author | Dominic Pinkman <dominic.pinkman@nokia.com> |
Wed, 16 Jun 2010 10:24:13 +0100 | |
changeset 10 | d4524d6a4472 |
parent 9 | 59758314f811 |
child 11 | 5072524fcc79 |
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_p_i_p_s_2antiword_2group_2_bld_8inf_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/group/bld.inf Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/group/bld.inf</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment">* ==============================================================================</span> -<a name="l00003"></a>00003 <span class="comment">* Name : Bld.inf</span> -<a name="l00004"></a>00004 <span class="comment">* Part of : Open C / antiword</span> -<a name="l00005"></a>00005 <span class="comment">* Interface : </span> -<a name="l00006"></a>00006 <span class="comment">* Description : Word document conversion project</span> -<a name="l00007"></a>00007 <span class="comment">* Version : </span> -<a name="l00008"></a>00008 <span class="comment">*</span> -<a name="l00009"></a>00009 <span class="comment">* Copyright (c) 2005-2007 Nokia Corporation.</span> -<a name="l00010"></a>00010 <span class="comment">* This material, including documentation and any related </span> -<a name="l00011"></a>00011 <span class="comment">* computer programs, is protected by copyright controlled by </span> -<a name="l00012"></a>00012 <span class="comment">* Nokia Corporation.</span> -<a name="l00013"></a>00013 <span class="comment">* ==============================================================================</span> -<a name="l00014"></a>00014 <span class="comment">*/</span> -<a name="l00015"></a>00015 PRJ_PLATFORMS -<a name="l00016"></a>00016 WINSCW -<a name="l00017"></a>00017 ARMV5 -<a name="l00018"></a>00018 GCCE -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 PRJ_MMPFILES -<a name="l00021"></a>00021 antiword.mmp -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 PRJ_EXPORTS -<a name="l00025"></a>00025 ..\data\Resources\8859-1.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-1.txt -<a name="l00026"></a>00026 ..\data\Resources\8859-10.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-10.txt -<a name="l00027"></a>00027 ..\data\Resources\8859-11.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-11.txt -<a name="l00028"></a>00028 ..\data\Resources\8859-13.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-13.txt -<a name="l00029"></a>00029 ..\data\Resources\8859-14.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-14.txt -<a name="l00030"></a>00030 ..\data\Resources\8859-15.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-15.txt -<a name="l00031"></a>00031 ..\data\Resources\8859-16.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-16.txt -<a name="l00032"></a>00032 ..\data\Resources\8859-2.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-2.txt -<a name="l00033"></a>00033 ..\data\Resources\8859-3.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-3.txt -<a name="l00034"></a>00034 ..\data\Resources\8859-4.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-4.txt -<a name="l00035"></a>00035 ..\data\Resources\8859-5.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-5.txt -<a name="l00036"></a>00036 ..\data\Resources\8859-6.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-6.txt -<a name="l00037"></a>00037 ..\data\Resources\8859-7.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-7.txt -<a name="l00038"></a>00038 ..\data\Resources\8859-8.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-8.txt -<a name="l00039"></a>00039 ..\data\Resources\8859-9.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\8859-9.txt -<a name="l00040"></a>00040 ..\data\Resources\cp1250.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp1250.txt -<a name="l00041"></a>00041 ..\data\Resources\cp1251.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp1251.txt -<a name="l00042"></a>00042 ..\data\Resources\cp1252.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp1252.txt -<a name="l00043"></a>00043 ..\data\Resources\cp437.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp437.txt -<a name="l00044"></a>00044 ..\data\Resources\cp850.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp850.txt -<a name="l00045"></a>00045 ..\data\Resources\cp852.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp852.txt -<a name="l00046"></a>00046 ..\data\Resources\cp862.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp862.txt -<a name="l00047"></a>00047 ..\data\Resources\cp864.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp864.txt -<a name="l00048"></a>00048 ..\data\Resources\cp866.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\cp866.txt -<a name="l00049"></a>00049 ..\data\Resources\Default \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\Default -<a name="l00050"></a>00050 ..\data\Resources\Example \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\Example -<a name="l00051"></a>00051 ..\data\Resources\fontnames \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\fontnames -<a name="l00052"></a>00052 ..\data\Resources\fontnames.russian \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\fontnames.russian -<a name="l00053"></a>00053 ..\data\Resources\koi8-r.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\koi8-r.txt -<a name="l00054"></a>00054 ..\data\Resources\koi8-u.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\koi8-u.txt -<a name="l00055"></a>00055 ..\data\Resources\MacCyrillic.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\MacCrillic.txt -<a name="l00056"></a>00056 ..\data\Resources\MacRoman.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\MacRoman.txt -<a name="l00057"></a>00057 ..\data\Resources\roman.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\roman.txt -<a name="l00058"></a>00058 ..\data\Resources\Unicode01 \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\Unicode01 -<a name="l00059"></a>00059 ..\data\Resources\Unicode15 \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\Unicode15 -<a name="l00060"></a>00060 ..\data\Resources\UTF-8.txt \epoc32\winscw\c\<span class="keyword">private</span>\A0001323\Resources\UTF-8.txt -<a name="l00061"></a>00061 -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 <span class="comment">//sample data file</span> -<a name="l00064"></a>00064 ..\data\sample.doc \epoc32\winscw\c\sample.doc -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/_p_i_p_s_2antiword_2sis_2backup__registration_8xml_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/sis/backup_registration.xml Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/sis/backup_registration.xml</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?xml version=<span class="stringliteral">"1.0"</span> standalone=<span class="stringliteral">"yes"</span>?> -<a name="l00002"></a>00002 <backup_registration> -<a name="l00003"></a>00003 <system_backup/> -<a name="l00004"></a>00004 <restore requires_reboot = <span class="stringliteral">"no"</span>/> -<a name="l00005"></a>00005 </backup_registration> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/antiword_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,753 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/antiword.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/antiword.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * antiword.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Generic include file for project 'Antiword'</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__antiword_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __antiword_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="preprocessor">#if defined(DEBUG) == defined(NDEBUG)</span> -<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#error Exactly one of the DEBUG and NDEBUG flags MUST be set</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG == NDEBUG */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#include <stdio.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include <limits.h></span> -<a name="l00018"></a>00018 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include "DeskLib:Font.h"</span> -<a name="l00020"></a>00020 <span class="preprocessor">#include "DeskLib:Wimp.h"</span> -<a name="l00021"></a>00021 <span class="preprocessor">#include "Desklib:Window.h"</span> -<a name="l00022"></a>00022 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00023"></a>00023 <span class="preprocessor">#define window_ANY event_ANY</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define icon_ANY event_ANY</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include <sys/types.h></span> -<a name="l00027"></a>00027 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00028"></a>00028 <span class="preprocessor">#include "wordconst.h"</span> -<a name="l00029"></a>00029 <span class="preprocessor">#include "wordtypes.h"</span> -<a name="l00030"></a>00030 <span class="preprocessor">#include "fail.h"</span> -<a name="l00031"></a>00031 <span class="preprocessor">#include "debug.h"</span> -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Constants */</span> -<a name="l00034"></a>00034 <span class="preprocessor">#if !defined(PATH_MAX)</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor"> #if defined(__riscos)</span> -<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor"> #define PATH_MAX 255</span> -<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor"> #else</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor"> #if defined(MAXPATHLEN)</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor"> #define PATH_MAX MAXPATHLEN</span> -<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor"> #else</span> -<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor"> #define PATH_MAX 255</span> -<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor"> #endif </span><span class="comment">/* MAXPATHLEN */</span> -<a name="l00043"></a>00043 <span class="preprocessor"> #endif </span><span class="comment">/* __riscos */</span> -<a name="l00044"></a>00044 <span class="preprocessor">#endif </span><span class="comment">/* !PATH_MAX */</span> -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="preprocessor">#if !defined(CHAR_BIT)</span> -<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define CHAR_BIT 8</span> -<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* CHAR_BIT */</span> -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 <span class="preprocessor">#if !defined(TIME_T_MIN)</span> -<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define TIME_T_MIN ((time_t)0 < (time_t)-1 ?\</span> -<a name="l00052"></a>00052 <span class="preprocessor"> (time_t)0 :\</span> -<a name="l00053"></a>00053 <span class="preprocessor"> (time_t)1 << (sizeof(time_t) * CHAR_BIT - 1))</span> -<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* TIMER_T_MIN */</span> -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 <span class="preprocessor">#if !defined(TIME_T_MAX)</span> -<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#if defined(__TURBOC__) </span><span class="comment">/* Turbo C chokes on the subtraction below */</span> -<a name="l00058"></a>00058 <span class="preprocessor">#define TIME_T_MAX (LONG_MAX)</span> -<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* All others */</span> -<a name="l00060"></a>00060 <span class="preprocessor">#define TIME_T_MAX (~(time_t)0 - TIME_T_MIN)</span> -<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __TURBOC__ */</span> -<a name="l00062"></a>00062 <span class="preprocessor">#endif </span><span class="comment">/* TIME_T_MAX */</span> -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 <span class="preprocessor">#if !defined(SIZE_T_MAX)</span> -<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#define SIZE_T_MAX (~(size_t)0)</span> -<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* SIZE_T_MAX */</span> -<a name="l00067"></a>00067 -<a name="l00068"></a>00068 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00069"></a>00069 <span class="preprocessor"></span><span class="preprocessor">#define FILE_SEPARATOR "."</span> -<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__dos) || defined(__CYGMING__)</span> -<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define FILE_SEPARATOR "\\"</span> -<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* All others */</span> -<a name="l00073"></a>00073 <span class="preprocessor">#define FILE_SEPARATOR "/"</span> -<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 <span class="comment">/* PNG chunk names */</span> -<a name="l00077"></a>00077 <span class="preprocessor">#define PNG_CN_IDAT 0x49444154</span> -<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define PNG_CN_IEND 0x49454e44</span> -<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define PNG_CN_IHDR 0x49484452</span> -<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define PNG_CN_PLTE 0x504c5445</span> -<a name="l00081"></a>00081 <span class="preprocessor"></span> -<a name="l00082"></a>00082 <span class="comment">/* The screen width */</span> -<a name="l00083"></a>00083 <span class="preprocessor">#define MIN_SCREEN_WIDTH 45</span> -<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_SCREEN_WIDTH 76</span> -<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define MAX_SCREEN_WIDTH 145</span> -<a name="l00086"></a>00086 <span class="preprocessor"></span> -<a name="l00087"></a>00087 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="comment">/* The scale factors as percentages */</span> -<a name="l00089"></a>00089 <span class="preprocessor">#define MIN_SCALE_FACTOR 25</span> -<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_SCALE_FACTOR 100</span> -<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define MAX_SCALE_FACTOR 400</span> -<a name="l00092"></a>00092 <span class="preprocessor"></span> -<a name="l00093"></a>00093 <span class="comment">/* Filetypes */</span> -<a name="l00094"></a>00094 <span class="preprocessor">#define FILETYPE_MSWORD 0xae6</span> -<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define FILETYPE_DRAW 0xaff</span> -<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define FILETYPE_JPEG 0xc85</span> -<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define FILETYPE_POSCRIPT 0xff5</span> -<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define FILETYPE_SPRITE 0xff9</span> -<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define FILETYPE_TEXT 0xfff</span> -<a name="l00100"></a>00100 <span class="preprocessor"></span> -<a name="l00101"></a>00101 <span class="comment">/* The button numbers in the choices window */</span> -<a name="l00102"></a>00102 <span class="preprocessor">#define CHOICES_DEFAULT_BUTTON 3</span> -<a name="l00103"></a>00103 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_SAVE_BUTTON 2</span> -<a name="l00104"></a>00104 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_CANCEL_BUTTON 1</span> -<a name="l00105"></a>00105 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_APPLY_BUTTON 0</span> -<a name="l00106"></a>00106 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_BREAK_BUTTON 6</span> -<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_BREAK_WRITEABLE 7</span> -<a name="l00108"></a>00108 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_BREAK_UP_BUTTON 8</span> -<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_BREAK_DOWN_BUTTON 9</span> -<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_NO_BREAK_BUTTON 11</span> -<a name="l00111"></a>00111 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_AUTOFILETYPE_BUTTON 14</span> -<a name="l00112"></a>00112 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_HIDDEN_TEXT_BUTTON 22</span> -<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_WITH_IMAGES_BUTTON 17</span> -<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_NO_IMAGES_BUTTON 18</span> -<a name="l00115"></a>00115 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_TEXTONLY_BUTTON 19</span> -<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_SCALE_WRITEABLE 25</span> -<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_SCALE_UP_BUTTON 26</span> -<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="preprocessor">#define CHOICES_SCALE_DOWN_BUTTON 27</span> -<a name="l00119"></a>00119 <span class="preprocessor"></span> -<a name="l00120"></a>00120 <span class="comment">/* The button numbers in the scale view window */</span> -<a name="l00121"></a>00121 <span class="preprocessor">#define SCALE_CANCEL_BUTTON 1</span> -<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_SCALE_BUTTON 0</span> -<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_SCALE_WRITEABLE 3</span> -<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_50_PCT 5</span> -<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_75_PCT 6</span> -<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_100_PCT 7</span> -<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_150_PCT 8</span> -<a name="l00128"></a>00128 <span class="preprocessor"></span> -<a name="l00129"></a>00129 <span class="comment">/* Save menu fields */</span> -<a name="l00130"></a>00130 <span class="preprocessor">#define SAVEMENU_SCALEVIEW 0</span> -<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define SAVEMENU_SAVEDRAW 1</span> -<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#define SAVEMENU_SAVETEXT 2</span> -<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="comment">/* Margins for the PostScript version */</span> -<a name="l00135"></a>00135 <span class="preprocessor">#define PS_LEFT_MARGIN (72 * 640L)</span> -<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor">#define PS_RIGHT_MARGIN (48 * 640L)</span> -<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">#define PS_TOP_MARGIN (72 * 640L)</span> -<a name="l00138"></a>00138 <span class="preprocessor"></span><span class="preprocessor">#define PS_BOTTOM_MARGIN (72 * 640L)</span> -<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 <span class="comment">/* Macros */</span> -<a name="l00142"></a>00142 <span class="preprocessor">#define STREQ(x,y) (*(x) == *(y) && strcmp(x,y) == 0)</span> -<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#define STRNEQ(x,y,n) (*(x) == *(y) && strncmp(x,y,n) == 0)</span> -<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor">#if defined(__dos) || defined(__EMX__)</span> -<a name="l00145"></a>00145 <span class="preprocessor"></span><span class="preprocessor">#define STRCEQ(x,y) (stricmp(x,y) == 0)</span> -<a name="l00146"></a>00146 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00147"></a>00147 <span class="preprocessor"></span><span class="preprocessor">#define STRCEQ(x,y) (strcasecmp(x,y) == 0)</span> -<a name="l00148"></a>00148 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __dos or __EMX__ */</span> -<a name="l00149"></a>00149 <span class="preprocessor">#define elementsof(a) (sizeof(a) / sizeof(a[0]))</span> -<a name="l00150"></a>00150 <span class="preprocessor"></span><span class="preprocessor">#define odd(x) (((x)&0x01)!=0)</span> -<a name="l00151"></a>00151 <span class="preprocessor"></span><span class="preprocessor">#define ROUND4(x) (((x)+3)&~0x03)</span> -<a name="l00152"></a>00152 <span class="preprocessor"></span><span class="preprocessor">#define ROUND128(x) (((x)+127)&~0x7f)</span> -<a name="l00153"></a>00153 <span class="preprocessor"></span><span class="preprocessor">#define BIT(x) (1UL << (x))</span> -<a name="l00154"></a>00154 <span class="preprocessor"></span><span class="preprocessor">#if !defined(max)</span> -<a name="l00155"></a>00155 <span class="preprocessor"></span><span class="preprocessor">#define max(x,y) ((x)>(y)?(x):(y))</span> -<a name="l00156"></a>00156 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !max */</span> -<a name="l00157"></a>00157 <span class="preprocessor">#if !defined(min)</span> -<a name="l00158"></a>00158 <span class="preprocessor"></span><span class="preprocessor">#define min(x,y) ((x)<(y)?(x):(y))</span> -<a name="l00159"></a>00159 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !min */</span> -<a name="l00160"></a>00160 -<a name="l00161"></a>00161 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00162"></a>00162 <span class="preprocessor"></span><span class="comment">/* The name of the table font */</span> -<a name="l00163"></a>00163 <span class="preprocessor">#define TABLE_FONT "Corpus.Medium"</span> -<a name="l00164"></a>00164 <span class="preprocessor"></span><span class="comment">/* Names of the default fonts */</span> -<a name="l00165"></a>00165 <span class="preprocessor">#define FONT_MONOSPACED_PLAIN "Corpus.Medium"</span> -<a name="l00166"></a>00166 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_BOLD "Corpus.Bold"</span> -<a name="l00167"></a>00167 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_ITALIC "Corpus.Medium.Oblique"</span> -<a name="l00168"></a>00168 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_BOLDITALIC "Corpus.Bold.Oblique"</span> -<a name="l00169"></a>00169 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_PLAIN "Trinity.Medium"</span> -<a name="l00170"></a>00170 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_BOLD "Trinity.Bold"</span> -<a name="l00171"></a>00171 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_ITALIC "Trinity.Medium.Italic"</span> -<a name="l00172"></a>00172 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_BOLDITALIC "Trinity.Bold.Italic"</span> -<a name="l00173"></a>00173 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_PLAIN "Homerton.Medium"</span> -<a name="l00174"></a>00174 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_BOLD "Homerton.Bold"</span> -<a name="l00175"></a>00175 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_ITALIC "Homerton.Medium.Oblique"</span> -<a name="l00176"></a>00176 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_BOLDITALIC "Homerton.Bold.Oblique"</span> -<a name="l00177"></a>00177 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00178"></a>00178 <span class="preprocessor"></span><span class="comment">/* The name of the table font */</span> -<a name="l00179"></a>00179 <span class="preprocessor">#define TABLE_FONT "Courier"</span> -<a name="l00180"></a>00180 <span class="preprocessor"></span><span class="comment">/* Names of the default fonts */</span> -<a name="l00181"></a>00181 <span class="preprocessor">#define FONT_MONOSPACED_PLAIN "Courier"</span> -<a name="l00182"></a>00182 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_BOLD "Courier-Bold"</span> -<a name="l00183"></a>00183 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_ITALIC "Courier-Oblique"</span> -<a name="l00184"></a>00184 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MONOSPACED_BOLDITALIC "Courier-BoldOblique"</span> -<a name="l00185"></a>00185 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_PLAIN "Times-Roman"</span> -<a name="l00186"></a>00186 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_BOLD "Times-Bold"</span> -<a name="l00187"></a>00187 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_ITALIC "Times-Italic"</span> -<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SERIF_BOLDITALIC "Times-BoldItalic"</span> -<a name="l00189"></a>00189 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_PLAIN "Helvetica"</span> -<a name="l00190"></a>00190 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_BOLD "Helvetica-Bold"</span> -<a name="l00191"></a>00191 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_ITALIC "Helvetica-Oblique"</span> -<a name="l00192"></a>00192 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SANS_SERIF_BOLDITALIC "Helvetica-BoldOblique"</span> -<a name="l00193"></a>00193 <span class="preprocessor"></span><span class="comment">/* The name of the antiword directories and the font information file */</span> -<a name="l00194"></a>00194 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00195"></a>00195 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "C:\\antiword"</span> -<a name="l00196"></a>00196 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "antiword"</span> -<a name="l00197"></a>00197 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontname.txt"</span> -<a name="l00198"></a>00198 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__amigaos)</span> -<a name="l00199"></a>00199 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "SYS:.antiword"</span> -<a name="l00200"></a>00200 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR ".antiword"</span> -<a name="l00201"></a>00201 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00202"></a>00202 <span class="preprocessor"></span><span class="preprocessor">#elif defined(N_PLAT_NLM)</span> -<a name="l00203"></a>00203 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "SYS:/antiword"</span> -<a name="l00204"></a>00204 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "antiword"</span> -<a name="l00205"></a>00205 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontname.txt"</span> -<a name="l00206"></a>00206 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__vms)</span> -<a name="l00207"></a>00207 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"</span> -<a name="l00208"></a>00208 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "antiword"</span> -<a name="l00209"></a>00209 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00210"></a>00210 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__BEOS__)</span> -<a name="l00211"></a>00211 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "/boot/home/config/apps/antiword"</span> -<a name="l00212"></a>00212 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "antiword"</span> -<a name="l00213"></a>00213 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00214"></a>00214 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__CYGMING__)</span> -<a name="l00215"></a>00215 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "C:\\antiword"</span> -<a name="l00216"></a>00216 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "antiword"</span> -<a name="l00217"></a>00217 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00218"></a>00218 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__Plan9__)</span> -<a name="l00219"></a>00219 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "/sys/lib/antiword"</span> -<a name="l00220"></a>00220 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR "lib/antiword"</span> -<a name="l00221"></a>00221 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00222"></a>00222 <span class="preprocessor"></span><span class="preprocessor">#elif defined(__sun__)</span> -<a name="l00223"></a>00223 <span class="preprocessor"></span><span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "/usr/local/share/antiword"</span> -<a name="l00224"></a>00224 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR</span> -<a name="l00225"></a>00225 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00226"></a>00226 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* All others */</span> -<a name="l00227"></a>00227 <span class="preprocessor">#define GLOBAL_ANTIWORD_DIR "/usr/share/antiword"</span> -<a name="l00228"></a>00228 <span class="preprocessor"></span><span class="preprocessor">#define ANTIWORD_DIR ".antiword"</span> -<a name="l00229"></a>00229 <span class="preprocessor"></span><span class="preprocessor">#define FONTNAMES_FILE "fontnames"</span> -<a name="l00230"></a>00230 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00231"></a>00231 <span class="comment">/* The names of grouped mapping files */</span> -<a name="l00232"></a>00232 <span class="comment">/* ASCII */</span> -<a name="l00233"></a>00233 <span class="preprocessor">#define MAPPING_FILE_CP437 "cp437.txt"</span> -<a name="l00234"></a>00234 <span class="preprocessor"></span> <span class="comment">/* Latin1 */</span> -<a name="l00235"></a>00235 <span class="preprocessor">#define MAPPING_FILE_8859_1 "8859-1.txt"</span> -<a name="l00236"></a>00236 <span class="preprocessor"></span> <span class="comment">/* Latin2 */</span> -<a name="l00237"></a>00237 <span class="preprocessor">#define MAPPING_FILE_8859_2 "8859-2.txt"</span> -<a name="l00238"></a>00238 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_CP852 "cp852.txt"</span> -<a name="l00239"></a>00239 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_CP1250 "cp1250.txt"</span> -<a name="l00240"></a>00240 <span class="preprocessor"></span> <span class="comment">/* Cyrillic */</span> -<a name="l00241"></a>00241 <span class="preprocessor">#define MAPPING_FILE_8859_5 "8859-5.txt"</span> -<a name="l00242"></a>00242 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_KOI8_R "koi8-r.txt"</span> -<a name="l00243"></a>00243 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_KOI8_U "koi8-u.txt"</span> -<a name="l00244"></a>00244 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_CP866 "cp866.txt"</span> -<a name="l00245"></a>00245 <span class="preprocessor"></span><span class="preprocessor">#define MAPPING_FILE_CP1251 "cp1251.txt"</span> -<a name="l00246"></a>00246 <span class="preprocessor"></span> <span class="comment">/* Latin9 */</span> -<a name="l00247"></a>00247 <span class="preprocessor">#define MAPPING_FILE_8859_15 "8859-15.txt"</span> -<a name="l00248"></a>00248 <span class="preprocessor"></span> <span class="comment">/* UTF-8 */</span> -<a name="l00249"></a>00249 <span class="preprocessor">#define MAPPING_FILE_UTF_8 "UTF-8.txt"</span> -<a name="l00250"></a>00250 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00251"></a>00251 -<a name="l00252"></a>00252 <span class="comment">/* Prototypes */</span> -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 <span class="comment">/* asc85enc.c */</span> -<a name="l00255"></a>00255 <span class="keyword">extern</span> <span class="keywordtype">void</span> vASCII85EncodeByte(FILE *, <span class="keywordtype">int</span>); -<a name="l00256"></a>00256 <span class="keyword">extern</span> <span class="keywordtype">void</span> vASCII85EncodeArray(FILE *, FILE *, <span class="keywordtype">size_t</span>); -<a name="l00257"></a>00257 <span class="keyword">extern</span> <span class="keywordtype">void</span> vASCII85EncodeFile(FILE *, FILE *, <span class="keywordtype">size_t</span>); -<a name="l00258"></a>00258 <span class="comment">/* blocklist.c */</span> -<a name="l00259"></a>00259 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyTextBlockList(<span class="keywordtype">void</span>); -<a name="l00260"></a>00260 <span class="keyword">extern</span> BOOL bAdd2TextBlockList(<span class="keyword">const</span> text_block_type *); -<a name="l00261"></a>00261 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSplitBlockList(FILE *, ULONG, ULONG, ULONG, ULONG, ULONG, -<a name="l00262"></a>00262 ULONG, ULONG, ULONG, BOOL); -<a name="l00263"></a>00263 <span class="keyword">extern</span> BOOL bExistsHdrFtr(<span class="keywordtype">void</span>); -<a name="l00264"></a>00264 <span class="keyword">extern</span> BOOL bExistsTextBox(<span class="keywordtype">void</span>); -<a name="l00265"></a>00265 <span class="keyword">extern</span> BOOL bExistsHdrTextBox(<span class="keywordtype">void</span>); -<a name="l00266"></a>00266 <span class="keyword">extern</span> USHORT usNextChar(FILE *, list_id_enum, ULONG *, ULONG *, USHORT *); -<a name="l00267"></a>00267 <span class="keyword">extern</span> USHORT usToHdrFtrPosition(FILE *, ULONG); -<a name="l00268"></a>00268 <span class="keyword">extern</span> USHORT usToFootnotePosition(FILE *, ULONG); -<a name="l00269"></a>00269 <span class="keyword">extern</span> ULONG ulCharPos2FileOffsetX(ULONG, list_id_enum *); -<a name="l00270"></a>00270 <span class="keyword">extern</span> ULONG ulCharPos2FileOffset(ULONG); -<a name="l00271"></a>00271 <span class="keyword">extern</span> ULONG ulHdrFtrOffset2CharPos(ULONG); -<a name="l00272"></a>00272 <span class="keyword">extern</span> ULONG ulGetSeqNumber(ULONG); -<a name="l00273"></a>00273 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00274"></a>00274 <span class="preprocessor"></span><span class="keyword">extern</span> ULONG ulGetDocumentLength(<span class="keywordtype">void</span>); -<a name="l00275"></a>00275 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00276"></a>00276 <span class="comment">/* chartrans.c */</span> -<a name="l00277"></a>00277 <span class="keyword">extern</span> UCHAR ucGetBulletCharacter(conversion_type, encoding_type); -<a name="l00278"></a>00278 <span class="keyword">extern</span> UCHAR ucGetNbspCharacter(<span class="keywordtype">void</span>); -<a name="l00279"></a>00279 <span class="keyword">extern</span> BOOL bReadCharacterMappingTable(FILE *); -<a name="l00280"></a>00280 <span class="keyword">extern</span> ULONG ulTranslateCharacters(USHORT, ULONG, <span class="keywordtype">int</span>, conversion_type, -<a name="l00281"></a>00281 encoding_type, BOOL); -<a name="l00282"></a>00282 <span class="keyword">extern</span> ULONG ulToUpper(ULONG); -<a name="l00283"></a>00283 <span class="comment">/* datalist.c */</span> -<a name="l00284"></a>00284 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyDataBlockList(<span class="keywordtype">void</span>); -<a name="l00285"></a>00285 <span class="keyword">extern</span> BOOL bAdd2DataBlockList(<span class="keyword">const</span> data_block_type *); -<a name="l00286"></a>00286 <span class="keyword">extern</span> ULONG ulGetDataOffset(FILE *); -<a name="l00287"></a>00287 <span class="keyword">extern</span> BOOL bSetDataOffset(FILE *, ULONG); -<a name="l00288"></a>00288 <span class="keyword">extern</span> <span class="keywordtype">int</span> iNextByte(FILE *); -<a name="l00289"></a>00289 <span class="keyword">extern</span> USHORT usNextWord(FILE *); -<a name="l00290"></a>00290 <span class="keyword">extern</span> ULONG ulNextLong(FILE *); -<a name="l00291"></a>00291 <span class="keyword">extern</span> USHORT usNextWordBE(FILE *); -<a name="l00292"></a>00292 <span class="keyword">extern</span> ULONG ulNextLongBE(FILE *); -<a name="l00293"></a>00293 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tSkipBytes(FILE *, <span class="keywordtype">size_t</span>); -<a name="l00294"></a>00294 <span class="keyword">extern</span> ULONG ulDataPos2FileOffset(ULONG); -<a name="l00295"></a>00295 <span class="comment">/* depot.c */</span> -<a name="l00296"></a>00296 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroySmallBlockList(<span class="keywordtype">void</span>); -<a name="l00297"></a>00297 <span class="keyword">extern</span> BOOL bCreateSmallBlockList(ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00298"></a>00298 <span class="keyword">extern</span> ULONG ulDepotOffset(ULONG, <span class="keywordtype">size_t</span>); -<a name="l00299"></a>00299 <span class="comment">/* dib2eps & dib2sprt.c */</span> -<a name="l00300"></a>00300 <span class="keyword">extern</span> BOOL bTranslateDIB(diagram_type *, -<a name="l00301"></a>00301 FILE *, ULONG, <span class="keyword">const</span> imagedata_type *); -<a name="l00302"></a>00302 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00303"></a>00303 <span class="preprocessor"></span><span class="comment">/* dos.c */</span> -<a name="l00304"></a>00304 <span class="keyword">extern</span> <span class="keywordtype">int</span> iGetCodepage(<span class="keywordtype">void</span>); -<a name="l00305"></a>00305 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00306"></a>00306 <span class="comment">/* doclist.c */</span> -<a name="l00307"></a>00307 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyDocumentInfoList(<span class="keywordtype">void</span>); -<a name="l00308"></a>00308 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreateDocumentInfoList(<span class="keyword">const</span> document_block_type *); -<a name="l00309"></a>00309 <span class="keyword">extern</span> UCHAR ucGetDopHdrFtrSpecification(<span class="keywordtype">void</span>); -<a name="l00310"></a>00310 <span class="comment">/* draw.c & output.c */</span> -<a name="l00311"></a>00311 <span class="keyword">extern</span> BOOL bAddDummyImage(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00312"></a>00312 <span class="keyword">extern</span> diagram_type *pCreateDiagram(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, FILE *); -<a name="l00313"></a>00313 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrologue2(diagram_type *, <span class="keywordtype">int</span>); -<a name="l00314"></a>00314 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMove2NextLine(diagram_type *, drawfile_fontref, USHORT); -<a name="l00315"></a>00315 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstring2Diagram(diagram_type *, -<a name="l00316"></a>00316 <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>, UCHAR, USHORT, -<a name="l00317"></a>00317 drawfile_fontref, USHORT, USHORT); -<a name="l00318"></a>00318 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraph1(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00319"></a>00319 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraph2(diagram_type *); -<a name="l00320"></a>00320 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfParagraph(diagram_type *, drawfile_fontref, USHORT, <span class="keywordtype">long</span>); -<a name="l00321"></a>00321 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfPage(diagram_type *, <span class="keywordtype">long</span>, BOOL); -<a name="l00322"></a>00322 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetHeaders(diagram_type *, USHORT); -<a name="l00323"></a>00323 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfList(diagram_type *, UCHAR, BOOL); -<a name="l00324"></a>00324 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfList(diagram_type *); -<a name="l00325"></a>00325 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfListItem(diagram_type *, BOOL); -<a name="l00326"></a>00326 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfTable(diagram_type *); -<a name="l00327"></a>00327 <span class="keyword">extern</span> BOOL bAddTableRow(diagram_type *, <span class="keywordtype">char</span> **, <span class="keywordtype">int</span>, -<a name="l00328"></a>00328 <span class="keyword">const</span> <span class="keywordtype">short</span> *, UCHAR); -<a name="l00329"></a>00329 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00330"></a>00330 <span class="preprocessor"></span><span class="keyword">extern</span> BOOL bDestroyDiagram(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00331"></a>00331 <span class="preprocessor">#if 0</span> -<a name="l00332"></a>00332 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> vImage2Diagram(diagram_type *, <span class="keyword">const</span> imagedata_type *, -<a name="l00333"></a>00333 UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00334"></a>00334 <span class="preprocessor">#endif //0 </span> -<a name="l00335"></a>00335 <span class="preprocessor"></span><span class="keyword">extern</span> BOOL bVerifyDiagram(diagram_type *); -<a name="l00336"></a>00336 <span class="keyword">extern</span> <span class="keywordtype">void</span> vShowDiagram(diagram_type *); -<a name="l00337"></a>00337 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMainButtonClick(mouse_block *); -<a name="l00338"></a>00338 <span class="keyword">extern</span> BOOL bMainKeyPressed(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00339"></a>00339 <span class="keyword">extern</span> BOOL bMainEventHandler(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00340"></a>00340 <span class="keyword">extern</span> BOOL bRedrawMainWindow(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00341"></a>00341 <span class="keyword">extern</span> BOOL bScaleOpenAction(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00342"></a>00342 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetTitle(diagram_type *); -<a name="l00343"></a>00343 <span class="keyword">extern</span> <span class="keywordtype">void</span> vScaleButtonClick(mouse_block *, diagram_type *); -<a name="l00344"></a>00344 <span class="keyword">extern</span> BOOL bScaleKeyPressed(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00345"></a>00345 <span class="keyword">extern</span> BOOL bScaleEventHandler(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00346"></a>00346 <span class="preprocessor">#else</span> -<a name="l00347"></a>00347 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> vImagePrologue(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00348"></a>00348 <span class="keyword">extern</span> <span class="keywordtype">void</span> vImageEpilogue(diagram_type *); -<a name="l00349"></a>00349 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyDiagram(diagram_type *); -<a name="l00350"></a>00350 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00351"></a>00351 <span class="comment">/* finddata.c */</span> -<a name="l00352"></a>00352 <span class="keyword">extern</span> BOOL bAddDataBlocks(ULONG , ULONG, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00353"></a>00353 <span class="keyword">extern</span> BOOL bGet6DocumentData(FILE *, ULONG, -<a name="l00354"></a>00354 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00355"></a>00355 <span class="comment">/* findtext.c */</span> -<a name="l00356"></a>00356 <span class="keyword">extern</span> BOOL bAddTextBlocks(ULONG , ULONG, BOOL, -<a name="l00357"></a>00357 USHORT, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00358"></a>00358 <span class="keyword">extern</span> BOOL bGet6DocumentText(FILE *, BOOL, ULONG, -<a name="l00359"></a>00359 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00360"></a>00360 <span class="keyword">extern</span> BOOL bGet8DocumentText(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00361"></a>00361 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00362"></a>00362 <span class="keyword">const</span> UCHAR *); -<a name="l00363"></a>00363 <span class="comment">/* fmt_text.c */</span> -<a name="l00364"></a>00364 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrologueFMT(diagram_type *, <span class="keyword">const</span> options_type *); -<a name="l00365"></a>00365 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstringFMT(diagram_type *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>, -<a name="l00366"></a>00366 USHORT); -<a name="l00367"></a>00367 <span class="comment">/* fontlist.c */</span> -<a name="l00368"></a>00368 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyFontInfoList(<span class="keywordtype">void</span>); -<a name="l00369"></a>00369 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCorrectFontValues(font_block_type *); -<a name="l00370"></a>00370 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2FontInfoList(<span class="keyword">const</span> font_block_type *); -<a name="l00371"></a>00371 <span class="keyword">extern</span> <span class="keyword">const</span> font_block_type *pGetNextFontInfoListItem( -<a name="l00372"></a>00372 <span class="keyword">const</span> font_block_type *); -<a name="l00373"></a>00373 <span class="comment">/* fonts.c */</span> -<a name="l00374"></a>00374 <span class="keyword">extern</span> <span class="keywordtype">int</span> iGetFontByNumber(UCHAR, USHORT); -<a name="l00375"></a>00375 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetOurFontname(<span class="keywordtype">int</span>); -<a name="l00376"></a>00376 <span class="keyword">extern</span> <span class="keywordtype">int</span> iFontname2Fontnumber(<span class="keyword">const</span> <span class="keywordtype">char</span> *, USHORT); -<a name="l00377"></a>00377 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreate0FontTable(<span class="keywordtype">void</span>); -<a name="l00378"></a>00378 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreate2FontTable(FILE *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00379"></a>00379 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreate6FontTable(FILE *, ULONG, -<a name="l00380"></a>00380 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00381"></a>00381 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreate8FontTable(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00382"></a>00382 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00383"></a>00383 <span class="keyword">const</span> UCHAR *); -<a name="l00384"></a>00384 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyFontTable(<span class="keywordtype">void</span>); -<a name="l00385"></a>00385 <span class="keyword">extern</span> <span class="keyword">const</span> font_table_type *pGetNextFontTableRecord( -<a name="l00386"></a>00386 <span class="keyword">const</span> font_table_type *); -<a name="l00387"></a>00387 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tGetFontTableLength(<span class="keywordtype">void</span>); -<a name="l00388"></a>00388 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCorrectFontTable(conversion_type, encoding_type); -<a name="l00389"></a>00389 <span class="keyword">extern</span> <span class="keywordtype">long</span> lComputeSpaceWidth(drawfile_fontref, USHORT); -<a name="l00390"></a>00390 <span class="comment">/* fonts_r.c & fonts_u.c */</span> -<a name="l00391"></a>00391 <span class="keyword">extern</span> FILE *pOpenFontTableFile(<span class="keywordtype">void</span>); -<a name="l00392"></a>00392 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCloseFont(<span class="keywordtype">void</span>); -<a name="l00393"></a>00393 <span class="keyword">extern</span> drawfile_fontref tOpenFont(UCHAR, USHORT, USHORT); -<a name="l00394"></a>00394 <span class="keyword">extern</span> drawfile_fontref tOpenTableFont(USHORT); -<a name="l00395"></a>00395 <span class="keyword">extern</span> <span class="keywordtype">long</span> lComputeStringWidth(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, drawfile_fontref, USHORT); -<a name="l00396"></a>00396 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tCountColumns(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>); -<a name="l00397"></a>00397 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tGetCharacterLength(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00398"></a>00398 <span class="comment">/* fonts_u.c */</span> -<a name="l00399"></a>00399 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00400"></a>00400 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetFontname(drawfile_fontref); -<a name="l00401"></a>00401 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00402"></a>00402 <span class="comment">/* hdrftrlist.c */</span> -<a name="l00403"></a>00403 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyHdrFtrInfoList(<span class="keywordtype">void</span>); -<a name="l00404"></a>00404 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreat8HdrFtrInfoList(<span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00405"></a>00405 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreat6HdrFtrInfoList(<span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00406"></a>00406 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreat2HdrFtrInfoList(<span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>); -<a name="l00407"></a>00407 <span class="keyword">extern</span> <span class="keyword">const</span> hdrftr_block_type *pGetHdrFtrInfo(<span class="keywordtype">int</span>, BOOL, BOOL, BOOL); -<a name="l00408"></a>00408 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrepareHdrFtrText(FILE *); -<a name="l00409"></a>00409 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00410"></a>00410 <span class="preprocessor"></span><span class="comment">/* icons.c */</span> -<a name="l00411"></a>00411 <span class="keyword">extern</span> <span class="keywordtype">void</span> vUpdateIcon(window_handle, icon_block *); -<a name="l00412"></a>00412 <span class="keyword">extern</span> <span class="keywordtype">void</span> vUpdateRadioButton(window_handle, icon_handle, BOOL); -<a name="l00413"></a>00413 <span class="keyword">extern</span> <span class="keywordtype">void</span> vUpdateWriteable(window_handle, icon_handle, <span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00414"></a>00414 <span class="keyword">extern</span> <span class="keywordtype">void</span> vUpdateWriteableNumber(window_handle, icon_handle, <span class="keywordtype">int</span>); -<a name="l00415"></a>00415 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00416"></a>00416 <span class="comment">/* imgexam.c */</span> -<a name="l00417"></a>00417 <span class="keyword">extern</span> image_info_enum eExamineImage(FILE *, ULONG, imagedata_type *); -<a name="l00418"></a>00418 <span class="comment">/* imgtrans */</span> -<a name="l00419"></a>00419 <span class="keyword">extern</span> BOOL bTranslateImage(diagram_type *, -<a name="l00420"></a>00420 FILE *, BOOL, ULONG, <span class="keyword">const</span> imagedata_type *); -<a name="l00421"></a>00421 <span class="comment">/* jpeg2eps.c & jpeg2spr.c */</span> -<a name="l00422"></a>00422 <span class="keyword">extern</span> BOOL bTranslateJPEG(diagram_type *, -<a name="l00423"></a>00423 FILE *, ULONG, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> imagedata_type *); -<a name="l00424"></a>00424 <span class="comment">/* listlist.c */</span> -<a name="l00425"></a>00425 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyListInfoList(<span class="keywordtype">void</span>); -<a name="l00426"></a>00426 <span class="keyword">extern</span> <span class="keywordtype">void</span> vBuildLfoList(<span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00427"></a>00427 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2ListInfoList(ULONG, USHORT, UCHAR, -<a name="l00428"></a>00428 <span class="keyword">const</span> list_block_type *); -<a name="l00429"></a>00429 <span class="keyword">extern</span> <span class="keyword">const</span> list_block_type *pGetListInfo(USHORT, UCHAR); -<a name="l00430"></a>00430 <span class="keyword">extern</span> USHORT usGetListValue(<span class="keywordtype">int</span>, <span class="keywordtype">int</span>, <span class="keyword">const</span> style_block_type *); -<a name="l00431"></a>00431 <span class="comment">/* misc.c */</span> -<a name="l00432"></a>00432 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00433"></a>00433 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetHomeDirectory(<span class="keywordtype">void</span>); -<a name="l00434"></a>00434 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetAntiwordDirectory(<span class="keywordtype">void</span>); -<a name="l00435"></a>00435 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00436"></a>00436 <span class="keyword">extern</span> <span class="keywordtype">long</span> lGetFilesize(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00437"></a>00437 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00438"></a>00438 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> vPrintBlock(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00439"></a>00439 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrintUnicode(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00440"></a>00440 <span class="keyword">extern</span> BOOL bCheckDoubleLinkedList(output_type *); -<a name="l00441"></a>00441 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00442"></a>00442 <span class="keyword">extern</span> BOOL bReadBytes(UCHAR *, <span class="keywordtype">size_t</span>, ULONG, FILE *); -<a name="l00443"></a>00443 <span class="keyword">extern</span> BOOL bReadBuffer(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>, -<a name="l00444"></a>00444 UCHAR *, ULONG, <span class="keywordtype">size_t</span>); -<a name="l00445"></a>00445 <span class="keyword">extern</span> ULONG ulColor2Color(UCHAR); -<a name="l00446"></a>00446 <span class="keyword">extern</span> output_type *pSplitList(output_type *); -<a name="l00447"></a>00447 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tNumber2Roman(UINT, BOOL, <span class="keywordtype">char</span> *); -<a name="l00448"></a>00448 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tNumber2Alpha(UINT, BOOL, <span class="keywordtype">char</span> *); -<a name="l00449"></a>00449 <span class="keyword">extern</span> <span class="keywordtype">char</span> *unincpy(<span class="keywordtype">char</span> *, <span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00450"></a>00450 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> unilen(<span class="keyword">const</span> UCHAR *); -<a name="l00451"></a>00451 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szBasename(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00452"></a>00452 <span class="keyword">extern</span> <span class="keywordtype">long</span> lComputeLeading(USHORT); -<a name="l00453"></a>00453 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tUcs2Utf8(ULONG, <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>); -<a name="l00454"></a>00454 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGetBulletValue(conversion_type, encoding_type, <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>); -<a name="l00455"></a>00455 <span class="keyword">extern</span> BOOL bAllZero(<span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00456"></a>00456 <span class="keyword">extern</span> BOOL bGetNormalizedCodeset(<span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, BOOL *); -<a name="l00457"></a>00457 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetDefaultMappingFile(<span class="keywordtype">void</span>); -<a name="l00458"></a>00458 <span class="keyword">extern</span> time_t tConvertDTTM(ULONG); -<a name="l00459"></a>00459 <span class="comment">/* notes.c */</span> -<a name="l00460"></a>00460 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyNotesInfoLists(<span class="keywordtype">void</span>); -<a name="l00461"></a>00461 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGetNotesInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00462"></a>00462 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00463"></a>00463 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>); -<a name="l00464"></a>00464 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrepareFootnoteText(FILE *); -<a name="l00465"></a>00465 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetFootnootText(UINT); -<a name="l00466"></a>00466 <span class="keyword">extern</span> notetype_enum eGetNotetype(ULONG); -<a name="l00467"></a>00467 <span class="comment">/* options.c */</span> -<a name="l00468"></a>00468 <span class="keyword">extern</span> <span class="keywordtype">int</span> iReadOptions(<span class="keywordtype">int</span>, <span class="keywordtype">char</span> **); -<a name="l00469"></a>00469 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGetOptions(options_type *); -<a name="l00470"></a>00470 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00471"></a>00471 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> vChoicesOpenAction(window_handle); -<a name="l00472"></a>00472 <span class="keyword">extern</span> BOOL bChoicesMouseClick(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00473"></a>00473 <span class="keyword">extern</span> BOOL bChoicesKeyPressed(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00474"></a>00474 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00475"></a>00475 <span class="comment">/* out2window.c */</span> -<a name="l00476"></a>00476 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetLeftIndentation(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00477"></a>00477 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAlign2Window(diagram_type *, output_type *, -<a name="l00478"></a>00478 <span class="keywordtype">long</span>, UCHAR); -<a name="l00479"></a>00479 <span class="keyword">extern</span> <span class="keywordtype">void</span> vJustify2Window(diagram_type *, output_type *, -<a name="l00480"></a>00480 <span class="keywordtype">long</span>, <span class="keywordtype">long</span>, UCHAR); -<a name="l00481"></a>00481 <span class="keyword">extern</span> <span class="keywordtype">void</span> vResetStyles(<span class="keywordtype">void</span>); -<a name="l00482"></a>00482 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tStyle2Window(<span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> style_block_type *, -<a name="l00483"></a>00483 <span class="keyword">const</span> section_block_type *); -<a name="l00484"></a>00484 <span class="keyword">extern</span> <span class="keywordtype">void</span> vTableRow2Window(diagram_type *, output_type *, -<a name="l00485"></a>00485 <span class="keyword">const</span> row_block_type *, conversion_type, <span class="keywordtype">int</span>); -<a name="l00486"></a>00486 <span class="comment">/* pdf.c */</span> -<a name="l00487"></a>00487 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreateInfoDictionary(diagram_type *, <span class="keywordtype">int</span>); -<a name="l00488"></a>00488 <span class="keyword">extern</span> <span class="keywordtype">void</span> vProloguePDF(diagram_type *, -<a name="l00489"></a>00489 <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> options_type *); -<a name="l00490"></a>00490 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEpiloguePDF(diagram_type *); -<a name="l00491"></a>00491 <span class="keyword">extern</span> <span class="keywordtype">void</span> vImageProloguePDF(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00492"></a>00492 <span class="keyword">extern</span> <span class="keywordtype">void</span> vImageEpiloguePDF(diagram_type *); -<a name="l00493"></a>00493 <span class="keyword">extern</span> BOOL bAddDummyImagePDF(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00494"></a>00494 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAddFontsPDF(diagram_type *); -<a name="l00495"></a>00495 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMove2NextLinePDF(diagram_type *, USHORT); -<a name="l00496"></a>00496 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstringPDF(diagram_type *, -<a name="l00497"></a>00497 <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>, UCHAR, USHORT, -<a name="l00498"></a>00498 drawfile_fontref, USHORT, USHORT); -<a name="l00499"></a>00499 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraphPDF(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00500"></a>00500 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfParagraphPDF(diagram_type *, USHORT, <span class="keywordtype">long</span>); -<a name="l00501"></a>00501 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfPagePDF(diagram_type *, BOOL); -<a name="l00502"></a>00502 <span class="comment">/* pictlist.c */</span> -<a name="l00503"></a>00503 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyPictInfoList(<span class="keywordtype">void</span>); -<a name="l00504"></a>00504 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2PictInfoList(<span class="keyword">const</span> picture_block_type *); -<a name="l00505"></a>00505 <span class="keyword">extern</span> ULONG ulGetPictInfoListItem(ULONG); -<a name="l00506"></a>00506 <span class="comment">/* png2eps.c & png2spr.c */</span> -<a name="l00507"></a>00507 <span class="keyword">extern</span> BOOL bTranslatePNG(diagram_type *, -<a name="l00508"></a>00508 FILE *, ULONG, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> imagedata_type *); -<a name="l00509"></a>00509 <span class="comment">/* postscript.c */</span> -<a name="l00510"></a>00510 <span class="keyword">extern</span> <span class="keywordtype">void</span> vProloguePS(diagram_type *, -<a name="l00511"></a>00511 <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> options_type *); -<a name="l00512"></a>00512 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEpiloguePS(diagram_type *); -<a name="l00513"></a>00513 <span class="keyword">extern</span> <span class="keywordtype">void</span> vImageProloguePS(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00514"></a>00514 <span class="keyword">extern</span> <span class="keywordtype">void</span> vImageEpiloguePS(diagram_type *); -<a name="l00515"></a>00515 <span class="keyword">extern</span> BOOL bAddDummyImagePS(diagram_type *, <span class="keyword">const</span> imagedata_type *); -<a name="l00516"></a>00516 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAddFontsPS(diagram_type *); -<a name="l00517"></a>00517 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMove2NextLinePS(diagram_type *, USHORT); -<a name="l00518"></a>00518 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstringPS(diagram_type *, -<a name="l00519"></a>00519 <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>, UCHAR, USHORT, -<a name="l00520"></a>00520 drawfile_fontref, USHORT, USHORT); -<a name="l00521"></a>00521 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraphPS(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00522"></a>00522 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfParagraphPS(diagram_type *, USHORT, <span class="keywordtype">long</span>); -<a name="l00523"></a>00523 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfPagePS(diagram_type *, BOOL); -<a name="l00524"></a>00524 <span class="comment">/* prop0.c */</span> -<a name="l00525"></a>00525 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet0DopInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00526"></a>00526 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet0SepInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00527"></a>00527 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet0PapInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00528"></a>00528 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet0ChrInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00529"></a>00529 <span class="comment">/* prop2.c */</span> -<a name="l00530"></a>00530 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2DopInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00531"></a>00531 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2SepInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00532"></a>00532 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2HdrFtrInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00533"></a>00533 <span class="keyword">extern</span> row_info_enum eGet2RowInfo(<span class="keywordtype">int</span>, -<a name="l00534"></a>00534 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, row_block_type *); -<a name="l00535"></a>00535 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2StyleInfo(<span class="keywordtype">int</span>, -<a name="l00536"></a>00536 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, style_block_type *); -<a name="l00537"></a>00537 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2PapInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00538"></a>00538 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet1FontInfo(<span class="keywordtype">int</span>, -<a name="l00539"></a>00539 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>, font_block_type *); -<a name="l00540"></a>00540 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2FontInfo(<span class="keywordtype">int</span>, -<a name="l00541"></a>00541 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">size_t</span>, font_block_type *); -<a name="l00542"></a>00542 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2ChrInfo(FILE *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00543"></a>00543 <span class="comment">/* prop6.c */</span> -<a name="l00544"></a>00544 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6DopInfo(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00545"></a>00545 <span class="keyword">const</span> UCHAR *); -<a name="l00546"></a>00546 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6SepInfo(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00547"></a>00547 <span class="keyword">const</span> UCHAR *); -<a name="l00548"></a>00548 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6HdrFtrInfo(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00549"></a>00549 <span class="keyword">const</span> UCHAR *); -<a name="l00550"></a>00550 <span class="keyword">extern</span> row_info_enum eGet6RowInfo(<span class="keywordtype">int</span>, -<a name="l00551"></a>00551 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, row_block_type *); -<a name="l00552"></a>00552 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6StyleInfo(<span class="keywordtype">int</span>, -<a name="l00553"></a>00553 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, style_block_type *); -<a name="l00554"></a>00554 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6PapInfo(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00555"></a>00555 <span class="keyword">const</span> UCHAR *); -<a name="l00556"></a>00556 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6FontInfo(<span class="keywordtype">int</span>, USHORT, -<a name="l00557"></a>00557 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, font_block_type *); -<a name="l00558"></a>00558 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6ChrInfo(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00559"></a>00559 <span class="keyword">const</span> UCHAR *); -<a name="l00560"></a>00560 <span class="comment">/* prop8.c */</span> -<a name="l00561"></a>00561 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8DopInfo(FILE *, <span class="keyword">const</span> pps_type *, -<a name="l00562"></a>00562 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00563"></a>00563 <span class="keyword">const</span> UCHAR *); -<a name="l00564"></a>00564 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8SepInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00565"></a>00565 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00566"></a>00566 <span class="keyword">const</span> UCHAR *); -<a name="l00567"></a>00567 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8HdrFtrInfo(FILE *, <span class="keyword">const</span> pps_type *, -<a name="l00568"></a>00568 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00569"></a>00569 <span class="keyword">const</span> UCHAR *); -<a name="l00570"></a>00570 <span class="keyword">extern</span> row_info_enum eGet8RowInfo(<span class="keywordtype">int</span>, -<a name="l00571"></a>00571 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, row_block_type *); -<a name="l00572"></a>00572 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8StyleInfo(<span class="keywordtype">int</span>, -<a name="l00573"></a>00573 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, style_block_type *); -<a name="l00574"></a>00574 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8LstInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00575"></a>00575 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00576"></a>00576 <span class="keyword">const</span> UCHAR *); -<a name="l00577"></a>00577 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8PapInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00578"></a>00578 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00579"></a>00579 <span class="keyword">const</span> UCHAR *); -<a name="l00580"></a>00580 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8FontInfo(<span class="keywordtype">int</span>, USHORT, -<a name="l00581"></a>00581 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>, font_block_type *); -<a name="l00582"></a>00582 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8ChrInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00583"></a>00583 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00584"></a>00584 <span class="keyword">const</span> UCHAR *); -<a name="l00585"></a>00585 <span class="comment">/* properties.c */</span> -<a name="l00586"></a>00586 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGetPropertyInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00587"></a>00587 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00588"></a>00588 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>); -<a name="l00589"></a>00589 <span class="keyword">extern</span> row_info_enum ePropMod2RowInfo(USHORT, <span class="keywordtype">int</span>); -<a name="l00590"></a>00590 <span class="comment">/* propmod.c */</span> -<a name="l00591"></a>00591 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyPropModList(<span class="keywordtype">void</span>); -<a name="l00592"></a>00592 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2PropModList(<span class="keyword">const</span> UCHAR *); -<a name="l00593"></a>00593 <span class="keyword">extern</span> <span class="keyword">const</span> UCHAR *aucReadPropModListItem(USHORT); -<a name="l00594"></a>00594 <span class="comment">/* rowlist.c */</span> -<a name="l00595"></a>00595 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyRowInfoList(<span class="keywordtype">void</span>); -<a name="l00596"></a>00596 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2RowInfoList(<span class="keyword">const</span> row_block_type *); -<a name="l00597"></a>00597 <span class="keyword">extern</span> <span class="keyword">const</span> row_block_type *pGetNextRowInfoListItem(<span class="keywordtype">void</span>); -<a name="l00598"></a>00598 <span class="comment">/* riscos.c */</span> -<a name="l00599"></a>00599 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00600"></a>00600 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">int</span> iGetFiletype(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00601"></a>00601 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetFiletype(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>); -<a name="l00602"></a>00602 <span class="keyword">extern</span> BOOL bMakeDirectory(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00603"></a>00603 <span class="keyword">extern</span> <span class="keywordtype">int</span> iReadCurrentAlphabetNumber(<span class="keywordtype">void</span>); -<a name="l00604"></a>00604 <span class="keyword">extern</span> <span class="keywordtype">int</span> iGetRiscOsVersion(<span class="keywordtype">void</span>); -<a name="l00605"></a>00605 <span class="keyword">extern</span> BOOL bDrawRenderDiag360(<span class="keywordtype">void</span> *, <span class="keywordtype">size_t</span>, -<a name="l00606"></a>00606 window_redrawblock *, <span class="keywordtype">double</span>, os_error *); -<a name="l00607"></a>00607 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00608"></a>00608 <span class="preprocessor"></span><span class="keyword">extern</span> BOOL bGetJpegInfo(UCHAR *, <span class="keywordtype">size_t</span>); -<a name="l00609"></a>00609 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00610"></a>00610 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00611"></a>00611 <span class="comment">/* saveas.c */</span> -<a name="l00612"></a>00612 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00613"></a>00613 <span class="preprocessor"></span><span class="keyword">extern</span> BOOL bSaveTextfile(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00614"></a>00614 <span class="keyword">extern</span> BOOL bSaveDrawfile(event_pollblock *, <span class="keywordtype">void</span> *); -<a name="l00615"></a>00615 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00616"></a>00616 <span class="comment">/* sectlist.c */</span> -<a name="l00617"></a>00617 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroySectionInfoList(<span class="keywordtype">void</span>); -<a name="l00618"></a>00618 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2SectionInfoList(<span class="keyword">const</span> section_block_type *, ULONG); -<a name="l00619"></a>00619 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGetDefaultSection(section_block_type *); -<a name="l00620"></a>00620 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDefault2SectionInfoList(ULONG); -<a name="l00621"></a>00621 <span class="keyword">extern</span> <span class="keyword">const</span> section_block_type * -<a name="l00622"></a>00622 pGetSectionInfo(<span class="keyword">const</span> section_block_type *, ULONG); -<a name="l00623"></a>00623 <span class="keyword">extern</span> <span class="keywordtype">size_t</span> tGetNumberOfSections(<span class="keywordtype">void</span>); -<a name="l00624"></a>00624 <span class="keyword">extern</span> UCHAR ucGetSepHdrFtrSpecification(<span class="keywordtype">size_t</span>); -<a name="l00625"></a>00625 <span class="comment">/* stylelist.c */</span> -<a name="l00626"></a>00626 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyStyleInfoList(<span class="keywordtype">void</span>); -<a name="l00627"></a>00627 <span class="keyword">extern</span> level_type_enum eGetNumType(UCHAR); -<a name="l00628"></a>00628 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCorrectStyleValues(style_block_type *); -<a name="l00629"></a>00629 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAdd2StyleInfoList(<span class="keyword">const</span> style_block_type *); -<a name="l00630"></a>00630 <span class="keyword">extern</span> <span class="keyword">const</span> style_block_type *pGetNextStyleInfoListItem( -<a name="l00631"></a>00631 <span class="keyword">const</span> style_block_type *); -<a name="l00632"></a>00632 <span class="keyword">extern</span> <span class="keyword">const</span> style_block_type *pGetNextTextStyle(<span class="keyword">const</span> style_block_type *); -<a name="l00633"></a>00633 <span class="keyword">extern</span> USHORT usGetIstd(ULONG); -<a name="l00634"></a>00634 <span class="keyword">extern</span> BOOL bStyleImpliesList(<span class="keyword">const</span> style_block_type *, <span class="keywordtype">int</span>); -<a name="l00635"></a>00635 <span class="comment">/* stylesheet.c */</span> -<a name="l00636"></a>00636 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroyStylesheetList(<span class="keywordtype">void</span>); -<a name="l00637"></a>00637 <span class="keyword">extern</span> USHORT usStc2istd(UCHAR); -<a name="l00638"></a>00638 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet2Stylesheet(FILE *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00639"></a>00639 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet6Stylesheet(FILE *, ULONG, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00640"></a>00640 <span class="keyword">const</span> UCHAR *); -<a name="l00641"></a>00641 <span class="keyword">extern</span> <span class="keywordtype">void</span> vGet8Stylesheet(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00642"></a>00642 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00643"></a>00643 <span class="keyword">const</span> UCHAR *); -<a name="l00644"></a>00644 <span class="keyword">extern</span> <span class="keywordtype">void</span> vFillStyleFromStylesheet(USHORT, style_block_type *); -<a name="l00645"></a>00645 <span class="keyword">extern</span> <span class="keywordtype">void</span> vFillFontFromStylesheet(USHORT, font_block_type *); -<a name="l00646"></a>00646 <span class="comment">/* summary.c */</span> -<a name="l00647"></a>00647 <span class="keyword">extern</span> <span class="keywordtype">void</span> vDestroySummaryInfo(<span class="keywordtype">void</span>); -<a name="l00648"></a>00648 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSet0SummaryInfo(FILE *, <span class="keyword">const</span> UCHAR *); -<a name="l00649"></a>00649 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSet2SummaryInfo(FILE *, <span class="keywordtype">int</span>, <span class="keyword">const</span> UCHAR *); -<a name="l00650"></a>00650 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSet6SummaryInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00651"></a>00651 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00652"></a>00652 <span class="keyword">const</span> UCHAR *); -<a name="l00653"></a>00653 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSet8SummaryInfo(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00654"></a>00654 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00655"></a>00655 <span class="keyword">const</span> UCHAR *); -<a name="l00656"></a>00656 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetTitle(<span class="keywordtype">void</span>); -<a name="l00657"></a>00657 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetSubject(<span class="keywordtype">void</span>); -<a name="l00658"></a>00658 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetAuthor(<span class="keywordtype">void</span>); -<a name="l00659"></a>00659 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetLastSaveDtm(<span class="keywordtype">void</span>); -<a name="l00660"></a>00660 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetModDate(<span class="keywordtype">void</span>); -<a name="l00661"></a>00661 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetCreationDate(<span class="keywordtype">void</span>); -<a name="l00662"></a>00662 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetCompany(<span class="keywordtype">void</span>); -<a name="l00663"></a>00663 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szGetLanguage(<span class="keywordtype">void</span>); -<a name="l00664"></a>00664 <span class="comment">/* tabstop.c */</span> -<a name="l00665"></a>00665 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetDefaultTabWidth(FILE *, <span class="keyword">const</span> pps_info_type *, -<a name="l00666"></a>00666 <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, <span class="keyword">const</span> ULONG *, <span class="keywordtype">size_t</span>, -<a name="l00667"></a>00667 <span class="keyword">const</span> UCHAR *, <span class="keywordtype">int</span>); -<a name="l00668"></a>00668 <span class="keyword">extern</span> <span class="keywordtype">long</span> lGetDefaultTabWidth(<span class="keywordtype">void</span>); -<a name="l00669"></a>00669 <span class="comment">/* text.c */</span> -<a name="l00670"></a>00670 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrologueTXT(diagram_type *, <span class="keyword">const</span> options_type *); -<a name="l00671"></a>00671 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEpilogueTXT(FILE *); -<a name="l00672"></a>00672 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMove2NextLineTXT(diagram_type *); -<a name="l00673"></a>00673 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstringTXT(diagram_type *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>); -<a name="l00674"></a>00674 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraphTXT(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00675"></a>00675 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfParagraphTXT(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00676"></a>00676 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfPageTXT(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00677"></a>00677 <span class="comment">/* unix.c */</span> -<a name="l00678"></a>00678 <span class="keyword">extern</span> <span class="keywordtype">void</span> werr(<span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> *, ...); -<a name="l00679"></a>00679 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00680"></a>00680 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">void</span> Hourglass_On(<span class="keywordtype">void</span>); -<a name="l00681"></a>00681 <span class="keyword">extern</span> <span class="keywordtype">void</span> Hourglass_Off(<span class="keywordtype">void</span>); -<a name="l00682"></a>00682 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00683"></a>00683 <span class="comment">/* utf8.c */</span> -<a name="l00684"></a>00684 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00685"></a>00685 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">long</span> utf8_strwidth(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>); -<a name="l00686"></a>00686 <span class="keyword">extern</span> <span class="keywordtype">int</span> utf8_chrlength(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00687"></a>00687 <span class="keyword">extern</span> BOOL is_locale_utf8(<span class="keywordtype">void</span>); -<a name="l00688"></a>00688 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00689"></a>00689 <span class="comment">/* word2text.c */</span> -<a name="l00690"></a>00690 <span class="keyword">extern</span> BOOL bOutputContainsText(<span class="keyword">const</span> output_type *); -<a name="l00691"></a>00691 <span class="keyword">extern</span> BOOL bWordDecryptor(FILE *, <span class="keywordtype">long</span>, diagram_type *); -<a name="l00692"></a>00692 <span class="keyword">extern</span> output_type *pHdrFtrDecryptor(FILE *, ULONG, ULONG); -<a name="l00693"></a>00693 <span class="keyword">extern</span> <span class="keywordtype">char</span> *szFootnoteDecryptor(FILE *, ULONG, ULONG); -<a name="l00694"></a>00694 <span class="comment">/* worddos.c */</span> -<a name="l00695"></a>00695 <span class="keyword">extern</span> <span class="keywordtype">int</span> iInitDocumentDOS(FILE *, <span class="keywordtype">long</span>); -<a name="l00696"></a>00696 <span class="comment">/* wordlib.c */</span> -<a name="l00697"></a>00697 <span class="keyword">extern</span> BOOL bIsWordForDosFile(FILE *, <span class="keywordtype">long</span>); -<a name="l00698"></a>00698 <span class="keyword">extern</span> BOOL bIsRtfFile(FILE *); -<a name="l00699"></a>00699 <span class="keyword">extern</span> BOOL bIsWordPerfectFile(FILE *); -<a name="l00700"></a>00700 <span class="keyword">extern</span> BOOL bIsWinWord12File(FILE *, <span class="keywordtype">long</span>); -<a name="l00701"></a>00701 <span class="keyword">extern</span> BOOL bIsMacWord45File(FILE *); -<a name="l00702"></a>00702 <span class="keyword">extern</span> <span class="keywordtype">int</span> iGuessVersionNumber(FILE *, <span class="keywordtype">long</span>); -<a name="l00703"></a>00703 <span class="keyword">extern</span> <span class="keywordtype">int</span> iGetVersionNumber(<span class="keyword">const</span> UCHAR *); -<a name="l00704"></a>00704 <span class="keyword">extern</span> BOOL bIsOldMacFile(<span class="keywordtype">void</span>); -<a name="l00705"></a>00705 <span class="keyword">extern</span> <span class="keywordtype">int</span> iInitDocument(FILE *, <span class="keywordtype">long</span>); -<a name="l00706"></a>00706 <span class="keyword">extern</span> <span class="keywordtype">void</span> vFreeDocument(<span class="keywordtype">void</span>); -<a name="l00707"></a>00707 <span class="comment">/* wordmac.c */</span> -<a name="l00708"></a>00708 <span class="keyword">extern</span> <span class="keywordtype">int</span> iInitDocumentMAC(FILE *, <span class="keywordtype">long</span>); -<a name="l00709"></a>00709 <span class="comment">/* wordole.c */</span> -<a name="l00710"></a>00710 <span class="keyword">extern</span> <span class="keywordtype">int</span> iInitDocumentOLE(FILE *, <span class="keywordtype">long</span>); -<a name="l00711"></a>00711 <span class="comment">/* wordwin.c */</span> -<a name="l00712"></a>00712 <span class="keyword">extern</span> <span class="keywordtype">int</span> iInitDocumentWIN(FILE *, <span class="keywordtype">long</span>); -<a name="l00713"></a>00713 <span class="comment">/* xmalloc.c */</span> -<a name="l00714"></a>00714 <span class="keyword">extern</span> <span class="keywordtype">void</span> *xmalloc(<span class="keywordtype">size_t</span>); -<a name="l00715"></a>00715 <span class="keyword">extern</span> <span class="keywordtype">void</span> *xcalloc(<span class="keywordtype">size_t</span>, <span class="keywordtype">size_t</span>); -<a name="l00716"></a>00716 <span class="keyword">extern</span> <span class="keywordtype">void</span> *xrealloc(<span class="keywordtype">void</span> *, <span class="keywordtype">size_t</span>); -<a name="l00717"></a>00717 <span class="keyword">extern</span> <span class="keywordtype">char</span> *xstrdup(<span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00718"></a>00718 <span class="keyword">extern</span> <span class="keywordtype">void</span> *xfree(<span class="keywordtype">void</span> *); -<a name="l00719"></a>00719 <span class="comment">/* xml.c */</span> -<a name="l00720"></a>00720 <span class="keyword">extern</span> <span class="keywordtype">void</span> vCreateBookIntro(diagram_type *, <span class="keywordtype">int</span>); -<a name="l00721"></a>00721 <span class="keyword">extern</span> <span class="keywordtype">void</span> vPrologueXML(diagram_type *, <span class="keyword">const</span> options_type *); -<a name="l00722"></a>00722 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEpilogueXML(diagram_type *); -<a name="l00723"></a>00723 <span class="keyword">extern</span> <span class="keywordtype">void</span> vMove2NextLineXML(diagram_type *); -<a name="l00724"></a>00724 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSubstringXML(diagram_type *, -<a name="l00725"></a>00725 <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>, <span class="keywordtype">long</span>, USHORT); -<a name="l00726"></a>00726 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfParagraphXML(diagram_type *, UINT); -<a name="l00727"></a>00727 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfParagraphXML(diagram_type *, UINT); -<a name="l00728"></a>00728 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfPageXML(diagram_type *); -<a name="l00729"></a>00729 <span class="keyword">extern</span> <span class="keywordtype">void</span> vSetHeadersXML(diagram_type *, USHORT); -<a name="l00730"></a>00730 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfListXML(diagram_type *, UCHAR, BOOL); -<a name="l00731"></a>00731 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfListXML(diagram_type *); -<a name="l00732"></a>00732 <span class="keyword">extern</span> <span class="keywordtype">void</span> vStartOfListItemXML(diagram_type *, BOOL); -<a name="l00733"></a>00733 <span class="keyword">extern</span> <span class="keywordtype">void</span> vEndOfTableXML(diagram_type *); -<a name="l00734"></a>00734 <span class="keyword">extern</span> <span class="keywordtype">void</span> vAddTableRowXML(diagram_type *, <span class="keywordtype">char</span> **, <span class="keywordtype">int</span>, -<a name="l00735"></a>00735 <span class="keyword">const</span> <span class="keywordtype">short</span> *, UCHAR); -<a name="l00736"></a>00736 -<a name="l00737"></a>00737 <span class="preprocessor">#endif </span><span class="comment">/* __antiword_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/antiword_8mmp_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/group/antiword.mmp Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/group/antiword.mmp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment">* ==============================================================================</span> -<a name="l00003"></a>00003 <span class="comment">* Name : antiword.mmp</span> -<a name="l00004"></a>00004 <span class="comment">* Part of : Open C / antiword</span> -<a name="l00005"></a>00005 <span class="comment">* Interface : </span> -<a name="l00006"></a>00006 <span class="comment">* Description : Word document conversion project</span> -<a name="l00007"></a>00007 <span class="comment">* Version : </span> -<a name="l00008"></a>00008 <span class="comment">*</span> -<a name="l00009"></a>00009 <span class="comment">* Copyright (c) 2005-2007 Nokia Corporation.</span> -<a name="l00010"></a>00010 <span class="comment">* This material, including documentation and any related </span> -<a name="l00011"></a>00011 <span class="comment">* computer programs, is protected by copyright controlled by </span> -<a name="l00012"></a>00012 <span class="comment">* Nokia Corporation.</span> -<a name="l00013"></a>00013 <span class="comment">* ==============================================================================</span> -<a name="l00014"></a>00014 <span class="comment">*/</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 TARGET antiword.exe -<a name="l00017"></a>00017 TARGETTYPE exe -<a name="l00018"></a>00018 UID 0x100039CE 0xA0001323 -<a name="l00019"></a>00019 VENDORID 0 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 SOURCEPATH ..\data -<a name="l00023"></a>00023 START RESOURCE antiword_reg.rss -<a name="l00024"></a>00024 <span class="preprocessor">#ifdef WINSCW</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span>TARGETPATH \<span class="keyword">private</span>\10003a3f\apps -<a name="l00026"></a>00026 <span class="preprocessor">#else</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span>TARGETPATH \<span class="keyword">private</span>\10003a3f\<span class="keyword">import</span>\apps -<a name="l00028"></a>00028 <span class="preprocessor">#endif</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span>END <span class="comment">//RESOURCE</span> -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 SOURCEPATH ..\src -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">//Sourcefile</span> -<a name="l00034"></a>00034 SOURCE asc85enc.c -<a name="l00035"></a>00035 SOURCE blocklist.c -<a name="l00036"></a>00036 SOURCE chartrans.c -<a name="l00037"></a>00037 SOURCE datalist.c -<a name="l00038"></a>00038 SOURCE depot.c -<a name="l00039"></a>00039 SOURCE dib2eps.c -<a name="l00040"></a>00040 SOURCE doclist.c -<a name="l00041"></a>00041 SOURCE fail.c -<a name="l00042"></a>00042 SOURCE finddata.c -<a name="l00043"></a>00043 SOURCE findtext.c -<a name="l00044"></a>00044 SOURCE fmt_text.c -<a name="l00045"></a>00045 SOURCE fontlist.c -<a name="l00046"></a>00046 SOURCE fonts.c -<a name="l00047"></a>00047 SOURCE fonts_u.c -<a name="l00048"></a>00048 SOURCE hdrftrlist.c -<a name="l00049"></a>00049 SOURCE imgexam.c -<a name="l00050"></a>00050 SOURCE imgtrans.c -<a name="l00051"></a>00051 SOURCE jpeg2eps.c -<a name="l00052"></a>00052 SOURCE listlist.c -<a name="l00053"></a>00053 SOURCE main_u.c -<a name="l00054"></a>00054 SOURCE misc.c -<a name="l00055"></a>00055 SOURCE notes.c -<a name="l00056"></a>00056 SOURCE options.c -<a name="l00057"></a>00057 SOURCE out2window.c -<a name="l00058"></a>00058 SOURCE output.c -<a name="l00059"></a>00059 SOURCE pdf.c -<a name="l00060"></a>00060 SOURCE pictlist.c -<a name="l00061"></a>00061 SOURCE png2eps.c -<a name="l00062"></a>00062 SOURCE png2sprt.c -<a name="l00063"></a>00063 SOURCE postscript.c -<a name="l00064"></a>00064 SOURCE prop0.c -<a name="l00065"></a>00065 SOURCE prop2.c -<a name="l00066"></a>00066 SOURCE prop6.c -<a name="l00067"></a>00067 SOURCE prop8.c -<a name="l00068"></a>00068 SOURCE properties.c -<a name="l00069"></a>00069 SOURCE propmod.c -<a name="l00070"></a>00070 SOURCE rowlist.c -<a name="l00071"></a>00071 SOURCE sectlist.c -<a name="l00072"></a>00072 SOURCE stylelist.c -<a name="l00073"></a>00073 SOURCE stylesheet.c -<a name="l00074"></a>00074 SOURCE summary.c -<a name="l00075"></a>00075 SOURCE tabstop.c -<a name="l00076"></a>00076 SOURCE text.c -<a name="l00077"></a>00077 SOURCE unix.c -<a name="l00078"></a>00078 SOURCE utf8.c -<a name="l00079"></a>00079 SOURCE word2text.c -<a name="l00080"></a>00080 SOURCE worddos.c -<a name="l00081"></a>00081 SOURCE wordlib.c -<a name="l00082"></a>00082 SOURCE wordmac.c -<a name="l00083"></a>00083 SOURCE wordole.c -<a name="l00084"></a>00084 SOURCE wordwin.c -<a name="l00085"></a>00085 SOURCE xmalloc.c -<a name="l00086"></a>00086 SOURCE xml.c -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="comment">// Some of the files removed</span> -<a name="l00089"></a>00089 <span class="comment">// sprite support is not present in openc</span> -<a name="l00090"></a>00090 <span class="comment">//SOURCE dib2sprt.c</span> -<a name="l00091"></a>00091 <span class="comment">//SOURCE draw.c</span> -<a name="l00092"></a>00092 <span class="comment">//SOURCE drawfile.c</span> -<a name="l00093"></a>00093 <span class="comment">//SOURCE fonts_r.c</span> -<a name="l00094"></a>00094 <span class="comment">//SOURCE icons.c</span> -<a name="l00095"></a>00095 <span class="comment">//SOURCE jpeg2sprt.c</span> -<a name="l00096"></a>00096 <span class="comment">//SOURCE main_ros.c</span> -<a name="l00097"></a>00097 <span class="comment">//SOURCE riscos.c</span> -<a name="l00098"></a>00098 <span class="comment">//SOURCE saveas.c</span> -<a name="l00099"></a>00099 <span class="comment">//SOURCE startup.c</span> -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 USERINCLUDE ..\inc -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 <span class="comment">//Project Specific Macro and reqmts.</span> -<a name="l00108"></a>00108 MACRO SYMBIAN -<a name="l00109"></a>00109 MACRO NDEBUG -<a name="l00110"></a>00110 epocheapsize 0x4000 0x8000 -<a name="l00111"></a>00111 epocstacksize 0x8000 -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 <span class="comment">//Standard System include paths</span> -<a name="l00114"></a>00114 SYSTEMINCLUDE \epoc32\include -<a name="l00115"></a>00115 <span class="comment">// These are needed for including Open C headers</span> -<a name="l00116"></a>00116 <span class="comment">// NOTE! When part of SDK, path will differ</span> -<a name="l00117"></a>00117 SYSTEMINCLUDE \epoc32\include\stdapis -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 STATICLIBRARY libcrt0.lib -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 LIBRARY euser.lib -<a name="l00122"></a>00122 LIBRARY libc.lib -<a name="l00123"></a>00123 -<a name="l00124"></a>00124 <span class="comment">// No capabilities needed by this application</span> -<a name="l00125"></a>00125 CAPABILITY None -<a name="l00126"></a>00126 -<a name="l00127"></a>00127 LANG SC -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/antiword__reg_8rss_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/data/antiword_reg.rss Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/data/antiword_reg.rss</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include <appinfo.rh></span> -<a name="l00002"></a>00002 -<a name="l00003"></a>00003 UID2 KUidAppRegistrationResourceFile -<a name="l00004"></a>00004 UID3 0xA0001323 -<a name="l00005"></a>00005 -<a name="l00006"></a>00006 RESOURCE APP_REGISTRATION_INFO -<a name="l00007"></a>00007 { -<a name="l00008"></a>00008 app_file=<span class="stringliteral">"Antiword"</span>; -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 embeddability=KAppNotEmbeddable; -<a name="l00011"></a>00011 newfile=KAppDoesNotSupportNewFile; -<a name="l00012"></a>00012 } -<a name="l00013"></a>00013 -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/asc85enc_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/asc85enc.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/asc85enc.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * asc85enc.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2003 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to for ASCII 85 encoding</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> *====================================================================</span> -<a name="l00009"></a>00009 <span class="comment"> * This part of the software is based on:</span> -<a name="l00010"></a>00010 <span class="comment"> * asc85ec.c - ASCII85 and Hex encoding for PostScript Level 2 and PDF</span> -<a name="l00011"></a>00011 <span class="comment"> * Copyright (C) 1994-99 Thomas Merz (tm@muc.de)</span> -<a name="l00012"></a>00012 <span class="comment"> *====================================================================</span> -<a name="l00013"></a>00013 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00014"></a>00014 <span class="comment"> */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#include <stdio.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 <span class="keyword">static</span> <span class="keyword">const</span> ULONG aulPower85[5] = { -<a name="l00020"></a>00020 1UL, 85UL, 85UL * 85, 85UL * 85 * 85, 85UL * 85 * 85 * 85, -<a name="l00021"></a>00021 }; -<a name="l00022"></a>00022 <span class="keyword">static</span> <span class="keywordtype">int</span> iOutBytes = 0; <span class="comment">/* Number of characters in an output line */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> <span class="keywordtype">char</span> cCharPrev = <span class="charliteral">'\0'</span>; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="comment">/*</span> -<a name="l00026"></a>00026 <span class="comment"> * Two percent characters at the start of a line will cause trouble</span> -<a name="l00027"></a>00027 <span class="comment"> * with some post-processing software. In order to avoid this, we</span> -<a name="l00028"></a>00028 <span class="comment"> * simply insert a line break if we encounter two percent characters</span> -<a name="l00029"></a>00029 <span class="comment"> * at the start of the line. Of course, this rather simplistic</span> -<a name="l00030"></a>00030 <span class="comment"> * algorithm may lead to a large line count in pathological cases,</span> -<a name="l00031"></a>00031 <span class="comment"> * but the chance for hitting such a case is very small, and even</span> -<a name="l00032"></a>00032 <span class="comment"> * so it's only a cosmetic flaw and not a functional restriction.</span> -<a name="l00033"></a>00033 <span class="comment"> */</span> -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 <span class="comment">/*</span> -<a name="l00036"></a>00036 <span class="comment"> * vOutputByte - output one byte</span> -<a name="l00037"></a>00037 <span class="comment"> */</span> -<a name="l00038"></a>00038 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00039"></a>00039 vOutputByte(ULONG ulChar, FILE *pOutFile) -<a name="l00040"></a>00040 { -<a name="l00041"></a>00041 <span class="keywordflow">if</span> (iOutBytes == 1 && cCharPrev == <span class="charliteral">'%'</span> && ulChar == (ULONG)<span class="charliteral">'%'</span>) { -<a name="l00042"></a>00042 <span class="keywordflow">if</span> (putc(<span class="charliteral">'\n'</span>, pOutFile) != EOF) { -<a name="l00043"></a>00043 iOutBytes = 0; -<a name="l00044"></a>00044 } -<a name="l00045"></a>00045 } -<a name="l00046"></a>00046 <span class="keywordflow">if</span> (putc((<span class="keywordtype">int</span>)ulChar, pOutFile) == EOF) { -<a name="l00047"></a>00047 <span class="keywordflow">return</span>; -<a name="l00048"></a>00048 } -<a name="l00049"></a>00049 iOutBytes++; -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (iOutBytes > 63) { -<a name="l00051"></a>00051 <span class="keywordflow">if</span> (putc(<span class="charliteral">'\n'</span>, pOutFile) != EOF) { -<a name="l00052"></a>00052 iOutBytes = 0; -<a name="l00053"></a>00053 } -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 cCharPrev = (char)ulChar; -<a name="l00056"></a>00056 } <span class="comment">/* end of vOutputByte */</span> -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/*</span> -<a name="l00059"></a>00059 <span class="comment"> * vASCII85EncodeByte - ASCII 85 encode a byte</span> -<a name="l00060"></a>00060 <span class="comment"> */</span> -<a name="l00061"></a>00061 <span class="keywordtype">void</span> -<a name="l00062"></a>00062 vASCII85EncodeByte(FILE *pOutFile, <span class="keywordtype">int</span> iByte) -<a name="l00063"></a>00063 { -<a name="l00064"></a>00064 <span class="keyword">static</span> ULONG ulBuffer[4] = { 0, 0, 0, 0 }; -<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">int</span> iInBuffer = 0; -<a name="l00066"></a>00066 ULONG ulValue, ulTmp; -<a name="l00067"></a>00067 <span class="keywordtype">int</span> iIndex; -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 fail(pOutFile == NULL); -<a name="l00070"></a>00070 fail(iInBuffer < 0); -<a name="l00071"></a>00071 fail(iInBuffer > 3); -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00074"></a>00074 <span class="comment">/* End Of File, time to clean up */</span> -<a name="l00075"></a>00075 <span class="keywordflow">if</span> (iInBuffer > 0 && iInBuffer < 4) { -<a name="l00076"></a>00076 <span class="comment">/* Encode the remaining bytes */</span> -<a name="l00077"></a>00077 ulValue = 0; -<a name="l00078"></a>00078 <span class="keywordflow">for</span> (iIndex = iInBuffer - 1; iIndex >= 0; iIndex--) { -<a name="l00079"></a>00079 ulValue |= -<a name="l00080"></a>00080 ulBuffer[iIndex] << (8 * (3 - iIndex)); -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 <span class="keywordflow">for</span> (iIndex = 4; iIndex >= 4 - iInBuffer; iIndex--) { -<a name="l00083"></a>00083 ulTmp = ulValue / aulPower85[iIndex]; -<a name="l00084"></a>00084 vOutputByte(ulTmp + <span class="charliteral">'!'</span>, pOutFile); -<a name="l00085"></a>00085 ulValue -= ulTmp * aulPower85[iIndex]; -<a name="l00086"></a>00086 } -<a name="l00087"></a>00087 } -<a name="l00088"></a>00088 <span class="comment">/* Add the End Of Data marker */</span> -<a name="l00089"></a>00089 (void)putc(<span class="charliteral">'~'</span>, pOutFile); -<a name="l00090"></a>00090 (void)putc(<span class="charliteral">'>'</span>, pOutFile); -<a name="l00091"></a>00091 (void)putc(<span class="charliteral">'\n'</span>, pOutFile); -<a name="l00092"></a>00092 <span class="comment">/* Reset the control variables */</span> -<a name="l00093"></a>00093 iInBuffer = 0; -<a name="l00094"></a>00094 iOutBytes = 0; -<a name="l00095"></a>00095 cCharPrev = <span class="charliteral">'\0'</span>; -<a name="l00096"></a>00096 <span class="keywordflow">return</span>; -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 ulBuffer[iInBuffer] = (ULONG)iByte & 0xff; -<a name="l00100"></a>00100 iInBuffer++; -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 <span class="keywordflow">if</span> (iInBuffer >= 4) { -<a name="l00103"></a>00103 ulValue = (ulBuffer[0] << 24) | (ulBuffer[1] << 16) | -<a name="l00104"></a>00104 (ulBuffer[2] << 8) | ulBuffer[3]; -<a name="l00105"></a>00105 <span class="keywordflow">if</span> (ulValue == 0) { -<a name="l00106"></a>00106 vOutputByte((ULONG)<span class="charliteral">'z'</span>, pOutFile); <span class="comment">/* Shortcut for 0 */</span> -<a name="l00107"></a>00107 } <span class="keywordflow">else</span> { -<a name="l00108"></a>00108 <span class="keywordflow">for</span> (iIndex = 4; iIndex >= 0; iIndex--) { -<a name="l00109"></a>00109 ulTmp = ulValue / aulPower85[iIndex]; -<a name="l00110"></a>00110 vOutputByte(ulTmp + <span class="charliteral">'!'</span>, pOutFile); -<a name="l00111"></a>00111 ulValue -= ulTmp * aulPower85[iIndex]; -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 <span class="comment">/* Reset the buffer */</span> -<a name="l00115"></a>00115 iInBuffer = 0; -<a name="l00116"></a>00116 } -<a name="l00117"></a>00117 } <span class="comment">/* end of vASCII85EncodeByte */</span> -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * vASCII85EncodeArray - ASCII 85 encode a byte array</span> -<a name="l00121"></a>00121 <span class="comment"> */</span> -<a name="l00122"></a>00122 <span class="keywordtype">void</span> -<a name="l00123"></a>00123 vASCII85EncodeArray(FILE *pInFile, FILE *pOutFile, <span class="keywordtype">size_t</span> tLength) -<a name="l00124"></a>00124 { -<a name="l00125"></a>00125 <span class="keywordtype">size_t</span> tCount; -<a name="l00126"></a>00126 <span class="keywordtype">int</span> iByte; -<a name="l00127"></a>00127 -<a name="l00128"></a>00128 fail(pInFile == NULL); -<a name="l00129"></a>00129 fail(pOutFile == NULL); -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 DBG_DEC(tLength); -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 <span class="keywordflow">for</span> (tCount = 0; tCount < tLength; tCount++) { -<a name="l00134"></a>00134 iByte = iNextByte(pInFile); -<a name="l00135"></a>00135 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00136"></a>00136 <span class="keywordflow">break</span>; -<a name="l00137"></a>00137 } -<a name="l00138"></a>00138 vASCII85EncodeByte(pOutFile, iByte); -<a name="l00139"></a>00139 } -<a name="l00140"></a>00140 } <span class="comment">/* end of vASCII85EncodeArray */</span> -<a name="l00141"></a>00141 -<a name="l00142"></a>00142 <span class="comment">/*</span> -<a name="l00143"></a>00143 <span class="comment"> * vASCII85EncodeFile - ASCII 85 encode part of a file</span> -<a name="l00144"></a>00144 <span class="comment"> */</span> -<a name="l00145"></a>00145 <span class="keywordtype">void</span> -<a name="l00146"></a>00146 vASCII85EncodeFile(FILE *pInFile, FILE *pOutFile, <span class="keywordtype">size_t</span> tLength) -<a name="l00147"></a>00147 { -<a name="l00148"></a>00148 fail(pInFile == NULL); -<a name="l00149"></a>00149 fail(pOutFile == NULL); -<a name="l00150"></a>00150 fail(tLength == 0); -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 vASCII85EncodeArray(pInFile, pOutFile, tLength); -<a name="l00153"></a>00153 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00154"></a>00154 } <span class="comment">/* end of vASCII85EncodeFile */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/blocklist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,839 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/blocklist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/blocklist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * blocklist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy the lists of Word "text" blocks</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/*</span> -<a name="l00014"></a>00014 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00015"></a>00015 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">typedef</span> <span class="keyword">struct </span>list_mem_tag { -<a name="l00018"></a>00018 text_block_type tInfo; -<a name="l00019"></a>00019 <span class="keyword">struct </span>list_mem_tag *pNext; -<a name="l00020"></a>00020 } list_mem_type; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="keyword">typedef</span> <span class="keyword">struct </span>readinfo_tag { -<a name="l00023"></a>00023 list_mem_type *pBlockCurrent; -<a name="l00024"></a>00024 ULONG ulBlockOffset; -<a name="l00025"></a>00025 <span class="keywordtype">size_t</span> tByteNext; -<a name="l00026"></a>00026 UCHAR aucBlock[BIG_BLOCK_SIZE]; -<a name="l00027"></a>00027 } readinfo_type; -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="comment">/* Variables to describe the start of the block lists */</span> -<a name="l00030"></a>00030 <span class="keyword">static</span> list_mem_type *pTextAnchor = NULL; -<a name="l00031"></a>00031 <span class="keyword">static</span> list_mem_type *pFootnoteAnchor = NULL; -<a name="l00032"></a>00032 <span class="keyword">static</span> list_mem_type *pHdrFtrAnchor = NULL; -<a name="l00033"></a>00033 <span class="keyword">static</span> list_mem_type *pMacroAnchor = NULL; -<a name="l00034"></a>00034 <span class="keyword">static</span> list_mem_type *pAnnotationAnchor = NULL; -<a name="l00035"></a>00035 <span class="keyword">static</span> list_mem_type *pEndnoteAnchor = NULL; -<a name="l00036"></a>00036 <span class="keyword">static</span> list_mem_type *pTextBoxAnchor = NULL; -<a name="l00037"></a>00037 <span class="keyword">static</span> list_mem_type *pHdrTextBoxAnchor = NULL; -<a name="l00038"></a>00038 <span class="comment">/* Variable needed to build the block list */</span> -<a name="l00039"></a>00039 <span class="keyword">static</span> list_mem_type *pBlockLast = NULL; -<a name="l00040"></a>00040 <span class="comment">/* Variable needed to read the block lists */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> readinfo_type tOthers = { NULL, 0, 0, }; -<a name="l00042"></a>00042 <span class="keyword">static</span> readinfo_type tHdrFtr = { NULL, 0, 0, }; -<a name="l00043"></a>00043 <span class="keyword">static</span> readinfo_type tFootnote = { NULL, 0, 0, }; -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/*</span> -<a name="l00047"></a>00047 <span class="comment"> * pFreeOneList - free a text block list</span> -<a name="l00048"></a>00048 <span class="comment"> *</span> -<a name="l00049"></a>00049 <span class="comment"> * Will always return NULL</span> -<a name="l00050"></a>00050 <span class="comment"> */</span> -<a name="l00051"></a>00051 <span class="keyword">static</span> list_mem_type * -<a name="l00052"></a>00052 pFreeOneList(list_mem_type *pAnchor) -<a name="l00053"></a>00053 { -<a name="l00054"></a>00054 list_mem_type *pCurr, *pNext; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 pCurr = pAnchor; -<a name="l00057"></a>00057 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00058"></a>00058 pNext = pCurr->pNext; -<a name="l00059"></a>00059 pCurr = xfree(pCurr); -<a name="l00060"></a>00060 pCurr = pNext; -<a name="l00061"></a>00061 } -<a name="l00062"></a>00062 <span class="keywordflow">return</span> NULL; -<a name="l00063"></a>00063 } <span class="comment">/* end of pFreeOneList */</span> -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="comment">/*</span> -<a name="l00066"></a>00066 <span class="comment"> * vDestroyTextBlockList - destroy the text block lists</span> -<a name="l00067"></a>00067 <span class="comment"> */</span> -<a name="l00068"></a>00068 <span class="keywordtype">void</span> -<a name="l00069"></a>00069 vDestroyTextBlockList(<span class="keywordtype">void</span>) -<a name="l00070"></a>00070 { -<a name="l00071"></a>00071 DBG_MSG(<span class="stringliteral">"vDestroyTextBlockList"</span>); -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="comment">/* Free the lists one by one */</span> -<a name="l00074"></a>00074 pTextAnchor = pFreeOneList(pTextAnchor); -<a name="l00075"></a>00075 pFootnoteAnchor = pFreeOneList(pFootnoteAnchor); -<a name="l00076"></a>00076 pHdrFtrAnchor = pFreeOneList(pHdrFtrAnchor); -<a name="l00077"></a>00077 pMacroAnchor = pFreeOneList(pMacroAnchor); -<a name="l00078"></a>00078 pAnnotationAnchor = pFreeOneList(pAnnotationAnchor); -<a name="l00079"></a>00079 pEndnoteAnchor = pFreeOneList(pEndnoteAnchor); -<a name="l00080"></a>00080 pTextBoxAnchor = pFreeOneList(pTextBoxAnchor); -<a name="l00081"></a>00081 pHdrTextBoxAnchor = pFreeOneList(pHdrTextBoxAnchor); -<a name="l00082"></a>00082 <span class="comment">/* Reset all the controle variables */</span> -<a name="l00083"></a>00083 pBlockLast = NULL; -<a name="l00084"></a>00084 tOthers.pBlockCurrent = NULL; -<a name="l00085"></a>00085 tHdrFtr.pBlockCurrent = NULL; -<a name="l00086"></a>00086 tFootnote.pBlockCurrent = NULL; -<a name="l00087"></a>00087 } <span class="comment">/* end of vDestroyTextBlockList */</span> -<a name="l00088"></a>00088 -<a name="l00089"></a>00089 <span class="comment">/*</span> -<a name="l00090"></a>00090 <span class="comment"> * bAdd2TextBlockList - add an element to the text block list</span> -<a name="l00091"></a>00091 <span class="comment"> *</span> -<a name="l00092"></a>00092 <span class="comment"> * returns: TRUE when successful, otherwise FALSE</span> -<a name="l00093"></a>00093 <span class="comment"> */</span> -<a name="l00094"></a>00094 BOOL -<a name="l00095"></a>00095 bAdd2TextBlockList(<span class="keyword">const</span> text_block_type *pTextBlock) -<a name="l00096"></a>00096 { -<a name="l00097"></a>00097 list_mem_type *pListMember; -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 fail(pTextBlock == NULL); -<a name="l00100"></a>00100 fail(pTextBlock->ulFileOffset == FC_INVALID); -<a name="l00101"></a>00101 fail(pTextBlock->ulCharPos == CP_INVALID); -<a name="l00102"></a>00102 fail(pTextBlock->ulLength == 0); -<a name="l00103"></a>00103 fail(pTextBlock->bUsesUnicode && odd(pTextBlock->ulLength)); -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 NO_DBG_MSG(<span class="stringliteral">"bAdd2TextBlockList"</span>); -<a name="l00106"></a>00106 NO_DBG_HEX(pTextBlock->ulFileOffset); -<a name="l00107"></a>00107 NO_DBG_HEX(pTextBlock->ulCharPos); -<a name="l00108"></a>00108 NO_DBG_HEX(pTextBlock->ulLength); -<a name="l00109"></a>00109 NO_DBG_DEC(pTextBlock->bUsesUnicode); -<a name="l00110"></a>00110 NO_DBG_DEC(pTextBlock->usPropMod); -<a name="l00111"></a>00111 -<a name="l00112"></a>00112 <span class="keywordflow">if</span> (pTextBlock->ulFileOffset == FC_INVALID || -<a name="l00113"></a>00113 pTextBlock->ulCharPos == CP_INVALID || -<a name="l00114"></a>00114 pTextBlock->ulLength == 0 || -<a name="l00115"></a>00115 (pTextBlock->bUsesUnicode && odd(pTextBlock->ulLength))) { -<a name="l00116"></a>00116 werr(0, <span class="stringliteral">"Software (textblock) error"</span>); -<a name="l00117"></a>00117 <span class="keywordflow">return</span> FALSE; -<a name="l00118"></a>00118 } -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * Check for continuous blocks of the same character size and</span> -<a name="l00121"></a>00121 <span class="comment"> * the same properties modifier</span> -<a name="l00122"></a>00122 <span class="comment"> */</span> -<a name="l00123"></a>00123 <span class="keywordflow">if</span> (pBlockLast != NULL && -<a name="l00124"></a>00124 pBlockLast->tInfo.ulFileOffset + -<a name="l00125"></a>00125 pBlockLast->tInfo.ulLength == pTextBlock->ulFileOffset && -<a name="l00126"></a>00126 pBlockLast->tInfo.ulCharPos + -<a name="l00127"></a>00127 pBlockLast->tInfo.ulLength == pTextBlock->ulCharPos && -<a name="l00128"></a>00128 pBlockLast->tInfo.bUsesUnicode == pTextBlock->bUsesUnicode && -<a name="l00129"></a>00129 pBlockLast->tInfo.usPropMod == pTextBlock->usPropMod) { -<a name="l00130"></a>00130 <span class="comment">/* These are continous blocks */</span> -<a name="l00131"></a>00131 pBlockLast->tInfo.ulLength += pTextBlock->ulLength; -<a name="l00132"></a>00132 <span class="keywordflow">return</span> TRUE; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 <span class="comment">/* Make a new block */</span> -<a name="l00135"></a>00135 pListMember = xmalloc(<span class="keyword">sizeof</span>(list_mem_type)); -<a name="l00136"></a>00136 <span class="comment">/* Add the block to the list */</span> -<a name="l00137"></a>00137 pListMember->tInfo = *pTextBlock; -<a name="l00138"></a>00138 pListMember->pNext = NULL; -<a name="l00139"></a>00139 <span class="keywordflow">if</span> (pTextAnchor == NULL) { -<a name="l00140"></a>00140 pTextAnchor = pListMember; -<a name="l00141"></a>00141 } <span class="keywordflow">else</span> { -<a name="l00142"></a>00142 fail(pBlockLast == NULL); -<a name="l00143"></a>00143 pBlockLast->pNext = pListMember; -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 pBlockLast = pListMember; -<a name="l00146"></a>00146 <span class="keywordflow">return</span> TRUE; -<a name="l00147"></a>00147 } <span class="comment">/* end of bAdd2TextBlockList */</span> -<a name="l00148"></a>00148 -<a name="l00149"></a>00149 <span class="comment">/*</span> -<a name="l00150"></a>00150 <span class="comment"> * vSpitList - Split the list in two</span> -<a name="l00151"></a>00151 <span class="comment"> */</span> -<a name="l00152"></a>00152 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00153"></a>00153 vSpitList(list_mem_type **ppAnchorCurr, list_mem_type **ppAnchorNext, -<a name="l00154"></a>00154 ULONG ulListLen) -<a name="l00155"></a>00155 { -<a name="l00156"></a>00156 list_mem_type *pCurr; -<a name="l00157"></a>00157 <span class="keywordtype">long</span> lCharsToGo, lBytesTooFar; -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 fail(ppAnchorCurr == NULL); -<a name="l00160"></a>00160 fail(ppAnchorNext == NULL); -<a name="l00161"></a>00161 fail(ulListLen > (ULONG)LONG_MAX); -<a name="l00162"></a>00162 -<a name="l00163"></a>00163 pCurr = NULL; -<a name="l00164"></a>00164 lCharsToGo = (long)ulListLen; -<a name="l00165"></a>00165 lBytesTooFar = -1; -<a name="l00166"></a>00166 <span class="keywordflow">if</span> (ulListLen != 0) { -<a name="l00167"></a>00167 DBG_DEC(ulListLen); -<a name="l00168"></a>00168 <span class="keywordflow">for</span> (pCurr = *ppAnchorCurr; -<a name="l00169"></a>00169 pCurr != NULL; -<a name="l00170"></a>00170 pCurr = pCurr->pNext) { -<a name="l00171"></a>00171 NO_DBG_DEC(pCurr->tInfo.ulLength); -<a name="l00172"></a>00172 fail(pCurr->tInfo.ulLength == 0); -<a name="l00173"></a>00173 fail(pCurr->tInfo.ulLength > (ULONG)LONG_MAX); -<a name="l00174"></a>00174 <span class="keywordflow">if</span> (pCurr->tInfo.bUsesUnicode) { -<a name="l00175"></a>00175 fail(odd(pCurr->tInfo.ulLength)); -<a name="l00176"></a>00176 lCharsToGo -= (long)(pCurr->tInfo.ulLength / 2); -<a name="l00177"></a>00177 <span class="keywordflow">if</span> (lCharsToGo < 0) { -<a name="l00178"></a>00178 lBytesTooFar = -2 * lCharsToGo; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 } <span class="keywordflow">else</span> { -<a name="l00181"></a>00181 lCharsToGo -= (long)pCurr->tInfo.ulLength; -<a name="l00182"></a>00182 if (lCharsToGo < 0) { -<a name="l00183"></a>00183 lBytesTooFar = -lCharsToGo; -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 <span class="keywordflow">if</span> (lCharsToGo <= 0) { -<a name="l00187"></a>00187 <span class="keywordflow">break</span>; -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 } -<a name="l00190"></a>00190 } -<a name="l00191"></a>00191 <span class="comment">/* Split the list */</span> -<a name="l00192"></a>00192 <span class="keywordflow">if</span> (ulListLen == 0) { -<a name="l00193"></a>00193 <span class="comment">/* Current blocklist is empty */</span> -<a name="l00194"></a>00194 *ppAnchorNext = *ppAnchorCurr; -<a name="l00195"></a>00195 *ppAnchorCurr = NULL; -<a name="l00196"></a>00196 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pCurr == NULL) { -<a name="l00197"></a>00197 <span class="comment">/* No blocks for the next list */</span> -<a name="l00198"></a>00198 *ppAnchorNext = NULL; -<a name="l00199"></a>00199 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lCharsToGo == 0) { -<a name="l00200"></a>00200 <span class="comment">/* Move the integral number of blocks to the next list */</span> -<a name="l00201"></a>00201 *ppAnchorNext = pCurr->pNext; -<a name="l00202"></a>00202 pCurr->pNext = NULL; -<a name="l00203"></a>00203 } <span class="keywordflow">else</span> { -<a name="l00204"></a>00204 <span class="comment">/* Split the part current block list, part next block list */</span> -<a name="l00205"></a>00205 DBG_DEC(lBytesTooFar); -<a name="l00206"></a>00206 fail(lBytesTooFar <= 0); -<a name="l00207"></a>00207 *ppAnchorNext = xmalloc(<span class="keyword">sizeof</span>(list_mem_type)); -<a name="l00208"></a>00208 DBG_HEX(pCurr->tInfo.ulFileOffset); -<a name="l00209"></a>00209 (*ppAnchorNext)->tInfo.ulFileOffset = -<a name="l00210"></a>00210 pCurr->tInfo.ulFileOffset + -<a name="l00211"></a>00211 pCurr->tInfo.ulLength - -<a name="l00212"></a>00212 lBytesTooFar; -<a name="l00213"></a>00213 DBG_HEX((*ppAnchorNext)->tInfo.ulFileOffset); -<a name="l00214"></a>00214 DBG_HEX(pCurr->tInfo.ulCharPos); -<a name="l00215"></a>00215 (*ppAnchorNext)->tInfo.ulCharPos = -<a name="l00216"></a>00216 pCurr->tInfo.ulCharPos + -<a name="l00217"></a>00217 pCurr->tInfo.ulLength - -<a name="l00218"></a>00218 lBytesTooFar; -<a name="l00219"></a>00219 DBG_HEX((*ppAnchorNext)->tInfo.ulCharPos); -<a name="l00220"></a>00220 (*ppAnchorNext)->tInfo.ulLength = (ULONG)lBytesTooFar; -<a name="l00221"></a>00221 pCurr->tInfo.ulLength -= (ULONG)lBytesTooFar; -<a name="l00222"></a>00222 (*ppAnchorNext)->tInfo.bUsesUnicode = pCurr->tInfo.bUsesUnicode; -<a name="l00223"></a>00223 (*ppAnchorNext)->tInfo.usPropMod = pCurr->tInfo.usPropMod; -<a name="l00224"></a>00224 <span class="comment">/* Move the integral number of blocks to the next list */</span> -<a name="l00225"></a>00225 (*ppAnchorNext)->pNext = pCurr->pNext; -<a name="l00226"></a>00226 pCurr->pNext = NULL; -<a name="l00227"></a>00227 } -<a name="l00228"></a>00228 } <span class="comment">/* end of vSpitList */</span> -<a name="l00229"></a>00229 -<a name="l00230"></a>00230 <span class="preprocessor">#if defined(DEBUG) || defined(__riscos)</span> -<a name="l00231"></a>00231 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00232"></a>00232 <span class="comment"> * ulComputeListLength - compute the length of a list</span> -<a name="l00233"></a>00233 <span class="comment"> *</span> -<a name="l00234"></a>00234 <span class="comment"> * returns the list length in characters</span> -<a name="l00235"></a>00235 <span class="comment"> */</span> -<a name="l00236"></a>00236 <span class="keyword">static</span> ULONG -<a name="l00237"></a>00237 ulComputeListLength(<span class="keyword">const</span> list_mem_type *pAnchor) -<a name="l00238"></a>00238 { -<a name="l00239"></a>00239 <span class="keyword">const</span> list_mem_type *pCurr; -<a name="l00240"></a>00240 ULONG ulTotal; -<a name="l00241"></a>00241 -<a name="l00242"></a>00242 ulTotal = 0; -<a name="l00243"></a>00243 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00244"></a>00244 fail(pCurr->tInfo.ulLength == 0); -<a name="l00245"></a>00245 <span class="keywordflow">if</span> (pCurr->tInfo.bUsesUnicode) { -<a name="l00246"></a>00246 fail(odd(pCurr->tInfo.ulLength)); -<a name="l00247"></a>00247 ulTotal += pCurr->tInfo.ulLength / 2; -<a name="l00248"></a>00248 } <span class="keywordflow">else</span> { -<a name="l00249"></a>00249 ulTotal += pCurr->tInfo.ulLength; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 } -<a name="l00252"></a>00252 <span class="keywordflow">return</span> ulTotal; -<a name="l00253"></a>00253 } <span class="comment">/* end of ulComputeListLength */</span> -<a name="l00254"></a>00254 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG || __riscos */</span> -<a name="l00255"></a>00255 -<a name="l00256"></a>00256 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00257"></a>00257 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00258"></a>00258 <span class="comment"> * vCheckList - check the number of bytes in a block list</span> -<a name="l00259"></a>00259 <span class="comment"> */</span> -<a name="l00260"></a>00260 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00261"></a>00261 vCheckList(<span class="keyword">const</span> list_mem_type *pAnchor, ULONG ulListLen, <span class="keywordtype">char</span> *szMsg) -<a name="l00262"></a>00262 { -<a name="l00263"></a>00263 ULONG ulTotal; -<a name="l00264"></a>00264 -<a name="l00265"></a>00265 ulTotal = ulComputeListLength(pAnchor); -<a name="l00266"></a>00266 DBG_DEC(ulTotal); -<a name="l00267"></a>00267 <span class="keywordflow">if</span> (ulTotal != ulListLen) { -<a name="l00268"></a>00268 DBG_DEC(ulListLen); -<a name="l00269"></a>00269 werr(1, szMsg); -<a name="l00270"></a>00270 } -<a name="l00271"></a>00271 } <span class="comment">/* end of vCheckList */</span> -<a name="l00272"></a>00272 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00273"></a>00273 -<a name="l00274"></a>00274 <span class="comment">/*</span> -<a name="l00275"></a>00275 <span class="comment"> * bIsEmptyBox - check to see if the given text box is empty</span> -<a name="l00276"></a>00276 <span class="comment"> */</span> -<a name="l00277"></a>00277 <span class="keyword">static</span> BOOL -<a name="l00278"></a>00278 bIsEmptyBox(FILE *pFile, <span class="keyword">const</span> list_mem_type *pAnchor) -<a name="l00279"></a>00279 { -<a name="l00280"></a>00280 <span class="keyword">const</span> list_mem_type *pCurr; -<a name="l00281"></a>00281 <span class="keywordtype">size_t</span> tIndex, tSize; -<a name="l00282"></a>00282 UCHAR *aucBuffer; -<a name="l00283"></a>00283 <span class="keywordtype">char</span> cChar; -<a name="l00284"></a>00284 -<a name="l00285"></a>00285 fail(pFile == NULL); -<a name="l00286"></a>00286 -<a name="l00287"></a>00287 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00288"></a>00288 <span class="keywordflow">return</span> TRUE; -<a name="l00289"></a>00289 } -<a name="l00290"></a>00290 -<a name="l00291"></a>00291 aucBuffer = NULL; -<a name="l00292"></a>00292 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00293"></a>00293 fail(pCurr->tInfo.ulLength == 0); -<a name="l00294"></a>00294 tSize = (size_t)pCurr->tInfo.ulLength; -<a name="l00295"></a>00295 #<span class="keywordflow">if</span> defined(__dos) && !defined(__DJGPP__) -<a name="l00296"></a>00296 if (pCurr->tInfo.ulLength > 0xffffUL) { -<a name="l00297"></a>00297 tSize = 0xffff; -<a name="l00298"></a>00298 } -<a name="l00299"></a>00299 <span class="preprocessor">#endif </span><span class="comment">/* __dos && !__DJGPP__ */</span> -<a name="l00300"></a>00300 fail(aucBuffer != NULL); -<a name="l00301"></a>00301 aucBuffer = xmalloc(tSize); -<a name="l00302"></a>00302 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tSize, -<a name="l00303"></a>00303 pCurr->tInfo.ulFileOffset, pFile)) { -<a name="l00304"></a>00304 aucBuffer = xfree(aucBuffer); -<a name="l00305"></a>00305 <span class="keywordflow">return</span> FALSE; -<a name="l00306"></a>00306 } -<a name="l00307"></a>00307 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tSize; tIndex++) { -<a name="l00308"></a>00308 cChar = (char)aucBuffer[tIndex]; -<a name="l00309"></a>00309 <span class="keywordflow">switch</span> (cChar) { -<a name="l00310"></a>00310 <span class="keywordflow">case</span> <span class="charliteral">'\0'</span>: <span class="keywordflow">case</span> <span class="charliteral">'\r'</span>: <span class="keywordflow">case</span> <span class="charliteral">'\n'</span>: -<a name="l00311"></a>00311 <span class="keywordflow">case</span> <span class="charliteral">'\f'</span>: <span class="keywordflow">case</span> <span class="charliteral">'\t'</span>: <span class="keywordflow">case</span> <span class="charliteral">'\v'</span>: -<a name="l00312"></a>00312 <span class="keywordflow">case</span> <span class="charliteral">' '</span>: -<a name="l00313"></a>00313 <span class="keywordflow">break</span>; -<a name="l00314"></a>00314 <span class="keywordflow">default</span>: -<a name="l00315"></a>00315 aucBuffer = xfree(aucBuffer); -<a name="l00316"></a>00316 <span class="keywordflow">return</span> FALSE; -<a name="l00317"></a>00317 } -<a name="l00318"></a>00318 } -<a name="l00319"></a>00319 aucBuffer = xfree(aucBuffer); -<a name="l00320"></a>00320 } -<a name="l00321"></a>00321 fail(aucBuffer != NULL); -<a name="l00322"></a>00322 <span class="keywordflow">return</span> TRUE; -<a name="l00323"></a>00323 } <span class="comment">/* end of bIsEmptyBox */</span> -<a name="l00324"></a>00324 -<a name="l00325"></a>00325 <span class="comment">/*</span> -<a name="l00326"></a>00326 <span class="comment"> * vSplitBlockList - split the block list in the various parts</span> -<a name="l00327"></a>00327 <span class="comment"> *</span> -<a name="l00328"></a>00328 <span class="comment"> * Split the blocklist in a Text block list, a Footnote block list, a</span> -<a name="l00329"></a>00329 <span class="comment"> * HeaderFooter block list, a Macro block list, an Annotation block list,</span> -<a name="l00330"></a>00330 <span class="comment"> * an Endnote block list, a TextBox list and a HeaderTextBox list.</span> -<a name="l00331"></a>00331 <span class="comment"> *</span> -<a name="l00332"></a>00332 <span class="comment"> * NOTE:</span> -<a name="l00333"></a>00333 <span class="comment"> * The various ul*Len input parameters are given in characters, but the</span> -<a name="l00334"></a>00334 <span class="comment"> * length of the blocks are in bytes.</span> -<a name="l00335"></a>00335 <span class="comment"> */</span> -<a name="l00336"></a>00336 <span class="keywordtype">void</span> -<a name="l00337"></a>00337 vSplitBlockList(FILE *pFile, ULONG ulTextLen, ULONG ulFootnoteLen, -<a name="l00338"></a>00338 ULONG ulHdrFtrLen, ULONG ulMacroLen, ULONG ulAnnotationLen, -<a name="l00339"></a>00339 ULONG ulEndnoteLen, ULONG ulTextBoxLen, ULONG ulHdrTextBoxLen, -<a name="l00340"></a>00340 BOOL bMustExtend) -<a name="l00341"></a>00341 { -<a name="l00342"></a>00342 list_mem_type *apAnchors[8]; -<a name="l00343"></a>00343 list_mem_type *pGarbageAnchor, *pCurr; -<a name="l00344"></a>00344 <span class="keywordtype">size_t</span> tIndex; -<a name="l00345"></a>00345 -<a name="l00346"></a>00346 DBG_MSG(<span class="stringliteral">"vSplitBlockList"</span>); -<a name="l00347"></a>00347 -<a name="l00348"></a>00348 pGarbageAnchor = NULL; -<a name="l00349"></a>00349 -<a name="l00350"></a>00350 DBG_MSG_C(ulTextLen != 0, <span class="stringliteral">"Text block list"</span>); -<a name="l00351"></a>00351 vSpitList(&pTextAnchor, &pFootnoteAnchor, ulTextLen); -<a name="l00352"></a>00352 DBG_MSG_C(ulFootnoteLen != 0, <span class="stringliteral">"Footnote block list"</span>); -<a name="l00353"></a>00353 vSpitList(&pFootnoteAnchor, &pHdrFtrAnchor, ulFootnoteLen); -<a name="l00354"></a>00354 DBG_MSG_C(ulHdrFtrLen != 0, <span class="stringliteral">"Header/Footer block list"</span>); -<a name="l00355"></a>00355 vSpitList(&pHdrFtrAnchor, &pMacroAnchor, ulHdrFtrLen); -<a name="l00356"></a>00356 DBG_MSG_C(ulMacroLen != 0, <span class="stringliteral">"Macro block list"</span>); -<a name="l00357"></a>00357 vSpitList(&pMacroAnchor, &pAnnotationAnchor, ulMacroLen); -<a name="l00358"></a>00358 DBG_MSG_C(ulAnnotationLen != 0, <span class="stringliteral">"Annotation block list"</span>); -<a name="l00359"></a>00359 vSpitList(&pAnnotationAnchor, &pEndnoteAnchor, ulAnnotationLen); -<a name="l00360"></a>00360 DBG_MSG_C(ulEndnoteLen != 0, <span class="stringliteral">"Endnote block list"</span>); -<a name="l00361"></a>00361 vSpitList(&pEndnoteAnchor, &pTextBoxAnchor, ulEndnoteLen); -<a name="l00362"></a>00362 DBG_MSG_C(ulTextBoxLen != 0, <span class="stringliteral">"Textbox block list"</span>); -<a name="l00363"></a>00363 vSpitList(&pTextBoxAnchor, &pHdrTextBoxAnchor, ulTextBoxLen); -<a name="l00364"></a>00364 DBG_MSG_C(ulHdrTextBoxLen != 0, <span class="stringliteral">"HeaderTextbox block list"</span>); -<a name="l00365"></a>00365 vSpitList(&pHdrTextBoxAnchor, &pGarbageAnchor, ulHdrTextBoxLen); -<a name="l00366"></a>00366 -<a name="l00367"></a>00367 <span class="comment">/* Free the garbage block list, this should not be needed */</span> -<a name="l00368"></a>00368 DBG_DEC_C(pGarbageAnchor != NULL, pGarbageAnchor->tInfo.ulLength); -<a name="l00369"></a>00369 pGarbageAnchor = pFreeOneList(pGarbageAnchor); -<a name="l00370"></a>00370 -<a name="l00371"></a>00371 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00372"></a>00372 <span class="preprocessor"></span> vCheckList(pTextAnchor, ulTextLen, <span class="stringliteral">"Software error (Text)"</span>); -<a name="l00373"></a>00373 vCheckList(pFootnoteAnchor, ulFootnoteLen, <span class="stringliteral">"Software error (Footnote)"</span>); -<a name="l00374"></a>00374 vCheckList(pHdrFtrAnchor, ulHdrFtrLen, <span class="stringliteral">"Software error (Hdr/Ftr)"</span>); -<a name="l00375"></a>00375 vCheckList(pMacroAnchor, ulMacroLen, <span class="stringliteral">"Software error (Macro)"</span>); -<a name="l00376"></a>00376 vCheckList(pAnnotationAnchor, ulAnnotationLen, -<a name="l00377"></a>00377 <span class="stringliteral">"Software error (Annotation)"</span>); -<a name="l00378"></a>00378 vCheckList(pEndnoteAnchor, ulEndnoteLen, <span class="stringliteral">"Software error (Endnote)"</span>); -<a name="l00379"></a>00379 vCheckList(pTextBoxAnchor, ulTextBoxLen, <span class="stringliteral">"Software error (TextBox)"</span>); -<a name="l00380"></a>00380 vCheckList(pHdrTextBoxAnchor, ulHdrTextBoxLen, -<a name="l00381"></a>00381 <span class="stringliteral">"Software error (HdrTextBox)"</span>); -<a name="l00382"></a>00382 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00383"></a>00383 -<a name="l00384"></a>00384 <span class="comment">/* Remove the list if the text box is empty */</span> -<a name="l00385"></a>00385 <span class="keywordflow">if</span> (bIsEmptyBox(pFile, pTextBoxAnchor)) { -<a name="l00386"></a>00386 pTextBoxAnchor = pFreeOneList(pTextBoxAnchor); -<a name="l00387"></a>00387 } -<a name="l00388"></a>00388 <span class="keywordflow">if</span> (bIsEmptyBox(pFile, pHdrTextBoxAnchor)) { -<a name="l00389"></a>00389 pHdrTextBoxAnchor = pFreeOneList(pHdrTextBoxAnchor); -<a name="l00390"></a>00390 } -<a name="l00391"></a>00391 -<a name="l00392"></a>00392 <span class="keywordflow">if</span> (!bMustExtend) { -<a name="l00393"></a>00393 <span class="keywordflow">return</span>; -<a name="l00394"></a>00394 } -<a name="l00395"></a>00395 <span class="comment">/*</span> -<a name="l00396"></a>00396 <span class="comment"> * All blocks (except the last one) must have a length that</span> -<a name="l00397"></a>00397 <span class="comment"> * is a multiple of the Big Block Size</span> -<a name="l00398"></a>00398 <span class="comment"> */</span> -<a name="l00399"></a>00399 -<a name="l00400"></a>00400 apAnchors[0] = pTextAnchor; -<a name="l00401"></a>00401 apAnchors[1] = pFootnoteAnchor; -<a name="l00402"></a>00402 apAnchors[2] = pHdrFtrAnchor; -<a name="l00403"></a>00403 apAnchors[3] = pMacroAnchor; -<a name="l00404"></a>00404 apAnchors[4] = pAnnotationAnchor; -<a name="l00405"></a>00405 apAnchors[5] = pEndnoteAnchor; -<a name="l00406"></a>00406 apAnchors[6] = pTextBoxAnchor; -<a name="l00407"></a>00407 apAnchors[7] = pHdrTextBoxAnchor; -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(apAnchors); tIndex++) { -<a name="l00410"></a>00410 <span class="keywordflow">for</span> (pCurr = apAnchors[tIndex]; -<a name="l00411"></a>00411 pCurr != NULL; -<a name="l00412"></a>00412 pCurr = pCurr->pNext) { -<a name="l00413"></a>00413 <span class="keywordflow">if</span> (pCurr->pNext != NULL && -<a name="l00414"></a>00414 pCurr->tInfo.ulLength % BIG_BLOCK_SIZE != 0) { -<a name="l00415"></a>00415 DBG_DEC(tIndex); -<a name="l00416"></a>00416 DBG_HEX(pCurr->tInfo.ulFileOffset); -<a name="l00417"></a>00417 DBG_HEX(pCurr->tInfo.ulCharPos); -<a name="l00418"></a>00418 DBG_DEC(pCurr->tInfo.ulLength); -<a name="l00419"></a>00419 pCurr->tInfo.ulLength /= BIG_BLOCK_SIZE; -<a name="l00420"></a>00420 pCurr->tInfo.ulLength++; -<a name="l00421"></a>00421 pCurr->tInfo.ulLength *= BIG_BLOCK_SIZE; -<a name="l00422"></a>00422 DBG_DEC(pCurr->tInfo.ulLength); -<a name="l00423"></a>00423 } -<a name="l00424"></a>00424 } -<a name="l00425"></a>00425 } -<a name="l00426"></a>00426 } <span class="comment">/* end of vSplitBlockList */</span> -<a name="l00427"></a>00427 -<a name="l00428"></a>00428 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00429"></a>00429 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00430"></a>00430 <span class="comment"> * ulGetDocumentLength - get the total character length of the printable lists</span> -<a name="l00431"></a>00431 <span class="comment"> *</span> -<a name="l00432"></a>00432 <span class="comment"> * returns: The total number of characters</span> -<a name="l00433"></a>00433 <span class="comment"> */</span> -<a name="l00434"></a>00434 ULONG -<a name="l00435"></a>00435 ulGetDocumentLength(<span class="keywordtype">void</span>) -<a name="l00436"></a>00436 { -<a name="l00437"></a>00437 <span class="keywordtype">long</span> ulTotal; -<a name="l00438"></a>00438 -<a name="l00439"></a>00439 DBG_MSG(<span class="stringliteral">"ulGetDocumentLength"</span>); -<a name="l00440"></a>00440 -<a name="l00441"></a>00441 ulTotal = ulComputeListLength(pTextAnchor); -<a name="l00442"></a>00442 ulTotal += ulComputeListLength(pFootnoteAnchor); -<a name="l00443"></a>00443 ulTotal += ulComputeListLength(pEndnoteAnchor); -<a name="l00444"></a>00444 ulTotal += ulComputeListLength(pTextBoxAnchor); -<a name="l00445"></a>00445 ulTotal += ulComputeListLength(pHdrTextBoxAnchor); -<a name="l00446"></a>00446 DBG_DEC(ulTotal); -<a name="l00447"></a>00447 <span class="keywordflow">return</span> ulTotal; -<a name="l00448"></a>00448 } <span class="comment">/* end of ulGetDocumentLength */</span> -<a name="l00449"></a>00449 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00450"></a>00450 -<a name="l00451"></a>00451 <span class="preprocessor">#if 0</span> -<a name="l00452"></a>00452 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00453"></a>00453 <span class="comment"> * bExistsHdrFtr - are there headers and/or footers?</span> -<a name="l00454"></a>00454 <span class="comment"> */</span> -<a name="l00455"></a>00455 BOOL -<a name="l00456"></a>00456 bExistsHdrFtr(<span class="keywordtype">void</span>) -<a name="l00457"></a>00457 { -<a name="l00458"></a>00458 <span class="keywordflow">return</span> pHdrFtrAnchor != NULL && -<a name="l00459"></a>00459 pHdrFtrAnchor->tInfo.ulLength != 0; -<a name="l00460"></a>00460 } <span class="comment">/* end of bExistsHdrFtr */</span> -<a name="l00461"></a>00461 <span class="preprocessor">#endif</span> -<a name="l00462"></a>00462 <span class="preprocessor"></span> -<a name="l00463"></a>00463 <span class="comment">/*</span> -<a name="l00464"></a>00464 <span class="comment"> * bExistsTextBox - is there a text box?</span> -<a name="l00465"></a>00465 <span class="comment"> */</span> -<a name="l00466"></a>00466 BOOL -<a name="l00467"></a>00467 bExistsTextBox(<span class="keywordtype">void</span>) -<a name="l00468"></a>00468 { -<a name="l00469"></a>00469 <span class="keywordflow">return</span> pTextBoxAnchor != NULL && -<a name="l00470"></a>00470 pTextBoxAnchor->tInfo.ulLength != 0; -<a name="l00471"></a>00471 } <span class="comment">/* end of bExistsTextBox */</span> -<a name="l00472"></a>00472 -<a name="l00473"></a>00473 <span class="comment">/*</span> -<a name="l00474"></a>00474 <span class="comment"> * bExistsHdrTextBox - is there a header text box?</span> -<a name="l00475"></a>00475 <span class="comment"> */</span> -<a name="l00476"></a>00476 BOOL -<a name="l00477"></a>00477 bExistsHdrTextBox(<span class="keywordtype">void</span>) -<a name="l00478"></a>00478 { -<a name="l00479"></a>00479 <span class="keywordflow">return</span> pHdrTextBoxAnchor != NULL && -<a name="l00480"></a>00480 pHdrTextBoxAnchor->tInfo.ulLength != 0; -<a name="l00481"></a>00481 } <span class="comment">/* end of bExistsHdrTextBox */</span> -<a name="l00482"></a>00482 -<a name="l00483"></a>00483 <span class="comment">/*</span> -<a name="l00484"></a>00484 <span class="comment"> * usGetNextByte - get the next byte from the specified block list</span> -<a name="l00485"></a>00485 <span class="comment"> */</span> -<a name="l00486"></a>00486 <span class="keyword">static</span> USHORT -<a name="l00487"></a>00487 usGetNextByte(FILE *pFile, readinfo_type *pInfoCurrent, list_mem_type *pAnchor, -<a name="l00488"></a>00488 ULONG *pulFileOffset, ULONG *pulCharPos, USHORT *pusPropMod) -<a name="l00489"></a>00489 { -<a name="l00490"></a>00490 ULONG ulReadOff; -<a name="l00491"></a>00491 <span class="keywordtype">size_t</span> tReadLen; -<a name="l00492"></a>00492 -<a name="l00493"></a>00493 fail(pInfoCurrent == NULL); -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 <span class="keywordflow">if</span> (pInfoCurrent->pBlockCurrent == NULL || -<a name="l00496"></a>00496 pInfoCurrent->tByteNext >= <span class="keyword">sizeof</span>(pInfoCurrent->aucBlock) || -<a name="l00497"></a>00497 pInfoCurrent->ulBlockOffset + pInfoCurrent->tByteNext >= -<a name="l00498"></a>00498 pInfoCurrent->pBlockCurrent->tInfo.ulLength) { -<a name="l00499"></a>00499 <span class="keywordflow">if</span> (pInfoCurrent->pBlockCurrent == NULL) { -<a name="l00500"></a>00500 <span class="comment">/* First block, first part */</span> -<a name="l00501"></a>00501 pInfoCurrent->pBlockCurrent = pAnchor; -<a name="l00502"></a>00502 pInfoCurrent->ulBlockOffset = 0; -<a name="l00503"></a>00503 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pInfoCurrent->ulBlockOffset + -<a name="l00504"></a>00504 <span class="keyword">sizeof</span>(pInfoCurrent->aucBlock) < -<a name="l00505"></a>00505 pInfoCurrent->pBlockCurrent->tInfo.ulLength) { -<a name="l00506"></a>00506 <span class="comment">/* Same block, next part */</span> -<a name="l00507"></a>00507 pInfoCurrent->ulBlockOffset += -<a name="l00508"></a>00508 <span class="keyword">sizeof</span>(pInfoCurrent->aucBlock); -<a name="l00509"></a>00509 } <span class="keywordflow">else</span> { -<a name="l00510"></a>00510 <span class="comment">/* Next block, first part */</span> -<a name="l00511"></a>00511 pInfoCurrent->pBlockCurrent = -<a name="l00512"></a>00512 pInfoCurrent->pBlockCurrent->pNext; -<a name="l00513"></a>00513 pInfoCurrent->ulBlockOffset = 0; -<a name="l00514"></a>00514 } -<a name="l00515"></a>00515 <span class="keywordflow">if</span> (pInfoCurrent->pBlockCurrent == NULL) { -<a name="l00516"></a>00516 <span class="comment">/* Past the last part of the last block */</span> -<a name="l00517"></a>00517 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00518"></a>00518 } -<a name="l00519"></a>00519 tReadLen = (size_t) -<a name="l00520"></a>00520 (pInfoCurrent->pBlockCurrent->tInfo.ulLength - -<a name="l00521"></a>00521 pInfoCurrent->ulBlockOffset); -<a name="l00522"></a>00522 <span class="keywordflow">if</span> (tReadLen > <span class="keyword">sizeof</span>(pInfoCurrent->aucBlock)) { -<a name="l00523"></a>00523 tReadLen = <span class="keyword">sizeof</span>(pInfoCurrent->aucBlock); -<a name="l00524"></a>00524 } -<a name="l00525"></a>00525 ulReadOff = pInfoCurrent->pBlockCurrent->tInfo.ulFileOffset + -<a name="l00526"></a>00526 pInfoCurrent->ulBlockOffset; -<a name="l00527"></a>00527 <span class="keywordflow">if</span> (!bReadBytes(pInfoCurrent->aucBlock, -<a name="l00528"></a>00528 tReadLen, ulReadOff, pFile)) { -<a name="l00529"></a>00529 <span class="comment">/* Don't read from this list any longer */</span> -<a name="l00530"></a>00530 pInfoCurrent->pBlockCurrent = NULL; -<a name="l00531"></a>00531 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00532"></a>00532 } -<a name="l00533"></a>00533 pInfoCurrent->tByteNext = 0; -<a name="l00534"></a>00534 } -<a name="l00535"></a>00535 <span class="keywordflow">if</span> (pulFileOffset != NULL) { -<a name="l00536"></a>00536 *pulFileOffset = -<a name="l00537"></a>00537 pInfoCurrent->pBlockCurrent->tInfo.ulFileOffset + -<a name="l00538"></a>00538 pInfoCurrent->ulBlockOffset + -<a name="l00539"></a>00539 pInfoCurrent->tByteNext; -<a name="l00540"></a>00540 } -<a name="l00541"></a>00541 <span class="keywordflow">if</span> (pulCharPos != NULL) { -<a name="l00542"></a>00542 *pulCharPos = -<a name="l00543"></a>00543 pInfoCurrent->pBlockCurrent->tInfo.ulCharPos + -<a name="l00544"></a>00544 pInfoCurrent->ulBlockOffset + -<a name="l00545"></a>00545 pInfoCurrent->tByteNext; -<a name="l00546"></a>00546 } -<a name="l00547"></a>00547 <span class="keywordflow">if</span> (pusPropMod != NULL) { -<a name="l00548"></a>00548 *pusPropMod = pInfoCurrent->pBlockCurrent->tInfo.usPropMod; -<a name="l00549"></a>00549 } -<a name="l00550"></a>00550 <span class="keywordflow">return</span> (USHORT)pInfoCurrent->aucBlock[pInfoCurrent->tByteNext++]; -<a name="l00551"></a>00551 } <span class="comment">/* end of usGetNextByte */</span> -<a name="l00552"></a>00552 -<a name="l00553"></a>00553 -<a name="l00554"></a>00554 <span class="comment">/*</span> -<a name="l00555"></a>00555 <span class="comment"> * usGetNextChar - get the next character from the specified block list</span> -<a name="l00556"></a>00556 <span class="comment"> */</span> -<a name="l00557"></a>00557 <span class="keyword">static</span> USHORT -<a name="l00558"></a>00558 usGetNextChar(FILE *pFile, list_id_enum eListID, -<a name="l00559"></a>00559 ULONG *pulFileOffset, ULONG *pulCharPos, USHORT *pusPropMod) -<a name="l00560"></a>00560 { -<a name="l00561"></a>00561 readinfo_type *pReadinfo; -<a name="l00562"></a>00562 list_mem_type *pAnchor; -<a name="l00563"></a>00563 USHORT usLSB, usMSB; -<a name="l00564"></a>00564 -<a name="l00565"></a>00565 <span class="keywordflow">switch</span> (eListID) { -<a name="l00566"></a>00566 <span class="keywordflow">case</span> text_list: -<a name="l00567"></a>00567 pReadinfo = &tOthers; -<a name="l00568"></a>00568 pAnchor = pTextAnchor; -<a name="l00569"></a>00569 <span class="keywordflow">break</span>; -<a name="l00570"></a>00570 <span class="keywordflow">case</span> footnote_list: -<a name="l00571"></a>00571 pReadinfo = &tFootnote; -<a name="l00572"></a>00572 pAnchor = pFootnoteAnchor; -<a name="l00573"></a>00573 <span class="keywordflow">break</span>; -<a name="l00574"></a>00574 <span class="keywordflow">case</span> hdrftr_list: -<a name="l00575"></a>00575 pReadinfo = &tHdrFtr; -<a name="l00576"></a>00576 pAnchor = pHdrFtrAnchor; -<a name="l00577"></a>00577 <span class="keywordflow">break</span>; -<a name="l00578"></a>00578 <span class="keywordflow">case</span> endnote_list: -<a name="l00579"></a>00579 pReadinfo = &tOthers; -<a name="l00580"></a>00580 pAnchor = pEndnoteAnchor; -<a name="l00581"></a>00581 <span class="keywordflow">break</span>; -<a name="l00582"></a>00582 <span class="keywordflow">case</span> textbox_list: -<a name="l00583"></a>00583 pReadinfo = &tOthers; -<a name="l00584"></a>00584 pAnchor = pTextBoxAnchor; -<a name="l00585"></a>00585 <span class="keywordflow">break</span>; -<a name="l00586"></a>00586 <span class="keywordflow">case</span> hdrtextbox_list: -<a name="l00587"></a>00587 pReadinfo = &tOthers; -<a name="l00588"></a>00588 pAnchor = pHdrTextBoxAnchor; -<a name="l00589"></a>00589 <span class="keywordflow">break</span>; -<a name="l00590"></a>00590 <span class="keywordflow">default</span>: -<a name="l00591"></a>00591 DBG_DEC(eListID); -<a name="l00592"></a>00592 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00593"></a>00593 } -<a name="l00594"></a>00594 -<a name="l00595"></a>00595 usLSB = usGetNextByte(pFile, pReadinfo, pAnchor, -<a name="l00596"></a>00596 pulFileOffset, pulCharPos, pusPropMod); -<a name="l00597"></a>00597 <span class="keywordflow">if</span> (usLSB == (USHORT)EOF) { -<a name="l00598"></a>00598 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00599"></a>00599 } -<a name="l00600"></a>00600 fail(pReadinfo->pBlockCurrent == NULL); -<a name="l00601"></a>00601 -<a name="l00602"></a>00602 <span class="keywordflow">if</span> (pReadinfo->pBlockCurrent->tInfo.bUsesUnicode) { -<a name="l00603"></a>00603 usMSB = usGetNextByte(pFile, -<a name="l00604"></a>00604 pReadinfo, pAnchor, NULL, NULL, NULL); -<a name="l00605"></a>00605 } <span class="keywordflow">else</span> { -<a name="l00606"></a>00606 usMSB = 0x00; -<a name="l00607"></a>00607 } -<a name="l00608"></a>00608 <span class="keywordflow">if</span> (usMSB == (USHORT)EOF) { -<a name="l00609"></a>00609 DBG_MSG(<span class="stringliteral">"usGetNextChar: Unexpected EOF"</span>); -<a name="l00610"></a>00610 DBG_HEX_C(pulFileOffset != NULL, *pulFileOffset); -<a name="l00611"></a>00611 DBG_HEX_C(pulCharPos != NULL, *pulCharPos); -<a name="l00612"></a>00612 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00613"></a>00613 } -<a name="l00614"></a>00614 <span class="keywordflow">return</span> (usMSB << 8) | usLSB; -<a name="l00615"></a>00615 } <span class="comment">/* end of usGetNextChar */</span> -<a name="l00616"></a>00616 -<a name="l00617"></a>00617 <span class="comment">/*</span> -<a name="l00618"></a>00618 <span class="comment"> * usNextChar - get the next character from the given block list</span> -<a name="l00619"></a>00619 <span class="comment"> */</span> -<a name="l00620"></a>00620 USHORT -<a name="l00621"></a>00621 usNextChar(FILE *pFile, list_id_enum eListID, -<a name="l00622"></a>00622 ULONG *pulFileOffset, ULONG *pulCharPos, USHORT *pusPropMod) -<a name="l00623"></a>00623 { -<a name="l00624"></a>00624 USHORT usRetVal; -<a name="l00625"></a>00625 -<a name="l00626"></a>00626 fail(pFile == NULL); -<a name="l00627"></a>00627 -<a name="l00628"></a>00628 usRetVal = usGetNextChar(pFile, eListID, -<a name="l00629"></a>00629 pulFileOffset, pulCharPos, pusPropMod); -<a name="l00630"></a>00630 <span class="keywordflow">if</span> (usRetVal == (USHORT)EOF) { -<a name="l00631"></a>00631 <span class="keywordflow">if</span> (pulFileOffset != NULL) { -<a name="l00632"></a>00632 *pulFileOffset = FC_INVALID; -<a name="l00633"></a>00633 } -<a name="l00634"></a>00634 <span class="keywordflow">if</span> (pulCharPos != NULL) { -<a name="l00635"></a>00635 *pulCharPos = CP_INVALID; -<a name="l00636"></a>00636 } -<a name="l00637"></a>00637 <span class="keywordflow">if</span> (pusPropMod != NULL) { -<a name="l00638"></a>00638 *pusPropMod = IGNORE_PROPMOD; -<a name="l00639"></a>00639 } -<a name="l00640"></a>00640 } -<a name="l00641"></a>00641 <span class="keywordflow">return</span> usRetVal; -<a name="l00642"></a>00642 } <span class="comment">/* end of usNextChar */</span> -<a name="l00643"></a>00643 -<a name="l00644"></a>00644 <span class="comment">/*</span> -<a name="l00645"></a>00645 <span class="comment"> * usToHdrFtrPosition - Go to a character position in header/foorter list</span> -<a name="l00646"></a>00646 <span class="comment"> *</span> -<a name="l00647"></a>00647 <span class="comment"> * Returns the character found on the specified character position</span> -<a name="l00648"></a>00648 <span class="comment"> */</span> -<a name="l00649"></a>00649 USHORT -<a name="l00650"></a>00650 usToHdrFtrPosition(FILE *pFile, ULONG ulCharPos) -<a name="l00651"></a>00651 { -<a name="l00652"></a>00652 ULONG ulCharPosCurr; -<a name="l00653"></a>00653 USHORT usChar; -<a name="l00654"></a>00654 -<a name="l00655"></a>00655 tHdrFtr.pBlockCurrent = NULL; <span class="comment">/* To reset the header/footer list */</span> -<a name="l00656"></a>00656 <span class="keywordflow">do</span> { -<a name="l00657"></a>00657 usChar = usNextChar(pFile, -<a name="l00658"></a>00658 hdrftr_list, NULL, &ulCharPosCurr, NULL); -<a name="l00659"></a>00659 } <span class="keywordflow">while</span> (usChar != (USHORT)EOF && ulCharPosCurr != ulCharPos); -<a name="l00660"></a>00660 <span class="keywordflow">return</span> usChar; -<a name="l00661"></a>00661 } <span class="comment">/* end of usToHdrFtrPosition */</span> -<a name="l00662"></a>00662 -<a name="l00663"></a>00663 <span class="comment">/*</span> -<a name="l00664"></a>00664 <span class="comment"> * usToFootnotePosition - Go to a character position in footnote list</span> -<a name="l00665"></a>00665 <span class="comment"> *</span> -<a name="l00666"></a>00666 <span class="comment"> * Returns the character found on the specified character position</span> -<a name="l00667"></a>00667 <span class="comment"> */</span> -<a name="l00668"></a>00668 USHORT -<a name="l00669"></a>00669 usToFootnotePosition(FILE *pFile, ULONG ulCharPos) -<a name="l00670"></a>00670 { -<a name="l00671"></a>00671 ULONG ulCharPosCurr; -<a name="l00672"></a>00672 USHORT usChar; -<a name="l00673"></a>00673 -<a name="l00674"></a>00674 tFootnote.pBlockCurrent = NULL; <span class="comment">/* To reset the footnote list */</span> -<a name="l00675"></a>00675 <span class="keywordflow">do</span> { -<a name="l00676"></a>00676 usChar = usNextChar(pFile, -<a name="l00677"></a>00677 footnote_list, NULL, &ulCharPosCurr, NULL); -<a name="l00678"></a>00678 } <span class="keywordflow">while</span> (usChar != (USHORT)EOF && ulCharPosCurr != ulCharPos); -<a name="l00679"></a>00679 <span class="keywordflow">return</span> usChar; -<a name="l00680"></a>00680 } <span class="comment">/* end of usToFootnotePosition */</span> -<a name="l00681"></a>00681 -<a name="l00682"></a>00682 <span class="comment">/*</span> -<a name="l00683"></a>00683 <span class="comment"> * Convert a character position to an offset in the file.</span> -<a name="l00684"></a>00684 <span class="comment"> * Logical to physical offset.</span> -<a name="l00685"></a>00685 <span class="comment"> *</span> -<a name="l00686"></a>00686 <span class="comment"> * Returns: FC_INVALID: in case of error</span> -<a name="l00687"></a>00687 <span class="comment"> * otherwise: the computed file offset</span> -<a name="l00688"></a>00688 <span class="comment"> */</span> -<a name="l00689"></a>00689 ULONG -<a name="l00690"></a>00690 ulCharPos2FileOffsetX(ULONG ulCharPos, list_id_enum *peListID) -<a name="l00691"></a>00691 { -<a name="l00692"></a>00692 <span class="keyword">static</span> list_id_enum eListIDs[8] = { -<a name="l00693"></a>00693 text_list, footnote_list, hdrftr_list, -<a name="l00694"></a>00694 macro_list, annotation_list, endnote_list, -<a name="l00695"></a>00695 textbox_list, hdrtextbox_list, -<a name="l00696"></a>00696 }; -<a name="l00697"></a>00697 list_mem_type *apAnchors[8]; -<a name="l00698"></a>00698 list_mem_type *pCurr; -<a name="l00699"></a>00699 list_id_enum eListGuess; -<a name="l00700"></a>00700 ULONG ulBestGuess; -<a name="l00701"></a>00701 <span class="keywordtype">size_t</span> tIndex; -<a name="l00702"></a>00702 -<a name="l00703"></a>00703 fail(peListID == NULL); -<a name="l00704"></a>00704 -<a name="l00705"></a>00705 <span class="keywordflow">if</span> (ulCharPos == CP_INVALID) { -<a name="l00706"></a>00706 *peListID = no_list; -<a name="l00707"></a>00707 <span class="keywordflow">return</span> FC_INVALID; -<a name="l00708"></a>00708 } -<a name="l00709"></a>00709 -<a name="l00710"></a>00710 apAnchors[0] = pTextAnchor; -<a name="l00711"></a>00711 apAnchors[1] = pFootnoteAnchor; -<a name="l00712"></a>00712 apAnchors[2] = pHdrFtrAnchor; -<a name="l00713"></a>00713 apAnchors[3] = pMacroAnchor; -<a name="l00714"></a>00714 apAnchors[4] = pAnnotationAnchor; -<a name="l00715"></a>00715 apAnchors[5] = pEndnoteAnchor; -<a name="l00716"></a>00716 apAnchors[6] = pTextBoxAnchor; -<a name="l00717"></a>00717 apAnchors[7] = pHdrTextBoxAnchor; -<a name="l00718"></a>00718 -<a name="l00719"></a>00719 eListGuess = no_list; <span class="comment">/* Best guess is no list */</span> -<a name="l00720"></a>00720 ulBestGuess = FC_INVALID; <span class="comment">/* Best guess is "file offset not found" */</span> -<a name="l00721"></a>00721 -<a name="l00722"></a>00722 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(apAnchors); tIndex++) { -<a name="l00723"></a>00723 <span class="keywordflow">for</span> (pCurr = apAnchors[tIndex]; -<a name="l00724"></a>00724 pCurr != NULL; -<a name="l00725"></a>00725 pCurr = pCurr->pNext) { -<a name="l00726"></a>00726 <span class="keywordflow">if</span> (ulCharPos == pCurr->tInfo.ulCharPos + -<a name="l00727"></a>00727 pCurr->tInfo.ulLength && -<a name="l00728"></a>00728 pCurr->pNext != NULL) { -<a name="l00729"></a>00729 <span class="comment">/*</span> -<a name="l00730"></a>00730 <span class="comment"> * The character position is one beyond this</span> -<a name="l00731"></a>00731 <span class="comment"> * block, so we guess it's the first byte of</span> -<a name="l00732"></a>00732 <span class="comment"> * the next block (if there is a next block)</span> -<a name="l00733"></a>00733 <span class="comment"> */</span> -<a name="l00734"></a>00734 eListGuess= eListIDs[tIndex]; -<a name="l00735"></a>00735 ulBestGuess = pCurr->pNext->tInfo.ulFileOffset; -<a name="l00736"></a>00736 } -<a name="l00737"></a>00737 -<a name="l00738"></a>00738 <span class="keywordflow">if</span> (ulCharPos < pCurr->tInfo.ulCharPos || -<a name="l00739"></a>00739 ulCharPos >= pCurr->tInfo.ulCharPos + -<a name="l00740"></a>00740 pCurr->tInfo.ulLength) { -<a name="l00741"></a>00741 <span class="comment">/* Character position is not in this block */</span> -<a name="l00742"></a>00742 <span class="keywordflow">continue</span>; -<a name="l00743"></a>00743 } -<a name="l00744"></a>00744 -<a name="l00745"></a>00745 <span class="comment">/* The character position is in the current block */</span> -<a name="l00746"></a>00746 *peListID = eListIDs[tIndex]; -<a name="l00747"></a>00747 <span class="keywordflow">return</span> pCurr->tInfo.ulFileOffset + -<a name="l00748"></a>00748 ulCharPos - pCurr->tInfo.ulCharPos; -<a name="l00749"></a>00749 } -<a name="l00750"></a>00750 } -<a name="l00751"></a>00751 <span class="comment">/* Passed beyond the end of the last list */</span> -<a name="l00752"></a>00752 NO_DBG_HEX(ulCharPos); -<a name="l00753"></a>00753 NO_DBG_HEX(ulBestGuess); -<a name="l00754"></a>00754 *peListID = eListGuess; -<a name="l00755"></a>00755 <span class="keywordflow">return</span> ulBestGuess; -<a name="l00756"></a>00756 } <span class="comment">/* end of ulCharPos2FileOffsetX */</span> -<a name="l00757"></a>00757 -<a name="l00758"></a>00758 <span class="comment">/*</span> -<a name="l00759"></a>00759 <span class="comment"> * Convert a character position to an offset in the file.</span> -<a name="l00760"></a>00760 <span class="comment"> * Logical to physical offset.</span> -<a name="l00761"></a>00761 <span class="comment"> *</span> -<a name="l00762"></a>00762 <span class="comment"> * Returns: FC_INVALID: in case of error</span> -<a name="l00763"></a>00763 <span class="comment"> * otherwise: the computed file offset</span> -<a name="l00764"></a>00764 <span class="comment"> */</span> -<a name="l00765"></a>00765 ULONG -<a name="l00766"></a>00766 ulCharPos2FileOffset(ULONG ulCharPos) -<a name="l00767"></a>00767 { -<a name="l00768"></a>00768 list_id_enum eListID; -<a name="l00769"></a>00769 -<a name="l00770"></a>00770 <span class="keywordflow">return</span> ulCharPos2FileOffsetX(ulCharPos, &eListID); -<a name="l00771"></a>00771 } <span class="comment">/* end of ulCharPos2FileOffset */</span> -<a name="l00772"></a>00772 -<a name="l00773"></a>00773 <span class="comment">/*</span> -<a name="l00774"></a>00774 <span class="comment"> * Convert an offset in the header/footer list to a character position.</span> -<a name="l00775"></a>00775 <span class="comment"> *</span> -<a name="l00776"></a>00776 <span class="comment"> * Returns: CP_INVALID: in case of error</span> -<a name="l00777"></a>00777 <span class="comment"> * otherwise: the computed character position</span> -<a name="l00778"></a>00778 <span class="comment"> */</span> -<a name="l00779"></a>00779 ULONG -<a name="l00780"></a>00780 ulHdrFtrOffset2CharPos(ULONG ulHdrFtrOffset) -<a name="l00781"></a>00781 { -<a name="l00782"></a>00782 list_mem_type *pCurr; -<a name="l00783"></a>00783 ULONG ulOffset; -<a name="l00784"></a>00784 -<a name="l00785"></a>00785 ulOffset = ulHdrFtrOffset; -<a name="l00786"></a>00786 <span class="keywordflow">for</span> (pCurr = pHdrFtrAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00787"></a>00787 <span class="keywordflow">if</span> (ulOffset >= pCurr->tInfo.ulLength) { -<a name="l00788"></a>00788 <span class="comment">/* The offset is not in this block */</span> -<a name="l00789"></a>00789 ulOffset -= pCurr->tInfo.ulLength; -<a name="l00790"></a>00790 <span class="keywordflow">continue</span>; -<a name="l00791"></a>00791 } -<a name="l00792"></a>00792 <span class="keywordflow">return</span> pCurr->tInfo.ulCharPos + ulOffset; -<a name="l00793"></a>00793 } -<a name="l00794"></a>00794 <span class="keywordflow">return</span> CP_INVALID; -<a name="l00795"></a>00795 } <span class="comment">/* end of ulHdrFtrOffset2CharPos */</span> -<a name="l00796"></a>00796 -<a name="l00797"></a>00797 <span class="comment">/*</span> -<a name="l00798"></a>00798 <span class="comment"> * Get the sequence number beloning to the given file offset</span> -<a name="l00799"></a>00799 <span class="comment"> *</span> -<a name="l00800"></a>00800 <span class="comment"> * Returns the sequence number</span> -<a name="l00801"></a>00801 <span class="comment"> */</span> -<a name="l00802"></a>00802 ULONG -<a name="l00803"></a>00803 ulGetSeqNumber(ULONG ulFileOffset) -<a name="l00804"></a>00804 { -<a name="l00805"></a>00805 list_mem_type *pCurr; -<a name="l00806"></a>00806 ULONG ulSeq; -<a name="l00807"></a>00807 -<a name="l00808"></a>00808 <span class="keywordflow">if</span> (ulFileOffset == FC_INVALID) { -<a name="l00809"></a>00809 <span class="keywordflow">return</span> FC_INVALID; -<a name="l00810"></a>00810 } -<a name="l00811"></a>00811 -<a name="l00812"></a>00812 ulSeq = 0; -<a name="l00813"></a>00813 <span class="keywordflow">for</span> (pCurr = pTextAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00814"></a>00814 <span class="keywordflow">if</span> (ulFileOffset >= pCurr->tInfo.ulFileOffset && -<a name="l00815"></a>00815 ulFileOffset < pCurr->tInfo.ulFileOffset + -<a name="l00816"></a>00816 pCurr->tInfo.ulLength) { -<a name="l00817"></a>00817 <span class="comment">/* The file offset is within the current textblock */</span> -<a name="l00818"></a>00818 <span class="keywordflow">return</span> ulSeq + ulFileOffset - pCurr->tInfo.ulFileOffset; -<a name="l00819"></a>00819 } -<a name="l00820"></a>00820 ulSeq += pCurr->tInfo.ulLength; -<a name="l00821"></a>00821 } -<a name="l00822"></a>00822 <span class="keywordflow">return</span> FC_INVALID; -<a name="l00823"></a>00823 } <span class="comment">/* end of ulGetSeqNumber */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/chartrans_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,736 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/chartrans.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/chartrans.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * chartrans.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Translate Word characters to local representation</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <ctype.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#if defined(__STDC_ISO_10646__)</span> -<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include <wctype.h></span> -<a name="l00014"></a>00014 <span class="preprocessor">#endif </span><span class="comment">/* __STDC_ISO_10646__ */</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usCp850[] = { <span class="comment">/* DOS implementation of Latin1 */</span> -<a name="l00018"></a>00018 0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7, -<a name="l00019"></a>00019 0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5, -<a name="l00020"></a>00020 0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9, -<a name="l00021"></a>00021 0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192, -<a name="l00022"></a>00022 0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba, -<a name="l00023"></a>00023 0x00bf, 0x00ae, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb, -<a name="l00024"></a>00024 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x00c0, -<a name="l00025"></a>00025 0x00a9, 0x2563, 0x2551, 0x2557, 0x255d, 0x00a2, 0x00a5, 0x2510, -<a name="l00026"></a>00026 0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x00e3, 0x00c3, -<a name="l00027"></a>00027 0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4, -<a name="l00028"></a>00028 0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x0131, 0x00cd, 0x00ce, -<a name="l00029"></a>00029 0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580, -<a name="l00030"></a>00030 0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe, -<a name="l00031"></a>00031 0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4, -<a name="l00032"></a>00032 0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8, -<a name="l00033"></a>00033 0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0, -<a name="l00034"></a>00034 }; -<a name="l00035"></a>00035 -<a name="l00036"></a>00036 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usCp1250[] = { <span class="comment">/* Windows implementation of Latin2 */</span> -<a name="l00037"></a>00037 0x20ac, 0x003f, 0x201a, 0x003f, 0x201e, 0x2026, 0x2020, 0x2021, -<a name="l00038"></a>00038 0x003f, 0x2030, 0x0160, 0x2039, 0x015a, 0x0164, 0x017d, 0x0179, -<a name="l00039"></a>00039 0x003f, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, -<a name="l00040"></a>00040 0x003f, 0x2122, 0x0161, 0x203a, 0x015b, 0x0165, 0x017e, 0x017a, -<a name="l00041"></a>00041 0x00a0, 0x02c7, 0x02d8, 0x0141, 0x00a4, 0x0104, 0x00a6, 0x00a7, -<a name="l00042"></a>00042 0x00a8, 0x00a9, 0x015e, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x017b, -<a name="l00043"></a>00043 0x00b0, 0x00b1, 0x02db, 0x0142, 0x00b4, 0x00b5, 0x00b6, 0x00b7, -<a name="l00044"></a>00044 0x00b8, 0x0105, 0x015f, 0x00bb, 0x013d, 0x02dd, 0x013e, 0x017c, -<a name="l00045"></a>00045 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, -<a name="l00046"></a>00046 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, -<a name="l00047"></a>00047 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, -<a name="l00048"></a>00048 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, -<a name="l00049"></a>00049 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, -<a name="l00050"></a>00050 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, -<a name="l00051"></a>00051 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, -<a name="l00052"></a>00052 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, -<a name="l00053"></a>00053 }; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usCp1251[] = { <span class="comment">/* Windows implementation of Cyrillic */</span> -<a name="l00056"></a>00056 0x0402, 0x0403, 0x201a, 0x0453, 0x201e, 0x2026, 0x2020, 0x2021, -<a name="l00057"></a>00057 0x20ac, 0x2030, 0x0409, 0x2039, 0x040a, 0x040c, 0x040b, 0x040f, -<a name="l00058"></a>00058 0x0452, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, -<a name="l00059"></a>00059 0x00f3, 0x2122, 0x0459, 0x203a, 0x045a, 0x045c, 0x045b, 0x045f, -<a name="l00060"></a>00060 0x00a0, 0x040e, 0x045e, 0x0408, 0x00a4, 0x0490, 0x00a6, 0x00a7, -<a name="l00061"></a>00061 0x0401, 0x00a9, 0x0404, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x0407, -<a name="l00062"></a>00062 0x00b0, 0x00b1, 0x0406, 0x0456, 0x0491, 0x00b5, 0x00b6, 0x00b7, -<a name="l00063"></a>00063 0x0451, 0x2116, 0x0454, 0x00bb, 0x0458, 0x0405, 0x0455, 0x0457, -<a name="l00064"></a>00064 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, -<a name="l00065"></a>00065 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, -<a name="l00066"></a>00066 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, -<a name="l00067"></a>00067 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, -<a name="l00068"></a>00068 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, -<a name="l00069"></a>00069 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, -<a name="l00070"></a>00070 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, -<a name="l00071"></a>00071 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, -<a name="l00072"></a>00072 }; -<a name="l00073"></a>00073 -<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usCp1252[] = { <span class="comment">/* Windows implementation of Latin1 */</span> -<a name="l00075"></a>00075 0x20ac, 0x003f, 0x201a, 0x0192, 0x201e, 0x2026, 0x2020, 0x2021, -<a name="l00076"></a>00076 0x02c6, 0x2030, 0x0160, 0x2039, 0x0152, 0x003f, 0x017d, 0x003f, -<a name="l00077"></a>00077 0x003f, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, -<a name="l00078"></a>00078 0x02dc, 0x2122, 0x0161, 0x203a, 0x0153, 0x003f, 0x017e, 0x0178, -<a name="l00079"></a>00079 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, -<a name="l00080"></a>00080 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, -<a name="l00081"></a>00081 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, -<a name="l00082"></a>00082 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, -<a name="l00083"></a>00083 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, -<a name="l00084"></a>00084 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, -<a name="l00085"></a>00085 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, -<a name="l00086"></a>00086 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, -<a name="l00087"></a>00087 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, -<a name="l00088"></a>00088 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, -<a name="l00089"></a>00089 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, -<a name="l00090"></a>00090 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, -<a name="l00091"></a>00091 }; -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usMacRoman[] = { <span class="comment">/* Apple implementation of Latin1 */</span> -<a name="l00094"></a>00094 0x00c4, 0x00c5, 0x00c7, 0x00c9, 0x00d1, 0x00d6, 0x00dc, 0x00e1, -<a name="l00095"></a>00095 0x00e0, 0x00e2, 0x00e4, 0x00e3, 0x00e5, 0x00e7, 0x00e9, 0x00e8, -<a name="l00096"></a>00096 0x00ea, 0x00eb, 0x00ed, 0x00ec, 0x00ee, 0x00ef, 0x00f1, 0x00f3, -<a name="l00097"></a>00097 0x00f2, 0x00f4, 0x00f6, 0x00f5, 0x00fa, 0x00f9, 0x00fb, 0x00fc, -<a name="l00098"></a>00098 0x2020, 0x00b0, 0x00a2, 0x00a3, 0x00a7, 0x2022, 0x00b6, 0x00df, -<a name="l00099"></a>00099 0x00ae, 0x00a9, 0x2122, 0x00b4, 0x00a8, 0x2260, 0x00c6, 0x00d8, -<a name="l00100"></a>00100 0x221e, 0x00b1, 0x2264, 0x2265, 0x00a5, 0x00b5, 0x2202, 0x2211, -<a name="l00101"></a>00101 0x220f, 0x03c0, 0x222b, 0x00aa, 0x00ba, 0x2126, 0x00e6, 0x00f8, -<a name="l00102"></a>00102 0x00bf, 0x00a1, 0x00ac, 0x221a, 0x0192, 0x2248, 0x2206, 0x00ab, -<a name="l00103"></a>00103 0x00bb, 0x2026, 0x00a0, 0x00c0, 0x00c3, 0x00d5, 0x0152, 0x0153, -<a name="l00104"></a>00104 0x2013, 0x2014, 0x201c, 0x201d, 0x2018, 0x2019, 0x00f7, 0x25ca, -<a name="l00105"></a>00105 0x00ff, 0x0178, 0x2044, 0x00a4, 0x2039, 0x203a, 0xfb01, 0xfb02, -<a name="l00106"></a>00106 0x2021, 0x00b7, 0x201a, 0x201e, 0x2030, 0x00c2, 0x00ca, 0x00c1, -<a name="l00107"></a>00107 0x00cb, 0x00c8, 0x00cd, 0x00ce, 0x00cf, 0x00cc, 0x00d3, 0x00d4, -<a name="l00108"></a>00108 0x003f, 0x00d2, 0x00da, 0x00db, 0x00d9, 0x0131, 0x02c6, 0x02dc, -<a name="l00109"></a>00109 0x00af, 0x02d8, 0x02d9, 0x02da, 0x00b8, 0x02dd, 0x02db, 0x02c7, -<a name="l00110"></a>00110 }; -<a name="l00111"></a>00111 -<a name="l00112"></a>00112 <span class="keyword">static</span> <span class="keyword">const</span> USHORT usPrivateArea[] = { -<a name="l00113"></a>00113 0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220d, -<a name="l00114"></a>00114 0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f, -<a name="l00115"></a>00115 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, -<a name="l00116"></a>00116 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x2019, 0x003e, 0x003f, -<a name="l00117"></a>00117 0x201d, 0x201c, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393, -<a name="l00118"></a>00118 0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f, -<a name="l00119"></a>00119 0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9, -<a name="l00120"></a>00120 0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f, -<a name="l00121"></a>00121 0x003f, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3, -<a name="l00122"></a>00122 0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf, -<a name="l00123"></a>00123 0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9, -<a name="l00124"></a>00124 0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x003f, -<a name="l00125"></a>00125 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, -<a name="l00126"></a>00126 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, -<a name="l00127"></a>00127 0x003f, 0x003f, 0x003f, 0x2022, 0x003f, 0x003f, 0x003f, 0x003f, -<a name="l00128"></a>00128 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, 0x003f, -<a name="l00129"></a>00129 0x20ac, 0x03d2, 0x2032, 0x2264, 0x2044, 0x221e, 0x0192, 0x2663, -<a name="l00130"></a>00130 0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193, -<a name="l00131"></a>00131 0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022, -<a name="l00132"></a>00132 0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0x007c, 0x23af, 0x21b5, -<a name="l00133"></a>00133 0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229, -<a name="l00134"></a>00134 0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209, -<a name="l00135"></a>00135 0x2220, 0x2207, 0x00ae, 0x00a9, 0x2122, 0x220f, 0x221a, 0x22c5, -<a name="l00136"></a>00136 0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3, -<a name="l00137"></a>00137 0x22c4, 0x3008, 0x00ae, 0x00a9, 0x2122, 0x2211, 0x239b, 0x239c, -<a name="l00138"></a>00138 0x239d, 0x23a1, 0x23a2, 0x23a3, 0x23a7, 0x23a8, 0x23a9, 0x23aa, -<a name="l00139"></a>00139 0x003f, 0x3009, 0x222b, 0x2320, 0x23ae, 0x2321, 0x239e, 0x239f, -<a name="l00140"></a>00140 0x23a0, 0x23a4, 0x23a5, 0x23a6, 0x23ab, 0x23ac, 0x23ad, 0x003f, -<a name="l00141"></a>00141 }; -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 <span class="keyword">typedef</span> <span class="keyword">struct </span>char_table_tag { -<a name="l00144"></a>00144 UCHAR ucLocal; -<a name="l00145"></a>00145 USHORT usUnicode; -<a name="l00146"></a>00146 } char_table_type; -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="keyword">static</span> char_table_type atCharTable[256]; -<a name="l00149"></a>00149 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tNextPosFree = 0; -<a name="l00150"></a>00150 -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 <span class="comment">/*</span> -<a name="l00153"></a>00153 <span class="comment"> * iCompare - compare two records</span> -<a name="l00154"></a>00154 <span class="comment"> *</span> -<a name="l00155"></a>00155 <span class="comment"> * Compares two records. For use by qsort(3C) and bsearch(3C).</span> -<a name="l00156"></a>00156 <span class="comment"> *</span> -<a name="l00157"></a>00157 <span class="comment"> * returns -1 if rec1 < rec2, 0 if rec1 == rec2, 1 if rec1 > rec2</span> -<a name="l00158"></a>00158 <span class="comment"> */</span> -<a name="l00159"></a>00159 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00160"></a>00160 iCompare(<span class="keyword">const</span> <span class="keywordtype">void</span> *pvRecord1, <span class="keyword">const</span> <span class="keywordtype">void</span> *pvRecord2) -<a name="l00161"></a>00161 { -<a name="l00162"></a>00162 USHORT usUnicode1, usUnicode2; -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 usUnicode1 = ((char_table_type *)pvRecord1)->usUnicode; -<a name="l00165"></a>00165 usUnicode2 = ((char_table_type *)pvRecord2)->usUnicode; -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 <span class="keywordflow">if</span> (usUnicode1 < usUnicode2) { -<a name="l00168"></a>00168 <span class="keywordflow">return</span> -1; -<a name="l00169"></a>00169 } -<a name="l00170"></a>00170 <span class="keywordflow">if</span> (usUnicode1 > usUnicode2) { -<a name="l00171"></a>00171 <span class="keywordflow">return</span> 1; -<a name="l00172"></a>00172 } -<a name="l00173"></a>00173 <span class="keywordflow">return</span> 0; -<a name="l00174"></a>00174 } <span class="comment">/* end of iCompare */</span> -<a name="l00175"></a>00175 -<a name="l00176"></a>00176 <span class="comment">/*</span> -<a name="l00177"></a>00177 <span class="comment"> * pGetCharTableRecord - get the character table record</span> -<a name="l00178"></a>00178 <span class="comment"> *</span> -<a name="l00179"></a>00179 <span class="comment"> * returns a pointer to the record when found, otherwise NULL</span> -<a name="l00180"></a>00180 <span class="comment"> */</span> -<a name="l00181"></a>00181 <span class="keyword">static</span> <span class="keyword">const</span> char_table_type * -<a name="l00182"></a>00182 pGetCharTableRecord(USHORT usUnicode) -<a name="l00183"></a>00183 { -<a name="l00184"></a>00184 char_table_type tKey; -<a name="l00185"></a>00185 -<a name="l00186"></a>00186 <span class="keywordflow">if</span> (tNextPosFree == 0) { -<a name="l00187"></a>00187 <span class="keywordflow">return</span> NULL; -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 tKey.usUnicode = usUnicode; -<a name="l00190"></a>00190 tKey.ucLocal = 0; -<a name="l00191"></a>00191 <span class="keywordflow">return</span> (char_table_type *)bsearch(&tKey, -<a name="l00192"></a>00192 atCharTable, -<a name="l00193"></a>00193 tNextPosFree, <span class="keyword">sizeof</span>(atCharTable[0]), -<a name="l00194"></a>00194 iCompare); -<a name="l00195"></a>00195 } <span class="comment">/* end of pGetCharTableRecord */</span> -<a name="l00196"></a>00196 -<a name="l00197"></a>00197 <span class="comment">/*</span> -<a name="l00198"></a>00198 <span class="comment"> * ucGetBulletCharacter - get the local representation of the bullet</span> -<a name="l00199"></a>00199 <span class="comment"> */</span> -<a name="l00200"></a>00200 UCHAR -<a name="l00201"></a>00201 ucGetBulletCharacter(conversion_type eConversionType, encoding_type eEncoding) -<a name="l00202"></a>00202 { -<a name="l00203"></a>00203 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00204"></a>00204 <span class="preprocessor"></span> <span class="keywordflow">return</span> 0x8f; -<a name="l00205"></a>00205 <span class="preprocessor">#else</span> -<a name="l00206"></a>00206 <span class="preprocessor"></span> <span class="keyword">const</span> char_table_type *pRec; -<a name="l00207"></a>00207 -<a name="l00208"></a>00208 fail(eEncoding == encoding_utf_8); -<a name="l00209"></a>00209 -<a name="l00210"></a>00210 <span class="keywordflow">if</span> (eEncoding == encoding_latin_1 && -<a name="l00211"></a>00211 (eConversionType == conversion_ps || -<a name="l00212"></a>00212 eConversionType == conversion_pdf)) { -<a name="l00213"></a>00213 <span class="comment">/* Ugly, but it makes the PostScript and PDF look better */</span> -<a name="l00214"></a>00214 <span class="keywordflow">return</span> (UCHAR)143; -<a name="l00215"></a>00215 } -<a name="l00216"></a>00216 <span class="keywordflow">if</span> (eConversionType != conversion_text && -<a name="l00217"></a>00217 eConversionType != conversion_fmt_text) { -<a name="l00218"></a>00218 pRec = pGetCharTableRecord(UNICODE_BULLET); -<a name="l00219"></a>00219 <span class="keywordflow">if</span> (pRec != NULL) { -<a name="l00220"></a>00220 <span class="keywordflow">return</span> pRec->ucLocal; -<a name="l00221"></a>00221 } -<a name="l00222"></a>00222 pRec = pGetCharTableRecord(UNICODE_BULLET_OPERATOR); -<a name="l00223"></a>00223 <span class="keywordflow">if</span> (pRec != NULL) { -<a name="l00224"></a>00224 <span class="keywordflow">return</span> pRec->ucLocal; -<a name="l00225"></a>00225 } -<a name="l00226"></a>00226 pRec = pGetCharTableRecord(UNICODE_MIDDLE_DOT); -<a name="l00227"></a>00227 <span class="keywordflow">if</span> (pRec != NULL) { -<a name="l00228"></a>00228 <span class="keywordflow">return</span> pRec->ucLocal; -<a name="l00229"></a>00229 } -<a name="l00230"></a>00230 } -<a name="l00231"></a>00231 <span class="keywordflow">return</span> (UCHAR)<span class="charliteral">'.'</span>; -<a name="l00232"></a>00232 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00233"></a>00233 } <span class="comment">/* end of ucGetBulletCharacter */</span> -<a name="l00234"></a>00234 -<a name="l00235"></a>00235 <span class="comment">/*</span> -<a name="l00236"></a>00236 <span class="comment"> * ucGetNbspCharacter - get the local representation of the non-breaking space</span> -<a name="l00237"></a>00237 <span class="comment"> */</span> -<a name="l00238"></a>00238 UCHAR -<a name="l00239"></a>00239 ucGetNbspCharacter(<span class="keywordtype">void</span>) -<a name="l00240"></a>00240 { -<a name="l00241"></a>00241 <span class="keyword">const</span> char_table_type *pRec; -<a name="l00242"></a>00242 -<a name="l00243"></a>00243 pRec = pGetCharTableRecord(0x00a0); <span class="comment">/* Unicode non-breaking space */</span> -<a name="l00244"></a>00244 <span class="keywordflow">if</span> (pRec == NULL) { -<a name="l00245"></a>00245 DBG_MSG(<span class="stringliteral">"Non-breaking space record not found"</span>); -<a name="l00246"></a>00246 <span class="comment">/* No value found, use the best guess */</span> -<a name="l00247"></a>00247 <span class="keywordflow">return</span> (UCHAR)0xa0; -<a name="l00248"></a>00248 } -<a name="l00249"></a>00249 <span class="keywordflow">return</span> pRec->ucLocal; -<a name="l00250"></a>00250 } <span class="comment">/* end of ucGetNbspCharacter */</span> -<a name="l00251"></a>00251 -<a name="l00252"></a>00252 <span class="comment">/*</span> -<a name="l00253"></a>00253 <span class="comment"> * bReadCharacterMappingTable - read the mapping table</span> -<a name="l00254"></a>00254 <span class="comment"> *</span> -<a name="l00255"></a>00255 <span class="comment"> * Read the character mapping table from file and have the contents sorted</span> -<a name="l00256"></a>00256 <span class="comment"> *</span> -<a name="l00257"></a>00257 <span class="comment"> * returns TRUE if successful, otherwise FALSE</span> -<a name="l00258"></a>00258 <span class="comment"> */</span> -<a name="l00259"></a>00259 BOOL -<a name="l00260"></a>00260 bReadCharacterMappingTable(FILE *pFile) -<a name="l00261"></a>00261 { -<a name="l00262"></a>00262 <span class="keywordtype">char</span> *pcTmp; -<a name="l00263"></a>00263 ULONG ulUnicode; -<a name="l00264"></a>00264 UINT uiLocal; -<a name="l00265"></a>00265 <span class="keywordtype">int</span> iFields; -<a name="l00266"></a>00266 <span class="keywordtype">char</span> szLine[81]; -<a name="l00267"></a>00267 -<a name="l00268"></a>00268 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00269"></a>00269 <span class="keywordflow">return</span> FALSE; -<a name="l00270"></a>00270 } -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 <span class="comment">/* Clean the table first */</span> -<a name="l00273"></a>00273 (void)memset(atCharTable, 0, <span class="keyword">sizeof</span>(atCharTable)); -<a name="l00274"></a>00274 -<a name="l00275"></a>00275 <span class="comment">/* Fill the table */</span> -<a name="l00276"></a>00276 <span class="keywordflow">while</span> (fgets(szLine, (<span class="keywordtype">int</span>)<span class="keyword">sizeof</span>(szLine), pFile)) { -<a name="l00277"></a>00277 <span class="keywordflow">if</span> (szLine[0] == <span class="charliteral">'#'</span> || -<a name="l00278"></a>00278 szLine[0] == <span class="charliteral">'\r'</span> || -<a name="l00279"></a>00279 szLine[0] == <span class="charliteral">'\n'</span>) { -<a name="l00280"></a>00280 <span class="comment">/* Comment or empty line */</span> -<a name="l00281"></a>00281 <span class="keywordflow">continue</span>; -<a name="l00282"></a>00282 } -<a name="l00283"></a>00283 iFields = sscanf(szLine, <span class="stringliteral">"%x %lx %*s"</span>, &uiLocal, &ulUnicode); -<a name="l00284"></a>00284 <span class="keywordflow">if</span> (iFields != 2) { -<a name="l00285"></a>00285 pcTmp = strchr(szLine, <span class="charliteral">'\r'</span>); -<a name="l00286"></a>00286 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00287"></a>00287 *pcTmp = <span class="charliteral">'\0'</span>; -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 pcTmp = strchr(szLine, <span class="charliteral">'\n'</span>); -<a name="l00290"></a>00290 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00291"></a>00291 *pcTmp = <span class="charliteral">'\0'</span>; -<a name="l00292"></a>00292 } -<a name="l00293"></a>00293 werr(0, <span class="stringliteral">"Syntax error in: '%s'"</span>, szLine); -<a name="l00294"></a>00294 <span class="keywordflow">continue</span>; -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 <span class="keywordflow">if</span> (uiLocal > 0xff || ulUnicode > 0xffff) { -<a name="l00297"></a>00297 werr(0, <span class="stringliteral">"Syntax error in: '%02x %04lx'"</span>, -<a name="l00298"></a>00298 uiLocal, ulUnicode); -<a name="l00299"></a>00299 <span class="keywordflow">continue</span>; -<a name="l00300"></a>00300 } -<a name="l00301"></a>00301 <span class="comment">/* Store only the relevant entries */</span> -<a name="l00302"></a>00302 <span class="keywordflow">if</span> (uiLocal != ulUnicode || uiLocal >= 0x80) { -<a name="l00303"></a>00303 atCharTable[tNextPosFree].ucLocal = (UCHAR)uiLocal; -<a name="l00304"></a>00304 atCharTable[tNextPosFree].usUnicode = (USHORT)ulUnicode; -<a name="l00305"></a>00305 tNextPosFree++; -<a name="l00306"></a>00306 } -<a name="l00307"></a>00307 <span class="keywordflow">if</span> (tNextPosFree >= elementsof(atCharTable)) { -<a name="l00308"></a>00308 werr(0, <span class="stringliteral">"Too many entries in the character mapping "</span> -<a name="l00309"></a>00309 <span class="stringliteral">"file. Ignoring the rest."</span>); -<a name="l00310"></a>00310 <span class="keywordflow">break</span>; -<a name="l00311"></a>00311 } -<a name="l00312"></a>00312 } -<a name="l00313"></a>00313 -<a name="l00314"></a>00314 <span class="keywordflow">if</span> (tNextPosFree != 0) { -<a name="l00315"></a>00315 DBG_HEX(atCharTable[0].usUnicode); -<a name="l00316"></a>00316 DBG_HEX(atCharTable[tNextPosFree - 1].usUnicode); -<a name="l00317"></a>00317 -<a name="l00318"></a>00318 qsort(atCharTable, -<a name="l00319"></a>00319 tNextPosFree, <span class="keyword">sizeof</span>(atCharTable[0]), -<a name="l00320"></a>00320 iCompare); -<a name="l00321"></a>00321 -<a name="l00322"></a>00322 DBG_HEX(atCharTable[0].usUnicode); -<a name="l00323"></a>00323 DBG_HEX(atCharTable[tNextPosFree - 1].usUnicode); -<a name="l00324"></a>00324 } -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 <span class="keywordflow">return</span> TRUE; -<a name="l00327"></a>00327 } <span class="comment">/* end of bReadCharacterMappingTable */</span> -<a name="l00328"></a>00328 -<a name="l00329"></a>00329 <span class="comment">/*</span> -<a name="l00330"></a>00330 <span class="comment"> * ulTranslateCharacters - Translate characters to local representation</span> -<a name="l00331"></a>00331 <span class="comment"> *</span> -<a name="l00332"></a>00332 <span class="comment"> * Translate all characters to local representation</span> -<a name="l00333"></a>00333 <span class="comment"> *</span> -<a name="l00334"></a>00334 <span class="comment"> * returns the translated character</span> -<a name="l00335"></a>00335 <span class="comment"> */</span> -<a name="l00336"></a>00336 ULONG -<a name="l00337"></a>00337 ulTranslateCharacters(USHORT usChar, ULONG ulFileOffset, <span class="keywordtype">int</span> iWordVersion, -<a name="l00338"></a>00338 conversion_type eConversionType, encoding_type eEncoding, -<a name="l00339"></a>00339 BOOL bUseMacCharSet) -<a name="l00340"></a>00340 { -<a name="l00341"></a>00341 <span class="keyword">const</span> char_table_type *pTmp; -<a name="l00342"></a>00342 <span class="keyword">const</span> USHORT *usCharSet; -<a name="l00343"></a>00343 -<a name="l00344"></a>00344 usCharSet = NULL; -<a name="l00345"></a>00345 <span class="keywordflow">if</span> (bUseMacCharSet) { -<a name="l00346"></a>00346 <span class="comment">/* Macintosh character set */</span> -<a name="l00347"></a>00347 usCharSet = usMacRoman; -<a name="l00348"></a>00348 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iWordVersion == 0) { -<a name="l00349"></a>00349 <span class="comment">/* DOS character set */</span> -<a name="l00350"></a>00350 usCharSet = usCp850; -<a name="l00351"></a>00351 } <span class="keywordflow">else</span> { -<a name="l00352"></a>00352 <span class="comment">/* Windows character set */</span> -<a name="l00353"></a>00353 <span class="keywordflow">switch</span> (eEncoding) { -<a name="l00354"></a>00354 <span class="keywordflow">case</span> encoding_latin_2: -<a name="l00355"></a>00355 usCharSet = usCp1250; -<a name="l00356"></a>00356 <span class="keywordflow">break</span>; -<a name="l00357"></a>00357 <span class="keywordflow">case</span> encoding_cyrillic: -<a name="l00358"></a>00358 usCharSet = usCp1251; -<a name="l00359"></a>00359 <span class="keywordflow">break</span>; -<a name="l00360"></a>00360 <span class="keywordflow">case</span> encoding_latin_1: -<a name="l00361"></a>00361 <span class="keywordflow">default</span>: -<a name="l00362"></a>00362 usCharSet = usCp1252; -<a name="l00363"></a>00363 <span class="keywordflow">break</span>; -<a name="l00364"></a>00364 } -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 fail(usCharSet == NULL); -<a name="l00367"></a>00367 <span class="keywordflow">if</span> (usChar >= 0x80 && usChar <= 0x9f) { -<a name="l00368"></a>00368 <span class="comment">/* Translate implementation defined characters */</span> -<a name="l00369"></a>00369 usChar = usCharSet[usChar - 0x80]; -<a name="l00370"></a>00370 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iWordVersion < 8 && usChar >= 0xa0 && usChar <= 0xff) { -<a name="l00371"></a>00371 <span class="comment">/* Translate old character set to Unixcode */</span> -<a name="l00372"></a>00372 usChar = usCharSet[usChar - 0x80]; -<a name="l00373"></a>00373 } -<a name="l00374"></a>00374 -<a name="l00375"></a>00375 <span class="comment">/* Microsoft Unicode to real Unicode */</span> -<a name="l00376"></a>00376 <span class="keywordflow">if</span> (usChar >= 0xf020 && usChar <= 0xf0ff) { -<a name="l00377"></a>00377 DBG_HEX_C(usPrivateArea[usChar - 0xf020] == 0x003f, usChar); -<a name="l00378"></a>00378 usChar = usPrivateArea[usChar - 0xf020]; -<a name="l00379"></a>00379 } -<a name="l00380"></a>00380 -<a name="l00381"></a>00381 <span class="comment">/* Characters with a special meaning in Word */</span> -<a name="l00382"></a>00382 <span class="keywordflow">switch</span> (usChar) { -<a name="l00383"></a>00383 <span class="keywordflow">case</span> IGNORE_CHARACTER: -<a name="l00384"></a>00384 <span class="keywordflow">case</span> FOOTNOTE_SEPARATOR: -<a name="l00385"></a>00385 <span class="keywordflow">case</span> FOOTNOTE_CONTINUATION: -<a name="l00386"></a>00386 <span class="keywordflow">case</span> ANNOTATION: -<a name="l00387"></a>00387 <span class="keywordflow">case</span> FRAME: -<a name="l00388"></a>00388 <span class="keywordflow">case</span> LINE_FEED: -<a name="l00389"></a>00389 <span class="keywordflow">case</span> WORD_SOFT_HYPHEN: -<a name="l00390"></a>00390 <span class="keywordflow">case</span> UNICODE_HYPHENATION_POINT: -<a name="l00391"></a>00391 <span class="keywordflow">return</span> IGNORE_CHARACTER; -<a name="l00392"></a>00392 <span class="keywordflow">case</span> PICTURE: -<a name="l00393"></a>00393 <span class="keywordflow">case</span> TABLE_SEPARATOR: -<a name="l00394"></a>00394 <span class="keywordflow">case</span> TAB: -<a name="l00395"></a>00395 <span class="keywordflow">case</span> HARD_RETURN: -<a name="l00396"></a>00396 <span class="keywordflow">case</span> PAGE_BREAK: -<a name="l00397"></a>00397 <span class="keywordflow">case</span> PAR_END: -<a name="l00398"></a>00398 <span class="keywordflow">case</span> COLUMN_FEED: -<a name="l00399"></a>00399 <span class="keywordflow">return</span> (ULONG)usChar; -<a name="l00400"></a>00400 <span class="keywordflow">case</span> FOOTNOTE_OR_ENDNOTE: -<a name="l00401"></a>00401 NO_DBG_HEX(ulFileOffset); -<a name="l00402"></a>00402 <span class="keywordflow">switch</span> (eGetNotetype(ulFileOffset)) { -<a name="l00403"></a>00403 <span class="keywordflow">case</span> notetype_is_footnote: -<a name="l00404"></a>00404 <span class="keywordflow">return</span> FOOTNOTE_CHAR; -<a name="l00405"></a>00405 <span class="keywordflow">case</span> notetype_is_endnote: -<a name="l00406"></a>00406 <span class="keywordflow">return</span> ENDNOTE_CHAR; -<a name="l00407"></a>00407 <span class="keywordflow">default</span>: -<a name="l00408"></a>00408 <span class="keywordflow">return</span> UNKNOWN_NOTE_CHAR; -<a name="l00409"></a>00409 } -<a name="l00410"></a>00410 <span class="keywordflow">case</span> WORD_UNBREAKABLE_JOIN: -<a name="l00411"></a>00411 <span class="keywordflow">return</span> (ULONG)OUR_UNBREAKABLE_JOIN; -<a name="l00412"></a>00412 <span class="keywordflow">default</span>: -<a name="l00413"></a>00413 <span class="keywordflow">break</span>; -<a name="l00414"></a>00414 } -<a name="l00415"></a>00415 -<a name="l00416"></a>00416 <span class="keywordflow">if</span> (eEncoding != encoding_utf_8) { -<a name="l00417"></a>00417 <span class="comment">/* Latin characters in an oriental text */</span> -<a name="l00418"></a>00418 <span class="keywordflow">if</span> (usChar >= 0xff01 && usChar <= 0xff5e) { -<a name="l00419"></a>00419 usChar -= 0xfee0; -<a name="l00420"></a>00420 } -<a name="l00421"></a>00421 } -<a name="l00422"></a>00422 -<a name="l00423"></a>00423 <span class="keywordflow">if</span> (eEncoding == encoding_latin_1 && -<a name="l00424"></a>00424 (eConversionType == conversion_ps || -<a name="l00425"></a>00425 eConversionType == conversion_pdf)) { -<a name="l00426"></a>00426 <span class="comment">/* Ugly, but it makes the PostScript and PDF look better */</span> -<a name="l00427"></a>00427 <span class="keywordflow">switch</span> (usChar) { -<a name="l00428"></a>00428 <span class="keywordflow">case</span> UNICODE_ELLIPSIS: -<a name="l00429"></a>00429 <span class="keywordflow">return</span> 140; -<a name="l00430"></a>00430 <span class="keywordflow">case</span> UNICODE_TRADEMARK_SIGN: -<a name="l00431"></a>00431 <span class="keywordflow">return</span> 141; -<a name="l00432"></a>00432 <span class="keywordflow">case</span> UNICODE_PER_MILLE_SIGN: -<a name="l00433"></a>00433 <span class="keywordflow">return</span> 142; -<a name="l00434"></a>00434 <span class="keywordflow">case</span> UNICODE_BULLET: -<a name="l00435"></a>00435 <span class="keywordflow">case</span> UNICODE_BULLET_OPERATOR: -<a name="l00436"></a>00436 <span class="keywordflow">case</span> UNICODE_BLACK_CLUB_SUIT: -<a name="l00437"></a>00437 <span class="keywordflow">return</span> 143; -<a name="l00438"></a>00438 <span class="keywordflow">case</span> UNICODE_LEFT_SINGLE_QMARK: -<a name="l00439"></a>00439 <span class="keywordflow">return</span> 144; -<a name="l00440"></a>00440 <span class="keywordflow">case</span> UNICODE_RIGHT_SINGLE_QMARK: -<a name="l00441"></a>00441 <span class="keywordflow">return</span> 145; -<a name="l00442"></a>00442 <span class="keywordflow">case</span> UNICODE_SINGLE_LEFT_ANGLE_QMARK: -<a name="l00443"></a>00443 <span class="keywordflow">return</span> 146; -<a name="l00444"></a>00444 <span class="keywordflow">case</span> UNICODE_SINGLE_RIGHT_ANGLE_QMARK: -<a name="l00445"></a>00445 <span class="keywordflow">return</span> 147; -<a name="l00446"></a>00446 <span class="keywordflow">case</span> UNICODE_LEFT_DOUBLE_QMARK: -<a name="l00447"></a>00447 <span class="keywordflow">return</span> 148; -<a name="l00448"></a>00448 <span class="keywordflow">case</span> UNICODE_RIGHT_DOUBLE_QMARK: -<a name="l00449"></a>00449 <span class="keywordflow">return</span> 149; -<a name="l00450"></a>00450 <span class="keywordflow">case</span> UNICODE_DOUBLE_LOW_9_QMARK: -<a name="l00451"></a>00451 <span class="keywordflow">return</span> 150; -<a name="l00452"></a>00452 <span class="keywordflow">case</span> UNICODE_EN_DASH: -<a name="l00453"></a>00453 <span class="keywordflow">return</span> 151; -<a name="l00454"></a>00454 <span class="keywordflow">case</span> UNICODE_EM_DASH: -<a name="l00455"></a>00455 <span class="keywordflow">return</span> 152; -<a name="l00456"></a>00456 <span class="keywordflow">case</span> UNICODE_MINUS_SIGN: -<a name="l00457"></a>00457 <span class="keywordflow">return</span> 153; -<a name="l00458"></a>00458 <span class="keywordflow">case</span> UNICODE_CAPITAL_LIGATURE_OE: -<a name="l00459"></a>00459 <span class="keywordflow">return</span> 154; -<a name="l00460"></a>00460 <span class="keywordflow">case</span> UNICODE_SMALL_LIGATURE_OE: -<a name="l00461"></a>00461 <span class="keywordflow">return</span> 155; -<a name="l00462"></a>00462 <span class="keywordflow">case</span> UNICODE_DAGGER: -<a name="l00463"></a>00463 <span class="keywordflow">return</span> 156; -<a name="l00464"></a>00464 <span class="keywordflow">case</span> UNICODE_DOUBLE_DAGGER: -<a name="l00465"></a>00465 <span class="keywordflow">return</span> 157; -<a name="l00466"></a>00466 <span class="keywordflow">case</span> UNICODE_SMALL_LIGATURE_FI: -<a name="l00467"></a>00467 <span class="keywordflow">return</span> 158; -<a name="l00468"></a>00468 <span class="keywordflow">case</span> UNICODE_SMALL_LIGATURE_FL: -<a name="l00469"></a>00469 <span class="keywordflow">return</span> 159; -<a name="l00470"></a>00470 <span class="keywordflow">default</span>: -<a name="l00471"></a>00471 <span class="keywordflow">break</span>; -<a name="l00472"></a>00472 } -<a name="l00473"></a>00473 } -<a name="l00474"></a>00474 -<a name="l00475"></a>00475 <span class="keywordflow">if</span> (eConversionType == conversion_pdf) { -<a name="l00476"></a>00476 <span class="keywordflow">if</span> (eEncoding == encoding_latin_1) { -<a name="l00477"></a>00477 <span class="keywordflow">switch</span> (usChar) { -<a name="l00478"></a>00478 <span class="keywordflow">case</span> UNICODE_EURO_SIGN: -<a name="l00479"></a>00479 <span class="keywordflow">return</span> 128; -<a name="l00480"></a>00480 <span class="keywordflow">default</span>: -<a name="l00481"></a>00481 <span class="keywordflow">break</span>; -<a name="l00482"></a>00482 } -<a name="l00483"></a>00483 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (eEncoding == encoding_latin_2) { -<a name="l00484"></a>00484 <span class="keywordflow">switch</span> (usChar) { -<a name="l00485"></a>00485 <span class="keywordflow">case</span> UNICODE_CAPITAL_D_WITH_STROKE: -<a name="l00486"></a>00486 <span class="keywordflow">case</span> UNICODE_SMALL_D_WITH_STROKE: -<a name="l00487"></a>00487 <span class="keywordflow">return</span> 0x3f; -<a name="l00488"></a>00488 <span class="keywordflow">default</span>: -<a name="l00489"></a>00489 <span class="keywordflow">break</span>; -<a name="l00490"></a>00490 } -<a name="l00491"></a>00491 } -<a name="l00492"></a>00492 } -<a name="l00493"></a>00493 -<a name="l00494"></a>00494 <span class="keywordflow">if</span> (usChar < 0x80) { -<a name="l00495"></a>00495 <span class="comment">/* US ASCII */</span> -<a name="l00496"></a>00496 <span class="keywordflow">if</span> (usChar < 0x20 || usChar == 0x7f) { -<a name="l00497"></a>00497 <span class="comment">/* Ignore control characters */</span> -<a name="l00498"></a>00498 DBG_HEX(usChar); -<a name="l00499"></a>00499 DBG_FIXME(); -<a name="l00500"></a>00500 <span class="keywordflow">return</span> IGNORE_CHARACTER; -<a name="l00501"></a>00501 } -<a name="l00502"></a>00502 <span class="keywordflow">return</span> (ULONG)usChar; -<a name="l00503"></a>00503 } -<a name="l00504"></a>00504 -<a name="l00505"></a>00505 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00506"></a>00506 <span class="comment">/* No need to convert Unicode characters */</span> -<a name="l00507"></a>00507 <span class="keywordflow">return</span> (ULONG)usChar; -<a name="l00508"></a>00508 } -<a name="l00509"></a>00509 -<a name="l00510"></a>00510 <span class="comment">/* Unicode to local representation */</span> -<a name="l00511"></a>00511 pTmp = pGetCharTableRecord(usChar); -<a name="l00512"></a>00512 <span class="keywordflow">if</span> (pTmp != NULL) { -<a name="l00513"></a>00513 DBG_HEX_C(usChar >= 0x7f && usChar <= 0x9f, usChar); -<a name="l00514"></a>00514 <span class="keywordflow">return</span> (ULONG)pTmp->ucLocal; -<a name="l00515"></a>00515 } -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 <span class="comment">/* Fancy characters to simple US ASCII */</span> -<a name="l00518"></a>00518 <span class="keywordflow">switch</span> (usChar) { -<a name="l00519"></a>00519 <span class="keywordflow">case</span> UNICODE_SMALL_F_HOOK: -<a name="l00520"></a>00520 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'f'</span>; -<a name="l00521"></a>00521 <span class="keywordflow">case</span> UNICODE_GREEK_CAPITAL_CHI: -<a name="l00522"></a>00522 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'X'</span>; -<a name="l00523"></a>00523 <span class="keywordflow">case</span> UNICODE_GREEK_SMALL_UPSILON: -<a name="l00524"></a>00524 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'v'</span>; -<a name="l00525"></a>00525 <span class="keywordflow">case</span> UNICODE_MODIFIER_CIRCUMFLEX: -<a name="l00526"></a>00526 <span class="keywordflow">case</span> UNICODE_UPWARDS_ARROW: -<a name="l00527"></a>00527 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'^'</span>; -<a name="l00528"></a>00528 <span class="keywordflow">case</span> UNICODE_SMALL_TILDE: -<a name="l00529"></a>00529 <span class="keywordflow">case</span> UNICODE_TILDE_OPERATOR: -<a name="l00530"></a>00530 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'~'</span>; -<a name="l00531"></a>00531 <span class="keywordflow">case</span> UNICODE_EN_QUAD: -<a name="l00532"></a>00532 <span class="keywordflow">case</span> UNICODE_EM_QUAD: -<a name="l00533"></a>00533 <span class="keywordflow">case</span> UNICODE_EN_SPACE: -<a name="l00534"></a>00534 <span class="keywordflow">case</span> UNICODE_EM_SPACE: -<a name="l00535"></a>00535 <span class="keywordflow">case</span> UNICODE_THREE_PER_EM_SPACE: -<a name="l00536"></a>00536 <span class="keywordflow">case</span> UNICODE_FOUR_PER_EM_SPACE: -<a name="l00537"></a>00537 <span class="keywordflow">case</span> UNICODE_SIX_PER_EM_SPACE: -<a name="l00538"></a>00538 <span class="keywordflow">case</span> UNICODE_FIGURE_SPACE: -<a name="l00539"></a>00539 <span class="keywordflow">case</span> UNICODE_PUNCTUATION_SPACE: -<a name="l00540"></a>00540 <span class="keywordflow">case</span> UNICODE_THIN_SPACE: -<a name="l00541"></a>00541 <span class="keywordflow">case</span> UNICODE_NARROW_NO_BREAK_SPACE: -<a name="l00542"></a>00542 <span class="keywordflow">case</span> UNICODE_LIGHT_SHADE: -<a name="l00543"></a>00543 <span class="keywordflow">case</span> UNICODE_MEDIUM_SHADE: -<a name="l00544"></a>00544 <span class="keywordflow">case</span> UNICODE_DARK_SHADE: -<a name="l00545"></a>00545 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">' '</span>; -<a name="l00546"></a>00546 <span class="keywordflow">case</span> UNICODE_LEFT_DOUBLE_QMARK: -<a name="l00547"></a>00547 <span class="keywordflow">case</span> UNICODE_RIGHT_DOUBLE_QMARK: -<a name="l00548"></a>00548 <span class="keywordflow">case</span> UNICODE_DOUBLE_LOW_9_QMARK: -<a name="l00549"></a>00549 <span class="keywordflow">case</span> UNICODE_DOUBLE_HIGH_REV_9_QMARK: -<a name="l00550"></a>00550 <span class="keywordflow">case</span> UNICODE_DOUBLE_PRIME: -<a name="l00551"></a>00551 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'"'</span>; -<a name="l00552"></a>00552 <span class="keywordflow">case</span> UNICODE_LEFT_SINGLE_QMARK: -<a name="l00553"></a>00553 <span class="keywordflow">case</span> UNICODE_RIGHT_SINGLE_QMARK: -<a name="l00554"></a>00554 <span class="keywordflow">case</span> UNICODE_SINGLE_LOW_9_QMARK: -<a name="l00555"></a>00555 <span class="keywordflow">case</span> UNICODE_SINGLE_HIGH_REV_9_QMARK: -<a name="l00556"></a>00556 <span class="keywordflow">case</span> UNICODE_PRIME: -<a name="l00557"></a>00557 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'\''</span>; -<a name="l00558"></a>00558 <span class="keywordflow">case</span> UNICODE_HYPHEN: -<a name="l00559"></a>00559 <span class="keywordflow">case</span> UNICODE_NON_BREAKING_HYPHEN: -<a name="l00560"></a>00560 <span class="keywordflow">case</span> UNICODE_FIGURE_DASH: -<a name="l00561"></a>00561 <span class="keywordflow">case</span> UNICODE_EN_DASH: -<a name="l00562"></a>00562 <span class="keywordflow">case</span> UNICODE_EM_DASH: -<a name="l00563"></a>00563 <span class="keywordflow">case</span> UNICODE_HORIZONTAL_BAR: -<a name="l00564"></a>00564 <span class="keywordflow">case</span> UNICODE_MINUS_SIGN: -<a name="l00565"></a>00565 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_HORIZONTAL: -<a name="l00566"></a>00566 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_HORIZONTAL: -<a name="l00567"></a>00567 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'-'</span>; -<a name="l00568"></a>00568 <span class="keywordflow">case</span> UNICODE_DOUBLE_VERTICAL_LINE: -<a name="l00569"></a>00569 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_VERTICAL: -<a name="l00570"></a>00570 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_VERTICAL: -<a name="l00571"></a>00571 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'|'</span>; -<a name="l00572"></a>00572 <span class="keywordflow">case</span> UNICODE_DOUBLE_LOW_LINE: -<a name="l00573"></a>00573 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'_'</span>; -<a name="l00574"></a>00574 <span class="keywordflow">case</span> UNICODE_DAGGER: -<a name="l00575"></a>00575 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'+'</span>; -<a name="l00576"></a>00576 <span class="keywordflow">case</span> UNICODE_DOUBLE_DAGGER: -<a name="l00577"></a>00577 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'#'</span>; -<a name="l00578"></a>00578 <span class="keywordflow">case</span> UNICODE_BULLET: -<a name="l00579"></a>00579 <span class="keywordflow">case</span> UNICODE_BULLET_OPERATOR: -<a name="l00580"></a>00580 <span class="keywordflow">case</span> UNICODE_BLACK_CLUB_SUIT: -<a name="l00581"></a>00581 <span class="keywordflow">return</span> (ULONG)ucGetBulletCharacter(eConversionType, eEncoding); -<a name="l00582"></a>00582 <span class="keywordflow">case</span> UNICODE_ONE_DOT_LEADER: -<a name="l00583"></a>00583 <span class="keywordflow">case</span> UNICODE_TWO_DOT_LEADER: -<a name="l00584"></a>00584 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'.'</span>; -<a name="l00585"></a>00585 <span class="keywordflow">case</span> UNICODE_ELLIPSIS: -<a name="l00586"></a>00586 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00587"></a>00587 <span class="preprocessor"></span> <span class="keywordflow">return</span> (ULONG)OUR_ELLIPSIS; -<a name="l00588"></a>00588 <span class="preprocessor">#else</span> -<a name="l00589"></a>00589 <span class="preprocessor"></span> <span class="keywordflow">if</span> (ulFileOffset == 0) { -<a name="l00590"></a>00590 <span class="keywordflow">return</span> (ULONG)OUR_ELLIPSIS; -<a name="l00591"></a>00591 } -<a name="l00592"></a>00592 <span class="keywordflow">return</span> UNICODE_ELLIPSIS; -<a name="l00593"></a>00593 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00594"></a>00594 <span class="keywordflow">case</span> UNICODE_DOUBLE_LEFT_ANGLE_QMARK: -<a name="l00595"></a>00595 <span class="keywordflow">case</span> UNICODE_TRIANGULAR_BULLET: -<a name="l00596"></a>00596 <span class="keywordflow">case</span> UNICODE_SINGLE_LEFT_ANGLE_QMARK: -<a name="l00597"></a>00597 <span class="keywordflow">case</span> UNICODE_LEFTWARDS_ARROW: -<a name="l00598"></a>00598 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'<'</span>; -<a name="l00599"></a>00599 <span class="keywordflow">case</span> UNICODE_DOUBLE_RIGHT_ANGLE_QMARK: -<a name="l00600"></a>00600 <span class="keywordflow">case</span> UNICODE_SINGLE_RIGHT_ANGLE_QMARK: -<a name="l00601"></a>00601 <span class="keywordflow">case</span> UNICODE_RIGHTWARDS_ARROW: -<a name="l00602"></a>00602 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'>'</span>; -<a name="l00603"></a>00603 <span class="keywordflow">case</span> UNICODE_UNDERTIE: -<a name="l00604"></a>00604 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'-'</span>; -<a name="l00605"></a>00605 <span class="keywordflow">case</span> UNICODE_N_ARY_SUMMATION: -<a name="l00606"></a>00606 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'S'</span>; -<a name="l00607"></a>00607 <span class="keywordflow">case</span> UNICODE_EURO_SIGN: -<a name="l00608"></a>00608 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'E'</span>; -<a name="l00609"></a>00609 <span class="keywordflow">case</span> UNICODE_CIRCLE: -<a name="l00610"></a>00610 <span class="keywordflow">case</span> UNICODE_SQUARE: -<a name="l00611"></a>00611 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'O'</span>; -<a name="l00612"></a>00612 <span class="keywordflow">case</span> UNICODE_DIAMOND: -<a name="l00613"></a>00613 <span class="keywordflow">return</span> (ULONG)OUR_DIAMOND; -<a name="l00614"></a>00614 <span class="keywordflow">case</span> UNICODE_NUMERO_SIGN: -<a name="l00615"></a>00615 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'N'</span>; -<a name="l00616"></a>00616 <span class="keywordflow">case</span> UNICODE_KELVIN_SIGN: -<a name="l00617"></a>00617 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'K'</span>; -<a name="l00618"></a>00618 <span class="keywordflow">case</span> UNICODE_DOWNWARDS_ARROW: -<a name="l00619"></a>00619 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'v'</span>; -<a name="l00620"></a>00620 <span class="keywordflow">case</span> UNICODE_FRACTION_SLASH: -<a name="l00621"></a>00621 <span class="keywordflow">case</span> UNICODE_DIVISION_SLASH: -<a name="l00622"></a>00622 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'/'</span>; -<a name="l00623"></a>00623 <span class="keywordflow">case</span> UNICODE_ASTERISK_OPERATOR: -<a name="l00624"></a>00624 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'*'</span>; -<a name="l00625"></a>00625 <span class="keywordflow">case</span> UNICODE_RATIO: -<a name="l00626"></a>00626 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">':'</span>; -<a name="l00627"></a>00627 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_DOWN_RIGHT: -<a name="l00628"></a>00628 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_DOWN_AND_LEFT: -<a name="l00629"></a>00629 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_UP_AND_RIGHT: -<a name="l00630"></a>00630 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_UP_AND_LEFT: -<a name="l00631"></a>00631 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_VERTICAL_AND_RIGHT: -<a name="l00632"></a>00632 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_VERTICAL_AND_LEFT: -<a name="l00633"></a>00633 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_DOWN_AND_HORIZONTAL: -<a name="l00634"></a>00634 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_UP_AND_HORIZONTAL: -<a name="l00635"></a>00635 <span class="keywordflow">case</span> UNICODE_BD_LIGHT_VERTICAL_AND_HORIZONTAL: -<a name="l00636"></a>00636 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_DOWN_AND_RIGHT: -<a name="l00637"></a>00637 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_DOWN_AND_LEFT: -<a name="l00638"></a>00638 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_UP_AND_RIGHT: -<a name="l00639"></a>00639 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_UP_AND_LEFT: -<a name="l00640"></a>00640 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_VERTICAL_AND_RIGHT: -<a name="l00641"></a>00641 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_VERTICAL_AND_LEFT: -<a name="l00642"></a>00642 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_DOWN_AND_HORIZONTAL: -<a name="l00643"></a>00643 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_UP_AND_HORIZONTAL: -<a name="l00644"></a>00644 <span class="keywordflow">case</span> UNICODE_BD_DOUBLE_VERTICAL_AND_HORIZONTAL: -<a name="l00645"></a>00645 <span class="keywordflow">case</span> UNICODE_BLACK_SQUARE: -<a name="l00646"></a>00646 <span class="keywordflow">return</span> (ULONG)<span class="charliteral">'+'</span>; -<a name="l00647"></a>00647 <span class="keywordflow">case</span> UNICODE_HAIR_SPACE: -<a name="l00648"></a>00648 <span class="keywordflow">case</span> UNICODE_ZERO_WIDTH_SPACE: -<a name="l00649"></a>00649 <span class="keywordflow">case</span> UNICODE_ZERO_WIDTH_NON_JOINER: -<a name="l00650"></a>00650 <span class="keywordflow">case</span> UNICODE_ZERO_WIDTH_JOINER: -<a name="l00651"></a>00651 <span class="keywordflow">case</span> UNICODE_LEFT_TO_RIGHT_MARK: -<a name="l00652"></a>00652 <span class="keywordflow">case</span> UNICODE_RIGHT_TO_LEFT_MARK: -<a name="l00653"></a>00653 <span class="keywordflow">case</span> UNICODE_LEFT_TO_RIGHT_EMBEDDING: -<a name="l00654"></a>00654 <span class="keywordflow">case</span> UNICODE_RIGHT_TO_LEFT_EMBEDDING: -<a name="l00655"></a>00655 <span class="keywordflow">case</span> UNICODE_POP_DIRECTIONAL_FORMATTING: -<a name="l00656"></a>00656 <span class="keywordflow">case</span> UNICODE_LEFT_TO_RIGHT_OVERRIDE: -<a name="l00657"></a>00657 <span class="keywordflow">case</span> UNICODE_RIGHT_TO_LEFT_OVERRIDE: -<a name="l00658"></a>00658 <span class="keywordflow">case</span> UNICODE_ZERO_WIDTH_NO_BREAK_SPACE: -<a name="l00659"></a>00659 <span class="keywordflow">return</span> IGNORE_CHARACTER; -<a name="l00660"></a>00660 <span class="keywordflow">default</span>: -<a name="l00661"></a>00661 <span class="keywordflow">break</span>; -<a name="l00662"></a>00662 } -<a name="l00663"></a>00663 -<a name="l00664"></a>00664 <span class="keywordflow">if</span> (usChar == UNICODE_TRADEMARK_SIGN) { -<a name="l00665"></a>00665 <span class="comment">/*</span> -<a name="l00666"></a>00666 <span class="comment"> * No local representation, it doesn't look like anything in</span> -<a name="l00667"></a>00667 <span class="comment"> * US-ASCII and a question mark does more harm than good.</span> -<a name="l00668"></a>00668 <span class="comment"> */</span> -<a name="l00669"></a>00669 <span class="keywordflow">return</span> IGNORE_CHARACTER; -<a name="l00670"></a>00670 } -<a name="l00671"></a>00671 -<a name="l00672"></a>00672 <span class="keywordflow">if</span> (usChar >= 0xa0 && usChar <= 0xff) { -<a name="l00673"></a>00673 <span class="comment">/* Before Word 97, Word did't use Unicode */</span> -<a name="l00674"></a>00674 <span class="keywordflow">return</span> (ULONG)usChar; -<a name="l00675"></a>00675 } -<a name="l00676"></a>00676 -<a name="l00677"></a>00677 DBG_HEX_C(usChar < 0x3000 || usChar >= 0xd800, ulFileOffset); -<a name="l00678"></a>00678 DBG_HEX_C(usChar < 0x3000 || usChar >= 0xd800, usChar); -<a name="l00679"></a>00679 DBG_MSG_C(usChar >= 0xe000 && usChar < 0xf900, <span class="stringliteral">"Private Use Area"</span>); -<a name="l00680"></a>00680 -<a name="l00681"></a>00681 <span class="comment">/* Untranslated Unicode character */</span> -<a name="l00682"></a>00682 <span class="keywordflow">return</span> 0x3f; -<a name="l00683"></a>00683 } <span class="comment">/* end of ulTranslateCharacters */</span> -<a name="l00684"></a>00684 -<a name="l00685"></a>00685 <span class="comment">/*</span> -<a name="l00686"></a>00686 <span class="comment"> * ulToUpper - convert letter to upper case</span> -<a name="l00687"></a>00687 <span class="comment"> *</span> -<a name="l00688"></a>00688 <span class="comment"> * This function converts a letter to upper case. Unlike toupper(3) this</span> -<a name="l00689"></a>00689 <span class="comment"> * function is independent from the settings of locale. This comes in handy</span> -<a name="l00690"></a>00690 <span class="comment"> * for people who have to read Word documents in more than one language or</span> -<a name="l00691"></a>00691 <span class="comment"> * contain more than one language.</span> -<a name="l00692"></a>00692 <span class="comment"> *</span> -<a name="l00693"></a>00693 <span class="comment"> * returns the converted letter, or ulChar if the conversion was not possible.</span> -<a name="l00694"></a>00694 <span class="comment"> */</span> -<a name="l00695"></a>00695 ULONG -<a name="l00696"></a>00696 ulToUpper(ULONG ulChar) -<a name="l00697"></a>00697 { -<a name="l00698"></a>00698 <span class="keywordflow">if</span> (ulChar < 0x80) { -<a name="l00699"></a>00699 <span class="comment">/* US ASCII: use standard function */</span> -<a name="l00700"></a>00700 <span class="keywordflow">return</span> (ULONG)toupper((<span class="keywordtype">int</span>)ulChar); -<a name="l00701"></a>00701 } -<a name="l00702"></a>00702 <span class="keywordflow">if</span> (ulChar >= 0xe0 && ulChar <= 0xfe && ulChar != 0xf7) { -<a name="l00703"></a>00703 <span class="comment">/*</span> -<a name="l00704"></a>00704 <span class="comment"> * Lower case accented characters</span> -<a name="l00705"></a>00705 <span class="comment"> * 0xf7 is Division sign; 0xd7 is Multiplication sign</span> -<a name="l00706"></a>00706 <span class="comment"> * 0xff is y with diaeresis; 0xdf is Sharp s</span> -<a name="l00707"></a>00707 <span class="comment"> */</span> -<a name="l00708"></a>00708 <span class="keywordflow">return</span> ulChar & ~0x20; -<a name="l00709"></a>00709 } -<a name="l00710"></a>00710 <span class="preprocessor">#if defined(__STDC_ISO_10646__)</span> -<a name="l00711"></a>00711 <span class="preprocessor"></span> <span class="comment">/*</span> -<a name="l00712"></a>00712 <span class="comment"> * If this is ISO C99 and all locales have wchar_t = ISO 10646</span> -<a name="l00713"></a>00713 <span class="comment"> * (e.g., glibc 2.2 or newer), then use standard function</span> -<a name="l00714"></a>00714 <span class="comment"> */</span> -<a name="l00715"></a>00715 <span class="keywordflow">if</span> (ulChar > 0xff) { -<a name="l00716"></a>00716 <span class="keywordflow">return</span> (ULONG)towupper((wint_t)ulChar); -<a name="l00717"></a>00717 } -<a name="l00718"></a>00718 <span class="preprocessor">#endif </span><span class="comment">/* __STDC_ISO_10646__ */</span> -<a name="l00719"></a>00719 <span class="keywordflow">return</span> ulChar; -<a name="l00720"></a>00720 } <span class="comment">/* end of ulToUpper */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/datalist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,390 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/datalist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/datalist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * datalist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word data blocks</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <errno.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define EIO 42</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="comment">/*</span> -<a name="l00019"></a>00019 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00020"></a>00020 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00021"></a>00021 <span class="comment"> */</span> -<a name="l00022"></a>00022 <span class="keyword">typedef</span> <span class="keyword">struct </span>data_mem_tag { -<a name="l00023"></a>00023 data_block_type tInfo; -<a name="l00024"></a>00024 <span class="keyword">struct </span>data_mem_tag *pNext; -<a name="l00025"></a>00025 } data_mem_type; -<a name="l00026"></a>00026 -<a name="l00027"></a>00027 <span class="comment">/* Variable to describe the start of the data block list */</span> -<a name="l00028"></a>00028 <span class="keyword">static</span> data_mem_type *pAnchor = NULL; -<a name="l00029"></a>00029 <span class="comment">/* Variable needed to read the data block list */</span> -<a name="l00030"></a>00030 <span class="keyword">static</span> data_mem_type *pBlockLast = NULL; -<a name="l00031"></a>00031 <span class="comment">/* Variable needed to read the data block list */</span> -<a name="l00032"></a>00032 <span class="keyword">static</span> data_mem_type *pBlockCurrent = NULL; -<a name="l00033"></a>00033 <span class="keyword">static</span> ULONG ulBlockOffset = 0; -<a name="l00034"></a>00034 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tByteNext = 0; -<a name="l00035"></a>00035 <span class="comment">/* Last block read */</span> -<a name="l00036"></a>00036 <span class="keyword">static</span> UCHAR aucBlock[BIG_BLOCK_SIZE]; -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 <span class="comment">/*</span> -<a name="l00040"></a>00040 <span class="comment"> * vDestroyDataBlockList - destroy the data block list</span> -<a name="l00041"></a>00041 <span class="comment"> */</span> -<a name="l00042"></a>00042 <span class="keywordtype">void</span> -<a name="l00043"></a>00043 vDestroyDataBlockList(<span class="keywordtype">void</span>) -<a name="l00044"></a>00044 { -<a name="l00045"></a>00045 data_mem_type *pCurr, *pNext; -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 DBG_MSG(<span class="stringliteral">"vDestroyDataBlockList"</span>); -<a name="l00048"></a>00048 -<a name="l00049"></a>00049 pCurr = pAnchor; -<a name="l00050"></a>00050 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00051"></a>00051 pNext = pCurr->pNext; -<a name="l00052"></a>00052 pCurr = xfree(pCurr); -<a name="l00053"></a>00053 pCurr = pNext; -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 pAnchor = NULL; -<a name="l00056"></a>00056 <span class="comment">/* Reset all the control variables */</span> -<a name="l00057"></a>00057 pBlockLast = NULL; -<a name="l00058"></a>00058 pBlockCurrent = NULL; -<a name="l00059"></a>00059 ulBlockOffset = 0; -<a name="l00060"></a>00060 tByteNext = 0; -<a name="l00061"></a>00061 } <span class="comment">/* end of vDestroyDataBlockList */</span> -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 <span class="comment">/*</span> -<a name="l00064"></a>00064 <span class="comment"> * bAdd2DataBlockList - add an element to the data block list</span> -<a name="l00065"></a>00065 <span class="comment"> *</span> -<a name="l00066"></a>00066 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00067"></a>00067 <span class="comment"> */</span> -<a name="l00068"></a>00068 BOOL -<a name="l00069"></a>00069 bAdd2DataBlockList(<span class="keyword">const</span> data_block_type *pDataBlock) -<a name="l00070"></a>00070 { -<a name="l00071"></a>00071 data_mem_type *pListMember; -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 fail(pDataBlock == NULL); -<a name="l00074"></a>00074 fail(pDataBlock->ulFileOffset == FC_INVALID); -<a name="l00075"></a>00075 fail(pDataBlock->ulDataPos == CP_INVALID); -<a name="l00076"></a>00076 fail(pDataBlock->ulLength == 0); -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 NO_DBG_MSG(<span class="stringliteral">"bAdd2DataBlockList"</span>); -<a name="l00079"></a>00079 NO_DBG_HEX(pDataBlock->ulFileOffset); -<a name="l00080"></a>00080 NO_DBG_HEX(pDataBlock->ulDataPos); -<a name="l00081"></a>00081 NO_DBG_HEX(pDataBlock->ulLength); -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="keywordflow">if</span> (pDataBlock->ulFileOffset == FC_INVALID || -<a name="l00084"></a>00084 pDataBlock->ulDataPos == CP_INVALID || -<a name="l00085"></a>00085 pDataBlock->ulLength == 0) { -<a name="l00086"></a>00086 werr(0, <span class="stringliteral">"Software (datablock) error"</span>); -<a name="l00087"></a>00087 <span class="keywordflow">return</span> FALSE; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 <span class="comment">/* Check for continuous blocks */</span> -<a name="l00090"></a>00090 <span class="keywordflow">if</span> (pBlockLast != NULL && -<a name="l00091"></a>00091 pBlockLast->tInfo.ulFileOffset + -<a name="l00092"></a>00092 pBlockLast->tInfo.ulLength == pDataBlock->ulFileOffset && -<a name="l00093"></a>00093 pBlockLast->tInfo.ulDataPos + -<a name="l00094"></a>00094 pBlockLast->tInfo.ulLength == pDataBlock->ulDataPos) { -<a name="l00095"></a>00095 <span class="comment">/* These are continous blocks */</span> -<a name="l00096"></a>00096 pBlockLast->tInfo.ulLength += pDataBlock->ulLength; -<a name="l00097"></a>00097 <span class="keywordflow">return</span> TRUE; -<a name="l00098"></a>00098 } -<a name="l00099"></a>00099 <span class="comment">/* Make a new block */</span> -<a name="l00100"></a>00100 pListMember = xmalloc(<span class="keyword">sizeof</span>(data_mem_type)); -<a name="l00101"></a>00101 <span class="comment">/* Add the block to the data list */</span> -<a name="l00102"></a>00102 pListMember->tInfo = *pDataBlock; -<a name="l00103"></a>00103 pListMember->pNext = NULL; -<a name="l00104"></a>00104 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00105"></a>00105 pAnchor = pListMember; -<a name="l00106"></a>00106 } <span class="keywordflow">else</span> { -<a name="l00107"></a>00107 fail(pBlockLast == NULL); -<a name="l00108"></a>00108 pBlockLast->pNext = pListMember; -<a name="l00109"></a>00109 } -<a name="l00110"></a>00110 pBlockLast = pListMember; -<a name="l00111"></a>00111 <span class="keywordflow">return</span> TRUE; -<a name="l00112"></a>00112 } <span class="comment">/* end of bAdd2DataBlockList */</span> -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 <span class="comment">/*</span> -<a name="l00115"></a>00115 <span class="comment"> * ulGetDataOffset - get the offset in the data block list</span> -<a name="l00116"></a>00116 <span class="comment"> *</span> -<a name="l00117"></a>00117 <span class="comment"> * Get the fileoffset the current position in the data block list</span> -<a name="l00118"></a>00118 <span class="comment"> */</span> -<a name="l00119"></a>00119 ULONG -<a name="l00120"></a>00120 ulGetDataOffset(FILE *pFile) -<a name="l00121"></a>00121 { -<a name="l00122"></a>00122 <span class="keywordflow">return</span> pBlockCurrent->tInfo.ulFileOffset + ulBlockOffset + tByteNext; -<a name="l00123"></a>00123 } <span class="comment">/* end of ulGetDataOffset */</span> -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 <span class="comment">/*</span> -<a name="l00126"></a>00126 <span class="comment"> * bSetDataOffset - set the offset in the data block list</span> -<a name="l00127"></a>00127 <span class="comment"> *</span> -<a name="l00128"></a>00128 <span class="comment"> * Make the given fileoffset the current position in the data block list</span> -<a name="l00129"></a>00129 <span class="comment"> */</span> -<a name="l00130"></a>00130 BOOL -<a name="l00131"></a>00131 bSetDataOffset(FILE *pFile, ULONG ulFileOffset) -<a name="l00132"></a>00132 { -<a name="l00133"></a>00133 data_mem_type *pCurr; -<a name="l00134"></a>00134 <span class="keywordtype">size_t</span> tReadLen; -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 DBG_HEX(ulFileOffset); -<a name="l00137"></a>00137 -<a name="l00138"></a>00138 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00139"></a>00139 <span class="keywordflow">if</span> (ulFileOffset < pCurr->tInfo.ulFileOffset || -<a name="l00140"></a>00140 ulFileOffset >= pCurr->tInfo.ulFileOffset + -<a name="l00141"></a>00141 pCurr->tInfo.ulLength) { -<a name="l00142"></a>00142 <span class="comment">/* The file offset is not in this block */</span> -<a name="l00143"></a>00143 <span class="keywordflow">continue</span>; -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 <span class="comment">/* Compute the maximum number of bytes to read */</span> -<a name="l00146"></a>00146 tReadLen = (size_t)(pCurr->tInfo.ulFileOffset + -<a name="l00147"></a>00147 pCurr->tInfo.ulLength - -<a name="l00148"></a>00148 ulFileOffset); -<a name="l00149"></a>00149 <span class="comment">/* Compute the real number of bytes to read */</span> -<a name="l00150"></a>00150 <span class="keywordflow">if</span> (tReadLen > <span class="keyword">sizeof</span>(aucBlock)) { -<a name="l00151"></a>00151 tReadLen = <span class="keyword">sizeof</span>(aucBlock); -<a name="l00152"></a>00152 } -<a name="l00153"></a>00153 <span class="comment">/* Read the bytes */</span> -<a name="l00154"></a>00154 <span class="keywordflow">if</span> (!bReadBytes(aucBlock, tReadLen, ulFileOffset, pFile)) { -<a name="l00155"></a>00155 <span class="keywordflow">return</span> FALSE; -<a name="l00156"></a>00156 } -<a name="l00157"></a>00157 <span class="comment">/* Set the control variables */</span> -<a name="l00158"></a>00158 pBlockCurrent = pCurr; -<a name="l00159"></a>00159 ulBlockOffset = ulFileOffset - pCurr->tInfo.ulFileOffset; -<a name="l00160"></a>00160 tByteNext = 0; -<a name="l00161"></a>00161 <span class="keywordflow">return</span> TRUE; -<a name="l00162"></a>00162 } -<a name="l00163"></a>00163 <span class="keywordflow">return</span> FALSE; -<a name="l00164"></a>00164 } <span class="comment">/* end of bSetDataOffset */</span> -<a name="l00165"></a>00165 -<a name="l00166"></a>00166 <span class="comment">/*</span> -<a name="l00167"></a>00167 <span class="comment"> * iNextByte - get the next byte from the data block list</span> -<a name="l00168"></a>00168 <span class="comment"> */</span> -<a name="l00169"></a>00169 <span class="keywordtype">int</span> -<a name="l00170"></a>00170 iNextByte(FILE *pFile) -<a name="l00171"></a>00171 { -<a name="l00172"></a>00172 ULONG ulReadOff; -<a name="l00173"></a>00173 <span class="keywordtype">size_t</span> tReadLen; -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 fail(pBlockCurrent == NULL); -<a name="l00176"></a>00176 -<a name="l00177"></a>00177 <span class="keywordflow">if</span> (tByteNext >= <span class="keyword">sizeof</span>(aucBlock) || -<a name="l00178"></a>00178 ulBlockOffset + tByteNext >= pBlockCurrent->tInfo.ulLength) { -<a name="l00179"></a>00179 <span class="keywordflow">if</span> (ulBlockOffset + <span class="keyword">sizeof</span>(aucBlock) < -<a name="l00180"></a>00180 pBlockCurrent->tInfo.ulLength) { -<a name="l00181"></a>00181 <span class="comment">/* Same block, next part */</span> -<a name="l00182"></a>00182 ulBlockOffset += <span class="keyword">sizeof</span>(aucBlock); -<a name="l00183"></a>00183 } <span class="keywordflow">else</span> { -<a name="l00184"></a>00184 <span class="comment">/* Next block, first part */</span> -<a name="l00185"></a>00185 pBlockCurrent = pBlockCurrent->pNext; -<a name="l00186"></a>00186 ulBlockOffset = 0; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 <span class="keywordflow">if</span> (pBlockCurrent == NULL) { -<a name="l00189"></a>00189 <span class="comment">/* Past the last part of the last block */</span> -<a name="l00190"></a>00190 errno = EIO; -<a name="l00191"></a>00191 <span class="keywordflow">return</span> EOF; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 tReadLen = (size_t) -<a name="l00194"></a>00194 (pBlockCurrent->tInfo.ulLength - ulBlockOffset); -<a name="l00195"></a>00195 <span class="keywordflow">if</span> (tReadLen > <span class="keyword">sizeof</span>(aucBlock)) { -<a name="l00196"></a>00196 tReadLen = <span class="keyword">sizeof</span>(aucBlock); -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 ulReadOff = pBlockCurrent->tInfo.ulFileOffset + ulBlockOffset; -<a name="l00199"></a>00199 <span class="keywordflow">if</span> (!bReadBytes(aucBlock, tReadLen, ulReadOff, pFile)) { -<a name="l00200"></a>00200 errno = EIO; -<a name="l00201"></a>00201 <span class="keywordflow">return</span> EOF; -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 tByteNext = 0; -<a name="l00204"></a>00204 } -<a name="l00205"></a>00205 <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)aucBlock[tByteNext++]; -<a name="l00206"></a>00206 } <span class="comment">/* end of iNextByte */</span> -<a name="l00207"></a>00207 -<a name="l00208"></a>00208 <span class="comment">/*</span> -<a name="l00209"></a>00209 <span class="comment"> * usNextWord - get the next word from the data block list</span> -<a name="l00210"></a>00210 <span class="comment"> *</span> -<a name="l00211"></a>00211 <span class="comment"> * Read a two byte value in Little Endian order, that means MSB last</span> -<a name="l00212"></a>00212 <span class="comment"> *</span> -<a name="l00213"></a>00213 <span class="comment"> * All return values can be valid so errno is set in case of error</span> -<a name="l00214"></a>00214 <span class="comment"> */</span> -<a name="l00215"></a>00215 USHORT -<a name="l00216"></a>00216 usNextWord(FILE *pFile) -<a name="l00217"></a>00217 { -<a name="l00218"></a>00218 USHORT usLSB, usMSB; -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 usLSB = (USHORT)iNextByte(pFile); -<a name="l00221"></a>00221 <span class="keywordflow">if</span> (usLSB == (USHORT)EOF) { -<a name="l00222"></a>00222 errno = EIO; -<a name="l00223"></a>00223 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00224"></a>00224 } -<a name="l00225"></a>00225 usMSB = (USHORT)iNextByte(pFile); -<a name="l00226"></a>00226 <span class="keywordflow">if</span> (usMSB == (USHORT)EOF) { -<a name="l00227"></a>00227 DBG_MSG(<span class="stringliteral">"usNextWord: Unexpected EOF"</span>); -<a name="l00228"></a>00228 errno = EIO; -<a name="l00229"></a>00229 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00230"></a>00230 } -<a name="l00231"></a>00231 <span class="keywordflow">return</span> (usMSB << 8) | usLSB; -<a name="l00232"></a>00232 } <span class="comment">/* end of usNextWord */</span> -<a name="l00233"></a>00233 -<a name="l00234"></a>00234 <span class="comment">/*</span> -<a name="l00235"></a>00235 <span class="comment"> * ulNextLong - get the next long from the data block list</span> -<a name="l00236"></a>00236 <span class="comment"> *</span> -<a name="l00237"></a>00237 <span class="comment"> * Read a four byte value in Little Endian order, that means MSW last</span> -<a name="l00238"></a>00238 <span class="comment"> *</span> -<a name="l00239"></a>00239 <span class="comment"> * All return values can be valid so errno is set in case of error</span> -<a name="l00240"></a>00240 <span class="comment"> */</span> -<a name="l00241"></a>00241 ULONG -<a name="l00242"></a>00242 ulNextLong(FILE *pFile) -<a name="l00243"></a>00243 { -<a name="l00244"></a>00244 ULONG ulLSW, ulMSW; -<a name="l00245"></a>00245 -<a name="l00246"></a>00246 ulLSW = (ULONG)usNextWord(pFile); -<a name="l00247"></a>00247 <span class="keywordflow">if</span> (ulLSW == (ULONG)EOF) { -<a name="l00248"></a>00248 errno = EIO; -<a name="l00249"></a>00249 <span class="keywordflow">return</span> (ULONG)EOF; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 ulMSW = (ULONG)usNextWord(pFile); -<a name="l00252"></a>00252 <span class="keywordflow">if</span> (ulMSW == (ULONG)EOF) { -<a name="l00253"></a>00253 DBG_MSG(<span class="stringliteral">"ulNextLong: Unexpected EOF"</span>); -<a name="l00254"></a>00254 errno = EIO; -<a name="l00255"></a>00255 <span class="keywordflow">return</span> (ULONG)EOF; -<a name="l00256"></a>00256 } -<a name="l00257"></a>00257 <span class="keywordflow">return</span> (ulMSW << 16) | ulLSW; -<a name="l00258"></a>00258 } <span class="comment">/* end of ulNextLong */</span> -<a name="l00259"></a>00259 -<a name="l00260"></a>00260 <span class="comment">/*</span> -<a name="l00261"></a>00261 <span class="comment"> * usNextWordBE - get the next two byte value</span> -<a name="l00262"></a>00262 <span class="comment"> *</span> -<a name="l00263"></a>00263 <span class="comment"> * Read a two byte value in Big Endian order, that means MSB first</span> -<a name="l00264"></a>00264 <span class="comment"> *</span> -<a name="l00265"></a>00265 <span class="comment"> * All return values can be valid so errno is set in case of error</span> -<a name="l00266"></a>00266 <span class="comment"> */</span> -<a name="l00267"></a>00267 USHORT -<a name="l00268"></a>00268 usNextWordBE(FILE *pFile) -<a name="l00269"></a>00269 { -<a name="l00270"></a>00270 USHORT usLSB, usMSB; -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 usMSB = (USHORT)iNextByte(pFile); -<a name="l00273"></a>00273 <span class="keywordflow">if</span> (usMSB == (USHORT)EOF) { -<a name="l00274"></a>00274 errno = EIO; -<a name="l00275"></a>00275 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00276"></a>00276 } -<a name="l00277"></a>00277 usLSB = (USHORT)iNextByte(pFile); -<a name="l00278"></a>00278 <span class="keywordflow">if</span> (usLSB == (USHORT)EOF) { -<a name="l00279"></a>00279 DBG_MSG(<span class="stringliteral">"usNextWordBE: Unexpected EOF"</span>); -<a name="l00280"></a>00280 errno = EIO; -<a name="l00281"></a>00281 <span class="keywordflow">return</span> (USHORT)EOF; -<a name="l00282"></a>00282 } -<a name="l00283"></a>00283 <span class="keywordflow">return</span> (usMSB << 8) | usLSB; -<a name="l00284"></a>00284 } <span class="comment">/* end of usNextWordBE */</span> -<a name="l00285"></a>00285 -<a name="l00286"></a>00286 <span class="comment">/*</span> -<a name="l00287"></a>00287 <span class="comment"> * ulNextLongBE - get the next four byte value</span> -<a name="l00288"></a>00288 <span class="comment"> *</span> -<a name="l00289"></a>00289 <span class="comment"> * Read a four byte value in Big Endian order, that means MSW first</span> -<a name="l00290"></a>00290 <span class="comment"> *</span> -<a name="l00291"></a>00291 <span class="comment"> * All return values can be valid so errno is set in case of error</span> -<a name="l00292"></a>00292 <span class="comment"> */</span> -<a name="l00293"></a>00293 ULONG -<a name="l00294"></a>00294 ulNextLongBE(FILE *pFile) -<a name="l00295"></a>00295 { -<a name="l00296"></a>00296 ULONG ulLSW, ulMSW; -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 ulMSW = (ULONG)usNextWordBE(pFile); -<a name="l00299"></a>00299 <span class="keywordflow">if</span> (ulMSW == (ULONG)EOF) { -<a name="l00300"></a>00300 errno = EIO; -<a name="l00301"></a>00301 <span class="keywordflow">return</span> (ULONG)EOF; -<a name="l00302"></a>00302 } -<a name="l00303"></a>00303 ulLSW = (ULONG)usNextWordBE(pFile); -<a name="l00304"></a>00304 <span class="keywordflow">if</span> (ulLSW == (ULONG)EOF) { -<a name="l00305"></a>00305 DBG_MSG(<span class="stringliteral">"ulNextLongBE: Unexpected EOF"</span>); -<a name="l00306"></a>00306 errno = EIO; -<a name="l00307"></a>00307 <span class="keywordflow">return</span> (ULONG)EOF; -<a name="l00308"></a>00308 } -<a name="l00309"></a>00309 <span class="keywordflow">return</span> (ulMSW << 16) | ulLSW; -<a name="l00310"></a>00310 } <span class="comment">/* end of ulNextLongBE */</span> -<a name="l00311"></a>00311 -<a name="l00312"></a>00312 <span class="comment">/*</span> -<a name="l00313"></a>00313 <span class="comment"> * tSkipBytes - skip over the given number of bytes</span> -<a name="l00314"></a>00314 <span class="comment"> *</span> -<a name="l00315"></a>00315 <span class="comment"> * Returns the number of skipped bytes</span> -<a name="l00316"></a>00316 <span class="comment"> */</span> -<a name="l00317"></a>00317 <span class="keywordtype">size_t</span> -<a name="l00318"></a>00318 tSkipBytes(FILE *pFile, <span class="keywordtype">size_t</span> tToSkip) -<a name="l00319"></a>00319 { -<a name="l00320"></a>00320 <span class="keywordtype">size_t</span> tToGo, tMaxMove, tMove; -<a name="l00321"></a>00321 -<a name="l00322"></a>00322 fail(pFile == NULL); -<a name="l00323"></a>00323 fail(pBlockCurrent == NULL); -<a name="l00324"></a>00324 -<a name="l00325"></a>00325 tToGo = tToSkip; -<a name="l00326"></a>00326 <span class="keywordflow">while</span> (tToGo != 0) { -<a name="l00327"></a>00327 <span class="comment">/* Goto the end of the current block */</span> -<a name="l00328"></a>00328 tMaxMove = min(<span class="keyword">sizeof</span>(aucBlock) - tByteNext, -<a name="l00329"></a>00329 (<span class="keywordtype">size_t</span>)(pBlockCurrent->tInfo.ulLength - -<a name="l00330"></a>00330 ulBlockOffset - tByteNext)); -<a name="l00331"></a>00331 tMove = min(tMaxMove, tToGo); -<a name="l00332"></a>00332 tByteNext += tMove; -<a name="l00333"></a>00333 tToGo -= tMove; -<a name="l00334"></a>00334 <span class="keywordflow">if</span> (tToGo != 0) { -<a name="l00335"></a>00335 <span class="comment">/* Goto the next block */</span> -<a name="l00336"></a>00336 <span class="keywordflow">if</span> (iNextByte(pFile) == EOF) { -<a name="l00337"></a>00337 <span class="keywordflow">return</span> tToSkip - tToGo; -<a name="l00338"></a>00338 } -<a name="l00339"></a>00339 tToGo--; -<a name="l00340"></a>00340 } -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 <span class="keywordflow">return</span> tToSkip; -<a name="l00343"></a>00343 } <span class="comment">/* end of tSkipBytes */</span> -<a name="l00344"></a>00344 -<a name="l00345"></a>00345 <span class="comment">/*</span> -<a name="l00346"></a>00346 <span class="comment"> * Translate a data position to an offset in the file.</span> -<a name="l00347"></a>00347 <span class="comment"> * Logical to physical offset.</span> -<a name="l00348"></a>00348 <span class="comment"> *</span> -<a name="l00349"></a>00349 <span class="comment"> * Returns: FC_INVALID: in case of error</span> -<a name="l00350"></a>00350 <span class="comment"> * otherwise: the computed file offset</span> -<a name="l00351"></a>00351 <span class="comment"> */</span> -<a name="l00352"></a>00352 ULONG -<a name="l00353"></a>00353 ulDataPos2FileOffset(ULONG ulDataPos) -<a name="l00354"></a>00354 { -<a name="l00355"></a>00355 data_mem_type *pCurr; -<a name="l00356"></a>00356 -<a name="l00357"></a>00357 fail(ulDataPos == CP_INVALID); -<a name="l00358"></a>00358 -<a name="l00359"></a>00359 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00360"></a>00360 <span class="keywordflow">if</span> (ulDataPos < pCurr->tInfo.ulDataPos || -<a name="l00361"></a>00361 ulDataPos >= pCurr->tInfo.ulDataPos + -<a name="l00362"></a>00362 pCurr->tInfo.ulLength) { -<a name="l00363"></a>00363 <span class="comment">/* The data offset is not in this block, try the next */</span> -<a name="l00364"></a>00364 <span class="keywordflow">continue</span>; -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 <span class="comment">/* The data offset is in the current block */</span> -<a name="l00367"></a>00367 <span class="keywordflow">return</span> pCurr->tInfo.ulFileOffset + -<a name="l00368"></a>00368 ulDataPos - -<a name="l00369"></a>00369 pCurr->tInfo.ulDataPos; -<a name="l00370"></a>00370 } -<a name="l00371"></a>00371 <span class="comment">/* Passed beyond the end of the list */</span> -<a name="l00372"></a>00372 DBG_HEX_C(ulDataPos != 0, ulDataPos); -<a name="l00373"></a>00373 <span class="keywordflow">return</span> FC_INVALID; -<a name="l00374"></a>00374 } <span class="comment">/* end of ulDataPos2FileOffset */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/debug_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/debug.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/debug.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * debug.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Macro's for debuging.</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__debug_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __debug_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include <stdio.h></span> -<a name="l00013"></a>00013 <span class="preprocessor">#include <ctype.h></span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span> -<a name="l00017"></a>00017 <span class="preprocessor">#define DBG_MSG(t) (void)fprintf(stderr,\</span> -<a name="l00018"></a>00018 <span class="preprocessor"> "%s[%3d]: %.240s\n",\</span> -<a name="l00019"></a>00019 <span class="preprocessor"> __FILE__, __LINE__, (t))</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span> -<a name="l00021"></a>00021 <span class="preprocessor">#define DBG_STRN(t,m) (void)fprintf(stderr,\</span> -<a name="l00022"></a>00022 <span class="preprocessor"> "%s[%3d]: %d '%.*s'\n",\</span> -<a name="l00023"></a>00023 <span class="preprocessor"> __FILE__, __LINE__,\</span> -<a name="l00024"></a>00024 <span class="preprocessor"> (int)(m), (int)(m), (const char *)(t))</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span> -<a name="l00026"></a>00026 <span class="preprocessor">#define DBG_CHR(m) (void)fprintf(stderr,\</span> -<a name="l00027"></a>00027 <span class="preprocessor"> "%s[%3d]: "#m" = %3d 0x%02x '%c'\n",\</span> -<a name="l00028"></a>00028 <span class="preprocessor"> __FILE__, __LINE__,\</span> -<a name="l00029"></a>00029 <span class="preprocessor"> (int)(m), (unsigned int)(unsigned char)(m),\</span> -<a name="l00030"></a>00030 <span class="preprocessor"> isprint((int)(unsigned char)(m))?(char)(m):' ')</span> -<a name="l00031"></a>00031 <span class="preprocessor"></span> -<a name="l00032"></a>00032 <span class="preprocessor">#define DBG_DEC(m) (void)fprintf(stderr,\</span> -<a name="l00033"></a>00033 <span class="preprocessor"> "%s[%3d]: "#m" = %ld\n",\</span> -<a name="l00034"></a>00034 <span class="preprocessor"> __FILE__, __LINE__, (long)(m))</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span> -<a name="l00036"></a>00036 <span class="preprocessor">#define DBG_HEX(m) (void)fprintf(stderr,\</span> -<a name="l00037"></a>00037 <span class="preprocessor"> "%s[%3d]: "#m" = 0x%02lx\n",\</span> -<a name="l00038"></a>00038 <span class="preprocessor"> __FILE__, __LINE__, (unsigned long)(m))</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span> -<a name="l00040"></a>00040 <span class="preprocessor">#define DBG_FLT(m) (void)fprintf(stderr,\</span> -<a name="l00041"></a>00041 <span class="preprocessor"> "%s[%3d]: "#m" = %.3f\n",\</span> -<a name="l00042"></a>00042 <span class="preprocessor"> __FILE__, __LINE__, (double)(m))</span> -<a name="l00043"></a>00043 <span class="preprocessor"></span> -<a name="l00044"></a>00044 <span class="preprocessor">#define DBG_FIXME() (void)fprintf(stderr,\</span> -<a name="l00045"></a>00045 <span class="preprocessor"> "%s[%3d]: FIXME\n",\</span> -<a name="l00046"></a>00046 <span class="preprocessor"> __FILE__, __LINE__)</span> -<a name="l00047"></a>00047 <span class="preprocessor"></span> -<a name="l00048"></a>00048 <span class="preprocessor">#define DBG_PRINT_BLOCK(b,m) vPrintBlock(__FILE__, __LINE__,(b),(m))</span> -<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define DBG_UNICODE(t) vPrintUnicode(__FILE__, __LINE__,\</span> -<a name="l00050"></a>00050 <span class="preprocessor"> (const UCHAR *)(t),unilen(t))</span> -<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#define DBG_UNICODE_N(t,m) vPrintUnicode(__FILE__, __LINE__,\</span> -<a name="l00052"></a>00052 <span class="preprocessor"> (const UCHAR *)(t),(m))</span> -<a name="l00053"></a>00053 <span class="preprocessor"></span> -<a name="l00054"></a>00054 <span class="preprocessor">#define DBG_MSG_C(c,t) do { if (c) DBG_MSG(t); } while(0)</span> -<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define DBG_STRN_C(c,t,m) do { if (c) DBG_STRN(t,m); } while(0)</span> -<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define DBG_CHR_C(c,m) do { if (c) DBG_CHR(m); } while(0)</span> -<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define DBG_DEC_C(c,m) do { if (c) DBG_DEC(m); } while(0)</span> -<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define DBG_HEX_C(c,m) do { if (c) DBG_HEX(m); } while(0)</span> -<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define DBG_FLT_C(c,m) do { if (c) DBG_FLT(m); } while(0)</span> -<a name="l00060"></a>00060 <span class="preprocessor"></span> -<a name="l00061"></a>00061 <span class="preprocessor">#else</span> -<a name="l00062"></a>00062 <span class="preprocessor"></span> -<a name="l00063"></a>00063 <span class="preprocessor">#define DBG_MSG(t) </span><span class="comment">/* EMPTY */</span> -<a name="l00064"></a>00064 <span class="preprocessor">#define DBG_STRN(t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00065"></a>00065 <span class="preprocessor">#define DBG_CHR(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00066"></a>00066 <span class="preprocessor">#define DBG_DEC(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00067"></a>00067 <span class="preprocessor">#define DBG_HEX(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00068"></a>00068 <span class="preprocessor">#define DBG_FLT(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00069"></a>00069 -<a name="l00070"></a>00070 <span class="preprocessor">#define DBG_FIXME() </span><span class="comment">/* EMPTY */</span> -<a name="l00071"></a>00071 <span class="preprocessor">#define DBG_PRINT_BLOCK(b,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00072"></a>00072 <span class="preprocessor">#define DBG_UNICODE(t) </span><span class="comment">/* EMPTY */</span> -<a name="l00073"></a>00073 <span class="preprocessor">#define DBG_UNICODE_N(t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00074"></a>00074 -<a name="l00075"></a>00075 <span class="preprocessor">#define DBG_MSG_C(c,t) </span><span class="comment">/* EMPTY */</span> -<a name="l00076"></a>00076 <span class="preprocessor">#define DBG_STRN_C(c,t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00077"></a>00077 <span class="preprocessor">#define DBG_CHR_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00078"></a>00078 <span class="preprocessor">#define DBG_DEC_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00079"></a>00079 <span class="preprocessor">#define DBG_HEX_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00080"></a>00080 <span class="preprocessor">#define DBG_FLT_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 <span class="preprocessor">#define NO_DBG_MSG(t) </span><span class="comment">/* EMPTY */</span> -<a name="l00085"></a>00085 <span class="preprocessor">#define NO_DBG_STRN(t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00086"></a>00086 <span class="preprocessor">#define NO_DBG_CHR(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00087"></a>00087 <span class="preprocessor">#define NO_DBG_DEC(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00088"></a>00088 <span class="preprocessor">#define NO_DBG_HEX(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00089"></a>00089 <span class="preprocessor">#define NO_DBG_FLT(m) </span><span class="comment">/* EMPTY */</span> -<a name="l00090"></a>00090 -<a name="l00091"></a>00091 <span class="preprocessor">#define NO_DBG_PRINT_BLOCK(b,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00092"></a>00092 <span class="preprocessor">#define NO_DBG_UNICODE(t) </span><span class="comment">/* EMPTY */</span> -<a name="l00093"></a>00093 <span class="preprocessor">#define NO_DBG_UNICODE_N(t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00094"></a>00094 -<a name="l00095"></a>00095 <span class="preprocessor">#define NO_DBG_MSG_C(c,t) </span><span class="comment">/* EMPTY */</span> -<a name="l00096"></a>00096 <span class="preprocessor">#define NO_DBG_STRN_C(c,t,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00097"></a>00097 <span class="preprocessor">#define NO_DBG_CHR_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00098"></a>00098 <span class="preprocessor">#define NO_DBG_DEC_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00099"></a>00099 <span class="preprocessor">#define NO_DBG_HEX_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00100"></a>00100 <span class="preprocessor">#define NO_DBG_FLT_C(c,m) </span><span class="comment">/* EMPTY */</span> -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 <span class="preprocessor">#if defined(TRACE)</span> -<a name="l00103"></a>00103 <span class="preprocessor"></span> -<a name="l00104"></a>00104 <span class="preprocessor">#define TRACE_MSG(t) do {\</span> -<a name="l00105"></a>00105 <span class="preprocessor"> (void)fprintf(stderr,\</span> -<a name="l00106"></a>00106 <span class="preprocessor"> "%s[%3d]: TRACE:%.40s\n",\</span> -<a name="l00107"></a>00107 <span class="preprocessor"> __FILE__, __LINE__, (t));\</span> -<a name="l00108"></a>00108 <span class="preprocessor"> (void)fflush(stderr);\</span> -<a name="l00109"></a>00109 <span class="preprocessor"> } while(0)</span> -<a name="l00110"></a>00110 <span class="preprocessor"></span> -<a name="l00111"></a>00111 <span class="preprocessor">#else</span> -<a name="l00112"></a>00112 <span class="preprocessor"></span> -<a name="l00113"></a>00113 <span class="preprocessor">#define TRACE_MSG(t) </span><span class="comment">/* EMPTY */</span> -<a name="l00114"></a>00114 -<a name="l00115"></a>00115 <span class="preprocessor">#endif </span><span class="comment">/* TRACE */</span> -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 <span class="preprocessor">#endif </span><span class="comment">/* !__debug_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/depot_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/depot.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/depot.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * depot.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to compute the depot offset</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 <span class="preprocessor">#define SIZE_RATIO (BIG_BLOCK_SIZE/SMALL_BLOCK_SIZE)</span> -<a name="l00012"></a>00012 <span class="preprocessor"></span> -<a name="l00013"></a>00013 <span class="keyword">static</span> ULONG *aulSmallBlockList = NULL; -<a name="l00014"></a>00014 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tSmallBlockListLen = 0; -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 <span class="comment">/*</span> -<a name="l00018"></a>00018 <span class="comment"> * vDestroySmallBlockList - destroy the small block list</span> -<a name="l00019"></a>00019 <span class="comment"> */</span> -<a name="l00020"></a>00020 <span class="keywordtype">void</span> -<a name="l00021"></a>00021 vDestroySmallBlockList(<span class="keywordtype">void</span>) -<a name="l00022"></a>00022 { -<a name="l00023"></a>00023 DBG_MSG(<span class="stringliteral">"vDestroySmallBlockList"</span>); -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 aulSmallBlockList = xfree(aulSmallBlockList); -<a name="l00026"></a>00026 tSmallBlockListLen = 0; -<a name="l00027"></a>00027 } <span class="comment">/* end of vDestroySmalBlockList */</span> -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="comment">/*</span> -<a name="l00030"></a>00030 <span class="comment"> * vCreateSmallBlockList - create the small block list</span> -<a name="l00031"></a>00031 <span class="comment"> *</span> -<a name="l00032"></a>00032 <span class="comment"> * returns: TRUE when successful, otherwise FALSE</span> -<a name="l00033"></a>00033 <span class="comment"> */</span> -<a name="l00034"></a>00034 BOOL -<a name="l00035"></a>00035 bCreateSmallBlockList(ULONG ulStartblock, <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen) -<a name="l00036"></a>00036 { -<a name="l00037"></a>00037 ULONG ulTmp; -<a name="l00038"></a>00038 <span class="keywordtype">size_t</span> tSize; -<a name="l00039"></a>00039 <span class="keywordtype">int</span> iIndex; -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 fail(aulSmallBlockList != NULL); -<a name="l00042"></a>00042 fail(tSmallBlockListLen != 0); -<a name="l00043"></a>00043 fail(ulStartblock > MAX_BLOCKNUMBER && ulStartblock != END_OF_CHAIN); -<a name="l00044"></a>00044 fail(aulBBD == NULL); -<a name="l00045"></a>00045 fail(tBBDLen == 0); -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 <span class="comment">/* Find the length of the small block list */</span> -<a name="l00048"></a>00048 <span class="keywordflow">for</span> (tSmallBlockListLen = 0, ulTmp = ulStartblock; -<a name="l00049"></a>00049 tSmallBlockListLen < tBBDLen && ulTmp != END_OF_CHAIN; -<a name="l00050"></a>00050 tSmallBlockListLen++, ulTmp = aulBBD[ulTmp]) { -<a name="l00051"></a>00051 <span class="keywordflow">if</span> (ulTmp >= (ULONG)tBBDLen) { -<a name="l00052"></a>00052 DBG_DEC(ulTmp); -<a name="l00053"></a>00053 DBG_DEC(tBBDLen); -<a name="l00054"></a>00054 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 } -<a name="l00057"></a>00057 DBG_DEC(tSmallBlockListLen); -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 <span class="keywordflow">if</span> (tSmallBlockListLen == 0) { -<a name="l00060"></a>00060 <span class="comment">/* There is no small block list */</span> -<a name="l00061"></a>00061 fail(ulStartblock != END_OF_CHAIN); -<a name="l00062"></a>00062 aulSmallBlockList = NULL; -<a name="l00063"></a>00063 <span class="keywordflow">return</span> TRUE; -<a name="l00064"></a>00064 } -<a name="l00065"></a>00065 -<a name="l00066"></a>00066 <span class="comment">/* Create the small block list */</span> -<a name="l00067"></a>00067 tSize = tSmallBlockListLen * <span class="keyword">sizeof</span>(ULONG); -<a name="l00068"></a>00068 aulSmallBlockList = xmalloc(tSize); -<a name="l00069"></a>00069 <span class="keywordflow">for</span> (iIndex = 0, ulTmp = ulStartblock; -<a name="l00070"></a>00070 iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; -<a name="l00071"></a>00071 iIndex++, ulTmp = aulBBD[ulTmp]) { -<a name="l00072"></a>00072 <span class="keywordflow">if</span> (ulTmp >= (ULONG)tBBDLen) { -<a name="l00073"></a>00073 DBG_DEC(ulTmp); -<a name="l00074"></a>00074 DBG_DEC(tBBDLen); -<a name="l00075"></a>00075 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00076"></a>00076 } -<a name="l00077"></a>00077 aulSmallBlockList[iIndex] = ulTmp; -<a name="l00078"></a>00078 NO_DBG_DEC(aulSmallBlockList[iIndex]); -<a name="l00079"></a>00079 } -<a name="l00080"></a>00080 <span class="keywordflow">return</span> TRUE; -<a name="l00081"></a>00081 } <span class="comment">/* end of bCreateSmallBlockList */</span> -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="comment">/*</span> -<a name="l00084"></a>00084 <span class="comment"> * ulDepotOffset - get the depot offset the block list</span> -<a name="l00085"></a>00085 <span class="comment"> */</span> -<a name="l00086"></a>00086 ULONG -<a name="l00087"></a>00087 ulDepotOffset(ULONG ulIndex, <span class="keywordtype">size_t</span> tBlockSize) -<a name="l00088"></a>00088 { -<a name="l00089"></a>00089 ULONG ulTmp; -<a name="l00090"></a>00090 <span class="keywordtype">size_t</span> tTmp; -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 fail(ulIndex >= ULONG_MAX / BIG_BLOCK_SIZE); -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 <span class="keywordflow">switch</span> (tBlockSize) { -<a name="l00095"></a>00095 <span class="keywordflow">case</span> BIG_BLOCK_SIZE: -<a name="l00096"></a>00096 <span class="keywordflow">return</span> (ulIndex + 1) * BIG_BLOCK_SIZE; -<a name="l00097"></a>00097 <span class="keywordflow">case</span> SMALL_BLOCK_SIZE: -<a name="l00098"></a>00098 tTmp = (size_t)(ulIndex / SIZE_RATIO); -<a name="l00099"></a>00099 ulTmp = ulIndex % SIZE_RATIO; -<a name="l00100"></a>00100 <span class="keywordflow">if</span> (aulSmallBlockList == NULL || -<a name="l00101"></a>00101 tTmp >= tSmallBlockListLen) { -<a name="l00102"></a>00102 DBG_HEX(aulSmallBlockList); -<a name="l00103"></a>00103 DBG_DEC(tSmallBlockListLen); -<a name="l00104"></a>00104 DBG_DEC(tTmp); -<a name="l00105"></a>00105 <span class="keywordflow">return</span> 0; -<a name="l00106"></a>00106 } -<a name="l00107"></a>00107 <span class="keywordflow">return</span> ((aulSmallBlockList[tTmp] + 1) * SIZE_RATIO + -<a name="l00108"></a>00108 ulTmp) * SMALL_BLOCK_SIZE; -<a name="l00109"></a>00109 <span class="keywordflow">default</span>: -<a name="l00110"></a>00110 DBG_DEC(tBlockSize); -<a name="l00111"></a>00111 DBG_FIXME(); -<a name="l00112"></a>00112 <span class="keywordflow">return</span> 0; -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 } <span class="comment">/* end of ulDepotOffset */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/dib2eps_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,525 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/dib2eps.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/dib2eps.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * dib2eps.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2003 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate dib pictures into eps</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> *================================================================</span> -<a name="l00009"></a>00009 <span class="comment"> * This part of the software is based on:</span> -<a name="l00010"></a>00010 <span class="comment"> * The Windows Bitmap Decoder Class part of paintlib</span> -<a name="l00011"></a>00011 <span class="comment"> * Paintlib is copyright (c) 1996-2000 Ulrich von Zadow</span> -<a name="l00012"></a>00012 <span class="comment"> *================================================================</span> -<a name="l00013"></a>00013 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00014"></a>00014 <span class="comment"> */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#include <stdio.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 <span class="comment">/*</span> -<a name="l00021"></a>00021 <span class="comment"> * vDecode1bpp - decode an uncompressed 1 bit per pixel image</span> -<a name="l00022"></a>00022 <span class="comment"> */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00024"></a>00024 vDecode1bpp(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00025"></a>00025 { -<a name="l00026"></a>00026 <span class="keywordtype">size_t</span> tPadding; -<a name="l00027"></a>00027 <span class="keywordtype">int</span> iX, iY, iN, iByte, iTmp, iEighthWidth, iUse; -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 DBG_MSG(<span class="stringliteral">"vDecode1bpp"</span>); -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 fail(pOutFile == NULL); -<a name="l00032"></a>00032 fail(pImg == NULL); -<a name="l00033"></a>00033 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 2); -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 DBG_DEC(pImg->iWidth); -<a name="l00036"></a>00036 DBG_DEC(pImg->iHeight); -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 iEighthWidth = (pImg->iWidth + 7) / 8; -<a name="l00039"></a>00039 tPadding = (size_t)(ROUND4(iEighthWidth) - iEighthWidth); -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight; iY++) { -<a name="l00042"></a>00042 <span class="keywordflow">for</span> (iX = 0; iX < iEighthWidth; iX++) { -<a name="l00043"></a>00043 iByte = iNextByte(pInFile); -<a name="l00044"></a>00044 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00045"></a>00045 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00046"></a>00046 <span class="keywordflow">return</span>; -<a name="l00047"></a>00047 } -<a name="l00048"></a>00048 <span class="keywordflow">if</span> (iX == iEighthWidth - 1 && pImg->iWidth % 8 != 0) { -<a name="l00049"></a>00049 iUse = pImg->iWidth % 8; -<a name="l00050"></a>00050 } <span class="keywordflow">else</span> { -<a name="l00051"></a>00051 iUse = 8; -<a name="l00052"></a>00052 } -<a name="l00053"></a>00053 <span class="keywordflow">for</span> (iN = 0; iN < iUse; iN++) { -<a name="l00054"></a>00054 <span class="keywordflow">switch</span> (iN) { -<a name="l00055"></a>00055 <span class="keywordflow">case</span> 0: iTmp = (iByte & 0x80) / 128; <span class="keywordflow">break</span>; -<a name="l00056"></a>00056 <span class="keywordflow">case</span> 1: iTmp = (iByte & 0x40) / 64; <span class="keywordflow">break</span>; -<a name="l00057"></a>00057 <span class="keywordflow">case</span> 2: iTmp = (iByte & 0x20) / 32; <span class="keywordflow">break</span>; -<a name="l00058"></a>00058 <span class="keywordflow">case</span> 3: iTmp = (iByte & 0x10) / 16; <span class="keywordflow">break</span>; -<a name="l00059"></a>00059 <span class="keywordflow">case</span> 4: iTmp = (iByte & 0x08) / 8; <span class="keywordflow">break</span>; -<a name="l00060"></a>00060 <span class="keywordflow">case</span> 5: iTmp = (iByte & 0x04) / 4; <span class="keywordflow">break</span>; -<a name="l00061"></a>00061 <span class="keywordflow">case</span> 6: iTmp = (iByte & 0x02) / 2; <span class="keywordflow">break</span>; -<a name="l00062"></a>00062 <span class="keywordflow">case</span> 7: iTmp = (iByte & 0x01); <span class="keywordflow">break</span>; -<a name="l00063"></a>00063 <span class="keywordflow">default</span>: iTmp = 0; <span class="keywordflow">break</span>; -<a name="l00064"></a>00064 } -<a name="l00065"></a>00065 vASCII85EncodeByte(pOutFile, iTmp); -<a name="l00066"></a>00066 } -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 (void)tSkipBytes(pInFile, tPadding); -<a name="l00069"></a>00069 } -<a name="l00070"></a>00070 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00071"></a>00071 } <span class="comment">/* end of vDecode1bpp */</span> -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="comment">/*</span> -<a name="l00074"></a>00074 <span class="comment"> * vDecode4bpp - decode an uncompressed 4 bits per pixel image</span> -<a name="l00075"></a>00075 <span class="comment"> */</span> -<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00077"></a>00077 vDecode4bpp(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00078"></a>00078 { -<a name="l00079"></a>00079 <span class="keywordtype">size_t</span> tPadding; -<a name="l00080"></a>00080 <span class="keywordtype">int</span> iX, iY, iN, iByte, iTmp, iHalfWidth, iUse; -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 DBG_MSG(<span class="stringliteral">"vDecode4bpp"</span>); -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 fail(pInFile == NULL); -<a name="l00085"></a>00085 fail(pOutFile == NULL); -<a name="l00086"></a>00086 fail(pImg == NULL); -<a name="l00087"></a>00087 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 16); -<a name="l00088"></a>00088 -<a name="l00089"></a>00089 DBG_DEC(pImg->iWidth); -<a name="l00090"></a>00090 DBG_DEC(pImg->iHeight); -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 iHalfWidth = (pImg->iWidth + 1) / 2; -<a name="l00093"></a>00093 tPadding = (size_t)(ROUND4(iHalfWidth) - iHalfWidth); -<a name="l00094"></a>00094 -<a name="l00095"></a>00095 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight; iY++) { -<a name="l00096"></a>00096 <span class="keywordflow">for</span> (iX = 0; iX < iHalfWidth; iX++) { -<a name="l00097"></a>00097 iByte = iNextByte(pInFile); -<a name="l00098"></a>00098 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00099"></a>00099 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00100"></a>00100 <span class="keywordflow">return</span>; -<a name="l00101"></a>00101 } -<a name="l00102"></a>00102 <span class="keywordflow">if</span> (iX == iHalfWidth - 1 && odd(pImg->iWidth)) { -<a name="l00103"></a>00103 iUse = 1; -<a name="l00104"></a>00104 } <span class="keywordflow">else</span> { -<a name="l00105"></a>00105 iUse = 2; -<a name="l00106"></a>00106 } -<a name="l00107"></a>00107 <span class="keywordflow">for</span> (iN = 0; iN < iUse; iN++) { -<a name="l00108"></a>00108 <span class="keywordflow">if</span> (odd(iN)) { -<a name="l00109"></a>00109 iTmp = iByte & 0x0f; -<a name="l00110"></a>00110 } <span class="keywordflow">else</span> { -<a name="l00111"></a>00111 iTmp = (iByte & 0xf0) / 16; -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 vASCII85EncodeByte(pOutFile, iTmp); -<a name="l00114"></a>00114 } -<a name="l00115"></a>00115 } -<a name="l00116"></a>00116 (void)tSkipBytes(pInFile, tPadding); -<a name="l00117"></a>00117 } -<a name="l00118"></a>00118 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00119"></a>00119 } <span class="comment">/* end of vDecode4bpp */</span> -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 <span class="comment">/*</span> -<a name="l00122"></a>00122 <span class="comment"> * vDecode8bpp - decode an uncompressed 8 bits per pixel image</span> -<a name="l00123"></a>00123 <span class="comment"> */</span> -<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00125"></a>00125 vDecode8bpp(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00126"></a>00126 { -<a name="l00127"></a>00127 <span class="keywordtype">size_t</span> tPadding; -<a name="l00128"></a>00128 <span class="keywordtype">int</span> iX, iY, iByte; -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 DBG_MSG(<span class="stringliteral">"vDecode8bpp"</span>); -<a name="l00131"></a>00131 -<a name="l00132"></a>00132 fail(pInFile == NULL); -<a name="l00133"></a>00133 fail(pOutFile == NULL); -<a name="l00134"></a>00134 fail(pImg == NULL); -<a name="l00135"></a>00135 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 256); -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 DBG_DEC(pImg->iWidth); -<a name="l00138"></a>00138 DBG_DEC(pImg->iHeight); -<a name="l00139"></a>00139 -<a name="l00140"></a>00140 tPadding = (size_t)(ROUND4(pImg->iWidth) - pImg->iWidth); -<a name="l00141"></a>00141 -<a name="l00142"></a>00142 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight; iY++) { -<a name="l00143"></a>00143 <span class="keywordflow">for</span> (iX = 0; iX < pImg->iWidth; iX++) { -<a name="l00144"></a>00144 iByte = iNextByte(pInFile); -<a name="l00145"></a>00145 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00146"></a>00146 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00147"></a>00147 <span class="keywordflow">return</span>; -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 vASCII85EncodeByte(pOutFile, iByte); -<a name="l00150"></a>00150 } -<a name="l00151"></a>00151 (void)tSkipBytes(pInFile, tPadding); -<a name="l00152"></a>00152 } -<a name="l00153"></a>00153 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00154"></a>00154 } <span class="comment">/* end of vDecode8bpp */</span> -<a name="l00155"></a>00155 -<a name="l00156"></a>00156 <span class="comment">/*</span> -<a name="l00157"></a>00157 <span class="comment"> * vDecode24bpp - decode an uncompressed 24 bits per pixel image</span> -<a name="l00158"></a>00158 <span class="comment"> */</span> -<a name="l00159"></a>00159 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00160"></a>00160 vDecode24bpp(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00161"></a>00161 { -<a name="l00162"></a>00162 <span class="keywordtype">size_t</span> tPadding; -<a name="l00163"></a>00163 <span class="keywordtype">int</span> iX, iY, iBlue, iGreen, iRed, iTripleWidth; -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 DBG_MSG(<span class="stringliteral">"vDecode24bpp"</span>); -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 fail(pInFile == NULL); -<a name="l00168"></a>00168 fail(pOutFile == NULL); -<a name="l00169"></a>00169 fail(pImg == NULL); -<a name="l00170"></a>00170 fail(!pImg->bColorImage); -<a name="l00171"></a>00171 -<a name="l00172"></a>00172 DBG_DEC(pImg->iWidth); -<a name="l00173"></a>00173 DBG_DEC(pImg->iHeight); -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 iTripleWidth = pImg->iWidth * 3; -<a name="l00176"></a>00176 tPadding = (size_t)(ROUND4(iTripleWidth) - iTripleWidth); -<a name="l00177"></a>00177 -<a name="l00178"></a>00178 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight; iY++) { -<a name="l00179"></a>00179 <span class="keywordflow">for</span> (iX = 0; iX < pImg->iWidth; iX++) { -<a name="l00180"></a>00180 <span class="comment">/* Change from BGR order to RGB order */</span> -<a name="l00181"></a>00181 iBlue = iNextByte(pInFile); -<a name="l00182"></a>00182 <span class="keywordflow">if</span> (iBlue == EOF) { -<a name="l00183"></a>00183 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00184"></a>00184 <span class="keywordflow">return</span>; -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 iGreen = iNextByte(pInFile); -<a name="l00187"></a>00187 <span class="keywordflow">if</span> (iGreen == EOF) { -<a name="l00188"></a>00188 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00189"></a>00189 <span class="keywordflow">return</span>; -<a name="l00190"></a>00190 } -<a name="l00191"></a>00191 iRed = iNextByte(pInFile); -<a name="l00192"></a>00192 <span class="keywordflow">if</span> (iRed == EOF) { -<a name="l00193"></a>00193 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00194"></a>00194 <span class="keywordflow">return</span>; -<a name="l00195"></a>00195 } -<a name="l00196"></a>00196 vASCII85EncodeByte(pOutFile, iRed); -<a name="l00197"></a>00197 vASCII85EncodeByte(pOutFile, iGreen); -<a name="l00198"></a>00198 vASCII85EncodeByte(pOutFile, iBlue); -<a name="l00199"></a>00199 } -<a name="l00200"></a>00200 (void)tSkipBytes(pInFile, tPadding); -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00203"></a>00203 } <span class="comment">/* end of vDecode24bpp */</span> -<a name="l00204"></a>00204 -<a name="l00205"></a>00205 <span class="comment">/*</span> -<a name="l00206"></a>00206 <span class="comment"> * vDecodeRle4 - decode a RLE compressed 4 bits per pixel image</span> -<a name="l00207"></a>00207 <span class="comment"> */</span> -<a name="l00208"></a>00208 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00209"></a>00209 vDecodeRle4(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00210"></a>00210 { -<a name="l00211"></a>00211 <span class="keywordtype">int</span> iX, iY, iByte, iTmp, iRunLength, iRun; -<a name="l00212"></a>00212 BOOL bEOF, bEOL; -<a name="l00213"></a>00213 -<a name="l00214"></a>00214 DBG_MSG(<span class="stringliteral">"vDecodeRle4"</span>); -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 fail(pInFile == NULL); -<a name="l00217"></a>00217 fail(pOutFile == NULL); -<a name="l00218"></a>00218 fail(pImg == NULL); -<a name="l00219"></a>00219 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 16); -<a name="l00220"></a>00220 -<a name="l00221"></a>00221 DBG_DEC(pImg->iWidth); -<a name="l00222"></a>00222 DBG_DEC(pImg->iHeight); -<a name="l00223"></a>00223 -<a name="l00224"></a>00224 bEOF = FALSE; -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight && !bEOF; iY++) { -<a name="l00227"></a>00227 bEOL = FALSE; -<a name="l00228"></a>00228 iX = 0; -<a name="l00229"></a>00229 <span class="keywordflow">while</span> (!bEOL) { -<a name="l00230"></a>00230 iRunLength = iNextByte(pInFile); -<a name="l00231"></a>00231 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00232"></a>00232 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00233"></a>00233 <span class="keywordflow">return</span>; -<a name="l00234"></a>00234 } -<a name="l00235"></a>00235 <span class="keywordflow">if</span> (iRunLength != 0) { -<a name="l00236"></a>00236 <span class="comment">/*</span> -<a name="l00237"></a>00237 <span class="comment"> * Encoded packet:</span> -<a name="l00238"></a>00238 <span class="comment"> * RunLength pixels, all the "same" value</span> -<a name="l00239"></a>00239 <span class="comment"> */</span> -<a name="l00240"></a>00240 iByte = iNextByte(pInFile); -<a name="l00241"></a>00241 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00242"></a>00242 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00243"></a>00243 <span class="keywordflow">return</span>; -<a name="l00244"></a>00244 } -<a name="l00245"></a>00245 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00246"></a>00246 <span class="keywordflow">if</span> (odd(iRun)) { -<a name="l00247"></a>00247 iTmp = iByte & 0x0f; -<a name="l00248"></a>00248 } <span class="keywordflow">else</span> { -<a name="l00249"></a>00249 iTmp = (iByte & 0xf0) / 16; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00252"></a>00252 vASCII85EncodeByte(pOutFile, iTmp); -<a name="l00253"></a>00253 } -<a name="l00254"></a>00254 iX++; -<a name="l00255"></a>00255 } -<a name="l00256"></a>00256 <span class="keywordflow">continue</span>; -<a name="l00257"></a>00257 } -<a name="l00258"></a>00258 <span class="comment">/* Literal or escape */</span> -<a name="l00259"></a>00259 iRunLength = iNextByte(pInFile); -<a name="l00260"></a>00260 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00261"></a>00261 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00262"></a>00262 <span class="keywordflow">return</span>; -<a name="l00263"></a>00263 } -<a name="l00264"></a>00264 <span class="keywordflow">if</span> (iRunLength == 0) { <span class="comment">/* End of line escape */</span> -<a name="l00265"></a>00265 bEOL = TRUE; -<a name="l00266"></a>00266 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 1) { <span class="comment">/* End of file escape */</span> -<a name="l00267"></a>00267 bEOF = TRUE; -<a name="l00268"></a>00268 bEOL = TRUE; -<a name="l00269"></a>00269 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 2) { <span class="comment">/* Delta escape */</span> -<a name="l00270"></a>00270 DBG_MSG(<span class="stringliteral">"RLE4: encountered delta escape"</span>); -<a name="l00271"></a>00271 bEOF = TRUE; -<a name="l00272"></a>00272 bEOL = TRUE; -<a name="l00273"></a>00273 } <span class="keywordflow">else</span> { <span class="comment">/* Literal packet */</span> -<a name="l00274"></a>00274 iByte = 0; -<a name="l00275"></a>00275 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00276"></a>00276 <span class="keywordflow">if</span> (odd(iRun)) { -<a name="l00277"></a>00277 iTmp = iByte & 0x0f; -<a name="l00278"></a>00278 } <span class="keywordflow">else</span> { -<a name="l00279"></a>00279 iByte = iNextByte(pInFile); -<a name="l00280"></a>00280 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00281"></a>00281 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00282"></a>00282 <span class="keywordflow">return</span>; -<a name="l00283"></a>00283 } -<a name="l00284"></a>00284 iTmp = (iByte & 0xf0) / 16; -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00287"></a>00287 vASCII85EncodeByte(pOutFile, iTmp); -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 iX++; -<a name="l00290"></a>00290 } -<a name="l00291"></a>00291 <span class="comment">/* Padding if the number of bytes is odd */</span> -<a name="l00292"></a>00292 <span class="keywordflow">if</span> (odd((iRunLength + 1) / 2)) { -<a name="l00293"></a>00293 (void)tSkipBytes(pInFile, 1); -<a name="l00294"></a>00294 } -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 } -<a name="l00297"></a>00297 DBG_DEC_C(iX != pImg->iWidth, iX); -<a name="l00298"></a>00298 } -<a name="l00299"></a>00299 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00300"></a>00300 } <span class="comment">/* end of vDecodeRle4 */</span> -<a name="l00301"></a>00301 -<a name="l00302"></a>00302 <span class="comment">/*</span> -<a name="l00303"></a>00303 <span class="comment"> * vDecodeRle8 - decode a RLE compressed 8 bits per pixel image</span> -<a name="l00304"></a>00304 <span class="comment"> */</span> -<a name="l00305"></a>00305 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00306"></a>00306 vDecodeRle8(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00307"></a>00307 { -<a name="l00308"></a>00308 <span class="keywordtype">int</span> iX, iY, iByte, iRunLength, iRun; -<a name="l00309"></a>00309 BOOL bEOF, bEOL; -<a name="l00310"></a>00310 -<a name="l00311"></a>00311 DBG_MSG(<span class="stringliteral">"vDecodeRle8"</span>); -<a name="l00312"></a>00312 -<a name="l00313"></a>00313 fail(pInFile == NULL); -<a name="l00314"></a>00314 fail(pOutFile == NULL); -<a name="l00315"></a>00315 fail(pImg == NULL); -<a name="l00316"></a>00316 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 256); -<a name="l00317"></a>00317 -<a name="l00318"></a>00318 DBG_DEC(pImg->iWidth); -<a name="l00319"></a>00319 DBG_DEC(pImg->iHeight); -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 bEOF = FALSE; -<a name="l00322"></a>00322 -<a name="l00323"></a>00323 <span class="keywordflow">for</span> (iY = 0; iY < pImg->iHeight && !bEOF; iY++) { -<a name="l00324"></a>00324 bEOL = FALSE; -<a name="l00325"></a>00325 iX = 0; -<a name="l00326"></a>00326 <span class="keywordflow">while</span> (!bEOL) { -<a name="l00327"></a>00327 iRunLength = iNextByte(pInFile); -<a name="l00328"></a>00328 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00329"></a>00329 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00330"></a>00330 <span class="keywordflow">return</span>; -<a name="l00331"></a>00331 } -<a name="l00332"></a>00332 <span class="keywordflow">if</span> (iRunLength != 0) { -<a name="l00333"></a>00333 <span class="comment">/*</span> -<a name="l00334"></a>00334 <span class="comment"> * Encoded packet:</span> -<a name="l00335"></a>00335 <span class="comment"> * RunLength pixels, all the same value</span> -<a name="l00336"></a>00336 <span class="comment"> */</span> -<a name="l00337"></a>00337 iByte = iNextByte(pInFile); -<a name="l00338"></a>00338 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00339"></a>00339 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00340"></a>00340 <span class="keywordflow">return</span>; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00343"></a>00343 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00344"></a>00344 vASCII85EncodeByte(pOutFile, iByte); -<a name="l00345"></a>00345 } -<a name="l00346"></a>00346 iX++; -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 <span class="keywordflow">continue</span>; -<a name="l00349"></a>00349 } -<a name="l00350"></a>00350 <span class="comment">/* Literal or escape */</span> -<a name="l00351"></a>00351 iRunLength = iNextByte(pInFile); -<a name="l00352"></a>00352 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00353"></a>00353 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00354"></a>00354 <span class="keywordflow">return</span>; -<a name="l00355"></a>00355 } -<a name="l00356"></a>00356 <span class="keywordflow">if</span> (iRunLength == 0) { <span class="comment">/* End of line escape */</span> -<a name="l00357"></a>00357 bEOL = TRUE; -<a name="l00358"></a>00358 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 1) { <span class="comment">/* End of file escape */</span> -<a name="l00359"></a>00359 bEOF = TRUE; -<a name="l00360"></a>00360 bEOL = TRUE; -<a name="l00361"></a>00361 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 2) { <span class="comment">/* Delta escape */</span> -<a name="l00362"></a>00362 DBG_MSG(<span class="stringliteral">"RLE8: encountered delta escape"</span>); -<a name="l00363"></a>00363 bEOF = TRUE; -<a name="l00364"></a>00364 bEOL = TRUE; -<a name="l00365"></a>00365 } <span class="keywordflow">else</span> { <span class="comment">/* Literal packet */</span> -<a name="l00366"></a>00366 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00367"></a>00367 iByte = iNextByte(pInFile); -<a name="l00368"></a>00368 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00369"></a>00369 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00370"></a>00370 <span class="keywordflow">return</span>; -<a name="l00371"></a>00371 } -<a name="l00372"></a>00372 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00373"></a>00373 vASCII85EncodeByte(pOutFile, iByte); -<a name="l00374"></a>00374 } -<a name="l00375"></a>00375 iX++; -<a name="l00376"></a>00376 } -<a name="l00377"></a>00377 <span class="comment">/* Padding if the number of bytes is odd */</span> -<a name="l00378"></a>00378 <span class="keywordflow">if</span> (odd(iRunLength)) { -<a name="l00379"></a>00379 (void)tSkipBytes(pInFile, 1); -<a name="l00380"></a>00380 } -<a name="l00381"></a>00381 } -<a name="l00382"></a>00382 } -<a name="l00383"></a>00383 DBG_DEC_C(iX != pImg->iWidth, iX); -<a name="l00384"></a>00384 } -<a name="l00385"></a>00385 vASCII85EncodeByte(pOutFile, EOF); -<a name="l00386"></a>00386 } <span class="comment">/* end of vDecodeRle8 */</span> -<a name="l00387"></a>00387 -<a name="l00388"></a>00388 <span class="comment">/*</span> -<a name="l00389"></a>00389 <span class="comment"> * vDecodeDIB - decode a dib picture</span> -<a name="l00390"></a>00390 <span class="comment"> */</span> -<a name="l00391"></a>00391 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00392"></a>00392 vDecodeDIB(FILE *pInFile, FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00393"></a>00393 { -<a name="l00394"></a>00394 <span class="keywordtype">size_t</span> tHeaderSize; -<a name="l00395"></a>00395 -<a name="l00396"></a>00396 fail(pInFile == NULL); -<a name="l00397"></a>00397 fail(pOutFile == NULL); -<a name="l00398"></a>00398 fail(pImg == NULL); -<a name="l00399"></a>00399 -<a name="l00400"></a>00400 <span class="comment">/* Skip the bitmap info header */</span> -<a name="l00401"></a>00401 tHeaderSize = (size_t)ulNextLong(pInFile); -<a name="l00402"></a>00402 (void)tSkipBytes(pInFile, tHeaderSize - 4); -<a name="l00403"></a>00403 <span class="comment">/* Skip the colortable */</span> -<a name="l00404"></a>00404 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00405"></a>00405 (void)tSkipBytes(pInFile, -<a name="l00406"></a>00406 (<span class="keywordtype">size_t</span>)(pImg->iColorsUsed * -<a name="l00407"></a>00407 ((tHeaderSize > 12) ? 4 : 3))); -<a name="l00408"></a>00408 } -<a name="l00409"></a>00409 -<a name="l00410"></a>00410 <span class="keywordflow">switch</span> (pImg->uiBitsPerComponent) { -<a name="l00411"></a>00411 <span class="keywordflow">case</span> 1: -<a name="l00412"></a>00412 fail(pImg->eCompression != compression_none); -<a name="l00413"></a>00413 vDecode1bpp(pInFile, pOutFile, pImg); -<a name="l00414"></a>00414 <span class="keywordflow">break</span>; -<a name="l00415"></a>00415 <span class="keywordflow">case</span> 4: -<a name="l00416"></a>00416 fail(pImg->eCompression != compression_none && -<a name="l00417"></a>00417 pImg->eCompression != compression_rle4); -<a name="l00418"></a>00418 <span class="keywordflow">if</span> (pImg->eCompression == compression_rle4) { -<a name="l00419"></a>00419 vDecodeRle4(pInFile, pOutFile, pImg); -<a name="l00420"></a>00420 } <span class="keywordflow">else</span> { -<a name="l00421"></a>00421 vDecode4bpp(pInFile, pOutFile, pImg); -<a name="l00422"></a>00422 } -<a name="l00423"></a>00423 <span class="keywordflow">break</span>; -<a name="l00424"></a>00424 <span class="keywordflow">case</span> 8: -<a name="l00425"></a>00425 fail(pImg->eCompression != compression_none && -<a name="l00426"></a>00426 pImg->eCompression != compression_rle8); -<a name="l00427"></a>00427 <span class="keywordflow">if</span> (pImg->eCompression == compression_rle8) { -<a name="l00428"></a>00428 vDecodeRle8(pInFile, pOutFile, pImg); -<a name="l00429"></a>00429 } <span class="keywordflow">else</span> { -<a name="l00430"></a>00430 vDecode8bpp(pInFile, pOutFile, pImg); -<a name="l00431"></a>00431 } -<a name="l00432"></a>00432 <span class="keywordflow">break</span>; -<a name="l00433"></a>00433 <span class="keywordflow">case</span> 24: -<a name="l00434"></a>00434 fail(pImg->eCompression != compression_none); -<a name="l00435"></a>00435 vDecode24bpp(pInFile, pOutFile, pImg); -<a name="l00436"></a>00436 <span class="keywordflow">break</span>; -<a name="l00437"></a>00437 <span class="keywordflow">default</span>: -<a name="l00438"></a>00438 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00439"></a>00439 <span class="keywordflow">break</span>; -<a name="l00440"></a>00440 } -<a name="l00441"></a>00441 } <span class="comment">/* end of vDecodeDIB */</span> -<a name="l00442"></a>00442 -<a name="l00443"></a>00443 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00444"></a>00444 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00445"></a>00445 <span class="comment"> * vCopy2File</span> -<a name="l00446"></a>00446 <span class="comment"> */</span> -<a name="l00447"></a>00447 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00448"></a>00448 vCopy2File(FILE *pInFile, ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen) -<a name="l00449"></a>00449 { -<a name="l00450"></a>00450 <span class="keyword">static</span> <span class="keywordtype">int</span> iPicCounter = 0; -<a name="l00451"></a>00451 FILE *pOutFile; -<a name="l00452"></a>00452 <span class="keywordtype">size_t</span> tIndex; -<a name="l00453"></a>00453 <span class="keywordtype">int</span> iTmp; -<a name="l00454"></a>00454 <span class="keywordtype">char</span> szFilename[30]; -<a name="l00455"></a>00455 -<a name="l00456"></a>00456 <span class="keywordflow">if</span> (!bSetDataOffset(pInFile, ulFileOffset)) { -<a name="l00457"></a>00457 <span class="keywordflow">return</span>; -<a name="l00458"></a>00458 } -<a name="l00459"></a>00459 -<a name="l00460"></a>00460 sprintf(szFilename, <span class="stringliteral">"/tmp/pic/pic%04d.bmp"</span>, ++iPicCounter); -<a name="l00461"></a>00461 pOutFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00462"></a>00462 <span class="keywordflow">if</span> (pOutFile == NULL) { -<a name="l00463"></a>00463 <span class="keywordflow">return</span>; -<a name="l00464"></a>00464 } -<a name="l00465"></a>00465 <span class="comment">/* Turn a dib into a bmp by adding a fake 14 byte header */</span> -<a name="l00466"></a>00466 (void)putc(<span class="charliteral">'B'</span>, pOutFile); -<a name="l00467"></a>00467 (void)putc(<span class="charliteral">'M'</span>, pOutFile); -<a name="l00468"></a>00468 <span class="keywordflow">for</span> (iTmp = 0; iTmp < 12; iTmp++) { -<a name="l00469"></a>00469 <span class="keywordflow">if</span> (putc(0, pOutFile) == EOF) { -<a name="l00470"></a>00470 <span class="keywordflow">break</span>; -<a name="l00471"></a>00471 } -<a name="l00472"></a>00472 } -<a name="l00473"></a>00473 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tPictureLen; tIndex++) { -<a name="l00474"></a>00474 iTmp = iNextByte(pInFile); -<a name="l00475"></a>00475 <span class="keywordflow">if</span> (putc(iTmp, pOutFile) == EOF) { -<a name="l00476"></a>00476 <span class="keywordflow">break</span>; -<a name="l00477"></a>00477 } -<a name="l00478"></a>00478 } -<a name="l00479"></a>00479 (void)fclose(pOutFile); -<a name="l00480"></a>00480 } <span class="comment">/* end of vCopy2File */</span> -<a name="l00481"></a>00481 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00482"></a>00482 -<a name="l00483"></a>00483 <span class="comment">/*</span> -<a name="l00484"></a>00484 <span class="comment"> * bTranslateDIB - translate a DIB picture</span> -<a name="l00485"></a>00485 <span class="comment"> *</span> -<a name="l00486"></a>00486 <span class="comment"> * This function translates a picture from dib to eps</span> -<a name="l00487"></a>00487 <span class="comment"> *</span> -<a name="l00488"></a>00488 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00489"></a>00489 <span class="comment"> */</span> -<a name="l00490"></a>00490 BOOL -<a name="l00491"></a>00491 bTranslateDIB(diagram_type *pDiag, FILE *pInFile, -<a name="l00492"></a>00492 ULONG ulFileOffset, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00493"></a>00493 { -<a name="l00494"></a>00494 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00495"></a>00495 <span class="preprocessor"></span> fail(pImg->tPosition > pImg->tLength); -<a name="l00496"></a>00496 vCopy2File(pInFile, ulFileOffset, pImg->tLength - pImg->tPosition); -<a name="l00497"></a>00497 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00498"></a>00498 -<a name="l00499"></a>00499 <span class="comment">/* Seek to start position of DIB data */</span> -<a name="l00500"></a>00500 <span class="keywordflow">if</span> (!bSetDataOffset(pInFile, ulFileOffset)) { -<a name="l00501"></a>00501 <span class="keywordflow">return</span> FALSE; -<a name="l00502"></a>00502 } -<a name="l00503"></a>00503 -<a name="l00504"></a>00504 vImagePrologue(pDiag, pImg); -<a name="l00505"></a>00505 vDecodeDIB(pInFile, pDiag->pOutFile, pImg); -<a name="l00506"></a>00506 vImageEpilogue(pDiag); -<a name="l00507"></a>00507 -<a name="l00508"></a>00508 <span class="keywordflow">return</span> TRUE; -<a name="l00509"></a>00509 } <span class="comment">/* end of bTranslateDIB */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/dib2sprt_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,613 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/dib2sprt.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/dib2sprt.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * dib2sprt.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2003 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate dib pictures into sprites</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:Sprite.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00016"></a>00016 <span class="keyword">static</span> <span class="keywordtype">int</span> iPicCounter = 0; -<a name="l00017"></a>00017 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 <span class="comment">/*</span> -<a name="l00021"></a>00021 <span class="comment"> * iGetByteWidth - compute the number of bytes needed for a row of pixels</span> -<a name="l00022"></a>00022 <span class="comment"> */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00024"></a>00024 iGetByteWidth(<span class="keyword">const</span> imagedata_type *pImg) -<a name="l00025"></a>00025 { -<a name="l00026"></a>00026 <span class="keywordflow">switch</span> (pImg->uiBitsPerComponent) { -<a name="l00027"></a>00027 <span class="keywordflow">case</span> 1: -<a name="l00028"></a>00028 <span class="keywordflow">return</span> (pImg->iWidth + 31) / 32 * <span class="keyword">sizeof</span>(int); -<a name="l00029"></a>00029 <span class="keywordflow">case</span> 4: -<a name="l00030"></a>00030 <span class="keywordflow">return</span> (pImg->iWidth + 7) / 8 * <span class="keyword">sizeof</span>(int); -<a name="l00031"></a>00031 <span class="keywordflow">case</span> 8: -<a name="l00032"></a>00032 <span class="keywordflow">case</span> 24: -<a name="l00033"></a>00033 <span class="keywordflow">return</span> (pImg->iWidth + 3) / 4 * <span class="keyword">sizeof</span>(int); -<a name="l00034"></a>00034 <span class="keywordflow">default</span>: -<a name="l00035"></a>00035 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00036"></a>00036 <span class="keywordflow">return</span> 0; -<a name="l00037"></a>00037 } -<a name="l00038"></a>00038 } <span class="comment">/* end of iGetByteWidth */</span> -<a name="l00039"></a>00039 -<a name="l00040"></a>00040 <span class="comment">/*</span> -<a name="l00041"></a>00041 <span class="comment"> * pCreateBlankSprite - Create a blank sprite.</span> -<a name="l00042"></a>00042 <span class="comment"> *</span> -<a name="l00043"></a>00043 <span class="comment"> * Create a blank sprite and add a palette if needed</span> -<a name="l00044"></a>00044 <span class="comment"> *</span> -<a name="l00045"></a>00045 <span class="comment"> * returns a pointer to the sprite when successful, otherwise NULL</span> -<a name="l00046"></a>00046 <span class="comment"> */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> sprite_areainfo * -<a name="l00048"></a>00048 pCreateBlankSprite(<span class="keyword">const</span> imagedata_type *pImg, <span class="keywordtype">size_t</span> *pSize) -<a name="l00049"></a>00049 { -<a name="l00050"></a>00050 sprite_areainfo *pArea; -<a name="l00051"></a>00051 UCHAR *pucTmp; -<a name="l00052"></a>00052 <span class="keywordtype">size_t</span> tSize; -<a name="l00053"></a>00053 screen_modeval uMode; -<a name="l00054"></a>00054 <span class="keywordtype">int</span> iIndex, iPaletteEntries; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 TRACE_MSG(<span class="stringliteral">"pCreateBlankSprite"</span>); -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 fail(pImg == NULL); -<a name="l00059"></a>00059 fail(pSize == NULL); -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 <span class="keywordflow">switch</span> (pImg->uiBitsPerComponent) { -<a name="l00062"></a>00062 <span class="keywordflow">case</span> 1: -<a name="l00063"></a>00063 uMode.screen_mode = 18; -<a name="l00064"></a>00064 iPaletteEntries = 2; -<a name="l00065"></a>00065 <span class="keywordflow">break</span>; -<a name="l00066"></a>00066 <span class="keywordflow">case</span> 4: -<a name="l00067"></a>00067 uMode.screen_mode = 20; -<a name="l00068"></a>00068 iPaletteEntries = 16; -<a name="l00069"></a>00069 <span class="keywordflow">break</span>; -<a name="l00070"></a>00070 <span class="keywordflow">case</span> 8: -<a name="l00071"></a>00071 <span class="keywordflow">case</span> 24: -<a name="l00072"></a>00072 uMode.screen_mode = 21; -<a name="l00073"></a>00073 iPaletteEntries = 0; -<a name="l00074"></a>00074 <span class="keywordflow">break</span>; -<a name="l00075"></a>00075 <span class="keywordflow">default</span>: -<a name="l00076"></a>00076 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00077"></a>00077 <span class="keywordflow">return</span> NULL; -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 fail(iPaletteEntries < 0 || iPaletteEntries > 16); -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 <span class="comment">/* Get memory for the sprite */</span> -<a name="l00082"></a>00082 tSize = <span class="keyword">sizeof</span>(sprite_areainfo) + -<a name="l00083"></a>00083 Sprite_MemorySize(pImg->iWidth, pImg->iHeight, uMode, -<a name="l00084"></a>00084 iPaletteEntries > 0 ? sprite_HASPAL : sprite_HASNOMASKPAL); -<a name="l00085"></a>00085 DBG_DEC(tSize); -<a name="l00086"></a>00086 pArea = xmalloc(tSize); -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="comment">/* Initialise sprite area */</span> -<a name="l00089"></a>00089 pArea->areasize = tSize; -<a name="l00090"></a>00090 pArea->numsprites = 0; -<a name="l00091"></a>00091 pArea->firstoffset = <span class="keyword">sizeof</span>(sprite_areainfo); -<a name="l00092"></a>00092 pArea->freeoffset = <span class="keyword">sizeof</span>(sprite_areainfo); -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 <span class="comment">/* Create a blank sprite */</span> -<a name="l00095"></a>00095 Error_CheckFatal(Sprite_Create(pArea, <span class="stringliteral">"wordimage"</span>, -<a name="l00096"></a>00096 iPaletteEntries > 0 ? 1 : 0, -<a name="l00097"></a>00097 pImg->iWidth, pImg->iHeight, uMode)); -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 <span class="comment">/* Add the palette */</span> -<a name="l00100"></a>00100 pucTmp = (UCHAR *)pArea + pArea->firstoffset + <span class="keyword">sizeof</span>(sprite_header); -<a name="l00101"></a>00101 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iPaletteEntries; iIndex++) { -<a name="l00102"></a>00102 <span class="comment">/* First color */</span> -<a name="l00103"></a>00103 *pucTmp++ = 0; -<a name="l00104"></a>00104 *pucTmp++ = pImg->aucPalette[iIndex][0]; -<a name="l00105"></a>00105 *pucTmp++ = pImg->aucPalette[iIndex][1]; -<a name="l00106"></a>00106 *pucTmp++ = pImg->aucPalette[iIndex][2]; -<a name="l00107"></a>00107 <span class="comment">/* Second color */</span> -<a name="l00108"></a>00108 *pucTmp++ = 0; -<a name="l00109"></a>00109 *pucTmp++ = pImg->aucPalette[iIndex][0]; -<a name="l00110"></a>00110 *pucTmp++ = pImg->aucPalette[iIndex][1]; -<a name="l00111"></a>00111 *pucTmp++ = pImg->aucPalette[iIndex][2]; -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 *pSize = tSize; -<a name="l00115"></a>00115 <span class="keywordflow">return</span> pArea; -<a name="l00116"></a>00116 } <span class="comment">/* end of pCreateBlankSprite */</span> -<a name="l00117"></a>00117 -<a name="l00118"></a>00118 <span class="comment">/*</span> -<a name="l00119"></a>00119 <span class="comment"> * iReduceColor - reduce from 24 bit to 8 bit color</span> -<a name="l00120"></a>00120 <span class="comment"> *</span> -<a name="l00121"></a>00121 <span class="comment"> * Reduce 24 bit true colors to RISC OS default 256 color palette</span> -<a name="l00122"></a>00122 <span class="comment"> *</span> -<a name="l00123"></a>00123 <span class="comment"> * returns the resulting color</span> -<a name="l00124"></a>00124 <span class="comment"> */</span> -<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00126"></a>00126 iReduceColor(<span class="keywordtype">int</span> iRed, <span class="keywordtype">int</span> iGreen, <span class="keywordtype">int</span> iBlue) -<a name="l00127"></a>00127 { -<a name="l00128"></a>00128 <span class="keywordtype">int</span> iResult; -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 iResult = (iBlue & 0x80) ? 0x80 : 0; -<a name="l00131"></a>00131 iResult |= (iGreen & 0x80) ? 0x40 : 0; -<a name="l00132"></a>00132 iResult |= (iGreen & 0x40) ? 0x20 : 0; -<a name="l00133"></a>00133 iResult |= (iRed & 0x80) ? 0x10 : 0; -<a name="l00134"></a>00134 iResult |= (iBlue & 0x40) ? 0x08 : 0; -<a name="l00135"></a>00135 iResult |= (iRed & 0x40) ? 0x04 : 0; -<a name="l00136"></a>00136 iResult |= ((iRed | iGreen | iBlue) & 0x20) ? 0x02 : 0; -<a name="l00137"></a>00137 iResult |= ((iRed | iGreen | iBlue) & 0x10) ? 0x01 : 0; -<a name="l00138"></a>00138 <span class="keywordflow">return</span> iResult; -<a name="l00139"></a>00139 } <span class="comment">/* end of iReduceColor */</span> -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 <span class="comment">/*</span> -<a name="l00142"></a>00142 <span class="comment"> * vDecode1bpp - decode an uncompressed 1 bit per pixel image</span> -<a name="l00143"></a>00143 <span class="comment"> */</span> -<a name="l00144"></a>00144 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00145"></a>00145 vDecode1bpp(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00146"></a>00146 { -<a name="l00147"></a>00147 <span class="keywordtype">int</span> iX, iY, iByteWidth, iOffset, iTmp, iEighthWidth, iPadding; -<a name="l00148"></a>00148 UCHAR ucTmp; -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 DBG_MSG(<span class="stringliteral">"vDecode1bpp"</span>); -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 fail(pFile == NULL); -<a name="l00153"></a>00153 fail(pucData == NULL); -<a name="l00154"></a>00154 fail(pImg == NULL); -<a name="l00155"></a>00155 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 2); -<a name="l00156"></a>00156 -<a name="l00157"></a>00157 iByteWidth = iGetByteWidth(pImg); -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 iEighthWidth = (pImg->iWidth + 7) / 8; -<a name="l00160"></a>00160 iPadding = ROUND4(iEighthWidth) - iEighthWidth; -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00163"></a>00163 <span class="keywordflow">for</span> (iX = 0; iX < iEighthWidth; iX++) { -<a name="l00164"></a>00164 iTmp = iNextByte(pFile); -<a name="l00165"></a>00165 <span class="keywordflow">if</span> (iTmp == EOF) { -<a name="l00166"></a>00166 <span class="keywordflow">return</span>; -<a name="l00167"></a>00167 } -<a name="l00168"></a>00168 <span class="comment">/* Reverse the bit order */</span> -<a name="l00169"></a>00169 ucTmp = (iTmp & BIT(0)) ? (UCHAR)BIT(7) : 0; -<a name="l00170"></a>00170 ucTmp |= (iTmp & BIT(1)) ? (UCHAR)BIT(6) : 0; -<a name="l00171"></a>00171 ucTmp |= (iTmp & BIT(2)) ? (UCHAR)BIT(5) : 0; -<a name="l00172"></a>00172 ucTmp |= (iTmp & BIT(3)) ? (UCHAR)BIT(4) : 0; -<a name="l00173"></a>00173 ucTmp |= (iTmp & BIT(4)) ? (UCHAR)BIT(3) : 0; -<a name="l00174"></a>00174 ucTmp |= (iTmp & BIT(5)) ? (UCHAR)BIT(2) : 0; -<a name="l00175"></a>00175 ucTmp |= (iTmp & BIT(6)) ? (UCHAR)BIT(1) : 0; -<a name="l00176"></a>00176 ucTmp |= (iTmp & BIT(7)) ? (UCHAR)BIT(0) : 0; -<a name="l00177"></a>00177 iOffset = iY * iByteWidth + iX; -<a name="l00178"></a>00178 *(pucData + iOffset) = ucTmp; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 (void)tSkipBytes(pFile, iPadding); -<a name="l00181"></a>00181 } -<a name="l00182"></a>00182 } <span class="comment">/* end of vDecode1bpp */</span> -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 <span class="comment">/*</span> -<a name="l00185"></a>00185 <span class="comment"> * vDecode4bpp - decode an uncompressed 4 bits per pixel image</span> -<a name="l00186"></a>00186 <span class="comment"> */</span> -<a name="l00187"></a>00187 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00188"></a>00188 vDecode4bpp(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00189"></a>00189 { -<a name="l00190"></a>00190 <span class="keywordtype">int</span> iX, iY, iByteWidth, iOffset, iTmp, iHalfWidth, iPadding; -<a name="l00191"></a>00191 UCHAR ucTmp; -<a name="l00192"></a>00192 -<a name="l00193"></a>00193 DBG_MSG(<span class="stringliteral">"vDecode4bpp"</span>); -<a name="l00194"></a>00194 -<a name="l00195"></a>00195 fail(pFile == NULL); -<a name="l00196"></a>00196 fail(pucData == NULL); -<a name="l00197"></a>00197 fail(pImg == NULL); -<a name="l00198"></a>00198 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 16); -<a name="l00199"></a>00199 -<a name="l00200"></a>00200 iByteWidth = iGetByteWidth(pImg); -<a name="l00201"></a>00201 -<a name="l00202"></a>00202 iHalfWidth = (pImg->iWidth + 1) / 2; -<a name="l00203"></a>00203 iPadding = ROUND4(iHalfWidth) - iHalfWidth; -<a name="l00204"></a>00204 -<a name="l00205"></a>00205 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00206"></a>00206 <span class="keywordflow">for</span> (iX = 0; iX < iHalfWidth; iX++) { -<a name="l00207"></a>00207 iTmp = iNextByte(pFile); -<a name="l00208"></a>00208 <span class="keywordflow">if</span> (iTmp == EOF) { -<a name="l00209"></a>00209 <span class="keywordflow">return</span>; -<a name="l00210"></a>00210 } -<a name="l00211"></a>00211 <span class="comment">/* Reverse the nibble order */</span> -<a name="l00212"></a>00212 ucTmp = (iTmp & 0xf0) >> 4; -<a name="l00213"></a>00213 ucTmp |= (iTmp & 0x0f) << 4; -<a name="l00214"></a>00214 iOffset = iY * iByteWidth + iX; -<a name="l00215"></a>00215 *(pucData + iOffset) = ucTmp; -<a name="l00216"></a>00216 } -<a name="l00217"></a>00217 (void)tSkipBytes(pFile, iPadding); -<a name="l00218"></a>00218 } -<a name="l00219"></a>00219 } <span class="comment">/* end of vDecode4bpp */</span> -<a name="l00220"></a>00220 -<a name="l00221"></a>00221 <span class="comment">/*</span> -<a name="l00222"></a>00222 <span class="comment"> * vDecode8bpp - decode an uncompressed 8 bits per pixel image</span> -<a name="l00223"></a>00223 <span class="comment"> */</span> -<a name="l00224"></a>00224 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00225"></a>00225 vDecode8bpp(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00226"></a>00226 { -<a name="l00227"></a>00227 <span class="keywordtype">int</span> iX, iY, iByteWidth, iOffset, iIndex, iPadding; -<a name="l00228"></a>00228 -<a name="l00229"></a>00229 DBG_MSG(<span class="stringliteral">"vDecode8bpp"</span>); -<a name="l00230"></a>00230 -<a name="l00231"></a>00231 fail(pFile == NULL); -<a name="l00232"></a>00232 fail(pucData == NULL); -<a name="l00233"></a>00233 fail(pImg == NULL); -<a name="l00234"></a>00234 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 256); -<a name="l00235"></a>00235 -<a name="l00236"></a>00236 iByteWidth = iGetByteWidth(pImg); -<a name="l00237"></a>00237 -<a name="l00238"></a>00238 iPadding = ROUND4(pImg->iWidth) - pImg->iWidth; -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00241"></a>00241 <span class="keywordflow">for</span> (iX = 0; iX < pImg->iWidth; iX++) { -<a name="l00242"></a>00242 iIndex = iNextByte(pFile); -<a name="l00243"></a>00243 <span class="keywordflow">if</span> (iIndex == EOF) { -<a name="l00244"></a>00244 <span class="keywordflow">return</span>; -<a name="l00245"></a>00245 } -<a name="l00246"></a>00246 iOffset = iY * iByteWidth + iX; -<a name="l00247"></a>00247 *(pucData + iOffset) = iReduceColor( -<a name="l00248"></a>00248 pImg->aucPalette[iIndex][0], -<a name="l00249"></a>00249 pImg->aucPalette[iIndex][1], -<a name="l00250"></a>00250 pImg->aucPalette[iIndex][2]); -<a name="l00251"></a>00251 } -<a name="l00252"></a>00252 (void)tSkipBytes(pFile, iPadding); -<a name="l00253"></a>00253 } -<a name="l00254"></a>00254 } <span class="comment">/* end of vDecode8bpp */</span> -<a name="l00255"></a>00255 -<a name="l00256"></a>00256 <span class="comment">/*</span> -<a name="l00257"></a>00257 <span class="comment"> * vDecode24bpp - decode an uncompressed 24 bits per pixel image</span> -<a name="l00258"></a>00258 <span class="comment"> */</span> -<a name="l00259"></a>00259 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00260"></a>00260 vDecode24bpp(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00261"></a>00261 { -<a name="l00262"></a>00262 <span class="keywordtype">int</span> iX, iY, iTripleWidth, iByteWidth, iOffset, iPadding; -<a name="l00263"></a>00263 <span class="keywordtype">int</span> iRed, iGreen, iBlue; -<a name="l00264"></a>00264 -<a name="l00265"></a>00265 DBG_MSG(<span class="stringliteral">"vDecode24bpp"</span>); -<a name="l00266"></a>00266 -<a name="l00267"></a>00267 fail(pFile == NULL); -<a name="l00268"></a>00268 fail(pucData == NULL); -<a name="l00269"></a>00269 fail(pImg == NULL); -<a name="l00270"></a>00270 -<a name="l00271"></a>00271 iByteWidth = iGetByteWidth(pImg); -<a name="l00272"></a>00272 -<a name="l00273"></a>00273 iTripleWidth = pImg->iWidth * 3; -<a name="l00274"></a>00274 iPadding = ROUND4(iTripleWidth) - iTripleWidth; -<a name="l00275"></a>00275 -<a name="l00276"></a>00276 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00277"></a>00277 <span class="keywordflow">for</span> (iX = 0; iX < pImg->iWidth; iX++) { -<a name="l00278"></a>00278 iBlue = iNextByte(pFile); -<a name="l00279"></a>00279 <span class="keywordflow">if</span> (iBlue == EOF) { -<a name="l00280"></a>00280 <span class="keywordflow">return</span>; -<a name="l00281"></a>00281 } -<a name="l00282"></a>00282 iGreen = iNextByte(pFile); -<a name="l00283"></a>00283 <span class="keywordflow">if</span> (iGreen == EOF) { -<a name="l00284"></a>00284 <span class="keywordflow">return</span>; -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 iRed = iNextByte(pFile); -<a name="l00287"></a>00287 <span class="keywordflow">if</span> (iRed == EOF) { -<a name="l00288"></a>00288 <span class="keywordflow">return</span>; -<a name="l00289"></a>00289 } -<a name="l00290"></a>00290 iOffset = iY * iByteWidth + iX; -<a name="l00291"></a>00291 *(pucData + iOffset) = -<a name="l00292"></a>00292 iReduceColor(iRed, iGreen, iBlue); -<a name="l00293"></a>00293 } -<a name="l00294"></a>00294 (void)tSkipBytes(pFile, iPadding); -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 } <span class="comment">/* end of vDecode24bpp */</span> -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 <span class="comment">/*</span> -<a name="l00299"></a>00299 <span class="comment"> * vDecodeRle4 - decode a RLE compressed 4 bits per pixel image</span> -<a name="l00300"></a>00300 <span class="comment"> */</span> -<a name="l00301"></a>00301 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00302"></a>00302 vDecodeRle4(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00303"></a>00303 { -<a name="l00304"></a>00304 <span class="keywordtype">int</span> iX, iY, iByteWidth, iOffset, iTmp, iHalfWidth; -<a name="l00305"></a>00305 <span class="keywordtype">int</span> iRun, iRunLength, iHalfRun; -<a name="l00306"></a>00306 BOOL bEOL; -<a name="l00307"></a>00307 UCHAR ucTmp; -<a name="l00308"></a>00308 -<a name="l00309"></a>00309 DBG_MSG(<span class="stringliteral">"vDecodeRle4"</span>); -<a name="l00310"></a>00310 -<a name="l00311"></a>00311 fail(pFile == NULL); -<a name="l00312"></a>00312 fail(pucData == NULL); -<a name="l00313"></a>00313 fail(pImg == NULL); -<a name="l00314"></a>00314 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 16); -<a name="l00315"></a>00315 -<a name="l00316"></a>00316 DBG_DEC(pImg->iWidth); -<a name="l00317"></a>00317 DBG_DEC(pImg->iHeight); -<a name="l00318"></a>00318 -<a name="l00319"></a>00319 iByteWidth = iGetByteWidth(pImg); -<a name="l00320"></a>00320 iHalfWidth = (pImg->iWidth + 1) / 2; -<a name="l00321"></a>00321 -<a name="l00322"></a>00322 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00323"></a>00323 bEOL = FALSE; -<a name="l00324"></a>00324 iX = 0; -<a name="l00325"></a>00325 <span class="keywordflow">while</span> (!bEOL) { -<a name="l00326"></a>00326 iRunLength = iNextByte(pFile); -<a name="l00327"></a>00327 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00328"></a>00328 <span class="keywordflow">return</span>; -<a name="l00329"></a>00329 } -<a name="l00330"></a>00330 <span class="keywordflow">if</span> (iRunLength != 0) { -<a name="l00331"></a>00331 <span class="comment">/*</span> -<a name="l00332"></a>00332 <span class="comment"> * Encoded packet:</span> -<a name="l00333"></a>00333 <span class="comment"> * RunLength pixels, all the "same" value</span> -<a name="l00334"></a>00334 <span class="comment"> */</span> -<a name="l00335"></a>00335 iTmp = iNextByte(pFile); -<a name="l00336"></a>00336 <span class="keywordflow">if</span> (iTmp == EOF) { -<a name="l00337"></a>00337 <span class="keywordflow">return</span>; -<a name="l00338"></a>00338 } -<a name="l00339"></a>00339 <span class="comment">/* Reverse the nibble order */</span> -<a name="l00340"></a>00340 ucTmp = (iTmp & 0xf0) >> 4; -<a name="l00341"></a>00341 ucTmp |= (iTmp & 0x0f) << 4; -<a name="l00342"></a>00342 iHalfRun = (iRunLength + 1) / 2; -<a name="l00343"></a>00343 <span class="keywordflow">for</span> (iRun = 0; iRun < iHalfRun; iRun++) { -<a name="l00344"></a>00344 <span class="keywordflow">if</span> (iX < iHalfWidth) { -<a name="l00345"></a>00345 iOffset = iY * iByteWidth + iX; -<a name="l00346"></a>00346 *(pucData + iOffset) = ucTmp; -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 iX++; -<a name="l00349"></a>00349 } -<a name="l00350"></a>00350 <span class="keywordflow">continue</span>; -<a name="l00351"></a>00351 } -<a name="l00352"></a>00352 <span class="comment">/* Literal or escape */</span> -<a name="l00353"></a>00353 iRunLength = iNextByte(pFile); -<a name="l00354"></a>00354 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00355"></a>00355 <span class="keywordflow">return</span>; -<a name="l00356"></a>00356 } -<a name="l00357"></a>00357 <span class="keywordflow">if</span> (iRunLength == 0) { <span class="comment">/* End of line escape */</span> -<a name="l00358"></a>00358 bEOL = TRUE; -<a name="l00359"></a>00359 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 1) { <span class="comment">/* End of file escape */</span> -<a name="l00360"></a>00360 <span class="keywordflow">return</span>; -<a name="l00361"></a>00361 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 2) { <span class="comment">/* Delta escape */</span> -<a name="l00362"></a>00362 DBG_MSG(<span class="stringliteral">"RLE4: encountered delta escape"</span>); -<a name="l00363"></a>00363 <span class="keywordflow">return</span>; -<a name="l00364"></a>00364 } <span class="keywordflow">else</span> { <span class="comment">/* Literal packet */</span> -<a name="l00365"></a>00365 iHalfRun = (iRunLength + 1) / 2; -<a name="l00366"></a>00366 <span class="keywordflow">for</span> (iRun = 0; iRun < iHalfRun; iRun++) { -<a name="l00367"></a>00367 iTmp = iNextByte(pFile); -<a name="l00368"></a>00368 <span class="keywordflow">if</span> (iTmp == EOF) { -<a name="l00369"></a>00369 <span class="keywordflow">return</span>; -<a name="l00370"></a>00370 } -<a name="l00371"></a>00371 <span class="comment">/* Reverse the nibble order */</span> -<a name="l00372"></a>00372 ucTmp = (iTmp & 0xf0) >> 4; -<a name="l00373"></a>00373 ucTmp |= (iTmp & 0x0f) << 4; -<a name="l00374"></a>00374 <span class="keywordflow">if</span> (iX < iHalfWidth) { -<a name="l00375"></a>00375 iOffset = iY * iByteWidth + iX; -<a name="l00376"></a>00376 *(pucData + iOffset) = ucTmp; -<a name="l00377"></a>00377 } -<a name="l00378"></a>00378 iX++; -<a name="l00379"></a>00379 } -<a name="l00380"></a>00380 <span class="comment">/* Padding if the number of bytes is odd */</span> -<a name="l00381"></a>00381 <span class="keywordflow">if</span> (odd(iHalfRun)) { -<a name="l00382"></a>00382 (void)tSkipBytes(pFile, 1); -<a name="l00383"></a>00383 } -<a name="l00384"></a>00384 } -<a name="l00385"></a>00385 } -<a name="l00386"></a>00386 DBG_DEC_C(iX != iHalfWidth, iX); -<a name="l00387"></a>00387 } -<a name="l00388"></a>00388 } <span class="comment">/* end of vDecodeRle4 */</span> -<a name="l00389"></a>00389 -<a name="l00390"></a>00390 <span class="comment">/*</span> -<a name="l00391"></a>00391 <span class="comment"> * vDecodeRle8 - decode a RLE compressed 8 bits per pixel image</span> -<a name="l00392"></a>00392 <span class="comment"> */</span> -<a name="l00393"></a>00393 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00394"></a>00394 vDecodeRle8(FILE *pFile, UCHAR *pucData, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00395"></a>00395 { -<a name="l00396"></a>00396 <span class="keywordtype">int</span> iX, iY, iRun, iRunLength, iOffset, iIndex, iByteWidth; -<a name="l00397"></a>00397 BOOL bEOL; -<a name="l00398"></a>00398 -<a name="l00399"></a>00399 DBG_MSG(<span class="stringliteral">"vDecodeRle8"</span>); -<a name="l00400"></a>00400 -<a name="l00401"></a>00401 fail(pFile == NULL); -<a name="l00402"></a>00402 fail(pucData == NULL); -<a name="l00403"></a>00403 fail(pImg == NULL); -<a name="l00404"></a>00404 fail(pImg->iColorsUsed < 1 || pImg->iColorsUsed > 256); -<a name="l00405"></a>00405 -<a name="l00406"></a>00406 DBG_DEC(pImg->iWidth); -<a name="l00407"></a>00407 DBG_DEC(pImg->iHeight); -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 iByteWidth = iGetByteWidth(pImg); -<a name="l00410"></a>00410 -<a name="l00411"></a>00411 <span class="keywordflow">for</span> (iY = pImg->iHeight - 1; iY >= 0; iY--) { -<a name="l00412"></a>00412 bEOL = FALSE; -<a name="l00413"></a>00413 iX = 0; -<a name="l00414"></a>00414 <span class="keywordflow">while</span> (!bEOL) { -<a name="l00415"></a>00415 iRunLength = iNextByte(pFile); -<a name="l00416"></a>00416 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00417"></a>00417 <span class="keywordflow">return</span>; -<a name="l00418"></a>00418 } -<a name="l00419"></a>00419 <span class="keywordflow">if</span> (iRunLength != 0) { -<a name="l00420"></a>00420 <span class="comment">/*</span> -<a name="l00421"></a>00421 <span class="comment"> * Encoded packet:</span> -<a name="l00422"></a>00422 <span class="comment"> * RunLength pixels, all the same value</span> -<a name="l00423"></a>00423 <span class="comment"> */</span> -<a name="l00424"></a>00424 iIndex = iNextByte(pFile); -<a name="l00425"></a>00425 <span class="keywordflow">if</span> (iIndex == EOF) { -<a name="l00426"></a>00426 <span class="keywordflow">return</span>; -<a name="l00427"></a>00427 } -<a name="l00428"></a>00428 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00429"></a>00429 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00430"></a>00430 iOffset = iY * iByteWidth + iX; -<a name="l00431"></a>00431 *(pucData + iOffset) = -<a name="l00432"></a>00432 iReduceColor( -<a name="l00433"></a>00433 pImg->aucPalette[iIndex][0], -<a name="l00434"></a>00434 pImg->aucPalette[iIndex][1], -<a name="l00435"></a>00435 pImg->aucPalette[iIndex][2]); -<a name="l00436"></a>00436 } -<a name="l00437"></a>00437 iX++; -<a name="l00438"></a>00438 } -<a name="l00439"></a>00439 <span class="keywordflow">continue</span>; -<a name="l00440"></a>00440 } -<a name="l00441"></a>00441 <span class="comment">/* Literal or escape */</span> -<a name="l00442"></a>00442 iRunLength = iNextByte(pFile); -<a name="l00443"></a>00443 <span class="keywordflow">if</span> (iRunLength == EOF) { -<a name="l00444"></a>00444 <span class="keywordflow">return</span>; -<a name="l00445"></a>00445 } -<a name="l00446"></a>00446 <span class="keywordflow">if</span> (iRunLength == 0) { <span class="comment">/* End of line escape */</span> -<a name="l00447"></a>00447 bEOL = TRUE; -<a name="l00448"></a>00448 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 1) { <span class="comment">/* End of file escape */</span> -<a name="l00449"></a>00449 <span class="keywordflow">return</span>; -<a name="l00450"></a>00450 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iRunLength == 2) { <span class="comment">/* Delta escape */</span> -<a name="l00451"></a>00451 DBG_MSG(<span class="stringliteral">"RLE8: encountered delta escape"</span>); -<a name="l00452"></a>00452 <span class="keywordflow">return</span>; -<a name="l00453"></a>00453 } <span class="keywordflow">else</span> { <span class="comment">/* Literal packet */</span> -<a name="l00454"></a>00454 <span class="keywordflow">for</span> (iRun = 0; iRun < iRunLength; iRun++) { -<a name="l00455"></a>00455 iIndex = iNextByte(pFile); -<a name="l00456"></a>00456 <span class="keywordflow">if</span> (iIndex == EOF) { -<a name="l00457"></a>00457 <span class="keywordflow">return</span>; -<a name="l00458"></a>00458 } -<a name="l00459"></a>00459 <span class="keywordflow">if</span> (iX < pImg->iWidth) { -<a name="l00460"></a>00460 iOffset = iY * iByteWidth + iX; -<a name="l00461"></a>00461 *(pucData + iOffset) = -<a name="l00462"></a>00462 iReduceColor( -<a name="l00463"></a>00463 pImg->aucPalette[iIndex][0], -<a name="l00464"></a>00464 pImg->aucPalette[iIndex][1], -<a name="l00465"></a>00465 pImg->aucPalette[iIndex][2]); -<a name="l00466"></a>00466 } -<a name="l00467"></a>00467 iX++; -<a name="l00468"></a>00468 } -<a name="l00469"></a>00469 <span class="comment">/* Padding if the number of bytes is odd */</span> -<a name="l00470"></a>00470 <span class="keywordflow">if</span> (odd(iRunLength)) { -<a name="l00471"></a>00471 (void)tSkipBytes(pFile, 1); -<a name="l00472"></a>00472 } -<a name="l00473"></a>00473 } -<a name="l00474"></a>00474 } -<a name="l00475"></a>00475 DBG_DEC_C(iX != pImg->iWidth, iX); -<a name="l00476"></a>00476 } -<a name="l00477"></a>00477 } <span class="comment">/* end of vDecodeRle8 */</span> -<a name="l00478"></a>00478 -<a name="l00479"></a>00479 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00480"></a>00480 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00481"></a>00481 vCopy2File(UCHAR *pucSprite, <span class="keywordtype">size_t</span> tSpriteSize) -<a name="l00482"></a>00482 { -<a name="l00483"></a>00483 FILE *pOutFile; -<a name="l00484"></a>00484 <span class="keywordtype">int</span> iIndex; -<a name="l00485"></a>00485 <span class="keywordtype">char</span> szFilename[30]; -<a name="l00486"></a>00486 -<a name="l00487"></a>00487 sprintf(szFilename, <span class="stringliteral">"<Wimp$ScrapDir>.sprt%04d"</span>, ++iPicCounter); -<a name="l00488"></a>00488 pOutFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00489"></a>00489 <span class="keywordflow">if</span> (pOutFile == NULL) { -<a name="l00490"></a>00490 <span class="keywordflow">return</span>; -<a name="l00491"></a>00491 } -<a name="l00492"></a>00492 DBG_MSG(szFilename); -<a name="l00493"></a>00493 <span class="keywordflow">for</span> (iIndex = 4; iIndex < (int)tSpriteSize; iIndex++) { -<a name="l00494"></a>00494 <span class="keywordflow">if</span> (putc(pucSprite[iIndex], pOutFile) == EOF) { -<a name="l00495"></a>00495 <span class="keywordflow">break</span>; -<a name="l00496"></a>00496 } -<a name="l00497"></a>00497 } -<a name="l00498"></a>00498 (void)fclose(pOutFile); -<a name="l00499"></a>00499 vSetFiletype(szFilename, FILETYPE_SPRITE); -<a name="l00500"></a>00500 } <span class="comment">/* end of vCopy2File */</span> -<a name="l00501"></a>00501 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00502"></a>00502 -<a name="l00503"></a>00503 <span class="comment">/*</span> -<a name="l00504"></a>00504 <span class="comment"> * vDecodeDIB - decode a dib picture</span> -<a name="l00505"></a>00505 <span class="comment"> */</span> -<a name="l00506"></a>00506 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00507"></a>00507 vDecodeDIB(diagram_type *pDiag, FILE *pFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00508"></a>00508 { -<a name="l00509"></a>00509 sprite_areainfo *pSprite; -<a name="l00510"></a>00510 UCHAR *pucPalette, *pucData; -<a name="l00511"></a>00511 <span class="keywordtype">size_t</span> tSpriteSize; -<a name="l00512"></a>00512 <span class="keywordtype">int</span> iHeaderSize; -<a name="l00513"></a>00513 -<a name="l00514"></a>00514 <span class="comment">/* Skip the bitmap info header */</span> -<a name="l00515"></a>00515 iHeaderSize = (int)ulNextLong(pFile); -<a name="l00516"></a>00516 (void)tSkipBytes(pFile, iHeaderSize - 4); -<a name="l00517"></a>00517 <span class="comment">/* Skip the colortable */</span> -<a name="l00518"></a>00518 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00519"></a>00519 (void)tSkipBytes(pFile, -<a name="l00520"></a>00520 pImg->iColorsUsed * ((iHeaderSize > 12) ? 4 : 3)); -<a name="l00521"></a>00521 } -<a name="l00522"></a>00522 -<a name="l00523"></a>00523 <span class="comment">/* Create an blank sprite */</span> -<a name="l00524"></a>00524 pSprite = pCreateBlankSprite(pImg, &tSpriteSize); -<a name="l00525"></a>00525 pucPalette = (UCHAR *)pSprite + -<a name="l00526"></a>00526 pSprite->firstoffset + <span class="keyword">sizeof</span>(sprite_header); -<a name="l00527"></a>00527 -<a name="l00528"></a>00528 <span class="comment">/* Add the pixel information */</span> -<a name="l00529"></a>00529 <span class="keywordflow">switch</span> (pImg->uiBitsPerComponent) { -<a name="l00530"></a>00530 <span class="keywordflow">case</span> 1: -<a name="l00531"></a>00531 fail(pImg->eCompression != compression_none); -<a name="l00532"></a>00532 pucData = pucPalette + 2 * 8; -<a name="l00533"></a>00533 vDecode1bpp(pFile, pucData, pImg); -<a name="l00534"></a>00534 <span class="keywordflow">break</span>; -<a name="l00535"></a>00535 <span class="keywordflow">case</span> 4: -<a name="l00536"></a>00536 fail(pImg->eCompression != compression_none && -<a name="l00537"></a>00537 pImg->eCompression != compression_rle4); -<a name="l00538"></a>00538 pucData = pucPalette + 16 * 8; -<a name="l00539"></a>00539 <span class="keywordflow">if</span> (pImg->eCompression == compression_rle4) { -<a name="l00540"></a>00540 vDecodeRle4(pFile, pucData, pImg); -<a name="l00541"></a>00541 } <span class="keywordflow">else</span> { -<a name="l00542"></a>00542 vDecode4bpp(pFile, pucData, pImg); -<a name="l00543"></a>00543 } -<a name="l00544"></a>00544 <span class="keywordflow">break</span>; -<a name="l00545"></a>00545 <span class="keywordflow">case</span> 8: -<a name="l00546"></a>00546 fail(pImg->eCompression != compression_none && -<a name="l00547"></a>00547 pImg->eCompression != compression_rle8); -<a name="l00548"></a>00548 pucData = pucPalette + 0 * 8; -<a name="l00549"></a>00549 <span class="keywordflow">if</span> (pImg->eCompression == compression_rle8) { -<a name="l00550"></a>00550 vDecodeRle8(pFile, pucData, pImg); -<a name="l00551"></a>00551 } <span class="keywordflow">else</span> { -<a name="l00552"></a>00552 vDecode8bpp(pFile, pucData, pImg); -<a name="l00553"></a>00553 } -<a name="l00554"></a>00554 <span class="keywordflow">break</span>; -<a name="l00555"></a>00555 <span class="keywordflow">case</span> 24: -<a name="l00556"></a>00556 fail(pImg->eCompression != compression_none); -<a name="l00557"></a>00557 pucData = pucPalette + 0 * 8; -<a name="l00558"></a>00558 vDecode24bpp(pFile, pucData, pImg); -<a name="l00559"></a>00559 <span class="keywordflow">break</span>; -<a name="l00560"></a>00560 <span class="keywordflow">default</span>: -<a name="l00561"></a>00561 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00562"></a>00562 <span class="keywordflow">break</span>; -<a name="l00563"></a>00563 } -<a name="l00564"></a>00564 -<a name="l00565"></a>00565 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00566"></a>00566 vCopy2File((UCHAR *)pSprite, tSpriteSize); -<a name="l00567"></a>00567 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00568"></a>00568 -<a name="l00569"></a>00569 <span class="comment">/* Add the sprite to the Draw file */</span> -<a name="l00570"></a>00570 vImage2Diagram(pDiag, pImg, -<a name="l00571"></a>00571 (UCHAR *)pSprite + pSprite->firstoffset, -<a name="l00572"></a>00572 tSpriteSize - pSprite->firstoffset); -<a name="l00573"></a>00573 -<a name="l00574"></a>00574 <span class="comment">/* Clean up before you leave */</span> -<a name="l00575"></a>00575 pSprite = xfree(pSprite); -<a name="l00576"></a>00576 } <span class="comment">/* end of vDecodeDIB */</span> -<a name="l00577"></a>00577 -<a name="l00578"></a>00578 <span class="comment">/*</span> -<a name="l00579"></a>00579 <span class="comment"> * bTranslateDIB - translate a DIB picture</span> -<a name="l00580"></a>00580 <span class="comment"> *</span> -<a name="l00581"></a>00581 <span class="comment"> * This function translates a picture from dib to sprite</span> -<a name="l00582"></a>00582 <span class="comment"> *</span> -<a name="l00583"></a>00583 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00584"></a>00584 <span class="comment"> */</span> -<a name="l00585"></a>00585 BOOL -<a name="l00586"></a>00586 bTranslateDIB(diagram_type *pDiag, FILE *pFile, -<a name="l00587"></a>00587 ULONG ulFileOffset, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00588"></a>00588 { -<a name="l00589"></a>00589 <span class="comment">/* Seek to start position of DIB data */</span> -<a name="l00590"></a>00590 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00591"></a>00591 <span class="keywordflow">return</span> FALSE; -<a name="l00592"></a>00592 } -<a name="l00593"></a>00593 -<a name="l00594"></a>00594 vDecodeDIB(pDiag, pFile, pImg); -<a name="l00595"></a>00595 -<a name="l00596"></a>00596 <span class="keywordflow">return</span> TRUE; -<a name="l00597"></a>00597 } <span class="comment">/* end of bTranslateDIB */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/doclist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/doclist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/doclist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * doclist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy list(s) of Word document information</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * Note:</span> -<a name="l00009"></a>00009 <span class="comment"> * There is no real list there is always one document per document</span> -<a name="l00010"></a>00010 <span class="comment"> */</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="preprocessor">#define HALF_INCH 36000L </span><span class="comment">/* In millipoints */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="comment">/* Variables needed to write the Document Information List */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> document_block_type *pAnchor = NULL; -<a name="l00018"></a>00018 <span class="keyword">static</span> document_block_type tInfo; -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/*</span> -<a name="l00022"></a>00022 <span class="comment"> * vDestroyDocumentInfoList - destroy the Document Information List</span> -<a name="l00023"></a>00023 <span class="comment"> */</span> -<a name="l00024"></a>00024 <span class="keywordtype">void</span> -<a name="l00025"></a>00025 vDestroyDocumentInfoList(<span class="keywordtype">void</span>) -<a name="l00026"></a>00026 { -<a name="l00027"></a>00027 DBG_MSG(<span class="stringliteral">"vDestroyDocumentInfoList"</span>); -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 pAnchor = NULL; -<a name="l00030"></a>00030 } <span class="comment">/* end of vDestoryDocumentInfoList */</span> -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 <span class="comment">/*</span> -<a name="l00033"></a>00033 <span class="comment"> * vCreateDocumentInfoList - create the Document Information List</span> -<a name="l00034"></a>00034 <span class="comment"> */</span> -<a name="l00035"></a>00035 <span class="keywordtype">void</span> -<a name="l00036"></a>00036 vCreateDocumentInfoList(<span class="keyword">const</span> document_block_type *pDocument) -<a name="l00037"></a>00037 { -<a name="l00038"></a>00038 fail(pDocument == NULL); -<a name="l00039"></a>00039 fail(pAnchor != NULL); -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 tInfo = *pDocument; -<a name="l00042"></a>00042 pAnchor = &tInfo; -<a name="l00043"></a>00043 } <span class="comment">/* end of vCreateDocumentInfoList */</span> -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 <span class="comment">/*</span> -<a name="l00046"></a>00046 <span class="comment"> * lGetDefaultTabWidth - get the default tabwidth in millipoints</span> -<a name="l00047"></a>00047 <span class="comment"> */</span> -<a name="l00048"></a>00048 <span class="keywordtype">long</span> -<a name="l00049"></a>00049 lGetDefaultTabWidth(<span class="keywordtype">void</span>) -<a name="l00050"></a>00050 { -<a name="l00051"></a>00051 <span class="keywordtype">long</span> lDefaultTabWidth; -<a name="l00052"></a>00052 USHORT usTmp; -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00055"></a>00055 DBG_FIXME(); -<a name="l00056"></a>00056 <span class="keywordflow">return</span> HALF_INCH; -<a name="l00057"></a>00057 } -<a name="l00058"></a>00058 usTmp = pAnchor->usDefaultTabWidth; -<a name="l00059"></a>00059 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp); -<a name="l00060"></a>00060 NO_DBG_DEC(lDefaultTabWidth); -<a name="l00061"></a>00061 <span class="keywordflow">return</span> lDefaultTabWidth; -<a name="l00062"></a>00062 } <span class="comment">/* end of lGetDefaultTabWidth */</span> -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 <span class="comment">/*</span> -<a name="l00065"></a>00065 <span class="comment"> * ucGetDopHdrFtrSpecification - get the Heder/footer specification</span> -<a name="l00066"></a>00066 <span class="comment"> */</span> -<a name="l00067"></a>00067 UCHAR -<a name="l00068"></a>00068 ucGetDopHdrFtrSpecification(<span class="keywordtype">void</span>) -<a name="l00069"></a>00069 { -<a name="l00070"></a>00070 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00071"></a>00071 DBG_FIXME(); -<a name="l00072"></a>00072 <span class="keywordflow">return</span> 0x00; -<a name="l00073"></a>00073 } -<a name="l00074"></a>00074 <span class="keywordflow">return</span> pAnchor->ucHdrFtrSpecification; -<a name="l00075"></a>00075 } <span class="comment">/* end of ucGetDopHdrFtrSpecification */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/draw_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1063 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/draw.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/draw.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * draw.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the Draw format</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <ctype.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:KeyCodes.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "DeskLib:Menu.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "DeskLib:Template.h"</span> -<a name="l00016"></a>00016 <span class="preprocessor">#include "DeskLib:Window.h"</span> -<a name="l00017"></a>00017 <span class="preprocessor">#include "DeskLib:EventMsg.h"</span> -<a name="l00018"></a>00018 <span class="preprocessor">#include "flexlib:flex.h"</span> -<a name="l00019"></a>00019 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00020"></a>00020 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* The work area must be a little bit larger than the diagram */</span> -<a name="l00023"></a>00023 <span class="preprocessor">#define WORKAREA_EXTENSION 5</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="comment">/* Diagram memory */</span> -<a name="l00025"></a>00025 <span class="preprocessor">#define INITIAL_SIZE 32768 </span><span class="comment">/* 32k */</span> -<a name="l00026"></a>00026 <span class="preprocessor">#define EXTENSION_SIZE 4096 </span><span class="comment">/* 4k */</span> -<a name="l00027"></a>00027 <span class="comment">/* Main window title */</span> -<a name="l00028"></a>00028 <span class="preprocessor">#define WINDOW_TITLE_LEN 28</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define FILENAME_TITLE_LEN (WINDOW_TITLE_LEN - 10)</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span> -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 <span class="preprocessor">#if !defined(__GNUC__)</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="keywordtype">int</span> -<a name="l00034"></a>00034 flex_alloc(flex_ptr anchor, <span class="keywordtype">int</span> n) -<a name="l00035"></a>00035 { -<a name="l00036"></a>00036 <span class="keywordtype">void</span> *pvTmp; -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 TRACE_MSG(<span class="stringliteral">"flex_alloc"</span>); -<a name="l00039"></a>00039 -<a name="l00040"></a>00040 <span class="keywordflow">if</span> (anchor == NULL || n < 0) { -<a name="l00041"></a>00041 <span class="keywordflow">return</span> 0; -<a name="l00042"></a>00042 } -<a name="l00043"></a>00043 <span class="keywordflow">if</span> (n == 0) { -<a name="l00044"></a>00044 n = 1; -<a name="l00045"></a>00045 } -<a name="l00046"></a>00046 pvTmp = malloc(n); -<a name="l00047"></a>00047 <span class="keywordflow">if</span> (pvTmp == NULL) { -<a name="l00048"></a>00048 <span class="keywordflow">return</span> 0; -<a name="l00049"></a>00049 } -<a name="l00050"></a>00050 *anchor = pvTmp; -<a name="l00051"></a>00051 <span class="keywordflow">return</span> 1; -<a name="l00052"></a>00052 } <span class="comment">/* end of flex_alloc */</span> -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 <span class="keywordtype">void</span> -<a name="l00055"></a>00055 flex_free(flex_ptr anchor) -<a name="l00056"></a>00056 { -<a name="l00057"></a>00057 TRACE_MSG(<span class="stringliteral">"flex_free"</span>); -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 <span class="keywordflow">if</span> (anchor == NULL || *anchor == NULL) { -<a name="l00060"></a>00060 <span class="keywordflow">return</span>; -<a name="l00061"></a>00061 } -<a name="l00062"></a>00062 free(*anchor); -<a name="l00063"></a>00063 *anchor = NULL; -<a name="l00064"></a>00064 } <span class="comment">/* end of flex_free */</span> -<a name="l00065"></a>00065 -<a name="l00066"></a>00066 <span class="keywordtype">int</span> -<a name="l00067"></a>00067 flex_extend(flex_ptr anchor, <span class="keywordtype">int</span> newsize) -<a name="l00068"></a>00068 { -<a name="l00069"></a>00069 <span class="keywordtype">void</span> *pvTmp; -<a name="l00070"></a>00070 -<a name="l00071"></a>00071 TRACE_MSG(<span class="stringliteral">"flex_extend"</span>); -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="keywordflow">if</span> (anchor == NULL || newsize < 0) { -<a name="l00074"></a>00074 <span class="keywordflow">return</span> 0; -<a name="l00075"></a>00075 } -<a name="l00076"></a>00076 <span class="keywordflow">if</span> (newsize == 0) { -<a name="l00077"></a>00077 newsize = 1; -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 pvTmp = realloc(*anchor, newsize); -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (pvTmp == NULL) { -<a name="l00081"></a>00081 <span class="keywordflow">return</span> 0; -<a name="l00082"></a>00082 } -<a name="l00083"></a>00083 *anchor = pvTmp; -<a name="l00084"></a>00084 <span class="keywordflow">return</span> 1; -<a name="l00085"></a>00085 } <span class="comment">/* end of flex_extend */</span> -<a name="l00086"></a>00086 <span class="preprocessor">#endif </span><span class="comment">/* !__GNUC__ */</span> -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="comment">/*</span> -<a name="l00089"></a>00089 <span class="comment"> * vCreateMainWindow - create the Main window</span> -<a name="l00090"></a>00090 <span class="comment"> *</span> -<a name="l00091"></a>00091 <span class="comment"> * remark: does not return if the Main window can't be created</span> -<a name="l00092"></a>00092 <span class="comment"> */</span> -<a name="l00093"></a>00093 <span class="keyword">static</span> window_handle -<a name="l00094"></a>00094 tCreateMainWindow(<span class="keywordtype">void</span>) -<a name="l00095"></a>00095 { -<a name="l00096"></a>00096 window_handle tMainWindow; -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 TRACE_MSG(<span class="stringliteral">"tCreateMainWindow"</span>); -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 tMainWindow = Window_Create(<span class="stringliteral">"MainWindow"</span>, template_TITLEMIN); -<a name="l00101"></a>00101 <span class="keywordflow">if</span> (tMainWindow == 0) { -<a name="l00102"></a>00102 werr(1, <span class="stringliteral">"I can't find the 'MainWindow' template"</span>); -<a name="l00103"></a>00103 } -<a name="l00104"></a>00104 <span class="keywordflow">return</span> tMainWindow; -<a name="l00105"></a>00105 } <span class="comment">/* end of tCreateMainWindow */</span> -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 <span class="comment">/*</span> -<a name="l00108"></a>00108 <span class="comment"> * vCreateScaleWindow - create the Scale view window</span> -<a name="l00109"></a>00109 <span class="comment"> *</span> -<a name="l00110"></a>00110 <span class="comment"> * remark: does not return if the Scale view window can't be created</span> -<a name="l00111"></a>00111 <span class="comment"> */</span> -<a name="l00112"></a>00112 <span class="keyword">static</span> window_handle -<a name="l00113"></a>00113 tCreateScaleWindow(<span class="keywordtype">void</span>) -<a name="l00114"></a>00114 { -<a name="l00115"></a>00115 window_handle tScaleWindow; -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 TRACE_MSG(<span class="stringliteral">"tCreateScaleWindow"</span>); -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 tScaleWindow = Window_Create(<span class="stringliteral">"ScaleView"</span>, template_TITLEMIN); -<a name="l00120"></a>00120 <span class="keywordflow">if</span> (tScaleWindow == 0) { -<a name="l00121"></a>00121 werr(1, <span class="stringliteral">"I can't find the 'ScaleView' template"</span>); -<a name="l00122"></a>00122 } -<a name="l00123"></a>00123 <span class="keywordflow">return</span> tScaleWindow; -<a name="l00124"></a>00124 } <span class="comment">/* end of tCreateScaleWindow */</span> -<a name="l00125"></a>00125 -<a name="l00126"></a>00126 <span class="comment">/*</span> -<a name="l00127"></a>00127 <span class="comment"> * pCreateDiagram - create and initialize a diagram</span> -<a name="l00128"></a>00128 <span class="comment"> *</span> -<a name="l00129"></a>00129 <span class="comment"> * remark: does not return if the diagram can't be created</span> -<a name="l00130"></a>00130 <span class="comment"> */</span> -<a name="l00131"></a>00131 diagram_type * -<a name="l00132"></a>00132 pCreateDiagram(<span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00133"></a>00133 { -<a name="l00134"></a>00134 diagram_type *pDiag; -<a name="l00135"></a>00135 options_type tOptions; -<a name="l00136"></a>00136 window_handle tMainWindow, tScaleWindow; -<a name="l00137"></a>00137 wimp_box tBox; -<a name="l00138"></a>00138 -<a name="l00139"></a>00139 TRACE_MSG(<span class="stringliteral">"pCreateDiagram"</span>); -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 fail(szTask == NULL || szTask[0] == <span class="charliteral">'\0'</span>); -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 <span class="comment">/* Create the main window */</span> -<a name="l00144"></a>00144 tMainWindow = tCreateMainWindow(); -<a name="l00145"></a>00145 -<a name="l00146"></a>00146 <span class="comment">/* Create the scale view window */</span> -<a name="l00147"></a>00147 tScaleWindow = tCreateScaleWindow(); -<a name="l00148"></a>00148 -<a name="l00149"></a>00149 <span class="comment">/* Get the necessary memory */</span> -<a name="l00150"></a>00150 pDiag = xmalloc(<span class="keyword">sizeof</span>(diagram_type)); -<a name="l00151"></a>00151 <span class="keywordflow">if</span> (flex_alloc((flex_ptr)&pDiag->tInfo.data, INITIAL_SIZE) != 1) { -<a name="l00152"></a>00152 werr(1, <span class="stringliteral">"Memory allocation failed, unable to continue"</span>); -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 -<a name="l00155"></a>00155 <span class="comment">/* Initialize the diagram */</span> -<a name="l00156"></a>00156 vGetOptions(&tOptions); -<a name="l00157"></a>00157 pDiag->tMainWindow = tMainWindow; -<a name="l00158"></a>00158 pDiag->tScaleWindow = tScaleWindow; -<a name="l00159"></a>00159 pDiag->iScaleFactorCurr = tOptions.iScaleFactor; -<a name="l00160"></a>00160 pDiag->iScaleFactorTemp = tOptions.iScaleFactor; -<a name="l00161"></a>00161 pDiag->tMemorySize = INITIAL_SIZE; -<a name="l00162"></a>00162 tBox.min.x = 0; -<a name="l00163"></a>00163 tBox.min.y = -(Drawfile_ScreenToDraw(32 + 3) * 8 + 1); -<a name="l00164"></a>00164 tBox.max.x = Drawfile_ScreenToDraw(16) * MIN_SCREEN_WIDTH + 1; -<a name="l00165"></a>00165 tBox.max.y = 0; -<a name="l00166"></a>00166 Error_CheckFatal(Drawfile_CreateDiagram(&pDiag->tInfo, -<a name="l00167"></a>00167 pDiag->tMemorySize, szTask, tBox)); -<a name="l00168"></a>00168 DBG_DEC(pDiag->tInfo.length); -<a name="l00169"></a>00169 pDiag->lXleft = 0; -<a name="l00170"></a>00170 pDiag->lYtop = 0; -<a name="l00171"></a>00171 strncpy(pDiag->szFilename, -<a name="l00172"></a>00172 szBasename(szFilename), <span class="keyword">sizeof</span>(pDiag->szFilename) - 1); -<a name="l00173"></a>00173 pDiag->szFilename[<span class="keyword">sizeof</span>(pDiag->szFilename) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00174"></a>00174 <span class="comment">/* Return success */</span> -<a name="l00175"></a>00175 <span class="keywordflow">return</span> pDiag; -<a name="l00176"></a>00176 } <span class="comment">/* end of pCreateDiagram */</span> -<a name="l00177"></a>00177 -<a name="l00178"></a>00178 <span class="comment">/*</span> -<a name="l00179"></a>00179 <span class="comment"> * bDestroyDiagram - remove a diagram by freeing the memory it uses</span> -<a name="l00180"></a>00180 <span class="comment"> */</span> -<a name="l00181"></a>00181 BOOL -<a name="l00182"></a>00182 bDestroyDiagram(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00183"></a>00183 { -<a name="l00184"></a>00184 diagram_type *pDiag; -<a name="l00185"></a>00185 window_handle tWindow; -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 TRACE_MSG(<span class="stringliteral">"bDestroyDiagram"</span>); -<a name="l00188"></a>00188 -<a name="l00189"></a>00189 fail(pEvent == NULL); -<a name="l00190"></a>00190 fail(pvReference == NULL); -<a name="l00191"></a>00191 -<a name="l00192"></a>00192 <span class="keywordflow">if</span> (pEvent == NULL || pvReference == NULL) { -<a name="l00193"></a>00193 <span class="keywordflow">return</span> FALSE; -<a name="l00194"></a>00194 } -<a name="l00195"></a>00195 -<a name="l00196"></a>00196 pDiag = (diagram_type *)pvReference; -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 <span class="keywordflow">switch</span> (pEvent->type) { -<a name="l00199"></a>00199 <span class="keywordflow">case</span> event_CLOSE: -<a name="l00200"></a>00200 tWindow = pEvent->data.openblock.window; -<a name="l00201"></a>00201 <span class="keywordflow">break</span>; -<a name="l00202"></a>00202 <span class="keywordflow">case</span> event_KEY: -<a name="l00203"></a>00203 tWindow = pEvent->data.key.caret.window; -<a name="l00204"></a>00204 <span class="keywordflow">break</span>; -<a name="l00205"></a>00205 <span class="keywordflow">default</span>: -<a name="l00206"></a>00206 DBG_DEC(pEvent->type); -<a name="l00207"></a>00207 <span class="keywordflow">return</span> FALSE; -<a name="l00208"></a>00208 } -<a name="l00209"></a>00209 <span class="keywordflow">if</span> (tWindow != pDiag->tMainWindow) { -<a name="l00210"></a>00210 <span class="keywordflow">return</span> FALSE; -<a name="l00211"></a>00211 } -<a name="l00212"></a>00212 -<a name="l00213"></a>00213 <span class="comment">/* Delete the main window */</span> -<a name="l00214"></a>00214 Window_Delete(pDiag->tMainWindow); -<a name="l00215"></a>00215 pDiag->tMainWindow = 0; -<a name="l00216"></a>00216 -<a name="l00217"></a>00217 <span class="comment">/* Delete the scale window */</span> -<a name="l00218"></a>00218 Window_Delete(pDiag->tScaleWindow); -<a name="l00219"></a>00219 pDiag->tScaleWindow = 0; -<a name="l00220"></a>00220 -<a name="l00221"></a>00221 <span class="preprocessor">#if defined(__GNUC__)</span> -<a name="l00222"></a>00222 <span class="preprocessor"></span> <span class="comment">/*</span> -<a name="l00223"></a>00223 <span class="comment"> * Remove all references to the diagram that will be free-ed</span> -<a name="l00224"></a>00224 <span class="comment"> * by undoing the EventMsg_Claim's from within the Menu_Warn's</span> -<a name="l00225"></a>00225 <span class="comment"> */</span> -<a name="l00226"></a>00226 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, -<a name="l00227"></a>00227 bSaveTextfile, pDiag)) -<a name="l00228"></a>00228 ; <span class="comment">/* EMPTY */</span> -<a name="l00229"></a>00229 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, -<a name="l00230"></a>00230 bSaveDrawfile, pDiag)) -<a name="l00231"></a>00231 ; <span class="comment">/* EMPTY */</span> -<a name="l00232"></a>00232 <span class="keywordflow">while</span> (EventMsg_ReleaseSpecific(message_MENUWARNING, window_ANY, -<a name="l00233"></a>00233 bScaleOpenAction, pDiag)) -<a name="l00234"></a>00234 ; <span class="comment">/* EMPTY */</span> -<a name="l00235"></a>00235 <span class="preprocessor">#endif </span><span class="comment">/* __GNUC__ */</span> -<a name="l00236"></a>00236 -<a name="l00237"></a>00237 <span class="comment">/* Free the memory */</span> -<a name="l00238"></a>00238 <span class="keywordflow">if</span> (pDiag->tInfo.data != NULL && pDiag->tMemorySize != 0) { -<a name="l00239"></a>00239 flex_free((flex_ptr)&pDiag->tInfo.data); -<a name="l00240"></a>00240 } -<a name="l00241"></a>00241 <span class="comment">/* Just to be on the save side */</span> -<a name="l00242"></a>00242 pDiag->tInfo.data = NULL; -<a name="l00243"></a>00243 pDiag->tInfo.length = 0; -<a name="l00244"></a>00244 pDiag->tMemorySize = 0; -<a name="l00245"></a>00245 -<a name="l00246"></a>00246 <span class="comment">/* Destroy the diagram itself */</span> -<a name="l00247"></a>00247 pDiag = xfree(pDiag); -<a name="l00248"></a>00248 <span class="keywordflow">return</span> TRUE; -<a name="l00249"></a>00249 } <span class="comment">/* end of bDestroyDiagram */</span> -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 <span class="comment">/*</span> -<a name="l00252"></a>00252 <span class="comment"> * vExtendDiagramSize - make sure the diagram is big enough</span> -<a name="l00253"></a>00253 <span class="comment"> */</span> -<a name="l00254"></a>00254 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00255"></a>00255 vExtendDiagramSize(diagram_type *pDiag, <span class="keywordtype">size_t</span> tSize) -<a name="l00256"></a>00256 { -<a name="l00257"></a>00257 TRACE_MSG(<span class="stringliteral">"vExtendDiagramSize"</span>); -<a name="l00258"></a>00258 -<a name="l00259"></a>00259 fail(pDiag == NULL || tSize % 4 != 0); -<a name="l00260"></a>00260 -<a name="l00261"></a>00261 <span class="keywordflow">while</span> (pDiag->tInfo.length + tSize > pDiag->tMemorySize) { -<a name="l00262"></a>00262 <span class="keywordflow">if</span> (flex_extend((flex_ptr)&pDiag->tInfo.data, -<a name="l00263"></a>00263 pDiag->tMemorySize + EXTENSION_SIZE) != 1) { -<a name="l00264"></a>00264 werr(1, <span class="stringliteral">"Memory extend failed, unable to continue"</span>); -<a name="l00265"></a>00265 } -<a name="l00266"></a>00266 pDiag->tMemorySize += EXTENSION_SIZE; -<a name="l00267"></a>00267 NO_DBG_DEC(pDiag->tMemorySize); -<a name="l00268"></a>00268 } -<a name="l00269"></a>00269 TRACE_MSG(<span class="stringliteral">"end of vExtendDiagramSize"</span>); -<a name="l00270"></a>00270 } <span class="comment">/* end of vExtendDiagramSize */</span> -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 <span class="comment">/*</span> -<a name="l00273"></a>00273 <span class="comment"> * vPrologue2 - prologue part 2; add a font list to a diagram</span> -<a name="l00274"></a>00274 <span class="comment"> */</span> -<a name="l00275"></a>00275 <span class="keywordtype">void</span> -<a name="l00276"></a>00276 vPrologue2(diagram_type *pDiag, <span class="keywordtype">int</span> iWordVersion) -<a name="l00277"></a>00277 { -<a name="l00278"></a>00278 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; -<a name="l00279"></a>00279 <span class="keyword">const</span> font_table_type *pTmp; -<a name="l00280"></a>00280 <span class="keywordtype">char</span> *pcTmp; -<a name="l00281"></a>00281 <span class="keywordtype">size_t</span> tRealSize, tSize; -<a name="l00282"></a>00282 <span class="keywordtype">int</span> iCount; -<a name="l00283"></a>00283 -<a name="l00284"></a>00284 TRACE_MSG(<span class="stringliteral">"vPrologue2"</span>); -<a name="l00285"></a>00285 -<a name="l00286"></a>00286 fail(pDiag == NULL); -<a name="l00287"></a>00287 -<a name="l00288"></a>00288 <span class="keywordflow">if</span> (tGetFontTableLength() == 0) { -<a name="l00289"></a>00289 <span class="keywordflow">return</span>; -<a name="l00290"></a>00290 } -<a name="l00291"></a>00291 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); -<a name="l00292"></a>00292 pTmp = NULL; -<a name="l00293"></a>00293 <span class="keywordflow">while</span> ((pTmp = pGetNextFontTableRecord(pTmp)) != NULL) { -<a name="l00294"></a>00294 tRealSize += 2 + strlen(pTmp->szOurFontname); -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 DBG_DEC(tRealSize); -<a name="l00297"></a>00297 tSize = ROUND4(tRealSize); -<a name="l00298"></a>00298 vExtendDiagramSize(pDiag, tSize); -<a name="l00299"></a>00299 pNew = xmalloc(tSize); -<a name="l00300"></a>00300 memset(pNew, 0, tSize); -<a name="l00301"></a>00301 pNew->type = drawfile_TYPE_FONT_TABLE; -<a name="l00302"></a>00302 pNew->size = tSize; -<a name="l00303"></a>00303 pcTmp = (<span class="keywordtype">char</span> *)&pNew->data.font_table.font_def[0].font_ref; -<a name="l00304"></a>00304 iCount = 0; -<a name="l00305"></a>00305 pTmp = NULL; -<a name="l00306"></a>00306 while ((pTmp = pGetNextFontTableRecord(pTmp)) != NULL) { -<a name="l00307"></a>00307 *pcTmp = ++iCount; -<a name="l00308"></a>00308 pcTmp++; -<a name="l00309"></a>00309 strcpy(pcTmp, pTmp->szOurFontname); -<a name="l00310"></a>00310 pcTmp += 1 + strlen(pTmp->szOurFontname); -<a name="l00311"></a>00311 } -<a name="l00312"></a>00312 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, -<a name="l00313"></a>00313 pDiag->tMemorySize, pNew, TRUE)); -<a name="l00314"></a>00314 pNew = xfree(pNew); -<a name="l00315"></a>00315 } <span class="comment">/* end of vPrologue2 */</span> -<a name="l00316"></a>00316 -<a name="l00317"></a>00317 <span class="comment">/*</span> -<a name="l00318"></a>00318 <span class="comment"> * vSubstring2Diagram - put a sub string into a diagram</span> -<a name="l00319"></a>00319 <span class="comment"> */</span> -<a name="l00320"></a>00320 <span class="keywordtype">void</span> -<a name="l00321"></a>00321 vSubstring2Diagram(diagram_type *pDiag, -<a name="l00322"></a>00322 <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l00323"></a>00323 UCHAR ucFontColor, USHORT usFontstyle, drawfile_fontref tFontRef, -<a name="l00324"></a>00324 USHORT usFontSize, USHORT usMaxFontSize) -<a name="l00325"></a>00325 { -<a name="l00326"></a>00326 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; -<a name="l00327"></a>00327 <span class="keywordtype">long</span> lSizeX, lSizeY, lOffset, l20, lYMove; -<a name="l00328"></a>00328 <span class="keywordtype">size_t</span> tRealSize, tSize; -<a name="l00329"></a>00329 -<a name="l00330"></a>00330 TRACE_MSG(<span class="stringliteral">"vSubstring2Diagram"</span>); -<a name="l00331"></a>00331 -<a name="l00332"></a>00332 fail(pDiag == NULL || szString == NULL); -<a name="l00333"></a>00333 fail(pDiag->lXleft < 0); -<a name="l00334"></a>00334 fail(tStringLength != strlen(szString)); -<a name="l00335"></a>00335 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00336"></a>00336 fail(usMaxFontSize < MIN_FONT_SIZE || usMaxFontSize > MAX_FONT_SIZE); -<a name="l00337"></a>00337 fail(usFontSize > usMaxFontSize); -<a name="l00338"></a>00338 -<a name="l00339"></a>00339 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00340"></a>00340 <span class="keywordflow">return</span>; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 <span class="keywordflow">if</span> (tFontRef == 0) { -<a name="l00344"></a>00344 lOffset = Drawfile_ScreenToDraw(2); -<a name="l00345"></a>00345 l20 = Drawfile_ScreenToDraw(32 + 3); -<a name="l00346"></a>00346 lSizeX = Drawfile_ScreenToDraw(16); -<a name="l00347"></a>00347 lSizeY = Drawfile_ScreenToDraw(32); -<a name="l00348"></a>00348 } <span class="keywordflow">else</span> { -<a name="l00349"></a>00349 lOffset = lToBaseLine(usMaxFontSize); -<a name="l00350"></a>00350 l20 = lWord2DrawUnits20(usMaxFontSize); -<a name="l00351"></a>00351 lSizeX = lWord2DrawUnits00(usFontSize); -<a name="l00352"></a>00352 lSizeY = lWord2DrawUnits00(usFontSize); -<a name="l00353"></a>00353 } -<a name="l00354"></a>00354 -<a name="l00355"></a>00355 lYMove = 0; -<a name="l00356"></a>00356 -<a name="l00357"></a>00357 <span class="comment">/* Up for superscript */</span> -<a name="l00358"></a>00358 <span class="keywordflow">if</span> (bIsSuperscript(usFontstyle)) { -<a name="l00359"></a>00359 lYMove = lMilliPoints2DrawUnits((((<span class="keywordtype">long</span>)usFontSize + 1) / 2) * 375); -<a name="l00360"></a>00360 } -<a name="l00361"></a>00361 <span class="comment">/* Down for subscript */</span> -<a name="l00362"></a>00362 <span class="keywordflow">if</span> (bIsSubscript(usFontstyle)) { -<a name="l00363"></a>00363 lYMove = -lMilliPoints2DrawUnits((<span class="keywordtype">long</span>)usFontSize * 125); -<a name="l00364"></a>00364 } -<a name="l00365"></a>00365 -<a name="l00366"></a>00366 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); -<a name="l00367"></a>00367 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__text.html">drawfile_text</a>) + tStringLength; -<a name="l00368"></a>00368 tSize = ROUND4(tRealSize); -<a name="l00369"></a>00369 vExtendDiagramSize(pDiag, tSize); -<a name="l00370"></a>00370 pNew = xmalloc(tSize); -<a name="l00371"></a>00371 memset(pNew, 0, tSize); -<a name="l00372"></a>00372 pNew->type = drawfile_TYPE_TEXT; -<a name="l00373"></a>00373 pNew->size = tSize; -<a name="l00374"></a>00374 pNew->data.text.bbox.min.x = (int)pDiag->lXleft; -<a name="l00375"></a>00375 pNew->data.text.bbox.min.y = (<span class="keywordtype">int</span>)(pDiag->lYtop + lYMove); -<a name="l00376"></a>00376 pNew->data.text.bbox.max.x = (int)(pDiag->lXleft + lStringWidth); -<a name="l00377"></a>00377 pNew->data.text.bbox.max.y = (int)(pDiag->lYtop + l20 + lYMove); -<a name="l00378"></a>00378 pNew->data.text.fill.value = (int)ulColor2Color(ucFontColor); -<a name="l00379"></a>00379 pNew->data.text.bg_hint.value = 0xffffff00; <span class="comment">/* White */</span> -<a name="l00380"></a>00380 pNew->data.text.style.font_ref = tFontRef; -<a name="l00381"></a>00381 pNew->data.text.style.reserved[0] = 0; -<a name="l00382"></a>00382 pNew->data.text.style.reserved[1] = 0; -<a name="l00383"></a>00383 pNew->data.text.style.reserved[2] = 0; -<a name="l00384"></a>00384 pNew->data.text.xsize = (int)lSizeX; -<a name="l00385"></a>00385 pNew->data.text.ysize = (int)lSizeY; -<a name="l00386"></a>00386 pNew->data.text.base.x = (int)pDiag->lXleft; -<a name="l00387"></a>00387 pNew->data.text.base.y = (<span class="keywordtype">int</span>)(pDiag->lYtop + lOffset + lYMove); -<a name="l00388"></a>00388 strncpy(pNew->data.text.text, szString, tStringLength); -<a name="l00389"></a>00389 pNew->data.text.text[tStringLength] = <span class="charliteral">'\0'</span>; -<a name="l00390"></a>00390 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, -<a name="l00391"></a>00391 pDiag->tMemorySize, pNew, TRUE)); -<a name="l00392"></a>00392 pNew = xfree(pNew); -<a name="l00393"></a>00393 <span class="comment">/*draw_translateText(&pDiag->tInfo);*/</span> -<a name="l00394"></a>00394 pDiag->lXleft += lStringWidth; -<a name="l00395"></a>00395 TRACE_MSG(<span class="stringliteral">"leaving vSubstring2Diagram"</span>); -<a name="l00396"></a>00396 } <span class="comment">/* end of vSubstring2Diagram */</span> -<a name="l00397"></a>00397 -<a name="l00398"></a>00398 <span class="comment">/*</span> -<a name="l00399"></a>00399 <span class="comment"> * vImage2Diagram - put an image into a diagram</span> -<a name="l00400"></a>00400 <span class="comment"> */</span> -<a name="l00401"></a>00401 <span class="keywordtype">void</span> -<a name="l00402"></a>00402 vImage2Diagram(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg, -<a name="l00403"></a>00403 UCHAR *pucImage, <span class="keywordtype">size_t</span> tImageSize) -<a name="l00404"></a>00404 { -<a name="l00405"></a>00405 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; -<a name="l00406"></a>00406 <span class="keywordtype">long</span> lWidth, lHeight; -<a name="l00407"></a>00407 <span class="keywordtype">size_t</span> tRealSize, tSize; -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 TRACE_MSG(<span class="stringliteral">"vImage2Diagram"</span>); -<a name="l00410"></a>00410 -<a name="l00411"></a>00411 fail(pDiag == NULL); -<a name="l00412"></a>00412 fail(pImg == NULL); -<a name="l00413"></a>00413 fail(pDiag->lXleft < 0); -<a name="l00414"></a>00414 fail(pImg->eImageType != imagetype_is_dib && -<a name="l00415"></a>00415 pImg->eImageType != imagetype_is_jpeg); -<a name="l00416"></a>00416 -<a name="l00417"></a>00417 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00418"></a>00418 -<a name="l00419"></a>00419 lWidth = lPoints2DrawUnits(pImg->iHorSizeScaled); -<a name="l00420"></a>00420 lHeight = lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00421"></a>00421 DBG_DEC(lWidth); -<a name="l00422"></a>00422 DBG_DEC(lHeight); -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 pDiag->lYtop -= lHeight; -<a name="l00425"></a>00425 -<a name="l00426"></a>00426 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); -<a name="l00427"></a>00427 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l00428"></a>00428 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l00429"></a>00429 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a>) + tImageSize; -<a name="l00430"></a>00430 tSize = ROUND4(tRealSize); -<a name="l00431"></a>00431 vExtendDiagramSize(pDiag, tSize); -<a name="l00432"></a>00432 pNew = xmalloc(tSize); -<a name="l00433"></a>00433 memset(pNew, 0, tSize); -<a name="l00434"></a>00434 pNew->type = drawfile_TYPE_SPRITE; -<a name="l00435"></a>00435 pNew->size = tSize; -<a name="l00436"></a>00436 pNew->data.sprite.bbox.min.x = (int)pDiag->lXleft; -<a name="l00437"></a>00437 pNew->data.sprite.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; -<a name="l00438"></a>00438 pNew->data.sprite.bbox.max.x = (int)(pDiag->lXleft + lWidth); -<a name="l00439"></a>00439 pNew->data.sprite.bbox.max.y = (int)(pDiag->lYtop + lHeight); -<a name="l00440"></a>00440 memcpy(&pNew->data.sprite.header, pucImage, tImageSize); -<a name="l00441"></a>00441 <span class="keywordflow">break</span>; -<a name="l00442"></a>00442 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l00443"></a>00443 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00444"></a>00444 <span class="preprocessor"></span> (void)bGetJpegInfo(pucImage, tImageSize); -<a name="l00445"></a>00445 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00446"></a>00446 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a>) + tImageSize; -<a name="l00447"></a>00447 tSize = ROUND4(tRealSize); -<a name="l00448"></a>00448 vExtendDiagramSize(pDiag, tSize); -<a name="l00449"></a>00449 pNew = xmalloc(tSize); -<a name="l00450"></a>00450 memset(pNew, 0, tSize); -<a name="l00451"></a>00451 pNew->type = drawfile_TYPE_JPEG; -<a name="l00452"></a>00452 pNew->size = tSize; -<a name="l00453"></a>00453 pNew->data.jpeg.bbox.min.x = (int)pDiag->lXleft; -<a name="l00454"></a>00454 pNew->data.jpeg.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; -<a name="l00455"></a>00455 pNew->data.jpeg.bbox.max.x = (int)(pDiag->lXleft + lWidth); -<a name="l00456"></a>00456 pNew->data.jpeg.bbox.max.y = (int)(pDiag->lYtop + lHeight); -<a name="l00457"></a>00457 pNew->data.jpeg.width = (int)lWidth; -<a name="l00458"></a>00458 pNew->data.jpeg.height = (int)lHeight; -<a name="l00459"></a>00459 pNew->data.jpeg.xdpi = 90; -<a name="l00460"></a>00460 pNew->data.jpeg.ydpi = 90; -<a name="l00461"></a>00461 pNew->data.jpeg.trfm.entries[0][0] = 0x10000; -<a name="l00462"></a>00462 pNew->data.jpeg.trfm.entries[0][1] = 0; -<a name="l00463"></a>00463 pNew->data.jpeg.trfm.entries[1][0] = 0; -<a name="l00464"></a>00464 pNew->data.jpeg.trfm.entries[1][1] = 0x10000; -<a name="l00465"></a>00465 pNew->data.jpeg.trfm.entries[2][0] = (int)pDiag->lXleft; -<a name="l00466"></a>00466 pNew->data.jpeg.trfm.entries[2][1] = (<span class="keywordtype">int</span>)pDiag->lYtop; -<a name="l00467"></a>00467 pNew->data.jpeg.len = tImageSize; -<a name="l00468"></a>00468 memcpy(pNew->data.jpeg.data, pucImage, tImageSize); -<a name="l00469"></a>00469 <span class="keywordflow">break</span>; -<a name="l00470"></a>00470 <span class="keywordflow">default</span>: -<a name="l00471"></a>00471 DBG_DEC(pImg->eImageType); -<a name="l00472"></a>00472 pNew = NULL; -<a name="l00473"></a>00473 <span class="keywordflow">break</span>; -<a name="l00474"></a>00474 } -<a name="l00475"></a>00475 -<a name="l00476"></a>00476 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, -<a name="l00477"></a>00477 pDiag->tMemorySize, pNew, TRUE)); -<a name="l00478"></a>00478 pNew = xfree(pNew); -<a name="l00479"></a>00479 pDiag->lXleft = 0; -<a name="l00480"></a>00480 } <span class="comment">/* end of vImage2Diagram */</span> -<a name="l00481"></a>00481 -<a name="l00482"></a>00482 <span class="comment">/*</span> -<a name="l00483"></a>00483 <span class="comment"> * bAddDummyImage - add a dummy image</span> -<a name="l00484"></a>00484 <span class="comment"> *</span> -<a name="l00485"></a>00485 <span class="comment"> * return TRUE when successful, otherwise FALSE</span> -<a name="l00486"></a>00486 <span class="comment"> */</span> -<a name="l00487"></a>00487 BOOL -<a name="l00488"></a>00488 bAddDummyImage(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00489"></a>00489 { -<a name="l00490"></a>00490 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pNew; -<a name="l00491"></a>00491 <span class="keywordtype">int</span> *piTmp; -<a name="l00492"></a>00492 <span class="keywordtype">long</span> lWidth, lHeight; -<a name="l00493"></a>00493 <span class="keywordtype">size_t</span> tRealSize, tSize; -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 TRACE_MSG(<span class="stringliteral">"bAddDummyImage"</span>); -<a name="l00496"></a>00496 -<a name="l00497"></a>00497 fail(pDiag == NULL); -<a name="l00498"></a>00498 fail(pImg == NULL); -<a name="l00499"></a>00499 fail(pDiag->lXleft < 0); -<a name="l00500"></a>00500 -<a name="l00501"></a>00501 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { -<a name="l00502"></a>00502 <span class="keywordflow">return</span> FALSE; -<a name="l00503"></a>00503 } -<a name="l00504"></a>00504 -<a name="l00505"></a>00505 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00506"></a>00506 -<a name="l00507"></a>00507 lWidth = lPoints2DrawUnits(pImg->iHorSizeScaled); -<a name="l00508"></a>00508 lHeight = lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00509"></a>00509 -<a name="l00510"></a>00510 pDiag->lYtop -= lHeight; -<a name="l00511"></a>00511 -<a name="l00512"></a>00512 tRealSize = offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data); -<a name="l00513"></a>00513 tRealSize += <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__path.html">drawfile_path</a>) + (14 - 1) * <span class="keyword">sizeof</span>(int); -<a name="l00514"></a>00514 tSize = ROUND4(tRealSize); -<a name="l00515"></a>00515 vExtendDiagramSize(pDiag, tSize); -<a name="l00516"></a>00516 pNew = xmalloc(tSize); -<a name="l00517"></a>00517 memset(pNew, 0, tSize); -<a name="l00518"></a>00518 pNew->type = drawfile_TYPE_PATH; -<a name="l00519"></a>00519 pNew->size = tSize; -<a name="l00520"></a>00520 pNew->data.path.bbox.min.x = (int)pDiag->lXleft; -<a name="l00521"></a>00521 pNew->data.path.bbox.min.y = (<span class="keywordtype">int</span>)pDiag->lYtop; -<a name="l00522"></a>00522 pNew->data.path.bbox.max.x = (int)(pDiag->lXleft + lWidth); -<a name="l00523"></a>00523 pNew->data.path.bbox.max.y = (int)(pDiag->lYtop + lHeight); -<a name="l00524"></a>00524 pNew->data.path.fill.value = -1; -<a name="l00525"></a>00525 pNew->data.path.outline.value = 0x4d4d4d00; <span class="comment">/* Gray 70 percent */</span> -<a name="l00526"></a>00526 pNew->data.path.width = (int)lMilliPoints2DrawUnits(500); -<a name="l00527"></a>00527 pNew->data.path.style.flags = 0; -<a name="l00528"></a>00528 pNew->data.path.style.reserved = 0; -<a name="l00529"></a>00529 pNew->data.path.style.cap_width = 0; -<a name="l00530"></a>00530 pNew->data.path.style.cap_length = 0; -<a name="l00531"></a>00531 piTmp = pNew->data.path.path; -<a name="l00532"></a>00532 *piTmp++ = drawfile_PATH_MOVE_TO; -<a name="l00533"></a>00533 *piTmp++ = pNew->data.path.bbox.min.x; -<a name="l00534"></a>00534 *piTmp++ = pNew->data.path.bbox.min.y; -<a name="l00535"></a>00535 *piTmp++ = drawfile_PATH_LINE_TO; -<a name="l00536"></a>00536 *piTmp++ = pNew->data.path.bbox.min.x; -<a name="l00537"></a>00537 *piTmp++ = pNew->data.path.bbox.max.y; -<a name="l00538"></a>00538 *piTmp++ = drawfile_PATH_LINE_TO; -<a name="l00539"></a>00539 *piTmp++ = pNew->data.path.bbox.max.x; -<a name="l00540"></a>00540 *piTmp++ = pNew->data.path.bbox.max.y; -<a name="l00541"></a>00541 *piTmp++ = drawfile_PATH_LINE_TO; -<a name="l00542"></a>00542 *piTmp++ = pNew->data.path.bbox.max.x; -<a name="l00543"></a>00543 *piTmp++ = pNew->data.path.bbox.min.y; -<a name="l00544"></a>00544 *piTmp++ = drawfile_PATH_CLOSE_LINE; -<a name="l00545"></a>00545 *piTmp++ = drawfile_PATH_END_PATH; -<a name="l00546"></a>00546 -<a name="l00547"></a>00547 Error_CheckFatal(Drawfile_AppendObject(&pDiag->tInfo, -<a name="l00548"></a>00548 pDiag->tMemorySize, pNew, TRUE)); -<a name="l00549"></a>00549 pNew = xfree(pNew); -<a name="l00550"></a>00550 pDiag->lXleft = 0; -<a name="l00551"></a>00551 <span class="keywordflow">return</span> TRUE; -<a name="l00552"></a>00552 } <span class="comment">/* end of bAddDummyImage */</span> -<a name="l00553"></a>00553 -<a name="l00554"></a>00554 <span class="comment">/*</span> -<a name="l00555"></a>00555 <span class="comment"> * vMove2NextLine - move to the next line</span> -<a name="l00556"></a>00556 <span class="comment"> */</span> -<a name="l00557"></a>00557 <span class="keywordtype">void</span> -<a name="l00558"></a>00558 vMove2NextLine(diagram_type *pDiag, drawfile_fontref tFontRef, -<a name="l00559"></a>00559 USHORT usFontSize) -<a name="l00560"></a>00560 { -<a name="l00561"></a>00561 <span class="keywordtype">long</span> l20; -<a name="l00562"></a>00562 -<a name="l00563"></a>00563 TRACE_MSG(<span class="stringliteral">"vMove2NextLine"</span>); -<a name="l00564"></a>00564 -<a name="l00565"></a>00565 fail(pDiag == NULL); -<a name="l00566"></a>00566 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00567"></a>00567 -<a name="l00568"></a>00568 <span class="keywordflow">if</span> (tFontRef == 0) { -<a name="l00569"></a>00569 l20 = Drawfile_ScreenToDraw(32 + 3); -<a name="l00570"></a>00570 } <span class="keywordflow">else</span> { -<a name="l00571"></a>00571 l20 = lWord2DrawUnits20(usFontSize); -<a name="l00572"></a>00572 } -<a name="l00573"></a>00573 pDiag->lYtop -= l20; -<a name="l00574"></a>00574 } <span class="comment">/* end of vMove2NextLine */</span> -<a name="l00575"></a>00575 -<a name="l00576"></a>00576 <span class="comment">/*</span> -<a name="l00577"></a>00577 <span class="comment"> * Create an start of paragraph (Phase 1)</span> -<a name="l00578"></a>00578 <span class="comment"> */</span> -<a name="l00579"></a>00579 <span class="keywordtype">void</span> -<a name="l00580"></a>00580 vStartOfParagraph1(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) -<a name="l00581"></a>00581 { -<a name="l00582"></a>00582 TRACE_MSG(<span class="stringliteral">"vStartOfParagraph1"</span>); -<a name="l00583"></a>00583 -<a name="l00584"></a>00584 fail(pDiag == NULL); -<a name="l00585"></a>00585 fail(lBeforeIndentation < 0); -<a name="l00586"></a>00586 -<a name="l00587"></a>00587 pDiag->lXleft = 0; -<a name="l00588"></a>00588 pDiag->lYtop -= lMilliPoints2DrawUnits(lBeforeIndentation); -<a name="l00589"></a>00589 } <span class="comment">/* end of vStartOfParagraph1 */</span> -<a name="l00590"></a>00590 -<a name="l00591"></a>00591 <span class="comment">/*</span> -<a name="l00592"></a>00592 <span class="comment"> * Create an start of paragraph (Phase 2)</span> -<a name="l00593"></a>00593 <span class="comment"> * DUMMY function</span> -<a name="l00594"></a>00594 <span class="comment"> */</span> -<a name="l00595"></a>00595 <span class="keywordtype">void</span> -<a name="l00596"></a>00596 vStartOfParagraph2(diagram_type *pDiag) -<a name="l00597"></a>00597 { -<a name="l00598"></a>00598 TRACE_MSG(<span class="stringliteral">"vStartOfParagraph2"</span>); -<a name="l00599"></a>00599 } <span class="comment">/* end of vStartOfParagraph2 */</span> -<a name="l00600"></a>00600 -<a name="l00601"></a>00601 <span class="comment">/*</span> -<a name="l00602"></a>00602 <span class="comment"> * Create an end of paragraph</span> -<a name="l00603"></a>00603 <span class="comment"> */</span> -<a name="l00604"></a>00604 <span class="keywordtype">void</span> -<a name="l00605"></a>00605 vEndOfParagraph(diagram_type *pDiag, -<a name="l00606"></a>00606 drawfile_fontref tFontRef, USHORT usFontSize, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l00607"></a>00607 { -<a name="l00608"></a>00608 TRACE_MSG(<span class="stringliteral">"vEndOfParagraph"</span>); -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 fail(pDiag == NULL); -<a name="l00611"></a>00611 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00612"></a>00612 fail(lAfterIndentation < 0); -<a name="l00613"></a>00613 -<a name="l00614"></a>00614 pDiag->lXleft = 0; -<a name="l00615"></a>00615 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); -<a name="l00616"></a>00616 } <span class="comment">/* end of vEndOfParagraph */</span> -<a name="l00617"></a>00617 -<a name="l00618"></a>00618 <span class="comment">/*</span> -<a name="l00619"></a>00619 <span class="comment"> * Create an end of page</span> -<a name="l00620"></a>00620 <span class="comment"> */</span> -<a name="l00621"></a>00621 <span class="keywordtype">void</span> -<a name="l00622"></a>00622 vEndOfPage(diagram_type *pDiag, <span class="keywordtype">long</span> lAfterIndentation, BOOL bNewSection) -<a name="l00623"></a>00623 { -<a name="l00624"></a>00624 TRACE_MSG(<span class="stringliteral">"vEndOfPage"</span>); -<a name="l00625"></a>00625 -<a name="l00626"></a>00626 fail(pDiag == NULL); -<a name="l00627"></a>00627 fail(lAfterIndentation < 0); -<a name="l00628"></a>00628 -<a name="l00629"></a>00629 pDiag->lXleft = 0; -<a name="l00630"></a>00630 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); -<a name="l00631"></a>00631 } <span class="comment">/* end of vEndOfPage */</span> -<a name="l00632"></a>00632 -<a name="l00633"></a>00633 <span class="comment">/*</span> -<a name="l00634"></a>00634 <span class="comment"> * vSetHeaders - set the headers</span> -<a name="l00635"></a>00635 <span class="comment"> * DUMMY function</span> -<a name="l00636"></a>00636 <span class="comment"> */</span> -<a name="l00637"></a>00637 <span class="keywordtype">void</span> -<a name="l00638"></a>00638 vSetHeaders(diagram_type *pDiag, USHORT usIstd) -<a name="l00639"></a>00639 { -<a name="l00640"></a>00640 TRACE_MSG(<span class="stringliteral">"vSetHeaders"</span>); -<a name="l00641"></a>00641 } <span class="comment">/* end of vSetHeaders */</span> -<a name="l00642"></a>00642 -<a name="l00643"></a>00643 <span class="comment">/*</span> -<a name="l00644"></a>00644 <span class="comment"> * Create a start of list</span> -<a name="l00645"></a>00645 <span class="comment"> * DUMMY function</span> -<a name="l00646"></a>00646 <span class="comment"> */</span> -<a name="l00647"></a>00647 <span class="keywordtype">void</span> -<a name="l00648"></a>00648 vStartOfList(diagram_type *pDiag, UCHAR ucNFC, BOOL bIsEndOfTable) -<a name="l00649"></a>00649 { -<a name="l00650"></a>00650 TRACE_MSG(<span class="stringliteral">"vStartOfList"</span>); -<a name="l00651"></a>00651 } <span class="comment">/* end of vStartOfList */</span> -<a name="l00652"></a>00652 -<a name="l00653"></a>00653 <span class="comment">/*</span> -<a name="l00654"></a>00654 <span class="comment"> * Create an end of list</span> -<a name="l00655"></a>00655 <span class="comment"> * DUMMY function</span> -<a name="l00656"></a>00656 <span class="comment"> */</span> -<a name="l00657"></a>00657 <span class="keywordtype">void</span> -<a name="l00658"></a>00658 vEndOfList(diagram_type *pDiag) -<a name="l00659"></a>00659 { -<a name="l00660"></a>00660 TRACE_MSG(<span class="stringliteral">"vEndOfList"</span>); -<a name="l00661"></a>00661 } <span class="comment">/* end of vEndOfList */</span> -<a name="l00662"></a>00662 -<a name="l00663"></a>00663 <span class="comment">/*</span> -<a name="l00664"></a>00664 <span class="comment"> * Create a start of a list item</span> -<a name="l00665"></a>00665 <span class="comment"> * DUMMY function</span> -<a name="l00666"></a>00666 <span class="comment"> */</span> -<a name="l00667"></a>00667 <span class="keywordtype">void</span> -<a name="l00668"></a>00668 vStartOfListItem(diagram_type *pDiag, BOOL bNoMarks) -<a name="l00669"></a>00669 { -<a name="l00670"></a>00670 TRACE_MSG(<span class="stringliteral">"vStartOfListItem"</span>); -<a name="l00671"></a>00671 } <span class="comment">/* end of vStartOfListItem */</span> -<a name="l00672"></a>00672 -<a name="l00673"></a>00673 <span class="comment">/*</span> -<a name="l00674"></a>00674 <span class="comment"> * Create an end of a table</span> -<a name="l00675"></a>00675 <span class="comment"> * DUMMY function</span> -<a name="l00676"></a>00676 <span class="comment"> */</span> -<a name="l00677"></a>00677 <span class="keywordtype">void</span> -<a name="l00678"></a>00678 vEndOfTable(diagram_type *pDiag) -<a name="l00679"></a>00679 { -<a name="l00680"></a>00680 TRACE_MSG(<span class="stringliteral">"vEndOfTable"</span>); -<a name="l00681"></a>00681 } <span class="comment">/* end of vEndTable */</span> -<a name="l00682"></a>00682 -<a name="l00683"></a>00683 <span class="comment">/*</span> -<a name="l00684"></a>00684 <span class="comment"> * Add a table row</span> -<a name="l00685"></a>00685 <span class="comment"> * DUMMY function</span> -<a name="l00686"></a>00686 <span class="comment"> *</span> -<a name="l00687"></a>00687 <span class="comment"> * Returns TRUE when conversion type is XML</span> -<a name="l00688"></a>00688 <span class="comment"> */</span> -<a name="l00689"></a>00689 BOOL -<a name="l00690"></a>00690 bAddTableRow(diagram_type *pDiag, <span class="keywordtype">char</span> **aszColTxt, -<a name="l00691"></a>00691 <span class="keywordtype">int</span> iNbrOfColumns, <span class="keyword">const</span> <span class="keywordtype">short</span> *asColumnWidth, UCHAR ucBorderInfo) -<a name="l00692"></a>00692 { -<a name="l00693"></a>00693 TRACE_MSG(<span class="stringliteral">"bAddTableRow"</span>); -<a name="l00694"></a>00694 -<a name="l00695"></a>00695 <span class="keywordflow">return</span> FALSE; -<a name="l00696"></a>00696 } <span class="comment">/* end of bAddTableRow */</span> -<a name="l00697"></a>00697 -<a name="l00698"></a>00698 <span class="comment">/*</span> -<a name="l00699"></a>00699 <span class="comment"> * vForceRedraw - force a redraw of the main window</span> -<a name="l00700"></a>00700 <span class="comment"> */</span> -<a name="l00701"></a>00701 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00702"></a>00702 vForceRedraw(diagram_type *pDiag) -<a name="l00703"></a>00703 { -<a name="l00704"></a>00704 window_state tWindowState; -<a name="l00705"></a>00705 window_redrawblock tRedraw; -<a name="l00706"></a>00706 <span class="keywordtype">int</span> x0, y0, x1, y1; -<a name="l00707"></a>00707 -<a name="l00708"></a>00708 TRACE_MSG(<span class="stringliteral">"vForceRedraw"</span>); -<a name="l00709"></a>00709 -<a name="l00710"></a>00710 fail(pDiag == NULL); -<a name="l00711"></a>00711 -<a name="l00712"></a>00712 DBG_DEC(pDiag->iScaleFactorCurr); -<a name="l00713"></a>00713 -<a name="l00714"></a>00714 <span class="comment">/* Read the size of the current diagram */</span> -<a name="l00715"></a>00715 Drawfile_QueryBox(&pDiag->tInfo, &tRedraw.rect, TRUE); -<a name="l00716"></a>00716 <span class="comment">/* Adjust the size of the work area */</span> -<a name="l00717"></a>00717 x0 = tRedraw.rect.min.x * pDiag->iScaleFactorCurr / 100 - 1; -<a name="l00718"></a>00718 y0 = tRedraw.rect.min.y * pDiag->iScaleFactorCurr / 100 - 1; -<a name="l00719"></a>00719 x1 = tRedraw.rect.max.x * pDiag->iScaleFactorCurr / 100 + 1; -<a name="l00720"></a>00720 y1 = tRedraw.rect.max.y * pDiag->iScaleFactorCurr / 100 + 1; -<a name="l00721"></a>00721 <span class="comment">/* Work area extension */</span> -<a name="l00722"></a>00722 x0 -= WORKAREA_EXTENSION; -<a name="l00723"></a>00723 y0 -= WORKAREA_EXTENSION; -<a name="l00724"></a>00724 x1 += WORKAREA_EXTENSION; -<a name="l00725"></a>00725 y1 += WORKAREA_EXTENSION; -<a name="l00726"></a>00726 Window_SetExtent(pDiag->tMainWindow, x0, y0, x1, y1); -<a name="l00727"></a>00727 <span class="comment">/* Widen the box slightly to be sure all the edges are drawn */</span> -<a name="l00728"></a>00728 x0 -= 5; -<a name="l00729"></a>00729 y0 -= 5; -<a name="l00730"></a>00730 x1 += 5; -<a name="l00731"></a>00731 y1 += 5; -<a name="l00732"></a>00732 <span class="comment">/* Force the redraw */</span> -<a name="l00733"></a>00733 Window_ForceRedraw(pDiag->tMainWindow, x0, y0, x1, y1); -<a name="l00734"></a>00734 <span class="comment">/* Reopen the window to show the correct size */</span> -<a name="l00735"></a>00735 Error_CheckFatal(Wimp_GetWindowState(pDiag->tMainWindow, &tWindowState)); -<a name="l00736"></a>00736 tWindowState.openblock.behind = -1; -<a name="l00737"></a>00737 Error_CheckFatal(Wimp_OpenWindow(&tWindowState.openblock)); -<a name="l00738"></a>00738 } <span class="comment">/* end of vForceRedraw */</span> -<a name="l00739"></a>00739 -<a name="l00740"></a>00740 <span class="comment">/*</span> -<a name="l00741"></a>00741 <span class="comment"> * vShowDiagram - put the diagram on the screen</span> -<a name="l00742"></a>00742 <span class="comment"> */</span> -<a name="l00743"></a>00743 <span class="keywordtype">void</span> -<a name="l00744"></a>00744 vShowDiagram(diagram_type *pDiag) -<a name="l00745"></a>00745 { -<a name="l00746"></a>00746 wimp_box tRect; -<a name="l00747"></a>00747 <span class="keywordtype">int</span> x0, y0, x1, y1; -<a name="l00748"></a>00748 -<a name="l00749"></a>00749 TRACE_MSG(<span class="stringliteral">"vShowDiagram"</span>); -<a name="l00750"></a>00750 -<a name="l00751"></a>00751 fail(pDiag == NULL); -<a name="l00752"></a>00752 -<a name="l00753"></a>00753 Window_Show(pDiag->tMainWindow, open_NEARLAST); -<a name="l00754"></a>00754 Drawfile_QueryBox(&pDiag->tInfo, &tRect, TRUE); -<a name="l00755"></a>00755 <span class="comment">/* Work area extension */</span> -<a name="l00756"></a>00756 x0 = tRect.min.x - WORKAREA_EXTENSION; -<a name="l00757"></a>00757 y0 = tRect.min.y - WORKAREA_EXTENSION; -<a name="l00758"></a>00758 x1 = tRect.max.x + WORKAREA_EXTENSION; -<a name="l00759"></a>00759 y1 = tRect.max.y + WORKAREA_EXTENSION; -<a name="l00760"></a>00760 Window_SetExtent(pDiag->tMainWindow, x0, y0, x1, y1); -<a name="l00761"></a>00761 vForceRedraw(pDiag); -<a name="l00762"></a>00762 } <span class="comment">/* end of vShowDiagram */</span> -<a name="l00763"></a>00763 -<a name="l00764"></a>00764 <span class="comment">/*</span> -<a name="l00765"></a>00765 <span class="comment"> * vMainButtonClick - handle mouse buttons clicks for the main screen</span> -<a name="l00766"></a>00766 <span class="comment"> */</span> -<a name="l00767"></a>00767 <span class="keywordtype">void</span> -<a name="l00768"></a>00768 vMainButtonClick(mouse_block *pMouse) -<a name="l00769"></a>00769 { -<a name="l00770"></a>00770 caret_block tCaret; -<a name="l00771"></a>00771 window_state ws; -<a name="l00772"></a>00772 -<a name="l00773"></a>00773 TRACE_MSG(<span class="stringliteral">"vMainButtonClick"</span>); -<a name="l00774"></a>00774 -<a name="l00775"></a>00775 fail(pMouse == NULL); -<a name="l00776"></a>00776 -<a name="l00777"></a>00777 DBG_DEC(pMouse->button.data.select); -<a name="l00778"></a>00778 DBG_DEC(pMouse->button.data.adjust); -<a name="l00779"></a>00779 DBG_DEC(pMouse->window); -<a name="l00780"></a>00780 DBG_DEC(pMouse->icon); -<a name="l00781"></a>00781 -<a name="l00782"></a>00782 <span class="keywordflow">if</span> (pMouse->window >= 0 && -<a name="l00783"></a>00783 pMouse->icon == -1 && -<a name="l00784"></a>00784 (pMouse->button.data.select || pMouse->button.data.adjust)) { -<a name="l00785"></a>00785 <span class="comment">/* Get the input focus */</span> -<a name="l00786"></a>00786 Error_CheckFatal(Wimp_GetWindowState(pMouse->window, &ws)); -<a name="l00787"></a>00787 tCaret.window = pMouse->window; -<a name="l00788"></a>00788 tCaret.icon = -1; -<a name="l00789"></a>00789 tCaret.offset.x = pMouse->pos.x - ws.openblock.screenrect.min.x; -<a name="l00790"></a>00790 tCaret.offset.y = pMouse->pos.y - ws.openblock.screenrect.max.y; -<a name="l00791"></a>00791 tCaret.height = (int)BIT(25); -<a name="l00792"></a>00792 tCaret.index = 0; -<a name="l00793"></a>00793 Error_CheckFatal(Wimp_SetCaretPosition(&tCaret)); -<a name="l00794"></a>00794 } -<a name="l00795"></a>00795 } <span class="comment">/* end of vMainButtonClick */</span> -<a name="l00796"></a>00796 -<a name="l00797"></a>00797 <span class="comment">/*</span> -<a name="l00798"></a>00798 <span class="comment"> * bMainKeyPressed - handle pressed keys for the main window</span> -<a name="l00799"></a>00799 <span class="comment"> */</span> -<a name="l00800"></a>00800 BOOL -<a name="l00801"></a>00801 bMainKeyPressed(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00802"></a>00802 { -<a name="l00803"></a>00803 diagram_type *pDiag; -<a name="l00804"></a>00804 -<a name="l00805"></a>00805 TRACE_MSG(<span class="stringliteral">"bMainKeyPressed"</span>); -<a name="l00806"></a>00806 -<a name="l00807"></a>00807 fail(pEvent == NULL); -<a name="l00808"></a>00808 fail(pEvent->type != event_KEY); -<a name="l00809"></a>00809 fail(pvReference == NULL); -<a name="l00810"></a>00810 -<a name="l00811"></a>00811 pDiag = (diagram_type *)pvReference; -<a name="l00812"></a>00812 -<a name="l00813"></a>00813 fail(pEvent->data.key.caret.window != pDiag->tMainWindow); -<a name="l00814"></a>00814 -<a name="l00815"></a>00815 -<a name="l00816"></a>00816 <span class="keywordflow">switch</span> (pEvent->data.key.code) { -<a name="l00817"></a>00817 <span class="keywordflow">case</span> keycode_CTRL_F2: <span class="comment">/* Ctrl F2 */</span> -<a name="l00818"></a>00818 bDestroyDiagram(pEvent, pvReference); -<a name="l00819"></a>00819 <span class="keywordflow">break</span>; -<a name="l00820"></a>00820 <span class="keywordflow">case</span> keycode_F3: <span class="comment">/* F3 */</span> -<a name="l00821"></a>00821 bSaveDrawfile(pEvent, pvReference); -<a name="l00822"></a>00822 <span class="keywordflow">break</span>; -<a name="l00823"></a>00823 <span class="keywordflow">case</span> keycode_SHIFT_F3: <span class="comment">/* Shift F3 */</span> -<a name="l00824"></a>00824 bSaveTextfile(pEvent, pvReference); -<a name="l00825"></a>00825 <span class="keywordflow">break</span>; -<a name="l00826"></a>00826 <span class="keywordflow">default</span>: -<a name="l00827"></a>00827 DBG_DEC(pEvent->data.key.code); -<a name="l00828"></a>00828 Error_CheckFatal(Wimp_ProcessKey(pEvent->data.key.code)); -<a name="l00829"></a>00829 } -<a name="l00830"></a>00830 <span class="keywordflow">return</span> TRUE; -<a name="l00831"></a>00831 } <span class="comment">/* end of bMainKeyPressed */</span> -<a name="l00832"></a>00832 -<a name="l00833"></a>00833 <span class="comment">/*</span> -<a name="l00834"></a>00834 <span class="comment"> * bRedrawMainWindow - redraw the main window</span> -<a name="l00835"></a>00835 <span class="comment"> */</span> -<a name="l00836"></a>00836 BOOL -<a name="l00837"></a>00837 bRedrawMainWindow(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00838"></a>00838 { -<a name="l00839"></a>00839 window_redrawblock tBlock; -<a name="l00840"></a>00840 diagram_type *pDiag; -<a name="l00841"></a>00841 <a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo; -<a name="l00842"></a>00842 <span class="keywordtype">double</span> dScaleFactor; -<a name="l00843"></a>00843 BOOL bMore; -<a name="l00844"></a>00844 -<a name="l00845"></a>00845 TRACE_MSG(<span class="stringliteral">"bRedrawMainWindow"</span>); -<a name="l00846"></a>00846 -<a name="l00847"></a>00847 fail(pEvent == NULL); -<a name="l00848"></a>00848 fail(pEvent->type != event_REDRAW); -<a name="l00849"></a>00849 fail(pvReference == NULL); -<a name="l00850"></a>00850 -<a name="l00851"></a>00851 pDiag = (diagram_type *)pvReference; -<a name="l00852"></a>00852 -<a name="l00853"></a>00853 fail(pDiag->tMainWindow != pEvent->data.openblock.window); -<a name="l00854"></a>00854 fail(pDiag->iScaleFactorCurr < MIN_SCALE_FACTOR); -<a name="l00855"></a>00855 fail(pDiag->iScaleFactorCurr > MAX_SCALE_FACTOR); -<a name="l00856"></a>00856 -<a name="l00857"></a>00857 dScaleFactor = (double)pDiag->iScaleFactorCurr / 100.0; -<a name="l00858"></a>00858 pInfo = &pDiag->tInfo; -<a name="l00859"></a>00859 -<a name="l00860"></a>00860 tBlock.window = pEvent->data.openblock.window; -<a name="l00861"></a>00861 Error_CheckFatal(Wimp_RedrawWindow(&tBlock, &bMore)); -<a name="l00862"></a>00862 -<a name="l00863"></a>00863 <span class="comment">/* If there is no real diagram just go thru the motions */</span> -<a name="l00864"></a>00864 <span class="keywordflow">while</span> (bMore) { -<a name="l00865"></a>00865 <span class="keywordflow">if</span> (pInfo->data != NULL && pInfo->length != 0) { -<a name="l00866"></a>00866 Error_CheckFatal(Drawfile_RenderDiagram(pInfo, -<a name="l00867"></a>00867 &tBlock, dScaleFactor)); -<a name="l00868"></a>00868 } -<a name="l00869"></a>00869 Error_CheckFatal(Wimp_GetRectangle(&tBlock, &bMore)); -<a name="l00870"></a>00870 } -<a name="l00871"></a>00871 <span class="keywordflow">return</span> TRUE; -<a name="l00872"></a>00872 } <span class="comment">/* end of bRedrawMainWindow */</span> -<a name="l00873"></a>00873 -<a name="l00874"></a>00874 <span class="comment">/*</span> -<a name="l00875"></a>00875 <span class="comment"> * bScaleOpenAction - action to be taken when the Scale view window opens</span> -<a name="l00876"></a>00876 <span class="comment"> */</span> -<a name="l00877"></a>00877 BOOL -<a name="l00878"></a>00878 bScaleOpenAction(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00879"></a>00879 { -<a name="l00880"></a>00880 window_state tWindowState; -<a name="l00881"></a>00881 diagram_type *pDiag; -<a name="l00882"></a>00882 -<a name="l00883"></a>00883 TRACE_MSG(<span class="stringliteral">"bScaleOpenAction"</span>); -<a name="l00884"></a>00884 -<a name="l00885"></a>00885 fail(pEvent == NULL); -<a name="l00886"></a>00886 fail(pEvent->type != event_SEND); -<a name="l00887"></a>00887 fail(pEvent->data.message.header.action != message_MENUWARN); -<a name="l00888"></a>00888 fail(pvReference == NULL); -<a name="l00889"></a>00889 -<a name="l00890"></a>00890 pDiag = (diagram_type *)pvReference; -<a name="l00891"></a>00891 -<a name="l00892"></a>00892 <span class="keywordflow">if</span> (menu_currentopen != pDiag->pSaveMenu || -<a name="l00893"></a>00893 pEvent->data.message.data.menuwarn.selection[0] != SAVEMENU_SCALEVIEW) { -<a name="l00894"></a>00894 <span class="keywordflow">return</span> FALSE; -<a name="l00895"></a>00895 } -<a name="l00896"></a>00896 -<a name="l00897"></a>00897 Error_CheckFatal(Wimp_GetWindowState(pDiag->tScaleWindow, -<a name="l00898"></a>00898 &tWindowState)); -<a name="l00899"></a>00899 <span class="keywordflow">if</span> (tWindowState.flags.data.open) { -<a name="l00900"></a>00900 <span class="comment">/* The window is already open */</span> -<a name="l00901"></a>00901 <span class="keywordflow">return</span> TRUE; -<a name="l00902"></a>00902 } -<a name="l00903"></a>00903 -<a name="l00904"></a>00904 DBG_MSG(<span class="stringliteral">"vScaleOpenAction for real"</span>); -<a name="l00905"></a>00905 -<a name="l00906"></a>00906 pDiag->iScaleFactorTemp = pDiag->iScaleFactorCurr; -<a name="l00907"></a>00907 vUpdateWriteableNumber(pDiag->tScaleWindow, -<a name="l00908"></a>00908 SCALE_SCALE_WRITEABLE, pDiag->iScaleFactorTemp); -<a name="l00909"></a>00909 Window_Show(pDiag->tScaleWindow, open_UNDERPOINTER); -<a name="l00910"></a>00910 <span class="keywordflow">return</span> TRUE; -<a name="l00911"></a>00911 } <span class="comment">/* end of bScaleOpenAction */</span> -<a name="l00912"></a>00912 -<a name="l00913"></a>00913 <span class="comment">/*</span> -<a name="l00914"></a>00914 <span class="comment"> * vSetTitle - set the title of a window</span> -<a name="l00915"></a>00915 <span class="comment"> */</span> -<a name="l00916"></a>00916 <span class="keywordtype">void</span> -<a name="l00917"></a>00917 vSetTitle(diagram_type *pDiag) -<a name="l00918"></a>00918 { -<a name="l00919"></a>00919 <span class="keywordtype">char</span> szTitle[WINDOW_TITLE_LEN]; -<a name="l00920"></a>00920 -<a name="l00921"></a>00921 TRACE_MSG(<span class="stringliteral">"vSetTitle"</span>); -<a name="l00922"></a>00922 -<a name="l00923"></a>00923 fail(pDiag == NULL); -<a name="l00924"></a>00924 fail(pDiag->szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00925"></a>00925 -<a name="l00926"></a>00926 (void)sprintf(szTitle, <span class="stringliteral">"%.*s at %d%%"</span>, -<a name="l00927"></a>00927 FILENAME_TITLE_LEN, -<a name="l00928"></a>00928 pDiag->szFilename, -<a name="l00929"></a>00929 pDiag->iScaleFactorCurr % 1000); -<a name="l00930"></a>00930 <span class="keywordflow">if</span> (strlen(pDiag->szFilename) > FILENAME_TITLE_LEN) { -<a name="l00931"></a>00931 szTitle[FILENAME_TITLE_LEN - 1] = OUR_ELLIPSIS; -<a name="l00932"></a>00932 } -<a name="l00933"></a>00933 -<a name="l00934"></a>00934 Window_SetTitle(pDiag->tMainWindow, szTitle); -<a name="l00935"></a>00935 } <span class="comment">/* end of vSetTitle */</span> -<a name="l00936"></a>00936 -<a name="l00937"></a>00937 <span class="comment">/*</span> -<a name="l00938"></a>00938 <span class="comment"> * vScaleButtonClick - handle a mouse button click in the Scale view window</span> -<a name="l00939"></a>00939 <span class="comment"> */</span> -<a name="l00940"></a>00940 <span class="keywordtype">void</span> -<a name="l00941"></a>00941 vScaleButtonClick(mouse_block *pMouse, diagram_type *pDiag) -<a name="l00942"></a>00942 { -<a name="l00943"></a>00943 BOOL bCloseWindow, bRedraw; -<a name="l00944"></a>00944 -<a name="l00945"></a>00945 TRACE_MSG(<span class="stringliteral">"vScaleButtonClick"</span>); -<a name="l00946"></a>00946 -<a name="l00947"></a>00947 fail(pMouse == NULL || pDiag == NULL); -<a name="l00948"></a>00948 fail(pMouse->window != pDiag->tScaleWindow); -<a name="l00949"></a>00949 -<a name="l00950"></a>00950 bCloseWindow = FALSE; -<a name="l00951"></a>00951 bRedraw = FALSE; -<a name="l00952"></a>00952 <span class="keywordflow">switch</span> (pMouse->icon) { -<a name="l00953"></a>00953 <span class="keywordflow">case</span> SCALE_CANCEL_BUTTON: -<a name="l00954"></a>00954 bCloseWindow = TRUE; -<a name="l00955"></a>00955 pDiag->iScaleFactorTemp = pDiag->iScaleFactorCurr; -<a name="l00956"></a>00956 <span class="keywordflow">break</span>; -<a name="l00957"></a>00957 <span class="keywordflow">case</span> SCALE_SCALE_BUTTON: -<a name="l00958"></a>00958 bCloseWindow = TRUE; -<a name="l00959"></a>00959 bRedraw = pDiag->iScaleFactorCurr != pDiag->iScaleFactorTemp; -<a name="l00960"></a>00960 pDiag->iScaleFactorCurr = pDiag->iScaleFactorTemp; -<a name="l00961"></a>00961 <span class="keywordflow">break</span>; -<a name="l00962"></a>00962 <span class="keywordflow">case</span> SCALE_50_PCT: -<a name="l00963"></a>00963 pDiag->iScaleFactorTemp = 50; -<a name="l00964"></a>00964 <span class="keywordflow">break</span>; -<a name="l00965"></a>00965 <span class="keywordflow">case</span> SCALE_75_PCT: -<a name="l00966"></a>00966 pDiag->iScaleFactorTemp = 75; -<a name="l00967"></a>00967 <span class="keywordflow">break</span>; -<a name="l00968"></a>00968 <span class="keywordflow">case</span> SCALE_100_PCT: -<a name="l00969"></a>00969 pDiag->iScaleFactorTemp = 100; -<a name="l00970"></a>00970 <span class="keywordflow">break</span>; -<a name="l00971"></a>00971 <span class="keywordflow">case</span> SCALE_150_PCT: -<a name="l00972"></a>00972 pDiag->iScaleFactorTemp = 150; -<a name="l00973"></a>00973 <span class="keywordflow">break</span>; -<a name="l00974"></a>00974 <span class="keywordflow">default</span>: -<a name="l00975"></a>00975 DBG_DEC(pMouse->icon); -<a name="l00976"></a>00976 <span class="keywordflow">break</span>; -<a name="l00977"></a>00977 } -<a name="l00978"></a>00978 <span class="keywordflow">if</span> (bCloseWindow) { -<a name="l00979"></a>00979 <span class="comment">/* Close the scale window */</span> -<a name="l00980"></a>00980 Error_CheckFatal(Wimp_CloseWindow(pMouse->window)); -<a name="l00981"></a>00981 <span class="keywordflow">if</span> (bRedraw) { -<a name="l00982"></a>00982 <span class="comment">/* Redraw the main window */</span> -<a name="l00983"></a>00983 vSetTitle(pDiag); -<a name="l00984"></a>00984 vForceRedraw(pDiag); -<a name="l00985"></a>00985 } -<a name="l00986"></a>00986 } <span class="keywordflow">else</span> { -<a name="l00987"></a>00987 vUpdateWriteableNumber(pMouse->window, -<a name="l00988"></a>00988 SCALE_SCALE_WRITEABLE, -<a name="l00989"></a>00989 pDiag->iScaleFactorTemp); -<a name="l00990"></a>00990 } -<a name="l00991"></a>00991 } <span class="comment">/* end of vScaleButtonClick */</span> -<a name="l00992"></a>00992 -<a name="l00993"></a>00993 <span class="comment">/*</span> -<a name="l00994"></a>00994 <span class="comment"> * bScaleKeyPressed - handle pressed keys for the scale window</span> -<a name="l00995"></a>00995 <span class="comment"> */</span> -<a name="l00996"></a>00996 BOOL -<a name="l00997"></a>00997 bScaleKeyPressed(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00998"></a>00998 { -<a name="l00999"></a>00999 icon_block tIcon; -<a name="l01000"></a>01000 diagram_type *pDiag; -<a name="l01001"></a>01001 caret_block *pCaret; -<a name="l01002"></a>01002 <span class="keywordtype">char</span> *pcChar; -<a name="l01003"></a>01003 <span class="keywordtype">int</span> iTmp; -<a name="l01004"></a>01004 -<a name="l01005"></a>01005 TRACE_MSG(<span class="stringliteral">"bScaleKeyPressed"</span>); -<a name="l01006"></a>01006 -<a name="l01007"></a>01007 fail(pEvent == NULL); -<a name="l01008"></a>01008 fail(pEvent->type != event_KEY); -<a name="l01009"></a>01009 fail(pvReference == NULL); -<a name="l01010"></a>01010 -<a name="l01011"></a>01011 pCaret = &pEvent->data.key.caret; -<a name="l01012"></a>01012 pDiag = (diagram_type *)pvReference; -<a name="l01013"></a>01013 -<a name="l01014"></a>01014 fail(pEvent->data.key.caret.window != pDiag->tScaleWindow); -<a name="l01015"></a>01015 -<a name="l01016"></a>01016 DBG_DEC_C(pCaret->icon != SCALE_SCALE_WRITEABLE, pCaret->icon); -<a name="l01017"></a>01017 DBG_DEC_C(pCaret->icon == SCALE_SCALE_WRITEABLE, pEvent->data.key.code); -<a name="l01018"></a>01018 -<a name="l01019"></a>01019 <span class="keywordflow">if</span> (pEvent->data.key.code != <span class="charliteral">'\r'</span> || -<a name="l01020"></a>01020 pCaret->icon != SCALE_SCALE_WRITEABLE) { -<a name="l01021"></a>01021 Error_CheckFatal(Wimp_ProcessKey(pEvent->data.key.code)); -<a name="l01022"></a>01022 <span class="keywordflow">return</span> TRUE; -<a name="l01023"></a>01023 } -<a name="l01024"></a>01024 -<a name="l01025"></a>01025 Error_CheckFatal(Wimp_GetIconState(pCaret->window, pCaret->icon, &tIcon)); -<a name="l01026"></a>01026 <span class="keywordflow">if</span> (!tIcon.flags.data.text || !tIcon.flags.data.indirected) { -<a name="l01027"></a>01027 werr(1, <span class="stringliteral">"Icon %d must be indirected text"</span>, (<span class="keywordtype">int</span>)pCaret->icon); -<a name="l01028"></a>01028 } -<a name="l01029"></a>01029 iTmp = (int)strtol(tIcon.data.indirecttext.buffer, &pcChar, 10); -<a name="l01030"></a>01030 <span class="keywordflow">if</span> (*pcChar != <span class="charliteral">'\0'</span> && *pcChar != <span class="charliteral">'\r'</span>) { -<a name="l01031"></a>01031 DBG_DEC(*pcChar); -<a name="l01032"></a>01032 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp < MIN_SCALE_FACTOR) { -<a name="l01033"></a>01033 pDiag->iScaleFactorTemp = MIN_SCALE_FACTOR; -<a name="l01034"></a>01034 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp > MAX_SCALE_FACTOR) { -<a name="l01035"></a>01035 pDiag->iScaleFactorTemp = MAX_SCALE_FACTOR; -<a name="l01036"></a>01036 } <span class="keywordflow">else</span> { -<a name="l01037"></a>01037 pDiag->iScaleFactorTemp = iTmp; -<a name="l01038"></a>01038 } -<a name="l01039"></a>01039 pDiag->iScaleFactorCurr = pDiag->iScaleFactorTemp; -<a name="l01040"></a>01040 <span class="comment">/* Close the scale window */</span> -<a name="l01041"></a>01041 Error_CheckFatal(Wimp_CloseWindow(pCaret->window)); -<a name="l01042"></a>01042 <span class="comment">/* Redraw the main window */</span> -<a name="l01043"></a>01043 vSetTitle(pDiag); -<a name="l01044"></a>01044 vForceRedraw(pDiag); -<a name="l01045"></a>01045 <span class="keywordflow">return</span> TRUE; -<a name="l01046"></a>01046 } <span class="comment">/* end of bScaleKeyPressed */</span> -<a name="l01047"></a>01047 -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/draw_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/draw.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/draw.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * draw.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Constants and macros to deal with the Draw format</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__draw_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __draw_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "drawftypes.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a><a class="code" href="structdraw__jpegstrhdr__tag.html">00014</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structdraw__jpegstrhdr__tag.html">draw_jpegstrhdr_tag</a> { -<a name="l00015"></a>00015 draw_tagtyp tag; <span class="comment">/* 1 word */</span> -<a name="l00016"></a>00016 draw_sizetyp size; <span class="comment">/* 1 word */</span> -<a name="l00017"></a>00017 draw_bboxtyp bbox; <span class="comment">/* 4 words */</span> -<a name="l00018"></a>00018 <span class="keywordtype">int</span> width; <span class="comment">/* 1 word */</span> -<a name="l00019"></a>00019 <span class="keywordtype">int</span> height; <span class="comment">/* 1 word */</span> -<a name="l00020"></a>00020 <span class="keywordtype">int</span> xdpi; <span class="comment">/* 1 word */</span> -<a name="l00021"></a>00021 <span class="keywordtype">int</span> ydpi; <span class="comment">/* 1 word */</span> -<a name="l00022"></a>00022 <span class="keywordtype">int</span> trfm[6]; <span class="comment">/* 6 words */</span> -<a name="l00023"></a>00023 <span class="keywordtype">int</span> len; <span class="comment">/* 1 word */</span> -<a name="l00024"></a>00024 } <a class="code" href="structdraw__jpegstrhdr__tag.html">draw_jpegstrhdr</a>; -<a name="l00025"></a>00025 -<a name="l00026"></a><a class="code" href="structdraw__jpegstr__tag.html">00026</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structdraw__jpegstr__tag.html">draw_jpegstr_tag</a> { -<a name="l00027"></a>00027 draw_tagtyp tag; <span class="comment">/* 1 word */</span> -<a name="l00028"></a>00028 draw_sizetyp size; <span class="comment">/* 1 word */</span> -<a name="l00029"></a>00029 draw_bboxtyp bbox; <span class="comment">/* 4 words */</span> -<a name="l00030"></a>00030 <span class="keywordtype">int</span> width; <span class="comment">/* 1 word */</span> -<a name="l00031"></a>00031 <span class="keywordtype">int</span> height; <span class="comment">/* 1 word */</span> -<a name="l00032"></a>00032 <span class="keywordtype">int</span> xdpi; <span class="comment">/* 1 word */</span> -<a name="l00033"></a>00033 <span class="keywordtype">int</span> ydpi; <span class="comment">/* 1 word */</span> -<a name="l00034"></a>00034 <span class="keywordtype">int</span> trfm[6]; <span class="comment">/* 6 words */</span> -<a name="l00035"></a>00035 <span class="keywordtype">int</span> len; <span class="comment">/* 1 word */</span> -<a name="l00036"></a>00036 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *jpeg; -<a name="l00037"></a>00037 } <a class="code" href="structdraw__jpegstr__tag.html">draw_jpegstr</a>; -<a name="l00038"></a>00038 -<a name="l00039"></a><a class="code" href="uniondraw__image_type__tag.html">00039</a> <span class="keyword">typedef</span> <span class="keyword">union </span><a class="code" href="uniondraw__image_type__tag.html">draw_imageType_tag</a> { -<a name="l00040"></a>00040 draw_spristr *sprite; -<a name="l00041"></a>00041 <a class="code" href="structdraw__jpegstr__tag.html">draw_jpegstr</a> *jpeg; -<a name="l00042"></a>00042 <span class="keywordtype">char</span> *bytep; -<a name="l00043"></a>00043 <span class="keywordtype">int</span> *wordp; -<a name="l00044"></a>00044 } <a class="code" href="uniondraw__image_type__tag.html">draw_imageType</a>; -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="preprocessor">#endif </span><span class="comment">/* !__draw_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/drawfile_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/drawfile.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/drawfile.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * drawfile.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to process with the Draw diagram</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "DeskLib:SWI.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="preprocessor">#define DRAWFILE_OBJECT_TOO_SMALL 200</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_NO_TEXT 201</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_BAD_CHARACTER 202</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_SMALL_MEMORY 203</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_PATH_WITHOUT_LINES 204</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_BAD_PATH_TYPE 205</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_PATH_WITHOUT_END 206</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_BAD_SPRITE_SIZE 207</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_BAD_JPEG_SIZE 208</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_TOO_SMALL 209</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_NOT_A_DRAWFILE 210</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_OBJECT_SIZE 211</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_MANY_FONTTABLES 212</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_TEXT_NO_FONT 213</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_OBJECT_UNEXPECTED 214</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define DRAWFILE_SIZE_ERROR 215</span> -<a name="l00031"></a>00031 <span class="preprocessor"></span> -<a name="l00032"></a>00032 <span class="keyword">typedef</span> <span class="keyword">struct </span>drawfile_error_tag { -<a name="l00033"></a>00033 <span class="keywordtype">int</span> iErrorNumber; -<a name="l00034"></a>00034 <span class="keyword">const</span> <span class="keywordtype">char</span> *szErrorText; -<a name="l00035"></a>00035 } drawfile_error_type; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keyword">const</span> drawfile_error_type atErrors[] = { -<a name="l00038"></a>00038 { DRAWFILE_OBJECT_TOO_SMALL, <span class="stringliteral">"Object too small"</span>}, -<a name="l00039"></a>00039 { DRAWFILE_NO_TEXT, <span class="stringliteral">"Text object without text"</span>}, -<a name="l00040"></a>00040 { DRAWFILE_BAD_CHARACTER, <span class="stringliteral">"Bad character in string"</span>}, -<a name="l00041"></a>00041 { DRAWFILE_SMALL_MEMORY, <span class="stringliteral">"Not enough memory reserved"</span>}, -<a name="l00042"></a>00042 { DRAWFILE_PATH_WITHOUT_LINES, <span class="stringliteral">"This path has no lines"</span>}, -<a name="l00043"></a>00043 { DRAWFILE_BAD_PATH_TYPE, <span class="stringliteral">"Bad path-type in path"</span>}, -<a name="l00044"></a>00044 { DRAWFILE_PATH_WITHOUT_END, <span class="stringliteral">"No end of path seen"</span>}, -<a name="l00045"></a>00045 { DRAWFILE_BAD_SPRITE_SIZE, <span class="stringliteral">"Bad sprite size"</span>}, -<a name="l00046"></a>00046 { DRAWFILE_BAD_JPEG_SIZE, <span class="stringliteral">"Bad jpeg size"</span>}, -<a name="l00047"></a>00047 { DRAWFILE_TOO_SMALL, <span class="stringliteral">"Too small to be a drawfile"</span>}, -<a name="l00048"></a>00048 { DRAWFILE_NOT_A_DRAWFILE, <span class="stringliteral">"Not a drawfile"</span>}, -<a name="l00049"></a>00049 { DRAWFILE_OBJECT_SIZE, <span class="stringliteral">"Object with incorrect size"</span>}, -<a name="l00050"></a>00050 { DRAWFILE_MANY_FONTTABLES, <span class="stringliteral">"More than one font table"</span>}, -<a name="l00051"></a>00051 { DRAWFILE_TEXT_NO_FONT, <span class="stringliteral">"Text, but no font table seen"</span>}, -<a name="l00052"></a>00052 { DRAWFILE_OBJECT_UNEXPECTED, <span class="stringliteral">"Unexpected object type"</span>}, -<a name="l00053"></a>00053 { DRAWFILE_SIZE_ERROR, <span class="stringliteral">"Sizes don't match"</span>}, -<a name="l00054"></a>00054 }; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 <span class="comment">/*</span> -<a name="l00058"></a>00058 <span class="comment"> * pFillError - error number to error struct</span> -<a name="l00059"></a>00059 <span class="comment"> */</span> -<a name="l00060"></a>00060 <span class="keyword">static</span> os_error * -<a name="l00061"></a>00061 pFillError(<span class="keywordtype">int</span> iErrorNumber) -<a name="l00062"></a>00062 { -<a name="l00063"></a>00063 <span class="keyword">static</span> os_error tError; -<a name="l00064"></a>00064 <span class="keyword">const</span> drawfile_error_type *pTmp; -<a name="l00065"></a>00065 <span class="keyword">const</span> <span class="keywordtype">char</span> *szErrorText; -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 szErrorText = <span class="stringliteral">"Unknown error"</span>; -<a name="l00068"></a>00068 <span class="keywordflow">for</span> (pTmp = atErrors; pTmp < atErrors + elementsof(atErrors); pTmp++) { -<a name="l00069"></a>00069 <span class="keywordflow">if</span> (iErrorNumber == pTmp->iErrorNumber) { -<a name="l00070"></a>00070 szErrorText = pTmp->szErrorText; -<a name="l00071"></a>00071 <span class="keywordflow">break</span>; -<a name="l00072"></a>00072 } -<a name="l00073"></a>00073 } -<a name="l00074"></a>00074 tError.errnum = iErrorNumber; -<a name="l00075"></a>00075 strncpy(tError.errmess, szErrorText, <span class="keyword">sizeof</span>(tError.errmess) - 1); -<a name="l00076"></a>00076 tError.errmess[<span class="keyword">sizeof</span>(tError.errmess) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00077"></a>00077 DBG_DEC(tError.errnum); -<a name="l00078"></a>00078 DBG_MSG(tError.errmess); -<a name="l00079"></a>00079 <span class="keywordflow">return</span> &tError; -<a name="l00080"></a>00080 } <span class="comment">/* end of pFillError */</span> -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="comment">/*</span> -<a name="l00083"></a>00083 <span class="comment"> * Drawfile_BBox - Find the bounding box of a diagram</span> -<a name="l00084"></a>00084 <span class="comment"> */</span> -<a name="l00085"></a>00085 os_error * -<a name="l00086"></a>00086 Drawfile_Bbox(drawfile_bbox_flags flags, -<a name="l00087"></a>00087 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> <span class="keyword">const</span> *diagram, -<a name="l00088"></a>00088 <span class="keywordtype">int</span> size, -<a name="l00089"></a>00089 <a class="code" href="structos__trfm.html">os_trfm</a> <span class="keyword">const</span> *trfm, -<a name="l00090"></a>00090 wimp_box *bbox) -<a name="l00091"></a>00091 { -<a name="l00092"></a>00092 <span class="keywordflow">return</span> SWI(5, 0, DrawFile_BBox | XOS_Bit, -<a name="l00093"></a>00093 flags, diagram, size, trfm, bbox); -<a name="l00094"></a>00094 } <span class="comment">/* end of Drawfile_Bbox */</span> -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="comment">/*</span> -<a name="l00097"></a>00097 <span class="comment"> * Drawfile_CreateDiagram - create an empty drawfile diagram</span> -<a name="l00098"></a>00098 <span class="comment"> */</span> -<a name="l00099"></a>00099 os_error * -<a name="l00100"></a>00100 Drawfile_CreateDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo, <span class="keywordtype">size_t</span> tMemorySize, -<a name="l00101"></a>00101 <span class="keyword">const</span> <span class="keywordtype">char</span> *szCreator, wimp_box tBbox) -<a name="l00102"></a>00102 { -<a name="l00103"></a>00103 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *pDiag; -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 <span class="keywordflow">if</span> (tMemorySize < offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects)) { -<a name="l00106"></a>00106 <span class="keywordflow">return</span> pFillError(DRAWFILE_SMALL_MEMORY); -<a name="l00107"></a>00107 } -<a name="l00108"></a>00108 pDiag = (<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *)pInfo->data; -<a name="l00109"></a>00109 strncpy(pDiag->tag, <span class="stringliteral">"Draw"</span>, 4); -<a name="l00110"></a>00110 pDiag->major_version = 201; -<a name="l00111"></a>00111 pDiag->minor_version = 0; -<a name="l00112"></a>00112 strncpy(pDiag->source, szCreator, <span class="keyword">sizeof</span>(pDiag->source)); -<a name="l00113"></a>00113 pDiag->bbox = tBbox; -<a name="l00114"></a>00114 <span class="comment">/* Memory in use */</span> -<a name="l00115"></a>00115 pInfo->length = offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects); -<a name="l00116"></a>00116 <span class="keywordflow">return</span> NULL; -<a name="l00117"></a>00117 } <span class="comment">/* end of Drawfile_CreateDiagram */</span> -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * Drawfile_AppendObject - append an object to a diagram</span> -<a name="l00121"></a>00121 <span class="comment"> */</span> -<a name="l00122"></a>00122 os_error * -<a name="l00123"></a>00123 Drawfile_AppendObject(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo, <span class="keywordtype">size_t</span> tMemorySize, -<a name="l00124"></a>00124 <span class="keyword">const</span> <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pObject, BOOL bRebind) -<a name="l00125"></a>00125 { -<a name="l00126"></a>00126 wimp_box *pMainBbox; -<a name="l00127"></a>00127 <span class="keyword">const</span> wimp_box *pBbox; -<a name="l00128"></a>00128 byte *pAfter; -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="keywordflow">if</span> (tMemorySize < pInfo->length + pObject->size) { -<a name="l00131"></a>00131 <span class="keywordflow">return</span> pFillError(DRAWFILE_OBJECT_TOO_SMALL); -<a name="l00132"></a>00132 } -<a name="l00133"></a>00133 <span class="comment">/* After the last object */</span> -<a name="l00134"></a>00134 pAfter = (byte *)pInfo->data + pInfo->length; -<a name="l00135"></a>00135 <span class="comment">/* Copy in the new data */</span> -<a name="l00136"></a>00136 memcpy(pAfter, pObject, pObject->size); -<a name="l00137"></a>00137 <span class="comment">/* Rebind if needed */</span> -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (bRebind) { -<a name="l00139"></a>00139 pMainBbox = &((<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *)pInfo->data)->bbox; -<a name="l00140"></a>00140 <span class="keywordflow">switch</span> (pObject->type) { -<a name="l00141"></a>00141 <span class="keywordflow">case</span> drawfile_TYPE_FONT_TABLE: -<a name="l00142"></a>00142 pBbox = NULL; -<a name="l00143"></a>00143 <span class="keywordflow">break</span>; -<a name="l00144"></a>00144 <span class="keywordflow">case</span> drawfile_TYPE_TEXT: -<a name="l00145"></a>00145 pBbox = &pObject->data.text.bbox; -<a name="l00146"></a>00146 <span class="keywordflow">break</span>; -<a name="l00147"></a>00147 <span class="keywordflow">case</span> drawfile_TYPE_PATH: -<a name="l00148"></a>00148 pBbox = &pObject->data.path.bbox; -<a name="l00149"></a>00149 <span class="keywordflow">break</span>; -<a name="l00150"></a>00150 <span class="keywordflow">case</span> drawfile_TYPE_SPRITE: -<a name="l00151"></a>00151 pBbox = &pObject->data.sprite.bbox; -<a name="l00152"></a>00152 <span class="keywordflow">break</span>; -<a name="l00153"></a>00153 <span class="keywordflow">case</span> drawfile_TYPE_GROUP: -<a name="l00154"></a>00154 pBbox = &pObject->data.group.bbox; -<a name="l00155"></a>00155 <span class="keywordflow">break</span>; -<a name="l00156"></a>00156 <span class="keywordflow">case</span> drawfile_TYPE_TAGGED: -<a name="l00157"></a>00157 pBbox = &pObject->data.tagged.bbox; -<a name="l00158"></a>00158 <span class="keywordflow">break</span>; -<a name="l00159"></a>00159 <span class="keywordflow">case</span> drawfile_TYPE_TEXT_AREA: -<a name="l00160"></a>00160 pBbox = &pObject->data.text_area.bbox; -<a name="l00161"></a>00161 <span class="keywordflow">break</span>; -<a name="l00162"></a>00162 <span class="keywordflow">case</span> drawfile_TYPE_TEXT_COLUMN: -<a name="l00163"></a>00163 pBbox = NULL; -<a name="l00164"></a>00164 <span class="keywordflow">break</span>; -<a name="l00165"></a>00165 <span class="keywordflow">case</span> drawfile_TYPE_OPTIONS: -<a name="l00166"></a>00166 pBbox = &pObject->data.options.bbox; -<a name="l00167"></a>00167 <span class="keywordflow">break</span>; -<a name="l00168"></a>00168 <span class="keywordflow">case</span> drawfile_TYPE_TRFM_TEXT: -<a name="l00169"></a>00169 pBbox = &pObject->data.trfm_text.bbox; -<a name="l00170"></a>00170 <span class="keywordflow">break</span>; -<a name="l00171"></a>00171 <span class="keywordflow">case</span> drawfile_TYPE_TRFM_SPRITE: -<a name="l00172"></a>00172 pBbox = &pObject->data.trfm_sprite.bbox; -<a name="l00173"></a>00173 <span class="keywordflow">break</span>; -<a name="l00174"></a>00174 <span class="keywordflow">case</span> drawfile_TYPE_JPEG: -<a name="l00175"></a>00175 pBbox = &pObject->data.jpeg.bbox; -<a name="l00176"></a>00176 <span class="keywordflow">break</span>; -<a name="l00177"></a>00177 <span class="keywordflow">default</span>: -<a name="l00178"></a>00178 pBbox = NULL; -<a name="l00179"></a>00179 <span class="keywordflow">break</span>; -<a name="l00180"></a>00180 } -<a name="l00181"></a>00181 <span class="keywordflow">if</span> (pBbox != NULL) { -<a name="l00182"></a>00182 <span class="keywordflow">if</span> (pBbox->min.x < pMainBbox->min.x) { -<a name="l00183"></a>00183 pMainBbox->min.x = pBbox->min.x; -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 <span class="keywordflow">if</span> (pBbox->min.y < pMainBbox->min.y) { -<a name="l00186"></a>00186 pMainBbox->min.y = pBbox->min.y; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 <span class="keywordflow">if</span> (pBbox->max.x > pMainBbox->max.x) { -<a name="l00189"></a>00189 pMainBbox->max.x = pBbox->max.x; -<a name="l00190"></a>00190 } -<a name="l00191"></a>00191 <span class="keywordflow">if</span> (pBbox->max.y > pMainBbox->max.y) { -<a name="l00192"></a>00192 pMainBbox->max.y = pBbox->max.y; -<a name="l00193"></a>00193 } -<a name="l00194"></a>00194 } -<a name="l00195"></a>00195 } -<a name="l00196"></a>00196 <span class="comment">/* Memory in use */</span> -<a name="l00197"></a>00197 pInfo->length += pObject->size; -<a name="l00198"></a>00198 <span class="keywordflow">return</span> NULL; -<a name="l00199"></a>00199 } <span class="comment">/* end of Drawfile_AppendObject */</span> -<a name="l00200"></a>00200 -<a name="l00201"></a>00201 <span class="comment">/*</span> -<a name="l00202"></a>00202 <span class="comment"> * Replaces the draw_render_diag function from RISC_OSLib</span> -<a name="l00203"></a>00203 <span class="comment"> */</span> -<a name="l00204"></a>00204 os_error * -<a name="l00205"></a>00205 Drawfile_RenderDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo, window_redrawblock *pRedraw, -<a name="l00206"></a>00206 <span class="keywordtype">double</span> dScale) -<a name="l00207"></a>00207 { -<a name="l00208"></a>00208 <span class="keywordtype">int</span> aiTransform[6]; -<a name="l00209"></a>00209 -<a name="l00210"></a>00210 fail(pInfo == NULL); -<a name="l00211"></a>00211 fail(pInfo->data == NULL); -<a name="l00212"></a>00212 fail(pRedraw == NULL); -<a name="l00213"></a>00213 fail(dScale < 0.01); -<a name="l00214"></a>00214 -<a name="l00215"></a>00215 aiTransform[0] = (int)(dScale * 0x10000); -<a name="l00216"></a>00216 aiTransform[1] = 0; -<a name="l00217"></a>00217 aiTransform[2] = 0; -<a name="l00218"></a>00218 aiTransform[3] = (int)(dScale * 0x10000); -<a name="l00219"></a>00219 aiTransform[4] = (pRedraw->rect.min.x - pRedraw->scroll.x) * 256; -<a name="l00220"></a>00220 aiTransform[5] = (pRedraw->rect.max.y - pRedraw->scroll.y) * 256; -<a name="l00221"></a>00221 -<a name="l00222"></a>00222 <span class="keywordflow">return</span> SWI(6, 0, DrawFile_Render | XOS_Bit, -<a name="l00223"></a>00223 0, pInfo->data, pInfo->length, aiTransform, &pRedraw->rect, 0); -<a name="l00224"></a>00224 } <span class="comment">/* end of Drawfile_RenderDiagram */</span> -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 <span class="comment">/*</span> -<a name="l00227"></a>00227 <span class="comment"> * pVerifyText - verify a text object</span> -<a name="l00228"></a>00228 <span class="comment"> */</span> -<a name="l00229"></a>00229 <span class="keyword">static</span> os_error * -<a name="l00230"></a>00230 pVerifyText(<span class="keyword">const</span> <a class="code" href="structdrawfile__text.html">drawfile_text</a> *pText) -<a name="l00231"></a>00231 { -<a name="l00232"></a>00232 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *pucTmp; -<a name="l00233"></a>00233 -<a name="l00234"></a>00234 <span class="keywordflow">if</span> (pText->text[0] == <span class="charliteral">'\0'</span>) { -<a name="l00235"></a>00235 <span class="keywordflow">return</span> pFillError(DRAWFILE_NO_TEXT); -<a name="l00236"></a>00236 } -<a name="l00237"></a>00237 pucTmp = (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)pText->text; -<a name="l00238"></a>00238 while (*pucTmp != <span class="charliteral">'\0'</span>) { -<a name="l00239"></a>00239 <span class="keywordflow">if</span> (*pucTmp < 0x20 || *pucTmp == 0x7f) { -<a name="l00240"></a>00240 <span class="keywordflow">return</span> pFillError(DRAWFILE_BAD_CHARACTER); -<a name="l00241"></a>00241 } -<a name="l00242"></a>00242 pucTmp++; -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 <span class="keywordflow">return</span> NULL; -<a name="l00245"></a>00245 } <span class="comment">/* end of pVerifyText */</span> -<a name="l00246"></a>00246 -<a name="l00247"></a>00247 <span class="comment">/*</span> -<a name="l00248"></a>00248 <span class="comment"> * pVerifyPath - verify a path object</span> -<a name="l00249"></a>00249 <span class="comment"> */</span> -<a name="l00250"></a>00250 <span class="keyword">static</span> os_error * -<a name="l00251"></a>00251 pVerifyPath(<span class="keyword">const</span> <a class="code" href="structdrawfile__path.html">drawfile_path</a> *pPath, <span class="keywordtype">int</span> iSize) -<a name="l00252"></a>00252 { -<a name="l00253"></a>00253 <span class="keyword">const</span> <span class="keywordtype">int</span> *piTmp; -<a name="l00254"></a>00254 <span class="keywordtype">int</span> iElements; -<a name="l00255"></a>00255 BOOL bLine; -<a name="l00256"></a>00256 -<a name="l00257"></a>00257 bLine = FALSE; -<a name="l00258"></a>00258 iElements = (iSize - offsetof(<a class="code" href="structdrawfile__path.html">drawfile_path</a>, path)) / 4; -<a name="l00259"></a>00259 -<a name="l00260"></a>00260 <span class="keywordflow">for</span> (piTmp = pPath->path; piTmp < pPath->path + iElements; piTmp++) { -<a name="l00261"></a>00261 <span class="keywordflow">switch</span>(*piTmp) { -<a name="l00262"></a>00262 <span class="keywordflow">case</span> drawfile_PATH_END_PATH: -<a name="l00263"></a>00263 <span class="keywordflow">if</span> (bLine) { -<a name="l00264"></a>00264 <span class="keywordflow">return</span> NULL; -<a name="l00265"></a>00265 } -<a name="l00266"></a>00266 <span class="keywordflow">return</span> pFillError(DRAWFILE_PATH_WITHOUT_LINES); -<a name="l00267"></a>00267 <span class="keywordflow">case</span> drawfile_PATH_LINE_TO: -<a name="l00268"></a>00268 bLine = TRUE; -<a name="l00269"></a>00269 piTmp += 2; -<a name="l00270"></a>00270 <span class="keywordflow">break</span>; -<a name="l00271"></a>00271 <span class="keywordflow">case</span> drawfile_PATH_MOVE_TO: -<a name="l00272"></a>00272 piTmp += 2; -<a name="l00273"></a>00273 <span class="keywordflow">break</span>; -<a name="l00274"></a>00274 <span class="keywordflow">case</span> drawfile_PATH_CLOSE_LINE: -<a name="l00275"></a>00275 bLine = TRUE; -<a name="l00276"></a>00276 <span class="keywordflow">break</span>; -<a name="l00277"></a>00277 <span class="keywordflow">default</span>: -<a name="l00278"></a>00278 <span class="keywordflow">return</span> pFillError(DRAWFILE_BAD_PATH_TYPE); -<a name="l00279"></a>00279 } -<a name="l00280"></a>00280 } -<a name="l00281"></a>00281 <span class="keywordflow">return</span> pFillError(DRAWFILE_PATH_WITHOUT_END); -<a name="l00282"></a>00282 } <span class="comment">/* end of pVerifyPath */</span> -<a name="l00283"></a>00283 -<a name="l00284"></a>00284 <span class="comment">/*</span> -<a name="l00285"></a>00285 <span class="comment"> * pVerifySprite - verify a sprite object</span> -<a name="l00286"></a>00286 <span class="comment"> */</span> -<a name="l00287"></a>00287 <span class="keyword">static</span> os_error * -<a name="l00288"></a>00288 pVerifySprite(<span class="keyword">const</span> <a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a> *pSprite, <span class="keywordtype">int</span> iSize) -<a name="l00289"></a>00289 { -<a name="l00290"></a>00290 iSize -= offsetof(<a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a>, header); -<a name="l00291"></a>00291 <span class="keywordflow">if</span> (iSize < pSprite->header.offset_next) { -<a name="l00292"></a>00292 DBG_DEC(iSize); -<a name="l00293"></a>00293 DBG_DEC(pSprite->header.offset_next); -<a name="l00294"></a>00294 <span class="keywordflow">return</span> pFillError(DRAWFILE_BAD_SPRITE_SIZE); -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 <span class="keywordflow">return</span> NULL; -<a name="l00297"></a>00297 } <span class="comment">/* end of pVerifySprite */</span> -<a name="l00298"></a>00298 -<a name="l00299"></a>00299 <span class="comment">/*</span> -<a name="l00300"></a>00300 <span class="comment"> * pVerifyJpeg - verify a jpeg object</span> -<a name="l00301"></a>00301 <span class="comment"> */</span> -<a name="l00302"></a>00302 <span class="keyword">static</span> os_error * -<a name="l00303"></a>00303 pVerifyJpeg(<span class="keyword">const</span> <a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a> *pJpeg, <span class="keywordtype">int</span> iSize) -<a name="l00304"></a>00304 { -<a name="l00305"></a>00305 iSize -= offsetof(<a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a>, data); -<a name="l00306"></a>00306 <span class="keywordflow">if</span> (iSize < pJpeg->len) { -<a name="l00307"></a>00307 DBG_DEC(iSize); -<a name="l00308"></a>00308 DBG_DEC(pJpeg->len); -<a name="l00309"></a>00309 <span class="keywordflow">return</span> pFillError(DRAWFILE_BAD_JPEG_SIZE); -<a name="l00310"></a>00310 } -<a name="l00311"></a>00311 <span class="keywordflow">return</span> NULL; -<a name="l00312"></a>00312 } <span class="comment">/* end of pVerifyJpeg */</span> -<a name="l00313"></a>00313 -<a name="l00314"></a>00314 <span class="comment">/*</span> -<a name="l00315"></a>00315 <span class="comment"> * Drawfile_VerifyDiagram - Verify the diagram generated from the Word file</span> -<a name="l00316"></a>00316 <span class="comment"> *</span> -<a name="l00317"></a>00317 <span class="comment"> * returns NULL if the diagram is correct</span> -<a name="l00318"></a>00318 <span class="comment"> */</span> -<a name="l00319"></a>00319 os_error * -<a name="l00320"></a>00320 Drawfile_VerifyDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo) -<a name="l00321"></a>00321 { -<a name="l00322"></a>00322 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *pDiag; -<a name="l00323"></a>00323 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pObj; -<a name="l00324"></a>00324 os_error *pError; -<a name="l00325"></a>00325 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00326"></a>00326 <span class="keywordtype">int</span> iToGo, iFontTables; -<a name="l00327"></a>00327 BOOL bTypeFontTable; -<a name="l00328"></a>00328 -<a name="l00329"></a>00329 TRACE_MSG(<span class="stringliteral">"Drawfile_VerifyDiagram"</span>); -<a name="l00330"></a>00330 -<a name="l00331"></a>00331 fail(pInfo == NULL); -<a name="l00332"></a>00332 -<a name="l00333"></a>00333 <span class="keywordflow">if</span> (pInfo->length < offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects)) { -<a name="l00334"></a>00334 <span class="keywordflow">return</span> pFillError(DRAWFILE_TOO_SMALL); -<a name="l00335"></a>00335 } -<a name="l00336"></a>00336 -<a name="l00337"></a>00337 pDiag = (<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *)pInfo->data; -<a name="l00338"></a>00338 if (strncmp(pDiag->tag, <span class="stringliteral">"Draw"</span>, 4) != 0 || -<a name="l00339"></a>00339 pDiag->major_version != 201 || -<a name="l00340"></a>00340 pDiag->minor_version != 0) { -<a name="l00341"></a>00341 <span class="keywordflow">return</span> pFillError(DRAWFILE_NOT_A_DRAWFILE); -<a name="l00342"></a>00342 } -<a name="l00343"></a>00343 -<a name="l00344"></a>00344 iToGo = pInfo->length - offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects); -<a name="l00345"></a>00345 pcTmp = (<span class="keyword">const</span> <span class="keywordtype">char</span> *)pInfo->data + offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects); -<a name="l00346"></a>00346 iFontTables = 0; -<a name="l00347"></a>00347 bTypeFontTable = FALSE; -<a name="l00348"></a>00348 -<a name="l00349"></a>00349 <span class="keywordflow">while</span> (iToGo > 0) { -<a name="l00350"></a>00350 pObj = (<a class="code" href="structdrawfile__object.html">drawfile_object</a> *)pcTmp; -<a name="l00351"></a>00351 <span class="keywordflow">if</span> (pObj->size < 0 || pObj->size % 4 != 0) { -<a name="l00352"></a>00352 <span class="keywordflow">return</span> pFillError(DRAWFILE_OBJECT_SIZE); -<a name="l00353"></a>00353 } -<a name="l00354"></a>00354 <span class="keywordflow">switch</span> (pObj->type) { -<a name="l00355"></a>00355 <span class="keywordflow">case</span> drawfile_TYPE_FONT_TABLE: -<a name="l00356"></a>00356 <span class="keywordflow">if</span> (bTypeFontTable) { -<a name="l00357"></a>00357 <span class="keywordflow">return</span> pFillError(DRAWFILE_MANY_FONTTABLES); -<a name="l00358"></a>00358 } -<a name="l00359"></a>00359 bTypeFontTable = TRUE; -<a name="l00360"></a>00360 <span class="keywordflow">break</span>; -<a name="l00361"></a>00361 <span class="keywordflow">case</span> drawfile_TYPE_TEXT: -<a name="l00362"></a>00362 <span class="keywordflow">if</span> (pObj->data.text.style.font_ref != 0 && -<a name="l00363"></a>00363 !bTypeFontTable) { -<a name="l00364"></a>00364 <span class="keywordflow">return</span> pFillError(DRAWFILE_TEXT_NO_FONT); -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 pError = pVerifyText(&pObj->data.text); -<a name="l00367"></a>00367 <span class="keywordflow">if</span> (pError != NULL) { -<a name="l00368"></a>00368 <span class="keywordflow">return</span> pError; -<a name="l00369"></a>00369 } -<a name="l00370"></a>00370 <span class="keywordflow">break</span>; -<a name="l00371"></a>00371 <span class="keywordflow">case</span> drawfile_TYPE_PATH: -<a name="l00372"></a>00372 pError = pVerifyPath(&pObj->data.path, -<a name="l00373"></a>00373 pObj->size - offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data)); -<a name="l00374"></a>00374 <span class="keywordflow">if</span> (pError != NULL) { -<a name="l00375"></a>00375 <span class="keywordflow">return</span> pError; -<a name="l00376"></a>00376 } -<a name="l00377"></a>00377 <span class="keywordflow">break</span>; -<a name="l00378"></a>00378 <span class="keywordflow">case</span> drawfile_TYPE_SPRITE: -<a name="l00379"></a>00379 pError = pVerifySprite(&pObj->data.sprite, -<a name="l00380"></a>00380 pObj->size - offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data)); -<a name="l00381"></a>00381 <span class="keywordflow">if</span> (pError != NULL) { -<a name="l00382"></a>00382 <span class="keywordflow">return</span> pError; -<a name="l00383"></a>00383 } -<a name="l00384"></a>00384 <span class="keywordflow">break</span>; -<a name="l00385"></a>00385 <span class="keywordflow">case</span> drawfile_TYPE_JPEG: -<a name="l00386"></a>00386 pError = pVerifyJpeg(&pObj->data.jpeg, -<a name="l00387"></a>00387 pObj->size - offsetof(<a class="code" href="structdrawfile__object.html">drawfile_object</a>, data)); -<a name="l00388"></a>00388 <span class="keywordflow">if</span> (pError != NULL) { -<a name="l00389"></a>00389 <span class="keywordflow">return</span> pError; -<a name="l00390"></a>00390 } -<a name="l00391"></a>00391 <span class="keywordflow">break</span>; -<a name="l00392"></a>00392 <span class="keywordflow">default</span>: -<a name="l00393"></a>00393 DBG_DEC(pObj->type); -<a name="l00394"></a>00394 <span class="keywordflow">return</span> pFillError(DRAWFILE_OBJECT_UNEXPECTED); -<a name="l00395"></a>00395 } -<a name="l00396"></a>00396 pcTmp += pObj->size; -<a name="l00397"></a>00397 iToGo -= pObj->size; -<a name="l00398"></a>00398 } -<a name="l00399"></a>00399 <span class="keywordflow">if</span> (iToGo < 0) { -<a name="l00400"></a>00400 <span class="keywordflow">return</span> pFillError(DRAWFILE_SIZE_ERROR); -<a name="l00401"></a>00401 } -<a name="l00402"></a>00402 <span class="keywordflow">return</span> NULL; -<a name="l00403"></a>00403 } <span class="comment">/* end of Drawfile_VerifyDiagram */</span> -<a name="l00404"></a>00404 -<a name="l00405"></a>00405 <span class="comment">/*</span> -<a name="l00406"></a>00406 <span class="comment"> * Drawfile_QueryBox - Find the bounding box of a diagram</span> -<a name="l00407"></a>00407 <span class="comment"> */</span> -<a name="l00408"></a>00408 <span class="keywordtype">void</span> -<a name="l00409"></a>00409 Drawfile_QueryBox(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *pInfo, wimp_box *pRect, BOOL bScreenUnits) -<a name="l00410"></a>00410 { -<a name="l00411"></a>00411 fail(pInfo == NULL); -<a name="l00412"></a>00412 fail(pRect == NULL); -<a name="l00413"></a>00413 -<a name="l00414"></a>00414 Error_CheckFatal(Drawfile_Bbox(0, -<a name="l00415"></a>00415 pInfo->data, pInfo->length, NULL, pRect)); -<a name="l00416"></a>00416 <span class="keywordflow">if</span> (bScreenUnits) { -<a name="l00417"></a>00417 pRect->min.x = Drawfile_DrawToScreen(pRect->min.x); -<a name="l00418"></a>00418 pRect->min.y = Drawfile_DrawToScreen(pRect->min.y); -<a name="l00419"></a>00419 pRect->max.x = Drawfile_DrawToScreen(pRect->max.x); -<a name="l00420"></a>00420 pRect->max.y = Drawfile_DrawToScreen(pRect->max.y); -<a name="l00421"></a>00421 } -<a name="l00422"></a>00422 } <span class="comment">/* end of Drawfile_QueryBox */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/drawfile_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,449 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/drawfile.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/drawfile.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * drawfile.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Include file to deal with drawfiles</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * Based on:</span> -<a name="l00009"></a>00009 <span class="comment"> * C header file for DrawFile</span> -<a name="l00010"></a>00010 <span class="comment"> * written by DefMod (May 4 2004) on Tue May 4 13:34:17 2004</span> -<a name="l00011"></a>00011 <span class="comment"> * Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995</span> -<a name="l00012"></a>00012 <span class="comment"> * OSLib---efficient, type-safe, transparent, extensible,</span> -<a name="l00013"></a>00013 <span class="comment"> * register-safe A P I coverage of RISC O S</span> -<a name="l00014"></a>00014 <span class="comment"> * Copyright (C) 1994 Jonathan Coxhead</span> -<a name="l00015"></a>00015 <span class="comment"> *</span> -<a name="l00016"></a>00016 <span class="comment"> * All credit should go to him, but all the bugs are mine</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 <span class="preprocessor">#if !defined(__drawfile_h)</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __drawfile_h</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span> -<a name="l00022"></a>00022 <span class="preprocessor">#include "DeskLib:Sprite.h"</span> -<a name="l00023"></a>00023 <span class="preprocessor">#include "DeskLib:Wimp.h"</span> -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="preprocessor">#if !defined(BOOL)</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define BOOL int</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define TRUE 1</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define FALSE 0</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !BOOL */</span> -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 <span class="comment">/*********************</span> -<a name="l00032"></a>00032 <span class="comment"> * Conversion macros *</span> -<a name="l00033"></a>00033 <span class="comment"> *********************/</span> -<a name="l00034"></a>00034 <span class="preprocessor">#define Drawfile_DrawToScreen(i) ((i) / 256)</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define Drawfile_ScreenToDraw(i) ((i) * 256)</span> -<a name="l00036"></a>00036 <span class="preprocessor"></span> -<a name="l00037"></a>00037 <span class="comment">/**********************************</span> -<a name="l00038"></a>00038 <span class="comment"> * SWI names and SWI reason codes *</span> -<a name="l00039"></a>00039 <span class="comment"> **********************************/</span> -<a name="l00040"></a>00040 <span class="preprocessor">#define DrawFile_Render 0x45540</span> -<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define DrawFile_BBox 0x45541</span> -<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define DrawFile_DeclareFonts 0x45542</span> -<a name="l00043"></a>00043 <span class="preprocessor"></span> -<a name="l00044"></a>00044 <span class="comment">/********************</span> -<a name="l00045"></a>00045 <span class="comment"> * Type definitions *</span> -<a name="l00046"></a>00046 <span class="comment"> ********************/</span> -<a name="l00047"></a>00047 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bits; -<a name="l00048"></a>00048 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> byte; -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 <span class="keyword">typedef</span> byte drawfile_fontref; -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="keyword">typedef</span> byte drawfile_path_style_flags; -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 <span class="keyword">typedef</span> bits drawfile_text_flags; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 <span class="keyword">typedef</span> bits drawfile_render_flags; -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="keyword">typedef</span> bits drawfile_declare_fonts_flags; -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 <span class="keyword">typedef</span> bits drawfile_paper_options; -<a name="l00061"></a>00061 -<a name="l00062"></a>00062 <span class="keyword">typedef</span> bits drawfile_entry_mode; -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 <span class="keyword">typedef</span> <span class="keyword">enum</span> { -<a name="l00065"></a>00065 drawfile_TYPE_FONT_TABLE = 0, -<a name="l00066"></a>00066 drawfile_TYPE_TEXT = 1, -<a name="l00067"></a>00067 drawfile_TYPE_PATH = 2, -<a name="l00068"></a>00068 drawfile_TYPE_SPRITE = 5, -<a name="l00069"></a>00069 drawfile_TYPE_GROUP = 6, -<a name="l00070"></a>00070 drawfile_TYPE_TAGGED = 7, -<a name="l00071"></a>00071 drawfile_TYPE_TEXT_AREA = 9, -<a name="l00072"></a>00072 drawfile_TYPE_TEXT_COLUMN = 10, -<a name="l00073"></a>00073 drawfile_TYPE_OPTIONS = 11, -<a name="l00074"></a>00074 drawfile_TYPE_TRFM_TEXT = 12, -<a name="l00075"></a>00075 drawfile_TYPE_TRFM_SPRITE = 13, -<a name="l00076"></a>00076 drawfile_TYPE_JPEG = 16 -<a name="l00077"></a>00077 } drawfile_type; -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 <span class="keyword">typedef</span> <span class="keyword">enum</span> { -<a name="l00080"></a>00080 drawfile_PATH_END_PATH = 0, -<a name="l00081"></a>00081 drawfile_PATH_CONTINUATION = 1, -<a name="l00082"></a>00082 drawfile_PATH_MOVE_TO = 2, -<a name="l00083"></a>00083 drawfile_PATH_SPECIAL_MOVE_TO = 3, -<a name="l00084"></a>00084 drawfile_PATH_CLOSE_GAP = 4, -<a name="l00085"></a>00085 drawfile_PATH_CLOSE_LINE = 5, -<a name="l00086"></a>00086 drawfile_PATH_BEZIER_TO = 6, -<a name="l00087"></a>00087 drawfile_PATH_GAP_TO = 7, -<a name="l00088"></a>00088 drawfile_PATH_LINE_TO = 8 -<a name="l00089"></a>00089 } drawfile_path_type; -<a name="l00090"></a>00090 -<a name="l00091"></a><a class="code" href="structdraw__dash__pattern.html">00091</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00092"></a>00092 <span class="keywordtype">int</span> start; -<a name="l00093"></a>00093 <span class="keywordtype">int</span> element_count; -<a name="l00094"></a>00094 <span class="keywordtype">int</span> elements [6]; -<a name="l00095"></a>00095 } <a class="code" href="structdraw__dash__pattern.html">draw_dash_pattern</a>; -<a name="l00096"></a>00096 -<a name="l00097"></a><a class="code" href="structos__trfm.html">00097</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00098"></a>00098 <span class="keywordtype">int</span> entries [3] [2]; -<a name="l00099"></a>00099 } <a class="code" href="structos__trfm.html">os_trfm</a>; -<a name="l00100"></a>00100 -<a name="l00101"></a><a class="code" href="structdrawfile__info.html">00101</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00102"></a>00102 <span class="keywordtype">void</span> *data; -<a name="l00103"></a>00103 <span class="keywordtype">size_t</span> length; -<a name="l00104"></a>00104 } <a class="code" href="structdrawfile__info.html">drawfile_info</a>; -<a name="l00105"></a>00105 -<a name="l00106"></a><a class="code" href="structdrawfile__font__def.html">00106</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00107"></a>00107 drawfile_fontref font_ref; -<a name="l00108"></a>00108 <span class="keywordtype">char</span> font_name [1]; -<a name="l00109"></a>00109 } <a class="code" href="structdrawfile__font__def.html">drawfile_font_def</a>; -<a name="l00110"></a>00110 -<a name="l00111"></a><a class="code" href="structdrawfile__text__style.html">00111</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00112"></a>00112 drawfile_fontref font_ref; -<a name="l00113"></a>00113 byte reserved [3]; -<a name="l00114"></a>00114 } <a class="code" href="structdrawfile__text__style.html">drawfile_text_style</a>; -<a name="l00115"></a>00115 -<a name="l00116"></a><a class="code" href="structdrawfile__path__style.html">00116</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00117"></a>00117 drawfile_path_style_flags flags; -<a name="l00118"></a>00118 byte reserved; -<a name="l00119"></a>00119 byte cap_width; -<a name="l00120"></a>00120 byte cap_length; -<a name="l00121"></a>00121 } <a class="code" href="structdrawfile__path__style.html">drawfile_path_style</a>; -<a name="l00122"></a>00122 -<a name="l00123"></a><a class="code" href="structdrawfile__font__table.html">00123</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00124"></a>00124 <a class="code" href="structdrawfile__font__def.html">drawfile_font_def</a> font_def[1]; -<a name="l00125"></a>00125 } <a class="code" href="structdrawfile__font__table.html">drawfile_font_table</a>; -<a name="l00126"></a>00126 -<a name="l00127"></a><a class="code" href="structdrawfile__text.html">00127</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00128"></a>00128 wimp_box bbox; -<a name="l00129"></a>00129 palette_entry fill; -<a name="l00130"></a>00130 palette_entry bg_hint; -<a name="l00131"></a>00131 <a class="code" href="structdrawfile__text__style.html">drawfile_text_style</a> style; -<a name="l00132"></a>00132 <span class="keywordtype">int</span> xsize; -<a name="l00133"></a>00133 <span class="keywordtype">int</span> ysize; -<a name="l00134"></a>00134 wimp_coord base; -<a name="l00135"></a>00135 <span class="keywordtype">char</span> text [1]; -<a name="l00136"></a>00136 } <a class="code" href="structdrawfile__text.html">drawfile_text</a>; -<a name="l00137"></a>00137 -<a name="l00138"></a><a class="code" href="structdrawfile__path.html">00138</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00139"></a>00139 wimp_box bbox; -<a name="l00140"></a>00140 palette_entry fill; -<a name="l00141"></a>00141 palette_entry outline; -<a name="l00142"></a>00142 <span class="keywordtype">int</span> width; -<a name="l00143"></a>00143 <a class="code" href="structdrawfile__path__style.html">drawfile_path_style</a> style; -<a name="l00144"></a>00144 <span class="keywordtype">int</span> path [1]; -<a name="l00145"></a>00145 } <a class="code" href="structdrawfile__path.html">drawfile_path</a>; -<a name="l00146"></a>00146 -<a name="l00147"></a><a class="code" href="structdrawfile__path__with__pattern.html">00147</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00148"></a>00148 wimp_box bbox; -<a name="l00149"></a>00149 palette_entry fill; -<a name="l00150"></a>00150 palette_entry outline; -<a name="l00151"></a>00151 <span class="keywordtype">int</span> width; -<a name="l00152"></a>00152 <a class="code" href="structdrawfile__path__style.html">drawfile_path_style</a> style; -<a name="l00153"></a>00153 <a class="code" href="structdraw__dash__pattern.html">draw_dash_pattern</a> pattern; -<a name="l00154"></a>00154 <span class="keywordtype">int</span> path [1]; -<a name="l00155"></a>00155 } <a class="code" href="structdrawfile__path__with__pattern.html">drawfile_path_with_pattern</a>; -<a name="l00156"></a>00156 -<a name="l00157"></a><a class="code" href="structdrawfile__sprite.html">00157</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00158"></a>00158 wimp_box bbox; -<a name="l00159"></a>00159 sprite_header header; -<a name="l00160"></a>00160 byte data [1]; -<a name="l00161"></a>00161 } <a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a>; -<a name="l00162"></a>00162 -<a name="l00163"></a><a class="code" href="structdrawfile__group.html">00163</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00164"></a>00164 wimp_box bbox; -<a name="l00165"></a>00165 <span class="keywordtype">char</span> name [12]; -<a name="l00166"></a>00166 <span class="keywordtype">int</span> objects [1]; -<a name="l00167"></a>00167 } <a class="code" href="structdrawfile__group.html">drawfile_group</a>; -<a name="l00168"></a>00168 -<a name="l00169"></a><a class="code" href="structdrawfile__tagged.html">00169</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00170"></a>00170 wimp_box bbox; -<a name="l00171"></a>00171 drawfile_type tag; -<a name="l00172"></a>00172 <span class="keywordtype">int</span> <span class="keywordtype">object</span> [1]; -<a name="l00173"></a>00173 } <a class="code" href="structdrawfile__tagged.html">drawfile_tagged</a>; -<a name="l00174"></a>00174 -<a name="l00175"></a><a class="code" href="structdrawfile__text__column.html">00175</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00176"></a>00176 wimp_box box; -<a name="l00177"></a>00177 } <a class="code" href="structdrawfile__text__column.html">drawfile_text_column</a>; -<a name="l00178"></a>00178 -<a name="l00179"></a><a class="code" href="structdrawfile__text__column__list.html">00179</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00180"></a>00180 <span class="keyword">struct </span>{ -<a name="l00181"></a>00181 drawfile_type type; -<a name="l00182"></a>00182 <span class="keywordtype">int</span> size; -<a name="l00183"></a>00183 <a class="code" href="structdrawfile__text__column.html">drawfile_text_column</a> data; -<a name="l00184"></a>00184 } columns [1]; -<a name="l00185"></a>00185 } <a class="code" href="structdrawfile__text__column__list.html">drawfile_text_column_list</a>; -<a name="l00186"></a>00186 -<a name="l00187"></a><a class="code" href="structdrawfile__area__text.html">00187</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00188"></a>00188 drawfile_type type; -<a name="l00189"></a>00189 <span class="keywordtype">int</span> reserved [2]; -<a name="l00190"></a>00190 palette_entry fill; -<a name="l00191"></a>00191 palette_entry bg_hint; -<a name="l00192"></a>00192 <span class="keywordtype">char</span> text [1]; -<a name="l00193"></a>00193 } <a class="code" href="structdrawfile__area__text.html">drawfile_area_text</a>; -<a name="l00194"></a>00194 -<a name="l00195"></a><a class="code" href="structdrawfile__text__area.html">00195</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00196"></a>00196 wimp_box bbox; -<a name="l00197"></a>00197 <a class="code" href="structdrawfile__text__column__list.html">drawfile_text_column_list</a> header; -<a name="l00198"></a>00198 <a class="code" href="structdrawfile__area__text.html">drawfile_area_text</a> area_text; -<a name="l00199"></a>00199 } <a class="code" href="structdrawfile__text__area.html">drawfile_text_area</a>; -<a name="l00200"></a>00200 -<a name="l00201"></a><a class="code" href="structdrawfile__options.html">00201</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00202"></a>00202 wimp_box bbox; -<a name="l00203"></a>00203 <span class="keywordtype">int</span> paper_size; -<a name="l00204"></a>00204 drawfile_paper_options paper_options; -<a name="l00205"></a>00205 <span class="keywordtype">double</span> grid_spacing; -<a name="l00206"></a>00206 <span class="keywordtype">int</span> grid_division; -<a name="l00207"></a>00207 BOOL isometric; -<a name="l00208"></a>00208 BOOL auto_adjust; -<a name="l00209"></a>00209 BOOL show; -<a name="l00210"></a>00210 BOOL lock; -<a name="l00211"></a>00211 BOOL cm; -<a name="l00212"></a>00212 <span class="keywordtype">int</span> zoom_mul; -<a name="l00213"></a>00213 <span class="keywordtype">int</span> zoom_div; -<a name="l00214"></a>00214 BOOL zoom_lock; -<a name="l00215"></a>00215 BOOL toolbox; -<a name="l00216"></a>00216 drawfile_entry_mode entry_mode; -<a name="l00217"></a>00217 <span class="keywordtype">int</span> undo_size; -<a name="l00218"></a>00218 } <a class="code" href="structdrawfile__options.html">drawfile_options</a>; -<a name="l00219"></a>00219 -<a name="l00220"></a><a class="code" href="structdrawfile__trfm__text.html">00220</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00221"></a>00221 wimp_box bbox; -<a name="l00222"></a>00222 <a class="code" href="structos__trfm.html">os_trfm</a> trfm; -<a name="l00223"></a>00223 drawfile_text_flags flags; -<a name="l00224"></a>00224 palette_entry fill; -<a name="l00225"></a>00225 palette_entry bg_hint; -<a name="l00226"></a>00226 <a class="code" href="structdrawfile__text__style.html">drawfile_text_style</a> style; -<a name="l00227"></a>00227 <span class="keywordtype">int</span> xsize; -<a name="l00228"></a>00228 <span class="keywordtype">int</span> ysize; -<a name="l00229"></a>00229 wimp_coord base; -<a name="l00230"></a>00230 <span class="keywordtype">char</span> text [1]; -<a name="l00231"></a>00231 } <a class="code" href="structdrawfile__trfm__text.html">drawfile_trfm_text</a>; -<a name="l00232"></a>00232 -<a name="l00233"></a><a class="code" href="structdrawfile__trfm__sprite.html">00233</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00234"></a>00234 wimp_box bbox; -<a name="l00235"></a>00235 <a class="code" href="structos__trfm.html">os_trfm</a> trfm; -<a name="l00236"></a>00236 sprite_header header; -<a name="l00237"></a>00237 byte data [1]; -<a name="l00238"></a>00238 } <a class="code" href="structdrawfile__trfm__sprite.html">drawfile_trfm_sprite</a>; -<a name="l00239"></a>00239 -<a name="l00240"></a><a class="code" href="structdrawfile__jpeg.html">00240</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00241"></a>00241 wimp_box bbox; -<a name="l00242"></a>00242 <span class="keywordtype">int</span> width; -<a name="l00243"></a>00243 <span class="keywordtype">int</span> height; -<a name="l00244"></a>00244 <span class="keywordtype">int</span> xdpi; -<a name="l00245"></a>00245 <span class="keywordtype">int</span> ydpi; -<a name="l00246"></a>00246 <a class="code" href="structos__trfm.html">os_trfm</a> trfm; -<a name="l00247"></a>00247 <span class="keywordtype">int</span> len; -<a name="l00248"></a>00248 byte data [1]; -<a name="l00249"></a>00249 } <a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a>; -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 <span class="comment">/* ------------------------------------------------------------------------</span> -<a name="l00252"></a>00252 <span class="comment"> * Type: drawfile_object</span> -<a name="l00253"></a>00253 <span class="comment"> *</span> -<a name="l00254"></a>00254 <span class="comment"> * Description: This type is used to declare pointers rather than objects</span> -<a name="l00255"></a>00255 <span class="comment"> */</span> -<a name="l00256"></a>00256 -<a name="l00257"></a><a class="code" href="structdrawfile__object.html">00257</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00258"></a>00258 drawfile_type type; -<a name="l00259"></a>00259 <span class="keywordtype">int</span> size; -<a name="l00260"></a>00260 <span class="keyword">union </span>{ -<a name="l00261"></a>00261 <a class="code" href="structdrawfile__font__table.html">drawfile_font_table</a> font_table; -<a name="l00262"></a>00262 <a class="code" href="structdrawfile__text.html">drawfile_text</a> text; -<a name="l00263"></a>00263 <a class="code" href="structdrawfile__path.html">drawfile_path</a> path; -<a name="l00264"></a>00264 <a class="code" href="structdrawfile__path__with__pattern.html">drawfile_path_with_pattern</a> path_with_pattern; -<a name="l00265"></a>00265 <a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a> sprite; -<a name="l00266"></a>00266 <a class="code" href="structdrawfile__group.html">drawfile_group</a> group; -<a name="l00267"></a>00267 <a class="code" href="structdrawfile__tagged.html">drawfile_tagged</a> tagged; -<a name="l00268"></a>00268 <a class="code" href="structdrawfile__text__column.html">drawfile_text_column</a> text_column; -<a name="l00269"></a>00269 <a class="code" href="structdrawfile__text__area.html">drawfile_text_area</a> text_area; -<a name="l00270"></a>00270 <a class="code" href="structdrawfile__options.html">drawfile_options</a> options; -<a name="l00271"></a>00271 <a class="code" href="structdrawfile__trfm__text.html">drawfile_trfm_text</a> trfm_text; -<a name="l00272"></a>00272 <a class="code" href="structdrawfile__trfm__sprite.html">drawfile_trfm_sprite</a> trfm_sprite; -<a name="l00273"></a>00273 <a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a> jpeg; -<a name="l00274"></a>00274 } data; -<a name="l00275"></a>00275 } <a class="code" href="structdrawfile__object.html">drawfile_object</a>; -<a name="l00276"></a>00276 -<a name="l00277"></a><a class="code" href="structdrawfile__diagram.html">00277</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00278"></a>00278 <span class="keywordtype">char</span> tag [4]; -<a name="l00279"></a>00279 <span class="keywordtype">int</span> major_version; -<a name="l00280"></a>00280 <span class="keywordtype">int</span> minor_version; -<a name="l00281"></a>00281 <span class="keywordtype">char</span> source [12]; -<a name="l00282"></a>00282 wimp_box bbox; -<a name="l00283"></a>00283 <a class="code" href="structdrawfile__object.html">drawfile_object</a> objects [1]; -<a name="l00284"></a>00284 } <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>; -<a name="l00285"></a>00285 -<a name="l00286"></a>00286 <span class="keyword">typedef</span> bits drawfile_bbox_flags; -<a name="l00287"></a>00287 -<a name="l00288"></a><a class="code" href="structdrawfile__declare__fonts__state.html">00288</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ -<a name="l00289"></a>00289 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *object; -<a name="l00290"></a>00290 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> *diagram; -<a name="l00291"></a>00291 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *font_table; -<a name="l00292"></a>00292 drawfile_declare_fonts_flags flags; -<a name="l00293"></a>00293 os_error *error; -<a name="l00294"></a>00294 } <a class="code" href="structdrawfile__declare__fonts__state.html">drawfile_declare_fonts_state</a>; -<a name="l00295"></a>00295 -<a name="l00296"></a>00296 <span class="comment">/************************</span> -<a name="l00297"></a>00297 <span class="comment"> * Constant definitions *</span> -<a name="l00298"></a>00298 <span class="comment"> ************************/</span> -<a name="l00299"></a>00299 <span class="preprocessor">#define error_DRAW_FILE_NOT_DRAW 0x20C00u</span> -<a name="l00300"></a>00300 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_VERSION 0x20C01u</span> -<a name="l00301"></a>00301 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_FONT_TAB 0x20C02u</span> -<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_BAD_FONT_NO 0x20C03u</span> -<a name="l00303"></a>00303 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_BAD_MODE 0x20C04u</span> -<a name="l00304"></a>00304 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_BAD_FILE 0x20C05u</span> -<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_BAD_GROUP 0x20C06u</span> -<a name="l00306"></a>00306 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_BAD_TAG 0x20C07u</span> -<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_SYNTAX 0x20C08u</span> -<a name="l00308"></a>00308 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_FONT_NO 0x20C09u</span> -<a name="l00309"></a>00309 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_AREA_VER 0x20C0Au</span> -<a name="l00310"></a>00310 <span class="preprocessor"></span><span class="preprocessor">#define error_DRAW_FILE_NO_AREA_VER 0x20C0Bu</span> -<a name="l00311"></a>00311 <span class="preprocessor"></span> -<a name="l00312"></a>00312 <span class="preprocessor">#define drawfile_PATH_MITRED ((drawfile_path_style_flags) 0x0u)</span> -<a name="l00313"></a>00313 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_ROUND ((drawfile_path_style_flags) 0x1u)</span> -<a name="l00314"></a>00314 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_BEVELLED ((drawfile_path_style_flags) 0x2u)</span> -<a name="l00315"></a>00315 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_BUTT ((drawfile_path_style_flags) 0x0u)</span> -<a name="l00316"></a>00316 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_SQUARE ((drawfile_path_style_flags) 0x2u)</span> -<a name="l00317"></a>00317 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_TRIANGLE ((drawfile_path_style_flags) 0x3u)</span> -<a name="l00318"></a>00318 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_JOIN_SHIFT 0</span> -<a name="l00319"></a>00319 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_JOIN ((drawfile_path_style_flags) 0x3u)</span> -<a name="l00320"></a>00320 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_END_SHIFT 2</span> -<a name="l00321"></a>00321 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_END ((drawfile_path_style_flags) 0xCu)</span> -<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_START_SHIFT 4</span> -<a name="l00323"></a>00323 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_START ((drawfile_path_style_flags) 0x30u)</span> -<a name="l00324"></a>00324 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_WINDING_EVEN_ODD ((drawfile_path_style_flags) 0x40u)</span> -<a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_DASHED ((drawfile_path_style_flags) 0x80u)</span> -<a name="l00326"></a>00326 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_CAP_WIDTH_SHIFT 16</span> -<a name="l00327"></a>00327 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_CAP_WIDTH ((drawfile_path_style_flags) 0xFF0000u)</span> -<a name="l00328"></a>00328 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_CAP_LENGTH_SHIFT 24</span> -<a name="l00329"></a>00329 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PATH_CAP_LENGTH ((drawfile_path_style_flags) 0xFF000000u)</span> -<a name="l00330"></a>00330 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_TEXT_KERN ((drawfile_text_flags) 0x1u)</span> -<a name="l00331"></a>00331 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_TEXT_RIGHT_TO_LEFT ((drawfile_text_flags) 0x2u)</span> -<a name="l00332"></a>00332 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_TEXT_UNDERLINE ((drawfile_text_flags) 0x4u)</span> -<a name="l00333"></a>00333 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_RENDER_BBOXES ((drawfile_render_flags) 0x1u)</span> -<a name="l00334"></a>00334 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_RENDER_SUPPRESS ((drawfile_render_flags) 0x2u)</span> -<a name="l00335"></a>00335 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_RENDER_GIVEN_FLATNESS ((drawfile_render_flags) 0x4u)</span> -<a name="l00336"></a>00336 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_RENDER_GIVEN_COLOUR_MAPPING ((drawfile_render_flags) 0x8u)</span> -<a name="l00337"></a>00337 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_NO_DOWNLOAD ((drawfile_declare_fonts_flags) 0x1u)</span> -<a name="l00338"></a>00338 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PAPER_SHOW ((drawfile_paper_options) 0x1u)</span> -<a name="l00339"></a>00339 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PAPER_LANDSCAPE ((drawfile_paper_options) 0x10u)</span> -<a name="l00340"></a>00340 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_PAPER_DEFAULT ((drawfile_paper_options) 0x100u)</span> -<a name="l00341"></a>00341 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_LINE ((drawfile_entry_mode) 0x1u)</span> -<a name="l00342"></a>00342 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_CLOSED_LINE ((drawfile_entry_mode) 0x2u)</span> -<a name="l00343"></a>00343 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_CURVE ((drawfile_entry_mode) 0x4u)</span> -<a name="l00344"></a>00344 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_CLOSED_CURVE ((drawfile_entry_mode) 0x8u)</span> -<a name="l00345"></a>00345 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_RECTANGLE ((drawfile_entry_mode) 0x10u)</span> -<a name="l00346"></a>00346 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_ELLIPSE ((drawfile_entry_mode) 0x20u)</span> -<a name="l00347"></a>00347 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_TEXT_LINE ((drawfile_entry_mode) 0x40u)</span> -<a name="l00348"></a>00348 <span class="preprocessor"></span><span class="preprocessor">#define drawfile_ENTRY_MODE_SELECT ((drawfile_entry_mode) 0x80u)</span> -<a name="l00349"></a>00349 <span class="preprocessor"></span> -<a name="l00350"></a>00350 <span class="comment">/*************************</span> -<a name="l00351"></a>00351 <span class="comment"> * Function declarations *</span> -<a name="l00352"></a>00352 <span class="comment"> *************************/</span> -<a name="l00353"></a>00353 -<a name="l00354"></a>00354 <span class="preprocessor">#if defined(__cplusplus)</span> -<a name="l00355"></a>00355 <span class="preprocessor"></span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> { -<a name="l00356"></a>00356 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> -<a name="l00357"></a>00357 -<a name="l00358"></a>00358 <span class="comment">/* ------------------------------------------------------------------------</span> -<a name="l00359"></a>00359 <span class="comment"> * Function: drawfile_render()</span> -<a name="l00360"></a>00360 <span class="comment"> *</span> -<a name="l00361"></a>00361 <span class="comment"> * Description: Calls SWI 0x45540</span> -<a name="l00362"></a>00362 <span class="comment"> *</span> -<a name="l00363"></a>00363 <span class="comment"> * Input: flags - value of R0 on entry</span> -<a name="l00364"></a>00364 <span class="comment"> * diagram - value of R1 on entry</span> -<a name="l00365"></a>00365 <span class="comment"> * size - value of R2 on entry</span> -<a name="l00366"></a>00366 <span class="comment"> * trfm - value of R3 on entry</span> -<a name="l00367"></a>00367 <span class="comment"> * clip - value of R4 on entry</span> -<a name="l00368"></a>00368 <span class="comment"> * flatness - value of R5 on entry</span> -<a name="l00369"></a>00369 <span class="comment"> */</span> -<a name="l00370"></a>00370 -<a name="l00371"></a>00371 <span class="keyword">extern</span> os_error *Drawfile_Render (drawfile_render_flags flags, -<a name="l00372"></a>00372 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> <span class="keyword">const</span> *diagram, -<a name="l00373"></a>00373 <span class="keywordtype">int</span> size, -<a name="l00374"></a>00374 <a class="code" href="structos__trfm.html">os_trfm</a> <span class="keyword">const</span> *trfm, -<a name="l00375"></a>00375 wimp_box <span class="keyword">const</span> *clip, -<a name="l00376"></a>00376 <span class="keywordtype">int</span> flatness); -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 <span class="comment">/* ------------------------------------------------------------------------</span> -<a name="l00379"></a>00379 <span class="comment"> * Function: drawfile_bbox()</span> -<a name="l00380"></a>00380 <span class="comment"> *</span> -<a name="l00381"></a>00381 <span class="comment"> * Description: Calls SWI 0x45541</span> -<a name="l00382"></a>00382 <span class="comment"> *</span> -<a name="l00383"></a>00383 <span class="comment"> * Input: flags - value of R0 on entry</span> -<a name="l00384"></a>00384 <span class="comment"> * diagram - value of R1 on entry</span> -<a name="l00385"></a>00385 <span class="comment"> * size - value of R2 on entry</span> -<a name="l00386"></a>00386 <span class="comment"> * trfm - value of R3 on entry</span> -<a name="l00387"></a>00387 <span class="comment"> * bbox - value of R4 on entry</span> -<a name="l00388"></a>00388 <span class="comment"> */</span> -<a name="l00389"></a>00389 -<a name="l00390"></a>00390 <span class="keyword">extern</span> os_error *Drawfile_Bbox (drawfile_bbox_flags flags, -<a name="l00391"></a>00391 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> <span class="keyword">const</span> *diagram, -<a name="l00392"></a>00392 <span class="keywordtype">int</span> size, -<a name="l00393"></a>00393 <a class="code" href="structos__trfm.html">os_trfm</a> <span class="keyword">const</span> *trfm, -<a name="l00394"></a>00394 wimp_box *bbox); -<a name="l00395"></a>00395 -<a name="l00396"></a>00396 <span class="comment">/* ------------------------------------------------------------------------</span> -<a name="l00397"></a>00397 <span class="comment"> * Function: Drawfile_DeclareFonts()</span> -<a name="l00398"></a>00398 <span class="comment"> *</span> -<a name="l00399"></a>00399 <span class="comment"> * Description: Calls SWI 0x45542</span> -<a name="l00400"></a>00400 <span class="comment"> *</span> -<a name="l00401"></a>00401 <span class="comment"> * Input: flags - value of R0 on entry</span> -<a name="l00402"></a>00402 <span class="comment"> * diagram - value of R1 on entry</span> -<a name="l00403"></a>00403 <span class="comment"> * size - value of R2 on entry</span> -<a name="l00404"></a>00404 <span class="comment"> */</span> -<a name="l00405"></a>00405 -<a name="l00406"></a>00406 <span class="keyword">extern</span> os_error *Drawfile_DeclareFonts (drawfile_declare_fonts_flags flags, -<a name="l00407"></a>00407 <a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a> <span class="keyword">const</span> *diagram, -<a name="l00408"></a>00408 <span class="keywordtype">int</span> size); -<a name="l00409"></a>00409 -<a name="l00410"></a>00410 <span class="comment">/* ------------------------------------------------------------------------</span> -<a name="l00411"></a>00411 <span class="comment"> * Function: Drawfile_CreateDiagram()</span> -<a name="l00412"></a>00412 <span class="comment"> *</span> -<a name="l00413"></a>00413 <span class="comment"> */</span> -<a name="l00414"></a>00414 -<a name="l00415"></a>00415 <span class="keyword">extern</span> os_error * Drawfile_CreateDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *info, <span class="keywordtype">size_t</span> memory, -<a name="l00416"></a>00416 <span class="keyword">const</span> <span class="keywordtype">char</span> *creator, wimp_box box); -<a name="l00417"></a>00417 -<a name="l00418"></a>00418 <span class="keyword">extern</span> os_error *Drawfile_AppendObject(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *info, <span class="keywordtype">size_t</span> memory, -<a name="l00419"></a>00419 <span class="keyword">const</span> <a class="code" href="structdrawfile__object.html">drawfile_object</a> *<span class="keywordtype">object</span>, BOOL rebind); -<a name="l00420"></a>00420 -<a name="l00421"></a>00421 <span class="keyword">extern</span> os_error *Drawfile_RenderDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *info, -<a name="l00422"></a>00422 window_redrawblock *redraw, <span class="keywordtype">double</span> scale); -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 <span class="keyword">extern</span> os_error *Drawfile_VerifyDiagram(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *info); -<a name="l00425"></a>00425 -<a name="l00426"></a>00426 <span class="keyword">extern</span> <span class="keywordtype">void</span> Drawfile_QueryBox(<a class="code" href="structdrawfile__info.html">drawfile_info</a> *info, -<a name="l00427"></a>00427 wimp_box *rect, BOOL screenUnits); -<a name="l00428"></a>00428 -<a name="l00429"></a>00429 <span class="preprocessor">#if defined(__cplusplus)</span> -<a name="l00430"></a>00430 <span class="preprocessor"></span> } -<a name="l00431"></a>00431 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span> -<a name="l00432"></a>00432 -<a name="l00433"></a>00433 <span class="preprocessor">#endif </span><span class="comment">/* __drawfile.h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fail_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fail.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fail.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fail.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998 A.J. van Os</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * An alternative form of assert()</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="preprocessor">#if !defined(NDEBUG)</span> -<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="keywordtype">void</span> -<a name="l00014"></a>00014 __fail(<span class="keywordtype">char</span> *szExpression, <span class="keywordtype">char</span> *szFilename, <span class="keywordtype">int</span> iLineNumber) -<a name="l00015"></a>00015 { -<a name="l00016"></a>00016 <span class="keywordflow">if</span> (szExpression == NULL || szFilename == NULL) { -<a name="l00017"></a>00017 werr(1, <span class="stringliteral">"Internal error: no expression"</span>); -<a name="l00018"></a>00018 } -<a name="l00019"></a>00019 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span> fprintf(stderr, <span class="stringliteral">"%s[%3d]: Internal error in '%s'\n"</span>, -<a name="l00021"></a>00021 szFilename, iLineNumber, szExpression); -<a name="l00022"></a>00022 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00023"></a>00023 werr(1, <span class="stringliteral">"Internal error in '%s' in file %s at line %d"</span>, -<a name="l00024"></a>00024 szExpression, szFilename, iLineNumber); -<a name="l00025"></a>00025 } <span class="comment">/* end of __fail */</span> -<a name="l00026"></a>00026 <span class="preprocessor">#endif </span><span class="comment">/* !NDEBUG */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fail_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/fail.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/fail.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fail.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2000 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Support for an alternative form of assert()</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__fail_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __fail_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="preprocessor">#undef fail</span> -<a name="l00013"></a>00013 <span class="preprocessor"></span> -<a name="l00014"></a>00014 <span class="preprocessor">#if defined(NDEBUG)</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define fail(e) ((void)0)</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define fail(e) ((e) ? __fail(#e, __FILE__, __LINE__) : (void)0)</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* NDEBUG */</span> -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 <span class="keyword">extern</span> <span class="keywordtype">void</span> __fail(<span class="keywordtype">char</span> *, <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>); -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="preprocessor">#endif </span><span class="comment">/* __fail_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/finddata_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/finddata.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/finddata.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * finddata.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Find the blocks that contain the data of MS Word files</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * bAddDataBlocks - Add the blocks to the data block list</span> -<a name="l00016"></a>00016 <span class="comment"> *</span> -<a name="l00017"></a>00017 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00018"></a>00018 <span class="comment"> */</span> -<a name="l00019"></a>00019 BOOL -<a name="l00020"></a>00020 bAddDataBlocks(ULONG ulDataPosFirst, ULONG ulTotalLength, -<a name="l00021"></a>00021 ULONG ulStartBlock, <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen) -<a name="l00022"></a>00022 { -<a name="l00023"></a>00023 data_block_type tDataBlock; -<a name="l00024"></a>00024 ULONG ulDataPos, ulOffset, ulIndex; -<a name="l00025"></a>00025 <span class="keywordtype">long</span> lToGo; -<a name="l00026"></a>00026 BOOL bSuccess; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 fail(ulTotalLength > (ULONG)LONG_MAX); -<a name="l00029"></a>00029 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00030"></a>00030 fail(aulBBD == NULL); -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 NO_DBG_HEX(ulDataPosFirst); -<a name="l00033"></a>00033 NO_DBG_DEC(ulTotalLength); -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 lToGo = (long)ulTotalLength; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 ulDataPos = ulDataPosFirst; -<a name="l00038"></a>00038 ulOffset = ulDataPosFirst; -<a name="l00039"></a>00039 <span class="keywordflow">for</span> (ulIndex = ulStartBlock; -<a name="l00040"></a>00040 ulIndex != END_OF_CHAIN && lToGo > 0; -<a name="l00041"></a>00041 ulIndex = aulBBD[ulIndex]) { -<a name="l00042"></a>00042 <span class="keywordflow">if</span> (ulIndex == UNUSED_BLOCK || ulIndex >= (ULONG)tBBDLen) { -<a name="l00043"></a>00043 DBG_DEC(ulIndex); -<a name="l00044"></a>00044 DBG_DEC(tBBDLen); -<a name="l00045"></a>00045 <span class="keywordflow">return</span> FALSE; -<a name="l00046"></a>00046 } -<a name="l00047"></a>00047 <span class="keywordflow">if</span> (ulOffset >= BIG_BLOCK_SIZE) { -<a name="l00048"></a>00048 ulOffset -= BIG_BLOCK_SIZE; -<a name="l00049"></a>00049 <span class="keywordflow">continue</span>; -<a name="l00050"></a>00050 } -<a name="l00051"></a>00051 tDataBlock.ulFileOffset = -<a name="l00052"></a>00052 (ulIndex + 1) * BIG_BLOCK_SIZE + ulOffset; -<a name="l00053"></a>00053 tDataBlock.ulDataPos = ulDataPos; -<a name="l00054"></a>00054 tDataBlock.ulLength = min(BIG_BLOCK_SIZE - ulOffset, -<a name="l00055"></a>00055 (ULONG)lToGo); -<a name="l00056"></a>00056 fail(tDataBlock.ulLength > BIG_BLOCK_SIZE); -<a name="l00057"></a>00057 ulOffset = 0; -<a name="l00058"></a>00058 <span class="keywordflow">if</span> (!bAdd2DataBlockList(&tDataBlock)) { -<a name="l00059"></a>00059 DBG_HEX(tDataBlock.ulFileOffset); -<a name="l00060"></a>00060 DBG_HEX(tDataBlock.ulDataPos); -<a name="l00061"></a>00061 DBG_DEC(tDataBlock.ulLength); -<a name="l00062"></a>00062 <span class="keywordflow">return</span> FALSE; -<a name="l00063"></a>00063 } -<a name="l00064"></a>00064 ulDataPos += tDataBlock.ulLength; -<a name="l00065"></a>00065 lToGo -= (long)tDataBlock.ulLength; -<a name="l00066"></a>00066 } -<a name="l00067"></a>00067 bSuccess = lToGo == 0 || -<a name="l00068"></a>00068 (ulTotalLength == (ULONG)LONG_MAX && ulIndex == END_OF_CHAIN); -<a name="l00069"></a>00069 DBG_DEC_C(!bSuccess, lToGo); -<a name="l00070"></a>00070 DBG_DEC_C(!bSuccess, ulTotalLength); -<a name="l00071"></a>00071 DBG_DEC_C(!bSuccess, ulIndex); -<a name="l00072"></a>00072 <span class="keywordflow">return</span> bSuccess; -<a name="l00073"></a>00073 } <span class="comment">/* end of bAddDataBlocks */</span> -<a name="l00074"></a>00074 -<a name="l00075"></a>00075 <span class="comment">/*</span> -<a name="l00076"></a>00076 <span class="comment"> * bGet6DocumentData - make a list of the data blocks of Word 6/7 files</span> -<a name="l00077"></a>00077 <span class="comment"> *</span> -<a name="l00078"></a>00078 <span class="comment"> * Code for "fast saved" files.</span> -<a name="l00079"></a>00079 <span class="comment"> *</span> -<a name="l00080"></a>00080 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00081"></a>00081 <span class="comment"> */</span> -<a name="l00082"></a>00082 BOOL -<a name="l00083"></a>00083 bGet6DocumentData(FILE *pFile, ULONG ulStartBlock, -<a name="l00084"></a>00084 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00085"></a>00085 { -<a name="l00086"></a>00086 UCHAR *aucBuffer; -<a name="l00087"></a>00087 ULONG ulBeginTextInfo, ulOffset, ulTotLength; -<a name="l00088"></a>00088 <span class="keywordtype">size_t</span> tTextInfoLen; -<a name="l00089"></a>00089 <span class="keywordtype">int</span> iIndex, iOff, iType, iLen, iPieces; -<a name="l00090"></a>00090 -<a name="l00091"></a>00091 DBG_MSG(<span class="stringliteral">"bGet6DocumentData"</span>); -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 fail(pFile == NULL); -<a name="l00094"></a>00094 fail(aulBBD == NULL); -<a name="l00095"></a>00095 fail(aucHeader == NULL); -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 ulBeginTextInfo = ulGetLong(0x160, aucHeader); -<a name="l00098"></a>00098 DBG_HEX(ulBeginTextInfo); -<a name="l00099"></a>00099 tTextInfoLen = (size_t)ulGetLong(0x164, aucHeader); -<a name="l00100"></a>00100 DBG_DEC(tTextInfoLen); -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 aucBuffer = xmalloc(tTextInfoLen); -<a name="l00103"></a>00103 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00104"></a>00104 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00105"></a>00105 aucBuffer, ulBeginTextInfo, tTextInfoLen)) { -<a name="l00106"></a>00106 aucBuffer = xfree(aucBuffer); -<a name="l00107"></a>00107 <span class="keywordflow">return</span> FALSE; -<a name="l00108"></a>00108 } -<a name="l00109"></a>00109 NO_DBG_PRINT_BLOCK(aucBuffer, tTextInfoLen); -<a name="l00110"></a>00110 -<a name="l00111"></a>00111 iOff = 0; -<a name="l00112"></a>00112 <span class="keywordflow">while</span> (iOff < (<span class="keywordtype">int</span>)tTextInfoLen) { -<a name="l00113"></a>00113 iType = (int)ucGetByte(iOff, aucBuffer); -<a name="l00114"></a>00114 iOff++; -<a name="l00115"></a>00115 <span class="keywordflow">if</span> (iType == 0) { -<a name="l00116"></a>00116 iOff++; -<a name="l00117"></a>00117 <span class="keywordflow">continue</span>; -<a name="l00118"></a>00118 } -<a name="l00119"></a>00119 iLen = (int)usGetWord(iOff, aucBuffer); -<a name="l00120"></a>00120 iOff += 2; -<a name="l00121"></a>00121 <span class="keywordflow">if</span> (iType == 1) { -<a name="l00122"></a>00122 iOff += iLen; -<a name="l00123"></a>00123 <span class="keywordflow">continue</span>; -<a name="l00124"></a>00124 } -<a name="l00125"></a>00125 <span class="keywordflow">if</span> (iType != 2) { -<a name="l00126"></a>00126 werr(0, <span class="stringliteral">"Unknown type of 'fastsaved' format"</span>); -<a name="l00127"></a>00127 aucBuffer = xfree(aucBuffer); -<a name="l00128"></a>00128 <span class="keywordflow">return</span> FALSE; -<a name="l00129"></a>00129 } -<a name="l00130"></a>00130 <span class="comment">/* Type 2 */</span> -<a name="l00131"></a>00131 NO_DBG_DEC(iLen); -<a name="l00132"></a>00132 iOff += 2; -<a name="l00133"></a>00133 iPieces = (iLen - 4) / 12; -<a name="l00134"></a>00134 DBG_DEC(iPieces); -<a name="l00135"></a>00135 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iPieces; iIndex++) { -<a name="l00136"></a>00136 ulOffset = ulGetLong( -<a name="l00137"></a>00137 iOff + (iPieces + 1) * 4 + iIndex * 8 + 2, -<a name="l00138"></a>00138 aucBuffer); -<a name="l00139"></a>00139 ulTotLength = ulGetLong(iOff + (iIndex + 1) * 4, -<a name="l00140"></a>00140 aucBuffer) - -<a name="l00141"></a>00141 ulGetLong(iOff + iIndex * 4, -<a name="l00142"></a>00142 aucBuffer); -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (!bAddDataBlocks(ulOffset, ulTotLength, -<a name="l00144"></a>00144 ulStartBlock, -<a name="l00145"></a>00145 aulBBD, tBBDLen)) { -<a name="l00146"></a>00146 aucBuffer = xfree(aucBuffer); -<a name="l00147"></a>00147 <span class="keywordflow">return</span> FALSE; -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 } -<a name="l00150"></a>00150 <span class="keywordflow">break</span>; -<a name="l00151"></a>00151 } -<a name="l00152"></a>00152 aucBuffer = xfree(aucBuffer); -<a name="l00153"></a>00153 <span class="keywordflow">return</span> TRUE; -<a name="l00154"></a>00154 } <span class="comment">/* end of bGet6DocumentData */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/findtext_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/findtext.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/findtext.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * findtext.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Find the blocks that contain the text of MS Word files</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * bAddTextBlocks - Add the blocks to the text block list</span> -<a name="l00016"></a>00016 <span class="comment"> *</span> -<a name="l00017"></a>00017 <span class="comment"> * Returns TRUE when successful, FALSE if not</span> -<a name="l00018"></a>00018 <span class="comment"> */</span> -<a name="l00019"></a>00019 BOOL -<a name="l00020"></a>00020 bAddTextBlocks(ULONG ulCharPosFirst, ULONG ulTotalLength, -<a name="l00021"></a>00021 BOOL bUsesUnicode, USHORT usPropMod, -<a name="l00022"></a>00022 ULONG ulStartBlock, <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen) -<a name="l00023"></a>00023 { -<a name="l00024"></a>00024 text_block_type tTextBlock; -<a name="l00025"></a>00025 ULONG ulCharPos, ulOffset, ulIndex; -<a name="l00026"></a>00026 <span class="keywordtype">long</span> lToGo; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 fail(ulTotalLength > (ULONG)LONG_MAX / 2); -<a name="l00029"></a>00029 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00030"></a>00030 fail(aulBBD == NULL); -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 NO_DBG_HEX(ulCharPosFirst); -<a name="l00033"></a>00033 NO_DBG_DEC(ulTotalLength); -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 <span class="keywordflow">if</span> (bUsesUnicode) { -<a name="l00036"></a>00036 <span class="comment">/* One character equals two bytes */</span> -<a name="l00037"></a>00037 NO_DBG_MSG(<span class="stringliteral">"Uses Unicode"</span>); -<a name="l00038"></a>00038 lToGo = (long)ulTotalLength * 2; -<a name="l00039"></a>00039 } <span class="keywordflow">else</span> { -<a name="l00040"></a>00040 <span class="comment">/* One character equals one byte */</span> -<a name="l00041"></a>00041 NO_DBG_MSG(<span class="stringliteral">"Uses ASCII"</span>); -<a name="l00042"></a>00042 lToGo = (long)ulTotalLength; -<a name="l00043"></a>00043 } -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 ulCharPos = ulCharPosFirst; -<a name="l00046"></a>00046 ulOffset = ulCharPosFirst; -<a name="l00047"></a>00047 <span class="keywordflow">for</span> (ulIndex = ulStartBlock; -<a name="l00048"></a>00048 ulIndex != END_OF_CHAIN && lToGo > 0; -<a name="l00049"></a>00049 ulIndex = aulBBD[ulIndex]) { -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (ulIndex >= (ULONG)tBBDLen) { -<a name="l00051"></a>00051 DBG_DEC(ulIndex); -<a name="l00052"></a>00052 DBG_DEC(tBBDLen); -<a name="l00053"></a>00053 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 <span class="keywordflow">if</span> (ulOffset >= BIG_BLOCK_SIZE) { -<a name="l00056"></a>00056 ulOffset -= BIG_BLOCK_SIZE; -<a name="l00057"></a>00057 <span class="keywordflow">continue</span>; -<a name="l00058"></a>00058 } -<a name="l00059"></a>00059 tTextBlock.ulFileOffset = -<a name="l00060"></a>00060 (ulIndex + 1) * BIG_BLOCK_SIZE + ulOffset; -<a name="l00061"></a>00061 tTextBlock.ulCharPos = ulCharPos; -<a name="l00062"></a>00062 tTextBlock.ulLength = min(BIG_BLOCK_SIZE - ulOffset, -<a name="l00063"></a>00063 (ULONG)lToGo); -<a name="l00064"></a>00064 tTextBlock.bUsesUnicode = bUsesUnicode; -<a name="l00065"></a>00065 tTextBlock.usPropMod = usPropMod; -<a name="l00066"></a>00066 ulOffset = 0; -<a name="l00067"></a>00067 <span class="keywordflow">if</span> (!bAdd2TextBlockList(&tTextBlock)) { -<a name="l00068"></a>00068 DBG_HEX(tTextBlock.ulFileOffset); -<a name="l00069"></a>00069 DBG_HEX(tTextBlock.ulCharPos); -<a name="l00070"></a>00070 DBG_DEC(tTextBlock.ulLength); -<a name="l00071"></a>00071 DBG_DEC(tTextBlock.bUsesUnicode); -<a name="l00072"></a>00072 DBG_DEC(tTextBlock.usPropMod); -<a name="l00073"></a>00073 <span class="keywordflow">return</span> FALSE; -<a name="l00074"></a>00074 } -<a name="l00075"></a>00075 ulCharPos += tTextBlock.ulLength; -<a name="l00076"></a>00076 lToGo -= (long)tTextBlock.ulLength; -<a name="l00077"></a>00077 } -<a name="l00078"></a>00078 DBG_DEC_C(lToGo != 0, lToGo); -<a name="l00079"></a>00079 <span class="keywordflow">return</span> lToGo == 0; -<a name="l00080"></a>00080 } <span class="comment">/* end of bAddTextBlocks */</span> -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="comment">/*</span> -<a name="l00083"></a>00083 <span class="comment"> * bGet6DocumentText - make a list of the text blocks of Word 6/7 files</span> -<a name="l00084"></a>00084 <span class="comment"> *</span> -<a name="l00085"></a>00085 <span class="comment"> * Code for "fast saved" files.</span> -<a name="l00086"></a>00086 <span class="comment"> *</span> -<a name="l00087"></a>00087 <span class="comment"> * Returns TRUE when successful, FALSE if not</span> -<a name="l00088"></a>00088 <span class="comment"> */</span> -<a name="l00089"></a>00089 BOOL -<a name="l00090"></a>00090 bGet6DocumentText(FILE *pFile, BOOL bUsesUnicode, ULONG ulStartBlock, -<a name="l00091"></a>00091 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00092"></a>00092 { -<a name="l00093"></a>00093 UCHAR *aucBuffer; -<a name="l00094"></a>00094 ULONG ulBeginTextInfo, ulTextOffset, ulTotLength; -<a name="l00095"></a>00095 <span class="keywordtype">size_t</span> tTextInfoLen; -<a name="l00096"></a>00096 <span class="keywordtype">int</span> iIndex, iType, iOff, iLen, iPieces; -<a name="l00097"></a>00097 USHORT usPropMod; -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 DBG_MSG(<span class="stringliteral">"bGet6DocumentText"</span>); -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 fail(pFile == NULL); -<a name="l00102"></a>00102 fail(aulBBD == NULL); -<a name="l00103"></a>00103 fail(aucHeader == NULL); -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 ulBeginTextInfo = ulGetLong(0x160, aucHeader); <span class="comment">/* fcClx */</span> -<a name="l00106"></a>00106 DBG_HEX(ulBeginTextInfo); -<a name="l00107"></a>00107 tTextInfoLen = (size_t)ulGetLong(0x164, aucHeader); <span class="comment">/* lcbClx */</span> -<a name="l00108"></a>00108 DBG_DEC(tTextInfoLen); -<a name="l00109"></a>00109 -<a name="l00110"></a>00110 aucBuffer = xmalloc(tTextInfoLen); -<a name="l00111"></a>00111 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00112"></a>00112 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00113"></a>00113 aucBuffer, ulBeginTextInfo, tTextInfoLen)) { -<a name="l00114"></a>00114 aucBuffer = xfree(aucBuffer); -<a name="l00115"></a>00115 <span class="keywordflow">return</span> FALSE; -<a name="l00116"></a>00116 } -<a name="l00117"></a>00117 NO_DBG_PRINT_BLOCK(aucBuffer, tTextInfoLen); -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 iOff = 0; -<a name="l00120"></a>00120 <span class="keywordflow">while</span> ((<span class="keywordtype">size_t</span>)iOff < tTextInfoLen) { -<a name="l00121"></a>00121 iType = (int)ucGetByte(iOff, aucBuffer); -<a name="l00122"></a>00122 iOff++; -<a name="l00123"></a>00123 <span class="keywordflow">if</span> (iType == 0) { -<a name="l00124"></a>00124 DBG_FIXME(); -<a name="l00125"></a>00125 iOff++; -<a name="l00126"></a>00126 <span class="keywordflow">continue</span>; -<a name="l00127"></a>00127 } -<a name="l00128"></a>00128 <span class="keywordflow">if</span> (iType == 1) { -<a name="l00129"></a>00129 iLen = (int)usGetWord(iOff, aucBuffer); -<a name="l00130"></a>00130 vAdd2PropModList(aucBuffer + iOff); -<a name="l00131"></a>00131 iOff += iLen + 2; -<a name="l00132"></a>00132 <span class="keywordflow">continue</span>; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 <span class="keywordflow">if</span> (iType != 2) { -<a name="l00135"></a>00135 werr(0, <span class="stringliteral">"Unknown type of 'fastsaved' format"</span>); -<a name="l00136"></a>00136 aucBuffer = xfree(aucBuffer); -<a name="l00137"></a>00137 <span class="keywordflow">return</span> FALSE; -<a name="l00138"></a>00138 } -<a name="l00139"></a>00139 <span class="comment">/* Type 2 */</span> -<a name="l00140"></a>00140 iLen = (int)usGetWord(iOff, aucBuffer); -<a name="l00141"></a>00141 NO_DBG_DEC(iLen); -<a name="l00142"></a>00142 iOff += 4; -<a name="l00143"></a>00143 iPieces = (iLen - 4) / 12; -<a name="l00144"></a>00144 DBG_DEC(iPieces); -<a name="l00145"></a>00145 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iPieces; iIndex++) { -<a name="l00146"></a>00146 ulTextOffset = ulGetLong( -<a name="l00147"></a>00147 iOff + (iPieces + 1) * 4 + iIndex * 8 + 2, -<a name="l00148"></a>00148 aucBuffer); -<a name="l00149"></a>00149 usPropMod = usGetWord( -<a name="l00150"></a>00150 iOff + (iPieces + 1) * 4 + iIndex * 8 + 6, -<a name="l00151"></a>00151 aucBuffer); -<a name="l00152"></a>00152 ulTotLength = ulGetLong(iOff + (iIndex + 1) * 4, -<a name="l00153"></a>00153 aucBuffer) - -<a name="l00154"></a>00154 ulGetLong(iOff + iIndex * 4, -<a name="l00155"></a>00155 aucBuffer); -<a name="l00156"></a>00156 NO_DBG_HEX_C(usPropMod != 0, usPropMod); -<a name="l00157"></a>00157 <span class="keywordflow">if</span> (!bAddTextBlocks(ulTextOffset, ulTotLength, -<a name="l00158"></a>00158 bUsesUnicode, usPropMod, -<a name="l00159"></a>00159 ulStartBlock, -<a name="l00160"></a>00160 aulBBD, tBBDLen)) { -<a name="l00161"></a>00161 aucBuffer = xfree(aucBuffer); -<a name="l00162"></a>00162 <span class="keywordflow">return</span> FALSE; -<a name="l00163"></a>00163 } -<a name="l00164"></a>00164 } -<a name="l00165"></a>00165 <span class="keywordflow">break</span>; -<a name="l00166"></a>00166 } -<a name="l00167"></a>00167 aucBuffer = xfree(aucBuffer); -<a name="l00168"></a>00168 <span class="keywordflow">return</span> TRUE; -<a name="l00169"></a>00169 } <span class="comment">/* end of bGet6DocumentText */</span> -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 <span class="comment">/*</span> -<a name="l00172"></a>00172 <span class="comment"> * bGet8DocumentText - make a list of the text blocks of Word 8/97 files</span> -<a name="l00173"></a>00173 <span class="comment"> *</span> -<a name="l00174"></a>00174 <span class="comment"> * Returns TRUE when successful, FALSE if not</span> -<a name="l00175"></a>00175 <span class="comment"> */</span> -<a name="l00176"></a>00176 BOOL -<a name="l00177"></a>00177 bGet8DocumentText(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00178"></a>00178 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00179"></a>00179 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00180"></a>00180 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00181"></a>00181 { -<a name="l00182"></a>00182 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00183"></a>00183 UCHAR *aucBuffer; -<a name="l00184"></a>00184 ULONG ulTextOffset, ulBeginTextInfo; -<a name="l00185"></a>00185 ULONG ulTotLength, ulLen; -<a name="l00186"></a>00186 <span class="keywordtype">long</span> lIndex, lPieces, lOff; -<a name="l00187"></a>00187 <span class="keywordtype">size_t</span> tTextInfoLen, tBlockDepotLen, tBlockSize; -<a name="l00188"></a>00188 <span class="keywordtype">int</span> iType, iLen; -<a name="l00189"></a>00189 BOOL bUsesUnicode; -<a name="l00190"></a>00190 USHORT usPropMod; -<a name="l00191"></a>00191 -<a name="l00192"></a>00192 DBG_MSG(<span class="stringliteral">"bGet8DocumentText"</span>); -<a name="l00193"></a>00193 -<a name="l00194"></a>00194 fail(pFile == NULL || pPPS == NULL); -<a name="l00195"></a>00195 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00196"></a>00196 fail(aucHeader == NULL); -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 ulBeginTextInfo = ulGetLong(0x1a2, aucHeader); <span class="comment">/* fcClx */</span> -<a name="l00199"></a>00199 DBG_HEX(ulBeginTextInfo); -<a name="l00200"></a>00200 tTextInfoLen = (size_t)ulGetLong(0x1a6, aucHeader); <span class="comment">/* lcbClx */</span> -<a name="l00201"></a>00201 DBG_DEC(tTextInfoLen); -<a name="l00202"></a>00202 -<a name="l00203"></a>00203 DBG_DEC(pPPS->tTable.ulSB); -<a name="l00204"></a>00204 DBG_HEX(pPPS->tTable.ulSize); -<a name="l00205"></a>00205 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00206"></a>00206 <span class="keywordflow">return</span> FALSE; -<a name="l00207"></a>00207 } -<a name="l00208"></a>00208 -<a name="l00209"></a>00209 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00210"></a>00210 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00211"></a>00211 aulBlockDepot = aulSBD; -<a name="l00212"></a>00212 tBlockDepotLen = tSBDLen; -<a name="l00213"></a>00213 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00214"></a>00214 } <span class="keywordflow">else</span> { -<a name="l00215"></a>00215 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00216"></a>00216 aulBlockDepot = aulBBD; -<a name="l00217"></a>00217 tBlockDepotLen = tBBDLen; -<a name="l00218"></a>00218 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00219"></a>00219 } -<a name="l00220"></a>00220 aucBuffer = xmalloc(tTextInfoLen); -<a name="l00221"></a>00221 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00222"></a>00222 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00223"></a>00223 aucBuffer, ulBeginTextInfo, tTextInfoLen)) { -<a name="l00224"></a>00224 aucBuffer = xfree(aucBuffer); -<a name="l00225"></a>00225 <span class="keywordflow">return</span> FALSE; -<a name="l00226"></a>00226 } -<a name="l00227"></a>00227 NO_DBG_PRINT_BLOCK(aucBuffer, tTextInfoLen); -<a name="l00228"></a>00228 -<a name="l00229"></a>00229 lOff = 0; -<a name="l00230"></a>00230 <span class="keywordflow">while</span> (lOff < (<span class="keywordtype">long</span>)tTextInfoLen) { -<a name="l00231"></a>00231 iType = (int)ucGetByte(lOff, aucBuffer); -<a name="l00232"></a>00232 lOff++; -<a name="l00233"></a>00233 <span class="keywordflow">if</span> (iType == 0) { -<a name="l00234"></a>00234 DBG_FIXME(); -<a name="l00235"></a>00235 lOff++; -<a name="l00236"></a>00236 <span class="keywordflow">continue</span>; -<a name="l00237"></a>00237 } -<a name="l00238"></a>00238 <span class="keywordflow">if</span> (iType == 1) { -<a name="l00239"></a>00239 iLen = (int)usGetWord(lOff, aucBuffer); -<a name="l00240"></a>00240 vAdd2PropModList(aucBuffer + lOff); -<a name="l00241"></a>00241 lOff += (long)iLen + 2; -<a name="l00242"></a>00242 <span class="keywordflow">continue</span>; -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 <span class="keywordflow">if</span> (iType != 2) { -<a name="l00245"></a>00245 werr(0, <span class="stringliteral">"Unknown type of 'fastsaved' format"</span>); -<a name="l00246"></a>00246 aucBuffer = xfree(aucBuffer); -<a name="l00247"></a>00247 <span class="keywordflow">return</span> FALSE; -<a name="l00248"></a>00248 } -<a name="l00249"></a>00249 <span class="comment">/* Type 2 */</span> -<a name="l00250"></a>00250 ulLen = ulGetLong(lOff, aucBuffer); -<a name="l00251"></a>00251 <span class="keywordflow">if</span> (ulLen < 4) { -<a name="l00252"></a>00252 DBG_DEC(ulLen); -<a name="l00253"></a>00253 <span class="keywordflow">return</span> FALSE; -<a name="l00254"></a>00254 } -<a name="l00255"></a>00255 lOff += 4; -<a name="l00256"></a>00256 lPieces = (long)((ulLen - 4) / 12); -<a name="l00257"></a>00257 DBG_DEC(lPieces); -<a name="l00258"></a>00258 <span class="keywordflow">for</span> (lIndex = 0; lIndex < lPieces; lIndex++) { -<a name="l00259"></a>00259 ulTextOffset = ulGetLong( -<a name="l00260"></a>00260 lOff + (lPieces + 1) * 4 + lIndex * 8 + 2, -<a name="l00261"></a>00261 aucBuffer); -<a name="l00262"></a>00262 usPropMod = usGetWord( -<a name="l00263"></a>00263 lOff + (lPieces + 1) * 4 + lIndex * 8 + 6, -<a name="l00264"></a>00264 aucBuffer); -<a name="l00265"></a>00265 ulTotLength = ulGetLong(lOff + (lIndex + 1) * 4, -<a name="l00266"></a>00266 aucBuffer) - -<a name="l00267"></a>00267 ulGetLong(lOff + lIndex * 4, -<a name="l00268"></a>00268 aucBuffer); -<a name="l00269"></a>00269 <span class="keywordflow">if</span> ((ulTextOffset & BIT(30)) == 0) { -<a name="l00270"></a>00270 bUsesUnicode = TRUE; -<a name="l00271"></a>00271 } <span class="keywordflow">else</span> { -<a name="l00272"></a>00272 bUsesUnicode = FALSE; -<a name="l00273"></a>00273 ulTextOffset &= ~BIT(30); -<a name="l00274"></a>00274 ulTextOffset /= 2; -<a name="l00275"></a>00275 } -<a name="l00276"></a>00276 NO_DBG_HEX_C(usPropMod != 0, usPropMod); -<a name="l00277"></a>00277 <span class="keywordflow">if</span> (!bAddTextBlocks(ulTextOffset, ulTotLength, -<a name="l00278"></a>00278 bUsesUnicode, usPropMod, -<a name="l00279"></a>00279 pPPS->tWordDocument.ulSB, -<a name="l00280"></a>00280 aulBBD, tBBDLen)) { -<a name="l00281"></a>00281 aucBuffer = xfree(aucBuffer); -<a name="l00282"></a>00282 <span class="keywordflow">return</span> FALSE; -<a name="l00283"></a>00283 } -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 <span class="keywordflow">break</span>; -<a name="l00286"></a>00286 } -<a name="l00287"></a>00287 aucBuffer = xfree(aucBuffer); -<a name="l00288"></a>00288 <span class="keywordflow">return</span> TRUE; -<a name="l00289"></a>00289 } <span class="comment">/* end of bGet8DocumentText */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fmt__text_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fmt_text.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fmt_text.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fmt_text.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the Formatted Text format</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * Based on patches send by: Ofir Reichenberg <ofir@qlusters.com></span> -<a name="l00009"></a>00009 <span class="comment"> *</span> -<a name="l00010"></a>00010 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00011"></a>00011 <span class="comment"> */</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#include <string.h></span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="comment">/* The character set */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00018"></a>00018 <span class="comment">/* Current vertical position information */</span> -<a name="l00019"></a>00019 <span class="keyword">static</span> <span class="keywordtype">long</span> lYtopCurr = 0; -<a name="l00020"></a>00020 <span class="comment">/* Local representation of the non-breaking space */</span> -<a name="l00021"></a>00021 <span class="keyword">static</span> UCHAR ucNbsp = 0; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 <span class="comment">/*</span> -<a name="l00025"></a>00025 <span class="comment"> * vPrologueFMT - set options and perform the Formatted Text initialization</span> -<a name="l00026"></a>00026 <span class="comment"> */</span> -<a name="l00027"></a>00027 <span class="keywordtype">void</span> -<a name="l00028"></a>00028 vPrologueFMT(diagram_type *pDiag, <span class="keyword">const</span> options_type *pOptions) -<a name="l00029"></a>00029 { -<a name="l00030"></a>00030 fail(pDiag == NULL); -<a name="l00031"></a>00031 fail(pOptions == NULL); -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 eEncoding = pOptions->eEncoding; -<a name="l00034"></a>00034 pDiag->lXleft = 0; -<a name="l00035"></a>00035 pDiag->lYtop = 0; -<a name="l00036"></a>00036 lYtopCurr = 0; -<a name="l00037"></a>00037 } <span class="comment">/* end of vPrologueFMT */</span> -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 <span class="comment">/*</span> -<a name="l00040"></a>00040 <span class="comment"> * vPrintFMT - print a Formatted Text string</span> -<a name="l00041"></a>00041 <span class="comment"> */</span> -<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00043"></a>00043 vPrintFMT(FILE *pFile, -<a name="l00044"></a>00044 <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, USHORT usFontstyle) -<a name="l00045"></a>00045 { -<a name="l00046"></a>00046 <span class="keyword">const</span> UCHAR *pucByte, *pucStart, *pucLast, *pucNonSpace; -<a name="l00047"></a>00047 -<a name="l00048"></a>00048 fail(szString == NULL); -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (szString == NULL || szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00051"></a>00051 <span class="keywordflow">return</span>; -<a name="l00052"></a>00052 } -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00055"></a>00055 fprintf(pFile, <span class="stringliteral">"%.*s"</span>, (<span class="keywordtype">int</span>)tStringLength, szString); -<a name="l00056"></a>00056 <span class="keywordflow">return</span>; -<a name="l00057"></a>00057 } -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 <span class="keywordflow">if</span> (ucNbsp == 0) { -<a name="l00060"></a>00060 ucNbsp = ucGetNbspCharacter(); -<a name="l00061"></a>00061 DBG_HEX_C(ucNbsp != 0xa0, ucNbsp); -<a name="l00062"></a>00062 } -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 pucStart = (UCHAR *)szString; -<a name="l00065"></a>00065 pucLast = pucStart + tStringLength - 1; -<a name="l00066"></a>00066 pucNonSpace = pucLast; -<a name="l00067"></a>00067 <span class="keywordflow">while</span> ((*pucNonSpace == (UCHAR)<span class="charliteral">' '</span> || *pucNonSpace == ucNbsp) && -<a name="l00068"></a>00068 pucNonSpace > pucStart) { -<a name="l00069"></a>00069 pucNonSpace--; -<a name="l00070"></a>00070 } -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 <span class="comment">/* 1: The spaces at the start */</span> -<a name="l00073"></a>00073 pucByte = pucStart; -<a name="l00074"></a>00074 <span class="keywordflow">while</span> ((*pucByte == (UCHAR)<span class="charliteral">' '</span> || *pucByte == ucNbsp) && -<a name="l00075"></a>00075 pucByte <= pucLast) { -<a name="l00076"></a>00076 (void)putc(<span class="charliteral">' '</span>, pFile); -<a name="l00077"></a>00077 pucByte++; -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (pucByte > pucLast) { -<a name="l00081"></a>00081 <span class="comment">/* There is no text, just spaces */</span> -<a name="l00082"></a>00082 <span class="keywordflow">return</span>; -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 <span class="comment">/* 2: Start the *bold*, /italic/ and _underline_ */</span> -<a name="l00086"></a>00086 <span class="keywordflow">if</span> (bIsBold(usFontstyle)) { -<a name="l00087"></a>00087 (void)putc(<span class="charliteral">'*'</span>, pFile); -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 <span class="keywordflow">if</span> (bIsItalic(usFontstyle)) { -<a name="l00090"></a>00090 (void)putc(<span class="charliteral">'/'</span>, pFile); -<a name="l00091"></a>00091 } -<a name="l00092"></a>00092 <span class="keywordflow">if</span> (bIsUnderline(usFontstyle)) { -<a name="l00093"></a>00093 (void)putc(<span class="charliteral">'_'</span>, pFile); -<a name="l00094"></a>00094 } -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="comment">/* 3: The text itself */</span> -<a name="l00097"></a>00097 <span class="keywordflow">while</span> (pucByte <= pucNonSpace) { -<a name="l00098"></a>00098 <span class="keywordflow">if</span> (*pucByte == ucNbsp) { -<a name="l00099"></a>00099 (void)putc(<span class="charliteral">' '</span>, pFile); -<a name="l00100"></a>00100 } <span class="keywordflow">else</span> { -<a name="l00101"></a>00101 (void)putc((<span class="keywordtype">char</span>)*pucByte, pFile); -<a name="l00102"></a>00102 } -<a name="l00103"></a>00103 pucByte++; -<a name="l00104"></a>00104 } -<a name="l00105"></a>00105 -<a name="l00106"></a>00106 <span class="comment">/* 4: End the *bold*, /italic/ and _underline_ */</span> -<a name="l00107"></a>00107 <span class="keywordflow">if</span> (bIsUnderline(usFontstyle)) { -<a name="l00108"></a>00108 (void)putc(<span class="charliteral">'_'</span>, pFile); -<a name="l00109"></a>00109 } -<a name="l00110"></a>00110 <span class="keywordflow">if</span> (bIsItalic(usFontstyle)) { -<a name="l00111"></a>00111 (void)putc(<span class="charliteral">'/'</span>, pFile); -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 <span class="keywordflow">if</span> (bIsBold(usFontstyle)) { -<a name="l00114"></a>00114 (void)putc(<span class="charliteral">'*'</span>, pFile); -<a name="l00115"></a>00115 } -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 <span class="comment">/* 5: The spaces at the end */</span> -<a name="l00118"></a>00118 <span class="keywordflow">while</span> (pucByte <= pucLast) { -<a name="l00119"></a>00119 (void)putc(<span class="charliteral">' '</span>, pFile); -<a name="l00120"></a>00120 pucByte++; -<a name="l00121"></a>00121 } -<a name="l00122"></a>00122 } <span class="comment">/* end of vPrintFMT */</span> -<a name="l00123"></a>00123 -<a name="l00124"></a>00124 <span class="comment">/*</span> -<a name="l00125"></a>00125 <span class="comment"> * vMoveTo - move to the given X,Y coordinates</span> -<a name="l00126"></a>00126 <span class="comment"> *</span> -<a name="l00127"></a>00127 <span class="comment"> * Move the current position of the given diagram to its X,Y coordinates,</span> -<a name="l00128"></a>00128 <span class="comment"> * start on a new page if needed</span> -<a name="l00129"></a>00129 <span class="comment"> */</span> -<a name="l00130"></a>00130 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00131"></a>00131 vMoveTo(diagram_type *pDiag) -<a name="l00132"></a>00132 { -<a name="l00133"></a>00133 <span class="keywordtype">int</span> iCount, iNbr; -<a name="l00134"></a>00134 -<a name="l00135"></a>00135 fail(pDiag == NULL); -<a name="l00136"></a>00136 fail(pDiag->pOutFile == NULL); -<a name="l00137"></a>00137 -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (pDiag->lYtop != lYtopCurr) { -<a name="l00139"></a>00139 iNbr = iDrawUnits2Char(pDiag->lXleft); -<a name="l00140"></a>00140 <span class="keywordflow">for</span> (iCount = 0; iCount < iNbr; iCount++) { -<a name="l00141"></a>00141 (void)putc(FILLER_CHAR, pDiag->pOutFile); -<a name="l00142"></a>00142 } -<a name="l00143"></a>00143 lYtopCurr = pDiag->lYtop; -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 } <span class="comment">/* end of vMoveTo */</span> -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 <span class="comment">/*</span> -<a name="l00148"></a>00148 <span class="comment"> * vSubstringFMT - print a sub string</span> -<a name="l00149"></a>00149 <span class="comment"> */</span> -<a name="l00150"></a>00150 <span class="keywordtype">void</span> -<a name="l00151"></a>00151 vSubstringFMT(diagram_type *pDiag, -<a name="l00152"></a>00152 <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l00153"></a>00153 USHORT usFontstyle) -<a name="l00154"></a>00154 { -<a name="l00155"></a>00155 fail(pDiag == NULL || szString == NULL); -<a name="l00156"></a>00156 fail(pDiag->pOutFile == NULL); -<a name="l00157"></a>00157 fail(pDiag->lXleft < 0); -<a name="l00158"></a>00158 fail(tStringLength != strlen(szString)); -<a name="l00159"></a>00159 -<a name="l00160"></a>00160 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00161"></a>00161 <span class="keywordflow">return</span>; -<a name="l00162"></a>00162 } -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 vMoveTo(pDiag); -<a name="l00165"></a>00165 vPrintFMT(pDiag->pOutFile, szString, tStringLength, usFontstyle); -<a name="l00166"></a>00166 pDiag->lXleft += lStringWidth; -<a name="l00167"></a>00167 } <span class="comment">/* end of vSubstringFMT */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fontinfo_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2267 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/fontinfo.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/fontinfo.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT! */</span> -<a name="l00002"></a>00002 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szFontnames[32] = { -<a name="l00003"></a>00003 <span class="stringliteral">"Courier"</span>, -<a name="l00004"></a>00004 <span class="stringliteral">"Courier-Bold"</span>, -<a name="l00005"></a>00005 <span class="stringliteral">"Courier-Oblique"</span>, -<a name="l00006"></a>00006 <span class="stringliteral">"Courier-BoldOblique"</span>, -<a name="l00007"></a>00007 <span class="stringliteral">"Times-Roman"</span>, -<a name="l00008"></a>00008 <span class="stringliteral">"Times-Bold"</span>, -<a name="l00009"></a>00009 <span class="stringliteral">"Times-Italic"</span>, -<a name="l00010"></a>00010 <span class="stringliteral">"Times-BoldItalic"</span>, -<a name="l00011"></a>00011 <span class="stringliteral">"Helvetica"</span>, -<a name="l00012"></a>00012 <span class="stringliteral">"Helvetica-Bold"</span>, -<a name="l00013"></a>00013 <span class="stringliteral">"Helvetica-Oblique"</span>, -<a name="l00014"></a>00014 <span class="stringliteral">"Helvetica-BoldOblique"</span>, -<a name="l00015"></a>00015 <span class="stringliteral">"Palatino-Roman"</span>, -<a name="l00016"></a>00016 <span class="stringliteral">"Palatino-Bold"</span>, -<a name="l00017"></a>00017 <span class="stringliteral">"Palatino-Italic"</span>, -<a name="l00018"></a>00018 <span class="stringliteral">"Palatino-BoldItalic"</span>, -<a name="l00019"></a>00019 <span class="stringliteral">"Helvetica-Narrow"</span>, -<a name="l00020"></a>00020 <span class="stringliteral">"Helvetica-Narrow-Bold"</span>, -<a name="l00021"></a>00021 <span class="stringliteral">"Helvetica-Narrow-Oblique"</span>, -<a name="l00022"></a>00022 <span class="stringliteral">"Helvetica-Narrow-BoldOblique"</span>, -<a name="l00023"></a>00023 <span class="stringliteral">"Bookman-Light"</span>, -<a name="l00024"></a>00024 <span class="stringliteral">"Bookman-Demi"</span>, -<a name="l00025"></a>00025 <span class="stringliteral">"Bookman-LightItalic"</span>, -<a name="l00026"></a>00026 <span class="stringliteral">"Bookman-DemiItalic"</span>, -<a name="l00027"></a>00027 <span class="stringliteral">"AvantGarde-Book"</span>, -<a name="l00028"></a>00028 <span class="stringliteral">"AvantGarde-Demi"</span>, -<a name="l00029"></a>00029 <span class="stringliteral">"AvantGarde-BookOblique"</span>, -<a name="l00030"></a>00030 <span class="stringliteral">"AvantGarde-DemiOblique"</span>, -<a name="l00031"></a>00031 <span class="stringliteral">"NewCenturySchlbk-Roman"</span>, -<a name="l00032"></a>00032 <span class="stringliteral">"NewCenturySchlbk-Bold"</span>, -<a name="l00033"></a>00033 <span class="stringliteral">"NewCenturySchlbk-Italic"</span>, -<a name="l00034"></a>00034 <span class="stringliteral">"NewCenturySchlbk-BoldItalic"</span>, -<a name="l00035"></a>00035 }; -<a name="l00036"></a>00036 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> ausCharacterWidths1[32][256] = { -<a name="l00037"></a>00037 { <span class="comment">/* Courier */</span> -<a name="l00038"></a>00038 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00039"></a>00039 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00040"></a>00040 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00041"></a>00041 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00042"></a>00042 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00043"></a>00043 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00044"></a>00044 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00045"></a>00045 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00046"></a>00046 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00047"></a>00047 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00048"></a>00048 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00049"></a>00049 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00050"></a>00050 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00051"></a>00051 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00052"></a>00052 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00053"></a>00053 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l00054"></a>00054 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00055"></a>00055 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 600, 600, 600, 600, -<a name="l00056"></a>00056 <span class="comment">/* 144 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00057"></a>00057 <span class="comment">/* 152 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00058"></a>00058 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00059"></a>00059 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00060"></a>00060 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00061"></a>00061 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00062"></a>00062 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00063"></a>00063 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00064"></a>00064 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00065"></a>00065 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00066"></a>00066 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00067"></a>00067 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00068"></a>00068 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00069"></a>00069 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00070"></a>00070 }, -<a name="l00071"></a>00071 { <span class="comment">/* Courier-Bold */</span> -<a name="l00072"></a>00072 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00073"></a>00073 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00074"></a>00074 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00075"></a>00075 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00076"></a>00076 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00077"></a>00077 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00078"></a>00078 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00079"></a>00079 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00080"></a>00080 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00081"></a>00081 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00082"></a>00082 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00083"></a>00083 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00084"></a>00084 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00085"></a>00085 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00086"></a>00086 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00087"></a>00087 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l00088"></a>00088 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00089"></a>00089 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 600, 600, 600, 600, -<a name="l00090"></a>00090 <span class="comment">/* 144 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00091"></a>00091 <span class="comment">/* 152 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00092"></a>00092 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00093"></a>00093 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00094"></a>00094 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00095"></a>00095 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00096"></a>00096 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00097"></a>00097 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00098"></a>00098 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00099"></a>00099 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00100"></a>00100 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00101"></a>00101 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00102"></a>00102 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00103"></a>00103 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00104"></a>00104 }, -<a name="l00105"></a>00105 { <span class="comment">/* Courier-Oblique */</span> -<a name="l00106"></a>00106 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00107"></a>00107 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00108"></a>00108 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00109"></a>00109 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00110"></a>00110 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00111"></a>00111 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00112"></a>00112 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00113"></a>00113 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00114"></a>00114 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00115"></a>00115 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00116"></a>00116 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00117"></a>00117 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00118"></a>00118 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00119"></a>00119 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00120"></a>00120 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00121"></a>00121 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l00122"></a>00122 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00123"></a>00123 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 600, 600, 600, 600, -<a name="l00124"></a>00124 <span class="comment">/* 144 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00125"></a>00125 <span class="comment">/* 152 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00126"></a>00126 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00127"></a>00127 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00128"></a>00128 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00129"></a>00129 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00130"></a>00130 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00131"></a>00131 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00132"></a>00132 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00133"></a>00133 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00134"></a>00134 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00135"></a>00135 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00136"></a>00136 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00137"></a>00137 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00138"></a>00138 }, -<a name="l00139"></a>00139 { <span class="comment">/* Courier-BoldOblique */</span> -<a name="l00140"></a>00140 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00141"></a>00141 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00142"></a>00142 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00143"></a>00143 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00144"></a>00144 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00145"></a>00145 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00146"></a>00146 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00147"></a>00147 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00148"></a>00148 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00149"></a>00149 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00150"></a>00150 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00151"></a>00151 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00152"></a>00152 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00153"></a>00153 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00154"></a>00154 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00155"></a>00155 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l00156"></a>00156 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00157"></a>00157 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 600, 600, 600, 600, -<a name="l00158"></a>00158 <span class="comment">/* 144 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00159"></a>00159 <span class="comment">/* 152 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00160"></a>00160 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00161"></a>00161 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00162"></a>00162 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00163"></a>00163 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00164"></a>00164 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00165"></a>00165 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00166"></a>00166 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00167"></a>00167 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00168"></a>00168 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00169"></a>00169 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00170"></a>00170 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00171"></a>00171 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l00172"></a>00172 }, -<a name="l00173"></a>00173 { <span class="comment">/* Times-Roman */</span> -<a name="l00174"></a>00174 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00175"></a>00175 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00176"></a>00176 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00177"></a>00177 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00178"></a>00178 <span class="comment">/* 32 */</span> 250, 333, 408, 500, 500, 833, 778, 333, -<a name="l00179"></a>00179 <span class="comment">/* 40 */</span> 333, 333, 500, 564, 250, 333, 250, 278, -<a name="l00180"></a>00180 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00181"></a>00181 <span class="comment">/* 56 */</span> 500, 500, 278, 278, 564, 564, 564, 444, -<a name="l00182"></a>00182 <span class="comment">/* 64 */</span> 921, 722, 667, 667, 722, 611, 556, 722, -<a name="l00183"></a>00183 <span class="comment">/* 72 */</span> 722, 333, 389, 722, 611, 889, 722, 722, -<a name="l00184"></a>00184 <span class="comment">/* 80 */</span> 556, 722, 667, 556, 611, 722, 722, 944, -<a name="l00185"></a>00185 <span class="comment">/* 88 */</span> 722, 722, 611, 333, 278, 333, 469, 500, -<a name="l00186"></a>00186 <span class="comment">/* 96 */</span> 333, 444, 500, 444, 500, 444, 333, 500, -<a name="l00187"></a>00187 <span class="comment">/* 104 */</span> 500, 278, 278, 500, 278, 778, 500, 500, -<a name="l00188"></a>00188 <span class="comment">/* 112 */</span> 500, 500, 333, 389, 278, 500, 500, 722, -<a name="l00189"></a>00189 <span class="comment">/* 120 */</span> 500, 500, 444, 480, 200, 480, 541, 0, -<a name="l00190"></a>00190 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00191"></a>00191 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 980, 1000, 350, -<a name="l00192"></a>00192 <span class="comment">/* 144 */</span> 333, 333, 333, 333, 444, 444, 444, 500, -<a name="l00193"></a>00193 <span class="comment">/* 152 */</span> 1000, 564, 889, 722, 500, 500, 556, 556, -<a name="l00194"></a>00194 <span class="comment">/* 160 */</span> 250, 333, 500, 500, 500, 500, 200, 500, -<a name="l00195"></a>00195 <span class="comment">/* 168 */</span> 333, 760, 276, 500, 564, 333, 760, 333, -<a name="l00196"></a>00196 <span class="comment">/* 176 */</span> 400, 564, 300, 300, 333, 500, 453, 250, -<a name="l00197"></a>00197 <span class="comment">/* 184 */</span> 333, 300, 310, 500, 750, 750, 750, 444, -<a name="l00198"></a>00198 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 889, 667, -<a name="l00199"></a>00199 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 333, 333, 333, 333, -<a name="l00200"></a>00200 <span class="comment">/* 208 */</span> 722, 722, 722, 722, 722, 722, 722, 564, -<a name="l00201"></a>00201 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 722, 556, 500, -<a name="l00202"></a>00202 <span class="comment">/* 224 */</span> 444, 444, 444, 444, 444, 444, 667, 444, -<a name="l00203"></a>00203 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 278, 278, 278, 278, -<a name="l00204"></a>00204 <span class="comment">/* 240 */</span> 500, 500, 500, 500, 500, 500, 500, 564, -<a name="l00205"></a>00205 <span class="comment">/* 248 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00206"></a>00206 }, -<a name="l00207"></a>00207 { <span class="comment">/* Times-Bold */</span> -<a name="l00208"></a>00208 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00209"></a>00209 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00210"></a>00210 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00211"></a>00211 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00212"></a>00212 <span class="comment">/* 32 */</span> 250, 333, 555, 500, 500, 1000, 833, 333, -<a name="l00213"></a>00213 <span class="comment">/* 40 */</span> 333, 333, 500, 570, 250, 333, 250, 278, -<a name="l00214"></a>00214 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00215"></a>00215 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 570, 570, 570, 500, -<a name="l00216"></a>00216 <span class="comment">/* 64 */</span> 930, 722, 667, 722, 722, 667, 611, 778, -<a name="l00217"></a>00217 <span class="comment">/* 72 */</span> 778, 389, 500, 778, 667, 944, 722, 778, -<a name="l00218"></a>00218 <span class="comment">/* 80 */</span> 611, 778, 722, 556, 667, 722, 722, 1000, -<a name="l00219"></a>00219 <span class="comment">/* 88 */</span> 722, 722, 667, 333, 278, 333, 581, 500, -<a name="l00220"></a>00220 <span class="comment">/* 96 */</span> 333, 500, 556, 444, 556, 444, 333, 500, -<a name="l00221"></a>00221 <span class="comment">/* 104 */</span> 556, 278, 333, 556, 278, 833, 556, 500, -<a name="l00222"></a>00222 <span class="comment">/* 112 */</span> 556, 556, 444, 389, 333, 556, 500, 722, -<a name="l00223"></a>00223 <span class="comment">/* 120 */</span> 500, 500, 444, 394, 220, 394, 520, 0, -<a name="l00224"></a>00224 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00225"></a>00225 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00226"></a>00226 <span class="comment">/* 144 */</span> 333, 333, 333, 333, 500, 500, 500, 500, -<a name="l00227"></a>00227 <span class="comment">/* 152 */</span> 1000, 570, 1000, 722, 500, 500, 556, 556, -<a name="l00228"></a>00228 <span class="comment">/* 160 */</span> 250, 333, 500, 500, 500, 500, 220, 500, -<a name="l00229"></a>00229 <span class="comment">/* 168 */</span> 333, 747, 300, 500, 570, 333, 747, 333, -<a name="l00230"></a>00230 <span class="comment">/* 176 */</span> 400, 570, 300, 300, 333, 556, 540, 250, -<a name="l00231"></a>00231 <span class="comment">/* 184 */</span> 333, 300, 330, 500, 750, 750, 750, 500, -<a name="l00232"></a>00232 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 1000, 722, -<a name="l00233"></a>00233 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 389, 389, 389, 389, -<a name="l00234"></a>00234 <span class="comment">/* 208 */</span> 722, 722, 778, 778, 778, 778, 778, 570, -<a name="l00235"></a>00235 <span class="comment">/* 216 */</span> 778, 722, 722, 722, 722, 722, 611, 556, -<a name="l00236"></a>00236 <span class="comment">/* 224 */</span> 500, 500, 500, 500, 500, 500, 722, 444, -<a name="l00237"></a>00237 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 278, 278, 278, 278, -<a name="l00238"></a>00238 <span class="comment">/* 240 */</span> 500, 556, 500, 500, 500, 500, 500, 570, -<a name="l00239"></a>00239 <span class="comment">/* 248 */</span> 500, 556, 556, 556, 556, 500, 556, 500, -<a name="l00240"></a>00240 }, -<a name="l00241"></a>00241 { <span class="comment">/* Times-Italic */</span> -<a name="l00242"></a>00242 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00243"></a>00243 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00244"></a>00244 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00245"></a>00245 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00246"></a>00246 <span class="comment">/* 32 */</span> 250, 333, 420, 500, 500, 833, 778, 333, -<a name="l00247"></a>00247 <span class="comment">/* 40 */</span> 333, 333, 500, 675, 250, 333, 250, 278, -<a name="l00248"></a>00248 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00249"></a>00249 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 675, 675, 675, 500, -<a name="l00250"></a>00250 <span class="comment">/* 64 */</span> 920, 611, 611, 667, 722, 611, 611, 722, -<a name="l00251"></a>00251 <span class="comment">/* 72 */</span> 722, 333, 444, 667, 556, 833, 667, 722, -<a name="l00252"></a>00252 <span class="comment">/* 80 */</span> 611, 722, 611, 500, 556, 722, 611, 833, -<a name="l00253"></a>00253 <span class="comment">/* 88 */</span> 611, 556, 556, 389, 278, 389, 422, 500, -<a name="l00254"></a>00254 <span class="comment">/* 96 */</span> 333, 500, 500, 444, 500, 444, 278, 500, -<a name="l00255"></a>00255 <span class="comment">/* 104 */</span> 500, 278, 278, 444, 278, 722, 500, 500, -<a name="l00256"></a>00256 <span class="comment">/* 112 */</span> 500, 500, 389, 389, 278, 500, 444, 667, -<a name="l00257"></a>00257 <span class="comment">/* 120 */</span> 444, 444, 389, 400, 275, 400, 541, 0, -<a name="l00258"></a>00258 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00259"></a>00259 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 889, 980, 1000, 350, -<a name="l00260"></a>00260 <span class="comment">/* 144 */</span> 333, 333, 333, 333, 556, 556, 556, 500, -<a name="l00261"></a>00261 <span class="comment">/* 152 */</span> 889, 675, 944, 667, 500, 500, 500, 500, -<a name="l00262"></a>00262 <span class="comment">/* 160 */</span> 250, 389, 500, 500, 500, 500, 275, 500, -<a name="l00263"></a>00263 <span class="comment">/* 168 */</span> 333, 760, 276, 500, 675, 333, 760, 333, -<a name="l00264"></a>00264 <span class="comment">/* 176 */</span> 400, 675, 300, 300, 333, 500, 523, 250, -<a name="l00265"></a>00265 <span class="comment">/* 184 */</span> 333, 300, 310, 500, 750, 750, 750, 500, -<a name="l00266"></a>00266 <span class="comment">/* 192 */</span> 611, 611, 611, 611, 611, 611, 889, 667, -<a name="l00267"></a>00267 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 333, 333, 333, 333, -<a name="l00268"></a>00268 <span class="comment">/* 208 */</span> 722, 667, 722, 722, 722, 722, 722, 675, -<a name="l00269"></a>00269 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 556, 611, 500, -<a name="l00270"></a>00270 <span class="comment">/* 224 */</span> 500, 500, 500, 500, 500, 500, 667, 444, -<a name="l00271"></a>00271 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 278, 278, 278, 278, -<a name="l00272"></a>00272 <span class="comment">/* 240 */</span> 500, 500, 500, 500, 500, 500, 500, 675, -<a name="l00273"></a>00273 <span class="comment">/* 248 */</span> 500, 500, 500, 500, 500, 444, 500, 444, -<a name="l00274"></a>00274 }, -<a name="l00275"></a>00275 { <span class="comment">/* Times-BoldItalic */</span> -<a name="l00276"></a>00276 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00277"></a>00277 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00278"></a>00278 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00279"></a>00279 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00280"></a>00280 <span class="comment">/* 32 */</span> 250, 389, 555, 500, 500, 833, 778, 333, -<a name="l00281"></a>00281 <span class="comment">/* 40 */</span> 333, 333, 500, 570, 250, 333, 250, 278, -<a name="l00282"></a>00282 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00283"></a>00283 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 570, 570, 570, 500, -<a name="l00284"></a>00284 <span class="comment">/* 64 */</span> 832, 667, 667, 667, 722, 667, 667, 722, -<a name="l00285"></a>00285 <span class="comment">/* 72 */</span> 778, 389, 500, 667, 611, 889, 722, 722, -<a name="l00286"></a>00286 <span class="comment">/* 80 */</span> 611, 722, 667, 556, 611, 722, 667, 889, -<a name="l00287"></a>00287 <span class="comment">/* 88 */</span> 667, 611, 611, 333, 278, 333, 570, 500, -<a name="l00288"></a>00288 <span class="comment">/* 96 */</span> 333, 500, 500, 444, 500, 444, 333, 500, -<a name="l00289"></a>00289 <span class="comment">/* 104 */</span> 556, 278, 278, 500, 278, 778, 556, 500, -<a name="l00290"></a>00290 <span class="comment">/* 112 */</span> 500, 500, 389, 389, 278, 556, 444, 667, -<a name="l00291"></a>00291 <span class="comment">/* 120 */</span> 500, 444, 389, 348, 220, 348, 570, 0, -<a name="l00292"></a>00292 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00293"></a>00293 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00294"></a>00294 <span class="comment">/* 144 */</span> 333, 333, 333, 333, 500, 500, 500, 500, -<a name="l00295"></a>00295 <span class="comment">/* 152 */</span> 1000, 606, 944, 722, 500, 500, 556, 556, -<a name="l00296"></a>00296 <span class="comment">/* 160 */</span> 250, 389, 500, 500, 500, 500, 220, 500, -<a name="l00297"></a>00297 <span class="comment">/* 168 */</span> 333, 747, 266, 500, 606, 333, 747, 333, -<a name="l00298"></a>00298 <span class="comment">/* 176 */</span> 400, 570, 300, 300, 333, 576, 500, 250, -<a name="l00299"></a>00299 <span class="comment">/* 184 */</span> 333, 300, 300, 500, 750, 750, 750, 500, -<a name="l00300"></a>00300 <span class="comment">/* 192 */</span> 667, 667, 667, 667, 667, 667, 944, 667, -<a name="l00301"></a>00301 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 389, 389, 389, 389, -<a name="l00302"></a>00302 <span class="comment">/* 208 */</span> 722, 722, 722, 722, 722, 722, 722, 570, -<a name="l00303"></a>00303 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 611, 611, 500, -<a name="l00304"></a>00304 <span class="comment">/* 224 */</span> 500, 500, 500, 500, 500, 500, 722, 444, -<a name="l00305"></a>00305 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 278, 278, 278, 278, -<a name="l00306"></a>00306 <span class="comment">/* 240 */</span> 500, 556, 500, 500, 500, 500, 500, 570, -<a name="l00307"></a>00307 <span class="comment">/* 248 */</span> 500, 556, 556, 556, 556, 444, 500, 444, -<a name="l00308"></a>00308 }, -<a name="l00309"></a>00309 { <span class="comment">/* Helvetica */</span> -<a name="l00310"></a>00310 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00311"></a>00311 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00312"></a>00312 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00313"></a>00313 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00314"></a>00314 <span class="comment">/* 32 */</span> 278, 278, 355, 556, 556, 889, 667, 221, -<a name="l00315"></a>00315 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l00316"></a>00316 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00317"></a>00317 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 584, 584, 584, 556, -<a name="l00318"></a>00318 <span class="comment">/* 64 */</span> 1015, 667, 667, 722, 722, 667, 611, 778, -<a name="l00319"></a>00319 <span class="comment">/* 72 */</span> 722, 278, 500, 667, 556, 833, 722, 778, -<a name="l00320"></a>00320 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l00321"></a>00321 <span class="comment">/* 88 */</span> 667, 667, 611, 278, 278, 278, 469, 556, -<a name="l00322"></a>00322 <span class="comment">/* 96 */</span> 222, 556, 556, 500, 556, 556, 278, 556, -<a name="l00323"></a>00323 <span class="comment">/* 104 */</span> 556, 222, 222, 500, 222, 833, 556, 556, -<a name="l00324"></a>00324 <span class="comment">/* 112 */</span> 556, 556, 333, 500, 278, 556, 500, 722, -<a name="l00325"></a>00325 <span class="comment">/* 120 */</span> 500, 500, 500, 334, 260, 334, 584, 0, -<a name="l00326"></a>00326 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00327"></a>00327 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00328"></a>00328 <span class="comment">/* 144 */</span> 222, 221, 333, 333, 333, 333, 333, 556, -<a name="l00329"></a>00329 <span class="comment">/* 152 */</span> 1000, 584, 1000, 944, 556, 556, 500, 500, -<a name="l00330"></a>00330 <span class="comment">/* 160 */</span> 278, 333, 556, 556, 556, 556, 260, 556, -<a name="l00331"></a>00331 <span class="comment">/* 168 */</span> 333, 737, 370, 556, 584, 333, 737, 333, -<a name="l00332"></a>00332 <span class="comment">/* 176 */</span> 606, 584, 351, 351, 333, 556, 537, 278, -<a name="l00333"></a>00333 <span class="comment">/* 184 */</span> 333, 351, 365, 556, 869, 869, 869, 611, -<a name="l00334"></a>00334 <span class="comment">/* 192 */</span> 667, 667, 667, 667, 667, 667, 1000, 722, -<a name="l00335"></a>00335 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 278, 278, 278, 278, -<a name="l00336"></a>00336 <span class="comment">/* 208 */</span> 722, 722, 778, 778, 778, 778, 778, 584, -<a name="l00337"></a>00337 <span class="comment">/* 216 */</span> 778, 722, 722, 722, 722, 666, 666, 611, -<a name="l00338"></a>00338 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 889, 500, -<a name="l00339"></a>00339 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 278, 278, 278, 278, -<a name="l00340"></a>00340 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 584, -<a name="l00341"></a>00341 <span class="comment">/* 248 */</span> 611, 556, 556, 556, 556, 500, 555, 500, -<a name="l00342"></a>00342 }, -<a name="l00343"></a>00343 { <span class="comment">/* Helvetica-Bold */</span> -<a name="l00344"></a>00344 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00345"></a>00345 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00346"></a>00346 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00347"></a>00347 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00348"></a>00348 <span class="comment">/* 32 */</span> 278, 333, 474, 556, 556, 889, 722, 278, -<a name="l00349"></a>00349 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l00350"></a>00350 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00351"></a>00351 <span class="comment">/* 56 */</span> 556, 556, 333, 333, 584, 584, 584, 611, -<a name="l00352"></a>00352 <span class="comment">/* 64 */</span> 975, 722, 722, 722, 722, 667, 611, 778, -<a name="l00353"></a>00353 <span class="comment">/* 72 */</span> 722, 278, 556, 722, 611, 833, 722, 778, -<a name="l00354"></a>00354 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l00355"></a>00355 <span class="comment">/* 88 */</span> 667, 667, 611, 333, 278, 333, 584, 556, -<a name="l00356"></a>00356 <span class="comment">/* 96 */</span> 278, 556, 611, 556, 611, 556, 333, 611, -<a name="l00357"></a>00357 <span class="comment">/* 104 */</span> 611, 278, 278, 556, 278, 889, 611, 611, -<a name="l00358"></a>00358 <span class="comment">/* 112 */</span> 611, 611, 389, 556, 333, 611, 556, 778, -<a name="l00359"></a>00359 <span class="comment">/* 120 */</span> 556, 556, 500, 389, 280, 389, 584, 0, -<a name="l00360"></a>00360 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00361"></a>00361 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00362"></a>00362 <span class="comment">/* 144 */</span> 278, 278, 333, 333, 500, 500, 500, 556, -<a name="l00363"></a>00363 <span class="comment">/* 152 */</span> 1000, 584, 1000, 944, 556, 556, 611, 611, -<a name="l00364"></a>00364 <span class="comment">/* 160 */</span> 278, 333, 556, 556, 556, 556, 280, 556, -<a name="l00365"></a>00365 <span class="comment">/* 168 */</span> 333, 737, 370, 556, 584, 333, 737, 333, -<a name="l00366"></a>00366 <span class="comment">/* 176 */</span> 606, 584, 351, 351, 333, 611, 556, 278, -<a name="l00367"></a>00367 <span class="comment">/* 184 */</span> 333, 351, 365, 556, 869, 869, 869, 611, -<a name="l00368"></a>00368 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 1000, 722, -<a name="l00369"></a>00369 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 278, 278, 278, 278, -<a name="l00370"></a>00370 <span class="comment">/* 208 */</span> 722, 722, 778, 778, 778, 778, 778, 584, -<a name="l00371"></a>00371 <span class="comment">/* 216 */</span> 778, 722, 722, 722, 722, 667, 667, 611, -<a name="l00372"></a>00372 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 889, 556, -<a name="l00373"></a>00373 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 278, 278, 278, 278, -<a name="l00374"></a>00374 <span class="comment">/* 240 */</span> 611, 611, 611, 611, 611, 611, 611, 584, -<a name="l00375"></a>00375 <span class="comment">/* 248 */</span> 611, 611, 611, 611, 611, 556, 611, 556, -<a name="l00376"></a>00376 }, -<a name="l00377"></a>00377 { <span class="comment">/* Helvetica-Oblique */</span> -<a name="l00378"></a>00378 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00379"></a>00379 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00380"></a>00380 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00381"></a>00381 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00382"></a>00382 <span class="comment">/* 32 */</span> 278, 278, 355, 556, 556, 889, 667, 222, -<a name="l00383"></a>00383 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l00384"></a>00384 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00385"></a>00385 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 584, 584, 584, 556, -<a name="l00386"></a>00386 <span class="comment">/* 64 */</span> 1015, 667, 667, 722, 722, 667, 611, 778, -<a name="l00387"></a>00387 <span class="comment">/* 72 */</span> 722, 278, 500, 667, 556, 833, 722, 778, -<a name="l00388"></a>00388 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l00389"></a>00389 <span class="comment">/* 88 */</span> 667, 667, 611, 278, 278, 278, 469, 556, -<a name="l00390"></a>00390 <span class="comment">/* 96 */</span> 222, 556, 556, 500, 556, 556, 278, 556, -<a name="l00391"></a>00391 <span class="comment">/* 104 */</span> 556, 222, 222, 500, 222, 833, 556, 556, -<a name="l00392"></a>00392 <span class="comment">/* 112 */</span> 556, 556, 333, 500, 278, 556, 500, 722, -<a name="l00393"></a>00393 <span class="comment">/* 120 */</span> 500, 500, 500, 334, 260, 334, 584, 0, -<a name="l00394"></a>00394 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00395"></a>00395 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00396"></a>00396 <span class="comment">/* 144 */</span> 222, 222, 333, 333, 333, 333, 333, 556, -<a name="l00397"></a>00397 <span class="comment">/* 152 */</span> 1000, 584, 1000, 944, 556, 556, 500, 500, -<a name="l00398"></a>00398 <span class="comment">/* 160 */</span> 278, 333, 556, 556, 556, 556, 260, 556, -<a name="l00399"></a>00399 <span class="comment">/* 168 */</span> 333, 737, 370, 556, 584, 333, 737, 333, -<a name="l00400"></a>00400 <span class="comment">/* 176 */</span> 606, 584, 390, 390, 333, 556, 537, 278, -<a name="l00401"></a>00401 <span class="comment">/* 184 */</span> 333, 390, 365, 556, 947, 947, 947, 611, -<a name="l00402"></a>00402 <span class="comment">/* 192 */</span> 667, 667, 667, 667, 667, 667, 1000, 722, -<a name="l00403"></a>00403 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 278, 278, 278, 278, -<a name="l00404"></a>00404 <span class="comment">/* 208 */</span> 722, 722, 778, 778, 778, 778, 778, 584, -<a name="l00405"></a>00405 <span class="comment">/* 216 */</span> 778, 722, 722, 722, 722, 667, 667, 611, -<a name="l00406"></a>00406 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 889, 500, -<a name="l00407"></a>00407 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 278, 278, 278, 278, -<a name="l00408"></a>00408 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 584, -<a name="l00409"></a>00409 <span class="comment">/* 248 */</span> 611, 556, 556, 556, 556, 500, 556, 500, -<a name="l00410"></a>00410 }, -<a name="l00411"></a>00411 { <span class="comment">/* Helvetica-BoldOblique */</span> -<a name="l00412"></a>00412 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00413"></a>00413 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00414"></a>00414 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00415"></a>00415 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00416"></a>00416 <span class="comment">/* 32 */</span> 278, 333, 474, 556, 556, 889, 722, 278, -<a name="l00417"></a>00417 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l00418"></a>00418 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00419"></a>00419 <span class="comment">/* 56 */</span> 556, 556, 333, 333, 584, 584, 584, 611, -<a name="l00420"></a>00420 <span class="comment">/* 64 */</span> 975, 722, 722, 722, 722, 667, 611, 778, -<a name="l00421"></a>00421 <span class="comment">/* 72 */</span> 722, 278, 556, 722, 611, 833, 722, 778, -<a name="l00422"></a>00422 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l00423"></a>00423 <span class="comment">/* 88 */</span> 667, 667, 611, 333, 278, 333, 584, 556, -<a name="l00424"></a>00424 <span class="comment">/* 96 */</span> 278, 556, 611, 556, 611, 556, 333, 611, -<a name="l00425"></a>00425 <span class="comment">/* 104 */</span> 611, 278, 278, 556, 278, 889, 611, 611, -<a name="l00426"></a>00426 <span class="comment">/* 112 */</span> 611, 611, 389, 556, 333, 611, 556, 778, -<a name="l00427"></a>00427 <span class="comment">/* 120 */</span> 556, 556, 500, 389, 280, 389, 584, 0, -<a name="l00428"></a>00428 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00429"></a>00429 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 350, -<a name="l00430"></a>00430 <span class="comment">/* 144 */</span> 278, 278, 333, 333, 500, 500, 500, 556, -<a name="l00431"></a>00431 <span class="comment">/* 152 */</span> 1000, 584, 1000, 944, 556, 556, 611, 611, -<a name="l00432"></a>00432 <span class="comment">/* 160 */</span> 278, 333, 556, 556, 556, 556, 280, 556, -<a name="l00433"></a>00433 <span class="comment">/* 168 */</span> 333, 737, 370, 556, 584, 333, 737, 333, -<a name="l00434"></a>00434 <span class="comment">/* 176 */</span> 606, 584, 444, 444, 333, 611, 556, 278, -<a name="l00435"></a>00435 <span class="comment">/* 184 */</span> 333, 444, 365, 556, 1055, 1055, 1055, 611, -<a name="l00436"></a>00436 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 1000, 722, -<a name="l00437"></a>00437 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 278, 278, 278, 278, -<a name="l00438"></a>00438 <span class="comment">/* 208 */</span> 722, 722, 778, 778, 778, 778, 778, 584, -<a name="l00439"></a>00439 <span class="comment">/* 216 */</span> 778, 722, 722, 722, 722, 667, 667, 611, -<a name="l00440"></a>00440 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 889, 556, -<a name="l00441"></a>00441 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 278, 278, 278, 278, -<a name="l00442"></a>00442 <span class="comment">/* 240 */</span> 611, 611, 611, 611, 611, 611, 611, 584, -<a name="l00443"></a>00443 <span class="comment">/* 248 */</span> 611, 611, 611, 611, 611, 556, 611, 556, -<a name="l00444"></a>00444 }, -<a name="l00445"></a>00445 { <span class="comment">/* Palatino-Roman */</span> -<a name="l00446"></a>00446 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00447"></a>00447 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00448"></a>00448 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00449"></a>00449 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00450"></a>00450 <span class="comment">/* 32 */</span> 250, 278, 371, 500, 500, 840, 778, 278, -<a name="l00451"></a>00451 <span class="comment">/* 40 */</span> 333, 333, 389, 606, 250, 333, 250, 606, -<a name="l00452"></a>00452 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00453"></a>00453 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l00454"></a>00454 <span class="comment">/* 64 */</span> 747, 778, 611, 709, 774, 611, 556, 763, -<a name="l00455"></a>00455 <span class="comment">/* 72 */</span> 832, 337, 333, 726, 611, 946, 831, 786, -<a name="l00456"></a>00456 <span class="comment">/* 80 */</span> 604, 786, 668, 525, 613, 778, 722, 1000, -<a name="l00457"></a>00457 <span class="comment">/* 88 */</span> 667, 667, 667, 333, 606, 333, 606, 500, -<a name="l00458"></a>00458 <span class="comment">/* 96 */</span> 278, 500, 553, 444, 611, 479, 333, 556, -<a name="l00459"></a>00459 <span class="comment">/* 104 */</span> 582, 291, 234, 556, 291, 883, 582, 546, -<a name="l00460"></a>00460 <span class="comment">/* 112 */</span> 601, 560, 395, 424, 326, 603, 565, 834, -<a name="l00461"></a>00461 <span class="comment">/* 120 */</span> 516, 556, 500, 333, 606, 333, 606, 0, -<a name="l00462"></a>00462 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00463"></a>00463 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 979, 1144, 606, -<a name="l00464"></a>00464 <span class="comment">/* 144 */</span> 278, 278, 331, 331, 500, 500, 500, 500, -<a name="l00465"></a>00465 <span class="comment">/* 152 */</span> 1000, 606, 998, 827, 500, 500, 605, 608, -<a name="l00466"></a>00466 <span class="comment">/* 160 */</span> 250, 278, 500, 500, 500, 500, 606, 500, -<a name="l00467"></a>00467 <span class="comment">/* 168 */</span> 333, 747, 333, 500, 606, 333, 747, 333, -<a name="l00468"></a>00468 <span class="comment">/* 176 */</span> 400, 606, 300, 300, 333, 603, 628, 250, -<a name="l00469"></a>00469 <span class="comment">/* 184 */</span> 333, 300, 333, 500, 750, 750, 750, 444, -<a name="l00470"></a>00470 <span class="comment">/* 192 */</span> 778, 778, 778, 778, 778, 778, 944, 709, -<a name="l00471"></a>00471 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 337, 337, 337, 337, -<a name="l00472"></a>00472 <span class="comment">/* 208 */</span> 774, 831, 786, 786, 786, 786, 786, 606, -<a name="l00473"></a>00473 <span class="comment">/* 216 */</span> 833, 778, 778, 778, 778, 667, 604, 556, -<a name="l00474"></a>00474 <span class="comment">/* 224 */</span> 500, 500, 500, 500, 500, 500, 758, 444, -<a name="l00475"></a>00475 <span class="comment">/* 232 */</span> 479, 479, 479, 479, 287, 287, 287, 287, -<a name="l00476"></a>00476 <span class="comment">/* 240 */</span> 546, 582, 546, 546, 546, 546, 546, 606, -<a name="l00477"></a>00477 <span class="comment">/* 248 */</span> 556, 603, 603, 603, 603, 556, 601, 556, -<a name="l00478"></a>00478 }, -<a name="l00479"></a>00479 { <span class="comment">/* Palatino-Bold */</span> -<a name="l00480"></a>00480 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00481"></a>00481 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00482"></a>00482 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00483"></a>00483 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00484"></a>00484 <span class="comment">/* 32 */</span> 250, 278, 402, 500, 500, 889, 833, 278, -<a name="l00485"></a>00485 <span class="comment">/* 40 */</span> 333, 333, 444, 606, 250, 333, 250, 296, -<a name="l00486"></a>00486 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00487"></a>00487 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l00488"></a>00488 <span class="comment">/* 64 */</span> 747, 778, 667, 722, 833, 611, 556, 833, -<a name="l00489"></a>00489 <span class="comment">/* 72 */</span> 833, 389, 389, 778, 611, 1000, 833, 833, -<a name="l00490"></a>00490 <span class="comment">/* 80 */</span> 611, 833, 722, 611, 667, 778, 778, 1000, -<a name="l00491"></a>00491 <span class="comment">/* 88 */</span> 667, 667, 667, 333, 606, 333, 606, 500, -<a name="l00492"></a>00492 <span class="comment">/* 96 */</span> 278, 500, 611, 444, 611, 500, 389, 556, -<a name="l00493"></a>00493 <span class="comment">/* 104 */</span> 611, 333, 333, 611, 333, 889, 611, 556, -<a name="l00494"></a>00494 <span class="comment">/* 112 */</span> 611, 611, 389, 444, 333, 611, 556, 833, -<a name="l00495"></a>00495 <span class="comment">/* 120 */</span> 500, 556, 500, 310, 606, 310, 606, 0, -<a name="l00496"></a>00496 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00497"></a>00497 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 998, 1000, 606, -<a name="l00498"></a>00498 <span class="comment">/* 144 */</span> 278, 278, 389, 389, 500, 500, 500, 500, -<a name="l00499"></a>00499 <span class="comment">/* 152 */</span> 1000, 606, 1000, 833, 500, 500, 611, 611, -<a name="l00500"></a>00500 <span class="comment">/* 160 */</span> 250, 278, 500, 500, 500, 500, 606, 500, -<a name="l00501"></a>00501 <span class="comment">/* 168 */</span> 333, 747, 438, 500, 606, 333, 747, 333, -<a name="l00502"></a>00502 <span class="comment">/* 176 */</span> 400, 606, 300, 300, 333, 611, 641, 250, -<a name="l00503"></a>00503 <span class="comment">/* 184 */</span> 333, 300, 488, 500, 750, 750, 750, 444, -<a name="l00504"></a>00504 <span class="comment">/* 192 */</span> 778, 778, 778, 778, 778, 778, 1000, 722, -<a name="l00505"></a>00505 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 389, 389, 389, 389, -<a name="l00506"></a>00506 <span class="comment">/* 208 */</span> 833, 833, 833, 833, 833, 833, 833, 606, -<a name="l00507"></a>00507 <span class="comment">/* 216 */</span> 833, 778, 778, 778, 778, 667, 611, 611, -<a name="l00508"></a>00508 <span class="comment">/* 224 */</span> 500, 500, 500, 500, 500, 500, 778, 444, -<a name="l00509"></a>00509 <span class="comment">/* 232 */</span> 500, 500, 500, 500, 333, 333, 333, 333, -<a name="l00510"></a>00510 <span class="comment">/* 240 */</span> 556, 611, 556, 556, 556, 556, 556, 606, -<a name="l00511"></a>00511 <span class="comment">/* 248 */</span> 556, 611, 611, 611, 611, 556, 611, 556, -<a name="l00512"></a>00512 }, -<a name="l00513"></a>00513 { <span class="comment">/* Palatino-Italic */</span> -<a name="l00514"></a>00514 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00515"></a>00515 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00516"></a>00516 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00517"></a>00517 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00518"></a>00518 <span class="comment">/* 32 */</span> 250, 333, 500, 500, 500, 889, 778, 278, -<a name="l00519"></a>00519 <span class="comment">/* 40 */</span> 333, 333, 389, 606, 250, 333, 250, 296, -<a name="l00520"></a>00520 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00521"></a>00521 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 500, -<a name="l00522"></a>00522 <span class="comment">/* 64 */</span> 747, 722, 611, 667, 778, 611, 556, 722, -<a name="l00523"></a>00523 <span class="comment">/* 72 */</span> 778, 333, 333, 667, 556, 944, 778, 778, -<a name="l00524"></a>00524 <span class="comment">/* 80 */</span> 611, 778, 667, 556, 611, 778, 722, 944, -<a name="l00525"></a>00525 <span class="comment">/* 88 */</span> 722, 667, 667, 333, 606, 333, 606, 500, -<a name="l00526"></a>00526 <span class="comment">/* 96 */</span> 278, 444, 463, 407, 500, 389, 278, 500, -<a name="l00527"></a>00527 <span class="comment">/* 104 */</span> 500, 278, 278, 444, 278, 778, 556, 444, -<a name="l00528"></a>00528 <span class="comment">/* 112 */</span> 500, 463, 389, 389, 333, 556, 500, 722, -<a name="l00529"></a>00529 <span class="comment">/* 120 */</span> 500, 500, 444, 333, 606, 333, 606, 0, -<a name="l00530"></a>00530 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00531"></a>00531 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 500, -<a name="l00532"></a>00532 <span class="comment">/* 144 */</span> 278, 278, 333, 333, 500, 500, 500, 500, -<a name="l00533"></a>00533 <span class="comment">/* 152 */</span> 1000, 606, 1028, 669, 500, 500, 528, 545, -<a name="l00534"></a>00534 <span class="comment">/* 160 */</span> 250, 333, 500, 500, 500, 500, 606, 500, -<a name="l00535"></a>00535 <span class="comment">/* 168 */</span> 333, 747, 333, 500, 606, 333, 747, 333, -<a name="l00536"></a>00536 <span class="comment">/* 176 */</span> 400, 606, 300, 300, 333, 556, 500, 250, -<a name="l00537"></a>00537 <span class="comment">/* 184 */</span> 333, 300, 333, 500, 750, 750, 750, 500, -<a name="l00538"></a>00538 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 941, 667, -<a name="l00539"></a>00539 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 333, 333, 333, 333, -<a name="l00540"></a>00540 <span class="comment">/* 208 */</span> 778, 778, 778, 778, 778, 778, 778, 606, -<a name="l00541"></a>00541 <span class="comment">/* 216 */</span> 778, 778, 778, 778, 778, 667, 611, 500, -<a name="l00542"></a>00542 <span class="comment">/* 224 */</span> 444, 444, 444, 444, 444, 444, 638, 407, -<a name="l00543"></a>00543 <span class="comment">/* 232 */</span> 389, 389, 389, 389, 278, 278, 278, 278, -<a name="l00544"></a>00544 <span class="comment">/* 240 */</span> 444, 556, 444, 444, 444, 444, 444, 606, -<a name="l00545"></a>00545 <span class="comment">/* 248 */</span> 444, 556, 556, 556, 556, 500, 500, 500, -<a name="l00546"></a>00546 }, -<a name="l00547"></a>00547 { <span class="comment">/* Palatino-BoldItalic */</span> -<a name="l00548"></a>00548 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00549"></a>00549 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00550"></a>00550 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00551"></a>00551 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00552"></a>00552 <span class="comment">/* 32 */</span> 250, 333, 500, 500, 500, 889, 833, 278, -<a name="l00553"></a>00553 <span class="comment">/* 40 */</span> 333, 333, 444, 606, 250, 389, 250, 315, -<a name="l00554"></a>00554 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l00555"></a>00555 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l00556"></a>00556 <span class="comment">/* 64 */</span> 833, 722, 667, 685, 778, 611, 556, 778, -<a name="l00557"></a>00557 <span class="comment">/* 72 */</span> 778, 389, 389, 722, 611, 944, 778, 833, -<a name="l00558"></a>00558 <span class="comment">/* 80 */</span> 667, 833, 722, 556, 611, 778, 667, 1000, -<a name="l00559"></a>00559 <span class="comment">/* 88 */</span> 722, 611, 667, 333, 606, 333, 606, 500, -<a name="l00560"></a>00560 <span class="comment">/* 96 */</span> 278, 556, 537, 444, 556, 444, 333, 500, -<a name="l00561"></a>00561 <span class="comment">/* 104 */</span> 556, 333, 333, 556, 333, 833, 556, 556, -<a name="l00562"></a>00562 <span class="comment">/* 112 */</span> 556, 537, 389, 444, 389, 556, 556, 833, -<a name="l00563"></a>00563 <span class="comment">/* 120 */</span> 500, 556, 500, 333, 606, 333, 606, 0, -<a name="l00564"></a>00564 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00565"></a>00565 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 606, -<a name="l00566"></a>00566 <span class="comment">/* 144 */</span> 278, 278, 333, 333, 500, 500, 500, 500, -<a name="l00567"></a>00567 <span class="comment">/* 152 */</span> 1000, 606, 944, 778, 556, 556, 611, 611, -<a name="l00568"></a>00568 <span class="comment">/* 160 */</span> 250, 333, 500, 500, 500, 500, 606, 556, -<a name="l00569"></a>00569 <span class="comment">/* 168 */</span> 333, 747, 333, 500, 606, 389, 747, 333, -<a name="l00570"></a>00570 <span class="comment">/* 176 */</span> 400, 606, 300, 300, 333, 556, 556, 250, -<a name="l00571"></a>00571 <span class="comment">/* 184 */</span> 333, 300, 333, 500, 750, 750, 750, 444, -<a name="l00572"></a>00572 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 944, 685, -<a name="l00573"></a>00573 <span class="comment">/* 200 */</span> 611, 611, 611, 611, 389, 389, 389, 389, -<a name="l00574"></a>00574 <span class="comment">/* 208 */</span> 778, 778, 833, 833, 833, 833, 833, 606, -<a name="l00575"></a>00575 <span class="comment">/* 216 */</span> 833, 778, 778, 778, 778, 611, 667, 556, -<a name="l00576"></a>00576 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 738, 444, -<a name="l00577"></a>00577 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 333, 333, 333, 333, -<a name="l00578"></a>00578 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 606, -<a name="l00579"></a>00579 <span class="comment">/* 248 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00580"></a>00580 }, -<a name="l00581"></a>00581 { <span class="comment">/* Helvetica-Narrow */</span> -<a name="l00582"></a>00582 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00583"></a>00583 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00584"></a>00584 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00585"></a>00585 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00586"></a>00586 <span class="comment">/* 32 */</span> 228, 228, 291, 456, 456, 729, 547, 182, -<a name="l00587"></a>00587 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l00588"></a>00588 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l00589"></a>00589 <span class="comment">/* 56 */</span> 456, 456, 228, 228, 479, 479, 479, 456, -<a name="l00590"></a>00590 <span class="comment">/* 64 */</span> 832, 547, 547, 592, 592, 547, 501, 638, -<a name="l00591"></a>00591 <span class="comment">/* 72 */</span> 592, 228, 410, 547, 456, 683, 592, 638, -<a name="l00592"></a>00592 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l00593"></a>00593 <span class="comment">/* 88 */</span> 547, 547, 501, 228, 228, 228, 385, 456, -<a name="l00594"></a>00594 <span class="comment">/* 96 */</span> 182, 456, 456, 410, 456, 456, 228, 456, -<a name="l00595"></a>00595 <span class="comment">/* 104 */</span> 456, 182, 182, 410, 182, 683, 456, 456, -<a name="l00596"></a>00596 <span class="comment">/* 112 */</span> 456, 456, 273, 410, 228, 456, 410, 592, -<a name="l00597"></a>00597 <span class="comment">/* 120 */</span> 410, 410, 410, 274, 213, 274, 479, 0, -<a name="l00598"></a>00598 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00599"></a>00599 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 820, 820, 820, 287, -<a name="l00600"></a>00600 <span class="comment">/* 144 */</span> 182, 182, 273, 273, 273, 273, 273, 456, -<a name="l00601"></a>00601 <span class="comment">/* 152 */</span> 820, 479, 820, 774, 456, 456, 410, 410, -<a name="l00602"></a>00602 <span class="comment">/* 160 */</span> 228, 273, 456, 456, 456, 456, 213, 456, -<a name="l00603"></a>00603 <span class="comment">/* 168 */</span> 273, 604, 303, 456, 479, 273, 604, 273, -<a name="l00604"></a>00604 <span class="comment">/* 176 */</span> 328, 479, 273, 273, 273, 456, 440, 228, -<a name="l00605"></a>00605 <span class="comment">/* 184 */</span> 273, 273, 299, 456, 684, 684, 684, 501, -<a name="l00606"></a>00606 <span class="comment">/* 192 */</span> 547, 547, 547, 547, 547, 547, 820, 592, -<a name="l00607"></a>00607 <span class="comment">/* 200 */</span> 547, 547, 547, 547, 228, 228, 228, 228, -<a name="l00608"></a>00608 <span class="comment">/* 208 */</span> 592, 592, 638, 638, 638, 638, 638, 479, -<a name="l00609"></a>00609 <span class="comment">/* 216 */</span> 638, 592, 592, 592, 592, 547, 547, 501, -<a name="l00610"></a>00610 <span class="comment">/* 224 */</span> 456, 456, 456, 456, 456, 456, 729, 410, -<a name="l00611"></a>00611 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 228, 228, 228, 228, -<a name="l00612"></a>00612 <span class="comment">/* 240 */</span> 456, 456, 456, 456, 456, 456, 456, 479, -<a name="l00613"></a>00613 <span class="comment">/* 248 */</span> 501, 456, 456, 456, 456, 410, 456, 410, -<a name="l00614"></a>00614 }, -<a name="l00615"></a>00615 { <span class="comment">/* Helvetica-Narrow-Bold */</span> -<a name="l00616"></a>00616 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00617"></a>00617 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00618"></a>00618 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00619"></a>00619 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00620"></a>00620 <span class="comment">/* 32 */</span> 228, 273, 389, 456, 456, 729, 592, 228, -<a name="l00621"></a>00621 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l00622"></a>00622 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l00623"></a>00623 <span class="comment">/* 56 */</span> 456, 456, 273, 273, 479, 479, 479, 501, -<a name="l00624"></a>00624 <span class="comment">/* 64 */</span> 800, 592, 592, 592, 592, 547, 501, 638, -<a name="l00625"></a>00625 <span class="comment">/* 72 */</span> 592, 228, 456, 592, 501, 683, 592, 638, -<a name="l00626"></a>00626 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l00627"></a>00627 <span class="comment">/* 88 */</span> 547, 547, 501, 273, 228, 273, 479, 456, -<a name="l00628"></a>00628 <span class="comment">/* 96 */</span> 228, 456, 501, 456, 501, 456, 273, 501, -<a name="l00629"></a>00629 <span class="comment">/* 104 */</span> 501, 228, 228, 456, 228, 729, 501, 501, -<a name="l00630"></a>00630 <span class="comment">/* 112 */</span> 501, 501, 319, 456, 273, 501, 456, 638, -<a name="l00631"></a>00631 <span class="comment">/* 120 */</span> 456, 456, 410, 319, 230, 319, 479, 0, -<a name="l00632"></a>00632 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00633"></a>00633 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 820, 820, 820, 287, -<a name="l00634"></a>00634 <span class="comment">/* 144 */</span> 228, 228, 273, 273, 410, 410, 410, 456, -<a name="l00635"></a>00635 <span class="comment">/* 152 */</span> 820, 479, 820, 774, 456, 456, 501, 501, -<a name="l00636"></a>00636 <span class="comment">/* 160 */</span> 228, 273, 456, 456, 456, 456, 230, 456, -<a name="l00637"></a>00637 <span class="comment">/* 168 */</span> 273, 604, 303, 456, 479, 273, 604, 273, -<a name="l00638"></a>00638 <span class="comment">/* 176 */</span> 328, 479, 273, 273, 273, 501, 456, 228, -<a name="l00639"></a>00639 <span class="comment">/* 184 */</span> 273, 273, 299, 456, 684, 684, 684, 501, -<a name="l00640"></a>00640 <span class="comment">/* 192 */</span> 592, 592, 592, 592, 592, 592, 820, 592, -<a name="l00641"></a>00641 <span class="comment">/* 200 */</span> 547, 547, 547, 547, 228, 228, 228, 228, -<a name="l00642"></a>00642 <span class="comment">/* 208 */</span> 592, 592, 638, 638, 638, 638, 638, 479, -<a name="l00643"></a>00643 <span class="comment">/* 216 */</span> 638, 592, 592, 592, 592, 547, 547, 501, -<a name="l00644"></a>00644 <span class="comment">/* 224 */</span> 456, 456, 456, 456, 456, 456, 729, 456, -<a name="l00645"></a>00645 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 228, 228, 228, 228, -<a name="l00646"></a>00646 <span class="comment">/* 240 */</span> 501, 501, 501, 501, 501, 501, 501, 479, -<a name="l00647"></a>00647 <span class="comment">/* 248 */</span> 501, 501, 501, 501, 501, 456, 501, 456, -<a name="l00648"></a>00648 }, -<a name="l00649"></a>00649 { <span class="comment">/* Helvetica-Narrow-Oblique */</span> -<a name="l00650"></a>00650 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00651"></a>00651 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00652"></a>00652 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00653"></a>00653 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00654"></a>00654 <span class="comment">/* 32 */</span> 228, 228, 291, 456, 456, 729, 547, 182, -<a name="l00655"></a>00655 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l00656"></a>00656 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l00657"></a>00657 <span class="comment">/* 56 */</span> 456, 456, 228, 228, 479, 479, 479, 456, -<a name="l00658"></a>00658 <span class="comment">/* 64 */</span> 832, 547, 547, 592, 592, 547, 501, 638, -<a name="l00659"></a>00659 <span class="comment">/* 72 */</span> 592, 228, 410, 547, 456, 683, 592, 638, -<a name="l00660"></a>00660 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l00661"></a>00661 <span class="comment">/* 88 */</span> 547, 547, 501, 228, 228, 228, 385, 456, -<a name="l00662"></a>00662 <span class="comment">/* 96 */</span> 182, 456, 456, 410, 456, 456, 228, 456, -<a name="l00663"></a>00663 <span class="comment">/* 104 */</span> 456, 182, 182, 410, 182, 683, 456, 456, -<a name="l00664"></a>00664 <span class="comment">/* 112 */</span> 456, 456, 273, 410, 228, 456, 410, 592, -<a name="l00665"></a>00665 <span class="comment">/* 120 */</span> 410, 410, 410, 274, 213, 274, 479, 0, -<a name="l00666"></a>00666 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00667"></a>00667 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 820, 820, 820, 287, -<a name="l00668"></a>00668 <span class="comment">/* 144 */</span> 182, 182, 273, 273, 273, 273, 273, 456, -<a name="l00669"></a>00669 <span class="comment">/* 152 */</span> 820, 479, 820, 774, 456, 456, 410, 410, -<a name="l00670"></a>00670 <span class="comment">/* 160 */</span> 228, 273, 456, 456, 456, 456, 213, 456, -<a name="l00671"></a>00671 <span class="comment">/* 168 */</span> 273, 604, 303, 456, 479, 273, 604, 273, -<a name="l00672"></a>00672 <span class="comment">/* 176 */</span> 328, 479, 273, 273, 273, 456, 440, 228, -<a name="l00673"></a>00673 <span class="comment">/* 184 */</span> 273, 273, 299, 456, 684, 684, 684, 501, -<a name="l00674"></a>00674 <span class="comment">/* 192 */</span> 547, 547, 547, 547, 547, 547, 820, 592, -<a name="l00675"></a>00675 <span class="comment">/* 200 */</span> 547, 547, 547, 547, 228, 228, 228, 228, -<a name="l00676"></a>00676 <span class="comment">/* 208 */</span> 592, 592, 638, 638, 638, 638, 638, 479, -<a name="l00677"></a>00677 <span class="comment">/* 216 */</span> 638, 592, 592, 592, 592, 547, 547, 501, -<a name="l00678"></a>00678 <span class="comment">/* 224 */</span> 456, 456, 456, 456, 456, 456, 729, 410, -<a name="l00679"></a>00679 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 228, 228, 228, 228, -<a name="l00680"></a>00680 <span class="comment">/* 240 */</span> 456, 456, 456, 456, 456, 456, 456, 479, -<a name="l00681"></a>00681 <span class="comment">/* 248 */</span> 501, 456, 456, 456, 456, 410, 456, 410, -<a name="l00682"></a>00682 }, -<a name="l00683"></a>00683 { <span class="comment">/* Helvetica-Narrow-BoldOblique */</span> -<a name="l00684"></a>00684 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00685"></a>00685 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00686"></a>00686 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00687"></a>00687 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00688"></a>00688 <span class="comment">/* 32 */</span> 228, 273, 389, 456, 456, 729, 592, 228, -<a name="l00689"></a>00689 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l00690"></a>00690 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l00691"></a>00691 <span class="comment">/* 56 */</span> 456, 456, 273, 273, 479, 479, 479, 501, -<a name="l00692"></a>00692 <span class="comment">/* 64 */</span> 800, 592, 592, 592, 592, 547, 501, 638, -<a name="l00693"></a>00693 <span class="comment">/* 72 */</span> 592, 228, 456, 592, 501, 683, 592, 638, -<a name="l00694"></a>00694 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l00695"></a>00695 <span class="comment">/* 88 */</span> 547, 547, 501, 273, 228, 273, 479, 456, -<a name="l00696"></a>00696 <span class="comment">/* 96 */</span> 228, 456, 501, 456, 501, 456, 273, 501, -<a name="l00697"></a>00697 <span class="comment">/* 104 */</span> 501, 228, 228, 456, 228, 729, 501, 501, -<a name="l00698"></a>00698 <span class="comment">/* 112 */</span> 501, 501, 319, 456, 273, 501, 456, 638, -<a name="l00699"></a>00699 <span class="comment">/* 120 */</span> 456, 456, 410, 319, 230, 319, 479, 0, -<a name="l00700"></a>00700 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00701"></a>00701 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 820, 820, 820, 287, -<a name="l00702"></a>00702 <span class="comment">/* 144 */</span> 228, 228, 273, 273, 410, 410, 410, 456, -<a name="l00703"></a>00703 <span class="comment">/* 152 */</span> 820, 479, 820, 774, 456, 456, 501, 501, -<a name="l00704"></a>00704 <span class="comment">/* 160 */</span> 228, 273, 456, 456, 456, 456, 230, 456, -<a name="l00705"></a>00705 <span class="comment">/* 168 */</span> 273, 604, 303, 456, 479, 273, 604, 273, -<a name="l00706"></a>00706 <span class="comment">/* 176 */</span> 328, 479, 273, 273, 273, 501, 456, 228, -<a name="l00707"></a>00707 <span class="comment">/* 184 */</span> 273, 273, 299, 456, 684, 684, 684, 501, -<a name="l00708"></a>00708 <span class="comment">/* 192 */</span> 592, 592, 592, 592, 592, 592, 820, 592, -<a name="l00709"></a>00709 <span class="comment">/* 200 */</span> 547, 547, 547, 547, 228, 228, 228, 228, -<a name="l00710"></a>00710 <span class="comment">/* 208 */</span> 592, 592, 638, 638, 638, 638, 638, 479, -<a name="l00711"></a>00711 <span class="comment">/* 216 */</span> 638, 592, 592, 592, 592, 547, 547, 501, -<a name="l00712"></a>00712 <span class="comment">/* 224 */</span> 456, 456, 456, 456, 456, 456, 729, 456, -<a name="l00713"></a>00713 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 228, 228, 228, 228, -<a name="l00714"></a>00714 <span class="comment">/* 240 */</span> 501, 501, 501, 501, 501, 501, 501, 479, -<a name="l00715"></a>00715 <span class="comment">/* 248 */</span> 501, 501, 501, 501, 501, 456, 501, 456, -<a name="l00716"></a>00716 }, -<a name="l00717"></a>00717 { <span class="comment">/* Bookman-Light */</span> -<a name="l00718"></a>00718 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00719"></a>00719 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00720"></a>00720 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00721"></a>00721 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00722"></a>00722 <span class="comment">/* 32 */</span> 320, 300, 380, 620, 620, 900, 800, 220, -<a name="l00723"></a>00723 <span class="comment">/* 40 */</span> 300, 300, 440, 600, 320, 400, 320, 600, -<a name="l00724"></a>00724 <span class="comment">/* 48 */</span> 620, 620, 620, 620, 620, 620, 620, 620, -<a name="l00725"></a>00725 <span class="comment">/* 56 */</span> 620, 620, 320, 320, 600, 600, 600, 540, -<a name="l00726"></a>00726 <span class="comment">/* 64 */</span> 820, 680, 740, 740, 800, 720, 640, 800, -<a name="l00727"></a>00727 <span class="comment">/* 72 */</span> 800, 340, 600, 720, 600, 920, 740, 800, -<a name="l00728"></a>00728 <span class="comment">/* 80 */</span> 620, 820, 720, 660, 620, 780, 700, 960, -<a name="l00729"></a>00729 <span class="comment">/* 88 */</span> 720, 640, 640, 300, 600, 300, 600, 500, -<a name="l00730"></a>00730 <span class="comment">/* 96 */</span> 220, 580, 620, 520, 620, 520, 320, 540, -<a name="l00731"></a>00731 <span class="comment">/* 104 */</span> 660, 300, 300, 620, 300, 940, 660, 560, -<a name="l00732"></a>00732 <span class="comment">/* 112 */</span> 620, 580, 440, 520, 380, 680, 520, 780, -<a name="l00733"></a>00733 <span class="comment">/* 120 */</span> 560, 540, 480, 280, 600, 280, 600, 0, -<a name="l00734"></a>00734 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00735"></a>00735 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 980, 1280, 460, -<a name="l00736"></a>00736 <span class="comment">/* 144 */</span> 220, 220, 240, 240, 400, 400, 400, 500, -<a name="l00737"></a>00737 <span class="comment">/* 152 */</span> 1000, 600, 1240, 900, 540, 540, 620, 620, -<a name="l00738"></a>00738 <span class="comment">/* 160 */</span> 320, 300, 620, 620, 620, 620, 600, 520, -<a name="l00739"></a>00739 <span class="comment">/* 168 */</span> 420, 740, 420, 360, 600, 400, 740, 440, -<a name="l00740"></a>00740 <span class="comment">/* 176 */</span> 400, 600, 372, 372, 340, 680, 600, 320, -<a name="l00741"></a>00741 <span class="comment">/* 184 */</span> 320, 372, 420, 360, 930, 930, 930, 540, -<a name="l00742"></a>00742 <span class="comment">/* 192 */</span> 680, 680, 680, 680, 680, 680, 1260, 740, -<a name="l00743"></a>00743 <span class="comment">/* 200 */</span> 720, 720, 720, 720, 340, 340, 340, 340, -<a name="l00744"></a>00744 <span class="comment">/* 208 */</span> 800, 740, 800, 800, 800, 800, 800, 600, -<a name="l00745"></a>00745 <span class="comment">/* 216 */</span> 800, 780, 780, 780, 780, 640, 620, 660, -<a name="l00746"></a>00746 <span class="comment">/* 224 */</span> 580, 580, 580, 580, 580, 580, 860, 520, -<a name="l00747"></a>00747 <span class="comment">/* 232 */</span> 520, 520, 520, 520, 300, 300, 300, 300, -<a name="l00748"></a>00748 <span class="comment">/* 240 */</span> 560, 660, 560, 560, 560, 560, 560, 600, -<a name="l00749"></a>00749 <span class="comment">/* 248 */</span> 560, 680, 680, 680, 680, 540, 620, 540, -<a name="l00750"></a>00750 }, -<a name="l00751"></a>00751 { <span class="comment">/* Bookman-Demi */</span> -<a name="l00752"></a>00752 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00753"></a>00753 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00754"></a>00754 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00755"></a>00755 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00756"></a>00756 <span class="comment">/* 32 */</span> 340, 360, 420, 660, 660, 940, 800, 320, -<a name="l00757"></a>00757 <span class="comment">/* 40 */</span> 320, 320, 460, 600, 340, 360, 340, 600, -<a name="l00758"></a>00758 <span class="comment">/* 48 */</span> 660, 660, 660, 660, 660, 660, 660, 660, -<a name="l00759"></a>00759 <span class="comment">/* 56 */</span> 660, 660, 340, 340, 600, 600, 600, 660, -<a name="l00760"></a>00760 <span class="comment">/* 64 */</span> 820, 720, 720, 740, 780, 720, 680, 780, -<a name="l00761"></a>00761 <span class="comment">/* 72 */</span> 820, 400, 640, 800, 640, 940, 740, 800, -<a name="l00762"></a>00762 <span class="comment">/* 80 */</span> 660, 800, 780, 660, 700, 740, 720, 940, -<a name="l00763"></a>00763 <span class="comment">/* 88 */</span> 780, 700, 640, 300, 600, 300, 600, 500, -<a name="l00764"></a>00764 <span class="comment">/* 96 */</span> 320, 580, 600, 580, 640, 580, 380, 580, -<a name="l00765"></a>00765 <span class="comment">/* 104 */</span> 680, 360, 340, 660, 340, 1000, 680, 620, -<a name="l00766"></a>00766 <span class="comment">/* 112 */</span> 640, 620, 460, 520, 460, 660, 600, 800, -<a name="l00767"></a>00767 <span class="comment">/* 120 */</span> 600, 620, 560, 320, 600, 320, 600, 0, -<a name="l00768"></a>00768 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00769"></a>00769 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 980, 1360, 460, -<a name="l00770"></a>00770 <span class="comment">/* 144 */</span> 320, 320, 220, 220, 540, 540, 540, 500, -<a name="l00771"></a>00771 <span class="comment">/* 152 */</span> 1000, 600, 1220, 940, 440, 380, 740, 740, -<a name="l00772"></a>00772 <span class="comment">/* 160 */</span> 340, 360, 660, 660, 660, 660, 600, 600, -<a name="l00773"></a>00773 <span class="comment">/* 168 */</span> 500, 740, 400, 400, 600, 360, 740, 460, -<a name="l00774"></a>00774 <span class="comment">/* 176 */</span> 400, 600, 396, 396, 400, 660, 800, 340, -<a name="l00775"></a>00775 <span class="comment">/* 184 */</span> 360, 396, 400, 400, 990, 990, 990, 660, -<a name="l00776"></a>00776 <span class="comment">/* 192 */</span> 720, 720, 720, 720, 720, 720, 1140, 740, -<a name="l00777"></a>00777 <span class="comment">/* 200 */</span> 720, 720, 720, 720, 400, 400, 400, 400, -<a name="l00778"></a>00778 <span class="comment">/* 208 */</span> 780, 740, 800, 800, 800, 800, 800, 600, -<a name="l00779"></a>00779 <span class="comment">/* 216 */</span> 800, 740, 740, 740, 740, 700, 660, 660, -<a name="l00780"></a>00780 <span class="comment">/* 224 */</span> 580, 580, 580, 580, 580, 580, 880, 580, -<a name="l00781"></a>00781 <span class="comment">/* 232 */</span> 580, 580, 580, 580, 360, 360, 360, 360, -<a name="l00782"></a>00782 <span class="comment">/* 240 */</span> 620, 680, 620, 620, 620, 620, 620, 600, -<a name="l00783"></a>00783 <span class="comment">/* 248 */</span> 620, 660, 660, 660, 660, 620, 640, 620, -<a name="l00784"></a>00784 }, -<a name="l00785"></a>00785 { <span class="comment">/* Bookman-LightItalic */</span> -<a name="l00786"></a>00786 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00787"></a>00787 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00788"></a>00788 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00789"></a>00789 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00790"></a>00790 <span class="comment">/* 32 */</span> 300, 320, 360, 620, 620, 800, 820, 280, -<a name="l00791"></a>00791 <span class="comment">/* 40 */</span> 280, 280, 440, 600, 300, 320, 300, 600, -<a name="l00792"></a>00792 <span class="comment">/* 48 */</span> 620, 620, 620, 620, 620, 620, 620, 620, -<a name="l00793"></a>00793 <span class="comment">/* 56 */</span> 620, 620, 300, 300, 600, 600, 600, 540, -<a name="l00794"></a>00794 <span class="comment">/* 64 */</span> 780, 700, 720, 720, 740, 680, 620, 760, -<a name="l00795"></a>00795 <span class="comment">/* 72 */</span> 800, 320, 560, 720, 580, 860, 720, 760, -<a name="l00796"></a>00796 <span class="comment">/* 80 */</span> 600, 780, 700, 640, 600, 720, 680, 960, -<a name="l00797"></a>00797 <span class="comment">/* 88 */</span> 700, 660, 580, 260, 600, 260, 600, 500, -<a name="l00798"></a>00798 <span class="comment">/* 96 */</span> 280, 620, 600, 480, 640, 540, 340, 560, -<a name="l00799"></a>00799 <span class="comment">/* 104 */</span> 620, 280, 280, 600, 280, 880, 620, 540, -<a name="l00800"></a>00800 <span class="comment">/* 112 */</span> 600, 560, 400, 540, 340, 620, 540, 880, -<a name="l00801"></a>00801 <span class="comment">/* 120 */</span> 540, 600, 520, 360, 600, 380, 600, 0, -<a name="l00802"></a>00802 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00803"></a>00803 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 980, 1180, 460, -<a name="l00804"></a>00804 <span class="comment">/* 144 */</span> 280, 280, 180, 180, 440, 440, 480, 500, -<a name="l00805"></a>00805 <span class="comment">/* 152 */</span> 1000, 600, 1180, 900, 620, 620, 640, 660, -<a name="l00806"></a>00806 <span class="comment">/* 160 */</span> 300, 320, 620, 620, 620, 620, 600, 620, -<a name="l00807"></a>00807 <span class="comment">/* 168 */</span> 420, 740, 440, 300, 600, 320, 740, 440, -<a name="l00808"></a>00808 <span class="comment">/* 176 */</span> 400, 600, 372, 372, 320, 620, 620, 300, -<a name="l00809"></a>00809 <span class="comment">/* 184 */</span> 320, 372, 400, 300, 930, 930, 930, 540, -<a name="l00810"></a>00810 <span class="comment">/* 192 */</span> 700, 700, 700, 700, 700, 700, 1220, 720, -<a name="l00811"></a>00811 <span class="comment">/* 200 */</span> 680, 680, 680, 680, 320, 320, 320, 320, -<a name="l00812"></a>00812 <span class="comment">/* 208 */</span> 740, 720, 760, 760, 760, 760, 760, 600, -<a name="l00813"></a>00813 <span class="comment">/* 216 */</span> 760, 720, 720, 720, 720, 660, 600, 620, -<a name="l00814"></a>00814 <span class="comment">/* 224 */</span> 620, 620, 620, 620, 620, 620, 880, 480, -<a name="l00815"></a>00815 <span class="comment">/* 232 */</span> 540, 540, 540, 540, 280, 280, 280, 280, -<a name="l00816"></a>00816 <span class="comment">/* 240 */</span> 540, 620, 540, 540, 540, 540, 540, 600, -<a name="l00817"></a>00817 <span class="comment">/* 248 */</span> 540, 620, 620, 620, 620, 600, 600, 600, -<a name="l00818"></a>00818 }, -<a name="l00819"></a>00819 { <span class="comment">/* Bookman-DemiItalic */</span> -<a name="l00820"></a>00820 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00821"></a>00821 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00822"></a>00822 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00823"></a>00823 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00824"></a>00824 <span class="comment">/* 32 */</span> 340, 320, 380, 680, 680, 880, 980, 320, -<a name="l00825"></a>00825 <span class="comment">/* 40 */</span> 260, 260, 460, 600, 340, 280, 340, 360, -<a name="l00826"></a>00826 <span class="comment">/* 48 */</span> 680, 680, 680, 680, 680, 680, 680, 680, -<a name="l00827"></a>00827 <span class="comment">/* 56 */</span> 680, 680, 340, 340, 620, 600, 620, 620, -<a name="l00828"></a>00828 <span class="comment">/* 64 */</span> 780, 720, 720, 700, 760, 720, 660, 760, -<a name="l00829"></a>00829 <span class="comment">/* 72 */</span> 800, 380, 620, 780, 640, 860, 740, 760, -<a name="l00830"></a>00830 <span class="comment">/* 80 */</span> 640, 760, 740, 700, 700, 740, 660, 1000, -<a name="l00831"></a>00831 <span class="comment">/* 88 */</span> 740, 660, 680, 260, 580, 260, 620, 500, -<a name="l00832"></a>00832 <span class="comment">/* 96 */</span> 320, 680, 600, 560, 680, 560, 420, 620, -<a name="l00833"></a>00833 <span class="comment">/* 104 */</span> 700, 380, 320, 700, 380, 960, 680, 600, -<a name="l00834"></a>00834 <span class="comment">/* 112 */</span> 660, 620, 500, 540, 440, 680, 540, 860, -<a name="l00835"></a>00835 <span class="comment">/* 120 */</span> 620, 600, 560, 300, 620, 300, 620, 0, -<a name="l00836"></a>00836 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00837"></a>00837 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 940, 1360, 360, -<a name="l00838"></a>00838 <span class="comment">/* 144 */</span> 320, 320, 220, 220, 520, 520, 520, 500, -<a name="l00839"></a>00839 <span class="comment">/* 152 */</span> 1000, 600, 1180, 920, 420, 420, 820, 820, -<a name="l00840"></a>00840 <span class="comment">/* 160 */</span> 340, 320, 680, 680, 680, 680, 620, 620, -<a name="l00841"></a>00841 <span class="comment">/* 168 */</span> 520, 780, 440, 380, 620, 280, 780, 480, -<a name="l00842"></a>00842 <span class="comment">/* 176 */</span> 400, 600, 408, 408, 340, 680, 680, 340, -<a name="l00843"></a>00843 <span class="comment">/* 184 */</span> 360, 408, 440, 380, 1020, 1020, 1020, 620, -<a name="l00844"></a>00844 <span class="comment">/* 192 */</span> 720, 720, 720, 720, 720, 720, 1140, 700, -<a name="l00845"></a>00845 <span class="comment">/* 200 */</span> 720, 720, 720, 720, 380, 380, 380, 380, -<a name="l00846"></a>00846 <span class="comment">/* 208 */</span> 760, 740, 760, 760, 760, 760, 760, 600, -<a name="l00847"></a>00847 <span class="comment">/* 216 */</span> 760, 740, 740, 740, 740, 660, 640, 660, -<a name="l00848"></a>00848 <span class="comment">/* 224 */</span> 680, 680, 680, 680, 680, 680, 880, 560, -<a name="l00849"></a>00849 <span class="comment">/* 232 */</span> 560, 560, 560, 560, 380, 380, 380, 380, -<a name="l00850"></a>00850 <span class="comment">/* 240 */</span> 600, 680, 600, 600, 600, 600, 600, 600, -<a name="l00851"></a>00851 <span class="comment">/* 248 */</span> 600, 680, 680, 680, 680, 600, 660, 600, -<a name="l00852"></a>00852 }, -<a name="l00853"></a>00853 { <span class="comment">/* AvantGarde-Book */</span> -<a name="l00854"></a>00854 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00855"></a>00855 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00856"></a>00856 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00857"></a>00857 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00858"></a>00858 <span class="comment">/* 32 */</span> 277, 295, 309, 554, 554, 775, 757, 351, -<a name="l00859"></a>00859 <span class="comment">/* 40 */</span> 369, 369, 425, 606, 277, 332, 277, 437, -<a name="l00860"></a>00860 <span class="comment">/* 48 */</span> 554, 554, 554, 554, 554, 554, 554, 554, -<a name="l00861"></a>00861 <span class="comment">/* 56 */</span> 554, 554, 277, 277, 606, 606, 606, 591, -<a name="l00862"></a>00862 <span class="comment">/* 64 */</span> 867, 740, 574, 813, 744, 536, 485, 872, -<a name="l00863"></a>00863 <span class="comment">/* 72 */</span> 683, 226, 482, 591, 462, 919, 740, 869, -<a name="l00864"></a>00864 <span class="comment">/* 80 */</span> 592, 871, 607, 498, 426, 655, 702, 960, -<a name="l00865"></a>00865 <span class="comment">/* 88 */</span> 609, 592, 480, 351, 605, 351, 606, 500, -<a name="l00866"></a>00866 <span class="comment">/* 96 */</span> 351, 683, 682, 647, 685, 650, 314, 673, -<a name="l00867"></a>00867 <span class="comment">/* 104 */</span> 610, 200, 203, 502, 200, 938, 610, 655, -<a name="l00868"></a>00868 <span class="comment">/* 112 */</span> 682, 682, 301, 388, 339, 608, 554, 831, -<a name="l00869"></a>00869 <span class="comment">/* 120 */</span> 480, 536, 425, 351, 672, 351, 606, 0, -<a name="l00870"></a>00870 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00871"></a>00871 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1174, 606, -<a name="l00872"></a>00872 <span class="comment">/* 144 */</span> 351, 351, 251, 251, 502, 484, 502, 500, -<a name="l00873"></a>00873 <span class="comment">/* 152 */</span> 1000, 606, 1194, 1137, 553, 553, 487, 485, -<a name="l00874"></a>00874 <span class="comment">/* 160 */</span> 277, 295, 554, 554, 554, 554, 672, 615, -<a name="l00875"></a>00875 <span class="comment">/* 168 */</span> 369, 747, 369, 425, 606, 332, 747, 485, -<a name="l00876"></a>00876 <span class="comment">/* 176 */</span> 400, 606, 332, 332, 375, 608, 564, 277, -<a name="l00877"></a>00877 <span class="comment">/* 184 */</span> 324, 332, 369, 425, 831, 831, 831, 591, -<a name="l00878"></a>00878 <span class="comment">/* 192 */</span> 740, 740, 740, 740, 740, 740, 992, 813, -<a name="l00879"></a>00879 <span class="comment">/* 200 */</span> 536, 536, 536, 536, 226, 226, 226, 226, -<a name="l00880"></a>00880 <span class="comment">/* 208 */</span> 790, 740, 869, 869, 869, 869, 869, 606, -<a name="l00881"></a>00881 <span class="comment">/* 216 */</span> 868, 655, 655, 655, 655, 592, 592, 554, -<a name="l00882"></a>00882 <span class="comment">/* 224 */</span> 683, 683, 683, 683, 683, 683, 1157, 647, -<a name="l00883"></a>00883 <span class="comment">/* 232 */</span> 650, 650, 650, 650, 200, 200, 200, 200, -<a name="l00884"></a>00884 <span class="comment">/* 240 */</span> 655, 610, 655, 655, 655, 655, 655, 606, -<a name="l00885"></a>00885 <span class="comment">/* 248 */</span> 653, 608, 608, 608, 608, 536, 682, 536, -<a name="l00886"></a>00886 }, -<a name="l00887"></a>00887 { <span class="comment">/* AvantGarde-Demi */</span> -<a name="l00888"></a>00888 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00889"></a>00889 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00890"></a>00890 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00891"></a>00891 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00892"></a>00892 <span class="comment">/* 32 */</span> 280, 280, 360, 560, 560, 860, 680, 280, -<a name="l00893"></a>00893 <span class="comment">/* 40 */</span> 380, 380, 440, 600, 280, 420, 280, 460, -<a name="l00894"></a>00894 <span class="comment">/* 48 */</span> 560, 560, 560, 560, 560, 560, 560, 560, -<a name="l00895"></a>00895 <span class="comment">/* 56 */</span> 560, 560, 280, 280, 600, 600, 600, 560, -<a name="l00896"></a>00896 <span class="comment">/* 64 */</span> 740, 740, 580, 780, 700, 520, 480, 840, -<a name="l00897"></a>00897 <span class="comment">/* 72 */</span> 680, 280, 480, 620, 440, 900, 740, 840, -<a name="l00898"></a>00898 <span class="comment">/* 80 */</span> 560, 840, 580, 520, 420, 640, 700, 900, -<a name="l00899"></a>00899 <span class="comment">/* 88 */</span> 680, 620, 500, 320, 640, 320, 600, 500, -<a name="l00900"></a>00900 <span class="comment">/* 96 */</span> 280, 660, 660, 640, 660, 640, 280, 660, -<a name="l00901"></a>00901 <span class="comment">/* 104 */</span> 600, 240, 260, 580, 240, 940, 600, 640, -<a name="l00902"></a>00902 <span class="comment">/* 112 */</span> 660, 660, 320, 440, 300, 600, 560, 800, -<a name="l00903"></a>00903 <span class="comment">/* 120 */</span> 560, 580, 460, 340, 600, 340, 600, 0, -<a name="l00904"></a>00904 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00905"></a>00905 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1280, 600, -<a name="l00906"></a>00906 <span class="comment">/* 144 */</span> 280, 280, 240, 240, 480, 480, 480, 500, -<a name="l00907"></a>00907 <span class="comment">/* 152 */</span> 1000, 600, 1060, 1080, 560, 560, 520, 520, -<a name="l00908"></a>00908 <span class="comment">/* 160 */</span> 280, 280, 560, 560, 560, 560, 600, 560, -<a name="l00909"></a>00909 <span class="comment">/* 168 */</span> 500, 740, 360, 460, 600, 420, 740, 420, -<a name="l00910"></a>00910 <span class="comment">/* 176 */</span> 400, 600, 336, 336, 420, 576, 600, 280, -<a name="l00911"></a>00911 <span class="comment">/* 184 */</span> 340, 336, 360, 460, 840, 840, 840, 560, -<a name="l00912"></a>00912 <span class="comment">/* 192 */</span> 740, 740, 740, 740, 740, 740, 900, 780, -<a name="l00913"></a>00913 <span class="comment">/* 200 */</span> 520, 520, 520, 520, 280, 280, 280, 280, -<a name="l00914"></a>00914 <span class="comment">/* 208 */</span> 742, 740, 840, 840, 840, 840, 840, 600, -<a name="l00915"></a>00915 <span class="comment">/* 216 */</span> 840, 640, 640, 640, 640, 620, 560, 600, -<a name="l00916"></a>00916 <span class="comment">/* 224 */</span> 660, 660, 660, 660, 660, 660, 1080, 640, -<a name="l00917"></a>00917 <span class="comment">/* 232 */</span> 640, 640, 640, 640, 240, 240, 240, 240, -<a name="l00918"></a>00918 <span class="comment">/* 240 */</span> 640, 600, 640, 640, 640, 640, 640, 600, -<a name="l00919"></a>00919 <span class="comment">/* 248 */</span> 660, 600, 600, 600, 600, 580, 660, 580, -<a name="l00920"></a>00920 }, -<a name="l00921"></a>00921 { <span class="comment">/* AvantGarde-BookOblique */</span> -<a name="l00922"></a>00922 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00923"></a>00923 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00924"></a>00924 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00925"></a>00925 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00926"></a>00926 <span class="comment">/* 32 */</span> 277, 295, 309, 554, 554, 775, 757, 351, -<a name="l00927"></a>00927 <span class="comment">/* 40 */</span> 369, 369, 425, 606, 277, 332, 277, 437, -<a name="l00928"></a>00928 <span class="comment">/* 48 */</span> 554, 554, 554, 554, 554, 554, 554, 554, -<a name="l00929"></a>00929 <span class="comment">/* 56 */</span> 554, 554, 277, 277, 606, 606, 606, 591, -<a name="l00930"></a>00930 <span class="comment">/* 64 */</span> 867, 740, 574, 813, 744, 536, 485, 872, -<a name="l00931"></a>00931 <span class="comment">/* 72 */</span> 683, 226, 482, 591, 462, 919, 740, 869, -<a name="l00932"></a>00932 <span class="comment">/* 80 */</span> 592, 871, 607, 498, 426, 655, 702, 960, -<a name="l00933"></a>00933 <span class="comment">/* 88 */</span> 609, 592, 480, 351, 605, 351, 606, 500, -<a name="l00934"></a>00934 <span class="comment">/* 96 */</span> 351, 683, 682, 647, 685, 650, 314, 673, -<a name="l00935"></a>00935 <span class="comment">/* 104 */</span> 610, 200, 203, 502, 200, 938, 610, 655, -<a name="l00936"></a>00936 <span class="comment">/* 112 */</span> 682, 682, 301, 388, 339, 608, 554, 831, -<a name="l00937"></a>00937 <span class="comment">/* 120 */</span> 480, 536, 425, 351, 672, 351, 606, 0, -<a name="l00938"></a>00938 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00939"></a>00939 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1174, 606, -<a name="l00940"></a>00940 <span class="comment">/* 144 */</span> 351, 351, 251, 251, 502, 484, 502, 500, -<a name="l00941"></a>00941 <span class="comment">/* 152 */</span> 1000, 606, 1194, 1137, 553, 553, 487, 485, -<a name="l00942"></a>00942 <span class="comment">/* 160 */</span> 277, 295, 554, 554, 554, 554, 672, 615, -<a name="l00943"></a>00943 <span class="comment">/* 168 */</span> 369, 747, 369, 425, 606, 332, 747, 485, -<a name="l00944"></a>00944 <span class="comment">/* 176 */</span> 400, 606, 332, 332, 375, 608, 564, 277, -<a name="l00945"></a>00945 <span class="comment">/* 184 */</span> 324, 332, 369, 425, 831, 831, 831, 591, -<a name="l00946"></a>00946 <span class="comment">/* 192 */</span> 740, 740, 740, 740, 740, 740, 992, 813, -<a name="l00947"></a>00947 <span class="comment">/* 200 */</span> 536, 536, 536, 536, 226, 226, 226, 226, -<a name="l00948"></a>00948 <span class="comment">/* 208 */</span> 790, 740, 869, 869, 869, 869, 869, 606, -<a name="l00949"></a>00949 <span class="comment">/* 216 */</span> 868, 655, 655, 655, 655, 592, 592, 554, -<a name="l00950"></a>00950 <span class="comment">/* 224 */</span> 683, 683, 683, 683, 683, 683, 1157, 647, -<a name="l00951"></a>00951 <span class="comment">/* 232 */</span> 650, 650, 650, 650, 200, 200, 200, 200, -<a name="l00952"></a>00952 <span class="comment">/* 240 */</span> 655, 610, 655, 655, 655, 655, 655, 606, -<a name="l00953"></a>00953 <span class="comment">/* 248 */</span> 653, 608, 608, 608, 608, 536, 682, 536, -<a name="l00954"></a>00954 }, -<a name="l00955"></a>00955 { <span class="comment">/* AvantGarde-DemiOblique */</span> -<a name="l00956"></a>00956 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00957"></a>00957 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00958"></a>00958 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00959"></a>00959 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00960"></a>00960 <span class="comment">/* 32 */</span> 280, 280, 360, 560, 560, 860, 680, 280, -<a name="l00961"></a>00961 <span class="comment">/* 40 */</span> 380, 380, 440, 600, 280, 420, 280, 460, -<a name="l00962"></a>00962 <span class="comment">/* 48 */</span> 560, 560, 560, 560, 560, 560, 560, 560, -<a name="l00963"></a>00963 <span class="comment">/* 56 */</span> 560, 560, 280, 280, 600, 600, 600, 560, -<a name="l00964"></a>00964 <span class="comment">/* 64 */</span> 740, 740, 580, 780, 700, 520, 480, 840, -<a name="l00965"></a>00965 <span class="comment">/* 72 */</span> 680, 280, 480, 620, 440, 900, 740, 840, -<a name="l00966"></a>00966 <span class="comment">/* 80 */</span> 560, 840, 580, 520, 420, 640, 700, 900, -<a name="l00967"></a>00967 <span class="comment">/* 88 */</span> 680, 620, 500, 320, 640, 320, 600, 500, -<a name="l00968"></a>00968 <span class="comment">/* 96 */</span> 280, 660, 660, 640, 660, 640, 280, 660, -<a name="l00969"></a>00969 <span class="comment">/* 104 */</span> 600, 240, 260, 580, 240, 940, 600, 640, -<a name="l00970"></a>00970 <span class="comment">/* 112 */</span> 660, 660, 320, 440, 300, 600, 560, 800, -<a name="l00971"></a>00971 <span class="comment">/* 120 */</span> 560, 580, 460, 340, 600, 340, 600, 0, -<a name="l00972"></a>00972 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00973"></a>00973 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1280, 600, -<a name="l00974"></a>00974 <span class="comment">/* 144 */</span> 280, 280, 240, 240, 480, 480, 480, 500, -<a name="l00975"></a>00975 <span class="comment">/* 152 */</span> 1000, 600, 1060, 1080, 560, 560, 520, 520, -<a name="l00976"></a>00976 <span class="comment">/* 160 */</span> 280, 280, 560, 560, 560, 560, 600, 560, -<a name="l00977"></a>00977 <span class="comment">/* 168 */</span> 500, 740, 360, 460, 600, 420, 740, 420, -<a name="l00978"></a>00978 <span class="comment">/* 176 */</span> 400, 600, 336, 336, 420, 576, 600, 280, -<a name="l00979"></a>00979 <span class="comment">/* 184 */</span> 340, 336, 360, 460, 840, 840, 840, 560, -<a name="l00980"></a>00980 <span class="comment">/* 192 */</span> 740, 740, 740, 740, 740, 740, 900, 780, -<a name="l00981"></a>00981 <span class="comment">/* 200 */</span> 520, 520, 520, 520, 280, 280, 280, 280, -<a name="l00982"></a>00982 <span class="comment">/* 208 */</span> 742, 740, 840, 840, 840, 840, 840, 600, -<a name="l00983"></a>00983 <span class="comment">/* 216 */</span> 840, 640, 640, 640, 640, 620, 560, 600, -<a name="l00984"></a>00984 <span class="comment">/* 224 */</span> 660, 660, 660, 660, 660, 660, 1080, 640, -<a name="l00985"></a>00985 <span class="comment">/* 232 */</span> 640, 640, 640, 640, 240, 240, 240, 240, -<a name="l00986"></a>00986 <span class="comment">/* 240 */</span> 640, 600, 640, 640, 640, 640, 640, 600, -<a name="l00987"></a>00987 <span class="comment">/* 248 */</span> 660, 600, 600, 600, 600, 580, 660, 580, -<a name="l00988"></a>00988 }, -<a name="l00989"></a>00989 { <span class="comment">/* NewCenturySchlbk-Roman */</span> -<a name="l00990"></a>00990 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00991"></a>00991 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00992"></a>00992 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00993"></a>00993 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l00994"></a>00994 <span class="comment">/* 32 */</span> 278, 296, 389, 556, 556, 833, 815, 204, -<a name="l00995"></a>00995 <span class="comment">/* 40 */</span> 333, 333, 500, 606, 278, 333, 278, 278, -<a name="l00996"></a>00996 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l00997"></a>00997 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 606, 606, 606, 444, -<a name="l00998"></a>00998 <span class="comment">/* 64 */</span> 737, 722, 722, 722, 778, 722, 667, 778, -<a name="l00999"></a>00999 <span class="comment">/* 72 */</span> 833, 407, 556, 778, 667, 944, 815, 778, -<a name="l01000"></a>01000 <span class="comment">/* 80 */</span> 667, 778, 722, 630, 667, 815, 722, 981, -<a name="l01001"></a>01001 <span class="comment">/* 88 */</span> 704, 704, 611, 333, 606, 333, 606, 500, -<a name="l01002"></a>01002 <span class="comment">/* 96 */</span> 204, 556, 556, 444, 574, 500, 333, 537, -<a name="l01003"></a>01003 <span class="comment">/* 104 */</span> 611, 315, 296, 593, 315, 889, 611, 500, -<a name="l01004"></a>01004 <span class="comment">/* 112 */</span> 574, 556, 444, 463, 389, 611, 537, 778, -<a name="l01005"></a>01005 <span class="comment">/* 120 */</span> 537, 537, 481, 333, 606, 333, 606, 0, -<a name="l01006"></a>01006 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01007"></a>01007 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 606, -<a name="l01008"></a>01008 <span class="comment">/* 144 */</span> 204, 204, 259, 259, 389, 389, 389, 556, -<a name="l01009"></a>01009 <span class="comment">/* 152 */</span> 1000, 606, 1000, 833, 500, 500, 611, 611, -<a name="l01010"></a>01010 <span class="comment">/* 160 */</span> 278, 296, 556, 556, 556, 556, 606, 500, -<a name="l01011"></a>01011 <span class="comment">/* 168 */</span> 333, 737, 334, 426, 606, 333, 737, 333, -<a name="l01012"></a>01012 <span class="comment">/* 176 */</span> 400, 606, 333, 333, 333, 611, 606, 278, -<a name="l01013"></a>01013 <span class="comment">/* 184 */</span> 333, 333, 300, 426, 834, 834, 834, 444, -<a name="l01014"></a>01014 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 722, 1000, 722, -<a name="l01015"></a>01015 <span class="comment">/* 200 */</span> 722, 722, 722, 722, 407, 407, 407, 407, -<a name="l01016"></a>01016 <span class="comment">/* 208 */</span> 778, 815, 778, 778, 778, 778, 778, 606, -<a name="l01017"></a>01017 <span class="comment">/* 216 */</span> 778, 815, 815, 815, 815, 704, 667, 574, -<a name="l01018"></a>01018 <span class="comment">/* 224 */</span> 556, 556, 556, 556, 556, 556, 796, 444, -<a name="l01019"></a>01019 <span class="comment">/* 232 */</span> 500, 500, 500, 500, 315, 315, 315, 315, -<a name="l01020"></a>01020 <span class="comment">/* 240 */</span> 500, 611, 500, 500, 500, 500, 500, 606, -<a name="l01021"></a>01021 <span class="comment">/* 248 */</span> 500, 611, 611, 611, 611, 537, 574, 537, -<a name="l01022"></a>01022 }, -<a name="l01023"></a>01023 { <span class="comment">/* NewCenturySchlbk-Bold */</span> -<a name="l01024"></a>01024 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01025"></a>01025 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01026"></a>01026 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01027"></a>01027 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01028"></a>01028 <span class="comment">/* 32 */</span> 287, 296, 333, 574, 574, 833, 852, 241, -<a name="l01029"></a>01029 <span class="comment">/* 40 */</span> 389, 389, 500, 606, 278, 333, 278, 278, -<a name="l01030"></a>01030 <span class="comment">/* 48 */</span> 574, 574, 574, 574, 574, 574, 574, 574, -<a name="l01031"></a>01031 <span class="comment">/* 56 */</span> 574, 574, 278, 278, 606, 606, 606, 500, -<a name="l01032"></a>01032 <span class="comment">/* 64 */</span> 747, 759, 778, 778, 833, 759, 722, 833, -<a name="l01033"></a>01033 <span class="comment">/* 72 */</span> 870, 444, 648, 815, 722, 981, 833, 833, -<a name="l01034"></a>01034 <span class="comment">/* 80 */</span> 759, 833, 815, 667, 722, 833, 759, 981, -<a name="l01035"></a>01035 <span class="comment">/* 88 */</span> 722, 722, 667, 389, 606, 389, 606, 500, -<a name="l01036"></a>01036 <span class="comment">/* 96 */</span> 241, 611, 648, 556, 667, 574, 389, 611, -<a name="l01037"></a>01037 <span class="comment">/* 104 */</span> 685, 370, 352, 667, 352, 963, 685, 611, -<a name="l01038"></a>01038 <span class="comment">/* 112 */</span> 667, 648, 519, 500, 426, 685, 611, 889, -<a name="l01039"></a>01039 <span class="comment">/* 120 */</span> 611, 611, 537, 389, 606, 389, 606, 0, -<a name="l01040"></a>01040 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01041"></a>01041 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 1000, 1000, 606, -<a name="l01042"></a>01042 <span class="comment">/* 144 */</span> 241, 241, 333, 333, 481, 481, 481, 500, -<a name="l01043"></a>01043 <span class="comment">/* 152 */</span> 1000, 606, 1000, 907, 500, 500, 685, 685, -<a name="l01044"></a>01044 <span class="comment">/* 160 */</span> 287, 296, 574, 574, 574, 574, 606, 500, -<a name="l01045"></a>01045 <span class="comment">/* 168 */</span> 333, 747, 367, 500, 606, 333, 747, 333, -<a name="l01046"></a>01046 <span class="comment">/* 176 */</span> 400, 606, 344, 344, 333, 685, 747, 278, -<a name="l01047"></a>01047 <span class="comment">/* 184 */</span> 333, 344, 367, 500, 861, 861, 861, 500, -<a name="l01048"></a>01048 <span class="comment">/* 192 */</span> 759, 759, 759, 759, 759, 759, 981, 778, -<a name="l01049"></a>01049 <span class="comment">/* 200 */</span> 759, 759, 759, 759, 444, 444, 444, 444, -<a name="l01050"></a>01050 <span class="comment">/* 208 */</span> 833, 833, 833, 833, 833, 833, 833, 606, -<a name="l01051"></a>01051 <span class="comment">/* 216 */</span> 833, 833, 833, 833, 833, 722, 759, 611, -<a name="l01052"></a>01052 <span class="comment">/* 224 */</span> 611, 611, 611, 611, 611, 611, 870, 556, -<a name="l01053"></a>01053 <span class="comment">/* 232 */</span> 574, 574, 574, 574, 370, 370, 370, 370, -<a name="l01054"></a>01054 <span class="comment">/* 240 */</span> 611, 685, 611, 611, 611, 611, 611, 606, -<a name="l01055"></a>01055 <span class="comment">/* 248 */</span> 611, 685, 685, 685, 685, 611, 667, 611, -<a name="l01056"></a>01056 }, -<a name="l01057"></a>01057 { <span class="comment">/* NewCenturySchlbk-Italic */</span> -<a name="l01058"></a>01058 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01059"></a>01059 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01060"></a>01060 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01061"></a>01061 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01062"></a>01062 <span class="comment">/* 32 */</span> 278, 333, 400, 556, 556, 833, 852, 204, -<a name="l01063"></a>01063 <span class="comment">/* 40 */</span> 333, 333, 500, 606, 278, 333, 278, 606, -<a name="l01064"></a>01064 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l01065"></a>01065 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 606, 606, 606, 444, -<a name="l01066"></a>01066 <span class="comment">/* 64 */</span> 747, 704, 722, 722, 778, 722, 667, 778, -<a name="l01067"></a>01067 <span class="comment">/* 72 */</span> 833, 407, 611, 741, 667, 944, 815, 778, -<a name="l01068"></a>01068 <span class="comment">/* 80 */</span> 667, 778, 741, 667, 685, 815, 704, 926, -<a name="l01069"></a>01069 <span class="comment">/* 88 */</span> 704, 685, 667, 333, 606, 333, 606, 500, -<a name="l01070"></a>01070 <span class="comment">/* 96 */</span> 204, 574, 556, 444, 611, 444, 333, 537, -<a name="l01071"></a>01071 <span class="comment">/* 104 */</span> 611, 333, 315, 556, 333, 889, 611, 500, -<a name="l01072"></a>01072 <span class="comment">/* 112 */</span> 574, 556, 444, 444, 352, 611, 519, 778, -<a name="l01073"></a>01073 <span class="comment">/* 120 */</span> 500, 500, 463, 333, 606, 333, 606, 0, -<a name="l01074"></a>01074 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01075"></a>01075 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 950, 1000, 606, -<a name="l01076"></a>01076 <span class="comment">/* 144 */</span> 204, 204, 333, 333, 389, 389, 389, 500, -<a name="l01077"></a>01077 <span class="comment">/* 152 */</span> 1000, 606, 981, 778, 500, 500, 611, 611, -<a name="l01078"></a>01078 <span class="comment">/* 160 */</span> 278, 333, 556, 556, 556, 556, 606, 500, -<a name="l01079"></a>01079 <span class="comment">/* 168 */</span> 333, 747, 422, 426, 606, 333, 747, 333, -<a name="l01080"></a>01080 <span class="comment">/* 176 */</span> 400, 606, 333, 333, 333, 611, 650, 278, -<a name="l01081"></a>01081 <span class="comment">/* 184 */</span> 333, 333, 372, 426, 834, 834, 834, 444, -<a name="l01082"></a>01082 <span class="comment">/* 192 */</span> 704, 704, 704, 704, 704, 704, 870, 722, -<a name="l01083"></a>01083 <span class="comment">/* 200 */</span> 722, 722, 722, 722, 407, 407, 407, 407, -<a name="l01084"></a>01084 <span class="comment">/* 208 */</span> 778, 815, 778, 778, 778, 778, 778, 606, -<a name="l01085"></a>01085 <span class="comment">/* 216 */</span> 778, 815, 815, 815, 815, 685, 667, 556, -<a name="l01086"></a>01086 <span class="comment">/* 224 */</span> 574, 574, 574, 574, 574, 574, 722, 444, -<a name="l01087"></a>01087 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 333, 333, 333, 333, -<a name="l01088"></a>01088 <span class="comment">/* 240 */</span> 500, 611, 500, 500, 500, 500, 500, 606, -<a name="l01089"></a>01089 <span class="comment">/* 248 */</span> 500, 611, 611, 611, 611, 500, 574, 500, -<a name="l01090"></a>01090 }, -<a name="l01091"></a>01091 { <span class="comment">/* NewCenturySchlbk-BoldItalic */</span> -<a name="l01092"></a>01092 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01093"></a>01093 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01094"></a>01094 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01095"></a>01095 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01096"></a>01096 <span class="comment">/* 32 */</span> 287, 333, 400, 574, 574, 889, 889, 259, -<a name="l01097"></a>01097 <span class="comment">/* 40 */</span> 407, 407, 500, 606, 287, 333, 287, 278, -<a name="l01098"></a>01098 <span class="comment">/* 48 */</span> 574, 574, 574, 574, 574, 574, 574, 574, -<a name="l01099"></a>01099 <span class="comment">/* 56 */</span> 574, 574, 287, 287, 606, 606, 606, 481, -<a name="l01100"></a>01100 <span class="comment">/* 64 */</span> 747, 741, 759, 759, 833, 741, 704, 815, -<a name="l01101"></a>01101 <span class="comment">/* 72 */</span> 870, 444, 667, 778, 704, 944, 852, 833, -<a name="l01102"></a>01102 <span class="comment">/* 80 */</span> 741, 833, 796, 685, 722, 833, 741, 944, -<a name="l01103"></a>01103 <span class="comment">/* 88 */</span> 741, 704, 704, 407, 606, 407, 606, 500, -<a name="l01104"></a>01104 <span class="comment">/* 96 */</span> 259, 667, 611, 537, 667, 519, 389, 611, -<a name="l01105"></a>01105 <span class="comment">/* 104 */</span> 685, 389, 370, 648, 389, 944, 685, 574, -<a name="l01106"></a>01106 <span class="comment">/* 112 */</span> 648, 630, 519, 481, 407, 685, 556, 833, -<a name="l01107"></a>01107 <span class="comment">/* 120 */</span> 574, 519, 519, 407, 606, 407, 606, 0, -<a name="l01108"></a>01108 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01109"></a>01109 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 1000, 950, 1167, 606, -<a name="l01110"></a>01110 <span class="comment">/* 144 */</span> 259, 259, 278, 278, 481, 481, 481, 500, -<a name="l01111"></a>01111 <span class="comment">/* 152 */</span> 1000, 606, 963, 852, 500, 500, 685, 685, -<a name="l01112"></a>01112 <span class="comment">/* 160 */</span> 287, 333, 574, 574, 574, 574, 606, 500, -<a name="l01113"></a>01113 <span class="comment">/* 168 */</span> 333, 747, 412, 481, 606, 333, 747, 333, -<a name="l01114"></a>01114 <span class="comment">/* 176 */</span> 400, 606, 344, 344, 333, 685, 650, 287, -<a name="l01115"></a>01115 <span class="comment">/* 184 */</span> 333, 344, 356, 481, 861, 861, 861, 481, -<a name="l01116"></a>01116 <span class="comment">/* 192 */</span> 741, 741, 741, 741, 741, 741, 889, 759, -<a name="l01117"></a>01117 <span class="comment">/* 200 */</span> 741, 741, 741, 741, 444, 444, 444, 444, -<a name="l01118"></a>01118 <span class="comment">/* 208 */</span> 833, 852, 833, 833, 833, 833, 833, 606, -<a name="l01119"></a>01119 <span class="comment">/* 216 */</span> 833, 833, 833, 833, 833, 704, 741, 574, -<a name="l01120"></a>01120 <span class="comment">/* 224 */</span> 667, 667, 667, 667, 667, 667, 815, 537, -<a name="l01121"></a>01121 <span class="comment">/* 232 */</span> 519, 519, 519, 519, 389, 389, 389, 389, -<a name="l01122"></a>01122 <span class="comment">/* 240 */</span> 574, 685, 574, 574, 574, 574, 574, 606, -<a name="l01123"></a>01123 <span class="comment">/* 248 */</span> 574, 685, 685, 685, 685, 519, 648, 519, -<a name="l01124"></a>01124 }, -<a name="l01125"></a>01125 }; -<a name="l01126"></a>01126 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> ausCharacterWidths2[32][256] = { -<a name="l01127"></a>01127 { <span class="comment">/* Courier */</span> -<a name="l01128"></a>01128 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01129"></a>01129 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01130"></a>01130 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01131"></a>01131 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01132"></a>01132 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01133"></a>01133 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01134"></a>01134 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01135"></a>01135 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01136"></a>01136 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01137"></a>01137 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01138"></a>01138 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01139"></a>01139 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01140"></a>01140 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01141"></a>01141 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01142"></a>01142 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01143"></a>01143 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l01144"></a>01144 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01145"></a>01145 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01146"></a>01146 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01147"></a>01147 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01148"></a>01148 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01149"></a>01149 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01150"></a>01150 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01151"></a>01151 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01152"></a>01152 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01153"></a>01153 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01154"></a>01154 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01155"></a>01155 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01156"></a>01156 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01157"></a>01157 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01158"></a>01158 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01159"></a>01159 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01160"></a>01160 }, -<a name="l01161"></a>01161 { <span class="comment">/* Courier-Bold */</span> -<a name="l01162"></a>01162 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01163"></a>01163 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01164"></a>01164 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01165"></a>01165 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01166"></a>01166 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01167"></a>01167 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01168"></a>01168 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01169"></a>01169 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01170"></a>01170 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01171"></a>01171 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01172"></a>01172 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01173"></a>01173 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01174"></a>01174 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01175"></a>01175 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01176"></a>01176 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01177"></a>01177 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l01178"></a>01178 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01179"></a>01179 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01180"></a>01180 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01181"></a>01181 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01182"></a>01182 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01183"></a>01183 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01184"></a>01184 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01185"></a>01185 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01186"></a>01186 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01187"></a>01187 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01188"></a>01188 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01189"></a>01189 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01190"></a>01190 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01191"></a>01191 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01192"></a>01192 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01193"></a>01193 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01194"></a>01194 }, -<a name="l01195"></a>01195 { <span class="comment">/* Courier-Oblique */</span> -<a name="l01196"></a>01196 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01197"></a>01197 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01198"></a>01198 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01199"></a>01199 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01200"></a>01200 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01201"></a>01201 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01202"></a>01202 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01203"></a>01203 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01204"></a>01204 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01205"></a>01205 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01206"></a>01206 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01207"></a>01207 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01208"></a>01208 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01209"></a>01209 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01210"></a>01210 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01211"></a>01211 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l01212"></a>01212 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01213"></a>01213 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01214"></a>01214 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01215"></a>01215 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01216"></a>01216 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01217"></a>01217 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01218"></a>01218 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01219"></a>01219 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01220"></a>01220 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01221"></a>01221 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01222"></a>01222 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01223"></a>01223 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01224"></a>01224 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01225"></a>01225 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01226"></a>01226 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01227"></a>01227 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01228"></a>01228 }, -<a name="l01229"></a>01229 { <span class="comment">/* Courier-BoldOblique */</span> -<a name="l01230"></a>01230 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01231"></a>01231 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01232"></a>01232 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01233"></a>01233 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01234"></a>01234 <span class="comment">/* 32 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01235"></a>01235 <span class="comment">/* 40 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01236"></a>01236 <span class="comment">/* 48 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01237"></a>01237 <span class="comment">/* 56 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01238"></a>01238 <span class="comment">/* 64 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01239"></a>01239 <span class="comment">/* 72 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01240"></a>01240 <span class="comment">/* 80 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01241"></a>01241 <span class="comment">/* 88 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01242"></a>01242 <span class="comment">/* 96 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01243"></a>01243 <span class="comment">/* 104 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01244"></a>01244 <span class="comment">/* 112 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01245"></a>01245 <span class="comment">/* 120 */</span> 600, 600, 600, 600, 600, 600, 600, 0, -<a name="l01246"></a>01246 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01247"></a>01247 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01248"></a>01248 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01249"></a>01249 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01250"></a>01250 <span class="comment">/* 160 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01251"></a>01251 <span class="comment">/* 168 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01252"></a>01252 <span class="comment">/* 176 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01253"></a>01253 <span class="comment">/* 184 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01254"></a>01254 <span class="comment">/* 192 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01255"></a>01255 <span class="comment">/* 200 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01256"></a>01256 <span class="comment">/* 208 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01257"></a>01257 <span class="comment">/* 216 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01258"></a>01258 <span class="comment">/* 224 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01259"></a>01259 <span class="comment">/* 232 */</span> 600, 600, 600, 600, 600, 600, 600, 740, -<a name="l01260"></a>01260 <span class="comment">/* 240 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01261"></a>01261 <span class="comment">/* 248 */</span> 600, 600, 600, 600, 600, 600, 600, 600, -<a name="l01262"></a>01262 }, -<a name="l01263"></a>01263 { <span class="comment">/* Times-Roman */</span> -<a name="l01264"></a>01264 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01265"></a>01265 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01266"></a>01266 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01267"></a>01267 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01268"></a>01268 <span class="comment">/* 32 */</span> 250, 333, 408, 500, 500, 833, 778, 180, -<a name="l01269"></a>01269 <span class="comment">/* 40 */</span> 333, 333, 500, 564, 250, 333, 250, 278, -<a name="l01270"></a>01270 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01271"></a>01271 <span class="comment">/* 56 */</span> 500, 500, 278, 278, 564, 564, 564, 444, -<a name="l01272"></a>01272 <span class="comment">/* 64 */</span> 921, 722, 667, 667, 722, 611, 556, 722, -<a name="l01273"></a>01273 <span class="comment">/* 72 */</span> 722, 333, 389, 722, 611, 889, 722, 722, -<a name="l01274"></a>01274 <span class="comment">/* 80 */</span> 556, 722, 667, 556, 611, 722, 722, 944, -<a name="l01275"></a>01275 <span class="comment">/* 88 */</span> 722, 722, 611, 333, 278, 333, 469, 500, -<a name="l01276"></a>01276 <span class="comment">/* 96 */</span> 333, 444, 500, 444, 500, 444, 333, 500, -<a name="l01277"></a>01277 <span class="comment">/* 104 */</span> 500, 278, 278, 500, 278, 778, 500, 500, -<a name="l01278"></a>01278 <span class="comment">/* 112 */</span> 500, 500, 333, 389, 278, 500, 500, 722, -<a name="l01279"></a>01279 <span class="comment">/* 120 */</span> 500, 500, 444, 480, 200, 480, 541, 0, -<a name="l01280"></a>01280 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01281"></a>01281 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01282"></a>01282 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01283"></a>01283 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01284"></a>01284 <span class="comment">/* 160 */</span> 250, 722, 333, 611, 500, 611, 556, 500, -<a name="l01285"></a>01285 <span class="comment">/* 168 */</span> 333, 556, 556, 611, 611, 333, 611, 611, -<a name="l01286"></a>01286 <span class="comment">/* 176 */</span> 333, 444, 333, 278, 333, 348, 389, 333, -<a name="l01287"></a>01287 <span class="comment">/* 184 */</span> 333, 389, 389, 278, 444, 333, 444, 444, -<a name="l01288"></a>01288 <span class="comment">/* 192 */</span> 667, 722, 722, 722, 722, 611, 667, 667, -<a name="l01289"></a>01289 <span class="comment">/* 200 */</span> 667, 611, 611, 611, 611, 333, 333, 722, -<a name="l01290"></a>01290 <span class="comment">/* 208 */</span> 722, 722, 722, 722, 722, 722, 722, 564, -<a name="l01291"></a>01291 <span class="comment">/* 216 */</span> 667, 722, 722, 722, 722, 722, 611, 500, -<a name="l01292"></a>01292 <span class="comment">/* 224 */</span> 333, 444, 444, 444, 444, 278, 444, 444, -<a name="l01293"></a>01293 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 278, 278, 600, -<a name="l01294"></a>01294 <span class="comment">/* 240 */</span> 500, 500, 500, 500, 500, 500, 500, 564, -<a name="l01295"></a>01295 <span class="comment">/* 248 */</span> 333, 500, 500, 500, 500, 500, 278, 333, -<a name="l01296"></a>01296 }, -<a name="l01297"></a>01297 { <span class="comment">/* Times-Bold */</span> -<a name="l01298"></a>01298 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01299"></a>01299 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01300"></a>01300 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01301"></a>01301 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01302"></a>01302 <span class="comment">/* 32 */</span> 250, 333, 555, 500, 500, 1000, 833, 278, -<a name="l01303"></a>01303 <span class="comment">/* 40 */</span> 333, 333, 500, 570, 250, 333, 250, 278, -<a name="l01304"></a>01304 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01305"></a>01305 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 570, 570, 570, 500, -<a name="l01306"></a>01306 <span class="comment">/* 64 */</span> 930, 722, 667, 722, 722, 667, 611, 778, -<a name="l01307"></a>01307 <span class="comment">/* 72 */</span> 778, 389, 500, 778, 667, 944, 722, 778, -<a name="l01308"></a>01308 <span class="comment">/* 80 */</span> 611, 778, 722, 556, 667, 722, 722, 1000, -<a name="l01309"></a>01309 <span class="comment">/* 88 */</span> 722, 722, 667, 333, 278, 333, 581, 500, -<a name="l01310"></a>01310 <span class="comment">/* 96 */</span> 333, 500, 556, 444, 556, 444, 333, 500, -<a name="l01311"></a>01311 <span class="comment">/* 104 */</span> 556, 278, 333, 556, 278, 833, 556, 500, -<a name="l01312"></a>01312 <span class="comment">/* 112 */</span> 556, 556, 444, 389, 333, 556, 500, 722, -<a name="l01313"></a>01313 <span class="comment">/* 120 */</span> 500, 500, 444, 394, 220, 394, 520, 0, -<a name="l01314"></a>01314 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01315"></a>01315 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01316"></a>01316 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01317"></a>01317 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01318"></a>01318 <span class="comment">/* 160 */</span> 250, 722, 333, 667, 500, 667, 556, 500, -<a name="l01319"></a>01319 <span class="comment">/* 168 */</span> 333, 556, 556, 667, 667, 333, 667, 667, -<a name="l01320"></a>01320 <span class="comment">/* 176 */</span> 333, 500, 333, 278, 333, 396, 389, 333, -<a name="l01321"></a>01321 <span class="comment">/* 184 */</span> 333, 389, 389, 400, 444, 333, 444, 444, -<a name="l01322"></a>01322 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 667, 722, 722, -<a name="l01323"></a>01323 <span class="comment">/* 200 */</span> 722, 667, 667, 667, 667, 389, 389, 722, -<a name="l01324"></a>01324 <span class="comment">/* 208 */</span> 722, 722, 722, 778, 778, 778, 778, 570, -<a name="l01325"></a>01325 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 722, 667, 556, -<a name="l01326"></a>01326 <span class="comment">/* 224 */</span> 444, 500, 500, 500, 500, 278, 444, 444, -<a name="l01327"></a>01327 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 278, 278, 665, -<a name="l01328"></a>01328 <span class="comment">/* 240 */</span> 556, 556, 556, 500, 500, 500, 500, 570, -<a name="l01329"></a>01329 <span class="comment">/* 248 */</span> 444, 556, 556, 556, 556, 500, 333, 333, -<a name="l01330"></a>01330 }, -<a name="l01331"></a>01331 { <span class="comment">/* Times-Italic */</span> -<a name="l01332"></a>01332 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01333"></a>01333 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01334"></a>01334 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01335"></a>01335 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01336"></a>01336 <span class="comment">/* 32 */</span> 250, 333, 420, 500, 500, 833, 778, 214, -<a name="l01337"></a>01337 <span class="comment">/* 40 */</span> 333, 333, 500, 675, 250, 333, 250, 278, -<a name="l01338"></a>01338 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01339"></a>01339 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 675, 675, 675, 500, -<a name="l01340"></a>01340 <span class="comment">/* 64 */</span> 920, 611, 611, 667, 722, 611, 611, 722, -<a name="l01341"></a>01341 <span class="comment">/* 72 */</span> 722, 333, 444, 667, 556, 833, 667, 722, -<a name="l01342"></a>01342 <span class="comment">/* 80 */</span> 611, 722, 611, 500, 556, 722, 611, 833, -<a name="l01343"></a>01343 <span class="comment">/* 88 */</span> 611, 556, 556, 389, 278, 389, 422, 500, -<a name="l01344"></a>01344 <span class="comment">/* 96 */</span> 333, 500, 500, 444, 500, 444, 278, 500, -<a name="l01345"></a>01345 <span class="comment">/* 104 */</span> 500, 278, 278, 444, 278, 722, 500, 500, -<a name="l01346"></a>01346 <span class="comment">/* 112 */</span> 500, 500, 389, 389, 278, 500, 444, 667, -<a name="l01347"></a>01347 <span class="comment">/* 120 */</span> 444, 444, 389, 400, 275, 400, 541, 0, -<a name="l01348"></a>01348 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01349"></a>01349 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01350"></a>01350 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01351"></a>01351 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01352"></a>01352 <span class="comment">/* 160 */</span> 250, 611, 333, 556, 500, 556, 500, 500, -<a name="l01353"></a>01353 <span class="comment">/* 168 */</span> 333, 500, 500, 556, 556, 333, 556, 556, -<a name="l01354"></a>01354 <span class="comment">/* 176 */</span> 333, 500, 333, 278, 333, 278, 389, 333, -<a name="l01355"></a>01355 <span class="comment">/* 184 */</span> 333, 389, 389, 278, 389, 333, 389, 389, -<a name="l01356"></a>01356 <span class="comment">/* 192 */</span> 611, 611, 611, 611, 611, 556, 667, 667, -<a name="l01357"></a>01357 <span class="comment">/* 200 */</span> 667, 611, 611, 611, 611, 333, 333, 722, -<a name="l01358"></a>01358 <span class="comment">/* 208 */</span> 722, 667, 667, 722, 722, 722, 722, 675, -<a name="l01359"></a>01359 <span class="comment">/* 216 */</span> 611, 722, 722, 722, 722, 556, 556, 500, -<a name="l01360"></a>01360 <span class="comment">/* 224 */</span> 389, 500, 500, 500, 500, 278, 444, 444, -<a name="l01361"></a>01361 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 278, 278, 521, -<a name="l01362"></a>01362 <span class="comment">/* 240 */</span> 500, 500, 500, 500, 500, 500, 500, 675, -<a name="l01363"></a>01363 <span class="comment">/* 248 */</span> 389, 500, 500, 500, 500, 444, 278, 333, -<a name="l01364"></a>01364 }, -<a name="l01365"></a>01365 { <span class="comment">/* Times-BoldItalic */</span> -<a name="l01366"></a>01366 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01367"></a>01367 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01368"></a>01368 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01369"></a>01369 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01370"></a>01370 <span class="comment">/* 32 */</span> 250, 389, 555, 500, 500, 833, 778, 278, -<a name="l01371"></a>01371 <span class="comment">/* 40 */</span> 333, 333, 500, 570, 250, 333, 250, 278, -<a name="l01372"></a>01372 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01373"></a>01373 <span class="comment">/* 56 */</span> 500, 500, 333, 333, 570, 570, 570, 500, -<a name="l01374"></a>01374 <span class="comment">/* 64 */</span> 832, 667, 667, 667, 722, 667, 667, 722, -<a name="l01375"></a>01375 <span class="comment">/* 72 */</span> 778, 389, 500, 667, 611, 889, 722, 722, -<a name="l01376"></a>01376 <span class="comment">/* 80 */</span> 611, 722, 667, 556, 611, 722, 667, 889, -<a name="l01377"></a>01377 <span class="comment">/* 88 */</span> 667, 611, 611, 333, 278, 333, 570, 500, -<a name="l01378"></a>01378 <span class="comment">/* 96 */</span> 333, 500, 500, 444, 500, 444, 333, 500, -<a name="l01379"></a>01379 <span class="comment">/* 104 */</span> 556, 278, 278, 500, 278, 778, 556, 500, -<a name="l01380"></a>01380 <span class="comment">/* 112 */</span> 500, 500, 389, 389, 278, 556, 444, 667, -<a name="l01381"></a>01381 <span class="comment">/* 120 */</span> 500, 444, 389, 348, 220, 348, 570, 0, -<a name="l01382"></a>01382 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01383"></a>01383 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01384"></a>01384 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01385"></a>01385 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01386"></a>01386 <span class="comment">/* 160 */</span> 250, 667, 333, 611, 500, 611, 556, 500, -<a name="l01387"></a>01387 <span class="comment">/* 168 */</span> 333, 556, 556, 611, 611, 333, 611, 611, -<a name="l01388"></a>01388 <span class="comment">/* 176 */</span> 333, 500, 333, 278, 333, 382, 389, 333, -<a name="l01389"></a>01389 <span class="comment">/* 184 */</span> 333, 389, 389, 345, 389, 333, 389, 389, -<a name="l01390"></a>01390 <span class="comment">/* 192 */</span> 667, 667, 667, 667, 667, 611, 667, 667, -<a name="l01391"></a>01391 <span class="comment">/* 200 */</span> 667, 667, 667, 667, 667, 389, 389, 722, -<a name="l01392"></a>01392 <span class="comment">/* 208 */</span> 722, 722, 722, 722, 722, 722, 722, 570, -<a name="l01393"></a>01393 <span class="comment">/* 216 */</span> 667, 722, 722, 722, 722, 611, 611, 500, -<a name="l01394"></a>01394 <span class="comment">/* 224 */</span> 389, 500, 500, 500, 500, 278, 444, 444, -<a name="l01395"></a>01395 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 278, 278, 600, -<a name="l01396"></a>01396 <span class="comment">/* 240 */</span> 500, 556, 556, 500, 500, 500, 500, 570, -<a name="l01397"></a>01397 <span class="comment">/* 248 */</span> 389, 556, 556, 556, 556, 444, 278, 333, -<a name="l01398"></a>01398 }, -<a name="l01399"></a>01399 { <span class="comment">/* Helvetica */</span> -<a name="l01400"></a>01400 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01401"></a>01401 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01402"></a>01402 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01403"></a>01403 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01404"></a>01404 <span class="comment">/* 32 */</span> 278, 278, 355, 556, 556, 889, 667, 191, -<a name="l01405"></a>01405 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l01406"></a>01406 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l01407"></a>01407 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 584, 584, 584, 556, -<a name="l01408"></a>01408 <span class="comment">/* 64 */</span> 1015, 667, 667, 722, 722, 667, 611, 778, -<a name="l01409"></a>01409 <span class="comment">/* 72 */</span> 722, 278, 500, 667, 556, 833, 722, 778, -<a name="l01410"></a>01410 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l01411"></a>01411 <span class="comment">/* 88 */</span> 667, 667, 611, 278, 278, 278, 469, 556, -<a name="l01412"></a>01412 <span class="comment">/* 96 */</span> 333, 556, 556, 500, 556, 556, 278, 556, -<a name="l01413"></a>01413 <span class="comment">/* 104 */</span> 556, 222, 222, 500, 222, 833, 556, 556, -<a name="l01414"></a>01414 <span class="comment">/* 112 */</span> 556, 556, 333, 500, 278, 556, 500, 722, -<a name="l01415"></a>01415 <span class="comment">/* 120 */</span> 500, 500, 500, 334, 260, 334, 584, 0, -<a name="l01416"></a>01416 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01417"></a>01417 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01418"></a>01418 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01419"></a>01419 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01420"></a>01420 <span class="comment">/* 160 */</span> 278, 667, 333, 556, 556, 556, 667, 556, -<a name="l01421"></a>01421 <span class="comment">/* 168 */</span> 333, 667, 667, 611, 611, 333, 611, 611, -<a name="l01422"></a>01422 <span class="comment">/* 176 */</span> 333, 556, 333, 222, 333, 292, 500, 333, -<a name="l01423"></a>01423 <span class="comment">/* 184 */</span> 333, 500, 500, 308, 500, 333, 500, 500, -<a name="l01424"></a>01424 <span class="comment">/* 192 */</span> 722, 667, 667, 667, 667, 556, 722, 722, -<a name="l01425"></a>01425 <span class="comment">/* 200 */</span> 722, 667, 667, 667, 667, 278, 278, 722, -<a name="l01426"></a>01426 <span class="comment">/* 208 */</span> 722, 722, 722, 778, 778, 778, 778, 584, -<a name="l01427"></a>01427 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 666, 611, 611, -<a name="l01428"></a>01428 <span class="comment">/* 224 */</span> 333, 556, 556, 556, 556, 222, 500, 500, -<a name="l01429"></a>01429 <span class="comment">/* 232 */</span> 500, 556, 556, 556, 556, 278, 278, 635, -<a name="l01430"></a>01430 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 584, -<a name="l01431"></a>01431 <span class="comment">/* 248 */</span> 333, 556, 556, 556, 556, 500, 278, 333, -<a name="l01432"></a>01432 }, -<a name="l01433"></a>01433 { <span class="comment">/* Helvetica-Bold */</span> -<a name="l01434"></a>01434 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01435"></a>01435 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01436"></a>01436 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01437"></a>01437 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01438"></a>01438 <span class="comment">/* 32 */</span> 278, 333, 474, 556, 556, 889, 722, 238, -<a name="l01439"></a>01439 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l01440"></a>01440 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l01441"></a>01441 <span class="comment">/* 56 */</span> 556, 556, 333, 333, 584, 584, 584, 611, -<a name="l01442"></a>01442 <span class="comment">/* 64 */</span> 975, 722, 722, 722, 722, 667, 611, 778, -<a name="l01443"></a>01443 <span class="comment">/* 72 */</span> 722, 278, 556, 722, 611, 833, 722, 778, -<a name="l01444"></a>01444 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l01445"></a>01445 <span class="comment">/* 88 */</span> 667, 667, 611, 333, 278, 333, 584, 556, -<a name="l01446"></a>01446 <span class="comment">/* 96 */</span> 333, 556, 611, 556, 611, 556, 333, 611, -<a name="l01447"></a>01447 <span class="comment">/* 104 */</span> 611, 278, 278, 556, 278, 889, 611, 611, -<a name="l01448"></a>01448 <span class="comment">/* 112 */</span> 611, 611, 389, 556, 333, 611, 556, 778, -<a name="l01449"></a>01449 <span class="comment">/* 120 */</span> 556, 556, 500, 389, 280, 389, 584, 0, -<a name="l01450"></a>01450 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01451"></a>01451 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01452"></a>01452 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01453"></a>01453 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01454"></a>01454 <span class="comment">/* 160 */</span> 278, 722, 333, 611, 556, 611, 667, 556, -<a name="l01455"></a>01455 <span class="comment">/* 168 */</span> 333, 667, 667, 611, 611, 333, 611, 611, -<a name="l01456"></a>01456 <span class="comment">/* 176 */</span> 333, 556, 333, 278, 333, 369, 556, 333, -<a name="l01457"></a>01457 <span class="comment">/* 184 */</span> 333, 556, 556, 385, 500, 333, 500, 500, -<a name="l01458"></a>01458 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 611, 722, 722, -<a name="l01459"></a>01459 <span class="comment">/* 200 */</span> 722, 667, 667, 667, 667, 278, 278, 722, -<a name="l01460"></a>01460 <span class="comment">/* 208 */</span> 722, 722, 722, 778, 778, 778, 778, 584, -<a name="l01461"></a>01461 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 667, 611, 611, -<a name="l01462"></a>01462 <span class="comment">/* 224 */</span> 389, 556, 556, 556, 556, 278, 556, 556, -<a name="l01463"></a>01463 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 556, 278, 278, 707, -<a name="l01464"></a>01464 <span class="comment">/* 240 */</span> 611, 611, 611, 611, 611, 611, 611, 584, -<a name="l01465"></a>01465 <span class="comment">/* 248 */</span> 389, 611, 611, 611, 611, 556, 333, 333, -<a name="l01466"></a>01466 }, -<a name="l01467"></a>01467 { <span class="comment">/* Helvetica-Oblique */</span> -<a name="l01468"></a>01468 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01469"></a>01469 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01470"></a>01470 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01471"></a>01471 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01472"></a>01472 <span class="comment">/* 32 */</span> 278, 278, 355, 556, 556, 889, 667, 191, -<a name="l01473"></a>01473 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l01474"></a>01474 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l01475"></a>01475 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 584, 584, 584, 556, -<a name="l01476"></a>01476 <span class="comment">/* 64 */</span> 1015, 667, 667, 722, 722, 667, 611, 778, -<a name="l01477"></a>01477 <span class="comment">/* 72 */</span> 722, 278, 500, 667, 556, 833, 722, 778, -<a name="l01478"></a>01478 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l01479"></a>01479 <span class="comment">/* 88 */</span> 667, 667, 611, 278, 278, 278, 469, 556, -<a name="l01480"></a>01480 <span class="comment">/* 96 */</span> 333, 556, 556, 500, 556, 556, 278, 556, -<a name="l01481"></a>01481 <span class="comment">/* 104 */</span> 556, 222, 222, 500, 222, 833, 556, 556, -<a name="l01482"></a>01482 <span class="comment">/* 112 */</span> 556, 556, 333, 500, 278, 556, 500, 722, -<a name="l01483"></a>01483 <span class="comment">/* 120 */</span> 500, 500, 500, 334, 260, 334, 584, 0, -<a name="l01484"></a>01484 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01485"></a>01485 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01486"></a>01486 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01487"></a>01487 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01488"></a>01488 <span class="comment">/* 160 */</span> 278, 667, 333, 556, 556, 556, 667, 556, -<a name="l01489"></a>01489 <span class="comment">/* 168 */</span> 333, 667, 667, 611, 611, 333, 611, 611, -<a name="l01490"></a>01490 <span class="comment">/* 176 */</span> 333, 556, 333, 222, 333, 307, 500, 333, -<a name="l01491"></a>01491 <span class="comment">/* 184 */</span> 333, 500, 500, 319, 500, 333, 500, 500, -<a name="l01492"></a>01492 <span class="comment">/* 192 */</span> 722, 667, 667, 667, 667, 556, 722, 722, -<a name="l01493"></a>01493 <span class="comment">/* 200 */</span> 722, 667, 667, 667, 667, 278, 278, 722, -<a name="l01494"></a>01494 <span class="comment">/* 208 */</span> 722, 722, 722, 778, 778, 778, 778, 584, -<a name="l01495"></a>01495 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 667, 611, 611, -<a name="l01496"></a>01496 <span class="comment">/* 224 */</span> 333, 556, 556, 556, 556, 222, 500, 500, -<a name="l01497"></a>01497 <span class="comment">/* 232 */</span> 500, 556, 556, 556, 556, 278, 278, 650, -<a name="l01498"></a>01498 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 584, -<a name="l01499"></a>01499 <span class="comment">/* 248 */</span> 333, 556, 556, 556, 556, 500, 278, 333, -<a name="l01500"></a>01500 }, -<a name="l01501"></a>01501 { <span class="comment">/* Helvetica-BoldOblique */</span> -<a name="l01502"></a>01502 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01503"></a>01503 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01504"></a>01504 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01505"></a>01505 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01506"></a>01506 <span class="comment">/* 32 */</span> 278, 333, 474, 556, 556, 889, 722, 238, -<a name="l01507"></a>01507 <span class="comment">/* 40 */</span> 333, 333, 389, 584, 278, 333, 278, 278, -<a name="l01508"></a>01508 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l01509"></a>01509 <span class="comment">/* 56 */</span> 556, 556, 333, 333, 584, 584, 584, 611, -<a name="l01510"></a>01510 <span class="comment">/* 64 */</span> 975, 722, 722, 722, 722, 667, 611, 778, -<a name="l01511"></a>01511 <span class="comment">/* 72 */</span> 722, 278, 556, 722, 611, 833, 722, 778, -<a name="l01512"></a>01512 <span class="comment">/* 80 */</span> 667, 778, 722, 667, 611, 722, 667, 944, -<a name="l01513"></a>01513 <span class="comment">/* 88 */</span> 667, 667, 611, 333, 278, 333, 584, 556, -<a name="l01514"></a>01514 <span class="comment">/* 96 */</span> 333, 556, 611, 556, 611, 556, 333, 611, -<a name="l01515"></a>01515 <span class="comment">/* 104 */</span> 611, 278, 278, 556, 278, 889, 611, 611, -<a name="l01516"></a>01516 <span class="comment">/* 112 */</span> 611, 611, 389, 556, 333, 611, 556, 778, -<a name="l01517"></a>01517 <span class="comment">/* 120 */</span> 556, 556, 500, 389, 280, 389, 584, 0, -<a name="l01518"></a>01518 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01519"></a>01519 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01520"></a>01520 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01521"></a>01521 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01522"></a>01522 <span class="comment">/* 160 */</span> 278, 722, 333, 611, 556, 611, 667, 556, -<a name="l01523"></a>01523 <span class="comment">/* 168 */</span> 333, 667, 667, 611, 611, 333, 611, 611, -<a name="l01524"></a>01524 <span class="comment">/* 176 */</span> 333, 556, 333, 278, 333, 384, 556, 333, -<a name="l01525"></a>01525 <span class="comment">/* 184 */</span> 333, 556, 556, 404, 500, 333, 500, 500, -<a name="l01526"></a>01526 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 611, 722, 722, -<a name="l01527"></a>01527 <span class="comment">/* 200 */</span> 722, 667, 667, 667, 667, 278, 278, 722, -<a name="l01528"></a>01528 <span class="comment">/* 208 */</span> 722, 722, 722, 778, 778, 778, 778, 584, -<a name="l01529"></a>01529 <span class="comment">/* 216 */</span> 722, 722, 722, 722, 722, 667, 611, 611, -<a name="l01530"></a>01530 <span class="comment">/* 224 */</span> 389, 556, 556, 556, 556, 278, 556, 556, -<a name="l01531"></a>01531 <span class="comment">/* 232 */</span> 556, 556, 556, 556, 556, 278, 278, 722, -<a name="l01532"></a>01532 <span class="comment">/* 240 */</span> 611, 611, 611, 611, 611, 611, 611, 584, -<a name="l01533"></a>01533 <span class="comment">/* 248 */</span> 389, 611, 611, 611, 611, 556, 333, 333, -<a name="l01534"></a>01534 }, -<a name="l01535"></a>01535 { <span class="comment">/* Palatino-Roman */</span> -<a name="l01536"></a>01536 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01537"></a>01537 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01538"></a>01538 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01539"></a>01539 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01540"></a>01540 <span class="comment">/* 32 */</span> 250, 278, 371, 500, 500, 840, 778, 208, -<a name="l01541"></a>01541 <span class="comment">/* 40 */</span> 333, 333, 389, 606, 250, 333, 250, 606, -<a name="l01542"></a>01542 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01543"></a>01543 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l01544"></a>01544 <span class="comment">/* 64 */</span> 747, 778, 611, 709, 774, 611, 556, 763, -<a name="l01545"></a>01545 <span class="comment">/* 72 */</span> 832, 337, 333, 726, 611, 946, 831, 786, -<a name="l01546"></a>01546 <span class="comment">/* 80 */</span> 604, 786, 668, 525, 613, 778, 722, 1000, -<a name="l01547"></a>01547 <span class="comment">/* 88 */</span> 667, 667, 667, 333, 606, 333, 606, 500, -<a name="l01548"></a>01548 <span class="comment">/* 96 */</span> 333, 500, 553, 444, 611, 479, 333, 556, -<a name="l01549"></a>01549 <span class="comment">/* 104 */</span> 582, 291, 234, 556, 291, 883, 582, 546, -<a name="l01550"></a>01550 <span class="comment">/* 112 */</span> 601, 560, 395, 424, 326, 603, 565, 834, -<a name="l01551"></a>01551 <span class="comment">/* 120 */</span> 516, 556, 500, 333, 606, 333, 606, 0, -<a name="l01552"></a>01552 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01553"></a>01553 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01554"></a>01554 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01555"></a>01555 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01556"></a>01556 <span class="comment">/* 160 */</span> 250, 778, 333, 611, 500, 611, 525, 500, -<a name="l01557"></a>01557 <span class="comment">/* 168 */</span> 333, 525, 525, 613, 667, 333, 667, 667, -<a name="l01558"></a>01558 <span class="comment">/* 176 */</span> 333, 500, 313, 291, 333, 375, 424, 333, -<a name="l01559"></a>01559 <span class="comment">/* 184 */</span> 333, 424, 424, 375, 500, 380, 500, 500, -<a name="l01560"></a>01560 <span class="comment">/* 192 */</span> 668, 778, 778, 778, 778, 611, 709, 709, -<a name="l01561"></a>01561 <span class="comment">/* 200 */</span> 709, 611, 611, 611, 611, 337, 337, 774, -<a name="l01562"></a>01562 <span class="comment">/* 208 */</span> 774, 831, 831, 786, 786, 786, 786, 606, -<a name="l01563"></a>01563 <span class="comment">/* 216 */</span> 668, 778, 778, 778, 778, 667, 613, 556, -<a name="l01564"></a>01564 <span class="comment">/* 224 */</span> 395, 500, 500, 500, 500, 291, 444, 444, -<a name="l01565"></a>01565 <span class="comment">/* 232 */</span> 444, 479, 479, 479, 479, 287, 287, 671, -<a name="l01566"></a>01566 <span class="comment">/* 240 */</span> 611, 582, 582, 546, 546, 546, 546, 606, -<a name="l01567"></a>01567 <span class="comment">/* 248 */</span> 395, 603, 603, 603, 603, 556, 326, 250, -<a name="l01568"></a>01568 }, -<a name="l01569"></a>01569 { <span class="comment">/* Palatino-Bold */</span> -<a name="l01570"></a>01570 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01571"></a>01571 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01572"></a>01572 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01573"></a>01573 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01574"></a>01574 <span class="comment">/* 32 */</span> 250, 278, 402, 500, 500, 889, 833, 227, -<a name="l01575"></a>01575 <span class="comment">/* 40 */</span> 333, 333, 444, 606, 250, 333, 250, 296, -<a name="l01576"></a>01576 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01577"></a>01577 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l01578"></a>01578 <span class="comment">/* 64 */</span> 747, 778, 667, 722, 833, 611, 556, 833, -<a name="l01579"></a>01579 <span class="comment">/* 72 */</span> 833, 389, 389, 778, 611, 1000, 833, 833, -<a name="l01580"></a>01580 <span class="comment">/* 80 */</span> 611, 833, 722, 611, 667, 778, 778, 1000, -<a name="l01581"></a>01581 <span class="comment">/* 88 */</span> 667, 667, 667, 333, 606, 333, 606, 500, -<a name="l01582"></a>01582 <span class="comment">/* 96 */</span> 333, 500, 611, 444, 611, 500, 389, 556, -<a name="l01583"></a>01583 <span class="comment">/* 104 */</span> 611, 333, 333, 611, 333, 889, 611, 556, -<a name="l01584"></a>01584 <span class="comment">/* 112 */</span> 611, 611, 389, 444, 333, 611, 556, 833, -<a name="l01585"></a>01585 <span class="comment">/* 120 */</span> 500, 556, 500, 310, 606, 310, 606, 0, -<a name="l01586"></a>01586 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01587"></a>01587 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01588"></a>01588 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01589"></a>01589 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01590"></a>01590 <span class="comment">/* 160 */</span> 250, 778, 333, 611, 500, 611, 611, 500, -<a name="l01591"></a>01591 <span class="comment">/* 168 */</span> 333, 611, 611, 667, 667, 333, 667, 667, -<a name="l01592"></a>01592 <span class="comment">/* 176 */</span> 333, 500, 333, 333, 333, 433, 444, 333, -<a name="l01593"></a>01593 <span class="comment">/* 184 */</span> 333, 444, 444, 402, 500, 333, 500, 500, -<a name="l01594"></a>01594 <span class="comment">/* 192 */</span> 722, 778, 778, 778, 778, 611, 722, 722, -<a name="l01595"></a>01595 <span class="comment">/* 200 */</span> 722, 611, 611, 611, 611, 389, 389, 833, -<a name="l01596"></a>01596 <span class="comment">/* 208 */</span> 833, 833, 833, 833, 833, 833, 833, 606, -<a name="l01597"></a>01597 <span class="comment">/* 216 */</span> 722, 778, 778, 778, 778, 667, 667, 611, -<a name="l01598"></a>01598 <span class="comment">/* 224 */</span> 389, 500, 500, 500, 500, 333, 444, 444, -<a name="l01599"></a>01599 <span class="comment">/* 232 */</span> 444, 500, 500, 500, 500, 333, 333, 711, -<a name="l01600"></a>01600 <span class="comment">/* 240 */</span> 611, 611, 611, 556, 556, 556, 556, 606, -<a name="l01601"></a>01601 <span class="comment">/* 248 */</span> 389, 611, 611, 611, 611, 556, 333, 333, -<a name="l01602"></a>01602 }, -<a name="l01603"></a>01603 { <span class="comment">/* Palatino-Italic */</span> -<a name="l01604"></a>01604 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01605"></a>01605 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01606"></a>01606 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01607"></a>01607 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01608"></a>01608 <span class="comment">/* 32 */</span> 250, 333, 500, 500, 500, 889, 778, 333, -<a name="l01609"></a>01609 <span class="comment">/* 40 */</span> 333, 333, 389, 606, 250, 333, 250, 296, -<a name="l01610"></a>01610 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01611"></a>01611 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 500, -<a name="l01612"></a>01612 <span class="comment">/* 64 */</span> 747, 722, 611, 667, 778, 611, 556, 722, -<a name="l01613"></a>01613 <span class="comment">/* 72 */</span> 778, 333, 333, 667, 556, 944, 778, 778, -<a name="l01614"></a>01614 <span class="comment">/* 80 */</span> 611, 778, 667, 556, 611, 778, 722, 944, -<a name="l01615"></a>01615 <span class="comment">/* 88 */</span> 722, 667, 667, 333, 606, 333, 606, 500, -<a name="l01616"></a>01616 <span class="comment">/* 96 */</span> 333, 444, 463, 407, 500, 389, 278, 500, -<a name="l01617"></a>01617 <span class="comment">/* 104 */</span> 500, 278, 278, 444, 278, 778, 556, 444, -<a name="l01618"></a>01618 <span class="comment">/* 112 */</span> 500, 463, 389, 389, 333, 556, 500, 722, -<a name="l01619"></a>01619 <span class="comment">/* 120 */</span> 500, 500, 444, 333, 606, 333, 606, 0, -<a name="l01620"></a>01620 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01621"></a>01621 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01622"></a>01622 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01623"></a>01623 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01624"></a>01624 <span class="comment">/* 160 */</span> 250, 722, 333, 556, 500, 556, 556, 500, -<a name="l01625"></a>01625 <span class="comment">/* 168 */</span> 333, 556, 556, 611, 667, 333, 667, 667, -<a name="l01626"></a>01626 <span class="comment">/* 176 */</span> 333, 444, 333, 278, 333, 346, 389, 333, -<a name="l01627"></a>01627 <span class="comment">/* 184 */</span> 333, 389, 389, 361, 444, 333, 444, 444, -<a name="l01628"></a>01628 <span class="comment">/* 192 */</span> 667, 722, 722, 722, 722, 556, 667, 667, -<a name="l01629"></a>01629 <span class="comment">/* 200 */</span> 667, 611, 611, 611, 611, 333, 333, 778, -<a name="l01630"></a>01630 <span class="comment">/* 208 */</span> 778, 778, 778, 778, 778, 778, 778, 606, -<a name="l01631"></a>01631 <span class="comment">/* 216 */</span> 667, 778, 778, 778, 778, 667, 611, 500, -<a name="l01632"></a>01632 <span class="comment">/* 224 */</span> 389, 444, 444, 444, 444, 278, 407, 407, -<a name="l01633"></a>01633 <span class="comment">/* 232 */</span> 407, 389, 389, 389, 389, 278, 278, 577, -<a name="l01634"></a>01634 <span class="comment">/* 240 */</span> 500, 556, 556, 444, 444, 444, 444, 606, -<a name="l01635"></a>01635 <span class="comment">/* 248 */</span> 389, 556, 556, 556, 556, 500, 333, 333, -<a name="l01636"></a>01636 }, -<a name="l01637"></a>01637 { <span class="comment">/* Palatino-BoldItalic */</span> -<a name="l01638"></a>01638 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01639"></a>01639 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01640"></a>01640 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01641"></a>01641 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01642"></a>01642 <span class="comment">/* 32 */</span> 250, 333, 500, 500, 500, 889, 833, 250, -<a name="l01643"></a>01643 <span class="comment">/* 40 */</span> 333, 333, 444, 606, 250, 389, 250, 315, -<a name="l01644"></a>01644 <span class="comment">/* 48 */</span> 500, 500, 500, 500, 500, 500, 500, 500, -<a name="l01645"></a>01645 <span class="comment">/* 56 */</span> 500, 500, 250, 250, 606, 606, 606, 444, -<a name="l01646"></a>01646 <span class="comment">/* 64 */</span> 833, 722, 667, 685, 778, 611, 556, 778, -<a name="l01647"></a>01647 <span class="comment">/* 72 */</span> 778, 389, 389, 722, 611, 944, 778, 833, -<a name="l01648"></a>01648 <span class="comment">/* 80 */</span> 667, 833, 722, 556, 611, 778, 667, 1000, -<a name="l01649"></a>01649 <span class="comment">/* 88 */</span> 722, 611, 667, 333, 606, 333, 606, 500, -<a name="l01650"></a>01650 <span class="comment">/* 96 */</span> 333, 556, 537, 444, 556, 444, 333, 500, -<a name="l01651"></a>01651 <span class="comment">/* 104 */</span> 556, 333, 333, 556, 333, 833, 556, 556, -<a name="l01652"></a>01652 <span class="comment">/* 112 */</span> 556, 537, 389, 444, 389, 556, 556, 833, -<a name="l01653"></a>01653 <span class="comment">/* 120 */</span> 500, 556, 500, 333, 606, 333, 606, 0, -<a name="l01654"></a>01654 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01655"></a>01655 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01656"></a>01656 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01657"></a>01657 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01658"></a>01658 <span class="comment">/* 160 */</span> 250, 722, 333, 611, 500, 611, 556, 556, -<a name="l01659"></a>01659 <span class="comment">/* 168 */</span> 333, 556, 556, 611, 667, 389, 667, 667, -<a name="l01660"></a>01660 <span class="comment">/* 176 */</span> 556, 556, 333, 333, 333, 429, 444, 333, -<a name="l01661"></a>01661 <span class="comment">/* 184 */</span> 333, 444, 444, 389, 500, 333, 500, 500, -<a name="l01662"></a>01662 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 611, 685, 685, -<a name="l01663"></a>01663 <span class="comment">/* 200 */</span> 685, 611, 611, 611, 611, 389, 389, 778, -<a name="l01664"></a>01664 <span class="comment">/* 208 */</span> 778, 778, 778, 833, 833, 833, 833, 606, -<a name="l01665"></a>01665 <span class="comment">/* 216 */</span> 722, 778, 778, 778, 778, 611, 611, 556, -<a name="l01666"></a>01666 <span class="comment">/* 224 */</span> 389, 556, 556, 556, 556, 333, 444, 444, -<a name="l01667"></a>01667 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 333, 333, 667, -<a name="l01668"></a>01668 <span class="comment">/* 240 */</span> 556, 556, 556, 556, 556, 556, 556, 606, -<a name="l01669"></a>01669 <span class="comment">/* 248 */</span> 389, 556, 556, 556, 556, 556, 389, 333, -<a name="l01670"></a>01670 }, -<a name="l01671"></a>01671 { <span class="comment">/* Helvetica-Narrow */</span> -<a name="l01672"></a>01672 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01673"></a>01673 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01674"></a>01674 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01675"></a>01675 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01676"></a>01676 <span class="comment">/* 32 */</span> 228, 228, 291, 456, 456, 729, 547, 157, -<a name="l01677"></a>01677 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l01678"></a>01678 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l01679"></a>01679 <span class="comment">/* 56 */</span> 456, 456, 228, 228, 479, 479, 479, 456, -<a name="l01680"></a>01680 <span class="comment">/* 64 */</span> 832, 547, 547, 592, 592, 547, 501, 638, -<a name="l01681"></a>01681 <span class="comment">/* 72 */</span> 592, 228, 410, 547, 456, 683, 592, 638, -<a name="l01682"></a>01682 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l01683"></a>01683 <span class="comment">/* 88 */</span> 547, 547, 501, 228, 228, 228, 385, 456, -<a name="l01684"></a>01684 <span class="comment">/* 96 */</span> 273, 456, 456, 410, 456, 456, 228, 456, -<a name="l01685"></a>01685 <span class="comment">/* 104 */</span> 456, 182, 182, 410, 182, 683, 456, 456, -<a name="l01686"></a>01686 <span class="comment">/* 112 */</span> 456, 456, 273, 410, 228, 456, 410, 592, -<a name="l01687"></a>01687 <span class="comment">/* 120 */</span> 410, 410, 410, 274, 213, 274, 479, 0, -<a name="l01688"></a>01688 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01689"></a>01689 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01690"></a>01690 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01691"></a>01691 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01692"></a>01692 <span class="comment">/* 160 */</span> 228, 547, 273, 456, 456, 456, 547, 456, -<a name="l01693"></a>01693 <span class="comment">/* 168 */</span> 273, 547, 547, 501, 501, 273, 501, 501, -<a name="l01694"></a>01694 <span class="comment">/* 176 */</span> 273, 456, 273, 182, 273, 212, 410, 273, -<a name="l01695"></a>01695 <span class="comment">/* 184 */</span> 273, 410, 410, 248, 410, 273, 410, 410, -<a name="l01696"></a>01696 <span class="comment">/* 192 */</span> 592, 547, 547, 547, 547, 456, 592, 592, -<a name="l01697"></a>01697 <span class="comment">/* 200 */</span> 592, 547, 547, 547, 547, 228, 228, 592, -<a name="l01698"></a>01698 <span class="comment">/* 208 */</span> 592, 592, 592, 638, 638, 638, 638, 479, -<a name="l01699"></a>01699 <span class="comment">/* 216 */</span> 592, 592, 592, 592, 592, 547, 501, 501, -<a name="l01700"></a>01700 <span class="comment">/* 224 */</span> 273, 456, 456, 456, 456, 182, 410, 410, -<a name="l01701"></a>01701 <span class="comment">/* 232 */</span> 410, 456, 456, 456, 456, 228, 228, 496, -<a name="l01702"></a>01702 <span class="comment">/* 240 */</span> 456, 456, 456, 456, 456, 456, 456, 479, -<a name="l01703"></a>01703 <span class="comment">/* 248 */</span> 273, 456, 456, 456, 456, 410, 228, 273, -<a name="l01704"></a>01704 }, -<a name="l01705"></a>01705 { <span class="comment">/* Helvetica-Narrow-Bold */</span> -<a name="l01706"></a>01706 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01707"></a>01707 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01708"></a>01708 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01709"></a>01709 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01710"></a>01710 <span class="comment">/* 32 */</span> 228, 273, 389, 456, 456, 729, 592, 195, -<a name="l01711"></a>01711 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l01712"></a>01712 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l01713"></a>01713 <span class="comment">/* 56 */</span> 456, 456, 273, 273, 479, 479, 479, 501, -<a name="l01714"></a>01714 <span class="comment">/* 64 */</span> 800, 592, 592, 592, 592, 547, 501, 638, -<a name="l01715"></a>01715 <span class="comment">/* 72 */</span> 592, 228, 456, 592, 501, 683, 592, 638, -<a name="l01716"></a>01716 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l01717"></a>01717 <span class="comment">/* 88 */</span> 547, 547, 501, 273, 228, 273, 479, 456, -<a name="l01718"></a>01718 <span class="comment">/* 96 */</span> 273, 456, 501, 456, 501, 456, 273, 501, -<a name="l01719"></a>01719 <span class="comment">/* 104 */</span> 501, 228, 228, 456, 228, 729, 501, 501, -<a name="l01720"></a>01720 <span class="comment">/* 112 */</span> 501, 501, 319, 456, 273, 501, 456, 638, -<a name="l01721"></a>01721 <span class="comment">/* 120 */</span> 456, 456, 410, 319, 230, 319, 479, 0, -<a name="l01722"></a>01722 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01723"></a>01723 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01724"></a>01724 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01725"></a>01725 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01726"></a>01726 <span class="comment">/* 160 */</span> 228, 592, 273, 501, 456, 501, 547, 456, -<a name="l01727"></a>01727 <span class="comment">/* 168 */</span> 273, 547, 547, 501, 501, 273, 501, 501, -<a name="l01728"></a>01728 <span class="comment">/* 176 */</span> 273, 456, 273, 228, 273, 280, 456, 273, -<a name="l01729"></a>01729 <span class="comment">/* 184 */</span> 273, 456, 456, 338, 410, 273, 410, 410, -<a name="l01730"></a>01730 <span class="comment">/* 192 */</span> 592, 592, 592, 592, 592, 501, 592, 592, -<a name="l01731"></a>01731 <span class="comment">/* 200 */</span> 592, 547, 547, 547, 547, 228, 228, 592, -<a name="l01732"></a>01732 <span class="comment">/* 208 */</span> 592, 592, 592, 638, 638, 638, 638, 479, -<a name="l01733"></a>01733 <span class="comment">/* 216 */</span> 592, 592, 592, 592, 592, 547, 501, 501, -<a name="l01734"></a>01734 <span class="comment">/* 224 */</span> 319, 456, 456, 456, 456, 228, 456, 456, -<a name="l01735"></a>01735 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 456, 228, 228, 561, -<a name="l01736"></a>01736 <span class="comment">/* 240 */</span> 501, 501, 501, 501, 501, 501, 501, 479, -<a name="l01737"></a>01737 <span class="comment">/* 248 */</span> 319, 501, 501, 501, 501, 456, 273, 273, -<a name="l01738"></a>01738 }, -<a name="l01739"></a>01739 { <span class="comment">/* Helvetica-Narrow-Oblique */</span> -<a name="l01740"></a>01740 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01741"></a>01741 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01742"></a>01742 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01743"></a>01743 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01744"></a>01744 <span class="comment">/* 32 */</span> 228, 228, 291, 456, 456, 729, 547, 157, -<a name="l01745"></a>01745 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l01746"></a>01746 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l01747"></a>01747 <span class="comment">/* 56 */</span> 456, 456, 228, 228, 479, 479, 479, 456, -<a name="l01748"></a>01748 <span class="comment">/* 64 */</span> 832, 547, 547, 592, 592, 547, 501, 638, -<a name="l01749"></a>01749 <span class="comment">/* 72 */</span> 592, 228, 410, 547, 456, 683, 592, 638, -<a name="l01750"></a>01750 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l01751"></a>01751 <span class="comment">/* 88 */</span> 547, 547, 501, 228, 228, 228, 385, 456, -<a name="l01752"></a>01752 <span class="comment">/* 96 */</span> 273, 456, 456, 410, 456, 456, 228, 456, -<a name="l01753"></a>01753 <span class="comment">/* 104 */</span> 456, 182, 182, 410, 182, 683, 456, 456, -<a name="l01754"></a>01754 <span class="comment">/* 112 */</span> 456, 456, 273, 410, 228, 456, 410, 592, -<a name="l01755"></a>01755 <span class="comment">/* 120 */</span> 410, 410, 410, 274, 213, 274, 479, 0, -<a name="l01756"></a>01756 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01757"></a>01757 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01758"></a>01758 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01759"></a>01759 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01760"></a>01760 <span class="comment">/* 160 */</span> 228, 547, 273, 456, 456, 456, 547, 456, -<a name="l01761"></a>01761 <span class="comment">/* 168 */</span> 273, 547, 547, 501, 501, 273, 501, 501, -<a name="l01762"></a>01762 <span class="comment">/* 176 */</span> 273, 456, 273, 182, 273, 217, 410, 273, -<a name="l01763"></a>01763 <span class="comment">/* 184 */</span> 273, 410, 410, 254, 410, 273, 410, 410, -<a name="l01764"></a>01764 <span class="comment">/* 192 */</span> 592, 547, 547, 547, 547, 456, 592, 592, -<a name="l01765"></a>01765 <span class="comment">/* 200 */</span> 592, 547, 547, 547, 547, 228, 228, 592, -<a name="l01766"></a>01766 <span class="comment">/* 208 */</span> 592, 592, 592, 638, 638, 638, 638, 479, -<a name="l01767"></a>01767 <span class="comment">/* 216 */</span> 592, 592, 592, 592, 592, 547, 501, 501, -<a name="l01768"></a>01768 <span class="comment">/* 224 */</span> 273, 456, 456, 456, 456, 182, 410, 410, -<a name="l01769"></a>01769 <span class="comment">/* 232 */</span> 410, 456, 456, 456, 456, 228, 228, 503, -<a name="l01770"></a>01770 <span class="comment">/* 240 */</span> 456, 456, 456, 456, 456, 456, 456, 479, -<a name="l01771"></a>01771 <span class="comment">/* 248 */</span> 273, 456, 456, 456, 456, 410, 228, 273, -<a name="l01772"></a>01772 }, -<a name="l01773"></a>01773 { <span class="comment">/* Helvetica-Narrow-BoldOblique */</span> -<a name="l01774"></a>01774 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01775"></a>01775 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01776"></a>01776 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01777"></a>01777 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01778"></a>01778 <span class="comment">/* 32 */</span> 228, 273, 389, 456, 456, 729, 592, 195, -<a name="l01779"></a>01779 <span class="comment">/* 40 */</span> 273, 273, 319, 479, 228, 273, 228, 228, -<a name="l01780"></a>01780 <span class="comment">/* 48 */</span> 456, 456, 456, 456, 456, 456, 456, 456, -<a name="l01781"></a>01781 <span class="comment">/* 56 */</span> 456, 456, 273, 273, 479, 479, 479, 501, -<a name="l01782"></a>01782 <span class="comment">/* 64 */</span> 800, 592, 592, 592, 592, 547, 501, 638, -<a name="l01783"></a>01783 <span class="comment">/* 72 */</span> 592, 228, 456, 592, 501, 683, 592, 638, -<a name="l01784"></a>01784 <span class="comment">/* 80 */</span> 547, 638, 592, 547, 501, 592, 547, 774, -<a name="l01785"></a>01785 <span class="comment">/* 88 */</span> 547, 547, 501, 273, 228, 273, 479, 456, -<a name="l01786"></a>01786 <span class="comment">/* 96 */</span> 273, 456, 501, 456, 501, 456, 273, 501, -<a name="l01787"></a>01787 <span class="comment">/* 104 */</span> 501, 228, 228, 456, 228, 729, 501, 501, -<a name="l01788"></a>01788 <span class="comment">/* 112 */</span> 501, 501, 319, 456, 273, 501, 456, 638, -<a name="l01789"></a>01789 <span class="comment">/* 120 */</span> 456, 456, 410, 319, 230, 319, 479, 0, -<a name="l01790"></a>01790 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01791"></a>01791 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01792"></a>01792 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01793"></a>01793 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01794"></a>01794 <span class="comment">/* 160 */</span> 228, 592, 273, 501, 456, 501, 547, 456, -<a name="l01795"></a>01795 <span class="comment">/* 168 */</span> 273, 547, 547, 501, 501, 273, 501, 501, -<a name="l01796"></a>01796 <span class="comment">/* 176 */</span> 273, 456, 273, 228, 273, 283, 456, 273, -<a name="l01797"></a>01797 <span class="comment">/* 184 */</span> 273, 456, 456, 312, 410, 273, 410, 410, -<a name="l01798"></a>01798 <span class="comment">/* 192 */</span> 592, 592, 592, 592, 592, 501, 592, 592, -<a name="l01799"></a>01799 <span class="comment">/* 200 */</span> 592, 547, 547, 547, 547, 228, 228, 592, -<a name="l01800"></a>01800 <span class="comment">/* 208 */</span> 592, 592, 592, 638, 638, 638, 638, 479, -<a name="l01801"></a>01801 <span class="comment">/* 216 */</span> 592, 592, 592, 592, 592, 547, 501, 501, -<a name="l01802"></a>01802 <span class="comment">/* 224 */</span> 319, 456, 456, 456, 456, 228, 456, 456, -<a name="l01803"></a>01803 <span class="comment">/* 232 */</span> 456, 456, 456, 456, 456, 228, 228, 561, -<a name="l01804"></a>01804 <span class="comment">/* 240 */</span> 501, 501, 501, 501, 501, 501, 501, 479, -<a name="l01805"></a>01805 <span class="comment">/* 248 */</span> 319, 501, 501, 501, 501, 456, 273, 273, -<a name="l01806"></a>01806 }, -<a name="l01807"></a>01807 { <span class="comment">/* Bookman-Light */</span> -<a name="l01808"></a>01808 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01809"></a>01809 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01810"></a>01810 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01811"></a>01811 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01812"></a>01812 <span class="comment">/* 32 */</span> 320, 300, 380, 620, 620, 900, 800, 220, -<a name="l01813"></a>01813 <span class="comment">/* 40 */</span> 300, 300, 440, 600, 320, 400, 320, 600, -<a name="l01814"></a>01814 <span class="comment">/* 48 */</span> 620, 620, 620, 620, 620, 620, 620, 620, -<a name="l01815"></a>01815 <span class="comment">/* 56 */</span> 620, 620, 320, 320, 600, 600, 600, 540, -<a name="l01816"></a>01816 <span class="comment">/* 64 */</span> 820, 680, 740, 740, 800, 720, 640, 800, -<a name="l01817"></a>01817 <span class="comment">/* 72 */</span> 800, 340, 600, 720, 600, 920, 740, 800, -<a name="l01818"></a>01818 <span class="comment">/* 80 */</span> 620, 820, 720, 660, 620, 780, 700, 960, -<a name="l01819"></a>01819 <span class="comment">/* 88 */</span> 720, 640, 640, 300, 600, 300, 600, 500, -<a name="l01820"></a>01820 <span class="comment">/* 96 */</span> 340, 580, 620, 520, 620, 520, 320, 540, -<a name="l01821"></a>01821 <span class="comment">/* 104 */</span> 660, 300, 300, 620, 300, 940, 660, 560, -<a name="l01822"></a>01822 <span class="comment">/* 112 */</span> 620, 580, 440, 520, 380, 680, 520, 780, -<a name="l01823"></a>01823 <span class="comment">/* 120 */</span> 560, 540, 480, 280, 600, 280, 600, 0, -<a name="l01824"></a>01824 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01825"></a>01825 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01826"></a>01826 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01827"></a>01827 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01828"></a>01828 <span class="comment">/* 160 */</span> 320, 680, 460, 600, 620, 600, 660, 520, -<a name="l01829"></a>01829 <span class="comment">/* 168 */</span> 420, 660, 660, 620, 640, 400, 640, 640, -<a name="l01830"></a>01830 <span class="comment">/* 176 */</span> 320, 580, 320, 320, 340, 336, 520, 420, -<a name="l01831"></a>01831 <span class="comment">/* 184 */</span> 320, 520, 520, 380, 480, 380, 480, 480, -<a name="l01832"></a>01832 <span class="comment">/* 192 */</span> 720, 680, 680, 680, 680, 600, 740, 740, -<a name="l01833"></a>01833 <span class="comment">/* 200 */</span> 740, 720, 720, 720, 720, 340, 340, 800, -<a name="l01834"></a>01834 <span class="comment">/* 208 */</span> 800, 740, 740, 800, 800, 800, 800, 600, -<a name="l01835"></a>01835 <span class="comment">/* 216 */</span> 720, 780, 780, 780, 780, 640, 620, 660, -<a name="l01836"></a>01836 <span class="comment">/* 224 */</span> 440, 580, 580, 580, 580, 300, 520, 520, -<a name="l01837"></a>01837 <span class="comment">/* 232 */</span> 520, 520, 520, 520, 520, 300, 300, 620, -<a name="l01838"></a>01838 <span class="comment">/* 240 */</span> 620, 660, 660, 560, 560, 560, 560, 600, -<a name="l01839"></a>01839 <span class="comment">/* 248 */</span> 440, 680, 680, 680, 680, 540, 380, 260, -<a name="l01840"></a>01840 }, -<a name="l01841"></a>01841 { <span class="comment">/* Bookman-Demi */</span> -<a name="l01842"></a>01842 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01843"></a>01843 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01844"></a>01844 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01845"></a>01845 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01846"></a>01846 <span class="comment">/* 32 */</span> 340, 360, 420, 660, 660, 940, 800, 240, -<a name="l01847"></a>01847 <span class="comment">/* 40 */</span> 320, 320, 460, 600, 340, 360, 340, 600, -<a name="l01848"></a>01848 <span class="comment">/* 48 */</span> 660, 660, 660, 660, 660, 660, 660, 660, -<a name="l01849"></a>01849 <span class="comment">/* 56 */</span> 660, 660, 340, 340, 600, 600, 600, 660, -<a name="l01850"></a>01850 <span class="comment">/* 64 */</span> 820, 720, 720, 740, 780, 720, 680, 780, -<a name="l01851"></a>01851 <span class="comment">/* 72 */</span> 820, 400, 640, 800, 640, 940, 740, 800, -<a name="l01852"></a>01852 <span class="comment">/* 80 */</span> 660, 800, 780, 660, 700, 740, 720, 940, -<a name="l01853"></a>01853 <span class="comment">/* 88 */</span> 780, 700, 640, 300, 600, 300, 600, 500, -<a name="l01854"></a>01854 <span class="comment">/* 96 */</span> 400, 580, 600, 580, 640, 580, 380, 580, -<a name="l01855"></a>01855 <span class="comment">/* 104 */</span> 680, 360, 340, 660, 340, 1000, 680, 620, -<a name="l01856"></a>01856 <span class="comment">/* 112 */</span> 640, 620, 460, 520, 460, 660, 600, 800, -<a name="l01857"></a>01857 <span class="comment">/* 120 */</span> 600, 620, 560, 320, 600, 320, 600, 0, -<a name="l01858"></a>01858 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01859"></a>01859 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01860"></a>01860 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01861"></a>01861 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01862"></a>01862 <span class="comment">/* 160 */</span> 340, 720, 500, 640, 660, 640, 660, 600, -<a name="l01863"></a>01863 <span class="comment">/* 168 */</span> 500, 660, 660, 700, 640, 360, 640, 640, -<a name="l01864"></a>01864 <span class="comment">/* 176 */</span> 340, 580, 320, 340, 400, 430, 520, 500, -<a name="l01865"></a>01865 <span class="comment">/* 184 */</span> 360, 520, 520, 470, 560, 440, 560, 560, -<a name="l01866"></a>01866 <span class="comment">/* 192 */</span> 780, 720, 720, 720, 720, 640, 740, 740, -<a name="l01867"></a>01867 <span class="comment">/* 200 */</span> 740, 720, 720, 720, 720, 400, 400, 780, -<a name="l01868"></a>01868 <span class="comment">/* 208 */</span> 780, 740, 740, 800, 800, 800, 800, 600, -<a name="l01869"></a>01869 <span class="comment">/* 216 */</span> 780, 740, 740, 740, 740, 700, 700, 660, -<a name="l01870"></a>01870 <span class="comment">/* 224 */</span> 460, 580, 580, 580, 580, 340, 580, 580, -<a name="l01871"></a>01871 <span class="comment">/* 232 */</span> 580, 580, 580, 580, 580, 360, 360, 720, -<a name="l01872"></a>01872 <span class="comment">/* 240 */</span> 640, 680, 680, 620, 620, 620, 620, 600, -<a name="l01873"></a>01873 <span class="comment">/* 248 */</span> 460, 660, 660, 660, 660, 620, 460, 320, -<a name="l01874"></a>01874 }, -<a name="l01875"></a>01875 { <span class="comment">/* Bookman-LightItalic */</span> -<a name="l01876"></a>01876 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01877"></a>01877 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01878"></a>01878 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01879"></a>01879 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01880"></a>01880 <span class="comment">/* 32 */</span> 300, 320, 360, 620, 620, 800, 820, 200, -<a name="l01881"></a>01881 <span class="comment">/* 40 */</span> 280, 280, 440, 600, 300, 320, 300, 600, -<a name="l01882"></a>01882 <span class="comment">/* 48 */</span> 620, 620, 620, 620, 620, 620, 620, 620, -<a name="l01883"></a>01883 <span class="comment">/* 56 */</span> 620, 620, 300, 300, 600, 600, 600, 540, -<a name="l01884"></a>01884 <span class="comment">/* 64 */</span> 780, 700, 720, 720, 740, 680, 620, 760, -<a name="l01885"></a>01885 <span class="comment">/* 72 */</span> 800, 320, 560, 720, 580, 860, 720, 760, -<a name="l01886"></a>01886 <span class="comment">/* 80 */</span> 600, 780, 700, 640, 600, 720, 680, 960, -<a name="l01887"></a>01887 <span class="comment">/* 88 */</span> 700, 660, 580, 260, 600, 260, 600, 500, -<a name="l01888"></a>01888 <span class="comment">/* 96 */</span> 340, 620, 600, 480, 640, 540, 340, 560, -<a name="l01889"></a>01889 <span class="comment">/* 104 */</span> 620, 280, 280, 600, 280, 880, 620, 540, -<a name="l01890"></a>01890 <span class="comment">/* 112 */</span> 600, 560, 400, 540, 340, 620, 540, 880, -<a name="l01891"></a>01891 <span class="comment">/* 120 */</span> 540, 600, 520, 360, 600, 380, 600, 0, -<a name="l01892"></a>01892 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01893"></a>01893 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01894"></a>01894 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01895"></a>01895 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01896"></a>01896 <span class="comment">/* 160 */</span> 300, 700, 440, 580, 620, 580, 640, 620, -<a name="l01897"></a>01897 <span class="comment">/* 168 */</span> 420, 640, 640, 600, 580, 320, 580, 580, -<a name="l01898"></a>01898 <span class="comment">/* 176 */</span> 300, 620, 260, 340, 320, 380, 540, 440, -<a name="l01899"></a>01899 <span class="comment">/* 184 */</span> 320, 540, 540, 340, 520, 340, 520, 520, -<a name="l01900"></a>01900 <span class="comment">/* 192 */</span> 700, 700, 700, 700, 700, 580, 720, 720, -<a name="l01901"></a>01901 <span class="comment">/* 200 */</span> 720, 680, 680, 680, 680, 320, 320, 740, -<a name="l01902"></a>01902 <span class="comment">/* 208 */</span> 740, 720, 720, 760, 760, 760, 760, 600, -<a name="l01903"></a>01903 <span class="comment">/* 216 */</span> 700, 720, 720, 720, 720, 660, 600, 620, -<a name="l01904"></a>01904 <span class="comment">/* 224 */</span> 400, 620, 620, 620, 620, 280, 480, 480, -<a name="l01905"></a>01905 <span class="comment">/* 232 */</span> 480, 540, 540, 540, 540, 280, 280, 730, -<a name="l01906"></a>01906 <span class="comment">/* 240 */</span> 640, 620, 620, 540, 540, 540, 540, 600, -<a name="l01907"></a>01907 <span class="comment">/* 248 */</span> 400, 620, 620, 620, 620, 600, 340, 260, -<a name="l01908"></a>01908 }, -<a name="l01909"></a>01909 { <span class="comment">/* Bookman-DemiItalic */</span> -<a name="l01910"></a>01910 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01911"></a>01911 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01912"></a>01912 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01913"></a>01913 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01914"></a>01914 <span class="comment">/* 32 */</span> 340, 320, 380, 680, 680, 880, 980, 180, -<a name="l01915"></a>01915 <span class="comment">/* 40 */</span> 260, 260, 460, 600, 340, 280, 340, 360, -<a name="l01916"></a>01916 <span class="comment">/* 48 */</span> 680, 680, 680, 680, 680, 680, 680, 680, -<a name="l01917"></a>01917 <span class="comment">/* 56 */</span> 680, 680, 340, 340, 620, 600, 620, 620, -<a name="l01918"></a>01918 <span class="comment">/* 64 */</span> 780, 720, 720, 700, 760, 720, 660, 760, -<a name="l01919"></a>01919 <span class="comment">/* 72 */</span> 800, 380, 620, 780, 640, 860, 740, 760, -<a name="l01920"></a>01920 <span class="comment">/* 80 */</span> 640, 760, 740, 700, 700, 740, 660, 1000, -<a name="l01921"></a>01921 <span class="comment">/* 88 */</span> 740, 660, 680, 260, 580, 260, 620, 500, -<a name="l01922"></a>01922 <span class="comment">/* 96 */</span> 380, 680, 600, 560, 680, 560, 420, 620, -<a name="l01923"></a>01923 <span class="comment">/* 104 */</span> 700, 380, 320, 700, 380, 960, 680, 600, -<a name="l01924"></a>01924 <span class="comment">/* 112 */</span> 660, 620, 500, 540, 440, 680, 540, 860, -<a name="l01925"></a>01925 <span class="comment">/* 120 */</span> 620, 600, 560, 300, 620, 300, 620, 0, -<a name="l01926"></a>01926 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01927"></a>01927 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01928"></a>01928 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01929"></a>01929 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01930"></a>01930 <span class="comment">/* 160 */</span> 340, 720, 460, 640, 680, 640, 700, 620, -<a name="l01931"></a>01931 <span class="comment">/* 168 */</span> 520, 700, 700, 700, 680, 280, 680, 680, -<a name="l01932"></a>01932 <span class="comment">/* 176 */</span> 360, 680, 320, 380, 340, 509, 540, 480, -<a name="l01933"></a>01933 <span class="comment">/* 184 */</span> 360, 540, 540, 520, 560, 560, 560, 560, -<a name="l01934"></a>01934 <span class="comment">/* 192 */</span> 740, 720, 720, 720, 720, 640, 700, 700, -<a name="l01935"></a>01935 <span class="comment">/* 200 */</span> 700, 720, 720, 720, 720, 380, 380, 760, -<a name="l01936"></a>01936 <span class="comment">/* 208 */</span> 760, 740, 740, 760, 760, 760, 760, 600, -<a name="l01937"></a>01937 <span class="comment">/* 216 */</span> 740, 740, 740, 740, 740, 660, 700, 660, -<a name="l01938"></a>01938 <span class="comment">/* 224 */</span> 500, 680, 680, 680, 680, 380, 560, 560, -<a name="l01939"></a>01939 <span class="comment">/* 232 */</span> 560, 560, 560, 560, 560, 380, 380, 810, -<a name="l01940"></a>01940 <span class="comment">/* 240 */</span> 680, 680, 680, 600, 600, 600, 600, 600, -<a name="l01941"></a>01941 <span class="comment">/* 248 */</span> 500, 680, 680, 680, 680, 600, 440, 380, -<a name="l01942"></a>01942 }, -<a name="l01943"></a>01943 { <span class="comment">/* AvantGarde-Book */</span> -<a name="l01944"></a>01944 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01945"></a>01945 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01946"></a>01946 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01947"></a>01947 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01948"></a>01948 <span class="comment">/* 32 */</span> 277, 295, 309, 554, 554, 775, 757, 198, -<a name="l01949"></a>01949 <span class="comment">/* 40 */</span> 369, 369, 425, 606, 277, 332, 277, 437, -<a name="l01950"></a>01950 <span class="comment">/* 48 */</span> 554, 554, 554, 554, 554, 554, 554, 554, -<a name="l01951"></a>01951 <span class="comment">/* 56 */</span> 554, 554, 277, 277, 606, 606, 606, 591, -<a name="l01952"></a>01952 <span class="comment">/* 64 */</span> 867, 740, 574, 813, 744, 536, 485, 872, -<a name="l01953"></a>01953 <span class="comment">/* 72 */</span> 683, 226, 482, 591, 462, 919, 740, 869, -<a name="l01954"></a>01954 <span class="comment">/* 80 */</span> 592, 871, 607, 498, 426, 655, 702, 960, -<a name="l01955"></a>01955 <span class="comment">/* 88 */</span> 609, 592, 480, 351, 605, 351, 606, 500, -<a name="l01956"></a>01956 <span class="comment">/* 96 */</span> 378, 683, 682, 647, 685, 650, 314, 673, -<a name="l01957"></a>01957 <span class="comment">/* 104 */</span> 610, 200, 203, 502, 200, 938, 610, 655, -<a name="l01958"></a>01958 <span class="comment">/* 112 */</span> 682, 682, 301, 388, 339, 608, 554, 831, -<a name="l01959"></a>01959 <span class="comment">/* 120 */</span> 480, 536, 425, 351, 672, 351, 606, 0, -<a name="l01960"></a>01960 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01961"></a>01961 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01962"></a>01962 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01963"></a>01963 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01964"></a>01964 <span class="comment">/* 160 */</span> 277, 740, 453, 517, 554, 462, 498, 615, -<a name="l01965"></a>01965 <span class="comment">/* 168 */</span> 369, 498, 498, 426, 480, 332, 480, 480, -<a name="l01966"></a>01966 <span class="comment">/* 176 */</span> 332, 683, 302, 300, 375, 245, 388, 502, -<a name="l01967"></a>01967 <span class="comment">/* 184 */</span> 324, 388, 388, 339, 425, 552, 425, 425, -<a name="l01968"></a>01968 <span class="comment">/* 192 */</span> 607, 740, 740, 740, 740, 462, 813, 813, -<a name="l01969"></a>01969 <span class="comment">/* 200 */</span> 813, 536, 536, 536, 536, 226, 226, 744, -<a name="l01970"></a>01970 <span class="comment">/* 208 */</span> 790, 740, 740, 869, 869, 869, 869, 606, -<a name="l01971"></a>01971 <span class="comment">/* 216 */</span> 607, 655, 655, 655, 655, 592, 426, 554, -<a name="l01972"></a>01972 <span class="comment">/* 224 */</span> 301, 683, 683, 683, 683, 200, 647, 647, -<a name="l01973"></a>01973 <span class="comment">/* 232 */</span> 647, 650, 650, 650, 650, 200, 200, 725, -<a name="l01974"></a>01974 <span class="comment">/* 240 */</span> 685, 610, 610, 655, 655, 655, 655, 606, -<a name="l01975"></a>01975 <span class="comment">/* 248 */</span> 301, 608, 608, 608, 608, 536, 339, 222, -<a name="l01976"></a>01976 }, -<a name="l01977"></a>01977 { <span class="comment">/* AvantGarde-Demi */</span> -<a name="l01978"></a>01978 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01979"></a>01979 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01980"></a>01980 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01981"></a>01981 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01982"></a>01982 <span class="comment">/* 32 */</span> 280, 280, 360, 560, 560, 860, 680, 220, -<a name="l01983"></a>01983 <span class="comment">/* 40 */</span> 380, 380, 440, 600, 280, 420, 280, 460, -<a name="l01984"></a>01984 <span class="comment">/* 48 */</span> 560, 560, 560, 560, 560, 560, 560, 560, -<a name="l01985"></a>01985 <span class="comment">/* 56 */</span> 560, 560, 280, 280, 600, 600, 600, 560, -<a name="l01986"></a>01986 <span class="comment">/* 64 */</span> 740, 740, 580, 780, 700, 520, 480, 840, -<a name="l01987"></a>01987 <span class="comment">/* 72 */</span> 680, 280, 480, 620, 440, 900, 740, 840, -<a name="l01988"></a>01988 <span class="comment">/* 80 */</span> 560, 840, 580, 520, 420, 640, 700, 900, -<a name="l01989"></a>01989 <span class="comment">/* 88 */</span> 680, 620, 500, 320, 640, 320, 600, 500, -<a name="l01990"></a>01990 <span class="comment">/* 96 */</span> 420, 660, 660, 640, 660, 640, 280, 660, -<a name="l01991"></a>01991 <span class="comment">/* 104 */</span> 600, 240, 260, 580, 240, 940, 600, 640, -<a name="l01992"></a>01992 <span class="comment">/* 112 */</span> 660, 660, 320, 440, 300, 600, 560, 800, -<a name="l01993"></a>01993 <span class="comment">/* 120 */</span> 560, 580, 460, 340, 600, 340, 600, 0, -<a name="l01994"></a>01994 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01995"></a>01995 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01996"></a>01996 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01997"></a>01997 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l01998"></a>01998 <span class="comment">/* 160 */</span> 280, 740, 480, 480, 560, 440, 520, 560, -<a name="l01999"></a>01999 <span class="comment">/* 168 */</span> 500, 520, 520, 420, 500, 420, 500, 500, -<a name="l02000"></a>02000 <span class="comment">/* 176 */</span> 360, 660, 340, 320, 420, 330, 440, 540, -<a name="l02001"></a>02001 <span class="comment">/* 184 */</span> 340, 440, 440, 369, 460, 700, 460, 460, -<a name="l02002"></a>02002 <span class="comment">/* 192 */</span> 580, 740, 740, 740, 740, 440, 780, 780, -<a name="l02003"></a>02003 <span class="comment">/* 200 */</span> 780, 520, 520, 520, 520, 280, 280, 700, -<a name="l02004"></a>02004 <span class="comment">/* 208 */</span> 742, 740, 740, 840, 840, 840, 840, 600, -<a name="l02005"></a>02005 <span class="comment">/* 216 */</span> 580, 640, 640, 640, 640, 620, 420, 600, -<a name="l02006"></a>02006 <span class="comment">/* 224 */</span> 320, 660, 660, 660, 660, 240, 640, 640, -<a name="l02007"></a>02007 <span class="comment">/* 232 */</span> 640, 640, 640, 640, 640, 240, 240, 754, -<a name="l02008"></a>02008 <span class="comment">/* 240 */</span> 660, 600, 600, 640, 640, 640, 640, 600, -<a name="l02009"></a>02009 <span class="comment">/* 248 */</span> 320, 600, 600, 600, 600, 580, 300, 280, -<a name="l02010"></a>02010 }, -<a name="l02011"></a>02011 { <span class="comment">/* AvantGarde-BookOblique */</span> -<a name="l02012"></a>02012 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02013"></a>02013 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02014"></a>02014 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02015"></a>02015 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02016"></a>02016 <span class="comment">/* 32 */</span> 277, 295, 309, 554, 554, 775, 757, 198, -<a name="l02017"></a>02017 <span class="comment">/* 40 */</span> 369, 369, 425, 606, 277, 332, 277, 437, -<a name="l02018"></a>02018 <span class="comment">/* 48 */</span> 554, 554, 554, 554, 554, 554, 554, 554, -<a name="l02019"></a>02019 <span class="comment">/* 56 */</span> 554, 554, 277, 277, 606, 606, 606, 591, -<a name="l02020"></a>02020 <span class="comment">/* 64 */</span> 867, 740, 574, 813, 744, 536, 485, 872, -<a name="l02021"></a>02021 <span class="comment">/* 72 */</span> 683, 226, 482, 591, 462, 919, 740, 869, -<a name="l02022"></a>02022 <span class="comment">/* 80 */</span> 592, 871, 607, 498, 426, 655, 702, 960, -<a name="l02023"></a>02023 <span class="comment">/* 88 */</span> 609, 592, 480, 351, 605, 351, 606, 500, -<a name="l02024"></a>02024 <span class="comment">/* 96 */</span> 378, 683, 682, 647, 685, 650, 314, 673, -<a name="l02025"></a>02025 <span class="comment">/* 104 */</span> 610, 200, 203, 502, 200, 938, 610, 655, -<a name="l02026"></a>02026 <span class="comment">/* 112 */</span> 682, 682, 301, 388, 339, 608, 554, 831, -<a name="l02027"></a>02027 <span class="comment">/* 120 */</span> 480, 536, 425, 351, 672, 351, 606, 0, -<a name="l02028"></a>02028 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02029"></a>02029 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02030"></a>02030 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02031"></a>02031 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02032"></a>02032 <span class="comment">/* 160 */</span> 277, 740, 453, 517, 554, 462, 498, 615, -<a name="l02033"></a>02033 <span class="comment">/* 168 */</span> 369, 498, 498, 426, 480, 332, 480, 480, -<a name="l02034"></a>02034 <span class="comment">/* 176 */</span> 332, 683, 302, 300, 375, 231, 388, 502, -<a name="l02035"></a>02035 <span class="comment">/* 184 */</span> 324, 388, 388, 339, 425, 552, 425, 425, -<a name="l02036"></a>02036 <span class="comment">/* 192 */</span> 607, 740, 740, 740, 740, 462, 813, 813, -<a name="l02037"></a>02037 <span class="comment">/* 200 */</span> 813, 536, 536, 536, 536, 226, 226, 744, -<a name="l02038"></a>02038 <span class="comment">/* 208 */</span> 790, 740, 740, 869, 869, 869, 869, 606, -<a name="l02039"></a>02039 <span class="comment">/* 216 */</span> 607, 655, 655, 655, 655, 592, 426, 554, -<a name="l02040"></a>02040 <span class="comment">/* 224 */</span> 301, 683, 683, 683, 683, 200, 647, 647, -<a name="l02041"></a>02041 <span class="comment">/* 232 */</span> 647, 650, 650, 650, 650, 200, 200, 714, -<a name="l02042"></a>02042 <span class="comment">/* 240 */</span> 685, 610, 610, 655, 655, 655, 655, 606, -<a name="l02043"></a>02043 <span class="comment">/* 248 */</span> 301, 608, 608, 608, 608, 536, 339, 222, -<a name="l02044"></a>02044 }, -<a name="l02045"></a>02045 { <span class="comment">/* AvantGarde-DemiOblique */</span> -<a name="l02046"></a>02046 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02047"></a>02047 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02048"></a>02048 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02049"></a>02049 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02050"></a>02050 <span class="comment">/* 32 */</span> 280, 280, 360, 560, 560, 860, 680, 220, -<a name="l02051"></a>02051 <span class="comment">/* 40 */</span> 380, 380, 440, 600, 280, 420, 280, 460, -<a name="l02052"></a>02052 <span class="comment">/* 48 */</span> 560, 560, 560, 560, 560, 560, 560, 560, -<a name="l02053"></a>02053 <span class="comment">/* 56 */</span> 560, 560, 280, 280, 600, 600, 600, 560, -<a name="l02054"></a>02054 <span class="comment">/* 64 */</span> 740, 740, 580, 780, 700, 520, 480, 840, -<a name="l02055"></a>02055 <span class="comment">/* 72 */</span> 680, 280, 480, 620, 440, 900, 740, 840, -<a name="l02056"></a>02056 <span class="comment">/* 80 */</span> 560, 840, 580, 520, 420, 640, 700, 900, -<a name="l02057"></a>02057 <span class="comment">/* 88 */</span> 680, 620, 500, 320, 640, 320, 600, 500, -<a name="l02058"></a>02058 <span class="comment">/* 96 */</span> 420, 660, 660, 640, 660, 640, 280, 660, -<a name="l02059"></a>02059 <span class="comment">/* 104 */</span> 600, 240, 260, 580, 240, 940, 600, 640, -<a name="l02060"></a>02060 <span class="comment">/* 112 */</span> 660, 660, 320, 440, 300, 600, 560, 800, -<a name="l02061"></a>02061 <span class="comment">/* 120 */</span> 560, 580, 460, 340, 600, 340, 600, 0, -<a name="l02062"></a>02062 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02063"></a>02063 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02064"></a>02064 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02065"></a>02065 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02066"></a>02066 <span class="comment">/* 160 */</span> 280, 740, 480, 480, 560, 440, 520, 560, -<a name="l02067"></a>02067 <span class="comment">/* 168 */</span> 500, 520, 520, 420, 500, 420, 500, 500, -<a name="l02068"></a>02068 <span class="comment">/* 176 */</span> 360, 660, 340, 320, 420, 326, 440, 540, -<a name="l02069"></a>02069 <span class="comment">/* 184 */</span> 340, 440, 440, 364, 460, 700, 460, 460, -<a name="l02070"></a>02070 <span class="comment">/* 192 */</span> 580, 740, 740, 740, 740, 440, 780, 780, -<a name="l02071"></a>02071 <span class="comment">/* 200 */</span> 780, 520, 520, 520, 520, 280, 280, 700, -<a name="l02072"></a>02072 <span class="comment">/* 208 */</span> 742, 740, 740, 840, 840, 840, 840, 600, -<a name="l02073"></a>02073 <span class="comment">/* 216 */</span> 580, 640, 640, 640, 640, 620, 420, 600, -<a name="l02074"></a>02074 <span class="comment">/* 224 */</span> 320, 660, 660, 660, 660, 240, 640, 640, -<a name="l02075"></a>02075 <span class="comment">/* 232 */</span> 640, 640, 640, 640, 640, 240, 240, 752, -<a name="l02076"></a>02076 <span class="comment">/* 240 */</span> 660, 600, 600, 640, 640, 640, 640, 600, -<a name="l02077"></a>02077 <span class="comment">/* 248 */</span> 320, 600, 600, 600, 600, 580, 300, 280, -<a name="l02078"></a>02078 }, -<a name="l02079"></a>02079 { <span class="comment">/* NewCenturySchlbk-Roman */</span> -<a name="l02080"></a>02080 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02081"></a>02081 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02082"></a>02082 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02083"></a>02083 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02084"></a>02084 <span class="comment">/* 32 */</span> 278, 296, 389, 556, 556, 833, 815, 204, -<a name="l02085"></a>02085 <span class="comment">/* 40 */</span> 333, 333, 500, 606, 278, 333, 278, 278, -<a name="l02086"></a>02086 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l02087"></a>02087 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 606, 606, 606, 444, -<a name="l02088"></a>02088 <span class="comment">/* 64 */</span> 737, 722, 722, 722, 778, 722, 667, 778, -<a name="l02089"></a>02089 <span class="comment">/* 72 */</span> 833, 407, 556, 778, 667, 944, 815, 778, -<a name="l02090"></a>02090 <span class="comment">/* 80 */</span> 667, 778, 722, 630, 667, 815, 722, 981, -<a name="l02091"></a>02091 <span class="comment">/* 88 */</span> 704, 704, 611, 333, 606, 333, 606, 500, -<a name="l02092"></a>02092 <span class="comment">/* 96 */</span> 333, 556, 556, 444, 574, 500, 333, 537, -<a name="l02093"></a>02093 <span class="comment">/* 104 */</span> 611, 315, 296, 593, 315, 889, 611, 500, -<a name="l02094"></a>02094 <span class="comment">/* 112 */</span> 574, 556, 444, 463, 389, 611, 537, 778, -<a name="l02095"></a>02095 <span class="comment">/* 120 */</span> 537, 537, 481, 333, 606, 333, 606, 0, -<a name="l02096"></a>02096 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02097"></a>02097 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02098"></a>02098 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02099"></a>02099 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02100"></a>02100 <span class="comment">/* 160 */</span> 278, 722, 333, 667, 556, 667, 630, 500, -<a name="l02101"></a>02101 <span class="comment">/* 168 */</span> 333, 630, 630, 667, 611, 333, 611, 611, -<a name="l02102"></a>02102 <span class="comment">/* 176 */</span> 333, 556, 333, 315, 333, 339, 463, 333, -<a name="l02103"></a>02103 <span class="comment">/* 184 */</span> 333, 463, 463, 389, 481, 333, 481, 481, -<a name="l02104"></a>02104 <span class="comment">/* 192 */</span> 722, 722, 722, 722, 722, 667, 722, 722, -<a name="l02105"></a>02105 <span class="comment">/* 200 */</span> 722, 722, 722, 722, 722, 407, 407, 778, -<a name="l02106"></a>02106 <span class="comment">/* 208 */</span> 778, 815, 815, 778, 778, 778, 778, 606, -<a name="l02107"></a>02107 <span class="comment">/* 216 */</span> 722, 815, 815, 815, 815, 704, 667, 574, -<a name="l02108"></a>02108 <span class="comment">/* 224 */</span> 444, 556, 556, 556, 556, 315, 444, 444, -<a name="l02109"></a>02109 <span class="comment">/* 232 */</span> 444, 500, 500, 500, 500, 315, 315, 606, -<a name="l02110"></a>02110 <span class="comment">/* 240 */</span> 574, 611, 611, 500, 500, 500, 500, 606, -<a name="l02111"></a>02111 <span class="comment">/* 248 */</span> 444, 611, 611, 611, 611, 537, 389, 333, -<a name="l02112"></a>02112 }, -<a name="l02113"></a>02113 { <span class="comment">/* NewCenturySchlbk-Bold */</span> -<a name="l02114"></a>02114 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02115"></a>02115 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02116"></a>02116 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02117"></a>02117 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02118"></a>02118 <span class="comment">/* 32 */</span> 287, 296, 333, 574, 574, 833, 852, 241, -<a name="l02119"></a>02119 <span class="comment">/* 40 */</span> 389, 389, 500, 606, 278, 333, 278, 278, -<a name="l02120"></a>02120 <span class="comment">/* 48 */</span> 574, 574, 574, 574, 574, 574, 574, 574, -<a name="l02121"></a>02121 <span class="comment">/* 56 */</span> 574, 574, 278, 278, 606, 606, 606, 500, -<a name="l02122"></a>02122 <span class="comment">/* 64 */</span> 747, 759, 778, 778, 833, 759, 722, 833, -<a name="l02123"></a>02123 <span class="comment">/* 72 */</span> 870, 444, 648, 815, 722, 981, 833, 833, -<a name="l02124"></a>02124 <span class="comment">/* 80 */</span> 759, 833, 815, 667, 722, 833, 759, 981, -<a name="l02125"></a>02125 <span class="comment">/* 88 */</span> 722, 722, 667, 389, 606, 389, 606, 500, -<a name="l02126"></a>02126 <span class="comment">/* 96 */</span> 333, 611, 648, 556, 667, 574, 389, 611, -<a name="l02127"></a>02127 <span class="comment">/* 104 */</span> 685, 370, 352, 667, 352, 963, 685, 611, -<a name="l02128"></a>02128 <span class="comment">/* 112 */</span> 667, 648, 519, 500, 426, 685, 611, 889, -<a name="l02129"></a>02129 <span class="comment">/* 120 */</span> 611, 611, 537, 389, 606, 389, 606, 0, -<a name="l02130"></a>02130 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02131"></a>02131 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02132"></a>02132 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02133"></a>02133 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02134"></a>02134 <span class="comment">/* 160 */</span> 287, 759, 333, 722, 574, 722, 667, 500, -<a name="l02135"></a>02135 <span class="comment">/* 168 */</span> 333, 667, 667, 722, 667, 333, 667, 667, -<a name="l02136"></a>02136 <span class="comment">/* 176 */</span> 333, 611, 333, 352, 333, 436, 500, 333, -<a name="l02137"></a>02137 <span class="comment">/* 184 */</span> 333, 500, 500, 446, 537, 333, 537, 537, -<a name="l02138"></a>02138 <span class="comment">/* 192 */</span> 815, 759, 759, 759, 759, 722, 778, 778, -<a name="l02139"></a>02139 <span class="comment">/* 200 */</span> 778, 759, 759, 759, 759, 444, 444, 833, -<a name="l02140"></a>02140 <span class="comment">/* 208 */</span> 833, 833, 833, 833, 833, 833, 833, 606, -<a name="l02141"></a>02141 <span class="comment">/* 216 */</span> 815, 833, 833, 833, 833, 722, 722, 611, -<a name="l02142"></a>02142 <span class="comment">/* 224 */</span> 519, 611, 611, 611, 611, 352, 556, 556, -<a name="l02143"></a>02143 <span class="comment">/* 232 */</span> 556, 574, 574, 574, 574, 370, 370, 747, -<a name="l02144"></a>02144 <span class="comment">/* 240 */</span> 667, 685, 685, 611, 611, 611, 611, 606, -<a name="l02145"></a>02145 <span class="comment">/* 248 */</span> 519, 685, 685, 685, 685, 611, 426, 333, -<a name="l02146"></a>02146 }, -<a name="l02147"></a>02147 { <span class="comment">/* NewCenturySchlbk-Italic */</span> -<a name="l02148"></a>02148 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02149"></a>02149 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02150"></a>02150 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02151"></a>02151 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02152"></a>02152 <span class="comment">/* 32 */</span> 278, 333, 400, 556, 556, 833, 852, 278, -<a name="l02153"></a>02153 <span class="comment">/* 40 */</span> 333, 333, 500, 606, 278, 333, 278, 606, -<a name="l02154"></a>02154 <span class="comment">/* 48 */</span> 556, 556, 556, 556, 556, 556, 556, 556, -<a name="l02155"></a>02155 <span class="comment">/* 56 */</span> 556, 556, 278, 278, 606, 606, 606, 444, -<a name="l02156"></a>02156 <span class="comment">/* 64 */</span> 747, 704, 722, 722, 778, 722, 667, 778, -<a name="l02157"></a>02157 <span class="comment">/* 72 */</span> 833, 407, 611, 741, 667, 944, 815, 778, -<a name="l02158"></a>02158 <span class="comment">/* 80 */</span> 667, 778, 741, 667, 685, 815, 704, 926, -<a name="l02159"></a>02159 <span class="comment">/* 88 */</span> 704, 685, 667, 333, 606, 333, 606, 500, -<a name="l02160"></a>02160 <span class="comment">/* 96 */</span> 333, 574, 556, 444, 611, 444, 333, 537, -<a name="l02161"></a>02161 <span class="comment">/* 104 */</span> 611, 333, 315, 556, 333, 889, 611, 500, -<a name="l02162"></a>02162 <span class="comment">/* 112 */</span> 574, 556, 444, 444, 352, 611, 519, 778, -<a name="l02163"></a>02163 <span class="comment">/* 120 */</span> 500, 500, 463, 333, 606, 333, 606, 0, -<a name="l02164"></a>02164 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02165"></a>02165 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02166"></a>02166 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02167"></a>02167 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02168"></a>02168 <span class="comment">/* 160 */</span> 278, 704, 333, 667, 556, 667, 667, 500, -<a name="l02169"></a>02169 <span class="comment">/* 168 */</span> 333, 667, 667, 685, 667, 333, 667, 667, -<a name="l02170"></a>02170 <span class="comment">/* 176 */</span> 333, 574, 333, 333, 333, 359, 444, 333, -<a name="l02171"></a>02171 <span class="comment">/* 184 */</span> 333, 444, 444, 368, 463, 333, 463, 463, -<a name="l02172"></a>02172 <span class="comment">/* 192 */</span> 741, 704, 704, 704, 704, 667, 722, 722, -<a name="l02173"></a>02173 <span class="comment">/* 200 */</span> 722, 722, 722, 722, 722, 407, 407, 778, -<a name="l02174"></a>02174 <span class="comment">/* 208 */</span> 778, 815, 815, 778, 778, 778, 778, 606, -<a name="l02175"></a>02175 <span class="comment">/* 216 */</span> 741, 815, 815, 815, 815, 685, 685, 556, -<a name="l02176"></a>02176 <span class="comment">/* 224 */</span> 444, 574, 574, 574, 574, 333, 444, 444, -<a name="l02177"></a>02177 <span class="comment">/* 232 */</span> 444, 444, 444, 444, 444, 333, 333, 651, -<a name="l02178"></a>02178 <span class="comment">/* 240 */</span> 611, 611, 611, 500, 500, 500, 500, 606, -<a name="l02179"></a>02179 <span class="comment">/* 248 */</span> 444, 611, 611, 611, 611, 500, 352, 333, -<a name="l02180"></a>02180 }, -<a name="l02181"></a>02181 { <span class="comment">/* NewCenturySchlbk-BoldItalic */</span> -<a name="l02182"></a>02182 <span class="comment">/* 0 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02183"></a>02183 <span class="comment">/* 8 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02184"></a>02184 <span class="comment">/* 16 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02185"></a>02185 <span class="comment">/* 24 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02186"></a>02186 <span class="comment">/* 32 */</span> 287, 333, 400, 574, 574, 889, 889, 287, -<a name="l02187"></a>02187 <span class="comment">/* 40 */</span> 407, 407, 500, 606, 287, 333, 287, 278, -<a name="l02188"></a>02188 <span class="comment">/* 48 */</span> 574, 574, 574, 574, 574, 574, 574, 574, -<a name="l02189"></a>02189 <span class="comment">/* 56 */</span> 574, 574, 287, 287, 606, 606, 606, 481, -<a name="l02190"></a>02190 <span class="comment">/* 64 */</span> 747, 741, 759, 759, 833, 741, 704, 815, -<a name="l02191"></a>02191 <span class="comment">/* 72 */</span> 870, 444, 667, 778, 704, 944, 852, 833, -<a name="l02192"></a>02192 <span class="comment">/* 80 */</span> 741, 833, 796, 685, 722, 833, 741, 944, -<a name="l02193"></a>02193 <span class="comment">/* 88 */</span> 741, 704, 704, 407, 606, 407, 606, 500, -<a name="l02194"></a>02194 <span class="comment">/* 96 */</span> 333, 667, 611, 537, 667, 519, 389, 611, -<a name="l02195"></a>02195 <span class="comment">/* 104 */</span> 685, 389, 370, 648, 389, 944, 685, 574, -<a name="l02196"></a>02196 <span class="comment">/* 112 */</span> 648, 630, 519, 481, 407, 685, 556, 833, -<a name="l02197"></a>02197 <span class="comment">/* 120 */</span> 574, 519, 519, 407, 606, 407, 606, 0, -<a name="l02198"></a>02198 <span class="comment">/* 128 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02199"></a>02199 <span class="comment">/* 136 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02200"></a>02200 <span class="comment">/* 144 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02201"></a>02201 <span class="comment">/* 152 */</span> 0, 0, 0, 0, 0, 0, 0, 0, -<a name="l02202"></a>02202 <span class="comment">/* 160 */</span> 287, 741, 333, 704, 574, 704, 685, 500, -<a name="l02203"></a>02203 <span class="comment">/* 168 */</span> 333, 685, 685, 722, 704, 333, 704, 704, -<a name="l02204"></a>02204 <span class="comment">/* 176 */</span> 333, 667, 333, 389, 333, 486, 481, 333, -<a name="l02205"></a>02205 <span class="comment">/* 184 */</span> 333, 481, 481, 483, 519, 333, 519, 519, -<a name="l02206"></a>02206 <span class="comment">/* 192 */</span> 796, 741, 741, 741, 741, 704, 759, 759, -<a name="l02207"></a>02207 <span class="comment">/* 200 */</span> 759, 741, 741, 741, 741, 444, 444, 833, -<a name="l02208"></a>02208 <span class="comment">/* 208 */</span> 833, 852, 852, 833, 833, 833, 833, 606, -<a name="l02209"></a>02209 <span class="comment">/* 216 */</span> 796, 833, 833, 833, 833, 704, 722, 574, -<a name="l02210"></a>02210 <span class="comment">/* 224 */</span> 519, 667, 667, 667, 667, 389, 537, 537, -<a name="l02211"></a>02211 <span class="comment">/* 232 */</span> 537, 519, 519, 519, 519, 389, 389, 780, -<a name="l02212"></a>02212 <span class="comment">/* 240 */</span> 667, 685, 685, 574, 574, 574, 574, 606, -<a name="l02213"></a>02213 <span class="comment">/* 248 */</span> 519, 685, 685, 685, 685, 519, 407, 333, -<a name="l02214"></a>02214 }, -<a name="l02215"></a>02215 }; -<a name="l02216"></a>02216 <span class="preprocessor">#if 0 </span><span class="comment">/* Until this array is needed */</span> -<a name="l02217"></a>02217 <span class="keyword">static</span> <span class="keywordtype">int</span> aiUnderlineInfo[32][2] = { -<a name="l02218"></a>02218 { -100, 50 }, -<a name="l02219"></a>02219 { -100, 50 }, -<a name="l02220"></a>02220 { -100, 50 }, -<a name="l02221"></a>02221 { -100, 50 }, -<a name="l02222"></a>02222 { -100, 50 }, -<a name="l02223"></a>02223 { -100, 50 }, -<a name="l02224"></a>02224 { -100, 50 }, -<a name="l02225"></a>02225 { -100, 50 }, -<a name="l02226"></a>02226 { -151, 50 }, -<a name="l02227"></a>02227 { -155, 69 }, -<a name="l02228"></a>02228 { -151, 50 }, -<a name="l02229"></a>02229 { -111, 69 }, -<a name="l02230"></a>02230 { -100, 50 }, -<a name="l02231"></a>02231 { -100, 50 }, -<a name="l02232"></a>02232 { -100, 50 }, -<a name="l02233"></a>02233 { -100, 50 }, -<a name="l02234"></a>02234 { -100, 50 }, -<a name="l02235"></a>02235 { -100, 50 }, -<a name="l02236"></a>02236 { -100, 50 }, -<a name="l02237"></a>02237 { -100, 50 }, -<a name="l02238"></a>02238 { -125, 60 }, -<a name="l02239"></a>02239 { -125, 60 }, -<a name="l02240"></a>02240 { -125, 60 }, -<a name="l02241"></a>02241 { -125, 60 }, -<a name="l02242"></a>02242 { -96, 58 }, -<a name="l02243"></a>02243 { -93, 90 }, -<a name="l02244"></a>02244 { -96, 58 }, -<a name="l02245"></a>02245 { -93, 90 }, -<a name="l02246"></a>02246 { -104, 61 }, -<a name="l02247"></a>02247 { -103, 90 }, -<a name="l02248"></a>02248 { -102, 42 }, -<a name="l02249"></a>02249 { -102, 54 }, -<a name="l02250"></a>02250 }; -<a name="l02251"></a>02251 <span class="preprocessor">#endif </span><span class="comment">/* 0 */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fontlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fontlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fontlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fontlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word font information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stddef.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00016"></a>00016 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keyword">typedef</span> <span class="keyword">struct </span>font_desc_tag { -<a name="l00019"></a>00019 font_block_type tInfo; -<a name="l00020"></a>00020 <span class="keyword">struct </span>font_desc_tag *pNext; -<a name="l00021"></a>00021 } font_mem_type; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 <span class="comment">/* Variables needed to write the Font Information List */</span> -<a name="l00024"></a>00024 <span class="keyword">static</span> font_mem_type *pAnchor = NULL; -<a name="l00025"></a>00025 <span class="keyword">static</span> font_mem_type *pFontLast = NULL; -<a name="l00026"></a>00026 -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 <span class="comment">/*</span> -<a name="l00029"></a>00029 <span class="comment"> * vDestroyFontInfoList - destroy the Font Information List</span> -<a name="l00030"></a>00030 <span class="comment"> */</span> -<a name="l00031"></a>00031 <span class="keywordtype">void</span> -<a name="l00032"></a>00032 vDestroyFontInfoList(<span class="keywordtype">void</span>) -<a name="l00033"></a>00033 { -<a name="l00034"></a>00034 font_mem_type *pCurr, *pNext; -<a name="l00035"></a>00035 -<a name="l00036"></a>00036 DBG_MSG(<span class="stringliteral">"vDestroyFontInfoList"</span>); -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 <span class="comment">/* Free the Font Information List */</span> -<a name="l00039"></a>00039 pCurr = pAnchor; -<a name="l00040"></a>00040 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00041"></a>00041 pNext = pCurr->pNext; -<a name="l00042"></a>00042 pCurr = xfree(pCurr); -<a name="l00043"></a>00043 pCurr = pNext; -<a name="l00044"></a>00044 } -<a name="l00045"></a>00045 pAnchor = NULL; -<a name="l00046"></a>00046 <span class="comment">/* Reset all control variables */</span> -<a name="l00047"></a>00047 pFontLast = NULL; -<a name="l00048"></a>00048 } <span class="comment">/* end of vDestroyFontInfoList */</span> -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 <span class="comment">/*</span> -<a name="l00051"></a>00051 <span class="comment"> * vCorrectFontValues - correct font values to values Antiword can use</span> -<a name="l00052"></a>00052 <span class="comment"> */</span> -<a name="l00053"></a>00053 <span class="keywordtype">void</span> -<a name="l00054"></a>00054 vCorrectFontValues(font_block_type *pFontBlock) -<a name="l00055"></a>00055 { -<a name="l00056"></a>00056 UINT uiRealSize; -<a name="l00057"></a>00057 USHORT usRealStyle; -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 uiRealSize = pFontBlock->usFontSize; -<a name="l00060"></a>00060 usRealStyle = pFontBlock->usFontStyle; -<a name="l00061"></a>00061 <span class="keywordflow">if</span> (bIsSmallCapitals(pFontBlock->usFontStyle)) { -<a name="l00062"></a>00062 <span class="comment">/* Small capitals become normal capitals in a smaller font */</span> -<a name="l00063"></a>00063 uiRealSize = (uiRealSize * 4 + 2) / 5; -<a name="l00064"></a>00064 usRealStyle &= ~FONT_SMALL_CAPITALS; -<a name="l00065"></a>00065 usRealStyle |= FONT_CAPITALS; -<a name="l00066"></a>00066 } -<a name="l00067"></a>00067 <span class="keywordflow">if</span> (bIsSuperscript(pFontBlock->usFontStyle) || -<a name="l00068"></a>00068 bIsSubscript(pFontBlock->usFontStyle)) { -<a name="l00069"></a>00069 <span class="comment">/* Superscript and subscript use a smaller fontsize */</span> -<a name="l00070"></a>00070 uiRealSize = (uiRealSize * 2 + 1) / 3; -<a name="l00071"></a>00071 } -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="keywordflow">if</span> (uiRealSize < MIN_FONT_SIZE) { -<a name="l00074"></a>00074 DBG_DEC(uiRealSize); -<a name="l00075"></a>00075 uiRealSize = MIN_FONT_SIZE; -<a name="l00076"></a>00076 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiRealSize > MAX_FONT_SIZE) { -<a name="l00077"></a>00077 DBG_DEC(uiRealSize); -<a name="l00078"></a>00078 uiRealSize = MAX_FONT_SIZE; -<a name="l00079"></a>00079 } -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 pFontBlock->usFontSize = (USHORT)uiRealSize; -<a name="l00082"></a>00082 <span class="keywordflow">if</span> (pFontBlock->ucFontColor == 8) { -<a name="l00083"></a>00083 <span class="comment">/* White text to light gray text */</span> -<a name="l00084"></a>00084 pFontBlock->ucFontColor = 16; -<a name="l00085"></a>00085 } -<a name="l00086"></a>00086 pFontBlock->usFontStyle = usRealStyle; -<a name="l00087"></a>00087 } <span class="comment">/* end of vCorrectFontValues */</span> -<a name="l00088"></a>00088 -<a name="l00089"></a>00089 <span class="comment">/*</span> -<a name="l00090"></a>00090 <span class="comment"> * vAdd2FontInfoList - Add an element to the Font Information List</span> -<a name="l00091"></a>00091 <span class="comment"> */</span> -<a name="l00092"></a>00092 <span class="keywordtype">void</span> -<a name="l00093"></a>00093 vAdd2FontInfoList(<span class="keyword">const</span> font_block_type *pFontBlock) -<a name="l00094"></a>00094 { -<a name="l00095"></a>00095 font_mem_type *pListMember; -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 fail(pFontBlock == NULL); -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 NO_DBG_MSG(<span class="stringliteral">"bAdd2FontInfoList"</span>); -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 <span class="keywordflow">if</span> (pFontBlock->ulFileOffset == FC_INVALID) { -<a name="l00102"></a>00102 <span class="comment">/*</span> -<a name="l00103"></a>00103 <span class="comment"> * This offset is really past the end of the file,</span> -<a name="l00104"></a>00104 <span class="comment"> * so don't waste any memory by storing it.</span> -<a name="l00105"></a>00105 <span class="comment"> */</span> -<a name="l00106"></a>00106 <span class="keywordflow">return</span>; -<a name="l00107"></a>00107 } -<a name="l00108"></a>00108 -<a name="l00109"></a>00109 NO_DBG_HEX(pFontBlock->ulFileOffset); -<a name="l00110"></a>00110 NO_DBG_DEC_C(pFontBlock->ucFontNumber != 0, -<a name="l00111"></a>00111 pFontBlock->ucFontNumber); -<a name="l00112"></a>00112 NO_DBG_DEC_C(pFontBlock->usFontSize != DEFAULT_FONT_SIZE, -<a name="l00113"></a>00113 pFontBlock->usFontSize); -<a name="l00114"></a>00114 NO_DBG_DEC_C(pFontBlock->ucFontColor != 0, -<a name="l00115"></a>00115 pFontBlock->ucFontColor); -<a name="l00116"></a>00116 NO_DBG_HEX_C(pFontBlock->usFontStyle != 0x00, -<a name="l00117"></a>00117 pFontBlock->usFontStyle); -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="keywordflow">if</span> (pFontLast != NULL && -<a name="l00120"></a>00120 pFontLast->tInfo.ulFileOffset == pFontBlock->ulFileOffset) { -<a name="l00121"></a>00121 <span class="comment">/*</span> -<a name="l00122"></a>00122 <span class="comment"> * If two consecutive fonts share the same</span> -<a name="l00123"></a>00123 <span class="comment"> * offset, remember only the last font</span> -<a name="l00124"></a>00124 <span class="comment"> */</span> -<a name="l00125"></a>00125 fail(pFontLast->pNext != NULL); -<a name="l00126"></a>00126 pFontLast->tInfo = *pFontBlock; -<a name="l00127"></a>00127 <span class="keywordflow">return</span>; -<a name="l00128"></a>00128 } -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="comment">/* Create list member */</span> -<a name="l00131"></a>00131 pListMember = xmalloc(<span class="keyword">sizeof</span>(font_mem_type)); -<a name="l00132"></a>00132 <span class="comment">/* Fill the list member */</span> -<a name="l00133"></a>00133 pListMember->tInfo = *pFontBlock; -<a name="l00134"></a>00134 pListMember->pNext = NULL; -<a name="l00135"></a>00135 <span class="comment">/* Correct the values where needed */</span> -<a name="l00136"></a>00136 vCorrectFontValues(&pListMember->tInfo); -<a name="l00137"></a>00137 <span class="comment">/* Add the new member to the list */</span> -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00139"></a>00139 pAnchor = pListMember; -<a name="l00140"></a>00140 } <span class="keywordflow">else</span> { -<a name="l00141"></a>00141 fail(pFontLast == NULL); -<a name="l00142"></a>00142 pFontLast->pNext = pListMember; -<a name="l00143"></a>00143 } -<a name="l00144"></a>00144 pFontLast = pListMember; -<a name="l00145"></a>00145 } <span class="comment">/* end of vAdd2FontInfoList */</span> -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 <span class="comment">/*</span> -<a name="l00148"></a>00148 <span class="comment"> * Get the record that follows the given recored in the Font Information List</span> -<a name="l00149"></a>00149 <span class="comment"> */</span> -<a name="l00150"></a>00150 <span class="keyword">const</span> font_block_type * -<a name="l00151"></a>00151 pGetNextFontInfoListItem(<span class="keyword">const</span> font_block_type *pCurr) -<a name="l00152"></a>00152 { -<a name="l00153"></a>00153 <span class="keyword">const</span> font_mem_type *pRecord; -<a name="l00154"></a>00154 <span class="keywordtype">size_t</span> tOffset; -<a name="l00155"></a>00155 -<a name="l00156"></a>00156 <span class="keywordflow">if</span> (pCurr == NULL) { -<a name="l00157"></a>00157 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00158"></a>00158 <span class="comment">/* There are no records */</span> -<a name="l00159"></a>00159 <span class="keywordflow">return</span> NULL; -<a name="l00160"></a>00160 } -<a name="l00161"></a>00161 <span class="comment">/* The first record is the only one without a predecessor */</span> -<a name="l00162"></a>00162 <span class="keywordflow">return</span> &pAnchor->tInfo; -<a name="l00163"></a>00163 } -<a name="l00164"></a>00164 tOffset = offsetof(font_mem_type, tInfo); -<a name="l00165"></a>00165 <span class="comment">/* Many casts to prevent alignment warnings */</span> -<a name="l00166"></a>00166 pRecord = (font_mem_type *)(<span class="keywordtype">void</span> *)((<span class="keywordtype">char</span> *)pCurr - tOffset); -<a name="l00167"></a>00167 fail(pCurr != &pRecord->tInfo); -<a name="l00168"></a>00168 <span class="keywordflow">if</span> (pRecord->pNext == NULL) { -<a name="l00169"></a>00169 <span class="comment">/* The last record has no successor */</span> -<a name="l00170"></a>00170 <span class="keywordflow">return</span> NULL; -<a name="l00171"></a>00171 } -<a name="l00172"></a>00172 <span class="keywordflow">return</span> &pRecord->pNext->tInfo; -<a name="l00173"></a>00173 } <span class="comment">/* end of pGetNextFontInfoListItem */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fonts_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1034 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fonts.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fonts.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fonts.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with fonts (generic)</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <ctype.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/* Maximum line length in the font file */</span> -<a name="l00014"></a>00014 <span class="preprocessor">#define FONT_LINE_LENGTH 81</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span> -<a name="l00016"></a>00016 <span class="comment">/* Pitch */</span> -<a name="l00017"></a>00017 <span class="preprocessor">#define PITCH_UNKNOWN 0</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define PITCH_FIXED 1</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define PITCH_VARIABLE 2</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span> -<a name="l00021"></a>00021 <span class="comment">/* Font Family */</span> -<a name="l00022"></a>00022 <span class="preprocessor">#define FAMILY_UNKNOWN 0</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define FAMILY_ROMAN 1</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define FAMILY_SWISS 2</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define FAMILY_MODERN 3</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define FAMILY_SCRIPT 4</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define FAMILY_DECORATIVE 5</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span> -<a name="l00029"></a>00029 <span class="comment">/* Font Translation Table */</span> -<a name="l00030"></a>00030 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tFontTableRecords = 0; -<a name="l00031"></a>00031 <span class="keyword">static</span> font_table_type *pFontTable = NULL; -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/*</span> -<a name="l00034"></a>00034 <span class="comment"> * Find the given font in the font table</span> -<a name="l00035"></a>00035 <span class="comment"> *</span> -<a name="l00036"></a>00036 <span class="comment"> * returns the index into the FontTable, -1 if not found</span> -<a name="l00037"></a>00037 <span class="comment"> */</span> -<a name="l00038"></a>00038 <span class="keywordtype">int</span> -<a name="l00039"></a>00039 iGetFontByNumber(UCHAR ucWordFontNumber, USHORT usFontStyle) -<a name="l00040"></a>00040 { -<a name="l00041"></a>00041 <span class="keywordtype">int</span> iIndex; -<a name="l00042"></a>00042 -<a name="l00043"></a>00043 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tFontTableRecords; iIndex++) { -<a name="l00044"></a>00044 <span class="keywordflow">if</span> (ucWordFontNumber == pFontTable[iIndex].ucWordFontNumber && -<a name="l00045"></a>00045 usFontStyle == pFontTable[iIndex].usFontStyle && -<a name="l00046"></a>00046 pFontTable[iIndex].szOurFontname[0] != <span class="charliteral">'\0'</span>) { -<a name="l00047"></a>00047 <span class="keywordflow">return</span> iIndex; -<a name="l00048"></a>00048 } -<a name="l00049"></a>00049 } -<a name="l00050"></a>00050 DBG_DEC(ucWordFontNumber); -<a name="l00051"></a>00051 DBG_HEX(usFontStyle); -<a name="l00052"></a>00052 <span class="keywordflow">return</span> -1; -<a name="l00053"></a>00053 } <span class="comment">/* end of iGetFontByNumber */</span> -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 <span class="comment">/*</span> -<a name="l00056"></a>00056 <span class="comment"> * szGetOurFontname - Get our font name</span> -<a name="l00057"></a>00057 <span class="comment"> *</span> -<a name="l00058"></a>00058 <span class="comment"> * return our font name from the given index, NULL if not found</span> -<a name="l00059"></a>00059 <span class="comment"> */</span> -<a name="l00060"></a>00060 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00061"></a>00061 szGetOurFontname(<span class="keywordtype">int</span> iIndex) -<a name="l00062"></a>00062 { -<a name="l00063"></a>00063 <span class="keywordflow">if</span> (iIndex < 0 || iIndex >= (<span class="keywordtype">int</span>)tFontTableRecords) { -<a name="l00064"></a>00064 <span class="keywordflow">return</span> NULL; -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 <span class="keywordflow">return</span> pFontTable[iIndex].szOurFontname; -<a name="l00067"></a>00067 } <span class="comment">/* end of szGetOurFontname */</span> -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 <span class="comment">/*</span> -<a name="l00070"></a>00070 <span class="comment"> * Find the given font in the font table</span> -<a name="l00071"></a>00071 <span class="comment"> *</span> -<a name="l00072"></a>00072 <span class="comment"> * returns the Word font number, -1 if not found</span> -<a name="l00073"></a>00073 <span class="comment"> */</span> -<a name="l00074"></a>00074 <span class="keywordtype">int</span> -<a name="l00075"></a>00075 iFontname2Fontnumber(<span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFontname, USHORT usFontStyle) -<a name="l00076"></a>00076 { -<a name="l00077"></a>00077 <span class="keywordtype">int</span> iIndex; -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tFontTableRecords; iIndex++) { -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (pFontTable[iIndex].usFontStyle == usFontStyle && -<a name="l00081"></a>00081 STREQ(pFontTable[iIndex].szOurFontname, szOurFontname)) { -<a name="l00082"></a>00082 <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)pFontTable[iIndex].ucWordFontNumber; -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 } -<a name="l00085"></a>00085 <span class="keywordflow">return</span> -1; -<a name="l00086"></a>00086 } <span class="comment">/* end of iFontname2Fontnumber */</span> -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="comment">/*</span> -<a name="l00089"></a>00089 <span class="comment"> * szGetDefaultFont - get the default font that matches the parameters</span> -<a name="l00090"></a>00090 <span class="comment"> */</span> -<a name="l00091"></a>00091 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00092"></a>00092 szGetDefaultFont(UCHAR ucFFN, <span class="keywordtype">int</span> iEmphasis) -<a name="l00093"></a>00093 { -<a name="l00094"></a>00094 UCHAR ucPrq, ucFf; -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 fail(iEmphasis < 0 || iEmphasis > 3); -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 ucPrq = ucFFN & 0x03; -<a name="l00099"></a>00099 ucFf = (ucFFN & 0x70) >> 4; -<a name="l00100"></a>00100 NO_DBG_DEC(ucPrq); -<a name="l00101"></a>00101 NO_DBG_DEC(ucFf); -<a name="l00102"></a>00102 <span class="keywordflow">if</span> (ucPrq == PITCH_FIXED) { -<a name="l00103"></a>00103 <span class="comment">/* Set to the default monospaced font */</span> -<a name="l00104"></a>00104 <span class="keywordflow">switch</span> (iEmphasis) { -<a name="l00105"></a>00105 <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> FONT_MONOSPACED_BOLD; -<a name="l00106"></a>00106 <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> FONT_MONOSPACED_ITALIC; -<a name="l00107"></a>00107 <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> FONT_MONOSPACED_BOLDITALIC; -<a name="l00108"></a>00108 <span class="keywordflow">default</span>: <span class="keywordflow">return</span> FONT_MONOSPACED_PLAIN; -<a name="l00109"></a>00109 } -<a name="l00110"></a>00110 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucFf == FAMILY_ROMAN) { -<a name="l00111"></a>00111 <span class="comment">/* Set to the default serif font */</span> -<a name="l00112"></a>00112 <span class="keywordflow">switch</span> (iEmphasis) { -<a name="l00113"></a>00113 <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> FONT_SERIF_BOLD; -<a name="l00114"></a>00114 <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> FONT_SERIF_ITALIC; -<a name="l00115"></a>00115 <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> FONT_SERIF_BOLDITALIC; -<a name="l00116"></a>00116 <span class="keywordflow">default</span>: <span class="keywordflow">return</span> FONT_SERIF_PLAIN; -<a name="l00117"></a>00117 } -<a name="l00118"></a>00118 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucFf == FAMILY_SWISS) { -<a name="l00119"></a>00119 <span class="comment">/* Set to the default sans serif font */</span> -<a name="l00120"></a>00120 <span class="keywordflow">switch</span> (iEmphasis) { -<a name="l00121"></a>00121 <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> FONT_SANS_SERIF_BOLD; -<a name="l00122"></a>00122 <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> FONT_SANS_SERIF_ITALIC; -<a name="l00123"></a>00123 <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> FONT_SANS_SERIF_BOLDITALIC; -<a name="l00124"></a>00124 <span class="keywordflow">default</span>: <span class="keywordflow">return</span> FONT_SANS_SERIF_PLAIN; -<a name="l00125"></a>00125 } -<a name="l00126"></a>00126 } <span class="keywordflow">else</span> { -<a name="l00127"></a>00127 <span class="comment">/* Set to the default default font */</span> -<a name="l00128"></a>00128 <span class="keywordflow">switch</span> (iEmphasis) { -<a name="l00129"></a>00129 <span class="keywordflow">case</span> 1: <span class="keywordflow">return</span> FONT_SERIF_BOLD; -<a name="l00130"></a>00130 <span class="keywordflow">case</span> 2: <span class="keywordflow">return</span> FONT_SERIF_ITALIC; -<a name="l00131"></a>00131 <span class="keywordflow">case</span> 3: <span class="keywordflow">return</span> FONT_SERIF_BOLDITALIC; -<a name="l00132"></a>00132 <span class="keywordflow">default</span>: <span class="keywordflow">return</span> FONT_SERIF_PLAIN; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 } -<a name="l00135"></a>00135 } <span class="comment">/* end of szGetDefaultFont */</span> -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 <span class="comment">/*</span> -<a name="l00138"></a>00138 <span class="comment"> * See if the fontname from the Word file matches the fontname from the</span> -<a name="l00139"></a>00139 <span class="comment"> * font translation file.</span> -<a name="l00140"></a>00140 <span class="comment"> * If iBytesPerChar is one than aucWord is in ISO-8859-x (Word 2/6/7),</span> -<a name="l00141"></a>00141 <span class="comment"> * if iBytesPerChar is two than aucWord is in Unicode (Word 8/9/10).</span> -<a name="l00142"></a>00142 <span class="comment"> */</span> -<a name="l00143"></a>00143 <span class="keyword">static</span> BOOL -<a name="l00144"></a>00144 bFontEqual(<span class="keyword">const</span> UCHAR *aucWord, <span class="keyword">const</span> <span class="keywordtype">char</span> *szTable, <span class="keywordtype">int</span> iBytesPerChar) -<a name="l00145"></a>00145 { -<a name="l00146"></a>00146 <span class="keyword">const</span> UCHAR *pucTmp; -<a name="l00147"></a>00147 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00148"></a>00148 -<a name="l00149"></a>00149 fail(aucWord == NULL || szTable == NULL); -<a name="l00150"></a>00150 fail(iBytesPerChar != 1 && iBytesPerChar != 2); -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 <span class="keywordflow">for</span> (pucTmp = aucWord, pcTmp = szTable; -<a name="l00153"></a>00153 *pucTmp != 0; -<a name="l00154"></a>00154 pucTmp += iBytesPerChar, pcTmp++) { -<a name="l00155"></a>00155 <span class="keywordflow">if</span> (ulToUpper((ULONG)*pucTmp) != -<a name="l00156"></a>00156 ulToUpper((ULONG)(UCHAR)*pcTmp)) { -<a name="l00157"></a>00157 <span class="keywordflow">return</span> FALSE; -<a name="l00158"></a>00158 } -<a name="l00159"></a>00159 } -<a name="l00160"></a>00160 <span class="keywordflow">return</span> *pcTmp == <span class="charliteral">'\0'</span>; -<a name="l00161"></a>00161 } <span class="comment">/* end of bFontEqual */</span> -<a name="l00162"></a>00162 -<a name="l00163"></a>00163 <span class="comment">/*</span> -<a name="l00164"></a>00164 <span class="comment"> * vFontname2Table - add fontnames to the font table</span> -<a name="l00165"></a>00165 <span class="comment"> */</span> -<a name="l00166"></a>00166 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00167"></a>00167 vFontname2Table(<span class="keyword">const</span> UCHAR *aucFont, <span class="keyword">const</span> UCHAR *aucAltFont, -<a name="l00168"></a>00168 <span class="keywordtype">int</span> iBytesPerChar, <span class="keywordtype">int</span> iEmphasis, UCHAR ucFFN, -<a name="l00169"></a>00169 <span class="keyword">const</span> <span class="keywordtype">char</span> *szWordFont, <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFont, -<a name="l00170"></a>00170 font_table_type *pFontTableRecord) -<a name="l00171"></a>00171 { -<a name="l00172"></a>00172 BOOL bMatchFound; -<a name="l00173"></a>00173 -<a name="l00174"></a>00174 fail(aucFont == NULL || aucFont[0] == 0); -<a name="l00175"></a>00175 fail(aucAltFont != NULL && aucAltFont[0] == 0); -<a name="l00176"></a>00176 fail(iBytesPerChar != 1 && iBytesPerChar != 2); -<a name="l00177"></a>00177 fail(iEmphasis < 0 || iEmphasis > 3); -<a name="l00178"></a>00178 fail(szWordFont == NULL || szWordFont[0] == <span class="charliteral">'\0'</span>); -<a name="l00179"></a>00179 fail(szOurFont == NULL || szOurFont[0] == <span class="charliteral">'\0'</span>); -<a name="l00180"></a>00180 fail(pFontTableRecord == NULL); -<a name="l00181"></a>00181 -<a name="l00182"></a>00182 bMatchFound = bFontEqual(aucFont, szWordFont, iBytesPerChar); -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 <span class="keywordflow">if</span> (!bMatchFound && aucAltFont != NULL) { -<a name="l00185"></a>00185 bMatchFound = bFontEqual(aucAltFont, szWordFont, iBytesPerChar); -<a name="l00186"></a>00186 } -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="keywordflow">if</span> (!bMatchFound && -<a name="l00189"></a>00189 pFontTableRecord->szWordFontname[0] == <span class="charliteral">'\0'</span> && -<a name="l00190"></a>00190 szWordFont[0] == <span class="charliteral">'*'</span> && -<a name="l00191"></a>00191 szWordFont[1] == <span class="charliteral">'\0'</span>) { -<a name="l00192"></a>00192 <span class="comment">/*</span> -<a name="l00193"></a>00193 <span class="comment"> * szWordFont contains a "*", so szOurFont will contain the</span> -<a name="l00194"></a>00194 <span class="comment"> * "default default" font. See if we can do better than that.</span> -<a name="l00195"></a>00195 <span class="comment"> */</span> -<a name="l00196"></a>00196 szOurFont = szGetDefaultFont(ucFFN, iEmphasis); -<a name="l00197"></a>00197 bMatchFound = TRUE; -<a name="l00198"></a>00198 } -<a name="l00199"></a>00199 -<a name="l00200"></a>00200 <span class="keywordflow">if</span> (bMatchFound) { -<a name="l00201"></a>00201 <span class="keywordflow">switch</span> (iBytesPerChar) { -<a name="l00202"></a>00202 <span class="keywordflow">case</span> 1: -<a name="l00203"></a>00203 (void)strncpy(pFontTableRecord->szWordFontname, -<a name="l00204"></a>00204 (<span class="keyword">const</span> <span class="keywordtype">char</span> *)aucFont, -<a name="l00205"></a>00205 <span class="keyword">sizeof</span>(pFontTableRecord->szWordFontname) - 1); -<a name="l00206"></a>00206 <span class="keywordflow">break</span>; -<a name="l00207"></a>00207 <span class="keywordflow">case</span> 2: -<a name="l00208"></a>00208 (void)unincpy(pFontTableRecord->szWordFontname, -<a name="l00209"></a>00209 aucFont, -<a name="l00210"></a>00210 <span class="keyword">sizeof</span>(pFontTableRecord->szWordFontname) - 1); -<a name="l00211"></a>00211 <span class="keywordflow">break</span>; -<a name="l00212"></a>00212 <span class="keywordflow">default</span>: -<a name="l00213"></a>00213 DBG_FIXME(); -<a name="l00214"></a>00214 pFontTableRecord->szWordFontname[0] = <span class="charliteral">'\0'</span>; -<a name="l00215"></a>00215 <span class="keywordflow">break</span>; -<a name="l00216"></a>00216 } -<a name="l00217"></a>00217 pFontTableRecord->szWordFontname[ -<a name="l00218"></a>00218 <span class="keyword">sizeof</span>(pFontTableRecord->szWordFontname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00219"></a>00219 (void)strncpy(pFontTableRecord->szOurFontname, szOurFont, -<a name="l00220"></a>00220 <span class="keyword">sizeof</span>(pFontTableRecord->szOurFontname) - 1); -<a name="l00221"></a>00221 pFontTableRecord->szOurFontname[ -<a name="l00222"></a>00222 <span class="keyword">sizeof</span>(pFontTableRecord->szOurFontname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00223"></a>00223 NO_DBG_MSG(pFontTableRecord->szWordFontname); -<a name="l00224"></a>00224 NO_DBG_MSG(pFontTableRecord->szOurFontname); -<a name="l00225"></a>00225 pFontTableRecord->ucFFN = ucFFN; -<a name="l00226"></a>00226 pFontTableRecord->ucEmphasis = (UCHAR)iEmphasis; -<a name="l00227"></a>00227 } -<a name="l00228"></a>00228 } <span class="comment">/* end of vFontname2Table */</span> -<a name="l00229"></a>00229 -<a name="l00230"></a>00230 <span class="comment">/*</span> -<a name="l00231"></a>00231 <span class="comment"> * vCreateFontTable - Create and initialize the internal font table</span> -<a name="l00232"></a>00232 <span class="comment"> */</span> -<a name="l00233"></a>00233 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00234"></a>00234 vCreateFontTable(<span class="keywordtype">void</span>) -<a name="l00235"></a>00235 { -<a name="l00236"></a>00236 font_table_type *pTmp; -<a name="l00237"></a>00237 <span class="keywordtype">int</span> iNbr; -<a name="l00238"></a>00238 -<a name="l00239"></a>00239 <span class="keywordflow">if</span> (tFontTableRecords == 0) { -<a name="l00240"></a>00240 pFontTable = xfree(pFontTable); -<a name="l00241"></a>00241 <span class="keywordflow">return</span>; -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 -<a name="l00244"></a>00244 <span class="comment">/* Create the font table */</span> -<a name="l00245"></a>00245 pFontTable = xcalloc(tFontTableRecords, <span class="keyword">sizeof</span>(*pFontTable)); -<a name="l00246"></a>00246 -<a name="l00247"></a>00247 <span class="comment">/* Initialize the font table */</span> -<a name="l00248"></a>00248 <span class="keywordflow">for</span> (iNbr = 0, pTmp = pFontTable; -<a name="l00249"></a>00249 pTmp < pFontTable + tFontTableRecords; -<a name="l00250"></a>00250 iNbr++, pTmp++) { -<a name="l00251"></a>00251 pTmp->ucWordFontNumber = (UCHAR)(iNbr / 4); -<a name="l00252"></a>00252 <span class="keywordflow">switch</span> (iNbr % 4) { -<a name="l00253"></a>00253 <span class="keywordflow">case</span> 0: -<a name="l00254"></a>00254 pTmp->usFontStyle = FONT_REGULAR; -<a name="l00255"></a>00255 <span class="keywordflow">break</span>; -<a name="l00256"></a>00256 <span class="keywordflow">case</span> 1: -<a name="l00257"></a>00257 pTmp->usFontStyle = FONT_BOLD; -<a name="l00258"></a>00258 <span class="keywordflow">break</span>; -<a name="l00259"></a>00259 <span class="keywordflow">case</span> 2: -<a name="l00260"></a>00260 pTmp->usFontStyle = FONT_ITALIC; -<a name="l00261"></a>00261 <span class="keywordflow">break</span>; -<a name="l00262"></a>00262 <span class="keywordflow">case</span> 3: -<a name="l00263"></a>00263 pTmp->usFontStyle = FONT_BOLD|FONT_ITALIC; -<a name="l00264"></a>00264 <span class="keywordflow">break</span>; -<a name="l00265"></a>00265 <span class="keywordflow">default</span>: -<a name="l00266"></a>00266 DBG_DEC(iNbr); -<a name="l00267"></a>00267 <span class="keywordflow">break</span>; -<a name="l00268"></a>00268 } -<a name="l00269"></a>00269 } -<a name="l00270"></a>00270 } <span class="comment">/* end of vCreateFontTable */</span> -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 <span class="comment">/*</span> -<a name="l00273"></a>00273 <span class="comment"> * vMinimizeFontTable - make the font table as small as possible</span> -<a name="l00274"></a>00274 <span class="comment"> */</span> -<a name="l00275"></a>00275 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00276"></a>00276 vMinimizeFontTable(<span class="keywordtype">void</span>) -<a name="l00277"></a>00277 { -<a name="l00278"></a>00278 font_block_type tFontNext; -<a name="l00279"></a>00279 <span class="keyword">const</span> style_block_type *pStyle; -<a name="l00280"></a>00280 <span class="keyword">const</span> font_block_type *pFont; -<a name="l00281"></a>00281 font_table_type *pTmp; -<a name="l00282"></a>00282 <span class="keywordtype">int</span> iUnUsed; -<a name="l00283"></a>00283 BOOL bMustAddTableFont; -<a name="l00284"></a>00284 -<a name="l00285"></a>00285 NO_DBG_MSG(<span class="stringliteral">"vMinimizeFontTable"</span>); -<a name="l00286"></a>00286 -<a name="l00287"></a>00287 <span class="keywordflow">if</span> (tFontTableRecords == 0) { -<a name="l00288"></a>00288 pFontTable = xfree(pFontTable); -<a name="l00289"></a>00289 <span class="keywordflow">return</span>; -<a name="l00290"></a>00290 } -<a name="l00291"></a>00291 -<a name="l00292"></a>00292 <span class="comment">/* See if we must add a font for our tables */</span> -<a name="l00293"></a>00293 bMustAddTableFont = TRUE; -<a name="l00294"></a>00294 -<a name="l00295"></a>00295 <span class="preprocessor">#if 0</span> -<a name="l00296"></a>00296 <span class="preprocessor"></span> DBG_MSG(<span class="stringliteral">"Before"</span>); -<a name="l00297"></a>00297 DBG_DEC(tFontTableRecords); -<a name="l00298"></a>00298 <span class="keywordflow">for</span> (pTmp = pFontTable; -<a name="l00299"></a>00299 pTmp < pFontTable + tFontTableRecords; -<a name="l00300"></a>00300 pTmp++) { -<a name="l00301"></a>00301 DBG_DEC(pTmp->ucWordFontNumber); -<a name="l00302"></a>00302 DBG_HEX(pTmp->usFontStyle); -<a name="l00303"></a>00303 DBG_MSG(pTmp->szWordFontname); -<a name="l00304"></a>00304 DBG_MSG(pTmp->szOurFontname); -<a name="l00305"></a>00305 } -<a name="l00306"></a>00306 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00307"></a>00307 -<a name="l00308"></a>00308 <span class="comment">/* See which fonts/styles we really need */</span> -<a name="l00309"></a>00309 -<a name="l00310"></a>00310 <span class="comment">/* Default font/style is by definition in use */</span> -<a name="l00311"></a>00311 pFontTable[0].ucInUse = 1; -<a name="l00312"></a>00312 -<a name="l00313"></a>00313 <span class="comment">/* Make InUse 1 for all the fonts/styles that WILL be used */</span> -<a name="l00314"></a>00314 pFont = NULL; -<a name="l00315"></a>00315 <span class="keywordflow">while</span>((pFont = pGetNextFontInfoListItem(pFont)) != NULL) { -<a name="l00316"></a>00316 pTmp = pFontTable + 4 * (int)pFont->ucFontNumber; -<a name="l00317"></a>00317 if (bIsBold(pFont->usFontStyle)) { -<a name="l00318"></a>00318 pTmp++; -<a name="l00319"></a>00319 } -<a name="l00320"></a>00320 <span class="keywordflow">if</span> (bIsItalic(pFont->usFontStyle)) { -<a name="l00321"></a>00321 pTmp += 2; -<a name="l00322"></a>00322 } -<a name="l00323"></a>00323 <span class="keywordflow">if</span> (pTmp >= pFontTable + tFontTableRecords) { -<a name="l00324"></a>00324 <span class="keywordflow">continue</span>; -<a name="l00325"></a>00325 } -<a name="l00326"></a>00326 <span class="keywordflow">if</span> (STREQ(pTmp->szOurFontname, TABLE_FONT)) { -<a name="l00327"></a>00327 <span class="comment">/* The table font is already present */</span> -<a name="l00328"></a>00328 bMustAddTableFont = FALSE; -<a name="l00329"></a>00329 } -<a name="l00330"></a>00330 pTmp->ucInUse = 1; -<a name="l00331"></a>00331 } -<a name="l00332"></a>00332 -<a name="l00333"></a>00333 <span class="comment">/* Make InUse 1 for all the fonts/styles that MIGHT be used */</span> -<a name="l00334"></a>00334 pStyle = NULL; -<a name="l00335"></a>00335 <span class="keywordflow">while</span>((pStyle = pGetNextStyleInfoListItem(pStyle)) != NULL) { -<a name="l00336"></a>00336 vFillFontFromStylesheet(pStyle->usIstdNext, &tFontNext); -<a name="l00337"></a>00337 vCorrectFontValues(&tFontNext); -<a name="l00338"></a>00338 pTmp = pFontTable + 4 * (int)tFontNext.ucFontNumber; -<a name="l00339"></a>00339 if (bIsBold(tFontNext.usFontStyle)) { -<a name="l00340"></a>00340 pTmp++; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 <span class="keywordflow">if</span> (bIsItalic(tFontNext.usFontStyle)) { -<a name="l00343"></a>00343 pTmp += 2; -<a name="l00344"></a>00344 } -<a name="l00345"></a>00345 <span class="keywordflow">if</span> (pTmp >= pFontTable + tFontTableRecords) { -<a name="l00346"></a>00346 <span class="keywordflow">continue</span>; -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 <span class="keywordflow">if</span> (STREQ(pTmp->szOurFontname, TABLE_FONT)) { -<a name="l00349"></a>00349 <span class="comment">/* The table font is already present */</span> -<a name="l00350"></a>00350 bMustAddTableFont = FALSE; -<a name="l00351"></a>00351 } -<a name="l00352"></a>00352 pTmp->ucInUse = 1; -<a name="l00353"></a>00353 } -<a name="l00354"></a>00354 -<a name="l00355"></a>00355 <span class="comment">/* Remove the unused font entries from the font table */</span> -<a name="l00356"></a>00356 iUnUsed = 0; -<a name="l00357"></a>00357 <span class="keywordflow">for</span> (pTmp = pFontTable; -<a name="l00358"></a>00358 pTmp < pFontTable + tFontTableRecords; -<a name="l00359"></a>00359 pTmp++) { -<a name="l00360"></a>00360 <span class="keywordflow">if</span> (pTmp->ucInUse == 0) { -<a name="l00361"></a>00361 iUnUsed++; -<a name="l00362"></a>00362 <span class="keywordflow">continue</span>; -<a name="l00363"></a>00363 } -<a name="l00364"></a>00364 <span class="keywordflow">if</span> (iUnUsed > 0) { -<a name="l00365"></a>00365 fail(pTmp - iUnUsed <= pFontTable); -<a name="l00366"></a>00366 *(pTmp - iUnUsed) = *pTmp; -<a name="l00367"></a>00367 } -<a name="l00368"></a>00368 } -<a name="l00369"></a>00369 fail(iUnUsed < 0); -<a name="l00370"></a>00370 fail(tFontTableRecords <= (<span class="keywordtype">size_t</span>)iUnUsed); -<a name="l00371"></a>00371 tFontTableRecords -= (size_t)iUnUsed; -<a name="l00372"></a>00372 -<a name="l00373"></a>00373 <span class="keywordflow">if</span> (bMustAddTableFont) { -<a name="l00374"></a>00374 pTmp = pFontTable + tFontTableRecords; -<a name="l00375"></a>00375 fail(pTmp <= pFontTable); -<a name="l00376"></a>00376 pTmp->ucWordFontNumber = (pTmp - 1)->ucWordFontNumber + 1; -<a name="l00377"></a>00377 pTmp->usFontStyle = FONT_REGULAR; -<a name="l00378"></a>00378 pTmp->ucInUse = 1; -<a name="l00379"></a>00379 strcpy(pTmp->szWordFontname, <span class="stringliteral">"Extra Table Font"</span>); -<a name="l00380"></a>00380 strcpy(pTmp->szOurFontname, TABLE_FONT); -<a name="l00381"></a>00381 tFontTableRecords++; -<a name="l00382"></a>00382 iUnUsed--; -<a name="l00383"></a>00383 } -<a name="l00384"></a>00384 <span class="keywordflow">if</span> (iUnUsed > 0) { -<a name="l00385"></a>00385 <span class="comment">/* Resize the font table */</span> -<a name="l00386"></a>00386 pFontTable = xrealloc(pFontTable, -<a name="l00387"></a>00387 tFontTableRecords * <span class="keyword">sizeof</span>(*pFontTable)); -<a name="l00388"></a>00388 } -<a name="l00389"></a>00389 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00390"></a>00390 <span class="preprocessor"></span> DBG_MSG(<span class="stringliteral">"After"</span>); -<a name="l00391"></a>00391 DBG_DEC(tFontTableRecords); -<a name="l00392"></a>00392 <span class="keywordflow">for</span> (pTmp = pFontTable; -<a name="l00393"></a>00393 pTmp < pFontTable + tFontTableRecords; -<a name="l00394"></a>00394 pTmp++) { -<a name="l00395"></a>00395 DBG_DEC(pTmp->ucWordFontNumber); -<a name="l00396"></a>00396 DBG_HEX(pTmp->usFontStyle); -<a name="l00397"></a>00397 DBG_MSG(pTmp->szWordFontname); -<a name="l00398"></a>00398 DBG_MSG(pTmp->szOurFontname); -<a name="l00399"></a>00399 } -<a name="l00400"></a>00400 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00401"></a>00401 } <span class="comment">/* end of vMinimizeFontTable */</span> -<a name="l00402"></a>00402 -<a name="l00403"></a>00403 <span class="comment">/*</span> -<a name="l00404"></a>00404 <span class="comment"> * bReadFontFile - read and check a line from the font translation file</span> -<a name="l00405"></a>00405 <span class="comment"> *</span> -<a name="l00406"></a>00406 <span class="comment"> * returns TRUE when a correct line has been read, otherwise FALSE</span> -<a name="l00407"></a>00407 <span class="comment"> */</span> -<a name="l00408"></a>00408 <span class="keyword">static</span> BOOL -<a name="l00409"></a>00409 bReadFontFile(FILE *pFontTableFile, <span class="keywordtype">char</span> *szWordFont, -<a name="l00410"></a>00410 <span class="keywordtype">int</span> *piItalic, <span class="keywordtype">int</span> *piBold, <span class="keywordtype">char</span> *szOurFont, <span class="keywordtype">int</span> *piSpecial) -<a name="l00411"></a>00411 { -<a name="l00412"></a>00412 <span class="keywordtype">char</span> *pcTmp; -<a name="l00413"></a>00413 <span class="keywordtype">int</span> iFields; -<a name="l00414"></a>00414 <span class="keywordtype">char</span> szLine[FONT_LINE_LENGTH]; -<a name="l00415"></a>00415 -<a name="l00416"></a>00416 fail(szWordFont == NULL || szOurFont == NULL); -<a name="l00417"></a>00417 fail(piItalic == NULL || piBold == NULL || piSpecial == NULL); -<a name="l00418"></a>00418 -<a name="l00419"></a>00419 <span class="keywordflow">while</span> (fgets(szLine, (<span class="keywordtype">int</span>)<span class="keyword">sizeof</span>(szLine), pFontTableFile) != NULL) { -<a name="l00420"></a>00420 <span class="keywordflow">if</span> (szLine[0] == <span class="charliteral">'#'</span> || -<a name="l00421"></a>00421 szLine[0] == <span class="charliteral">'\n'</span> || -<a name="l00422"></a>00422 szLine[0] == <span class="charliteral">'\r'</span>) { -<a name="l00423"></a>00423 <span class="keywordflow">continue</span>; -<a name="l00424"></a>00424 } -<a name="l00425"></a>00425 iFields = sscanf(szLine, <span class="stringliteral">"%[^,],%d,%d,%1s%[^,],%d"</span>, -<a name="l00426"></a>00426 szWordFont, piItalic, piBold, -<a name="l00427"></a>00427 &szOurFont[0], &szOurFont[1], piSpecial); -<a name="l00428"></a>00428 <span class="keywordflow">if</span> (iFields != 6) { -<a name="l00429"></a>00429 pcTmp = strchr(szLine, <span class="charliteral">'\r'</span>); -<a name="l00430"></a>00430 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00431"></a>00431 *pcTmp = <span class="charliteral">'\0'</span>; -<a name="l00432"></a>00432 } -<a name="l00433"></a>00433 pcTmp = strchr(szLine, <span class="charliteral">'\n'</span>); -<a name="l00434"></a>00434 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00435"></a>00435 *pcTmp = <span class="charliteral">'\0'</span>; -<a name="l00436"></a>00436 } -<a name="l00437"></a>00437 DBG_DEC(iFields); -<a name="l00438"></a>00438 werr(0, <span class="stringliteral">"Syntax error in: '%s'"</span>, szLine); -<a name="l00439"></a>00439 <span class="keywordflow">continue</span>; -<a name="l00440"></a>00440 } -<a name="l00441"></a>00441 <span class="keywordflow">if</span> (strlen(szWordFont) >= -<a name="l00442"></a>00442 <span class="keyword">sizeof</span>(pFontTable[0].szWordFontname)) { -<a name="l00443"></a>00443 werr(0, <span class="stringliteral">"Word fontname too long: '%s'"</span>, szWordFont); -<a name="l00444"></a>00444 <span class="keywordflow">continue</span>; -<a name="l00445"></a>00445 } -<a name="l00446"></a>00446 <span class="keywordflow">if</span> (strlen(szOurFont) >= -<a name="l00447"></a>00447 <span class="keyword">sizeof</span>(pFontTable[0].szOurFontname)) { -<a name="l00448"></a>00448 werr(0, <span class="stringliteral">"Local fontname too long: '%s'"</span>, szOurFont); -<a name="l00449"></a>00449 <span class="keywordflow">continue</span>; -<a name="l00450"></a>00450 } -<a name="l00451"></a>00451 <span class="comment">/* The current line passed all the tests */</span> -<a name="l00452"></a>00452 <span class="keywordflow">return</span> TRUE; -<a name="l00453"></a>00453 } -<a name="l00454"></a>00454 <span class="keywordflow">return</span> FALSE; -<a name="l00455"></a>00455 } <span class="comment">/* end of bReadFontFile */</span> -<a name="l00456"></a>00456 -<a name="l00457"></a>00457 <span class="comment">/*</span> -<a name="l00458"></a>00458 <span class="comment"> * vCreate0FontTable - create a font table from Word for DOS</span> -<a name="l00459"></a>00459 <span class="comment"> */</span> -<a name="l00460"></a>00460 <span class="keywordtype">void</span> -<a name="l00461"></a>00461 vCreate0FontTable(<span class="keywordtype">void</span>) -<a name="l00462"></a>00462 { -<a name="l00463"></a>00463 FILE *pFontTableFile; -<a name="l00464"></a>00464 font_table_type *pTmp; -<a name="l00465"></a>00465 UCHAR *aucFont; -<a name="l00466"></a>00466 <span class="keywordtype">int</span> iBold, iItalic, iSpecial, iEmphasis, iFtc; -<a name="l00467"></a>00467 UCHAR ucPrq, ucFf, ucFFN; -<a name="l00468"></a>00468 <span class="keywordtype">char</span> szWordFont[FONT_LINE_LENGTH], szOurFont[FONT_LINE_LENGTH]; -<a name="l00469"></a>00469 -<a name="l00470"></a>00470 tFontTableRecords = 0; -<a name="l00471"></a>00471 pFontTable = xfree(pFontTable); -<a name="l00472"></a>00472 -<a name="l00473"></a>00473 pFontTableFile = pOpenFontTableFile(); -<a name="l00474"></a>00474 <span class="keywordflow">if</span> (pFontTableFile == NULL) { -<a name="l00475"></a>00475 <span class="comment">/* No translation table file, no translation table */</span> -<a name="l00476"></a>00476 <span class="keywordflow">return</span>; -<a name="l00477"></a>00477 } -<a name="l00478"></a>00478 -<a name="l00479"></a>00479 <span class="comment">/* Get the maximum number of entries in the font table */</span> -<a name="l00480"></a>00480 tFontTableRecords = 64; -<a name="l00481"></a>00481 tFontTableRecords *= 4; <span class="comment">/* Plain, Bold, Italic and Bold/italic */</span> -<a name="l00482"></a>00482 tFontTableRecords++; <span class="comment">/* One extra for the table-font */</span> -<a name="l00483"></a>00483 vCreateFontTable(); -<a name="l00484"></a>00484 -<a name="l00485"></a>00485 <span class="comment">/* Read the font translation file */</span> -<a name="l00486"></a>00486 iItalic = 0; -<a name="l00487"></a>00487 iBold = 0; -<a name="l00488"></a>00488 iSpecial = 0; -<a name="l00489"></a>00489 <span class="keywordflow">while</span> (bReadFontFile(pFontTableFile, szWordFont, -<a name="l00490"></a>00490 &iItalic, &iBold, szOurFont, &iSpecial)) { -<a name="l00491"></a>00491 iEmphasis = 0; -<a name="l00492"></a>00492 <span class="keywordflow">if</span> (iBold != 0) { -<a name="l00493"></a>00493 iEmphasis++; -<a name="l00494"></a>00494 } -<a name="l00495"></a>00495 <span class="keywordflow">if</span> (iItalic != 0) { -<a name="l00496"></a>00496 iEmphasis += 2; -<a name="l00497"></a>00497 } -<a name="l00498"></a>00498 <span class="keywordflow">for</span> (iFtc = 0, pTmp = pFontTable + iEmphasis; -<a name="l00499"></a>00499 pTmp < pFontTable + tFontTableRecords; -<a name="l00500"></a>00500 iFtc++, pTmp += 4) { -<a name="l00501"></a>00501 <span class="keywordflow">if</span> (iFtc >= 16 && iFtc <= 55) { -<a name="l00502"></a>00502 ucPrq = PITCH_VARIABLE; -<a name="l00503"></a>00503 ucFf = FAMILY_ROMAN; -<a name="l00504"></a>00504 aucFont = (UCHAR *)<span class="stringliteral">"Times"</span>; -<a name="l00505"></a>00505 } <span class="keywordflow">else</span> { -<a name="l00506"></a>00506 ucPrq = PITCH_FIXED; -<a name="l00507"></a>00507 ucFf = FAMILY_MODERN; -<a name="l00508"></a>00508 aucFont = (UCHAR *)<span class="stringliteral">"Courier"</span>; -<a name="l00509"></a>00509 } -<a name="l00510"></a>00510 ucFFN = (ucFf << 4) | ucPrq; -<a name="l00511"></a>00511 vFontname2Table(aucFont, NULL, 1, iEmphasis, -<a name="l00512"></a>00512 ucFFN, szWordFont, szOurFont, pTmp); -<a name="l00513"></a>00513 } -<a name="l00514"></a>00514 } -<a name="l00515"></a>00515 (void)fclose(pFontTableFile); -<a name="l00516"></a>00516 vMinimizeFontTable(); -<a name="l00517"></a>00517 } <span class="comment">/* end of vCreate0FontTable */</span> -<a name="l00518"></a>00518 -<a name="l00519"></a>00519 <span class="comment">/*</span> -<a name="l00520"></a>00520 <span class="comment"> * vCreate2FontTable - create a font table from WinWord 1/2</span> -<a name="l00521"></a>00521 <span class="comment"> */</span> -<a name="l00522"></a>00522 <span class="keywordtype">void</span> -<a name="l00523"></a>00523 vCreate2FontTable(FILE *pFile, <span class="keywordtype">int</span> iWordVersion, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00524"></a>00524 { -<a name="l00525"></a>00525 FILE *pFontTableFile; -<a name="l00526"></a>00526 font_table_type *pTmp; -<a name="l00527"></a>00527 UCHAR *aucFont; -<a name="l00528"></a>00528 UCHAR *aucBuffer; -<a name="l00529"></a>00529 ULONG ulBeginFontInfo; -<a name="l00530"></a>00530 <span class="keywordtype">size_t</span> tFontInfoLen; -<a name="l00531"></a>00531 <span class="keywordtype">int</span> iPos, iOff, iRecLen; -<a name="l00532"></a>00532 <span class="keywordtype">int</span> iBold, iItalic, iSpecial, iEmphasis; -<a name="l00533"></a>00533 UCHAR ucFFN; -<a name="l00534"></a>00534 <span class="keywordtype">char</span> szWordFont[FONT_LINE_LENGTH], szOurFont[FONT_LINE_LENGTH]; -<a name="l00535"></a>00535 -<a name="l00536"></a>00536 fail(pFile == NULL || aucHeader == NULL); -<a name="l00537"></a>00537 fail(iWordVersion != 1 && iWordVersion != 2); -<a name="l00538"></a>00538 -<a name="l00539"></a>00539 tFontTableRecords = 0; -<a name="l00540"></a>00540 pFontTable = xfree(pFontTable); -<a name="l00541"></a>00541 -<a name="l00542"></a>00542 pFontTableFile = pOpenFontTableFile(); -<a name="l00543"></a>00543 <span class="keywordflow">if</span> (pFontTableFile == NULL) { -<a name="l00544"></a>00544 <span class="comment">/* No translation table file, no translation table */</span> -<a name="l00545"></a>00545 <span class="keywordflow">return</span>; -<a name="l00546"></a>00546 } -<a name="l00547"></a>00547 -<a name="l00548"></a>00548 ulBeginFontInfo = ulGetLong(0xb2, aucHeader); <span class="comment">/* fcSttbfffn */</span> -<a name="l00549"></a>00549 DBG_HEX(ulBeginFontInfo); -<a name="l00550"></a>00550 tFontInfoLen = (size_t)usGetWord(0xb6, aucHeader); <span class="comment">/* cbSttbfffn */</span> -<a name="l00551"></a>00551 DBG_DEC(tFontInfoLen); -<a name="l00552"></a>00552 -<a name="l00553"></a>00553 <span class="keywordflow">if</span> (ulBeginFontInfo > (ULONG)LONG_MAX || tFontInfoLen == 0) { -<a name="l00554"></a>00554 <span class="comment">/* Don't ask me why this is needed */</span> -<a name="l00555"></a>00555 DBG_HEX_C(tFontInfoLen != 0, ulBeginFontInfo); -<a name="l00556"></a>00556 (void)fclose(pFontTableFile); -<a name="l00557"></a>00557 <span class="keywordflow">return</span>; -<a name="l00558"></a>00558 } -<a name="l00559"></a>00559 -<a name="l00560"></a>00560 aucBuffer = xmalloc(tFontInfoLen); -<a name="l00561"></a>00561 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tFontInfoLen, ulBeginFontInfo, pFile)) { -<a name="l00562"></a>00562 aucBuffer = xfree(aucBuffer); -<a name="l00563"></a>00563 (void)fclose(pFontTableFile); -<a name="l00564"></a>00564 <span class="keywordflow">return</span>; -<a name="l00565"></a>00565 } -<a name="l00566"></a>00566 NO_DBG_PRINT_BLOCK(aucBuffer, tFontInfoLen); -<a name="l00567"></a>00567 DBG_DEC(usGetWord(0, aucBuffer)); -<a name="l00568"></a>00568 -<a name="l00569"></a>00569 <span class="comment">/* Compute the maximum number of entries in the font table */</span> -<a name="l00570"></a>00570 <span class="keywordflow">if</span> (iWordVersion == 1) { -<a name="l00571"></a>00571 fail(tFontInfoLen < 2); -<a name="l00572"></a>00572 <span class="comment">/* WinWord 1 has three implicit fonts */</span> -<a name="l00573"></a>00573 tFontTableRecords = 3; -<a name="l00574"></a>00574 iOff = 2; -<a name="l00575"></a>00575 } <span class="keywordflow">else</span> { -<a name="l00576"></a>00576 fail(tFontInfoLen < 6); -<a name="l00577"></a>00577 <span class="comment">/* WinWord 2 and up have no implicit fonts */</span> -<a name="l00578"></a>00578 tFontTableRecords = 0; -<a name="l00579"></a>00579 iOff = 3; -<a name="l00580"></a>00580 } -<a name="l00581"></a>00581 iPos = 2; -<a name="l00582"></a>00582 <span class="keywordflow">while</span> (iPos + iOff < (<span class="keywordtype">int</span>)tFontInfoLen) { -<a name="l00583"></a>00583 iRecLen = (int)ucGetByte(iPos, aucBuffer); -<a name="l00584"></a>00584 NO_DBG_DEC(iRecLen); -<a name="l00585"></a>00585 NO_DBG_MSG(aucBuffer + iPos + iOff); -<a name="l00586"></a>00586 iPos += iRecLen + 1; -<a name="l00587"></a>00587 tFontTableRecords++; -<a name="l00588"></a>00588 } -<a name="l00589"></a>00589 tFontTableRecords *= 4; <span class="comment">/* Plain, Bold, Italic and Bold/Italic */</span> -<a name="l00590"></a>00590 tFontTableRecords++; <span class="comment">/* One extra for the table-font */</span> -<a name="l00591"></a>00591 vCreateFontTable(); -<a name="l00592"></a>00592 -<a name="l00593"></a>00593 <span class="comment">/* Add the tree implicit fonts (in four variations) */</span> -<a name="l00594"></a>00594 <span class="keywordflow">if</span> (iWordVersion == 1) { -<a name="l00595"></a>00595 fail(tFontTableRecords < 13); -<a name="l00596"></a>00596 vFontname2Table((UCHAR *)<span class="stringliteral">"Tms Rmn"</span>, NULL, 1, 0, -<a name="l00597"></a>00597 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00598"></a>00598 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Roman"</span>, pFontTable + 0); -<a name="l00599"></a>00599 vFontname2Table((UCHAR *)<span class="stringliteral">"Tms Rmn"</span>, NULL, 1, 1, -<a name="l00600"></a>00600 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00601"></a>00601 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Bold"</span>, pFontTable + 1); -<a name="l00602"></a>00602 vFontname2Table((UCHAR *)<span class="stringliteral">"Tms Rmn"</span>, NULL, 1, 2, -<a name="l00603"></a>00603 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00604"></a>00604 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Italic"</span>, pFontTable + 2); -<a name="l00605"></a>00605 vFontname2Table((UCHAR *)<span class="stringliteral">"Tms Rmn"</span>, NULL, 1, 3, -<a name="l00606"></a>00606 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00607"></a>00607 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-BoldItalic"</span>, pFontTable + 3); -<a name="l00608"></a>00608 vFontname2Table((UCHAR *)<span class="stringliteral">"Symbol"</span>, NULL, 1, 0, -<a name="l00609"></a>00609 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00610"></a>00610 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Roman"</span>, pFontTable + 4); -<a name="l00611"></a>00611 vFontname2Table((UCHAR *)<span class="stringliteral">"Symbol"</span>, NULL, 1, 1, -<a name="l00612"></a>00612 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00613"></a>00613 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Bold"</span>, pFontTable + 5); -<a name="l00614"></a>00614 vFontname2Table((UCHAR *)<span class="stringliteral">"Symbol"</span>, NULL, 1, 2, -<a name="l00615"></a>00615 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00616"></a>00616 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-Italic"</span>, pFontTable + 6); -<a name="l00617"></a>00617 vFontname2Table((UCHAR *)<span class="stringliteral">"Symbol"</span>, NULL, 1, 3, -<a name="l00618"></a>00618 (UCHAR)((FAMILY_ROMAN << 4) | PITCH_VARIABLE), -<a name="l00619"></a>00619 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Times-BoldItalic"</span>, pFontTable + 7); -<a name="l00620"></a>00620 vFontname2Table((UCHAR *)<span class="stringliteral">"Helv"</span>, NULL, 1, 0, -<a name="l00621"></a>00621 (UCHAR)((FAMILY_SWISS << 4) | PITCH_VARIABLE), -<a name="l00622"></a>00622 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Helvetica"</span>, pFontTable + 8); -<a name="l00623"></a>00623 vFontname2Table((UCHAR *)<span class="stringliteral">"Helv"</span>, NULL, 1, 1, -<a name="l00624"></a>00624 (UCHAR)((FAMILY_SWISS << 4) | PITCH_VARIABLE), -<a name="l00625"></a>00625 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Helvetica-Bold"</span>, pFontTable + 9); -<a name="l00626"></a>00626 vFontname2Table((UCHAR *)<span class="stringliteral">"Helv"</span>, NULL, 1, 2, -<a name="l00627"></a>00627 (UCHAR)((FAMILY_SWISS << 4) | PITCH_VARIABLE), -<a name="l00628"></a>00628 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Helvetica-Oblique"</span>, pFontTable + 10); -<a name="l00629"></a>00629 vFontname2Table((UCHAR *)<span class="stringliteral">"Helv"</span>, NULL, 1, 3, -<a name="l00630"></a>00630 (UCHAR)((FAMILY_SWISS << 4) | PITCH_VARIABLE), -<a name="l00631"></a>00631 <span class="stringliteral">"*"</span>, <span class="stringliteral">"Helvetica-BoldOblique"</span>, pFontTable + 11); -<a name="l00632"></a>00632 } -<a name="l00633"></a>00633 -<a name="l00634"></a>00634 <span class="comment">/* Read the font translation file */</span> -<a name="l00635"></a>00635 iItalic = 0; -<a name="l00636"></a>00636 iBold = 0; -<a name="l00637"></a>00637 iSpecial = 0; -<a name="l00638"></a>00638 <span class="keywordflow">while</span> (bReadFontFile(pFontTableFile, szWordFont, -<a name="l00639"></a>00639 &iItalic, &iBold, szOurFont, &iSpecial)) { -<a name="l00640"></a>00640 iEmphasis = 0; -<a name="l00641"></a>00641 <span class="keywordflow">if</span> (iBold != 0) { -<a name="l00642"></a>00642 iEmphasis++; -<a name="l00643"></a>00643 } -<a name="l00644"></a>00644 <span class="keywordflow">if</span> (iItalic != 0) { -<a name="l00645"></a>00645 iEmphasis += 2; -<a name="l00646"></a>00646 } -<a name="l00647"></a>00647 pTmp = pFontTable + iEmphasis; -<a name="l00648"></a>00648 iPos = 2; -<a name="l00649"></a>00649 <span class="keywordflow">while</span> (iPos + iOff < (<span class="keywordtype">int</span>)tFontInfoLen) { -<a name="l00650"></a>00650 iRecLen = (int)ucGetByte(iPos, aucBuffer); -<a name="l00651"></a>00651 ucFFN = ucGetByte(iPos + 1, aucBuffer); -<a name="l00652"></a>00652 aucFont = aucBuffer + iPos + iOff; -<a name="l00653"></a>00653 vFontname2Table(aucFont, NULL, 1, iEmphasis, -<a name="l00654"></a>00654 ucFFN, szWordFont, szOurFont, pTmp); -<a name="l00655"></a>00655 pTmp += 4; -<a name="l00656"></a>00656 iPos += iRecLen + 1; -<a name="l00657"></a>00657 } -<a name="l00658"></a>00658 } -<a name="l00659"></a>00659 (void)fclose(pFontTableFile); -<a name="l00660"></a>00660 aucBuffer = xfree(aucBuffer); -<a name="l00661"></a>00661 vMinimizeFontTable(); -<a name="l00662"></a>00662 } <span class="comment">/* end of vCreate2FontTable */</span> -<a name="l00663"></a>00663 -<a name="l00664"></a>00664 <span class="comment">/*</span> -<a name="l00665"></a>00665 <span class="comment"> * vCreate6FontTable - create a font table from Word 6/7</span> -<a name="l00666"></a>00666 <span class="comment"> */</span> -<a name="l00667"></a>00667 <span class="keywordtype">void</span> -<a name="l00668"></a>00668 vCreate6FontTable(FILE *pFile, ULONG ulStartBlock, -<a name="l00669"></a>00669 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00670"></a>00670 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00671"></a>00671 { -<a name="l00672"></a>00672 FILE *pFontTableFile; -<a name="l00673"></a>00673 font_table_type *pTmp; -<a name="l00674"></a>00674 UCHAR *aucFont, *aucAltFont; -<a name="l00675"></a>00675 UCHAR *aucBuffer; -<a name="l00676"></a>00676 ULONG ulBeginFontInfo; -<a name="l00677"></a>00677 <span class="keywordtype">size_t</span> tFontInfoLen; -<a name="l00678"></a>00678 <span class="keywordtype">int</span> iPos, iRecLen, iOffsetAltName; -<a name="l00679"></a>00679 <span class="keywordtype">int</span> iBold, iItalic, iSpecial, iEmphasis; -<a name="l00680"></a>00680 UCHAR ucFFN; -<a name="l00681"></a>00681 <span class="keywordtype">char</span> szWordFont[FONT_LINE_LENGTH], szOurFont[FONT_LINE_LENGTH]; -<a name="l00682"></a>00682 -<a name="l00683"></a>00683 fail(pFile == NULL || aucHeader == NULL); -<a name="l00684"></a>00684 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00685"></a>00685 fail(aulBBD == NULL); -<a name="l00686"></a>00686 -<a name="l00687"></a>00687 tFontTableRecords = 0; -<a name="l00688"></a>00688 pFontTable = xfree(pFontTable); -<a name="l00689"></a>00689 -<a name="l00690"></a>00690 pFontTableFile = pOpenFontTableFile(); -<a name="l00691"></a>00691 <span class="keywordflow">if</span> (pFontTableFile == NULL) { -<a name="l00692"></a>00692 <span class="comment">/* No translation table file, no translation table */</span> -<a name="l00693"></a>00693 <span class="keywordflow">return</span>; -<a name="l00694"></a>00694 } -<a name="l00695"></a>00695 -<a name="l00696"></a>00696 ulBeginFontInfo = ulGetLong(0xd0, aucHeader); <span class="comment">/* fcSttbfffn */</span> -<a name="l00697"></a>00697 DBG_HEX(ulBeginFontInfo); -<a name="l00698"></a>00698 tFontInfoLen = (size_t)ulGetLong(0xd4, aucHeader); <span class="comment">/* lcbSttbfffn */</span> -<a name="l00699"></a>00699 DBG_DEC(tFontInfoLen); -<a name="l00700"></a>00700 fail(tFontInfoLen < 9); -<a name="l00701"></a>00701 -<a name="l00702"></a>00702 aucBuffer = xmalloc(tFontInfoLen); -<a name="l00703"></a>00703 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00704"></a>00704 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00705"></a>00705 aucBuffer, ulBeginFontInfo, tFontInfoLen)) { -<a name="l00706"></a>00706 aucBuffer = xfree(aucBuffer); -<a name="l00707"></a>00707 (void)fclose(pFontTableFile); -<a name="l00708"></a>00708 <span class="keywordflow">return</span>; -<a name="l00709"></a>00709 } -<a name="l00710"></a>00710 DBG_DEC(usGetWord(0, aucBuffer)); -<a name="l00711"></a>00711 -<a name="l00712"></a>00712 <span class="comment">/* Compute the maximum number of entries in the font table */</span> -<a name="l00713"></a>00713 tFontTableRecords = 0; -<a name="l00714"></a>00714 iPos = 2; -<a name="l00715"></a>00715 <span class="keywordflow">while</span> (iPos + 6 < (<span class="keywordtype">int</span>)tFontInfoLen) { -<a name="l00716"></a>00716 iRecLen = (int)ucGetByte(iPos, aucBuffer); -<a name="l00717"></a>00717 NO_DBG_DEC(iRecLen); -<a name="l00718"></a>00718 iOffsetAltName = (int)ucGetByte(iPos + 5, aucBuffer); -<a name="l00719"></a>00719 NO_DBG_MSG(aucBuffer + iPos + 6); -<a name="l00720"></a>00720 NO_DBG_MSG_C(iOffsetAltName > 0, -<a name="l00721"></a>00721 aucBuffer + iPos + 6 + iOffsetAltName); -<a name="l00722"></a>00722 iPos += iRecLen + 1; -<a name="l00723"></a>00723 tFontTableRecords++; -<a name="l00724"></a>00724 } -<a name="l00725"></a>00725 tFontTableRecords *= 4; <span class="comment">/* Plain, Bold, Italic and Bold/italic */</span> -<a name="l00726"></a>00726 tFontTableRecords++; <span class="comment">/* One extra for the table-font */</span> -<a name="l00727"></a>00727 vCreateFontTable(); -<a name="l00728"></a>00728 -<a name="l00729"></a>00729 <span class="comment">/* Read the font translation file */</span> -<a name="l00730"></a>00730 iItalic = 0; -<a name="l00731"></a>00731 iBold = 0; -<a name="l00732"></a>00732 iSpecial = 0; -<a name="l00733"></a>00733 <span class="keywordflow">while</span> (bReadFontFile(pFontTableFile, szWordFont, -<a name="l00734"></a>00734 &iItalic, &iBold, szOurFont, &iSpecial)) { -<a name="l00735"></a>00735 iEmphasis = 0; -<a name="l00736"></a>00736 <span class="keywordflow">if</span> (iBold != 0) { -<a name="l00737"></a>00737 iEmphasis++; -<a name="l00738"></a>00738 } -<a name="l00739"></a>00739 <span class="keywordflow">if</span> (iItalic != 0) { -<a name="l00740"></a>00740 iEmphasis += 2; -<a name="l00741"></a>00741 } -<a name="l00742"></a>00742 pTmp = pFontTable + iEmphasis; -<a name="l00743"></a>00743 iPos = 2; -<a name="l00744"></a>00744 <span class="keywordflow">while</span> (iPos + 6 < (<span class="keywordtype">int</span>)tFontInfoLen) { -<a name="l00745"></a>00745 iRecLen = (int)ucGetByte(iPos, aucBuffer); -<a name="l00746"></a>00746 ucFFN = ucGetByte(iPos + 1, aucBuffer); -<a name="l00747"></a>00747 aucFont = aucBuffer + iPos + 6; -<a name="l00748"></a>00748 iOffsetAltName = (int)ucGetByte(iPos + 5, aucBuffer); -<a name="l00749"></a>00749 <span class="keywordflow">if</span> (iOffsetAltName <= 0) { -<a name="l00750"></a>00750 aucAltFont = NULL; -<a name="l00751"></a>00751 } <span class="keywordflow">else</span> { -<a name="l00752"></a>00752 aucAltFont = aucFont + iOffsetAltName; -<a name="l00753"></a>00753 NO_DBG_MSG(aucFont); -<a name="l00754"></a>00754 NO_DBG_MSG(aucAltFont); -<a name="l00755"></a>00755 } -<a name="l00756"></a>00756 vFontname2Table(aucFont, aucAltFont, 1, iEmphasis, -<a name="l00757"></a>00757 ucFFN, szWordFont, szOurFont, pTmp); -<a name="l00758"></a>00758 pTmp += 4; -<a name="l00759"></a>00759 iPos += iRecLen + 1; -<a name="l00760"></a>00760 } -<a name="l00761"></a>00761 } -<a name="l00762"></a>00762 (void)fclose(pFontTableFile); -<a name="l00763"></a>00763 aucBuffer = xfree(aucBuffer); -<a name="l00764"></a>00764 vMinimizeFontTable(); -<a name="l00765"></a>00765 } <span class="comment">/* end of vCreate6FontTable */</span> -<a name="l00766"></a>00766 -<a name="l00767"></a>00767 <span class="comment">/*</span> -<a name="l00768"></a>00768 <span class="comment"> * vCreate8FontTable - create a font table from Word 8/9/10</span> -<a name="l00769"></a>00769 <span class="comment"> */</span> -<a name="l00770"></a>00770 <span class="keywordtype">void</span> -<a name="l00771"></a>00771 vCreate8FontTable(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00772"></a>00772 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00773"></a>00773 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00774"></a>00774 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00775"></a>00775 { -<a name="l00776"></a>00776 FILE *pFontTableFile; -<a name="l00777"></a>00777 font_table_type *pTmp; -<a name="l00778"></a>00778 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00779"></a>00779 UCHAR *aucFont, *aucAltFont; -<a name="l00780"></a>00780 UCHAR *aucBuffer; -<a name="l00781"></a>00781 ULONG ulBeginFontInfo; -<a name="l00782"></a>00782 <span class="keywordtype">size_t</span> tFontInfoLen, tBlockDepotLen, tBlockSize; -<a name="l00783"></a>00783 <span class="keywordtype">int</span> iPos, iRecLen, iOffsetAltName; -<a name="l00784"></a>00784 <span class="keywordtype">int</span> iBold, iItalic, iSpecial, iEmphasis; -<a name="l00785"></a>00785 UCHAR ucFFN; -<a name="l00786"></a>00786 <span class="keywordtype">char</span> szWordFont[FONT_LINE_LENGTH], szOurFont[FONT_LINE_LENGTH]; -<a name="l00787"></a>00787 -<a name="l00788"></a>00788 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l00789"></a>00789 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00790"></a>00790 -<a name="l00791"></a>00791 tFontTableRecords = 0; -<a name="l00792"></a>00792 pFontTable = xfree(pFontTable); -<a name="l00793"></a>00793 -<a name="l00794"></a>00794 pFontTableFile = pOpenFontTableFile(); -<a name="l00795"></a>00795 <span class="keywordflow">if</span> (pFontTableFile == NULL) { -<a name="l00796"></a>00796 <span class="comment">/* No translation table file, no translation table */</span> -<a name="l00797"></a>00797 <span class="keywordflow">return</span>; -<a name="l00798"></a>00798 } -<a name="l00799"></a>00799 -<a name="l00800"></a>00800 ulBeginFontInfo = ulGetLong(0x112, aucHeader); <span class="comment">/* fcSttbfffn */</span> -<a name="l00801"></a>00801 DBG_HEX(ulBeginFontInfo); -<a name="l00802"></a>00802 tFontInfoLen = (size_t)ulGetLong(0x116, aucHeader); <span class="comment">/* lcbSttbfffn */</span> -<a name="l00803"></a>00803 DBG_DEC(tFontInfoLen); -<a name="l00804"></a>00804 fail(tFontInfoLen < 46); -<a name="l00805"></a>00805 -<a name="l00806"></a>00806 DBG_DEC(pPPS->tTable.ulSB); -<a name="l00807"></a>00807 DBG_HEX(pPPS->tTable.ulSize); -<a name="l00808"></a>00808 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00809"></a>00809 DBG_MSG(<span class="stringliteral">"No fontname table"</span>); -<a name="l00810"></a>00810 (void)fclose(pFontTableFile); -<a name="l00811"></a>00811 <span class="keywordflow">return</span>; -<a name="l00812"></a>00812 } -<a name="l00813"></a>00813 -<a name="l00814"></a>00814 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00815"></a>00815 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00816"></a>00816 aulBlockDepot = aulSBD; -<a name="l00817"></a>00817 tBlockDepotLen = tSBDLen; -<a name="l00818"></a>00818 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00819"></a>00819 } <span class="keywordflow">else</span> { -<a name="l00820"></a>00820 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00821"></a>00821 aulBlockDepot = aulBBD; -<a name="l00822"></a>00822 tBlockDepotLen = tBBDLen; -<a name="l00823"></a>00823 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00824"></a>00824 } -<a name="l00825"></a>00825 aucBuffer = xmalloc(tFontInfoLen); -<a name="l00826"></a>00826 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00827"></a>00827 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00828"></a>00828 aucBuffer, ulBeginFontInfo, tFontInfoLen)) { -<a name="l00829"></a>00829 aucBuffer = xfree(aucBuffer); -<a name="l00830"></a>00830 (void)fclose(pFontTableFile); -<a name="l00831"></a>00831 <span class="keywordflow">return</span>; -<a name="l00832"></a>00832 } -<a name="l00833"></a>00833 NO_DBG_PRINT_BLOCK(aucBuffer, tFontInfoLen); -<a name="l00834"></a>00834 -<a name="l00835"></a>00835 <span class="comment">/* Get the maximum number of entries in the font table */</span> -<a name="l00836"></a>00836 tFontTableRecords = (size_t)usGetWord(0, aucBuffer); -<a name="l00837"></a>00837 tFontTableRecords *= 4; <span class="comment">/* Plain, Bold, Italic and Bold/italic */</span> -<a name="l00838"></a>00838 tFontTableRecords++; <span class="comment">/* One extra for the table-font */</span> -<a name="l00839"></a>00839 vCreateFontTable(); -<a name="l00840"></a>00840 -<a name="l00841"></a>00841 <span class="comment">/* Read the font translation file */</span> -<a name="l00842"></a>00842 iItalic = 0; -<a name="l00843"></a>00843 iBold = 0; -<a name="l00844"></a>00844 iSpecial = 0; -<a name="l00845"></a>00845 <span class="keywordflow">while</span> (bReadFontFile(pFontTableFile, szWordFont, -<a name="l00846"></a>00846 &iItalic, &iBold, szOurFont, &iSpecial)) { -<a name="l00847"></a>00847 iEmphasis = 0; -<a name="l00848"></a>00848 <span class="keywordflow">if</span> (iBold != 0) { -<a name="l00849"></a>00849 iEmphasis++; -<a name="l00850"></a>00850 } -<a name="l00851"></a>00851 <span class="keywordflow">if</span> (iItalic != 0) { -<a name="l00852"></a>00852 iEmphasis += 2; -<a name="l00853"></a>00853 } -<a name="l00854"></a>00854 pTmp = pFontTable + iEmphasis; -<a name="l00855"></a>00855 iPos = 4; -<a name="l00856"></a>00856 <span class="keywordflow">while</span> (iPos + 40 < (<span class="keywordtype">int</span>)tFontInfoLen) { -<a name="l00857"></a>00857 iRecLen = (int)ucGetByte(iPos, aucBuffer); -<a name="l00858"></a>00858 ucFFN = ucGetByte(iPos + 1, aucBuffer); -<a name="l00859"></a>00859 aucFont = aucBuffer + iPos + 40; -<a name="l00860"></a>00860 iOffsetAltName = (int)unilen(aucFont); -<a name="l00861"></a>00861 <span class="keywordflow">if</span> (iPos + 40 + iOffsetAltName + 4 >= iRecLen) { -<a name="l00862"></a>00862 aucAltFont = NULL; -<a name="l00863"></a>00863 } <span class="keywordflow">else</span> { -<a name="l00864"></a>00864 aucAltFont = aucFont + iOffsetAltName + 2; -<a name="l00865"></a>00865 NO_DBG_UNICODE(aucFont); -<a name="l00866"></a>00866 NO_DBG_UNICODE(aucAltFont); -<a name="l00867"></a>00867 } -<a name="l00868"></a>00868 vFontname2Table(aucFont, aucAltFont, 2, iEmphasis, -<a name="l00869"></a>00869 ucFFN, szWordFont, szOurFont, pTmp); -<a name="l00870"></a>00870 pTmp += 4; -<a name="l00871"></a>00871 iPos += iRecLen + 1; -<a name="l00872"></a>00872 } -<a name="l00873"></a>00873 } -<a name="l00874"></a>00874 (void)fclose(pFontTableFile); -<a name="l00875"></a>00875 aucBuffer = xfree(aucBuffer); -<a name="l00876"></a>00876 vMinimizeFontTable(); -<a name="l00877"></a>00877 } <span class="comment">/* end of vCreate8FontTable */</span> -<a name="l00878"></a>00878 -<a name="l00879"></a>00879 <span class="comment">/*</span> -<a name="l00880"></a>00880 <span class="comment"> * Destroy the internal font table by freeing its memory</span> -<a name="l00881"></a>00881 <span class="comment"> */</span> -<a name="l00882"></a>00882 <span class="keywordtype">void</span> -<a name="l00883"></a>00883 vDestroyFontTable(<span class="keywordtype">void</span>) -<a name="l00884"></a>00884 { -<a name="l00885"></a>00885 DBG_MSG(<span class="stringliteral">"vDestroyFontTable"</span>); -<a name="l00886"></a>00886 -<a name="l00887"></a>00887 tFontTableRecords = 0; -<a name="l00888"></a>00888 pFontTable = xfree(pFontTable); -<a name="l00889"></a>00889 } <span class="comment">/* end of vDestroyFontTable */</span> -<a name="l00890"></a>00890 -<a name="l00891"></a>00891 <span class="comment">/*</span> -<a name="l00892"></a>00892 <span class="comment"> * pGetNextFontTableRecord</span> -<a name="l00893"></a>00893 <span class="comment"> *</span> -<a name="l00894"></a>00894 <span class="comment"> * returns the next record in the table or NULL if there is no next record</span> -<a name="l00895"></a>00895 <span class="comment"> */</span> -<a name="l00896"></a>00896 <span class="keyword">const</span> font_table_type * -<a name="l00897"></a>00897 pGetNextFontTableRecord(<span class="keyword">const</span> font_table_type *pRecordCurr) -<a name="l00898"></a>00898 { -<a name="l00899"></a>00899 <span class="keywordtype">size_t</span> tIndexCurr; -<a name="l00900"></a>00900 -<a name="l00901"></a>00901 <span class="keywordflow">if</span> (pRecordCurr == NULL) { -<a name="l00902"></a>00902 <span class="comment">/* No current record, so start with the first one */</span> -<a name="l00903"></a>00903 <span class="keywordflow">return</span> &pFontTable[0]; -<a name="l00904"></a>00904 } -<a name="l00905"></a>00905 -<a name="l00906"></a>00906 <span class="keywordflow">if</span> (pRecordCurr < pFontTable || -<a name="l00907"></a>00907 pRecordCurr >= pFontTable + tFontTableRecords) { -<a name="l00908"></a>00908 <span class="comment">/* Not a pointer in the array */</span> -<a name="l00909"></a>00909 DBG_HEX(pRecordCurr); -<a name="l00910"></a>00910 DBG_HEX(pFontTable); -<a name="l00911"></a>00911 <span class="keywordflow">return</span> NULL; -<a name="l00912"></a>00912 } -<a name="l00913"></a>00913 -<a name="l00914"></a>00914 tIndexCurr = (size_t)(pRecordCurr - pFontTable); -<a name="l00915"></a>00915 <span class="keywordflow">if</span> (tIndexCurr + 1 < tFontTableRecords) { -<a name="l00916"></a>00916 <span class="comment">/* There is a next record, so return it */</span> -<a name="l00917"></a>00917 <span class="keywordflow">return</span> &pFontTable[tIndexCurr + 1]; -<a name="l00918"></a>00918 } -<a name="l00919"></a>00919 <span class="comment">/* There is no next record */</span> -<a name="l00920"></a>00920 <span class="keywordflow">return</span> NULL; -<a name="l00921"></a>00921 } <span class="comment">/* end of pGetNextFontTableRecord */</span> -<a name="l00922"></a>00922 -<a name="l00923"></a>00923 <span class="comment">/*</span> -<a name="l00924"></a>00924 <span class="comment"> * tGetFontTableLength</span> -<a name="l00925"></a>00925 <span class="comment"> *</span> -<a name="l00926"></a>00926 <span class="comment"> * returns the number of records in the internal font table</span> -<a name="l00927"></a>00927 <span class="comment"> */</span> -<a name="l00928"></a>00928 <span class="keywordtype">size_t</span> -<a name="l00929"></a>00929 tGetFontTableLength(<span class="keywordtype">void</span>) -<a name="l00930"></a>00930 { -<a name="l00931"></a>00931 <span class="keywordflow">return</span> tFontTableRecords; -<a name="l00932"></a>00932 } <span class="comment">/* end of tGetFontTableLength */</span> -<a name="l00933"></a>00933 -<a name="l00934"></a>00934 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00935"></a>00935 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00936"></a>00936 <span class="comment"> * vCorrect4PDF - only include PDF default fonts</span> -<a name="l00937"></a>00937 <span class="comment"> */</span> -<a name="l00938"></a>00938 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00939"></a>00939 vCorrect4PDF(<span class="keywordtype">void</span>) -<a name="l00940"></a>00940 { -<a name="l00941"></a>00941 font_table_type *pTmp; -<a name="l00942"></a>00942 <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFont; -<a name="l00943"></a>00943 -<a name="l00944"></a>00944 <span class="keywordflow">for</span> (pTmp = pFontTable; pTmp < pFontTable + tFontTableRecords; pTmp++) { -<a name="l00945"></a>00945 <span class="keywordflow">if</span> (STRCEQ(pTmp->szOurFontname, FONT_MONOSPACED_PLAIN) || -<a name="l00946"></a>00946 STRCEQ(pTmp->szOurFontname, FONT_MONOSPACED_BOLD) || -<a name="l00947"></a>00947 STRCEQ(pTmp->szOurFontname, FONT_MONOSPACED_ITALIC) || -<a name="l00948"></a>00948 STRCEQ(pTmp->szOurFontname, FONT_MONOSPACED_BOLDITALIC) || -<a name="l00949"></a>00949 STRCEQ(pTmp->szOurFontname, FONT_SERIF_PLAIN) || -<a name="l00950"></a>00950 STRCEQ(pTmp->szOurFontname, FONT_SERIF_BOLD) || -<a name="l00951"></a>00951 STRCEQ(pTmp->szOurFontname, FONT_SERIF_ITALIC) || -<a name="l00952"></a>00952 STRCEQ(pTmp->szOurFontname, FONT_SERIF_BOLDITALIC) || -<a name="l00953"></a>00953 STRCEQ(pTmp->szOurFontname, FONT_SANS_SERIF_PLAIN) || -<a name="l00954"></a>00954 STRCEQ(pTmp->szOurFontname, FONT_SANS_SERIF_BOLD) || -<a name="l00955"></a>00955 STRCEQ(pTmp->szOurFontname, FONT_SANS_SERIF_ITALIC) || -<a name="l00956"></a>00956 STRCEQ(pTmp->szOurFontname, FONT_SANS_SERIF_BOLDITALIC)) { -<a name="l00957"></a>00957 <span class="comment">/* Already a default font */</span> -<a name="l00958"></a>00958 <span class="keywordflow">continue</span>; -<a name="l00959"></a>00959 } -<a name="l00960"></a>00960 szOurFont = -<a name="l00961"></a>00961 szGetDefaultFont(pTmp->ucFFN, (<span class="keywordtype">int</span>)pTmp->ucEmphasis); -<a name="l00962"></a>00962 (void)strncpy(pTmp->szOurFontname, szOurFont, -<a name="l00963"></a>00963 <span class="keyword">sizeof</span>(pTmp->szOurFontname) - 1); -<a name="l00964"></a>00964 pTmp->szOurFontname[<span class="keyword">sizeof</span>(pTmp->szOurFontname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00965"></a>00965 } -<a name="l00966"></a>00966 } <span class="comment">/* end of vCorrect4PDF */</span> -<a name="l00967"></a>00967 -<a name="l00968"></a>00968 <span class="comment">/*</span> -<a name="l00969"></a>00969 <span class="comment"> * vCorrect4CyrPS - only include monospaced fonts</span> -<a name="l00970"></a>00970 <span class="comment"> */</span> -<a name="l00971"></a>00971 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00972"></a>00972 vCorrect4CyrPS(<span class="keywordtype">void</span>) -<a name="l00973"></a>00973 { -<a name="l00974"></a>00974 font_table_type *pTmp; -<a name="l00975"></a>00975 <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFont; -<a name="l00976"></a>00976 UCHAR ucFFN; -<a name="l00977"></a>00977 -<a name="l00978"></a>00978 ucFFN = (FAMILY_UNKNOWN << 4) | PITCH_FIXED; -<a name="l00979"></a>00979 <span class="keywordflow">for</span> (pTmp = pFontTable; pTmp < pFontTable + tFontTableRecords; pTmp++) { -<a name="l00980"></a>00980 szOurFont = szGetDefaultFont(ucFFN, (<span class="keywordtype">int</span>)pTmp->ucEmphasis); -<a name="l00981"></a>00981 (void)strncpy(pTmp->szOurFontname, szOurFont, -<a name="l00982"></a>00982 <span class="keyword">sizeof</span>(pTmp->szOurFontname) - 1); -<a name="l00983"></a>00983 pTmp->szOurFontname[<span class="keyword">sizeof</span>(pTmp->szOurFontname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00984"></a>00984 } -<a name="l00985"></a>00985 } <span class="comment">/* end of vCorrect4CyrPS */</span> -<a name="l00986"></a>00986 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00987"></a>00987 -<a name="l00988"></a>00988 <span class="comment">/*</span> -<a name="l00989"></a>00989 <span class="comment"> * vCorrectFontTable - correct the font table in special cases</span> -<a name="l00990"></a>00990 <span class="comment"> */</span> -<a name="l00991"></a>00991 <span class="keywordtype">void</span> -<a name="l00992"></a>00992 vCorrectFontTable(conversion_type eConversionType, encoding_type eEncoding) -<a name="l00993"></a>00993 { -<a name="l00994"></a>00994 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00995"></a>00995 <span class="preprocessor"></span> <span class="keywordflow">if</span> (eConversionType == conversion_pdf) { -<a name="l00996"></a>00996 vCorrect4PDF(); -<a name="l00997"></a>00997 } -<a name="l00998"></a>00998 <span class="keywordflow">if</span> (eConversionType == conversion_ps && -<a name="l00999"></a>00999 eEncoding == encoding_cyrillic) { -<a name="l01000"></a>01000 vCorrect4CyrPS(); -<a name="l01001"></a>01001 } -<a name="l01002"></a>01002 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l01003"></a>01003 } <span class="comment">/* end of vCorrectFontTable */</span> -<a name="l01004"></a>01004 -<a name="l01005"></a>01005 <span class="comment">/*</span> -<a name="l01006"></a>01006 <span class="comment"> * lComputeSpaceWidth - compute the width of a space character</span> -<a name="l01007"></a>01007 <span class="comment"> *</span> -<a name="l01008"></a>01008 <span class="comment"> * Returns the space width in millipoints</span> -<a name="l01009"></a>01009 <span class="comment"> */</span> -<a name="l01010"></a>01010 <span class="keywordtype">long</span> -<a name="l01011"></a>01011 lComputeSpaceWidth(drawfile_fontref tFontRef, USHORT usFontSize) -<a name="l01012"></a>01012 { -<a name="l01013"></a>01013 <span class="keywordtype">char</span> szSpace[] = <span class="stringliteral">" "</span>; -<a name="l01014"></a>01014 -<a name="l01015"></a>01015 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01016"></a>01016 -<a name="l01017"></a>01017 <span class="keywordflow">return</span> lComputeStringWidth(szSpace, 1, tFontRef, usFontSize); -<a name="l01018"></a>01018 } <span class="comment">/* end of lComputeSpaceWidth */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fonts__r_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,267 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fonts_r.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fonts_r.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fonts_r.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with fonts (RiscOs version)</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "DeskLib:Font.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="keyword">static</span> font_handle tFontCurr = (font_handle)-1; -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 <span class="comment">/*</span> -<a name="l00018"></a>00018 <span class="comment"> * pOpenFontTableFile - open the Font translation file</span> -<a name="l00019"></a>00019 <span class="comment"> * Copy the file to the proper place if necessary.</span> -<a name="l00020"></a>00020 <span class="comment"> *</span> -<a name="l00021"></a>00021 <span class="comment"> * Returns the file pointer or NULL</span> -<a name="l00022"></a>00022 <span class="comment"> */</span> -<a name="l00023"></a>00023 FILE * -<a name="l00024"></a>00024 pOpenFontTableFile(<span class="keywordtype">void</span>) -<a name="l00025"></a>00025 { -<a name="l00026"></a>00026 FILE *pFileR, *pFileW; -<a name="l00027"></a>00027 <span class="keywordtype">char</span> *szFontNamesFile; -<a name="l00028"></a>00028 <span class="keywordtype">size_t</span> tSize; -<a name="l00029"></a>00029 BOOL bFailed; -<a name="l00030"></a>00030 <span class="keywordtype">char</span> acBuffer[256]; -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 pFileR = fopen(<span class="stringliteral">"<AntiWord$FontNamesFile>"</span>, <span class="stringliteral">"r"</span>); -<a name="l00033"></a>00033 <span class="keywordflow">if</span> (pFileR != NULL) { -<a name="l00034"></a>00034 <span class="comment">/* The font table is already in the right directory */</span> -<a name="l00035"></a>00035 <span class="keywordflow">return</span> pFileR; -<a name="l00036"></a>00036 } -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 szFontNamesFile = getenv(<span class="stringliteral">"AntiWord$FontNamesSave"</span>); -<a name="l00039"></a>00039 <span class="keywordflow">if</span> (szFontNamesFile == NULL) { -<a name="l00040"></a>00040 werr(0, <span class="stringliteral">"Warning: Name of the FontNames file not found"</span>); -<a name="l00041"></a>00041 <span class="keywordflow">return</span> NULL; -<a name="l00042"></a>00042 } -<a name="l00043"></a>00043 DBG_MSG(szFontNamesFile); -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 pFileR = fopen(<span class="stringliteral">"<AntiWord$Dir>.Resources.Default"</span>, <span class="stringliteral">"r"</span>); -<a name="l00046"></a>00046 <span class="keywordflow">if</span> (pFileR == NULL) { -<a name="l00047"></a>00047 werr(0, <span class="stringliteral">"I can't find 'Resources.Default'"</span>); -<a name="l00048"></a>00048 <span class="keywordflow">return</span> NULL; -<a name="l00049"></a>00049 } -<a name="l00050"></a>00050 <span class="comment">/* Here the default font translation table is known to exist */</span> -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="keywordflow">if</span> (!bMakeDirectory(szFontNamesFile)) { -<a name="l00053"></a>00053 werr(0, -<a name="l00054"></a>00054 <span class="stringliteral">"I can't make a directory for the FontNames file"</span>); -<a name="l00055"></a>00055 <span class="keywordflow">return</span> NULL; -<a name="l00056"></a>00056 } -<a name="l00057"></a>00057 <span class="comment">/* Here the proper directory is known to exist */</span> -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 pFileW = fopen(szFontNamesFile, <span class="stringliteral">"w"</span>); -<a name="l00060"></a>00060 <span class="keywordflow">if</span> (pFileW == NULL) { -<a name="l00061"></a>00061 (void)fclose(pFileR); -<a name="l00062"></a>00062 werr(0, <span class="stringliteral">"I can't create a default FontNames file"</span>); -<a name="l00063"></a>00063 <span class="keywordflow">return</span> NULL; -<a name="l00064"></a>00064 } -<a name="l00065"></a>00065 <span class="comment">/* Here the proper directory is known to be writeable */</span> -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 <span class="comment">/* Copy the default FontNames file */</span> -<a name="l00068"></a>00068 bFailed = FALSE; -<a name="l00069"></a>00069 <span class="keywordflow">while</span> (!feof(pFileR)) { -<a name="l00070"></a>00070 tSize = fread(acBuffer, 1, <span class="keyword">sizeof</span>(acBuffer), pFileR); -<a name="l00071"></a>00071 <span class="keywordflow">if</span> (ferror(pFileR)) { -<a name="l00072"></a>00072 DBG_MSG(<span class="stringliteral">"Read error"</span>); -<a name="l00073"></a>00073 bFailed = TRUE; -<a name="l00074"></a>00074 <span class="keywordflow">break</span>; -<a name="l00075"></a>00075 } -<a name="l00076"></a>00076 <span class="keywordflow">if</span> (fwrite(acBuffer, 1, tSize, pFileW) != tSize) { -<a name="l00077"></a>00077 DBG_MSG(<span class="stringliteral">"Write error"</span>); -<a name="l00078"></a>00078 bFailed = TRUE; -<a name="l00079"></a>00079 <span class="keywordflow">break</span>; -<a name="l00080"></a>00080 } -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 (void)fclose(pFileW); -<a name="l00083"></a>00083 (void)fclose(pFileR); -<a name="l00084"></a>00084 <span class="keywordflow">if</span> (bFailed) { -<a name="l00085"></a>00085 DBG_MSG(<span class="stringliteral">"Copying the FontNames file failed"</span>); -<a name="l00086"></a>00086 (void)<span class="keyword">remove</span>(szFontNamesFile); -<a name="l00087"></a>00087 <span class="keywordflow">return</span> NULL; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 <span class="keywordflow">return</span> fopen(szFontNamesFile, <span class="stringliteral">"r"</span>); -<a name="l00090"></a>00090 } <span class="comment">/* end of pOpenFontTableFile */</span> -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 <span class="comment">/*</span> -<a name="l00093"></a>00093 <span class="comment"> * vCloseFont - close the current font, if any</span> -<a name="l00094"></a>00094 <span class="comment"> */</span> -<a name="l00095"></a>00095 <span class="keywordtype">void</span> -<a name="l00096"></a>00096 vCloseFont(<span class="keywordtype">void</span>) -<a name="l00097"></a>00097 { -<a name="l00098"></a>00098 os_error *e; -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 NO_DBG_MSG(<span class="stringliteral">"vCloseFont"</span>); -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 <span class="keywordflow">if</span> (tFontCurr == (font_handle)-1) { -<a name="l00103"></a>00103 <span class="keywordflow">return</span>; -<a name="l00104"></a>00104 } -<a name="l00105"></a>00105 e = Font_LoseFont(tFontCurr); -<a name="l00106"></a>00106 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00107"></a>00107 werr(0, <span class="stringliteral">"Close font error %d: %s"</span>, e->errnum, e->errmess); -<a name="l00108"></a>00108 } -<a name="l00109"></a>00109 tFontCurr = (font_handle)-1; -<a name="l00110"></a>00110 } <span class="comment">/* end of vCloseFont */</span> -<a name="l00111"></a>00111 -<a name="l00112"></a>00112 <span class="comment">/*</span> -<a name="l00113"></a>00113 <span class="comment"> * tOpenFont - make the specified font the current font</span> -<a name="l00114"></a>00114 <span class="comment"> *</span> -<a name="l00115"></a>00115 <span class="comment"> * Returns the font reference number for use in a draw file</span> -<a name="l00116"></a>00116 <span class="comment"> */</span> -<a name="l00117"></a>00117 drawfile_fontref -<a name="l00118"></a>00118 tOpenFont(UCHAR ucWordFontNumber, USHORT usFontStyle, USHORT usWordFontSize) -<a name="l00119"></a>00119 { -<a name="l00120"></a>00120 os_error *e; -<a name="l00121"></a>00121 <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFontname; -<a name="l00122"></a>00122 font_handle tFont; -<a name="l00123"></a>00123 <span class="keywordtype">int</span> iFontnumber; -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 NO_DBG_MSG(<span class="stringliteral">"tOpenFont"</span>); -<a name="l00126"></a>00126 NO_DBG_DEC(ucWordFontNumber); -<a name="l00127"></a>00127 NO_DBG_HEX(usFontStyle); -<a name="l00128"></a>00128 NO_DBG_DEC(usWordFontSize); -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="comment">/* Keep the relevant bits */</span> -<a name="l00131"></a>00131 usFontStyle &= FONT_BOLD|FONT_ITALIC; -<a name="l00132"></a>00132 NO_DBG_HEX(usFontStyle); -<a name="l00133"></a>00133 -<a name="l00134"></a>00134 iFontnumber = iGetFontByNumber(ucWordFontNumber, usFontStyle); -<a name="l00135"></a>00135 szOurFontname = szGetOurFontname(iFontnumber); -<a name="l00136"></a>00136 <span class="keywordflow">if</span> (szOurFontname == NULL || szOurFontname[0] == <span class="charliteral">'\0'</span>) { -<a name="l00137"></a>00137 tFontCurr = (font_handle)-1; -<a name="l00138"></a>00138 <span class="keywordflow">return</span> (byte)0; -<a name="l00139"></a>00139 } -<a name="l00140"></a>00140 NO_DBG_MSG(szOurFontname); -<a name="l00141"></a>00141 e = Font_FindFont(&tFont, (<span class="keywordtype">char</span> *)szOurFontname, -<a name="l00142"></a>00142 (<span class="keywordtype">int</span>)usWordFontSize * 8, (<span class="keywordtype">int</span>)usWordFontSize * 8, -<a name="l00143"></a>00143 0, 0); -<a name="l00144"></a>00144 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00145"></a>00145 <span class="keywordflow">switch</span> (e->errnum) { -<a name="l00146"></a>00146 <span class="keywordflow">case</span> 523: -<a name="l00147"></a>00147 werr(0, <span class="stringliteral">"%s"</span>, e->errmess); -<a name="l00148"></a>00148 <span class="keywordflow">break</span>; -<a name="l00149"></a>00149 <span class="keywordflow">default</span>: -<a name="l00150"></a>00150 werr(0, <span class="stringliteral">"Open font error %d: %s"</span>, -<a name="l00151"></a>00151 e->errnum, e->errmess); -<a name="l00152"></a>00152 <span class="keywordflow">break</span>; -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 tFontCurr = (font_handle)-1; -<a name="l00155"></a>00155 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00156"></a>00156 } -<a name="l00157"></a>00157 tFontCurr = tFont; -<a name="l00158"></a>00158 NO_DBG_DEC(tFontCurr); -<a name="l00159"></a>00159 <span class="keywordflow">return</span> (drawfile_fontref)(iFontnumber + 1); -<a name="l00160"></a>00160 } <span class="comment">/* end of tOpenFont */</span> -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="comment">/*</span> -<a name="l00163"></a>00163 <span class="comment"> * tOpenTableFont - make the table font the current font</span> -<a name="l00164"></a>00164 <span class="comment"> *</span> -<a name="l00165"></a>00165 <span class="comment"> * Returns the font reference number for use in a draw file</span> -<a name="l00166"></a>00166 <span class="comment"> */</span> -<a name="l00167"></a>00167 drawfile_fontref -<a name="l00168"></a>00168 tOpenTableFont(USHORT usWordFontSize) -<a name="l00169"></a>00169 { -<a name="l00170"></a>00170 <span class="keywordtype">int</span> iWordFontnumber; -<a name="l00171"></a>00171 -<a name="l00172"></a>00172 NO_DBG_MSG(<span class="stringliteral">"tOpenTableFont"</span>); -<a name="l00173"></a>00173 -<a name="l00174"></a>00174 iWordFontnumber = iFontname2Fontnumber(TABLE_FONT, FONT_REGULAR); -<a name="l00175"></a>00175 <span class="keywordflow">if</span> (iWordFontnumber < 0 || iWordFontnumber > (<span class="keywordtype">int</span>)UCHAR_MAX) { -<a name="l00176"></a>00176 DBG_DEC(iWordFontnumber); -<a name="l00177"></a>00177 tFontCurr = (font_handle)-1; -<a name="l00178"></a>00178 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 -<a name="l00181"></a>00181 <span class="keywordflow">return</span> tOpenFont((UCHAR)iWordFontnumber, FONT_REGULAR, usWordFontSize); -<a name="l00182"></a>00182 } <span class="comment">/* end of tOpenTableFont */</span> -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 <span class="comment">/*</span> -<a name="l00185"></a>00185 <span class="comment"> * lComputeStringWidth - compute the string width</span> -<a name="l00186"></a>00186 <span class="comment"> *</span> -<a name="l00187"></a>00187 <span class="comment"> * Returns the string width in millipoints</span> -<a name="l00188"></a>00188 <span class="comment"> */</span> -<a name="l00189"></a>00189 <span class="keywordtype">long</span> -<a name="l00190"></a>00190 lComputeStringWidth(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, -<a name="l00191"></a>00191 drawfile_fontref tFontRef, USHORT usFontSize) -<a name="l00192"></a>00192 { -<a name="l00193"></a>00193 font_string tStr; -<a name="l00194"></a>00194 os_error *e; -<a name="l00195"></a>00195 -<a name="l00196"></a>00196 fail(szString == NULL); -<a name="l00197"></a>00197 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00200"></a>00200 <span class="comment">/* Empty string */</span> -<a name="l00201"></a>00201 <span class="keywordflow">return</span> 0; -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 <span class="keywordflow">if</span> (tStringLength == 1 && szString[0] == TABLE_SEPARATOR) { -<a name="l00204"></a>00204 <span class="comment">/* Font_strwidth doesn't like control characters */</span> -<a name="l00205"></a>00205 <span class="keywordflow">return</span> 0; -<a name="l00206"></a>00206 } -<a name="l00207"></a>00207 <span class="keywordflow">if</span> (tFontCurr == (font_handle)-1) { -<a name="l00208"></a>00208 <span class="comment">/* No current font, use systemfont */</span> -<a name="l00209"></a>00209 <span class="keywordflow">return</span> lChar2MilliPoints(tStringLength); -<a name="l00210"></a>00210 } -<a name="l00211"></a>00211 tStr.s = (<span class="keywordtype">char</span> *)szString; -<a name="l00212"></a>00212 tStr.x = INT_MAX; -<a name="l00213"></a>00213 tStr.y = INT_MAX; -<a name="l00214"></a>00214 tStr.split = -1; -<a name="l00215"></a>00215 tStr.term = tStringLength; -<a name="l00216"></a>00216 e = Font_StringWidth(&tStr); -<a name="l00217"></a>00217 <span class="keywordflow">if</span> (e == NULL) { -<a name="l00218"></a>00218 <span class="keywordflow">return</span> (<span class="keywordtype">long</span>)tStr.x; -<a name="l00219"></a>00219 } -<a name="l00220"></a>00220 DBG_DEC(e->errnum); -<a name="l00221"></a>00221 DBG_MSG(e->errmess); -<a name="l00222"></a>00222 DBG_DEC(tStringLength); -<a name="l00223"></a>00223 DBG_MSG(szString); -<a name="l00224"></a>00224 werr(0, <span class="stringliteral">"String width error %d: %s"</span>, e->errnum, e->errmess); -<a name="l00225"></a>00225 <span class="keywordflow">return</span> lChar2MilliPoints(tStringLength); -<a name="l00226"></a>00226 } <span class="comment">/* end of lComputeStringWidth */</span> -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 <span class="comment">/*</span> -<a name="l00229"></a>00229 <span class="comment"> * tCountColumns - count the number of columns in a string</span> -<a name="l00230"></a>00230 <span class="comment"> *</span> -<a name="l00231"></a>00231 <span class="comment"> * Returns the number of columns</span> -<a name="l00232"></a>00232 <span class="comment"> */</span> -<a name="l00233"></a>00233 <span class="keywordtype">size_t</span> -<a name="l00234"></a>00234 tCountColumns(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tLength) -<a name="l00235"></a>00235 { -<a name="l00236"></a>00236 fail(szString == NULL); -<a name="l00237"></a>00237 -<a name="l00238"></a>00238 <span class="comment">/* One byte, one character, one column */</span> -<a name="l00239"></a>00239 <span class="keywordflow">return</span> tLength; -<a name="l00240"></a>00240 } <span class="comment">/* end of tCountColumns */</span> -<a name="l00241"></a>00241 -<a name="l00242"></a>00242 <span class="comment">/*</span> -<a name="l00243"></a>00243 <span class="comment"> * tGetCharacterLength - the length of the specified character in bytes</span> -<a name="l00244"></a>00244 <span class="comment"> *</span> -<a name="l00245"></a>00245 <span class="comment"> * Returns the length in bytes</span> -<a name="l00246"></a>00246 <span class="comment"> */</span> -<a name="l00247"></a>00247 <span class="keywordtype">size_t</span> -<a name="l00248"></a>00248 tGetCharacterLength(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString) -<a name="l00249"></a>00249 { -<a name="l00250"></a>00250 <span class="keywordflow">return</span> 1; -<a name="l00251"></a>00251 } <span class="comment">/* end of tGetCharacterLength */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/fonts__u_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/fonts_u.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/fonts_u.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * fonts_u.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with fonts (Unix version)</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "fontinfo.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="comment">/* Don't use fonts, just plain text */</span> -<a name="l00016"></a>00016 <span class="keyword">static</span> BOOL bUsePlainText = TRUE; -<a name="l00017"></a>00017 <span class="comment">/* Which character set should be used */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/*</span> -<a name="l00022"></a>00022 <span class="comment"> * pOpenFontTableFile - open the Font translation file</span> -<a name="l00023"></a>00023 <span class="comment"> *</span> -<a name="l00024"></a>00024 <span class="comment"> * Returns the file pointer or NULL</span> -<a name="l00025"></a>00025 <span class="comment"> */</span> -<a name="l00026"></a>00026 FILE * -<a name="l00027"></a>00027 pOpenFontTableFile(<span class="keywordtype">void</span>) -<a name="l00028"></a>00028 { -<a name="l00029"></a>00029 FILE *pFile; -<a name="l00030"></a>00030 <span class="keyword">const</span> <span class="keywordtype">char</span> *szHome, *szAntiword, *szGlobalFile; -<a name="l00031"></a>00031 <span class="keywordtype">char</span> szEnvironmentFile[PATH_MAX+1]; -<a name="l00032"></a>00032 <span class="keywordtype">char</span> szLocalFile[PATH_MAX+1]; -<a name="l00033"></a>00033 -<a name="l00034"></a>00034 szEnvironmentFile[0] = <span class="charliteral">'\0'</span>; -<a name="l00035"></a>00035 szLocalFile[0] = <span class="charliteral">'\0'</span>; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="comment">/* Try the environment version of the fontnames file */</span> -<a name="l00038"></a>00038 szAntiword = szGetAntiwordDirectory(); -<a name="l00039"></a>00039 <span class="keywordflow">if</span> (szAntiword != NULL && szAntiword[0] != <span class="charliteral">'\0'</span>) { -<a name="l00040"></a>00040 <span class="keywordflow">if</span> (strlen(szAntiword) + -<a name="l00041"></a>00041 <span class="keyword">sizeof</span>(FILE_SEPARATOR FONTNAMES_FILE) >= -<a name="l00042"></a>00042 <span class="keyword">sizeof</span>(szEnvironmentFile)) { -<a name="l00043"></a>00043 werr(0, -<a name="l00044"></a>00044 <span class="stringliteral">"The name of your ANTIWORDHOME directory is too long"</span>); -<a name="l00045"></a>00045 <span class="keywordflow">return</span> NULL; -<a name="l00046"></a>00046 } -<a name="l00047"></a>00047 sprintf(szEnvironmentFile, <span class="stringliteral">"%s%s"</span>, -<a name="l00048"></a>00048 szAntiword, -<a name="l00049"></a>00049 FILE_SEPARATOR FONTNAMES_FILE); -<a name="l00050"></a>00050 DBG_MSG(szEnvironmentFile); -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 pFile = fopen(szEnvironmentFile, <span class="stringliteral">"r"</span>); -<a name="l00053"></a>00053 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00054"></a>00054 <span class="keywordflow">return</span> pFile; -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 } -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/* Try the local version of the fontnames file */</span> -<a name="l00059"></a>00059 szHome = szGetHomeDirectory(); -<a name="l00060"></a>00060 <span class="keywordflow">if</span> (strlen(szHome) + -<a name="l00061"></a>00061 <span class="keyword">sizeof</span>(FILE_SEPARATOR ANTIWORD_DIR FILE_SEPARATOR FONTNAMES_FILE) >= -<a name="l00062"></a>00062 <span class="keyword">sizeof</span>(szLocalFile)) { -<a name="l00063"></a>00063 werr(0, <span class="stringliteral">"The name of your HOME directory is too long"</span>); -<a name="l00064"></a>00064 <span class="keywordflow">return</span> NULL; -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 <span class="preprocessor"> #ifndef SYMBIAN</span> -<a name="l00068"></a>00068 <span class="preprocessor"></span> sprintf(szLocalFile, <span class="stringliteral">"%s%s"</span>, -<a name="l00069"></a>00069 szHome, -<a name="l00070"></a>00070 FILE_SEPARATOR ANTIWORD_DIR FILE_SEPARATOR FONTNAMES_FILE); -<a name="l00071"></a>00071 DBG_MSG(szLocalFile); -<a name="l00072"></a>00072 <span class="preprocessor"> #else</span> -<a name="l00073"></a>00073 <span class="preprocessor"></span> sprintf(szLocalFile, <span class="stringliteral">"%s%s"</span>, -<a name="l00074"></a>00074 szHome, -<a name="l00075"></a>00075 FONTNAMES_FILE); -<a name="l00076"></a>00076 DBG_MSG(szLocalFile); -<a name="l00077"></a>00077 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00078"></a>00078 pFile = fopen(szLocalFile, <span class="stringliteral">"r"</span>); -<a name="l00079"></a>00079 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00080"></a>00080 <span class="keywordflow">return</span> pFile; -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="comment">/* Try the global version of the fontnames file */</span> -<a name="l00084"></a>00084 szGlobalFile = GLOBAL_ANTIWORD_DIR FILE_SEPARATOR FONTNAMES_FILE; -<a name="l00085"></a>00085 DBG_MSG(szGlobalFile); -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 pFile = fopen(szGlobalFile, <span class="stringliteral">"r"</span>); -<a name="l00088"></a>00088 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00089"></a>00089 <span class="keywordflow">return</span> pFile; -<a name="l00090"></a>00090 } -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 <span class="keywordflow">if</span> (szEnvironmentFile[0] != <span class="charliteral">'\0'</span>) { -<a name="l00093"></a>00093 werr(0, <span class="stringliteral">"I can not open your fontnames file.\n"</span> -<a name="l00094"></a>00094 <span class="stringliteral">"Neither '%s' nor\n"</span> -<a name="l00095"></a>00095 <span class="stringliteral">"'%s' nor\n"</span> -<a name="l00096"></a>00096 <span class="stringliteral">"'%s' can be opened for reading."</span>, -<a name="l00097"></a>00097 szEnvironmentFile, szLocalFile, szGlobalFile); -<a name="l00098"></a>00098 } <span class="keywordflow">else</span> { -<a name="l00099"></a>00099 werr(0, <span class="stringliteral">"I can not open your fontnames file.\n"</span> -<a name="l00100"></a>00100 <span class="stringliteral">"Neither '%s' nor\n"</span> -<a name="l00101"></a>00101 <span class="stringliteral">"'%s' can be opened for reading."</span>, -<a name="l00102"></a>00102 szLocalFile, szGlobalFile); -<a name="l00103"></a>00103 } -<a name="l00104"></a>00104 <span class="keywordflow">return</span> NULL; -<a name="l00105"></a>00105 } <span class="comment">/* end of pOpenFontTableFile */</span> -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 <span class="comment">/*</span> -<a name="l00108"></a>00108 <span class="comment"> * vCloseFont - close the current font, if any</span> -<a name="l00109"></a>00109 <span class="comment"> */</span> -<a name="l00110"></a>00110 <span class="keywordtype">void</span> -<a name="l00111"></a>00111 vCloseFont(<span class="keywordtype">void</span>) -<a name="l00112"></a>00112 { -<a name="l00113"></a>00113 NO_DBG_MSG(<span class="stringliteral">"vCloseFont"</span>); -<a name="l00114"></a>00114 <span class="comment">/* For safety: to be overwritten at the next call of tOpenfont() */</span> -<a name="l00115"></a>00115 eEncoding = encoding_neutral; -<a name="l00116"></a>00116 bUsePlainText = TRUE; -<a name="l00117"></a>00117 } <span class="comment">/* end of vCloseFont */</span> -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * tOpenFont - make the specified font the current font</span> -<a name="l00121"></a>00121 <span class="comment"> *</span> -<a name="l00122"></a>00122 <span class="comment"> * Returns the font reference number</span> -<a name="l00123"></a>00123 <span class="comment"> */</span> -<a name="l00124"></a>00124 drawfile_fontref -<a name="l00125"></a>00125 tOpenFont(UCHAR ucWordFontNumber, USHORT usFontStyle, USHORT usWordFontSize) -<a name="l00126"></a>00126 { -<a name="l00127"></a>00127 options_type tOptions; -<a name="l00128"></a>00128 <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFontname; -<a name="l00129"></a>00129 <span class="keywordtype">size_t</span> tIndex; -<a name="l00130"></a>00130 <span class="keywordtype">int</span> iFontnumber; -<a name="l00131"></a>00131 -<a name="l00132"></a>00132 NO_DBG_MSG(<span class="stringliteral">"tOpenFont"</span>); -<a name="l00133"></a>00133 NO_DBG_DEC(ucWordFontNumber); -<a name="l00134"></a>00134 NO_DBG_HEX(usFontStyle); -<a name="l00135"></a>00135 NO_DBG_DEC(usWordFontSize); -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 <span class="comment">/* Keep the relevant bits */</span> -<a name="l00138"></a>00138 usFontStyle &= FONT_BOLD|FONT_ITALIC; -<a name="l00139"></a>00139 NO_DBG_HEX(usFontStyle); -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 vGetOptions(&tOptions); -<a name="l00142"></a>00142 eEncoding = tOptions.eEncoding; -<a name="l00143"></a>00143 bUsePlainText = tOptions.eConversionType != conversion_draw && -<a name="l00144"></a>00144 tOptions.eConversionType != conversion_ps && -<a name="l00145"></a>00145 tOptions.eConversionType != conversion_pdf; -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 <span class="keywordflow">if</span> (bUsePlainText) { -<a name="l00148"></a>00148 <span class="comment">/* Plain text, no fonts */</span> -<a name="l00149"></a>00149 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00150"></a>00150 } -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 iFontnumber = iGetFontByNumber(ucWordFontNumber, usFontStyle); -<a name="l00153"></a>00153 szOurFontname = szGetOurFontname(iFontnumber); -<a name="l00154"></a>00154 <span class="keywordflow">if</span> (szOurFontname == NULL || szOurFontname[0] == <span class="charliteral">'\0'</span>) { -<a name="l00155"></a>00155 DBG_DEC(iFontnumber); -<a name="l00156"></a>00156 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00157"></a>00157 } -<a name="l00158"></a>00158 NO_DBG_MSG(szOurFontname); -<a name="l00159"></a>00159 -<a name="l00160"></a>00160 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(szFontnames); tIndex++) { -<a name="l00161"></a>00161 <span class="keywordflow">if</span> (STREQ(szFontnames[tIndex], szOurFontname)) { -<a name="l00162"></a>00162 NO_DBG_DEC(tIndex); -<a name="l00163"></a>00163 <span class="keywordflow">return</span> (drawfile_fontref)tIndex; -<a name="l00164"></a>00164 } -<a name="l00165"></a>00165 } -<a name="l00166"></a>00166 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00167"></a>00167 } <span class="comment">/* end of tOpenFont */</span> -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="comment">/*</span> -<a name="l00170"></a>00170 <span class="comment"> * tOpenTableFont - make the table font the current font</span> -<a name="l00171"></a>00171 <span class="comment"> *</span> -<a name="l00172"></a>00172 <span class="comment"> * Returns the font reference number</span> -<a name="l00173"></a>00173 <span class="comment"> */</span> -<a name="l00174"></a>00174 drawfile_fontref -<a name="l00175"></a>00175 tOpenTableFont(USHORT usWordFontSize) -<a name="l00176"></a>00176 { -<a name="l00177"></a>00177 options_type tOptions; -<a name="l00178"></a>00178 <span class="keywordtype">int</span> iWordFontnumber; -<a name="l00179"></a>00179 -<a name="l00180"></a>00180 NO_DBG_MSG(<span class="stringliteral">"tOpenTableFont"</span>); -<a name="l00181"></a>00181 -<a name="l00182"></a>00182 vGetOptions(&tOptions); -<a name="l00183"></a>00183 eEncoding = tOptions.eEncoding; -<a name="l00184"></a>00184 bUsePlainText = tOptions.eConversionType != conversion_draw && -<a name="l00185"></a>00185 tOptions.eConversionType != conversion_ps && -<a name="l00186"></a>00186 tOptions.eConversionType != conversion_pdf; -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="keywordflow">if</span> (bUsePlainText) { -<a name="l00189"></a>00189 <span class="comment">/* Plain text, no fonts */</span> -<a name="l00190"></a>00190 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00191"></a>00191 } -<a name="l00192"></a>00192 -<a name="l00193"></a>00193 iWordFontnumber = iFontname2Fontnumber(TABLE_FONT, FONT_REGULAR); -<a name="l00194"></a>00194 <span class="keywordflow">if</span> (iWordFontnumber < 0 || iWordFontnumber > (<span class="keywordtype">int</span>)UCHAR_MAX) { -<a name="l00195"></a>00195 DBG_DEC(iWordFontnumber); -<a name="l00196"></a>00196 <span class="keywordflow">return</span> (drawfile_fontref)0; -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 <span class="keywordflow">return</span> tOpenFont((UCHAR)iWordFontnumber, FONT_REGULAR, usWordFontSize); -<a name="l00200"></a>00200 } <span class="comment">/* end of tOpenTableFont */</span> -<a name="l00201"></a>00201 -<a name="l00202"></a>00202 <span class="comment">/*</span> -<a name="l00203"></a>00203 <span class="comment"> * szGetFontname - get the fontname</span> -<a name="l00204"></a>00204 <span class="comment"> */</span> -<a name="l00205"></a>00205 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00206"></a>00206 szGetFontname(drawfile_fontref tFontRef) -<a name="l00207"></a>00207 { -<a name="l00208"></a>00208 fail((<span class="keywordtype">size_t</span>)(UCHAR)tFontRef >= elementsof(szFontnames)); -<a name="l00209"></a>00209 <span class="keywordflow">return</span> szFontnames[(int)(UCHAR)tFontRef]; -<a name="l00210"></a>00210 } <span class="comment">/* end of szGetFontname */</span> -<a name="l00211"></a>00211 -<a name="l00212"></a>00212 <span class="comment">/*</span> -<a name="l00213"></a>00213 <span class="comment"> * lComputeStringWidth - compute the string width</span> -<a name="l00214"></a>00214 <span class="comment"> *</span> -<a name="l00215"></a>00215 <span class="comment"> * Note: the fontsize is specified in half-points!</span> -<a name="l00216"></a>00216 <span class="comment"> * the stringlength is specified in bytes, not characters!</span> -<a name="l00217"></a>00217 <span class="comment"> *</span> -<a name="l00218"></a>00218 <span class="comment"> * Returns the string width in millipoints</span> -<a name="l00219"></a>00219 <span class="comment"> */</span> -<a name="l00220"></a>00220 <span class="keywordtype">long</span> -<a name="l00221"></a>00221 lComputeStringWidth(const <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, -<a name="l00222"></a>00222 drawfile_fontref tFontRef, USHORT usFontSize) -<a name="l00223"></a>00223 { -<a name="l00224"></a>00224 USHORT *ausCharWidths; -<a name="l00225"></a>00225 UCHAR *pucChar; -<a name="l00226"></a>00226 <span class="keywordtype">long</span> lRelWidth; -<a name="l00227"></a>00227 <span class="keywordtype">size_t</span> tIndex; -<a name="l00228"></a>00228 <span class="keywordtype">int</span> iFontRef; -<a name="l00229"></a>00229 -<a name="l00230"></a>00230 fail(szString == NULL); -<a name="l00231"></a>00231 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00234"></a>00234 <span class="comment">/* Empty string */</span> -<a name="l00235"></a>00235 <span class="keywordflow">return</span> 0; -<a name="l00236"></a>00236 } -<a name="l00237"></a>00237 -<a name="l00238"></a>00238 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00239"></a>00239 fail(!bUsePlainText); -<a name="l00240"></a>00240 <span class="keywordflow">return</span> lChar2MilliPoints( -<a name="l00241"></a>00241 utf8_strwidth(szString, tStringLength)); -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 -<a name="l00244"></a>00244 <span class="keywordflow">if</span> (bUsePlainText) { -<a name="l00245"></a>00245 <span class="comment">/* No current font, use "systemfont" */</span> -<a name="l00246"></a>00246 <span class="keywordflow">return</span> lChar2MilliPoints(tStringLength); -<a name="l00247"></a>00247 } -<a name="l00248"></a>00248 -<a name="l00249"></a>00249 <span class="keywordflow">if</span> (eEncoding == encoding_cyrillic) { -<a name="l00250"></a>00250 <span class="comment">/* FIXME: until the character tables are available */</span> -<a name="l00251"></a>00251 <span class="keywordflow">return</span> (tStringLength * 600L * (<span class="keywordtype">long</span>)usFontSize + 1) / 2; -<a name="l00252"></a>00252 } -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 DBG_DEC_C(eEncoding != encoding_latin_1 && -<a name="l00255"></a>00255 eEncoding != encoding_latin_2, eEncoding); -<a name="l00256"></a>00256 fail(eEncoding != encoding_latin_1 && -<a name="l00257"></a>00257 eEncoding != encoding_latin_2); -<a name="l00258"></a>00258 -<a name="l00259"></a>00259 <span class="comment">/* Compute the relative string width */</span> -<a name="l00260"></a>00260 iFontRef = (int)(UCHAR)tFontRef; -<a name="l00261"></a>00261 <span class="keywordflow">if</span> (eEncoding == encoding_latin_2) { -<a name="l00262"></a>00262 ausCharWidths = ausCharacterWidths2[iFontRef]; -<a name="l00263"></a>00263 } <span class="keywordflow">else</span> { -<a name="l00264"></a>00264 ausCharWidths = ausCharacterWidths1[iFontRef]; -<a name="l00265"></a>00265 } -<a name="l00266"></a>00266 lRelWidth = 0; -<a name="l00267"></a>00267 <span class="keywordflow">for</span> (tIndex = 0, pucChar = (UCHAR *)szString; -<a name="l00268"></a>00268 tIndex < tStringLength; -<a name="l00269"></a>00269 tIndex++, pucChar++) { -<a name="l00270"></a>00270 lRelWidth += (long)ausCharWidths[(<span class="keywordtype">int</span>)*pucChar]; -<a name="l00271"></a>00271 } -<a name="l00272"></a>00272 -<a name="l00273"></a>00273 <span class="comment">/* Compute the absolute string width */</span> -<a name="l00274"></a>00274 <span class="keywordflow">return</span> (lRelWidth * (<span class="keywordtype">long</span>)usFontSize + 1) / 2; -<a name="l00275"></a>00275 } <span class="comment">/* end of lComputeStringWidth */</span> -<a name="l00276"></a>00276 -<a name="l00277"></a>00277 <span class="comment">/*</span> -<a name="l00278"></a>00278 <span class="comment"> * tCountColumns - count the number of columns in a string</span> -<a name="l00279"></a>00279 <span class="comment"> *</span> -<a name="l00280"></a>00280 <span class="comment"> * Note: the length is specified in bytes!</span> -<a name="l00281"></a>00281 <span class="comment"> * A UTF-8 a character can be 0, 1 or 2 columns wide.</span> -<a name="l00282"></a>00282 <span class="comment"> *</span> -<a name="l00283"></a>00283 <span class="comment"> * Returns the number of columns</span> -<a name="l00284"></a>00284 <span class="comment"> */</span> -<a name="l00285"></a>00285 <span class="keywordtype">size_t</span> -<a name="l00286"></a>00286 tCountColumns(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tLength) -<a name="l00287"></a>00287 { -<a name="l00288"></a>00288 fail(szString == NULL); -<a name="l00289"></a>00289 -<a name="l00290"></a>00290 <span class="keywordflow">if</span> (eEncoding != encoding_utf_8) { -<a name="l00291"></a>00291 <span class="comment">/* One byte, one character, one column */</span> -<a name="l00292"></a>00292 <span class="keywordflow">return</span> tLength; -<a name="l00293"></a>00293 } -<a name="l00294"></a>00294 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)utf8_strwidth(szString, tLength); -<a name="l00295"></a>00295 } <span class="comment">/* end of tCountColumns */</span> -<a name="l00296"></a>00296 -<a name="l00297"></a>00297 <span class="comment">/*</span> -<a name="l00298"></a>00298 <span class="comment"> * tGetCharacterLength - the length of the specified character in bytes</span> -<a name="l00299"></a>00299 <span class="comment"> *</span> -<a name="l00300"></a>00300 <span class="comment"> * Returns the length in bytes</span> -<a name="l00301"></a>00301 <span class="comment"> */</span> -<a name="l00302"></a>00302 <span class="keywordtype">size_t</span> -<a name="l00303"></a>00303 tGetCharacterLength(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString) -<a name="l00304"></a>00304 { -<a name="l00305"></a>00305 fail(szString == NULL); -<a name="l00306"></a>00306 -<a name="l00307"></a>00307 <span class="keywordflow">if</span> (eEncoding != encoding_utf_8) { -<a name="l00308"></a>00308 <span class="keywordflow">return</span> 1; -<a name="l00309"></a>00309 } -<a name="l00310"></a>00310 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)utf8_chrlength(szString); -<a name="l00311"></a>00311 } <span class="comment">/* end of tGetCharacterLength */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/guid-72f72df3-653c-414c-a357-7613ad8bc169.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: antiword</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<div class="contents"> - - -<h1><a class="anchor" id="guid-72f72df3-653c-414c-a357-7613ad8bc169">antiword </a></h1><p>Source files:</p> -<ul> -<li><a href="antiword__reg_8rss_source.html">data\antiword_reg.rss</a></li> -<li><a href="antiword_8mmp_source.html">group\antiword.mmp</a></li> -<li><a href="_p_i_p_s_2antiword_2group_2_bld_8inf_source.html">group\bld.inf</a></li> -<li><a href="antiword_8h_source.html">inc\antiword.h</a></li> -<li><a href="debug_8h_source.html">inc\debug.h</a></li> -<li><a href="draw_8h_source.html">inc\draw.h</a></li> -<li><a href="drawfile_8h_source.html">inc\drawfile.h</a></li> -<li><a href="fail_8h_source.html">inc\fail.h</a></li> -<li><a href="fontinfo_8h_source.html">inc\fontinfo.h</a></li> -<li><a href="version_8h_source.html">inc\version.h</a></li> -<li><a href="wordconst_8h_source.html">inc\wordconst.h</a></li> -<li><a href="wordtypes_8h_source.html">inc\wordtypes.h</a></li> -<li><a href="_p_i_p_s_2antiword_2sis_2backup__registration_8xml_source.html">sis\backup_registration.xml</a></li> -<li><a href="asc85enc_8c_source.html">src\asc85enc.c</a></li> -<li><a href="blocklist_8c_source.html">src\blocklist.c</a></li> -<li><a href="chartrans_8c_source.html">src\chartrans.c</a></li> -<li><a href="datalist_8c_source.html">src\datalist.c</a></li> -<li><a href="depot_8c_source.html">src\depot.c</a></li> -<li><a href="dib2eps_8c_source.html">src\dib2eps.c</a></li> -<li><a href="dib2sprt_8c_source.html">src\dib2sprt.c</a></li> -<li><a href="doclist_8c_source.html">src\doclist.c</a></li> -<li><a href="draw_8c_source.html">src\draw.c</a></li> -<li><a href="drawfile_8c_source.html">src\drawfile.c</a></li> -<li><a href="fail_8c_source.html">src\fail.c</a></li> -<li><a href="finddata_8c_source.html">src\finddata.c</a></li> -<li><a href="findtext_8c_source.html">src\findtext.c</a></li> -<li><a href="fmt__text_8c_source.html">src\fmt_text.c</a></li> -<li><a href="fontlist_8c_source.html">src\fontlist.c</a></li> -<li><a href="fonts_8c_source.html">src\fonts.c</a></li> -<li><a href="fonts__r_8c_source.html">src\fonts_r.c</a></li> -<li><a href="fonts__u_8c_source.html">src\fonts_u.c</a></li> -<li><a href="hdrftrlist_8c_source.html">src\hdrftrlist.c</a></li> -<li><a href="icons_8c_source.html">src\icons.c</a></li> -<li><a href="imgexam_8c_source.html">src\imgexam.c</a></li> -<li><a href="imgtrans_8c_source.html">src\imgtrans.c</a></li> -<li><a href="jpeg2eps_8c_source.html">src\jpeg2eps.c</a></li> -<li><a href="jpeg2sprt_8c_source.html">src\jpeg2sprt.c</a></li> -<li><a href="listlist_8c_source.html">src\listlist.c</a></li> -<li><a href="main__ros_8c_source.html">src\main_ros.c</a></li> -<li><a href="main__u_8c_source.html">src\main_u.c</a></li> -<li><a href="misc_8c_source.html">src\misc.c</a></li> -<li><a href="notes_8c_source.html">src\notes.c</a></li> -<li><a href="options_8c_source.html">src\options.c</a></li> -<li><a href="out2window_8c_source.html">src\out2window.c</a></li> -<li><a href="output_8c_source.html">src\output.c</a></li> -<li><a href="pdf_8c_source.html">src\pdf.c</a></li> -<li><a href="pictlist_8c_source.html">src\pictlist.c</a></li> -<li><a href="png2eps_8c_source.html">src\png2eps.c</a></li> -<li><a href="png2sprt_8c_source.html">src\png2sprt.c</a></li> -<li><a href="postscript_8c_source.html">src\postscript.c</a></li> -<li><a href="prop0_8c_source.html">src\prop0.c</a></li> -<li><a href="prop2_8c_source.html">src\prop2.c</a></li> -<li><a href="prop6_8c_source.html">src\prop6.c</a></li> -<li><a href="prop8_8c_source.html">src\prop8.c</a></li> -<li><a href="properties_8c_source.html">src\properties.c</a></li> -<li><a href="propmod_8c_source.html">src\propmod.c</a></li> -<li><a href="riscos_8c_source.html">src\riscos.c</a></li> -<li><a href="rowlist_8c_source.html">src\rowlist.c</a></li> -<li><a href="saveas_8c_source.html">src\saveas.c</a></li> -<li><a href="sectlist_8c_source.html">src\sectlist.c</a></li> -<li><a href="startup_8c_source.html">src\startup.c</a></li> -<li><a href="stylelist_8c_source.html">src\stylelist.c</a></li> -<li><a href="stylesheet_8c_source.html">src\stylesheet.c</a></li> -<li><a href="summary_8c_source.html">src\summary.c</a></li> -<li><a href="tabstop_8c_source.html">src\tabstop.c</a></li> -<li><a href="text_8c_source.html">src\text.c</a></li> -<li><a href="unix_8c_source.html">src\unix.c</a></li> -<li><a href="utf8_8c_source.html">src\utf8.c</a></li> -<li><a href="word2text_8c_source.html">src\word2text.c</a></li> -<li><a href="worddos_8c_source.html">src\worddos.c</a></li> -<li><a href="wordlib_8c_source.html">src\wordlib.c</a></li> -<li><a href="wordmac_8c_source.html">src\wordmac.c</a></li> -<li><a href="wordole_8c_source.html">src\wordole.c</a></li> -<li><a href="wordwin_8c_source.html">src\wordwin.c</a></li> -<li><a href="xmalloc_8c_source.html">src\xmalloc.c</a></li> -<li><a href="xml_8c_source.html">src\xml.c</a> </li> -</ul> -</div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/hdrftrlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,387 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/hdrftrlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/hdrftrlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * hdrftrlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2004,2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy list(s) of Word Header/footer information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#define HDR_EVEN_PAGES 0</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define HDR_ODD_PAGES 1</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define FTR_EVEN_PAGES 2</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define FTR_ODD_PAGES 3</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define HDR_FIRST_PAGE 4</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define FTR_FIRST_PAGE 5</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span> -<a name="l00020"></a>00020 <span class="comment">/*</span> -<a name="l00021"></a>00021 <span class="comment"> * Private structures to hide the way the information</span> -<a name="l00022"></a>00022 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00023"></a>00023 <span class="comment"> */</span> -<a name="l00024"></a>00024 <span class="keyword">typedef</span> <span class="keyword">struct </span>hdrftr_local_tag { -<a name="l00025"></a>00025 hdrftr_block_type tInfo; -<a name="l00026"></a>00026 ULONG ulCharPosStart; -<a name="l00027"></a>00027 ULONG ulCharPosNext; -<a name="l00028"></a>00028 BOOL bUseful; -<a name="l00029"></a>00029 BOOL bTextOriginal; -<a name="l00030"></a>00030 } hdrftr_local_type; -<a name="l00031"></a>00031 <span class="keyword">typedef</span> <span class="keyword">struct </span>hdrftr_mem_tag { -<a name="l00032"></a>00032 hdrftr_local_type atElement[6]; -<a name="l00033"></a>00033 } hdrftr_mem_type; -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 <span class="comment">/* Variables needed to write the Header/footer Information List */</span> -<a name="l00036"></a>00036 <span class="keyword">static</span> hdrftr_mem_type *pHdrFtrList = NULL; -<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tHdrFtrLen = 0; -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 -<a name="l00040"></a>00040 <span class="comment">/*</span> -<a name="l00041"></a>00041 <span class="comment"> * vDestroyHdrFtrInfoList - destroy the Header/footer Information List</span> -<a name="l00042"></a>00042 <span class="comment"> */</span> -<a name="l00043"></a>00043 <span class="keywordtype">void</span> -<a name="l00044"></a>00044 vDestroyHdrFtrInfoList(<span class="keywordtype">void</span>) -<a name="l00045"></a>00045 { -<a name="l00046"></a>00046 hdrftr_mem_type *pRecord; -<a name="l00047"></a>00047 output_type *pCurr, *pNext; -<a name="l00048"></a>00048 <span class="keywordtype">size_t</span> tHdrFtr, tIndex; -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 DBG_MSG(<span class="stringliteral">"vDestroyHdrFtrInfoList"</span>); -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="comment">/* Free the Header/footer Information List */</span> -<a name="l00053"></a>00053 <span class="keywordflow">for</span> (tHdrFtr = 0; tHdrFtr < tHdrFtrLen; tHdrFtr++) { -<a name="l00054"></a>00054 pRecord = pHdrFtrList + tHdrFtr; -<a name="l00055"></a>00055 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00056"></a>00056 tIndex < elementsof(pRecord->atElement); -<a name="l00057"></a>00057 tIndex++) { -<a name="l00058"></a>00058 <span class="keywordflow">if</span> (!pRecord->atElement[tIndex].bTextOriginal) { -<a name="l00059"></a>00059 <span class="keywordflow">continue</span>; -<a name="l00060"></a>00060 } -<a name="l00061"></a>00061 pCurr = pRecord->atElement[tIndex].tInfo.pText; -<a name="l00062"></a>00062 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00063"></a>00063 pCurr->szStorage = xfree(pCurr->szStorage); -<a name="l00064"></a>00064 pNext = pCurr->pNext; -<a name="l00065"></a>00065 pCurr = xfree(pCurr); -<a name="l00066"></a>00066 pCurr = pNext; -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 } -<a name="l00069"></a>00069 } -<a name="l00070"></a>00070 pHdrFtrList = xfree(pHdrFtrList); -<a name="l00071"></a>00071 <span class="comment">/* Reset all control variables */</span> -<a name="l00072"></a>00072 tHdrFtrLen = 0; -<a name="l00073"></a>00073 } <span class="comment">/* end of vDestroyHdrFtrInfoList */</span> -<a name="l00074"></a>00074 -<a name="l00075"></a>00075 <span class="comment">/*</span> -<a name="l00076"></a>00076 <span class="comment"> * vCreat8HdrFtrInfoList - Create the Header/footer Information List</span> -<a name="l00077"></a>00077 <span class="comment"> */</span> -<a name="l00078"></a>00078 <span class="keywordtype">void</span> -<a name="l00079"></a>00079 vCreat8HdrFtrInfoList(<span class="keyword">const</span> ULONG *aulCharPos, <span class="keywordtype">size_t</span> tLength) -<a name="l00080"></a>00080 { -<a name="l00081"></a>00081 hdrftr_mem_type *pListMember; -<a name="l00082"></a>00082 <span class="keywordtype">size_t</span> tHdrFtr, tIndex, tMainIndex; -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 fail(aulCharPos == NULL); -<a name="l00085"></a>00085 -<a name="l00086"></a>00086 DBG_DEC(tLength); -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (tLength <= 1) { -<a name="l00088"></a>00088 <span class="keywordflow">return</span>; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 tHdrFtrLen = tLength / 12; -<a name="l00091"></a>00091 <span class="keywordflow">if</span> (tLength % 12 != 0 && tLength % 12 != 1) { -<a name="l00092"></a>00092 tHdrFtrLen++; -<a name="l00093"></a>00093 } -<a name="l00094"></a>00094 DBG_DEC(tHdrFtrLen); -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 pHdrFtrList = xcalloc(tHdrFtrLen, <span class="keyword">sizeof</span>(hdrftr_mem_type)); -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 <span class="keywordflow">for</span> (tHdrFtr = 0; tHdrFtr < tHdrFtrLen; tHdrFtr++) { -<a name="l00099"></a>00099 pListMember = pHdrFtrList + tHdrFtr; -<a name="l00100"></a>00100 <span class="keywordflow">for</span> (tIndex = 0, tMainIndex = tHdrFtr * 12; -<a name="l00101"></a>00101 tIndex < 6 && tMainIndex < tLength; -<a name="l00102"></a>00102 tIndex++, tMainIndex++) { -<a name="l00103"></a>00103 pListMember->atElement[tIndex].tInfo.pText = NULL; -<a name="l00104"></a>00104 pListMember->atElement[tIndex].ulCharPosStart = -<a name="l00105"></a>00105 aulCharPos[tMainIndex]; -<a name="l00106"></a>00106 <span class="keywordflow">if</span> (tMainIndex + 1 < tLength) { -<a name="l00107"></a>00107 pListMember->atElement[tIndex].ulCharPosNext = -<a name="l00108"></a>00108 aulCharPos[tMainIndex + 1]; -<a name="l00109"></a>00109 } <span class="keywordflow">else</span> { -<a name="l00110"></a>00110 pListMember->atElement[tIndex].ulCharPosNext = -<a name="l00111"></a>00111 aulCharPos[tMainIndex]; -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 } -<a name="l00115"></a>00115 } <span class="comment">/* end of vCreat8HdrFtrInfoList */</span> -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 <span class="comment">/*</span> -<a name="l00118"></a>00118 <span class="comment"> * vCreat6HdrFtrInfoList - Create the Header/footer Information List</span> -<a name="l00119"></a>00119 <span class="comment"> */</span> -<a name="l00120"></a>00120 <span class="keywordtype">void</span> -<a name="l00121"></a>00121 vCreat6HdrFtrInfoList(<span class="keyword">const</span> ULONG *aulCharPos, <span class="keywordtype">size_t</span> tLength) -<a name="l00122"></a>00122 { -<a name="l00123"></a>00123 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> atIndex[] = -<a name="l00124"></a>00124 { SIZE_T_MAX, SIZE_T_MAX, FTR_FIRST_PAGE, HDR_FIRST_PAGE, -<a name="l00125"></a>00125 FTR_ODD_PAGES, FTR_EVEN_PAGES, HDR_ODD_PAGES, HDR_EVEN_PAGES, -<a name="l00126"></a>00126 }; -<a name="l00127"></a>00127 hdrftr_mem_type *pListMember; -<a name="l00128"></a>00128 <span class="keywordtype">size_t</span> tHdrFtr, tTmp, tIndex, tMainIndex, tBit; -<a name="l00129"></a>00129 UCHAR ucDopSpecification, ucSepSpecification; -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 fail(aulCharPos == NULL); -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 DBG_DEC(tLength); -<a name="l00134"></a>00134 <span class="keywordflow">if</span> (tLength <= 1) { -<a name="l00135"></a>00135 <span class="keywordflow">return</span>; -<a name="l00136"></a>00136 } -<a name="l00137"></a>00137 tHdrFtrLen = tGetNumberOfSections(); -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (tHdrFtrLen == 0) { -<a name="l00139"></a>00139 tHdrFtrLen = 1; -<a name="l00140"></a>00140 } -<a name="l00141"></a>00141 DBG_DEC(tHdrFtrLen); -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 pHdrFtrList = xcalloc(tHdrFtrLen, <span class="keyword">sizeof</span>(hdrftr_mem_type)); -<a name="l00144"></a>00144 -<a name="l00145"></a>00145 <span class="comment">/* Get the start index in aulCharPos */</span> -<a name="l00146"></a>00146 ucDopSpecification = ucGetDopHdrFtrSpecification(); -<a name="l00147"></a>00147 DBG_HEX(ucDopSpecification & 0xe0); -<a name="l00148"></a>00148 tMainIndex = 0; -<a name="l00149"></a>00149 <span class="keywordflow">for</span> (tBit = 7; tBit >= 5; tBit--) { -<a name="l00150"></a>00150 <span class="keywordflow">if</span> ((ucDopSpecification & BIT(tBit)) != 0) { -<a name="l00151"></a>00151 tMainIndex++; -<a name="l00152"></a>00152 } -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 DBG_DEC(tMainIndex); -<a name="l00155"></a>00155 -<a name="l00156"></a>00156 <span class="keywordflow">for</span> (tHdrFtr = 0; tHdrFtr < tHdrFtrLen; tHdrFtr++) { -<a name="l00157"></a>00157 ucSepSpecification = ucGetSepHdrFtrSpecification(tHdrFtr); -<a name="l00158"></a>00158 DBG_HEX(ucSepSpecification & 0xfc); -<a name="l00159"></a>00159 pListMember = pHdrFtrList + tHdrFtr; -<a name="l00160"></a>00160 <span class="keywordflow">for</span> (tTmp = 0; -<a name="l00161"></a>00161 tTmp < elementsof(pListMember->atElement); -<a name="l00162"></a>00162 tTmp++) { -<a name="l00163"></a>00163 pListMember->atElement[tTmp].tInfo.pText = NULL; -<a name="l00164"></a>00164 } -<a name="l00165"></a>00165 <span class="keywordflow">for</span> (tBit = 7; tBit >= 2; tBit--) { -<a name="l00166"></a>00166 <span class="keywordflow">if</span> (tMainIndex >= tLength) { -<a name="l00167"></a>00167 <span class="keywordflow">break</span>; -<a name="l00168"></a>00168 } -<a name="l00169"></a>00169 <span class="keywordflow">if</span> ((ucSepSpecification & BIT(tBit)) == 0) { -<a name="l00170"></a>00170 <span class="keywordflow">continue</span>; -<a name="l00171"></a>00171 } -<a name="l00172"></a>00172 tIndex = atIndex[tBit]; -<a name="l00173"></a>00173 fail(tIndex >= 6); -<a name="l00174"></a>00174 pListMember->atElement[tIndex].ulCharPosStart = -<a name="l00175"></a>00175 aulCharPos[tMainIndex]; -<a name="l00176"></a>00176 <span class="keywordflow">if</span> (tMainIndex + 1 < tLength) { -<a name="l00177"></a>00177 pListMember->atElement[tIndex].ulCharPosNext = -<a name="l00178"></a>00178 aulCharPos[tMainIndex + 1]; -<a name="l00179"></a>00179 } <span class="keywordflow">else</span> { -<a name="l00180"></a>00180 pListMember->atElement[tIndex].ulCharPosNext = -<a name="l00181"></a>00181 aulCharPos[tMainIndex]; -<a name="l00182"></a>00182 } -<a name="l00183"></a>00183 tMainIndex++; -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 } <span class="comment">/* end of vCreat6HdrFtrInfoList */</span> -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="comment">/*</span> -<a name="l00189"></a>00189 <span class="comment"> * vCreat2HdrFtrInfoList - Create the Header/footer Information List</span> -<a name="l00190"></a>00190 <span class="comment"> */</span> -<a name="l00191"></a>00191 <span class="keywordtype">void</span> -<a name="l00192"></a>00192 vCreat2HdrFtrInfoList(<span class="keyword">const</span> ULONG *aulCharPos, <span class="keywordtype">size_t</span> tLength) -<a name="l00193"></a>00193 { -<a name="l00194"></a>00194 vCreat6HdrFtrInfoList(aulCharPos, tLength); -<a name="l00195"></a>00195 } <span class="comment">/* end of vCreat2HdrFtrInfoList */</span> -<a name="l00196"></a>00196 -<a name="l00197"></a>00197 <span class="comment">/*</span> -<a name="l00198"></a>00198 <span class="comment"> * pGetHdrFtrInfo - get the Header/footer information</span> -<a name="l00199"></a>00199 <span class="comment"> */</span> -<a name="l00200"></a>00200 <span class="keyword">const</span> hdrftr_block_type * -<a name="l00201"></a>00201 pGetHdrFtrInfo(<span class="keywordtype">int</span> iSectionIndex, -<a name="l00202"></a>00202 BOOL bWantHeader, BOOL bOddPage, BOOL bFirstInSection) -<a name="l00203"></a>00203 { -<a name="l00204"></a>00204 hdrftr_mem_type *pCurr; -<a name="l00205"></a>00205 -<a name="l00206"></a>00206 fail(iSectionIndex < 0); -<a name="l00207"></a>00207 fail(pHdrFtrList == NULL && tHdrFtrLen != 0); -<a name="l00208"></a>00208 -<a name="l00209"></a>00209 <span class="keywordflow">if</span> (pHdrFtrList == NULL || tHdrFtrLen == 0) { -<a name="l00210"></a>00210 <span class="comment">/* No information */</span> -<a name="l00211"></a>00211 <span class="keywordflow">return</span> NULL; -<a name="l00212"></a>00212 } -<a name="l00213"></a>00213 -<a name="l00214"></a>00214 <span class="keywordflow">if</span> (iSectionIndex < 0) { -<a name="l00215"></a>00215 iSectionIndex = 0; -<a name="l00216"></a>00216 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iSectionIndex >= (<span class="keywordtype">int</span>)tHdrFtrLen) { -<a name="l00217"></a>00217 iSectionIndex = (int)(tHdrFtrLen - 1); -<a name="l00218"></a>00218 } -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 pCurr = pHdrFtrList + iSectionIndex; -<a name="l00221"></a>00221 -<a name="l00222"></a>00222 <span class="keywordflow">if</span> (bFirstInSection) { -<a name="l00223"></a>00223 <span class="keywordflow">if</span> (bWantHeader) { -<a name="l00224"></a>00224 <span class="keywordflow">return</span> &pCurr->atElement[HDR_FIRST_PAGE].tInfo; -<a name="l00225"></a>00225 } <span class="keywordflow">else</span> { -<a name="l00226"></a>00226 <span class="keywordflow">return</span> &pCurr->atElement[FTR_FIRST_PAGE].tInfo; -<a name="l00227"></a>00227 } -<a name="l00228"></a>00228 } <span class="keywordflow">else</span> { -<a name="l00229"></a>00229 <span class="keywordflow">if</span> (bWantHeader) { -<a name="l00230"></a>00230 <span class="keywordflow">if</span> (bOddPage) { -<a name="l00231"></a>00231 <span class="keywordflow">return</span> &pCurr->atElement[HDR_ODD_PAGES].tInfo; -<a name="l00232"></a>00232 } <span class="keywordflow">else</span> { -<a name="l00233"></a>00233 <span class="keywordflow">return</span> &pCurr->atElement[HDR_EVEN_PAGES].tInfo; -<a name="l00234"></a>00234 } -<a name="l00235"></a>00235 } <span class="keywordflow">else</span> { -<a name="l00236"></a>00236 <span class="keywordflow">if</span> (bOddPage) { -<a name="l00237"></a>00237 <span class="keywordflow">return</span> &pCurr->atElement[FTR_ODD_PAGES].tInfo; -<a name="l00238"></a>00238 } <span class="keywordflow">else</span> { -<a name="l00239"></a>00239 <span class="keywordflow">return</span> &pCurr->atElement[FTR_EVEN_PAGES].tInfo; -<a name="l00240"></a>00240 } -<a name="l00241"></a>00241 } -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 } <span class="comment">/* end of pGetHdrFtrInfo */</span> -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 <span class="comment">/*</span> -<a name="l00246"></a>00246 <span class="comment"> * lComputeHdrFtrHeight - compute the height of a header or footer</span> -<a name="l00247"></a>00247 <span class="comment"> *</span> -<a name="l00248"></a>00248 <span class="comment"> * Returns the height in DrawUnits</span> -<a name="l00249"></a>00249 <span class="comment"> */</span> -<a name="l00250"></a>00250 <span class="keyword">static</span> <span class="keywordtype">long</span> -<a name="l00251"></a>00251 lComputeHdrFtrHeight(<span class="keyword">const</span> output_type *pAnchor) -<a name="l00252"></a>00252 { -<a name="l00253"></a>00253 <span class="keyword">const</span> output_type *pCurr; -<a name="l00254"></a>00254 <span class="keywordtype">long</span> lTotal; -<a name="l00255"></a>00255 USHORT usFontSizeMax; -<a name="l00256"></a>00256 -<a name="l00257"></a>00257 lTotal = 0; -<a name="l00258"></a>00258 usFontSizeMax = 0; -<a name="l00259"></a>00259 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00260"></a>00260 <span class="keywordflow">if</span> (pCurr->tNextFree == 1) { -<a name="l00261"></a>00261 <span class="keywordflow">if</span> (pCurr->szStorage[0] == PAR_END) { -<a name="l00262"></a>00262 <span class="comment">/* End of a paragraph */</span> -<a name="l00263"></a>00263 lTotal += lComputeLeading(usFontSizeMax); -<a name="l00264"></a>00264 lTotal += lMilliPoints2DrawUnits( -<a name="l00265"></a>00265 (<span class="keywordtype">long</span>)pCurr->usFontSize * 200); -<a name="l00266"></a>00266 usFontSizeMax = 0; -<a name="l00267"></a>00267 <span class="keywordflow">continue</span>; -<a name="l00268"></a>00268 } -<a name="l00269"></a>00269 <span class="keywordflow">if</span> (pCurr->szStorage[0] == HARD_RETURN) { -<a name="l00270"></a>00270 <span class="comment">/* End of a line */</span> -<a name="l00271"></a>00271 lTotal += lComputeLeading(usFontSizeMax); -<a name="l00272"></a>00272 usFontSizeMax = 0; -<a name="l00273"></a>00273 <span class="keywordflow">continue</span>; -<a name="l00274"></a>00274 } -<a name="l00275"></a>00275 } -<a name="l00276"></a>00276 <span class="keywordflow">if</span> (pCurr->usFontSize > usFontSizeMax) { -<a name="l00277"></a>00277 usFontSizeMax = pCurr->usFontSize; -<a name="l00278"></a>00278 } -<a name="l00279"></a>00279 } -<a name="l00280"></a>00280 <span class="keywordflow">if</span> (usFontSizeMax != 0) { -<a name="l00281"></a>00281 <span class="comment">/* Height of the last paragraph */</span> -<a name="l00282"></a>00282 lTotal += lComputeLeading(usFontSizeMax); -<a name="l00283"></a>00283 } -<a name="l00284"></a>00284 <span class="keywordflow">return</span> lTotal; -<a name="l00285"></a>00285 } <span class="comment">/* end of lComputeHdrFtrHeight */</span> -<a name="l00286"></a>00286 -<a name="l00287"></a>00287 <span class="comment">/*</span> -<a name="l00288"></a>00288 <span class="comment"> * vPrepareHdrFtrText - prepare the header/footer text</span> -<a name="l00289"></a>00289 <span class="comment"> */</span> -<a name="l00290"></a>00290 <span class="keywordtype">void</span> -<a name="l00291"></a>00291 vPrepareHdrFtrText(FILE *pFile) -<a name="l00292"></a>00292 { -<a name="l00293"></a>00293 hdrftr_mem_type *pCurr, *pPrev; -<a name="l00294"></a>00294 hdrftr_local_type *pTmp; -<a name="l00295"></a>00295 output_type *pText; -<a name="l00296"></a>00296 <span class="keywordtype">size_t</span> tHdrFtr, tIndex; -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 fail(pFile == NULL); -<a name="l00299"></a>00299 fail(pHdrFtrList == NULL && tHdrFtrLen != 0); -<a name="l00300"></a>00300 -<a name="l00301"></a>00301 <span class="keywordflow">if</span> (pHdrFtrList == NULL || tHdrFtrLen == 0) { -<a name="l00302"></a>00302 <span class="comment">/* No information */</span> -<a name="l00303"></a>00303 <span class="keywordflow">return</span>; -<a name="l00304"></a>00304 } -<a name="l00305"></a>00305 -<a name="l00306"></a>00306 <span class="comment">/* Fill text, text height and useful-ness */</span> -<a name="l00307"></a>00307 <span class="keywordflow">for</span> (tHdrFtr = 0; tHdrFtr < tHdrFtrLen; tHdrFtr++) { -<a name="l00308"></a>00308 pCurr = pHdrFtrList + tHdrFtr; -<a name="l00309"></a>00309 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00310"></a>00310 tIndex < elementsof(pHdrFtrList->atElement); -<a name="l00311"></a>00311 tIndex++) { -<a name="l00312"></a>00312 pTmp = &pCurr->atElement[tIndex]; -<a name="l00313"></a>00313 pTmp->bUseful = -<a name="l00314"></a>00314 pTmp->ulCharPosStart != pTmp->ulCharPosNext; -<a name="l00315"></a>00315 <span class="keywordflow">if</span> (pTmp->bUseful) { -<a name="l00316"></a>00316 pText = pHdrFtrDecryptor(pFile, -<a name="l00317"></a>00317 pTmp->ulCharPosStart, -<a name="l00318"></a>00318 pTmp->ulCharPosNext); -<a name="l00319"></a>00319 pTmp->tInfo.pText = pText; -<a name="l00320"></a>00320 pTmp->tInfo.lHeight = -<a name="l00321"></a>00321 lComputeHdrFtrHeight(pText); -<a name="l00322"></a>00322 pTmp->bTextOriginal = pText != NULL; -<a name="l00323"></a>00323 } <span class="keywordflow">else</span> { -<a name="l00324"></a>00324 pTmp->tInfo.pText = NULL; -<a name="l00325"></a>00325 pTmp->tInfo.lHeight = 0; -<a name="l00326"></a>00326 pTmp->bTextOriginal = FALSE; -<a name="l00327"></a>00327 } -<a name="l00328"></a>00328 } -<a name="l00329"></a>00329 } -<a name="l00330"></a>00330 -<a name="l00331"></a>00331 <span class="comment">/* Replace not-useful records by using inheritance */</span> -<a name="l00332"></a>00332 <span class="keywordflow">if</span> (pHdrFtrList->atElement[HDR_FIRST_PAGE].bUseful) { -<a name="l00333"></a>00333 pTmp = &pHdrFtrList->atElement[HDR_ODD_PAGES]; -<a name="l00334"></a>00334 <span class="keywordflow">if</span> (!pTmp->bUseful) { -<a name="l00335"></a>00335 *pTmp = pHdrFtrList->atElement[HDR_FIRST_PAGE]; -<a name="l00336"></a>00336 pTmp->bTextOriginal = FALSE; -<a name="l00337"></a>00337 } -<a name="l00338"></a>00338 pTmp = &pHdrFtrList->atElement[HDR_EVEN_PAGES]; -<a name="l00339"></a>00339 <span class="keywordflow">if</span> (!pTmp->bUseful) { -<a name="l00340"></a>00340 *pTmp = pHdrFtrList->atElement[HDR_FIRST_PAGE]; -<a name="l00341"></a>00341 pTmp->bTextOriginal = FALSE; -<a name="l00342"></a>00342 } -<a name="l00343"></a>00343 } -<a name="l00344"></a>00344 <span class="keywordflow">if</span> (pHdrFtrList->atElement[FTR_FIRST_PAGE].bUseful) { -<a name="l00345"></a>00345 pTmp = &pHdrFtrList->atElement[FTR_ODD_PAGES]; -<a name="l00346"></a>00346 <span class="keywordflow">if</span> (!pTmp->bUseful) { -<a name="l00347"></a>00347 *pTmp = pHdrFtrList->atElement[FTR_FIRST_PAGE]; -<a name="l00348"></a>00348 pTmp->bTextOriginal = FALSE; -<a name="l00349"></a>00349 } -<a name="l00350"></a>00350 pTmp = &pHdrFtrList->atElement[FTR_EVEN_PAGES]; -<a name="l00351"></a>00351 <span class="keywordflow">if</span> (!pTmp->bUseful) { -<a name="l00352"></a>00352 *pTmp = pHdrFtrList->atElement[FTR_FIRST_PAGE]; -<a name="l00353"></a>00353 pTmp->bTextOriginal = FALSE; -<a name="l00354"></a>00354 } -<a name="l00355"></a>00355 } -<a name="l00356"></a>00356 <span class="keywordflow">for</span> (tHdrFtr = 1, pCurr = &pHdrFtrList[1]; -<a name="l00357"></a>00357 tHdrFtr < tHdrFtrLen; -<a name="l00358"></a>00358 tHdrFtr++, pCurr++) { -<a name="l00359"></a>00359 pPrev = pCurr - 1; -<a name="l00360"></a>00360 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00361"></a>00361 tIndex < elementsof(pHdrFtrList->atElement); -<a name="l00362"></a>00362 tIndex++) { -<a name="l00363"></a>00363 <span class="keywordflow">if</span> (!pCurr->atElement[tIndex].bUseful && -<a name="l00364"></a>00364 pPrev->atElement[tIndex].bUseful) { -<a name="l00365"></a>00365 pCurr->atElement[tIndex] = -<a name="l00366"></a>00366 pPrev->atElement[tIndex]; -<a name="l00367"></a>00367 pCurr->atElement[tIndex].bTextOriginal = FALSE; -<a name="l00368"></a>00368 } -<a name="l00369"></a>00369 } -<a name="l00370"></a>00370 } -<a name="l00371"></a>00371 } <span class="comment">/* end of vPrepareHdrFtrText */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/icons_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/icons.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/icons.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * icons.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2001 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Update window icons</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "DeskLib:WimpSWIs.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="keywordtype">void</span> -<a name="l00015"></a>00015 vUpdateIcon(window_handle tWindow, icon_block *pIcon) -<a name="l00016"></a>00016 { -<a name="l00017"></a>00017 window_redrawblock tRedraw; -<a name="l00018"></a>00018 BOOL bMore; -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 tRedraw.window = tWindow; -<a name="l00021"></a>00021 tRedraw.rect = pIcon->workarearect; -<a name="l00022"></a>00022 Error_CheckFatal(Wimp_UpdateWindow(&tRedraw, &bMore)); -<a name="l00023"></a>00023 <span class="keywordflow">while</span> (bMore) { -<a name="l00024"></a>00024 Error_CheckFatal(Wimp_PlotIcon(pIcon)); -<a name="l00025"></a>00025 Error_CheckFatal(Wimp_GetRectangle(&tRedraw, &bMore)); -<a name="l00026"></a>00026 } -<a name="l00027"></a>00027 } <span class="comment">/* end of vUpdateIcon */</span> -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="keywordtype">void</span> -<a name="l00030"></a>00030 vUpdateRadioButton(window_handle tWindow, icon_handle tIconNumber, -<a name="l00031"></a>00031 BOOL bSelected) -<a name="l00032"></a>00032 { -<a name="l00033"></a>00033 icon_block tIcon; -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 Error_CheckFatal(Wimp_GetIconState(tWindow, tIconNumber, &tIcon)); -<a name="l00036"></a>00036 DBG_DEC(tIconNumber); -<a name="l00037"></a>00037 DBG_HEX(tIcon.flags.data.selected); -<a name="l00038"></a>00038 <span class="keywordflow">if</span> (bSelected == (tIcon.flags.data.selected == 1)) { -<a name="l00039"></a>00039 <span class="comment">/* No update needed */</span> -<a name="l00040"></a>00040 <span class="keywordflow">return</span>; -<a name="l00041"></a>00041 } -<a name="l00042"></a>00042 Error_CheckFatal(Wimp_SetIconState(tWindow, tIconNumber, -<a name="l00043"></a>00043 bSelected ? 0x00200000 : 0, 0x00200000)); -<a name="l00044"></a>00044 vUpdateIcon(tWindow, &tIcon); -<a name="l00045"></a>00045 } <span class="comment">/* end of vUpdateRadioButton */</span> -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 <span class="comment">/*</span> -<a name="l00048"></a>00048 <span class="comment"> * vUpdateWriteable - update a writeable icon with a string</span> -<a name="l00049"></a>00049 <span class="comment"> */</span> -<a name="l00050"></a>00050 <span class="keywordtype">void</span> -<a name="l00051"></a>00051 vUpdateWriteable(window_handle tWindow, icon_handle tIconNumber, -<a name="l00052"></a>00052 <span class="keyword">const</span> <span class="keywordtype">char</span> *szString) -<a name="l00053"></a>00053 { -<a name="l00054"></a>00054 icon_block tIcon; -<a name="l00055"></a>00055 caret_block tCaret; -<a name="l00056"></a>00056 <span class="keywordtype">int</span> iLen; -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 fail(szString == NULL); -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 NO_DBG_DEC(tIconNumber); -<a name="l00061"></a>00061 NO_DBG_MSG(szString); -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 Error_CheckFatal(Wimp_GetIconState(tWindow, tIconNumber, &tIcon)); -<a name="l00064"></a>00064 NO_DBG_HEX(tIcon.flags); -<a name="l00065"></a>00065 <span class="keywordflow">if</span> (!tIcon.flags.data.text || !tIcon.flags.data.indirected) { -<a name="l00066"></a>00066 werr(1, <span class="stringliteral">"Icon %d must be indirected text"</span>, (<span class="keywordtype">int</span>)tIconNumber); -<a name="l00067"></a>00067 <span class="keywordflow">return</span>; -<a name="l00068"></a>00068 } -<a name="l00069"></a>00069 strncpy(tIcon.data.indirecttext.buffer, -<a name="l00070"></a>00070 szString, -<a name="l00071"></a>00071 tIcon.data.indirecttext.bufflen - 1); -<a name="l00072"></a>00072 <span class="comment">/* Ensure the caret is behind the last character of the text */</span> -<a name="l00073"></a>00073 Error_CheckFatal(Wimp_GetCaretPosition(&tCaret)); -<a name="l00074"></a>00074 <span class="keywordflow">if</span> (tCaret.window == tWindow && tCaret.icon == tIconNumber) { -<a name="l00075"></a>00075 iLen = strlen(tIcon.data.indirecttext.buffer); -<a name="l00076"></a>00076 <span class="keywordflow">if</span> (tCaret.index != iLen) { -<a name="l00077"></a>00077 tCaret.index = iLen; -<a name="l00078"></a>00078 Error_CheckFatal(Wimp_SetCaretPosition(&tCaret)); -<a name="l00079"></a>00079 } -<a name="l00080"></a>00080 } -<a name="l00081"></a>00081 Error_CheckFatal(Wimp_SetIconState(tWindow, tIconNumber, 0, 0)); -<a name="l00082"></a>00082 vUpdateIcon(tWindow, &tIcon); -<a name="l00083"></a>00083 } <span class="comment">/* end of vUpdateWriteable */</span> -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 <span class="comment">/*</span> -<a name="l00086"></a>00086 <span class="comment"> * vUpdateWriteableNumber - update a writeable icon with a number</span> -<a name="l00087"></a>00087 <span class="comment"> */</span> -<a name="l00088"></a>00088 <span class="keywordtype">void</span> -<a name="l00089"></a>00089 vUpdateWriteableNumber(window_handle tWindow, icon_handle tIconNumber, -<a name="l00090"></a>00090 <span class="keywordtype">int</span> iNumber) -<a name="l00091"></a>00091 { -<a name="l00092"></a>00092 <span class="keywordtype">char</span> szTmp[1+3*<span class="keyword">sizeof</span>(int)+1]; -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 (void)sprintf(szTmp, <span class="stringliteral">"%d"</span>, iNumber); -<a name="l00095"></a>00095 vUpdateWriteable(tWindow, tIconNumber, szTmp); -<a name="l00096"></a>00096 } <span class="comment">/* end of vUpdateWriteableNumber */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/imgexam_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1060 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/imgexam.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/imgexam.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * imgexam.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to examine image headers</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> *================================================================</span> -<a name="l00009"></a>00009 <span class="comment"> * Part of this software is based on:</span> -<a name="l00010"></a>00010 <span class="comment"> * jpeg2ps - convert JPEG compressed images to PostScript Level 2</span> -<a name="l00011"></a>00011 <span class="comment"> * Copyright (C) 1994-99 Thomas Merz (tm@muc.de)</span> -<a name="l00012"></a>00012 <span class="comment"> *================================================================</span> -<a name="l00013"></a>00013 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00014"></a>00014 <span class="comment"> */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#include <stdio.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include <string.h></span> -<a name="l00018"></a>00018 <span class="preprocessor">#include <ctype.h></span> -<a name="l00019"></a>00019 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/* BMP compression types */</span> -<a name="l00022"></a>00022 <span class="preprocessor">#define BI_RGB 0</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define BI_RLE8 1</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define BI_RLE4 2</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span> -<a name="l00026"></a>00026 <span class="comment">/* PNG colortype bits */</span> -<a name="l00027"></a>00027 <span class="preprocessor">#define PNG_CB_PALETTE 0x01</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define PNG_CB_COLOR 0x02</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define PNG_CB_ALPHA 0x04</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span> -<a name="l00031"></a>00031 <span class="comment">/* Instance signature */</span> -<a name="l00032"></a>00032 <span class="preprocessor">#define MSOBI_WMF 0x0216</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define MSOBI_EMF 0x03d4</span> -<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define MSOBI_PICT 0x0542</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define MSOBI_PNG 0x06e0</span> -<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define MSOBI_JPEG 0x046a</span> -<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define MSOBI_DIB 0x07a8</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span> -<a name="l00039"></a>00039 <span class="comment">/* The following enum is stolen from the IJG JPEG library */</span> -<a name="l00040"></a>00040 <span class="keyword">typedef</span> <span class="keyword">enum</span> { <span class="comment">/* JPEG marker codes */</span> -<a name="l00041"></a>00041 M_SOF0 = 0xc0, <span class="comment">/* baseline DCT */</span> -<a name="l00042"></a>00042 M_SOF1 = 0xc1, <span class="comment">/* extended sequential DCT */</span> -<a name="l00043"></a>00043 M_SOF2 = 0xc2, <span class="comment">/* progressive DCT */</span> -<a name="l00044"></a>00044 M_SOF3 = 0xc3, <span class="comment">/* lossless (sequential) */</span> -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 M_SOF5 = 0xc5, <span class="comment">/* differential sequential DCT */</span> -<a name="l00047"></a>00047 M_SOF6 = 0xc6, <span class="comment">/* differential progressive DCT */</span> -<a name="l00048"></a>00048 M_SOF7 = 0xc7, <span class="comment">/* differential lossless */</span> -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 M_JPG = 0xc8, <span class="comment">/* JPEG extensions */</span> -<a name="l00051"></a>00051 M_SOF9 = 0xc9, <span class="comment">/* extended sequential DCT */</span> -<a name="l00052"></a>00052 M_SOF10 = 0xca, <span class="comment">/* progressive DCT */</span> -<a name="l00053"></a>00053 M_SOF11 = 0xcb, <span class="comment">/* lossless (sequential) */</span> -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 M_SOF13 = 0xcd, <span class="comment">/* differential sequential DCT */</span> -<a name="l00056"></a>00056 M_SOF14 = 0xce, <span class="comment">/* differential progressive DCT */</span> -<a name="l00057"></a>00057 M_SOF15 = 0xcf, <span class="comment">/* differential lossless */</span> -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 M_DHT = 0xc4, <span class="comment">/* define Huffman tables */</span> -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 M_DAC = 0xcc, <span class="comment">/* define arithmetic conditioning table */</span> -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 M_RST0 = 0xd0, <span class="comment">/* restart */</span> -<a name="l00064"></a>00064 M_RST1 = 0xd1, <span class="comment">/* restart */</span> -<a name="l00065"></a>00065 M_RST2 = 0xd2, <span class="comment">/* restart */</span> -<a name="l00066"></a>00066 M_RST3 = 0xd3, <span class="comment">/* restart */</span> -<a name="l00067"></a>00067 M_RST4 = 0xd4, <span class="comment">/* restart */</span> -<a name="l00068"></a>00068 M_RST5 = 0xd5, <span class="comment">/* restart */</span> -<a name="l00069"></a>00069 M_RST6 = 0xd6, <span class="comment">/* restart */</span> -<a name="l00070"></a>00070 M_RST7 = 0xd7, <span class="comment">/* restart */</span> -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 M_SOI = 0xd8, <span class="comment">/* start of image */</span> -<a name="l00073"></a>00073 M_EOI = 0xd9, <span class="comment">/* end of image */</span> -<a name="l00074"></a>00074 M_SOS = 0xda, <span class="comment">/* start of scan */</span> -<a name="l00075"></a>00075 M_DQT = 0xdb, <span class="comment">/* define quantization tables */</span> -<a name="l00076"></a>00076 M_DNL = 0xdc, <span class="comment">/* define number of lines */</span> -<a name="l00077"></a>00077 M_DRI = 0xdd, <span class="comment">/* define restart interval */</span> -<a name="l00078"></a>00078 M_DHP = 0xde, <span class="comment">/* define hierarchical progression */</span> -<a name="l00079"></a>00079 M_EXP = 0xdf, <span class="comment">/* expand reference image(s) */</span> -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 M_APP0 = 0xe0, <span class="comment">/* application marker, used for JFIF */</span> -<a name="l00082"></a>00082 M_APP1 = 0xe1, <span class="comment">/* application marker */</span> -<a name="l00083"></a>00083 M_APP2 = 0xe2, <span class="comment">/* application marker */</span> -<a name="l00084"></a>00084 M_APP3 = 0xe3, <span class="comment">/* application marker */</span> -<a name="l00085"></a>00085 M_APP4 = 0xe4, <span class="comment">/* application marker */</span> -<a name="l00086"></a>00086 M_APP5 = 0xe5, <span class="comment">/* application marker */</span> -<a name="l00087"></a>00087 M_APP6 = 0xe6, <span class="comment">/* application marker */</span> -<a name="l00088"></a>00088 M_APP7 = 0xe7, <span class="comment">/* application marker */</span> -<a name="l00089"></a>00089 M_APP8 = 0xe8, <span class="comment">/* application marker */</span> -<a name="l00090"></a>00090 M_APP9 = 0xe9, <span class="comment">/* application marker */</span> -<a name="l00091"></a>00091 M_APP10 = 0xea, <span class="comment">/* application marker */</span> -<a name="l00092"></a>00092 M_APP11 = 0xeb, <span class="comment">/* application marker */</span> -<a name="l00093"></a>00093 M_APP12 = 0xec, <span class="comment">/* application marker */</span> -<a name="l00094"></a>00094 M_APP13 = 0xed, <span class="comment">/* application marker */</span> -<a name="l00095"></a>00095 M_APP14 = 0xee, <span class="comment">/* application marker, used by Adobe */</span> -<a name="l00096"></a>00096 M_APP15 = 0xef, <span class="comment">/* application marker */</span> -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 M_JPG0 = 0xf0, <span class="comment">/* reserved for JPEG extensions */</span> -<a name="l00099"></a>00099 M_JPG13 = 0xfd, <span class="comment">/* reserved for JPEG extensions */</span> -<a name="l00100"></a>00100 M_COM = 0xfe, <span class="comment">/* comment */</span> -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 M_TEM = 0x01 <span class="comment">/* temporary use */</span> -<a name="l00103"></a>00103 } JPEG_MARKER; -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 -<a name="l00106"></a>00106 <span class="comment">/*</span> -<a name="l00107"></a>00107 <span class="comment"> * bFillPaletteDIB - fill the palette part of the imagesdata</span> -<a name="l00108"></a>00108 <span class="comment"> *</span> -<a name="l00109"></a>00109 <span class="comment"> * returns TRUE if the images must be a color image, otherwise FALSE;</span> -<a name="l00110"></a>00110 <span class="comment"> */</span> -<a name="l00111"></a>00111 <span class="keyword">static</span> BOOL -<a name="l00112"></a>00112 bFillPaletteDIB(FILE *pFile, imagedata_type *pImg, BOOL bNewFormat) -<a name="l00113"></a>00113 { -<a name="l00114"></a>00114 <span class="keywordtype">int</span> iIndex; -<a name="l00115"></a>00115 BOOL bIsColorPalette; -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 fail(pFile == NULL); -<a name="l00118"></a>00118 fail(pImg == NULL); -<a name="l00119"></a>00119 -<a name="l00120"></a>00120 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent > 8) { -<a name="l00121"></a>00121 <span class="comment">/* No palette, image uses more than 256 colors */</span> -<a name="l00122"></a>00122 <span class="keywordflow">return</span> TRUE; -<a name="l00123"></a>00123 } -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 <span class="keywordflow">if</span> (pImg->iColorsUsed <= 0) { -<a name="l00126"></a>00126 <span class="comment">/* Not specified, so compute the number of colors used */</span> -<a name="l00127"></a>00127 pImg->iColorsUsed = 1 << pImg->uiBitsPerComponent; -<a name="l00128"></a>00128 } -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 fail(pImg->iColorsUsed > 256); -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (pImg->iColorsUsed > 256) { -<a name="l00132"></a>00132 pImg->iColorsUsed = 256; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 -<a name="l00135"></a>00135 bIsColorPalette = FALSE; -<a name="l00136"></a>00136 <span class="keywordflow">for</span> (iIndex = 0; iIndex < pImg->iColorsUsed; iIndex++) { -<a name="l00137"></a>00137 <span class="comment">/* From BGR order to RGB order */</span> -<a name="l00138"></a>00138 pImg->aucPalette[iIndex][2] = (UCHAR)iNextByte(pFile); -<a name="l00139"></a>00139 pImg->aucPalette[iIndex][1] = (UCHAR)iNextByte(pFile); -<a name="l00140"></a>00140 pImg->aucPalette[iIndex][0] = (UCHAR)iNextByte(pFile); -<a name="l00141"></a>00141 <span class="keywordflow">if</span> (bNewFormat) { -<a name="l00142"></a>00142 (void)iNextByte(pFile); -<a name="l00143"></a>00143 } -<a name="l00144"></a>00144 NO_DBG_PRINT_BLOCK(pImg->aucPalette[iIndex], 3); -<a name="l00145"></a>00145 <span class="keywordflow">if</span> (pImg->aucPalette[iIndex][0] != -<a name="l00146"></a>00146 pImg->aucPalette[iIndex][1] || -<a name="l00147"></a>00147 pImg->aucPalette[iIndex][1] != -<a name="l00148"></a>00148 pImg->aucPalette[iIndex][2]) { -<a name="l00149"></a>00149 bIsColorPalette = TRUE; -<a name="l00150"></a>00150 } -<a name="l00151"></a>00151 } -<a name="l00152"></a>00152 -<a name="l00153"></a>00153 <span class="keywordflow">return</span> bIsColorPalette; -<a name="l00154"></a>00154 } <span class="comment">/* end of bFillPaletteDIB */</span> -<a name="l00155"></a>00155 -<a name="l00156"></a>00156 <span class="comment">/*</span> -<a name="l00157"></a>00157 <span class="comment"> * bExamineDIB - Examine a DIB header</span> -<a name="l00158"></a>00158 <span class="comment"> *</span> -<a name="l00159"></a>00159 <span class="comment"> * return TRUE if successful, otherwise FALSE</span> -<a name="l00160"></a>00160 <span class="comment"> */</span> -<a name="l00161"></a>00161 <span class="keyword">static</span> BOOL -<a name="l00162"></a>00162 bExamineDIB(FILE *pFile, imagedata_type *pImg) -<a name="l00163"></a>00163 { -<a name="l00164"></a>00164 <span class="keywordtype">size_t</span> tHeaderSize; -<a name="l00165"></a>00165 <span class="keywordtype">int</span> iPlanes, iCompression; -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 tHeaderSize = (size_t)ulNextLong(pFile); -<a name="l00168"></a>00168 <span class="keywordflow">switch</span> (tHeaderSize) { -<a name="l00169"></a>00169 <span class="keywordflow">case</span> 12: -<a name="l00170"></a>00170 pImg->iWidth = (int)usNextWord(pFile); -<a name="l00171"></a>00171 pImg->iHeight = (int)usNextWord(pFile); -<a name="l00172"></a>00172 iPlanes = (int)usNextWord(pFile); -<a name="l00173"></a>00173 pImg->uiBitsPerComponent = (UINT)usNextWord(pFile); -<a name="l00174"></a>00174 iCompression = BI_RGB; -<a name="l00175"></a>00175 pImg->iColorsUsed = 0; -<a name="l00176"></a>00176 <span class="keywordflow">break</span>; -<a name="l00177"></a>00177 <span class="keywordflow">case</span> 40: -<a name="l00178"></a>00178 <span class="keywordflow">case</span> 64: -<a name="l00179"></a>00179 pImg->iWidth = (int)ulNextLong(pFile); -<a name="l00180"></a>00180 pImg->iHeight = (int)ulNextLong(pFile); -<a name="l00181"></a>00181 iPlanes = (int)usNextWord(pFile); -<a name="l00182"></a>00182 pImg->uiBitsPerComponent = (UINT)usNextWord(pFile); -<a name="l00183"></a>00183 iCompression = (int)ulNextLong(pFile); -<a name="l00184"></a>00184 (void)tSkipBytes(pFile, 12); -<a name="l00185"></a>00185 pImg->iColorsUsed = (int)ulNextLong(pFile); -<a name="l00186"></a>00186 (void)tSkipBytes(pFile, tHeaderSize - 36); -<a name="l00187"></a>00187 <span class="keywordflow">break</span>; -<a name="l00188"></a>00188 <span class="keywordflow">default</span>: -<a name="l00189"></a>00189 DBG_DEC(tHeaderSize); -<a name="l00190"></a>00190 <span class="keywordflow">return</span> FALSE; -<a name="l00191"></a>00191 } -<a name="l00192"></a>00192 DBG_DEC(pImg->iWidth); -<a name="l00193"></a>00193 DBG_DEC(pImg->iHeight); -<a name="l00194"></a>00194 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00195"></a>00195 DBG_DEC(iCompression); -<a name="l00196"></a>00196 DBG_DEC(pImg->iColorsUsed); -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 <span class="comment">/* Do some sanity checks with the parameters */</span> -<a name="l00199"></a>00199 <span class="keywordflow">if</span> (iPlanes != 1) { -<a name="l00200"></a>00200 DBG_DEC(iPlanes); -<a name="l00201"></a>00201 <span class="keywordflow">return</span> FALSE; -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 <span class="keywordflow">if</span> (pImg->iWidth <= 0 || pImg->iHeight <= 0) { -<a name="l00204"></a>00204 DBG_DEC(pImg->iWidth); -<a name="l00205"></a>00205 DBG_DEC(pImg->iHeight); -<a name="l00206"></a>00206 <span class="keywordflow">return</span> FALSE; -<a name="l00207"></a>00207 } -<a name="l00208"></a>00208 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent != 1 && pImg->uiBitsPerComponent != 4 && -<a name="l00209"></a>00209 pImg->uiBitsPerComponent != 8 && pImg->uiBitsPerComponent != 24) { -<a name="l00210"></a>00210 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00211"></a>00211 <span class="keywordflow">return</span> FALSE; -<a name="l00212"></a>00212 } -<a name="l00213"></a>00213 <span class="keywordflow">if</span> (iCompression != BI_RGB && -<a name="l00214"></a>00214 (pImg->uiBitsPerComponent == 1 || pImg->uiBitsPerComponent == 24)) { -<a name="l00215"></a>00215 <span class="keywordflow">return</span> FALSE; -<a name="l00216"></a>00216 } -<a name="l00217"></a>00217 <span class="keywordflow">if</span> (iCompression == BI_RLE8 && pImg->uiBitsPerComponent == 4) { -<a name="l00218"></a>00218 <span class="keywordflow">return</span> FALSE; -<a name="l00219"></a>00219 } -<a name="l00220"></a>00220 <span class="keywordflow">if</span> (iCompression == BI_RLE4 && pImg->uiBitsPerComponent == 8) { -<a name="l00221"></a>00221 <span class="keywordflow">return</span> FALSE; -<a name="l00222"></a>00222 } -<a name="l00223"></a>00223 -<a name="l00224"></a>00224 <span class="keywordflow">switch</span> (iCompression) { -<a name="l00225"></a>00225 <span class="keywordflow">case</span> BI_RGB: -<a name="l00226"></a>00226 pImg->eCompression = compression_none; -<a name="l00227"></a>00227 <span class="keywordflow">break</span>; -<a name="l00228"></a>00228 <span class="keywordflow">case</span> BI_RLE4: -<a name="l00229"></a>00229 pImg->eCompression = compression_rle4; -<a name="l00230"></a>00230 <span class="keywordflow">break</span>; -<a name="l00231"></a>00231 <span class="keywordflow">case</span> BI_RLE8: -<a name="l00232"></a>00232 pImg->eCompression = compression_rle8; -<a name="l00233"></a>00233 <span class="keywordflow">break</span>; -<a name="l00234"></a>00234 <span class="keywordflow">default</span>: -<a name="l00235"></a>00235 DBG_DEC(iCompression); -<a name="l00236"></a>00236 <span class="keywordflow">return</span> FALSE; -<a name="l00237"></a>00237 } -<a name="l00238"></a>00238 -<a name="l00239"></a>00239 pImg->bColorImage = bFillPaletteDIB(pFile, pImg, tHeaderSize > 12); -<a name="l00240"></a>00240 -<a name="l00241"></a>00241 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00242"></a>00242 pImg->iComponents = 1; -<a name="l00243"></a>00243 } <span class="keywordflow">else</span> { -<a name="l00244"></a>00244 pImg->iComponents = (int)(pImg->uiBitsPerComponent / 8); -<a name="l00245"></a>00245 } -<a name="l00246"></a>00246 -<a name="l00247"></a>00247 <span class="keywordflow">return</span> TRUE; -<a name="l00248"></a>00248 } <span class="comment">/* end of bExamineDIB */</span> -<a name="l00249"></a>00249 -<a name="l00250"></a>00250 <span class="comment">/*</span> -<a name="l00251"></a>00251 <span class="comment"> * iNextMarker - read the next JPEG marker</span> -<a name="l00252"></a>00252 <span class="comment"> */</span> -<a name="l00253"></a>00253 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00254"></a>00254 iNextMarker(FILE *pFile) -<a name="l00255"></a>00255 { -<a name="l00256"></a>00256 <span class="keywordtype">int</span> iMarker; -<a name="l00257"></a>00257 -<a name="l00258"></a>00258 <span class="keywordflow">do</span> { -<a name="l00259"></a>00259 <span class="keywordflow">do</span> { -<a name="l00260"></a>00260 iMarker = iNextByte(pFile); -<a name="l00261"></a>00261 } <span class="keywordflow">while</span> (iMarker != 0xff && iMarker != EOF); -<a name="l00262"></a>00262 <span class="keywordflow">if</span> (iMarker == EOF) { -<a name="l00263"></a>00263 <span class="keywordflow">return</span> EOF; -<a name="l00264"></a>00264 } -<a name="l00265"></a>00265 <span class="keywordflow">do</span> { -<a name="l00266"></a>00266 iMarker = iNextByte(pFile); -<a name="l00267"></a>00267 } <span class="keywordflow">while</span> (iMarker == 0xff); -<a name="l00268"></a>00268 } <span class="keywordflow">while</span> (iMarker == 0x00); <span class="comment">/* repeat if ff/00 */</span> -<a name="l00269"></a>00269 -<a name="l00270"></a>00270 <span class="keywordflow">return</span> iMarker; -<a name="l00271"></a>00271 } <span class="comment">/* end of iNextMarker */</span> -<a name="l00272"></a>00272 -<a name="l00273"></a>00273 <span class="comment">/*</span> -<a name="l00274"></a>00274 <span class="comment"> * bExamineJPEG - Examine a JPEG header</span> -<a name="l00275"></a>00275 <span class="comment"> *</span> -<a name="l00276"></a>00276 <span class="comment"> * return TRUE if successful, otherwise FALSE</span> -<a name="l00277"></a>00277 <span class="comment"> */</span> -<a name="l00278"></a>00278 <span class="keyword">static</span> BOOL -<a name="l00279"></a>00279 bExamineJPEG(FILE *pFile, imagedata_type *pImg) -<a name="l00280"></a>00280 { -<a name="l00281"></a>00281 <span class="keywordtype">size_t</span> tLength; -<a name="l00282"></a>00282 <span class="keywordtype">int</span> iMarker, iIndex; -<a name="l00283"></a>00283 <span class="keywordtype">char</span> appstring[10]; -<a name="l00284"></a>00284 BOOL bSOFDone; -<a name="l00285"></a>00285 -<a name="l00286"></a>00286 tLength = 0; -<a name="l00287"></a>00287 bSOFDone = FALSE; -<a name="l00288"></a>00288 -<a name="l00289"></a>00289 <span class="comment">/* process JPEG markers */</span> -<a name="l00290"></a>00290 <span class="keywordflow">while</span> (!bSOFDone && (iMarker = iNextMarker(pFile)) != (<span class="keywordtype">int</span>)M_EOI) { -<a name="l00291"></a>00291 <span class="keywordflow">switch</span> (iMarker) { -<a name="l00292"></a>00292 <span class="keywordflow">case</span> EOF: -<a name="l00293"></a>00293 DBG_MSG(<span class="stringliteral">"Error: unexpected end of JPEG file"</span>); -<a name="l00294"></a>00294 <span class="keywordflow">return</span> FALSE; -<a name="l00295"></a>00295 <span class="comment">/* The following are not officially supported in PostScript level 2 */</span> -<a name="l00296"></a>00296 <span class="keywordflow">case</span> M_SOF2: -<a name="l00297"></a>00297 <span class="keywordflow">case</span> M_SOF3: -<a name="l00298"></a>00298 <span class="keywordflow">case</span> M_SOF5: -<a name="l00299"></a>00299 <span class="keywordflow">case</span> M_SOF6: -<a name="l00300"></a>00300 <span class="keywordflow">case</span> M_SOF7: -<a name="l00301"></a>00301 <span class="keywordflow">case</span> M_SOF9: -<a name="l00302"></a>00302 <span class="keywordflow">case</span> M_SOF10: -<a name="l00303"></a>00303 <span class="keywordflow">case</span> M_SOF11: -<a name="l00304"></a>00304 <span class="keywordflow">case</span> M_SOF13: -<a name="l00305"></a>00305 <span class="keywordflow">case</span> M_SOF14: -<a name="l00306"></a>00306 <span class="keywordflow">case</span> M_SOF15: -<a name="l00307"></a>00307 DBG_HEX(iMarker); -<a name="l00308"></a>00308 <span class="keywordflow">return</span> FALSE; -<a name="l00309"></a>00309 <span class="keywordflow">case</span> M_SOF0: -<a name="l00310"></a>00310 <span class="keywordflow">case</span> M_SOF1: -<a name="l00311"></a>00311 tLength = (size_t)usNextWordBE(pFile); -<a name="l00312"></a>00312 pImg->uiBitsPerComponent = (UINT)iNextByte(pFile); -<a name="l00313"></a>00313 pImg->iHeight = (int)usNextWordBE(pFile); -<a name="l00314"></a>00314 pImg->iWidth = (int)usNextWordBE(pFile); -<a name="l00315"></a>00315 pImg->iComponents = iNextByte(pFile); -<a name="l00316"></a>00316 bSOFDone = TRUE; -<a name="l00317"></a>00317 <span class="keywordflow">break</span>; -<a name="l00318"></a>00318 <span class="keywordflow">case</span> M_APP14: -<a name="l00319"></a>00319 <span class="comment">/*</span> -<a name="l00320"></a>00320 <span class="comment"> * Check for Adobe application marker. It is known (per Adobe's</span> -<a name="l00321"></a>00321 <span class="comment"> * TN5116) to contain the string "Adobe" at the start of the</span> -<a name="l00322"></a>00322 <span class="comment"> * APP14 marker.</span> -<a name="l00323"></a>00323 <span class="comment"> */</span> -<a name="l00324"></a>00324 tLength = (size_t)usNextWordBE(pFile); -<a name="l00325"></a>00325 <span class="keywordflow">if</span> (tLength < 12) { -<a name="l00326"></a>00326 (void)tSkipBytes(pFile, tLength - 2); -<a name="l00327"></a>00327 } <span class="keywordflow">else</span> { -<a name="l00328"></a>00328 <span class="keywordflow">for</span> (iIndex = 0; iIndex < 5; iIndex++) { -<a name="l00329"></a>00329 appstring[iIndex] = -<a name="l00330"></a>00330 (char)iNextByte(pFile); -<a name="l00331"></a>00331 } -<a name="l00332"></a>00332 appstring[5] = <span class="charliteral">'\0'</span>; -<a name="l00333"></a>00333 <span class="keywordflow">if</span> (STREQ(appstring, <span class="stringliteral">"Adobe"</span>)) { -<a name="l00334"></a>00334 pImg->bAdobe = TRUE; -<a name="l00335"></a>00335 } -<a name="l00336"></a>00336 (void)tSkipBytes(pFile, tLength - 7); -<a name="l00337"></a>00337 } -<a name="l00338"></a>00338 <span class="keywordflow">break</span>; -<a name="l00339"></a>00339 <span class="keywordflow">case</span> M_SOI: <span class="comment">/* ignore markers without parameters */</span> -<a name="l00340"></a>00340 <span class="keywordflow">case</span> M_EOI: -<a name="l00341"></a>00341 <span class="keywordflow">case</span> M_TEM: -<a name="l00342"></a>00342 <span class="keywordflow">case</span> M_RST0: -<a name="l00343"></a>00343 <span class="keywordflow">case</span> M_RST1: -<a name="l00344"></a>00344 <span class="keywordflow">case</span> M_RST2: -<a name="l00345"></a>00345 <span class="keywordflow">case</span> M_RST3: -<a name="l00346"></a>00346 <span class="keywordflow">case</span> M_RST4: -<a name="l00347"></a>00347 <span class="keywordflow">case</span> M_RST5: -<a name="l00348"></a>00348 <span class="keywordflow">case</span> M_RST6: -<a name="l00349"></a>00349 <span class="keywordflow">case</span> M_RST7: -<a name="l00350"></a>00350 <span class="keywordflow">break</span>; -<a name="l00351"></a>00351 <span class="keywordflow">default</span>: <span class="comment">/* skip variable length markers */</span> -<a name="l00352"></a>00352 tLength = (size_t)usNextWordBE(pFile); -<a name="l00353"></a>00353 (void)tSkipBytes(pFile, tLength - 2); -<a name="l00354"></a>00354 <span class="keywordflow">break</span>; -<a name="l00355"></a>00355 } -<a name="l00356"></a>00356 } -<a name="l00357"></a>00357 -<a name="l00358"></a>00358 DBG_DEC(pImg->iWidth); -<a name="l00359"></a>00359 DBG_DEC(pImg->iHeight); -<a name="l00360"></a>00360 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00361"></a>00361 DBG_DEC(pImg->iComponents); -<a name="l00362"></a>00362 -<a name="l00363"></a>00363 <span class="comment">/* Do some sanity checks with the parameters */</span> -<a name="l00364"></a>00364 <span class="keywordflow">if</span> (pImg->iHeight <= 0 || -<a name="l00365"></a>00365 pImg->iWidth <= 0 || -<a name="l00366"></a>00366 pImg->iComponents <= 0) { -<a name="l00367"></a>00367 DBG_DEC(pImg->iHeight); -<a name="l00368"></a>00368 DBG_DEC(pImg->iWidth); -<a name="l00369"></a>00369 DBG_DEC(pImg->iComponents); -<a name="l00370"></a>00370 <span class="keywordflow">return</span> FALSE; -<a name="l00371"></a>00371 } -<a name="l00372"></a>00372 -<a name="l00373"></a>00373 <span class="comment">/* Some broken JPEG files have this but they print anyway... */</span> -<a name="l00374"></a>00374 <span class="keywordflow">if</span> (pImg->iComponents * 3 + 8 != (<span class="keywordtype">int</span>)tLength) { -<a name="l00375"></a>00375 DBG_MSG(<span class="stringliteral">"Warning: SOF marker has incorrect length - ignored"</span>); -<a name="l00376"></a>00376 } -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent != 8) { -<a name="l00379"></a>00379 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00380"></a>00380 DBG_MSG(<span class="stringliteral">"Not supported in PostScript level 2"</span>); -<a name="l00381"></a>00381 <span class="keywordflow">return</span> FALSE; -<a name="l00382"></a>00382 } -<a name="l00383"></a>00383 -<a name="l00384"></a>00384 <span class="keywordflow">if</span> (pImg->iComponents != 1 && -<a name="l00385"></a>00385 pImg->iComponents != 3 && -<a name="l00386"></a>00386 pImg->iComponents != 4) { -<a name="l00387"></a>00387 DBG_DEC(pImg->iComponents); -<a name="l00388"></a>00388 <span class="keywordflow">return</span> FALSE; -<a name="l00389"></a>00389 } -<a name="l00390"></a>00390 -<a name="l00391"></a>00391 pImg->bColorImage = pImg->iComponents >= 3; -<a name="l00392"></a>00392 pImg->iColorsUsed = 0; -<a name="l00393"></a>00393 pImg->eCompression = compression_jpeg; -<a name="l00394"></a>00394 -<a name="l00395"></a>00395 <span class="keywordflow">return</span> TRUE; -<a name="l00396"></a>00396 } <span class="comment">/* end of bExamineJPEG */</span> -<a name="l00397"></a>00397 -<a name="l00398"></a>00398 <span class="comment">/*</span> -<a name="l00399"></a>00399 <span class="comment"> * bFillPalettePNG - fill the palette part of the imagesdata</span> -<a name="l00400"></a>00400 <span class="comment"> *</span> -<a name="l00401"></a>00401 <span class="comment"> * returns TRUE if sucessful, otherwise FALSE;</span> -<a name="l00402"></a>00402 <span class="comment"> */</span> -<a name="l00403"></a>00403 <span class="keyword">static</span> BOOL -<a name="l00404"></a>00404 bFillPalettePNG(FILE *pFile, imagedata_type *pImg, <span class="keywordtype">size_t</span> tLength) -<a name="l00405"></a>00405 { -<a name="l00406"></a>00406 <span class="keywordtype">int</span> iIndex, iEntries; -<a name="l00407"></a>00407 -<a name="l00408"></a>00408 fail(pFile == NULL); -<a name="l00409"></a>00409 fail(pImg == NULL); -<a name="l00410"></a>00410 -<a name="l00411"></a>00411 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent > 8) { -<a name="l00412"></a>00412 <span class="comment">/* No palette, image uses more than 256 colors */</span> -<a name="l00413"></a>00413 <span class="keywordflow">return</span> TRUE; -<a name="l00414"></a>00414 } -<a name="l00415"></a>00415 -<a name="l00416"></a>00416 <span class="keywordflow">if</span> (!pImg->bColorImage) { -<a name="l00417"></a>00417 <span class="comment">/* Only color images can have a palette */</span> -<a name="l00418"></a>00418 <span class="keywordflow">return</span> FALSE; -<a name="l00419"></a>00419 } -<a name="l00420"></a>00420 -<a name="l00421"></a>00421 <span class="keywordflow">if</span> (tLength % 3 != 0) { -<a name="l00422"></a>00422 <span class="comment">/* Each palette entry takes three bytes */</span> -<a name="l00423"></a>00423 DBG_DEC(tLength); -<a name="l00424"></a>00424 <span class="keywordflow">return</span> FALSE; -<a name="l00425"></a>00425 } -<a name="l00426"></a>00426 -<a name="l00427"></a>00427 iEntries = (int)(tLength / 3); -<a name="l00428"></a>00428 DBG_DEC(iEntries); -<a name="l00429"></a>00429 pImg->iColorsUsed = 1 << pImg->uiBitsPerComponent; -<a name="l00430"></a>00430 DBG_DEC(pImg->iColorsUsed); -<a name="l00431"></a>00431 -<a name="l00432"></a>00432 <span class="keywordflow">if</span> (iEntries > 256) { -<a name="l00433"></a>00433 DBG_DEC(iEntries); -<a name="l00434"></a>00434 <span class="keywordflow">return</span> FALSE; -<a name="l00435"></a>00435 } -<a name="l00436"></a>00436 -<a name="l00437"></a>00437 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iEntries; iIndex++) { -<a name="l00438"></a>00438 pImg->aucPalette[iIndex][0] = (UCHAR)iNextByte(pFile); -<a name="l00439"></a>00439 pImg->aucPalette[iIndex][1] = (UCHAR)iNextByte(pFile); -<a name="l00440"></a>00440 pImg->aucPalette[iIndex][2] = (UCHAR)iNextByte(pFile); -<a name="l00441"></a>00441 NO_DBG_PRINT_BLOCK(pImg->aucPalette[iIndex], 3); -<a name="l00442"></a>00442 } -<a name="l00443"></a>00443 <span class="keywordflow">for</span> (;iIndex < pImg->iColorsUsed; iIndex++) { -<a name="l00444"></a>00444 pImg->aucPalette[iIndex][0] = 0; -<a name="l00445"></a>00445 pImg->aucPalette[iIndex][1] = 0; -<a name="l00446"></a>00446 pImg->aucPalette[iIndex][2] = 0; -<a name="l00447"></a>00447 } -<a name="l00448"></a>00448 -<a name="l00449"></a>00449 <span class="keywordflow">return</span> TRUE; -<a name="l00450"></a>00450 } <span class="comment">/* end of bFillPalettePNG */</span> -<a name="l00451"></a>00451 -<a name="l00452"></a>00452 <span class="comment">/*</span> -<a name="l00453"></a>00453 <span class="comment"> * bExaminePNG - Examine a PNG header</span> -<a name="l00454"></a>00454 <span class="comment"> *</span> -<a name="l00455"></a>00455 <span class="comment"> * return TRUE if successful, otherwise FALSE</span> -<a name="l00456"></a>00456 <span class="comment"> */</span> -<a name="l00457"></a>00457 <span class="keyword">static</span> BOOL -<a name="l00458"></a>00458 bExaminePNG(FILE *pFile, imagedata_type *pImg) -<a name="l00459"></a>00459 { -<a name="l00460"></a>00460 <span class="keywordtype">size_t</span> tLength; -<a name="l00461"></a>00461 ULONG ulLong1, ulLong2, ulName; -<a name="l00462"></a>00462 <span class="keywordtype">int</span> iIndex, iTmp; -<a name="l00463"></a>00463 <span class="keywordtype">int</span> iCompressionMethod, iFilterMethod, iInterlaceMethod; -<a name="l00464"></a>00464 <span class="keywordtype">int</span> iColor, iIncrement; -<a name="l00465"></a>00465 BOOL bHasPalette, bHasAlpha; -<a name="l00466"></a>00466 UCHAR aucBuf[4]; -<a name="l00467"></a>00467 -<a name="l00468"></a>00468 <span class="comment">/* Check signature */</span> -<a name="l00469"></a>00469 ulLong1 = ulNextLongBE(pFile); -<a name="l00470"></a>00470 ulLong2 = ulNextLongBE(pFile); -<a name="l00471"></a>00471 <span class="keywordflow">if</span> (ulLong1 != 0x89504e47UL || ulLong2 != 0x0d0a1a0aUL) { -<a name="l00472"></a>00472 DBG_HEX(ulLong1); -<a name="l00473"></a>00473 DBG_HEX(ulLong2); -<a name="l00474"></a>00474 <span class="keywordflow">return</span> FALSE; -<a name="l00475"></a>00475 } -<a name="l00476"></a>00476 -<a name="l00477"></a>00477 ulName = 0x00; -<a name="l00478"></a>00478 bHasPalette = FALSE; -<a name="l00479"></a>00479 -<a name="l00480"></a>00480 <span class="comment">/* Examine chunks */</span> -<a name="l00481"></a>00481 <span class="keywordflow">while</span> (ulName != PNG_CN_IEND) { -<a name="l00482"></a>00482 tLength = (size_t)ulNextLongBE(pFile); -<a name="l00483"></a>00483 ulName = 0x00; -<a name="l00484"></a>00484 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)elementsof(aucBuf); iIndex++) { -<a name="l00485"></a>00485 aucBuf[iIndex] = (UCHAR)iNextByte(pFile); -<a name="l00486"></a>00486 <span class="keywordflow">if</span> (!isalpha(aucBuf[iIndex])) { -<a name="l00487"></a>00487 DBG_HEX(aucBuf[iIndex]); -<a name="l00488"></a>00488 <span class="keywordflow">return</span> FALSE; -<a name="l00489"></a>00489 } -<a name="l00490"></a>00490 ulName <<= 8; -<a name="l00491"></a>00491 ulName |= aucBuf[iIndex]; -<a name="l00492"></a>00492 } -<a name="l00493"></a>00493 -<a name="l00494"></a>00494 <span class="keywordflow">switch</span> (ulName) { -<a name="l00495"></a>00495 <span class="keywordflow">case</span> PNG_CN_IHDR: -<a name="l00496"></a>00496 <span class="comment">/* Header chunck */</span> -<a name="l00497"></a>00497 <span class="keywordflow">if</span> (tLength < 13) { -<a name="l00498"></a>00498 DBG_DEC(tLength); -<a name="l00499"></a>00499 <span class="keywordflow">return</span> FALSE; -<a name="l00500"></a>00500 } -<a name="l00501"></a>00501 pImg->iWidth = (int)ulNextLongBE(pFile); -<a name="l00502"></a>00502 pImg->iHeight = (int)ulNextLongBE(pFile); -<a name="l00503"></a>00503 pImg->uiBitsPerComponent = (UINT)iNextByte(pFile); -<a name="l00504"></a>00504 iTmp = iNextByte(pFile); -<a name="l00505"></a>00505 NO_DBG_HEX(iTmp); -<a name="l00506"></a>00506 pImg->bColorImage = (iTmp & PNG_CB_COLOR) != 0; -<a name="l00507"></a>00507 bHasPalette = (iTmp & PNG_CB_PALETTE) != 0; -<a name="l00508"></a>00508 bHasAlpha = (iTmp & PNG_CB_ALPHA) != 0; -<a name="l00509"></a>00509 <span class="keywordflow">if</span> (bHasPalette && pImg->uiBitsPerComponent > 8) { -<a name="l00510"></a>00510 <span class="comment">/* This should not happen */</span> -<a name="l00511"></a>00511 <span class="keywordflow">return</span> FALSE; -<a name="l00512"></a>00512 } -<a name="l00513"></a>00513 pImg->iComponents = -<a name="l00514"></a>00514 (bHasPalette || !pImg->bColorImage) ? 1 : 3; -<a name="l00515"></a>00515 <span class="keywordflow">if</span> (bHasAlpha) { -<a name="l00516"></a>00516 pImg->iComponents++; -<a name="l00517"></a>00517 } -<a name="l00518"></a>00518 iCompressionMethod = iNextByte(pFile); -<a name="l00519"></a>00519 <span class="keywordflow">if</span> (iCompressionMethod != 0) { -<a name="l00520"></a>00520 DBG_DEC(iCompressionMethod); -<a name="l00521"></a>00521 <span class="keywordflow">return</span> FALSE; -<a name="l00522"></a>00522 } -<a name="l00523"></a>00523 iFilterMethod = iNextByte(pFile); -<a name="l00524"></a>00524 <span class="keywordflow">if</span> (iFilterMethod != 0) { -<a name="l00525"></a>00525 DBG_DEC(iFilterMethod); -<a name="l00526"></a>00526 <span class="keywordflow">return</span> FALSE; -<a name="l00527"></a>00527 } -<a name="l00528"></a>00528 iInterlaceMethod = iNextByte(pFile); -<a name="l00529"></a>00529 <span class="keywordflow">if</span> (iInterlaceMethod != 0) { -<a name="l00530"></a>00530 DBG_DEC(iInterlaceMethod); -<a name="l00531"></a>00531 <span class="keywordflow">return</span> FALSE; -<a name="l00532"></a>00532 } -<a name="l00533"></a>00533 pImg->iColorsUsed = 0; -<a name="l00534"></a>00534 (void)tSkipBytes(pFile, tLength - 13 + 4); -<a name="l00535"></a>00535 <span class="keywordflow">break</span>; -<a name="l00536"></a>00536 <span class="keywordflow">case</span> PNG_CN_PLTE: -<a name="l00537"></a>00537 <span class="keywordflow">if</span> (!bHasPalette) { -<a name="l00538"></a>00538 <span class="keywordflow">return</span> FALSE; -<a name="l00539"></a>00539 } -<a name="l00540"></a>00540 <span class="keywordflow">if</span> (!bFillPalettePNG(pFile, pImg, tLength)) { -<a name="l00541"></a>00541 <span class="keywordflow">return</span> FALSE; -<a name="l00542"></a>00542 } -<a name="l00543"></a>00543 (void)tSkipBytes(pFile, 4); -<a name="l00544"></a>00544 <span class="keywordflow">break</span>; -<a name="l00545"></a>00545 <span class="keywordflow">default</span>: -<a name="l00546"></a>00546 (void)tSkipBytes(pFile, tLength + 4); -<a name="l00547"></a>00547 <span class="keywordflow">break</span>; -<a name="l00548"></a>00548 } -<a name="l00549"></a>00549 } -<a name="l00550"></a>00550 -<a name="l00551"></a>00551 DBG_DEC(pImg->iWidth); -<a name="l00552"></a>00552 DBG_DEC(pImg->iHeight); -<a name="l00553"></a>00553 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00554"></a>00554 DBG_DEC(pImg->iColorsUsed); -<a name="l00555"></a>00555 DBG_DEC(pImg->iComponents); -<a name="l00556"></a>00556 -<a name="l00557"></a>00557 <span class="comment">/* Do some sanity checks with the parameters */</span> -<a name="l00558"></a>00558 <span class="keywordflow">if</span> (pImg->iWidth <= 0 || pImg->iHeight <= 0) { -<a name="l00559"></a>00559 <span class="keywordflow">return</span> FALSE; -<a name="l00560"></a>00560 } -<a name="l00561"></a>00561 -<a name="l00562"></a>00562 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent != 1 && pImg->uiBitsPerComponent != 2 && -<a name="l00563"></a>00563 pImg->uiBitsPerComponent != 4 && pImg->uiBitsPerComponent != 8 && -<a name="l00564"></a>00564 pImg->uiBitsPerComponent != 16) { -<a name="l00565"></a>00565 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00566"></a>00566 <span class="keywordflow">return</span> FALSE; -<a name="l00567"></a>00567 } -<a name="l00568"></a>00568 -<a name="l00569"></a>00569 <span class="keywordflow">if</span> (pImg->iComponents != 1 && pImg->iComponents != 3) { -<a name="l00570"></a>00570 <span class="comment">/* Not supported */</span> -<a name="l00571"></a>00571 DBG_DEC(pImg->iComponents); -<a name="l00572"></a>00572 <span class="keywordflow">return</span> FALSE; -<a name="l00573"></a>00573 } -<a name="l00574"></a>00574 -<a name="l00575"></a>00575 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent > 8) { -<a name="l00576"></a>00576 <span class="comment">/* Not supported */</span> -<a name="l00577"></a>00577 DBG_DEC(pImg->uiBitsPerComponent); -<a name="l00578"></a>00578 <span class="keywordflow">return</span> FALSE; -<a name="l00579"></a>00579 } -<a name="l00580"></a>00580 -<a name="l00581"></a>00581 <span class="keywordflow">if</span> (pImg->iColorsUsed == 0 && -<a name="l00582"></a>00582 pImg->iComponents == 1 && -<a name="l00583"></a>00583 pImg->uiBitsPerComponent <= 4) { -<a name="l00584"></a>00584 <span class="comment">/*</span> -<a name="l00585"></a>00585 <span class="comment"> * No palette is supplied, but PostScript needs one in these</span> -<a name="l00586"></a>00586 <span class="comment"> * cases, so we add a default palette here</span> -<a name="l00587"></a>00587 <span class="comment"> */</span> -<a name="l00588"></a>00588 pImg->iColorsUsed = 1 << pImg->uiBitsPerComponent; -<a name="l00589"></a>00589 iIncrement = 0xff / (pImg->iColorsUsed - 1); -<a name="l00590"></a>00590 <span class="keywordflow">for</span> (iIndex = 0, iColor = 0x00; -<a name="l00591"></a>00591 iIndex < pImg->iColorsUsed; -<a name="l00592"></a>00592 iIndex++, iColor += iIncrement) { -<a name="l00593"></a>00593 pImg->aucPalette[iIndex][0] = (UCHAR)iColor; -<a name="l00594"></a>00594 pImg->aucPalette[iIndex][1] = (UCHAR)iColor; -<a name="l00595"></a>00595 pImg->aucPalette[iIndex][2] = (UCHAR)iColor; -<a name="l00596"></a>00596 } -<a name="l00597"></a>00597 <span class="comment">/* Just to be sure */</span> -<a name="l00598"></a>00598 pImg->bColorImage = FALSE; -<a name="l00599"></a>00599 } -<a name="l00600"></a>00600 -<a name="l00601"></a>00601 pImg->eCompression = compression_zlib; -<a name="l00602"></a>00602 -<a name="l00603"></a>00603 <span class="keywordflow">return</span> TRUE; -<a name="l00604"></a>00604 } <span class="comment">/* end of bExaminePNG */</span> -<a name="l00605"></a>00605 -<a name="l00606"></a>00606 <span class="comment">/*</span> -<a name="l00607"></a>00607 <span class="comment"> * bExamineWMF - Examine a WMF header</span> -<a name="l00608"></a>00608 <span class="comment"> *</span> -<a name="l00609"></a>00609 <span class="comment"> * return TRUE if successful, otherwise FALSE</span> -<a name="l00610"></a>00610 <span class="comment"> */</span> -<a name="l00611"></a>00611 <span class="keyword">static</span> BOOL -<a name="l00612"></a>00612 bExamineWMF(FILE *pFile, imagedata_type *pImg) -<a name="l00613"></a>00613 { -<a name="l00614"></a>00614 ULONG ulFileSize, ulMaxRecord, ulMagic; -<a name="l00615"></a>00615 USHORT usType, usHeaderSize, usVersion, usNoObjects; -<a name="l00616"></a>00616 -<a name="l00617"></a>00617 usType = usNextWord(pFile); -<a name="l00618"></a>00618 usHeaderSize = usNextWord(pFile); -<a name="l00619"></a>00619 ulMagic = ((ULONG)usHeaderSize << 16) | (ULONG)usType; -<a name="l00620"></a>00620 usVersion = usNextWord(pFile); -<a name="l00621"></a>00621 ulFileSize = ulNextLong(pFile); -<a name="l00622"></a>00622 usNoObjects = usNextWord(pFile); -<a name="l00623"></a>00623 ulMaxRecord = ulNextLong(pFile); -<a name="l00624"></a>00624 -<a name="l00625"></a>00625 DBG_HEX(ulMagic); -<a name="l00626"></a>00626 DBG_DEC(usType); -<a name="l00627"></a>00627 DBG_DEC(usHeaderSize); -<a name="l00628"></a>00628 DBG_HEX(usVersion); -<a name="l00629"></a>00629 DBG_DEC(ulFileSize); -<a name="l00630"></a>00630 DBG_DEC(usNoObjects); -<a name="l00631"></a>00631 DBG_DEC(ulMaxRecord); -<a name="l00632"></a>00632 -<a name="l00633"></a>00633 <span class="keywordflow">return</span> FALSE; -<a name="l00634"></a>00634 } <span class="comment">/* end of bExamineWMF */</span> -<a name="l00635"></a>00635 -<a name="l00636"></a>00636 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00637"></a>00637 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00638"></a>00638 <span class="comment"> * vImage2Papersize - make sure the image fits on the paper</span> -<a name="l00639"></a>00639 <span class="comment"> *</span> -<a name="l00640"></a>00640 <span class="comment"> * This function should not be needed if Word would do a proper job</span> -<a name="l00641"></a>00641 <span class="comment"> */</span> -<a name="l00642"></a>00642 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00643"></a>00643 vImage2Papersize(imagedata_type *pImg) -<a name="l00644"></a>00644 { -<a name="l00645"></a>00645 <span class="keyword">static</span> <span class="keywordtype">int</span> iNetPageHeight = -1; -<a name="l00646"></a>00646 <span class="keyword">static</span> <span class="keywordtype">int</span> iNetPageWidth = -1; -<a name="l00647"></a>00647 options_type tOptions; -<a name="l00648"></a>00648 <span class="keywordtype">double</span> dVerFactor, dHorFactor, dFactor; -<a name="l00649"></a>00649 -<a name="l00650"></a>00650 DBG_MSG(<span class="stringliteral">"vImage2Papersize"</span>); -<a name="l00651"></a>00651 -<a name="l00652"></a>00652 fail(pImg == NULL); -<a name="l00653"></a>00653 -<a name="l00654"></a>00654 <span class="keywordflow">if</span> (iNetPageHeight < 0 || iNetPageWidth < 0) { -<a name="l00655"></a>00655 <span class="comment">/* Get the page dimensions from the options */</span> -<a name="l00656"></a>00656 vGetOptions(&tOptions); -<a name="l00657"></a>00657 <span class="comment">/* Add 999 to err on the save side */</span> -<a name="l00658"></a>00658 iNetPageHeight = tOptions.iPageHeight - -<a name="l00659"></a>00659 (lDrawUnits2MilliPoints( -<a name="l00660"></a>00660 PS_TOP_MARGIN + PS_BOTTOM_MARGIN) + -<a name="l00661"></a>00661 999) / 1000; -<a name="l00662"></a>00662 iNetPageWidth = tOptions.iPageWidth - -<a name="l00663"></a>00663 (lDrawUnits2MilliPoints( -<a name="l00664"></a>00664 PS_LEFT_MARGIN + PS_RIGHT_MARGIN) + -<a name="l00665"></a>00665 999) / 1000; -<a name="l00666"></a>00666 DBG_DEC(iNetPageHeight); -<a name="l00667"></a>00667 DBG_DEC(iNetPageWidth); -<a name="l00668"></a>00668 } -<a name="l00669"></a>00669 -<a name="l00670"></a>00670 <span class="keywordflow">if</span> (pImg->iVerSizeScaled < iNetPageHeight && -<a name="l00671"></a>00671 pImg->iHorSizeScaled < iNetPageWidth) { -<a name="l00672"></a>00672 <span class="comment">/* The image fits on the paper */</span> -<a name="l00673"></a>00673 <span class="keywordflow">return</span>; -<a name="l00674"></a>00674 } -<a name="l00675"></a>00675 -<a name="l00676"></a>00676 dVerFactor = (double)iNetPageHeight / (<span class="keywordtype">double</span>)pImg->iVerSizeScaled; -<a name="l00677"></a>00677 dHorFactor = (double)iNetPageWidth / (<span class="keywordtype">double</span>)pImg->iHorSizeScaled; -<a name="l00678"></a>00678 dFactor = min(dVerFactor, dHorFactor); -<a name="l00679"></a>00679 DBG_FLT(dFactor); -<a name="l00680"></a>00680 <span class="comment">/* Round down, just to be on the save side */</span> -<a name="l00681"></a>00681 pImg->iVerSizeScaled = (int)(pImg->iVerSizeScaled * dFactor); -<a name="l00682"></a>00682 pImg->iHorSizeScaled = (int)(pImg->iHorSizeScaled * dFactor); -<a name="l00683"></a>00683 } <span class="comment">/* end of vImage2Papersize */</span> -<a name="l00684"></a>00684 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00685"></a>00685 -<a name="l00686"></a>00686 <span class="comment">/*</span> -<a name="l00687"></a>00687 <span class="comment"> * tFind6Image - skip until the image is found</span> -<a name="l00688"></a>00688 <span class="comment"> *</span> -<a name="l00689"></a>00689 <span class="comment"> * Find the image in Word 6/7 files</span> -<a name="l00690"></a>00690 <span class="comment"> *</span> -<a name="l00691"></a>00691 <span class="comment"> * returns the new position when a image is found, otherwise -1</span> -<a name="l00692"></a>00692 <span class="comment"> */</span> -<a name="l00693"></a>00693 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00694"></a>00694 tFind6Image(FILE *pFile, <span class="keywordtype">size_t</span> tPosition, <span class="keywordtype">size_t</span> tLength, -<a name="l00695"></a>00695 imagetype_enum *peImageType) -<a name="l00696"></a>00696 { -<a name="l00697"></a>00697 ULONG ulMarker; -<a name="l00698"></a>00698 <span class="keywordtype">size_t</span> tRecordLength, tToSkip; -<a name="l00699"></a>00699 USHORT usMarker; -<a name="l00700"></a>00700 -<a name="l00701"></a>00701 fail(pFile == NULL); -<a name="l00702"></a>00702 fail(peImageType == NULL); -<a name="l00703"></a>00703 -<a name="l00704"></a>00704 *peImageType = imagetype_is_unknown; -<a name="l00705"></a>00705 <span class="keywordflow">if</span> (tPosition + 18 >= tLength) { -<a name="l00706"></a>00706 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00707"></a>00707 } -<a name="l00708"></a>00708 -<a name="l00709"></a>00709 ulMarker = ulNextLong(pFile); -<a name="l00710"></a>00710 <span class="keywordflow">if</span> (ulMarker != 0x00090001) { -<a name="l00711"></a>00711 DBG_HEX(ulMarker); -<a name="l00712"></a>00712 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00713"></a>00713 } -<a name="l00714"></a>00714 usMarker = usNextWord(pFile); -<a name="l00715"></a>00715 <span class="keywordflow">if</span> (usMarker != 0x0300) { -<a name="l00716"></a>00716 DBG_HEX(usMarker); -<a name="l00717"></a>00717 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00718"></a>00718 } -<a name="l00719"></a>00719 (void)tSkipBytes(pFile, 10); -<a name="l00720"></a>00720 usMarker = usNextWord(pFile); -<a name="l00721"></a>00721 <span class="keywordflow">if</span> (usMarker != 0x0000) { -<a name="l00722"></a>00722 DBG_HEX(usMarker); -<a name="l00723"></a>00723 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00724"></a>00724 } -<a name="l00725"></a>00725 tPosition += 18; -<a name="l00726"></a>00726 -<a name="l00727"></a>00727 <span class="keywordflow">while</span> (tPosition + 6 <= tLength) { -<a name="l00728"></a>00728 tRecordLength = (size_t)ulNextLong(pFile); -<a name="l00729"></a>00729 usMarker = usNextWord(pFile); -<a name="l00730"></a>00730 tPosition += 6; -<a name="l00731"></a>00731 NO_DBG_DEC(tRecordLength); -<a name="l00732"></a>00732 NO_DBG_HEX(usMarker); -<a name="l00733"></a>00733 <span class="keywordflow">switch</span> (usMarker) { -<a name="l00734"></a>00734 <span class="keywordflow">case</span> 0x0000: -<a name="l00735"></a>00735 DBG_HEX(ulGetDataOffset(pFile)); -<a name="l00736"></a>00736 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00737"></a>00737 <span class="keywordflow">case</span> 0x0b41: -<a name="l00738"></a>00738 DBG_MSG(<span class="stringliteral">"DIB"</span>); -<a name="l00739"></a>00739 *peImageType = imagetype_is_dib; -<a name="l00740"></a>00740 tPosition += tSkipBytes(pFile, 20); -<a name="l00741"></a>00741 <span class="keywordflow">return</span> tPosition; -<a name="l00742"></a>00742 <span class="keywordflow">case</span> 0x0f43: -<a name="l00743"></a>00743 DBG_MSG(<span class="stringliteral">"DIB"</span>); -<a name="l00744"></a>00744 *peImageType = imagetype_is_dib; -<a name="l00745"></a>00745 tPosition += tSkipBytes(pFile, 22); -<a name="l00746"></a>00746 <span class="keywordflow">return</span> tPosition; -<a name="l00747"></a>00747 <span class="keywordflow">default</span>: -<a name="l00748"></a>00748 <span class="keywordflow">if</span> (tRecordLength < 3) { -<a name="l00749"></a>00749 <span class="keywordflow">break</span>; -<a name="l00750"></a>00750 } -<a name="l00751"></a>00751 <span class="keywordflow">if</span> (tRecordLength > SIZE_T_MAX / 2) { -<a name="l00752"></a>00752 <span class="comment">/*</span> -<a name="l00753"></a>00753 <span class="comment"> * No need to compute the number of bytes</span> -<a name="l00754"></a>00754 <span class="comment"> * to skip</span> -<a name="l00755"></a>00755 <span class="comment"> */</span> -<a name="l00756"></a>00756 DBG_DEC(tRecordLength); -<a name="l00757"></a>00757 DBG_HEX(tRecordLength); -<a name="l00758"></a>00758 DBG_FIXME(); -<a name="l00759"></a>00759 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00760"></a>00760 } -<a name="l00761"></a>00761 tToSkip = tRecordLength * 2 - 6; -<a name="l00762"></a>00762 <span class="keywordflow">if</span> (tToSkip > tLength - tPosition) { -<a name="l00763"></a>00763 <span class="comment">/* You can't skip this number of bytes */</span> -<a name="l00764"></a>00764 DBG_DEC(tToSkip); -<a name="l00765"></a>00765 DBG_DEC(tLength - tPosition); -<a name="l00766"></a>00766 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00767"></a>00767 } -<a name="l00768"></a>00768 tPosition += tSkipBytes(pFile, tToSkip); -<a name="l00769"></a>00769 <span class="keywordflow">break</span>; -<a name="l00770"></a>00770 } -<a name="l00771"></a>00771 } -<a name="l00772"></a>00772 -<a name="l00773"></a>00773 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00774"></a>00774 } <span class="comment">/* end of tFind6Image */</span> -<a name="l00775"></a>00775 -<a name="l00776"></a>00776 <span class="comment">/*</span> -<a name="l00777"></a>00777 <span class="comment"> * tFind8Image - skip until the image is found</span> -<a name="l00778"></a>00778 <span class="comment"> *</span> -<a name="l00779"></a>00779 <span class="comment"> * Find the image in Word 8/9/10 files</span> -<a name="l00780"></a>00780 <span class="comment"> *</span> -<a name="l00781"></a>00781 <span class="comment"> * returns the new position when a image is found, otherwise -1</span> -<a name="l00782"></a>00782 <span class="comment"> */</span> -<a name="l00783"></a>00783 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00784"></a>00784 tFind8Image(FILE *pFile, <span class="keywordtype">size_t</span> tPosition, <span class="keywordtype">size_t</span> tLength, -<a name="l00785"></a>00785 imagetype_enum *peImageType) -<a name="l00786"></a>00786 { -<a name="l00787"></a>00787 <span class="keywordtype">size_t</span> tRecordLength, tNameLen; -<a name="l00788"></a>00788 USHORT usRecordVersion, usRecordType, usRecordInstance; -<a name="l00789"></a>00789 USHORT usTmp; -<a name="l00790"></a>00790 -<a name="l00791"></a>00791 fail(pFile == NULL); -<a name="l00792"></a>00792 fail(peImageType == NULL); -<a name="l00793"></a>00793 -<a name="l00794"></a>00794 *peImageType = imagetype_is_unknown; -<a name="l00795"></a>00795 <span class="keywordflow">while</span> (tPosition + 8 <= tLength) { -<a name="l00796"></a>00796 usTmp = usNextWord(pFile); -<a name="l00797"></a>00797 usRecordVersion = usTmp & 0x000f; -<a name="l00798"></a>00798 usRecordInstance = usTmp >> 4; -<a name="l00799"></a>00799 usRecordType = usNextWord(pFile); -<a name="l00800"></a>00800 tRecordLength = (size_t)ulNextLong(pFile); -<a name="l00801"></a>00801 tPosition += 8; -<a name="l00802"></a>00802 NO_DBG_HEX(usRecordVersion); -<a name="l00803"></a>00803 NO_DBG_HEX(usRecordInstance); -<a name="l00804"></a>00804 NO_DBG_HEX(usRecordType); -<a name="l00805"></a>00805 NO_DBG_DEC(tRecordLength); -<a name="l00806"></a>00806 <span class="keywordflow">switch</span> (usRecordType) { -<a name="l00807"></a>00807 <span class="keywordflow">case</span> 0xf000: <span class="keywordflow">case</span> 0xf001: <span class="keywordflow">case</span> 0xf002: <span class="keywordflow">case</span> 0xf003: -<a name="l00808"></a>00808 <span class="keywordflow">case</span> 0xf004: <span class="keywordflow">case</span> 0xf005: -<a name="l00809"></a>00809 <span class="keywordflow">break</span>; -<a name="l00810"></a>00810 <span class="keywordflow">case</span> 0xf007: -<a name="l00811"></a>00811 tPosition += tSkipBytes(pFile, 33); -<a name="l00812"></a>00812 tNameLen = (size_t)iNextByte(pFile); -<a name="l00813"></a>00813 tPosition++; -<a name="l00814"></a>00814 DBG_DEC_C(tNameLen != 0, tNameLen); -<a name="l00815"></a>00815 tPosition += tSkipBytes(pFile, 2 + tNameLen * 2); -<a name="l00816"></a>00816 <span class="keywordflow">break</span>; -<a name="l00817"></a>00817 <span class="keywordflow">case</span> 0xf008: -<a name="l00818"></a>00818 tPosition += tSkipBytes(pFile, 8); -<a name="l00819"></a>00819 <span class="keywordflow">break</span>; -<a name="l00820"></a>00820 <span class="keywordflow">case</span> 0xf009: -<a name="l00821"></a>00821 tPosition += tSkipBytes(pFile, 16); -<a name="l00822"></a>00822 <span class="keywordflow">break</span>; -<a name="l00823"></a>00823 <span class="keywordflow">case</span> 0xf006: <span class="keywordflow">case</span> 0xf00a: <span class="keywordflow">case</span> 0xf00b: <span class="keywordflow">case</span> 0xf00d: -<a name="l00824"></a>00824 <span class="keywordflow">case</span> 0xf00e: <span class="keywordflow">case</span> 0xf00f: <span class="keywordflow">case</span> 0xf010: <span class="keywordflow">case</span> 0xf011: -<a name="l00825"></a>00825 <span class="keywordflow">case</span> 0xf122: -<a name="l00826"></a>00826 tPosition += tSkipBytes(pFile, tRecordLength); -<a name="l00827"></a>00827 <span class="keywordflow">break</span>; -<a name="l00828"></a>00828 <span class="keywordflow">case</span> 0xf01a: -<a name="l00829"></a>00829 DBG_MSG(<span class="stringliteral">"EMF"</span>); -<a name="l00830"></a>00830 *peImageType = imagetype_is_emf; -<a name="l00831"></a>00831 tPosition += tSkipBytes(pFile, 50); -<a name="l00832"></a>00832 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_EMF) == 1) { -<a name="l00833"></a>00833 tPosition += tSkipBytes(pFile, 16); -<a name="l00834"></a>00834 } -<a name="l00835"></a>00835 <span class="keywordflow">return</span> tPosition; -<a name="l00836"></a>00836 <span class="keywordflow">case</span> 0xf01b: -<a name="l00837"></a>00837 DBG_MSG(<span class="stringliteral">"WMF"</span>); -<a name="l00838"></a>00838 *peImageType = imagetype_is_wmf; -<a name="l00839"></a>00839 tPosition += tSkipBytes(pFile, 50); -<a name="l00840"></a>00840 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_WMF) == 1) { -<a name="l00841"></a>00841 tPosition += tSkipBytes(pFile, 16); -<a name="l00842"></a>00842 } -<a name="l00843"></a>00843 <span class="keywordflow">return</span> tPosition; -<a name="l00844"></a>00844 <span class="keywordflow">case</span> 0xf01c: -<a name="l00845"></a>00845 DBG_MSG(<span class="stringliteral">"PICT"</span>); -<a name="l00846"></a>00846 *peImageType = imagetype_is_pict; -<a name="l00847"></a>00847 tPosition += tSkipBytes(pFile, 50); -<a name="l00848"></a>00848 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_PICT) == 1) { -<a name="l00849"></a>00849 tPosition += tSkipBytes(pFile, 16); -<a name="l00850"></a>00850 } -<a name="l00851"></a>00851 <span class="keywordflow">return</span> tPosition; -<a name="l00852"></a>00852 <span class="keywordflow">case</span> 0xf01d: -<a name="l00853"></a>00853 DBG_MSG(<span class="stringliteral">"JPEG"</span>); -<a name="l00854"></a>00854 *peImageType = imagetype_is_jpeg; -<a name="l00855"></a>00855 tPosition += tSkipBytes(pFile, 17); -<a name="l00856"></a>00856 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_JPEG) == 1) { -<a name="l00857"></a>00857 tPosition += tSkipBytes(pFile, 16); -<a name="l00858"></a>00858 } -<a name="l00859"></a>00859 <span class="keywordflow">return</span> tPosition; -<a name="l00860"></a>00860 <span class="keywordflow">case</span> 0xf01e: -<a name="l00861"></a>00861 DBG_MSG(<span class="stringliteral">"PNG"</span>); -<a name="l00862"></a>00862 *peImageType = imagetype_is_png; -<a name="l00863"></a>00863 tPosition += tSkipBytes(pFile, 17); -<a name="l00864"></a>00864 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_PNG) == 1) { -<a name="l00865"></a>00865 tPosition += tSkipBytes(pFile, 16); -<a name="l00866"></a>00866 } -<a name="l00867"></a>00867 <span class="keywordflow">return</span> tPosition; -<a name="l00868"></a>00868 <span class="keywordflow">case</span> 0xf01f: -<a name="l00869"></a>00869 DBG_MSG(<span class="stringliteral">"DIB"</span>); -<a name="l00870"></a>00870 <span class="comment">/* DIB is a BMP minus its 14 byte header */</span> -<a name="l00871"></a>00871 *peImageType = imagetype_is_dib; -<a name="l00872"></a>00872 tPosition += tSkipBytes(pFile, 17); -<a name="l00873"></a>00873 <span class="keywordflow">if</span> ((usRecordInstance ^ MSOBI_DIB) == 1) { -<a name="l00874"></a>00874 tPosition += tSkipBytes(pFile, 16); -<a name="l00875"></a>00875 } -<a name="l00876"></a>00876 <span class="keywordflow">return</span> tPosition; -<a name="l00877"></a>00877 <span class="keywordflow">case</span> 0xf00c: -<a name="l00878"></a>00878 <span class="keywordflow">default</span>: -<a name="l00879"></a>00879 DBG_HEX(usRecordType); -<a name="l00880"></a>00880 DBG_DEC_C(tRecordLength % 4 != 0, tRecordLength); -<a name="l00881"></a>00881 DBG_FIXME(); -<a name="l00882"></a>00882 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00883"></a>00883 } -<a name="l00884"></a>00884 } -<a name="l00885"></a>00885 -<a name="l00886"></a>00886 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00887"></a>00887 } <span class="comment">/* end of tFind8Image */</span> -<a name="l00888"></a>00888 -<a name="l00889"></a>00889 <span class="comment">/*</span> -<a name="l00890"></a>00890 <span class="comment"> * eExamineImage - Examine the image</span> -<a name="l00891"></a>00891 <span class="comment"> *</span> -<a name="l00892"></a>00892 <span class="comment"> * Returns an indication of the amount of information found</span> -<a name="l00893"></a>00893 <span class="comment"> */</span> -<a name="l00894"></a>00894 image_info_enum -<a name="l00895"></a>00895 eExamineImage(FILE *pFile, ULONG ulFileOffsetImage, imagedata_type *pImg) -<a name="l00896"></a>00896 { -<a name="l00897"></a>00897 <span class="keywordtype">long</span> lTmp; -<a name="l00898"></a>00898 <span class="keywordtype">size_t</span> tWordHeaderLen, tLength, tPos; -<a name="l00899"></a>00899 <span class="keywordtype">int</span> iType, iHorSize, iVerSize; -<a name="l00900"></a>00900 USHORT usHorScalingFactor, usVerScalingFactor; -<a name="l00901"></a>00901 -<a name="l00902"></a>00902 <span class="keywordflow">if</span> (ulFileOffsetImage == FC_INVALID) { -<a name="l00903"></a>00903 <span class="keywordflow">return</span> image_no_information; -<a name="l00904"></a>00904 } -<a name="l00905"></a>00905 DBG_HEX(ulFileOffsetImage); -<a name="l00906"></a>00906 -<a name="l00907"></a>00907 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffsetImage)) { -<a name="l00908"></a>00908 <span class="keywordflow">return</span> image_no_information; -<a name="l00909"></a>00909 } -<a name="l00910"></a>00910 -<a name="l00911"></a>00911 tLength = (size_t)ulNextLong(pFile); -<a name="l00912"></a>00912 DBG_DEC(tLength); -<a name="l00913"></a>00913 <span class="keywordflow">if</span> (tLength < 46) { -<a name="l00914"></a>00914 <span class="comment">/* Smaller than the smallest known header */</span> -<a name="l00915"></a>00915 DBG_FIXME(); -<a name="l00916"></a>00916 <span class="keywordflow">return</span> image_no_information; -<a name="l00917"></a>00917 } -<a name="l00918"></a>00918 tWordHeaderLen = (size_t)usNextWord(pFile); -<a name="l00919"></a>00919 DBG_DEC(tWordHeaderLen); -<a name="l00920"></a>00920 fail(tWordHeaderLen != 46 && -<a name="l00921"></a>00921 tWordHeaderLen != 58 && -<a name="l00922"></a>00922 tWordHeaderLen != 68); -<a name="l00923"></a>00923 -<a name="l00924"></a>00924 <span class="keywordflow">if</span> (tLength < tWordHeaderLen) { -<a name="l00925"></a>00925 <span class="comment">/* Smaller than the current header */</span> -<a name="l00926"></a>00926 <span class="keywordflow">return</span> image_no_information; -<a name="l00927"></a>00927 } -<a name="l00928"></a>00928 iType = (int)usNextWord(pFile); -<a name="l00929"></a>00929 DBG_DEC(iType); -<a name="l00930"></a>00930 (void)tSkipBytes(pFile, 28 - 8); -<a name="l00931"></a>00931 -<a name="l00932"></a>00932 lTmp = lTwips2MilliPoints(usNextWord(pFile)); -<a name="l00933"></a>00933 iHorSize = (int)(lTmp / 1000); -<a name="l00934"></a>00934 <span class="keywordflow">if</span> (lTmp % 1000 != 0) { -<a name="l00935"></a>00935 iHorSize++; -<a name="l00936"></a>00936 } -<a name="l00937"></a>00937 DBG_DEC(iHorSize); -<a name="l00938"></a>00938 lTmp = lTwips2MilliPoints(usNextWord(pFile)); -<a name="l00939"></a>00939 iVerSize = (int)(lTmp / 1000); -<a name="l00940"></a>00940 <span class="keywordflow">if</span> (lTmp % 1000 != 0) { -<a name="l00941"></a>00941 iVerSize++; -<a name="l00942"></a>00942 } -<a name="l00943"></a>00943 DBG_DEC(iVerSize); -<a name="l00944"></a>00944 -<a name="l00945"></a>00945 usHorScalingFactor = usNextWord(pFile); -<a name="l00946"></a>00946 DBG_DEC(usHorScalingFactor); -<a name="l00947"></a>00947 usVerScalingFactor = usNextWord(pFile); -<a name="l00948"></a>00948 DBG_DEC(usVerScalingFactor); -<a name="l00949"></a>00949 -<a name="l00950"></a>00950 <span class="comment">/* Sanity checks */</span> -<a name="l00951"></a>00951 lTmp = (long)iHorSize * (<span class="keywordtype">long</span>)usHorScalingFactor; -<a name="l00952"></a>00952 <span class="keywordflow">if</span> (lTmp < 2835) { -<a name="l00953"></a>00953 <span class="comment">/* This image would be less than 1 millimeter wide */</span> -<a name="l00954"></a>00954 DBG_DEC(lTmp); -<a name="l00955"></a>00955 <span class="keywordflow">return</span> image_no_information; -<a name="l00956"></a>00956 } -<a name="l00957"></a>00957 lTmp = (long)iVerSize * (<span class="keywordtype">long</span>)usVerScalingFactor; -<a name="l00958"></a>00958 <span class="keywordflow">if</span> (lTmp < 2835) { -<a name="l00959"></a>00959 <span class="comment">/* This image would be less than 1 millimeter high */</span> -<a name="l00960"></a>00960 DBG_DEC(lTmp); -<a name="l00961"></a>00961 <span class="keywordflow">return</span> image_no_information; -<a name="l00962"></a>00962 } -<a name="l00963"></a>00963 -<a name="l00964"></a>00964 <span class="comment">/* Skip the rest of the header */</span> -<a name="l00965"></a>00965 (void)tSkipBytes(pFile, tWordHeaderLen - 36); -<a name="l00966"></a>00966 tPos = tWordHeaderLen; -<a name="l00967"></a>00967 -<a name="l00968"></a>00968 (void)memset(pImg, 0, <span class="keyword">sizeof</span>(*pImg)); -<a name="l00969"></a>00969 -<a name="l00970"></a>00970 <span class="keywordflow">switch</span> (iType) { -<a name="l00971"></a>00971 <span class="keywordflow">case</span> 7: -<a name="l00972"></a>00972 <span class="keywordflow">case</span> 8: -<a name="l00973"></a>00973 tPos = tFind6Image(pFile, tPos, tLength, &pImg->eImageType); -<a name="l00974"></a>00974 <span class="keywordflow">if</span> (tPos == (<span class="keywordtype">size_t</span>)-1) { -<a name="l00975"></a>00975 <span class="comment">/* No image found */</span> -<a name="l00976"></a>00976 <span class="keywordflow">return</span> image_no_information; -<a name="l00977"></a>00977 } -<a name="l00978"></a>00978 DBG_HEX(tPos); -<a name="l00979"></a>00979 <span class="keywordflow">break</span>; -<a name="l00980"></a>00980 <span class="keywordflow">case</span> 94: <span class="comment">/* Word 6/7, no image just a pathname */</span> -<a name="l00981"></a>00981 pImg->eImageType = imagetype_is_external; -<a name="l00982"></a>00982 DBG_HEX(ulFileOffsetImage + tPos); -<a name="l00983"></a>00983 <span class="keywordflow">break</span>; -<a name="l00984"></a>00984 <span class="keywordflow">case</span> 100: -<a name="l00985"></a>00985 tPos = tFind8Image(pFile, tPos, tLength, &pImg->eImageType); -<a name="l00986"></a>00986 <span class="keywordflow">if</span> (tPos == (<span class="keywordtype">size_t</span>)-1) { -<a name="l00987"></a>00987 <span class="comment">/* No image found */</span> -<a name="l00988"></a>00988 <span class="keywordflow">return</span> image_no_information; -<a name="l00989"></a>00989 } -<a name="l00990"></a>00990 DBG_HEX(tPos); -<a name="l00991"></a>00991 <span class="keywordflow">break</span>; -<a name="l00992"></a>00992 <span class="keywordflow">case</span> 102: <span class="comment">/* Word 8/9/10, no image just a pathname or URL */</span> -<a name="l00993"></a>00993 pImg->eImageType = imagetype_is_external; -<a name="l00994"></a>00994 DBG_HEX(ulFileOffsetImage + tPos); -<a name="l00995"></a>00995 <span class="keywordflow">break</span>; -<a name="l00996"></a>00996 <span class="keywordflow">default</span>: -<a name="l00997"></a>00997 DBG_DEC(iType); -<a name="l00998"></a>00998 DBG_HEX(ulFileOffsetImage + tPos); -<a name="l00999"></a>00999 DBG_FIXME(); -<a name="l01000"></a>01000 <span class="keywordflow">return</span> image_no_information; -<a name="l01001"></a>01001 } -<a name="l01002"></a>01002 -<a name="l01003"></a>01003 <span class="comment">/* Minimal information is now available */</span> -<a name="l01004"></a>01004 pImg->tLength = tLength; -<a name="l01005"></a>01005 pImg->tPosition = tPos; -<a name="l01006"></a>01006 pImg->iHorSizeScaled = -<a name="l01007"></a>01007 (int)(((<span class="keywordtype">long</span>)iHorSize * (<span class="keywordtype">long</span>)usHorScalingFactor + 500) / 1000); -<a name="l01008"></a>01008 pImg->iVerSizeScaled = -<a name="l01009"></a>01009 (int)(((<span class="keywordtype">long</span>)iVerSize * (long)usVerScalingFactor + 500) / 1000); -<a name="l01010"></a>01010 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l01011"></a>01011 <span class="preprocessor"></span> vImage2Papersize(pImg); -<a name="l01012"></a>01012 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l01013"></a>01013 -<a name="l01014"></a>01014 <span class="comment">/* Image type specific examinations */</span> -<a name="l01015"></a>01015 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l01016"></a>01016 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l01017"></a>01017 <span class="keywordflow">if</span> (bExamineDIB(pFile, pImg)) { -<a name="l01018"></a>01018 <span class="keywordflow">return</span> image_full_information; -<a name="l01019"></a>01019 } -<a name="l01020"></a>01020 <span class="keywordflow">return</span> image_minimal_information; -<a name="l01021"></a>01021 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l01022"></a>01022 <span class="keywordflow">if</span> (bExamineJPEG(pFile, pImg)) { -<a name="l01023"></a>01023 <span class="keywordflow">return</span> image_full_information; -<a name="l01024"></a>01024 } -<a name="l01025"></a>01025 <span class="keywordflow">return</span> image_minimal_information; -<a name="l01026"></a>01026 <span class="keywordflow">case</span> imagetype_is_png: -<a name="l01027"></a>01027 <span class="keywordflow">if</span> (bExaminePNG(pFile, pImg)) { -<a name="l01028"></a>01028 <span class="keywordflow">return</span> image_full_information; -<a name="l01029"></a>01029 } -<a name="l01030"></a>01030 <span class="keywordflow">return</span> image_minimal_information; -<a name="l01031"></a>01031 <span class="keywordflow">case</span> imagetype_is_wmf: -<a name="l01032"></a>01032 <span class="keywordflow">if</span> (bExamineWMF(pFile, pImg)) { -<a name="l01033"></a>01033 <span class="keywordflow">return</span> image_full_information; -<a name="l01034"></a>01034 } -<a name="l01035"></a>01035 <span class="keywordflow">return</span> image_minimal_information; -<a name="l01036"></a>01036 <span class="keywordflow">case</span> imagetype_is_emf: -<a name="l01037"></a>01037 <span class="keywordflow">case</span> imagetype_is_pict: -<a name="l01038"></a>01038 <span class="keywordflow">case</span> imagetype_is_external: -<a name="l01039"></a>01039 <span class="keywordflow">return</span> image_minimal_information; -<a name="l01040"></a>01040 <span class="keywordflow">case</span> imagetype_is_unknown: -<a name="l01041"></a>01041 <span class="keywordflow">default</span>: -<a name="l01042"></a>01042 <span class="keywordflow">return</span> image_no_information; -<a name="l01043"></a>01043 } -<a name="l01044"></a>01044 } <span class="comment">/* end of eExamineImage */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/imgtrans_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/imgtrans.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/imgtrans.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * imgtrans.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Generic functions to translate Word images</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/*</span> -<a name="l00014"></a>00014 <span class="comment"> * bTranslateImage - translate the image</span> -<a name="l00015"></a>00015 <span class="comment"> *</span> -<a name="l00016"></a>00016 <span class="comment"> * This function reads the type of the given image and and gets it translated.</span> -<a name="l00017"></a>00017 <span class="comment"> *</span> -<a name="l00018"></a>00018 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00019"></a>00019 <span class="comment"> */</span> -<a name="l00020"></a>00020 BOOL -<a name="l00021"></a>00021 bTranslateImage(diagram_type *pDiag, FILE *pFile, BOOL bMinimalInformation, -<a name="l00022"></a>00022 ULONG ulFileOffsetImage, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00023"></a>00023 { -<a name="l00024"></a>00024 options_type tOptions; -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 DBG_MSG(<span class="stringliteral">"bTranslateImage"</span>); -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 fail(pDiag == NULL); -<a name="l00029"></a>00029 fail(pFile == NULL); -<a name="l00030"></a>00030 fail(ulFileOffsetImage == FC_INVALID); -<a name="l00031"></a>00031 fail(pImg == NULL); -<a name="l00032"></a>00032 fail(pImg->iHorSizeScaled <= 0); -<a name="l00033"></a>00033 fail(pImg->iVerSizeScaled <= 0); -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 vGetOptions(&tOptions); -<a name="l00036"></a>00036 fail(tOptions.eImageLevel == level_no_images); -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 <span class="keywordflow">if</span> (bMinimalInformation) { -<a name="l00039"></a>00039 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00040"></a>00040 } -<a name="l00041"></a>00041 -<a name="l00042"></a>00042 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l00043"></a>00043 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l00044"></a>00044 <span class="keywordflow">return</span> bTranslateDIB(pDiag, pFile, -<a name="l00045"></a>00045 ulFileOffsetImage + pImg->tPosition, -<a name="l00046"></a>00046 pImg); -<a name="l00047"></a>00047 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l00048"></a>00048 <span class="keywordflow">return</span> bTranslateJPEG(pDiag, pFile, -<a name="l00049"></a>00049 ulFileOffsetImage + pImg->tPosition, -<a name="l00050"></a>00050 pImg->tLength - pImg->tPosition, -<a name="l00051"></a>00051 pImg); -<a name="l00052"></a>00052 <span class="keywordflow">case</span> imagetype_is_png: -<a name="l00053"></a>00053 <span class="keywordflow">if</span> (tOptions.eImageLevel == level_ps_2) { -<a name="l00054"></a>00054 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 <span class="keywordflow">return</span> bTranslatePNG(pDiag, pFile, -<a name="l00057"></a>00057 ulFileOffsetImage + pImg->tPosition, -<a name="l00058"></a>00058 pImg->tLength - pImg->tPosition, -<a name="l00059"></a>00059 pImg); -<a name="l00060"></a>00060 <span class="keywordflow">case</span> imagetype_is_emf: -<a name="l00061"></a>00061 <span class="keywordflow">case</span> imagetype_is_wmf: -<a name="l00062"></a>00062 <span class="keywordflow">case</span> imagetype_is_pict: -<a name="l00063"></a>00063 <span class="keywordflow">case</span> imagetype_is_external: -<a name="l00064"></a>00064 <span class="comment">/* FIXME */</span> -<a name="l00065"></a>00065 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00066"></a>00066 <span class="keywordflow">case</span> imagetype_is_unknown: -<a name="l00067"></a>00067 <span class="keywordflow">default</span>: -<a name="l00068"></a>00068 DBG_DEC(pImg->eImageType); -<a name="l00069"></a>00069 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00070"></a>00070 } -<a name="l00071"></a>00071 } <span class="comment">/* end of bTranslateImage */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/jpeg2eps_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/jpeg2eps.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/jpeg2eps.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * jpeg2eps.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate jpeg pictures into eps</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdio.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">int</span> iPicCounter = 0; -<a name="l00015"></a>00015 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00020"></a>00020 <span class="comment"> * vCopy2File</span> -<a name="l00021"></a>00021 <span class="comment"> */</span> -<a name="l00022"></a>00022 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00023"></a>00023 vCopy2File(FILE *pFile, ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen) -<a name="l00024"></a>00024 { -<a name="l00025"></a>00025 FILE *pOutFile; -<a name="l00026"></a>00026 <span class="keywordtype">size_t</span> tIndex; -<a name="l00027"></a>00027 <span class="keywordtype">int</span> iTmp; -<a name="l00028"></a>00028 <span class="keywordtype">char</span> szFilename[30]; -<a name="l00029"></a>00029 -<a name="l00030"></a>00030 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00031"></a>00031 <span class="keywordflow">return</span>; -<a name="l00032"></a>00032 } -<a name="l00033"></a>00033 -<a name="l00034"></a>00034 sprintf(szFilename, <span class="stringliteral">"/tmp/pic/pic%04d.jpg"</span>, ++iPicCounter); -<a name="l00035"></a>00035 pOutFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00036"></a>00036 <span class="keywordflow">if</span> (pOutFile == NULL) { -<a name="l00037"></a>00037 <span class="keywordflow">return</span>; -<a name="l00038"></a>00038 } -<a name="l00039"></a>00039 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tPictureLen; tIndex++) { -<a name="l00040"></a>00040 iTmp = iNextByte(pFile); -<a name="l00041"></a>00041 <span class="keywordflow">if</span> (putc(iTmp, pOutFile) == EOF) { -<a name="l00042"></a>00042 <span class="keywordflow">break</span>; -<a name="l00043"></a>00043 } -<a name="l00044"></a>00044 } -<a name="l00045"></a>00045 (void)fclose(pOutFile); -<a name="l00046"></a>00046 } <span class="comment">/* end of vCopy2File */</span> -<a name="l00047"></a>00047 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00048"></a>00048 -<a name="l00049"></a>00049 <span class="comment">/*</span> -<a name="l00050"></a>00050 <span class="comment"> * bTranslateJPEG - translate a JPEG picture</span> -<a name="l00051"></a>00051 <span class="comment"> *</span> -<a name="l00052"></a>00052 <span class="comment"> * This function translates a picture from jpeg to eps</span> -<a name="l00053"></a>00053 <span class="comment"> *</span> -<a name="l00054"></a>00054 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00055"></a>00055 <span class="comment"> */</span> -<a name="l00056"></a>00056 BOOL -<a name="l00057"></a>00057 bTranslateJPEG(diagram_type *pDiag, FILE *pFile, -<a name="l00058"></a>00058 ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00059"></a>00059 { -<a name="l00060"></a>00060 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00061"></a>00061 <span class="preprocessor"></span> vCopy2File(pFile, ulFileOffset, tPictureLen); -<a name="l00062"></a>00062 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 <span class="comment">/* Seek to start position of JPEG data */</span> -<a name="l00065"></a>00065 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00066"></a>00066 <span class="keywordflow">return</span> FALSE; -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 vImagePrologue(pDiag, pImg); -<a name="l00070"></a>00070 vASCII85EncodeFile(pFile, pDiag->pOutFile, tPictureLen); -<a name="l00071"></a>00071 vImageEpilogue(pDiag); -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="keywordflow">return</span> TRUE; -<a name="l00074"></a>00074 } <span class="comment">/* end of bTranslateJPEG */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/jpeg2sprt_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/jpeg2sprt.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/jpeg2sprt.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * jpeg2sprt.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate jpeg pictures into sprites</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00013"></a>00013 <span class="keyword">static</span> <span class="keywordtype">int</span> iPicCounter = 0; -<a name="l00014"></a>00014 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00019"></a>00019 vCopy2File(UCHAR *pucJpeg, <span class="keywordtype">size_t</span> tJpegSize) -<a name="l00020"></a>00020 { -<a name="l00021"></a>00021 FILE *pOutFile; -<a name="l00022"></a>00022 <span class="keywordtype">size_t</span> tIndex; -<a name="l00023"></a>00023 <span class="keywordtype">char</span> szFilename[30]; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 sprintf(szFilename, <span class="stringliteral">"<Wimp$ScrapDir>.jpeg%04d"</span>, ++iPicCounter); -<a name="l00026"></a>00026 pOutFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00027"></a>00027 <span class="keywordflow">if</span> (pOutFile == NULL) { -<a name="l00028"></a>00028 <span class="keywordflow">return</span>; -<a name="l00029"></a>00029 } -<a name="l00030"></a>00030 DBG_MSG(szFilename); -<a name="l00031"></a>00031 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tJpegSize; tIndex++) { -<a name="l00032"></a>00032 <span class="keywordflow">if</span> (putc(pucJpeg[tIndex], pOutFile) == EOF) { -<a name="l00033"></a>00033 <span class="keywordflow">break</span>; -<a name="l00034"></a>00034 } -<a name="l00035"></a>00035 } -<a name="l00036"></a>00036 (void)fclose(pOutFile); -<a name="l00037"></a>00037 vSetFiletype(szFilename, FILETYPE_JPEG); -<a name="l00038"></a>00038 } <span class="comment">/* end of vCopy2File */</span> -<a name="l00039"></a>00039 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 <span class="comment">/*</span> -<a name="l00042"></a>00042 <span class="comment"> * bSave2Draw - save the JPEG picture to the Draw file</span> -<a name="l00043"></a>00043 <span class="comment"> *</span> -<a name="l00044"></a>00044 <span class="comment"> * This function puts a JPEG picture in a Draw file</span> -<a name="l00045"></a>00045 <span class="comment"> *</span> -<a name="l00046"></a>00046 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00047"></a>00047 <span class="comment"> */</span> -<a name="l00048"></a>00048 BOOL -<a name="l00049"></a>00049 bSave2Draw(diagram_type *pDiag, FILE *pFile, -<a name="l00050"></a>00050 <span class="keywordtype">size_t</span> tJpegSize, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00051"></a>00051 { -<a name="l00052"></a>00052 UCHAR *pucJpeg, *pucTmp; -<a name="l00053"></a>00053 <span class="keywordtype">size_t</span> tLen; -<a name="l00054"></a>00054 <span class="keywordtype">int</span> iByte; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 pucJpeg = xmalloc(tJpegSize); -<a name="l00057"></a>00057 <span class="keywordflow">for</span> (pucTmp = pucJpeg, tLen = 0; tLen < tJpegSize; pucTmp++, tLen++) { -<a name="l00058"></a>00058 iByte = iNextByte(pFile); -<a name="l00059"></a>00059 <span class="keywordflow">if</span> (iByte == EOF) { -<a name="l00060"></a>00060 <span class="keywordflow">return</span> FALSE; -<a name="l00061"></a>00061 } -<a name="l00062"></a>00062 *pucTmp = (UCHAR)iByte; -<a name="l00063"></a>00063 } -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00066"></a>00066 vCopy2File(pucJpeg, tJpegSize); -<a name="l00067"></a>00067 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 <span class="comment">/* Add the JPEG to the Draw file */</span> -<a name="l00070"></a>00070 vImage2Diagram(pDiag, pImg, pucJpeg, tJpegSize); -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 xfree(pucJpeg); -<a name="l00073"></a>00073 <span class="keywordflow">return</span> TRUE; -<a name="l00074"></a>00074 } <span class="comment">/* end of bSave2Draw */</span> -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 <span class="comment">/*</span> -<a name="l00077"></a>00077 <span class="comment"> * bTranslateJPEG - translate a JPEG picture</span> -<a name="l00078"></a>00078 <span class="comment"> *</span> -<a name="l00079"></a>00079 <span class="comment"> * This function translates a picture from jpeg to sprite</span> -<a name="l00080"></a>00080 <span class="comment"> *</span> -<a name="l00081"></a>00081 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00082"></a>00082 <span class="comment"> */</span> -<a name="l00083"></a>00083 <span class="preprocessor">#if 0</span> -<a name="l00084"></a>00084 <span class="preprocessor"></span>BOOL -<a name="l00085"></a>00085 bTranslateJPEG(diagram_type *pDiag, FILE *pFile, -<a name="l00086"></a>00086 ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00087"></a>00087 { -<a name="l00088"></a>00088 <span class="comment">/* Seek to start position of JPEG data */</span> -<a name="l00089"></a>00089 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00090"></a>00090 <span class="keywordflow">return</span> FALSE; -<a name="l00091"></a>00091 } -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 <span class="keywordflow">if</span> (iGetRiscOsVersion() >= 360) { -<a name="l00094"></a>00094 <span class="keywordflow">return</span> bSave2Draw(pDiag, pFile, tPictureLen, pImg); -<a name="l00095"></a>00095 } -<a name="l00096"></a>00096 <span class="comment">/* JPEG is not supported until RISC OS 3.6 */</span> -<a name="l00097"></a>00097 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00098"></a>00098 } <span class="comment">/* end of bTranslateJPEG */</span> -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 <span class="preprocessor">#endif</span><span class="comment">/*0*/</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/listlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,346 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/listlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/listlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * listlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002,2003 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word list information</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * Note:</span> -<a name="l00009"></a>00009 <span class="comment"> * This list only exists when the Word document is saved by Word 8 or later</span> -<a name="l00010"></a>00010 <span class="comment"> */</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00016"></a>00016 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keyword">typedef</span> <span class="keyword">struct </span>list_desc_tag { -<a name="l00019"></a>00019 list_block_type tInfo; -<a name="l00020"></a>00020 ULONG ulListID; -<a name="l00021"></a>00021 USHORT usIstd; -<a name="l00022"></a>00022 UCHAR ucListLevel; -<a name="l00023"></a>00023 <span class="keyword">struct </span>list_desc_tag *pNext; -<a name="l00024"></a>00024 } list_desc_type; -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 <span class="keyword">typedef</span> <span class="keyword">struct </span>list_value_tag { -<a name="l00027"></a>00027 USHORT usValue; -<a name="l00028"></a>00028 USHORT usListIndex; -<a name="l00029"></a>00029 UCHAR ucListLevel; -<a name="l00030"></a>00030 <span class="keyword">struct </span>list_value_tag *pNext; -<a name="l00031"></a>00031 } list_value_type; -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Variables needed to describe the LFO list (pllfo) */</span> -<a name="l00034"></a>00034 <span class="keyword">static</span> ULONG *aulLfoList = NULL; -<a name="l00035"></a>00035 <span class="keyword">static</span> USHORT usLfoLen = 0; -<a name="l00036"></a>00036 <span class="comment">/* Variables needed to write the List Information List */</span> -<a name="l00037"></a>00037 <span class="keyword">static</span> list_desc_type *pAnchor = NULL; -<a name="l00038"></a>00038 <span class="keyword">static</span> list_desc_type *pBlockLast = NULL; -<a name="l00039"></a>00039 <span class="comment">/* Variable needed for numbering new lists */</span> -<a name="l00040"></a>00040 <span class="keyword">static</span> list_value_type *pValues = NULL; -<a name="l00041"></a>00041 <span class="comment">/* Variables needed for numbering old lists */</span> -<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">int</span> iOldListSeqNumber = 0; -<a name="l00043"></a>00043 <span class="keyword">static</span> USHORT usOldListValue = 0; -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/*</span> -<a name="l00047"></a>00047 <span class="comment"> * vDestroyListInfoList - destroy the List Information List</span> -<a name="l00048"></a>00048 <span class="comment"> */</span> -<a name="l00049"></a>00049 <span class="keywordtype">void</span> -<a name="l00050"></a>00050 vDestroyListInfoList(<span class="keywordtype">void</span>) -<a name="l00051"></a>00051 { -<a name="l00052"></a>00052 list_desc_type *pCurr, *pNext; -<a name="l00053"></a>00053 list_value_type *pValueCurr, *pValueNext; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 DBG_MSG(<span class="stringliteral">"vDestroyListInfoList"</span>); -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 <span class="comment">/* Free the LFO list */</span> -<a name="l00058"></a>00058 usLfoLen = 0; -<a name="l00059"></a>00059 aulLfoList = xfree(aulLfoList); -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 <span class="comment">/* Free the List Information List */</span> -<a name="l00062"></a>00062 pCurr = pAnchor; -<a name="l00063"></a>00063 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00064"></a>00064 pNext = pCurr->pNext; -<a name="l00065"></a>00065 pCurr = xfree(pCurr); -<a name="l00066"></a>00066 pCurr = pNext; -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 pAnchor = NULL; -<a name="l00069"></a>00069 <span class="comment">/* Reset all control variables */</span> -<a name="l00070"></a>00070 pBlockLast = NULL; -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 <span class="comment">/* Free the values list */</span> -<a name="l00073"></a>00073 pValueCurr = pValues; -<a name="l00074"></a>00074 <span class="keywordflow">while</span> (pValueCurr != NULL) { -<a name="l00075"></a>00075 pValueNext = pValueCurr->pNext; -<a name="l00076"></a>00076 pValueCurr = xfree(pValueCurr); -<a name="l00077"></a>00077 pValueCurr = pValueNext; -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 pValues = NULL; -<a name="l00080"></a>00080 <span class="comment">/* Reset the values for the old lists */</span> -<a name="l00081"></a>00081 iOldListSeqNumber = 0; -<a name="l00082"></a>00082 usOldListValue = 0; -<a name="l00083"></a>00083 } <span class="comment">/* end of vDestroyListInfoList */</span> -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 <span class="comment">/*</span> -<a name="l00086"></a>00086 <span class="comment"> * vBuildLfoList - build the LFO list (pllfo)</span> -<a name="l00087"></a>00087 <span class="comment"> */</span> -<a name="l00088"></a>00088 <span class="keywordtype">void</span> -<a name="l00089"></a>00089 vBuildLfoList(<span class="keyword">const</span> UCHAR *aucBuffer, <span class="keywordtype">size_t</span> tBufLen) -<a name="l00090"></a>00090 { -<a name="l00091"></a>00091 <span class="keywordtype">size_t</span> tRecords; -<a name="l00092"></a>00092 <span class="keywordtype">int</span> iIndex; -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 fail(aucBuffer == NULL); -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="keywordflow">if</span> (tBufLen < 4) { -<a name="l00097"></a>00097 <span class="keywordflow">return</span>; -<a name="l00098"></a>00098 } -<a name="l00099"></a>00099 tRecords = (size_t)ulGetLong(0, aucBuffer); -<a name="l00100"></a>00100 NO_DBG_DEC(tRecords); -<a name="l00101"></a>00101 <span class="keywordflow">if</span> (4 + 16 * tRecords > tBufLen || tRecords >= 0x7fff) { -<a name="l00102"></a>00102 <span class="comment">/* Just a sanity check */</span> -<a name="l00103"></a>00103 DBG_DEC(tRecords); -<a name="l00104"></a>00104 DBG_DEC(4 + 16 * tRecords); -<a name="l00105"></a>00105 DBG_DEC(tBufLen); -<a name="l00106"></a>00106 <span class="keywordflow">return</span>; -<a name="l00107"></a>00107 } -<a name="l00108"></a>00108 aulLfoList = xcalloc(tRecords, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00109"></a>00109 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tRecords; iIndex++) { -<a name="l00110"></a>00110 aulLfoList[iIndex] = ulGetLong(4 + 16 * iIndex, aucBuffer); -<a name="l00111"></a>00111 NO_DBG_HEX(aulLfoList[iIndex]); -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 usLfoLen = (USHORT)tRecords; -<a name="l00114"></a>00114 } <span class="comment">/* end of vBuildLfoList */</span> -<a name="l00115"></a>00115 -<a name="l00116"></a>00116 <span class="comment">/*</span> -<a name="l00117"></a>00117 <span class="comment"> * vAdd2ListInfoList - add an element to the List Information list</span> -<a name="l00118"></a>00118 <span class="comment"> */</span> -<a name="l00119"></a>00119 <span class="keywordtype">void</span> -<a name="l00120"></a>00120 vAdd2ListInfoList(ULONG ulListID, USHORT usIstd, UCHAR ucListLevel, -<a name="l00121"></a>00121 <span class="keyword">const</span> list_block_type *pListBlock) -<a name="l00122"></a>00122 { -<a name="l00123"></a>00123 list_desc_type *pListMember; -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 fail(pListBlock == NULL); -<a name="l00126"></a>00126 -<a name="l00127"></a>00127 NO_DBG_HEX(ulListID); -<a name="l00128"></a>00128 NO_DBG_DEC(usIstd); -<a name="l00129"></a>00129 NO_DBG_DEC(ucListLevel); -<a name="l00130"></a>00130 NO_DBG_DEC(pListBlock->ulStartAt); -<a name="l00131"></a>00131 NO_DBG_DEC(pListBlock->bNoRestart); -<a name="l00132"></a>00132 NO_DBG_DEC(pListBlock->sLeftIndent); -<a name="l00133"></a>00133 NO_DBG_HEX(pListBlock->ucNFC); -<a name="l00134"></a>00134 NO_DBG_HEX(pListBlock->usListChar); -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 <span class="comment">/* Create list member */</span> -<a name="l00137"></a>00137 pListMember = xmalloc(<span class="keyword">sizeof</span>(list_desc_type)); -<a name="l00138"></a>00138 <span class="comment">/* Fill the list member */</span> -<a name="l00139"></a>00139 pListMember->tInfo = *pListBlock; -<a name="l00140"></a>00140 pListMember->ulListID = ulListID; -<a name="l00141"></a>00141 pListMember->usIstd = usIstd; -<a name="l00142"></a>00142 pListMember->ucListLevel = ucListLevel; -<a name="l00143"></a>00143 pListMember->pNext = NULL; -<a name="l00144"></a>00144 <span class="comment">/* Correct the values where needed */</span> -<a name="l00145"></a>00145 <span class="keywordflow">if</span> (pListMember->tInfo.ulStartAt > 0xffff) { -<a name="l00146"></a>00146 DBG_DEC(pListMember->tInfo.ulStartAt); -<a name="l00147"></a>00147 pListMember->tInfo.ulStartAt = 1; -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 <span class="comment">/* Add the new member to the list */</span> -<a name="l00150"></a>00150 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00151"></a>00151 pAnchor = pListMember; -<a name="l00152"></a>00152 } <span class="keywordflow">else</span> { -<a name="l00153"></a>00153 fail(pBlockLast == NULL); -<a name="l00154"></a>00154 pBlockLast->pNext = pListMember; -<a name="l00155"></a>00155 } -<a name="l00156"></a>00156 pBlockLast = pListMember; -<a name="l00157"></a>00157 } <span class="comment">/* end of vAdd2ListInfoList */</span> -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 <span class="comment">/*</span> -<a name="l00160"></a>00160 <span class="comment"> * Get a matching record from the List Information List</span> -<a name="l00161"></a>00161 <span class="comment"> *</span> -<a name="l00162"></a>00162 <span class="comment"> * Returns NULL if no matching records is found</span> -<a name="l00163"></a>00163 <span class="comment"> */</span> -<a name="l00164"></a>00164 <span class="keyword">const</span> list_block_type * -<a name="l00165"></a>00165 pGetListInfo(USHORT usListIndex, UCHAR ucListLevel) -<a name="l00166"></a>00166 { -<a name="l00167"></a>00167 list_desc_type *pCurr; -<a name="l00168"></a>00168 list_block_type *pNearMatch; -<a name="l00169"></a>00169 ULONG ulListID; -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 <span class="keywordflow">if</span> (usListIndex == 0) { -<a name="l00172"></a>00172 <span class="keywordflow">return</span> NULL; -<a name="l00173"></a>00173 } -<a name="l00174"></a>00174 <span class="keywordflow">if</span> (usListIndex - 1 >= usLfoLen || ucListLevel > 8) { -<a name="l00175"></a>00175 DBG_DEC(usListIndex); -<a name="l00176"></a>00176 DBG_DEC(ucListLevel); -<a name="l00177"></a>00177 <span class="keywordflow">return</span> NULL; -<a name="l00178"></a>00178 } -<a name="l00179"></a>00179 fail(aulLfoList == NULL); -<a name="l00180"></a>00180 ulListID = aulLfoList[usListIndex - 1]; -<a name="l00181"></a>00181 NO_DBG_HEX(ulListID); -<a name="l00182"></a>00182 -<a name="l00183"></a>00183 pNearMatch = NULL; -<a name="l00184"></a>00184 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00185"></a>00185 <span class="keywordflow">if</span> (pCurr->ulListID != ulListID) { -<a name="l00186"></a>00186 <span class="comment">/* No match */</span> -<a name="l00187"></a>00187 <span class="keywordflow">continue</span>; -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 <span class="keywordflow">if</span> (pCurr->ucListLevel == ucListLevel) { -<a name="l00190"></a>00190 <span class="comment">/* Exact match */</span> -<a name="l00191"></a>00191 <span class="keywordflow">return</span> &pCurr->tInfo; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 <span class="keywordflow">if</span> (pCurr->ucListLevel == 0) { -<a name="l00194"></a>00194 <span class="comment">/* Near match */</span> -<a name="l00195"></a>00195 pNearMatch = &pCurr->tInfo; -<a name="l00196"></a>00196 } -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 <span class="comment">/* No exact match, use a near match if any */</span> -<a name="l00199"></a>00199 <span class="keywordflow">return</span> pNearMatch; -<a name="l00200"></a>00200 } <span class="comment">/* end of pGetListInfo */</span> -<a name="l00201"></a>00201 -<a name="l00202"></a>00202 <span class="comment">/*</span> -<a name="l00203"></a>00203 <span class="comment"> * Get a matching record from the List Information List</span> -<a name="l00204"></a>00204 <span class="comment"> *</span> -<a name="l00205"></a>00205 <span class="comment"> * Returns NULL if no matching records is found</span> -<a name="l00206"></a>00206 <span class="comment"> */</span> -<a name="l00207"></a>00207 <span class="keyword">const</span> list_block_type * -<a name="l00208"></a>00208 pGetListInfoByIstd(USHORT usIstd) -<a name="l00209"></a>00209 { -<a name="l00210"></a>00210 list_desc_type *pCurr; -<a name="l00211"></a>00211 -<a name="l00212"></a>00212 <span class="keywordflow">if</span> (usIstd == ISTD_INVALID || usIstd == STI_NIL || usIstd == STI_USER) { -<a name="l00213"></a>00213 <span class="keywordflow">return</span> NULL; -<a name="l00214"></a>00214 } -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00217"></a>00217 <span class="keywordflow">if</span> (pCurr->usIstd == usIstd) { -<a name="l00218"></a>00218 <span class="keywordflow">return</span> &pCurr->tInfo; -<a name="l00219"></a>00219 } -<a name="l00220"></a>00220 } -<a name="l00221"></a>00221 <span class="keywordflow">return</span> NULL; -<a name="l00222"></a>00222 } <span class="comment">/* end of pGetListInfoByIstd */</span> -<a name="l00223"></a>00223 -<a name="l00224"></a>00224 <span class="comment">/*</span> -<a name="l00225"></a>00225 <span class="comment"> * vRestartListValues - reset the less significant list levels</span> -<a name="l00226"></a>00226 <span class="comment"> */</span> -<a name="l00227"></a>00227 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00228"></a>00228 vRestartListValues(USHORT usListIndex, UCHAR ucListLevel) -<a name="l00229"></a>00229 { -<a name="l00230"></a>00230 list_value_type *pPrev, *pCurr, *pNext; -<a name="l00231"></a>00231 <span class="keywordtype">int</span> iCounter; -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 iCounter = 0; -<a name="l00234"></a>00234 pPrev = NULL; -<a name="l00235"></a>00235 pCurr = pValues; -<a name="l00236"></a>00236 -<a name="l00237"></a>00237 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00238"></a>00238 <span class="keywordflow">if</span> (pCurr->usListIndex != usListIndex || -<a name="l00239"></a>00239 pCurr->ucListLevel <= ucListLevel) { -<a name="l00240"></a>00240 pPrev = pCurr; -<a name="l00241"></a>00241 pCurr = pCurr->pNext; -<a name="l00242"></a>00242 <span class="keywordflow">continue</span>; -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 <span class="comment">/* Reset the level by deleting the record */</span> -<a name="l00245"></a>00245 pNext = pCurr->pNext; -<a name="l00246"></a>00246 <span class="keywordflow">if</span> (pPrev == NULL) { -<a name="l00247"></a>00247 pValues = pNext; -<a name="l00248"></a>00248 } <span class="keywordflow">else</span> { -<a name="l00249"></a>00249 pPrev->pNext = pNext; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 DBG_DEC(pCurr->usListIndex); -<a name="l00252"></a>00252 DBG_DEC(pCurr->ucListLevel); -<a name="l00253"></a>00253 pCurr = xfree(pCurr); -<a name="l00254"></a>00254 pCurr = pNext; -<a name="l00255"></a>00255 iCounter++; -<a name="l00256"></a>00256 } -<a name="l00257"></a>00257 DBG_DEC_C(iCounter > 0, iCounter); -<a name="l00258"></a>00258 } <span class="comment">/* end of vRestartListValues */</span> -<a name="l00259"></a>00259 -<a name="l00260"></a>00260 <span class="comment">/*</span> -<a name="l00261"></a>00261 <span class="comment"> * usGetListValue - Get the current value of the given list</span> -<a name="l00262"></a>00262 <span class="comment"> *</span> -<a name="l00263"></a>00263 <span class="comment"> * Returns the value of the given list</span> -<a name="l00264"></a>00264 <span class="comment"> */</span> -<a name="l00265"></a>00265 USHORT -<a name="l00266"></a>00266 usGetListValue(<span class="keywordtype">int</span> iListSeqNumber, <span class="keywordtype">int</span> iWordVersion, -<a name="l00267"></a>00267 <span class="keyword">const</span> style_block_type *pStyle) -<a name="l00268"></a>00268 { -<a name="l00269"></a>00269 list_value_type *pCurr; -<a name="l00270"></a>00270 USHORT usValue; -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 fail(iListSeqNumber < 0); -<a name="l00273"></a>00273 fail(iListSeqNumber < iOldListSeqNumber); -<a name="l00274"></a>00274 fail(iWordVersion < 0); -<a name="l00275"></a>00275 fail(pStyle == NULL); -<a name="l00276"></a>00276 -<a name="l00277"></a>00277 <span class="keywordflow">if</span> (iListSeqNumber <= 0) { -<a name="l00278"></a>00278 <span class="keywordflow">return</span> 0; -<a name="l00279"></a>00279 } -<a name="l00280"></a>00280 -<a name="l00281"></a>00281 <span class="keywordflow">if</span> (iWordVersion < 8) { -<a name="l00282"></a>00282 <span class="comment">/* Old style list */</span> -<a name="l00283"></a>00283 <span class="keywordflow">if</span> (iListSeqNumber == iOldListSeqNumber || -<a name="l00284"></a>00284 (iListSeqNumber == iOldListSeqNumber + 1 && -<a name="l00285"></a>00285 eGetNumType(pStyle->ucNumLevel) == level_type_sequence)) { -<a name="l00286"></a>00286 <span class="keywordflow">if</span> (!pStyle->bNumPause) { -<a name="l00287"></a>00287 usOldListValue++; -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 } <span class="keywordflow">else</span> { -<a name="l00290"></a>00290 usOldListValue = pStyle->usStartAt; -<a name="l00291"></a>00291 } -<a name="l00292"></a>00292 iOldListSeqNumber = iListSeqNumber; -<a name="l00293"></a>00293 <span class="keywordflow">return</span> usOldListValue; -<a name="l00294"></a>00294 } -<a name="l00295"></a>00295 -<a name="l00296"></a>00296 <span class="comment">/* New style list */</span> -<a name="l00297"></a>00297 <span class="keywordflow">if</span> (pStyle->usListIndex == 0 || -<a name="l00298"></a>00298 pStyle->usListIndex - 1 >= usLfoLen || -<a name="l00299"></a>00299 pStyle->ucListLevel > 8) { -<a name="l00300"></a>00300 <span class="comment">/* Out of range; no need to search */</span> -<a name="l00301"></a>00301 <span class="keywordflow">return</span> 0; -<a name="l00302"></a>00302 } -<a name="l00303"></a>00303 -<a name="l00304"></a>00304 <span class="keywordflow">for</span> (pCurr = pValues; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00305"></a>00305 <span class="keywordflow">if</span> (pCurr->usListIndex == pStyle->usListIndex && -<a name="l00306"></a>00306 pCurr->ucListLevel == pStyle->ucListLevel) { -<a name="l00307"></a>00307 <span class="comment">/* Record found; increment and return the value */</span> -<a name="l00308"></a>00308 pCurr->usValue++; -<a name="l00309"></a>00309 usValue = pCurr->usValue; -<a name="l00310"></a>00310 <span class="keywordflow">if</span> (!pStyle->bNoRestart) { -<a name="l00311"></a>00311 vRestartListValues(pStyle->usListIndex, -<a name="l00312"></a>00312 pStyle->ucListLevel); -<a name="l00313"></a>00313 } -<a name="l00314"></a>00314 <span class="keywordflow">return</span> usValue; -<a name="l00315"></a>00315 } -<a name="l00316"></a>00316 } -<a name="l00317"></a>00317 -<a name="l00318"></a>00318 <span class="comment">/* Record not found; create it and add it to the front of the list */</span> -<a name="l00319"></a>00319 pCurr = xmalloc(<span class="keyword">sizeof</span>(list_value_type)); -<a name="l00320"></a>00320 pCurr->usValue = pStyle->usStartAt; -<a name="l00321"></a>00321 pCurr->usListIndex = pStyle->usListIndex; -<a name="l00322"></a>00322 pCurr->ucListLevel = pStyle->ucListLevel; -<a name="l00323"></a>00323 pCurr->pNext = pValues; -<a name="l00324"></a>00324 pValues = pCurr; -<a name="l00325"></a>00325 usValue = pCurr->usValue; -<a name="l00326"></a>00326 <span class="keywordflow">if</span> (!pStyle->bNoRestart) { -<a name="l00327"></a>00327 vRestartListValues(pStyle->usListIndex, pStyle->ucListLevel); -<a name="l00328"></a>00328 } -<a name="l00329"></a>00329 <span class="keywordflow">return</span> usValue; -<a name="l00330"></a>00330 } <span class="comment">/* end of usGetListValue */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/main__ros_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,536 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/main_ros.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/main_ros.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * main_ros.c</span> -<a name="l00003"></a>00003 <span class="comment"> *</span> -<a name="l00004"></a>00004 <span class="comment"> * Released under GPL</span> -<a name="l00005"></a>00005 <span class="comment"> *</span> -<a name="l00006"></a>00006 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or</span> -<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU General Public License</span> -<a name="l00010"></a>00010 <span class="comment"> * as published by the Free Software Foundation; either version 2</span> -<a name="l00011"></a>00011 <span class="comment"> * of the License, or (at your option) any later version.</span> -<a name="l00012"></a>00012 <span class="comment"> *</span> -<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> -<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> -<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> -<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span> -<a name="l00017"></a>00017 <span class="comment"> *</span> -<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span> -<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span> -<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span> -<a name="l00021"></a>00021 <span class="comment"> *</span> -<a name="l00022"></a>00022 <span class="comment"> * Description:</span> -<a name="l00023"></a>00023 <span class="comment"> * The main program of !Antiword (RISC OS version)</span> -<a name="l00024"></a>00024 <span class="comment"> */</span> -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 <span class="preprocessor">#include <stdio.h></span> -<a name="l00027"></a>00027 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00028"></a>00028 <span class="preprocessor">#include <string.h></span> -<a name="l00029"></a>00029 <span class="preprocessor">#include "DeskLib:Dialog2.h"</span> -<a name="l00030"></a>00030 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00031"></a>00031 <span class="preprocessor">#include "DeskLib:Event.h"</span> -<a name="l00032"></a>00032 <span class="preprocessor">#include "DeskLib:EventMsg.h"</span> -<a name="l00033"></a>00033 <span class="preprocessor">#include "DeskLib:Handler.h"</span> -<a name="l00034"></a>00034 <span class="preprocessor">#include "DeskLib:Menu.h"</span> -<a name="l00035"></a>00035 <span class="preprocessor">#include "DeskLib:Resource.h"</span> -<a name="l00036"></a>00036 <span class="preprocessor">#include "DeskLib:Screen.h"</span> -<a name="l00037"></a>00037 <span class="preprocessor">#include "DeskLib:Template.h"</span> -<a name="l00038"></a>00038 <span class="preprocessor">#include "DeskLib:Window.h"</span> -<a name="l00039"></a>00039 <span class="preprocessor">#if defined(__GNUC__)</span> -<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include "flexlib:flex.h"</span> -<a name="l00041"></a>00041 <span class="preprocessor">#endif </span><span class="comment">/* __GNUC__ */</span> -<a name="l00042"></a>00042 <span class="preprocessor">#include "version.h"</span> -<a name="l00043"></a>00043 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/* The name of this program */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">char</span> *szTask = <span class="stringliteral">"!Antiword"</span>; -<a name="l00048"></a>00048 -<a name="l00049"></a>00049 <span class="comment">/* The window handle of the choices window */</span> -<a name="l00050"></a>00050 <span class="keyword">static</span> window_handle tChoicesWindow = 0; -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="comment">/* Dummy diagram with the iconbar menu pointer */</span> -<a name="l00053"></a>00053 <span class="keyword">static</span> diagram_type tDummyDiagram; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 <span class="comment">/* Program information Box */</span> -<a name="l00056"></a>00056 <span class="keyword">static</span> dialog2_block *pInfoBox = NULL; -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/* Info box fields */</span> -<a name="l00059"></a>00059 <span class="preprocessor">#define PURPOSE_INFO_FIELD 2</span> -<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define AUTHOR_INFO_FIELD 3</span> -<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define VERSION_INFO_FIELD 4</span> -<a name="l00062"></a>00062 <span class="preprocessor"></span><span class="preprocessor">#define STATUS_INFO_FIELD 5</span> -<a name="l00063"></a>00063 <span class="preprocessor"></span> -<a name="l00064"></a>00064 <span class="comment">/* Iconbar menu fields */</span> -<a name="l00065"></a>00065 <span class="preprocessor">#define ICONBAR_INFO_FIELD 0</span> -<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#define ICONBAR_CHOICES_FIELD 1</span> -<a name="l00067"></a>00067 <span class="preprocessor"></span><span class="preprocessor">#define ICONBAR_QUIT_FIELD 2</span> -<a name="l00068"></a>00068 <span class="preprocessor"></span> -<a name="l00069"></a>00069 -<a name="l00070"></a>00070 <span class="comment">/*</span> -<a name="l00071"></a>00071 <span class="comment"> * bBarInfo - Show iconbar information</span> -<a name="l00072"></a>00072 <span class="comment"> */</span> -<a name="l00073"></a>00073 <span class="keyword">static</span> BOOL -<a name="l00074"></a>00074 bBarInfo(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00075"></a>00075 { -<a name="l00076"></a>00076 diagram_type *pDiag; -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 TRACE_MSG(<span class="stringliteral">"bBarInfo"</span>); -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 fail(pEvent == NULL); -<a name="l00081"></a>00081 fail(pEvent->type != event_SEND); -<a name="l00082"></a>00082 fail(pEvent->data.message.header.action != message_MENUWARN); -<a name="l00083"></a>00083 fail(pvReference == NULL); -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 pDiag = (diagram_type *)pvReference; -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (menu_currentopen != pDiag->pSaveMenu || -<a name="l00088"></a>00088 pEvent->data.message.data.menuwarn.selection[0] != ICONBAR_INFO_FIELD) { -<a name="l00089"></a>00089 <span class="keywordflow">return</span> FALSE; -<a name="l00090"></a>00090 } -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 Dialog2_OpenDialogMenuLeaf(pEvent, pInfoBox); -<a name="l00093"></a>00093 <span class="keywordflow">return</span> TRUE; -<a name="l00094"></a>00094 } <span class="comment">/* end of bBarInfo */</span> -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="comment">/*</span> -<a name="l00097"></a>00097 <span class="comment"> * vBarInfoSetText - Set the iconbar infobox text</span> -<a name="l00098"></a>00098 <span class="comment"> */</span> -<a name="l00099"></a>00099 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00100"></a>00100 vBarInfoSetText(dialog2_block *pBox) -<a name="l00101"></a>00101 { -<a name="l00102"></a>00102 TRACE_MSG(<span class="stringliteral">"vBarInfoSetText"</span>); -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 fail(pBox == NULL); -<a name="l00105"></a>00105 fail(pBox != pInfoBox); -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 Icon_SetText(pBox->window, PURPOSE_INFO_FIELD, PURPOSESTRING); -<a name="l00108"></a>00108 Icon_SetText(pBox->window, AUTHOR_INFO_FIELD, AUTHORSTRING); -<a name="l00109"></a>00109 Icon_SetText(pBox->window, VERSION_INFO_FIELD, VERSIONSTRING); -<a name="l00110"></a>00110 Icon_SetText(pBox->window, STATUS_INFO_FIELD, STATUSSTRING); -<a name="l00111"></a>00111 } <span class="comment">/* end of vBarInfoSetText */</span> -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 <span class="comment">/*</span> -<a name="l00114"></a>00114 <span class="comment"> * bMouseButtonClick - respond to mouse button click</span> -<a name="l00115"></a>00115 <span class="comment"> */</span> -<a name="l00116"></a>00116 <span class="keyword">static</span> BOOL -<a name="l00117"></a>00117 bMouseButtonClick(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00118"></a>00118 { -<a name="l00119"></a>00119 diagram_type *pDiag; -<a name="l00120"></a>00120 menu_ptr pMenu; -<a name="l00121"></a>00121 <span class="keywordtype">int</span> iPosY; -<a name="l00122"></a>00122 -<a name="l00123"></a>00123 TRACE_MSG(<span class="stringliteral">"bMouseButtonClick"</span>); -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 fail(pEvent == NULL); -<a name="l00126"></a>00126 fail(pEvent->type != event_CLICK); -<a name="l00127"></a>00127 fail(pvReference == NULL); -<a name="l00128"></a>00128 -<a name="l00129"></a>00129 pDiag = (diagram_type *)pvReference; -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (pEvent->data.mouse.button.data.menu) { -<a name="l00132"></a>00132 pMenu = pDiag->pSaveMenu; -<a name="l00133"></a>00133 iPosY = (pMenu == tDummyDiagram.pSaveMenu) ? -<a name="l00134"></a>00134 -1 : pEvent->data.mouse.pos.y; -<a name="l00135"></a>00135 Menu_Show(pMenu, pEvent->data.mouse.pos.x, iPosY); -<a name="l00136"></a>00136 <span class="keywordflow">return</span> TRUE; -<a name="l00137"></a>00137 } -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (pEvent->data.mouse.window == pDiag->tMainWindow && -<a name="l00139"></a>00139 pEvent->data.mouse.icon == -1) { -<a name="l00140"></a>00140 vMainButtonClick(&pEvent->data.mouse); -<a name="l00141"></a>00141 <span class="keywordflow">return</span> TRUE; -<a name="l00142"></a>00142 } -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (pEvent->data.mouse.window == pDiag->tScaleWindow && -<a name="l00144"></a>00144 pEvent->data.mouse.icon >= 0) { -<a name="l00145"></a>00145 vScaleButtonClick(&pEvent->data.mouse, pDiag); -<a name="l00146"></a>00146 <span class="keywordflow">return</span> TRUE; -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 <span class="keywordflow">return</span> FALSE; -<a name="l00149"></a>00149 } <span class="comment">/* end of bMouseButtonClick */</span> -<a name="l00150"></a>00150 -<a name="l00151"></a>00151 <span class="comment">/*</span> -<a name="l00152"></a>00152 <span class="comment"> * bAutoRedrawWindow - the redraw is handled by the WIMP</span> -<a name="l00153"></a>00153 <span class="comment"> */</span> -<a name="l00154"></a>00154 <span class="keyword">static</span> BOOL -<a name="l00155"></a>00155 bAutoRedrawWindow(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00156"></a>00156 { -<a name="l00157"></a>00157 <span class="keywordflow">return</span> TRUE; -<a name="l00158"></a>00158 } <span class="comment">/* end of bAutoRedrawWindow */</span> -<a name="l00159"></a>00159 -<a name="l00160"></a>00160 <span class="keyword">static</span> BOOL -<a name="l00161"></a>00161 bSaveSelect(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00162"></a>00162 { -<a name="l00163"></a>00163 TRACE_MSG(<span class="stringliteral">"bSaveSelect"</span>); -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 fail(pEvent == NULL); -<a name="l00166"></a>00166 fail(pEvent->type != event_MENU); -<a name="l00167"></a>00167 fail(pvReference == NULL); -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 DBG_DEC(pEvent->data.selection[0]); -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 <span class="keywordflow">switch</span> (pEvent->data.selection[0]) { -<a name="l00172"></a>00172 <span class="keywordflow">case</span> SAVEMENU_SCALEVIEW: -<a name="l00173"></a>00173 <span class="keywordflow">return</span> bScaleOpenAction(pEvent, pvReference); -<a name="l00174"></a>00174 <span class="keywordflow">case</span> SAVEMENU_SAVEDRAW: -<a name="l00175"></a>00175 <span class="keywordflow">return</span> bSaveDrawfile(pEvent, pvReference); -<a name="l00176"></a>00176 <span class="keywordflow">case</span> SAVEMENU_SAVETEXT: -<a name="l00177"></a>00177 <span class="keywordflow">return</span> bSaveTextfile(pEvent, pvReference); -<a name="l00178"></a>00178 <span class="keywordflow">default</span>: -<a name="l00179"></a>00179 DBG_DEC(pEvent->data.selection[0]); -<a name="l00180"></a>00180 <span class="keywordflow">return</span> FALSE; -<a name="l00181"></a>00181 } -<a name="l00182"></a>00182 } <span class="comment">/* end of bSaveSelect */</span> -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 <span class="comment">/*</span> -<a name="l00185"></a>00185 <span class="comment"> * Create the window for the text from the given file</span> -<a name="l00186"></a>00186 <span class="comment"> */</span> -<a name="l00187"></a>00187 <span class="keyword">static</span> diagram_type * -<a name="l00188"></a>00188 pCreateTextWindow(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00189"></a>00189 { -<a name="l00190"></a>00190 diagram_type *pDiag; -<a name="l00191"></a>00191 -<a name="l00192"></a>00192 TRACE_MSG(<span class="stringliteral">"pCreateTextWindow"</span>); -<a name="l00193"></a>00193 -<a name="l00194"></a>00194 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00195"></a>00195 -<a name="l00196"></a>00196 <span class="comment">/* Create the diagram */</span> -<a name="l00197"></a>00197 pDiag = pCreateDiagram(szTask+1, szFilename); -<a name="l00198"></a>00198 <span class="keywordflow">if</span> (pDiag == NULL) { -<a name="l00199"></a>00199 werr(0, <span class="stringliteral">"Sorry, no new diagram object"</span>); -<a name="l00200"></a>00200 <span class="keywordflow">return</span> NULL; -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 -<a name="l00203"></a>00203 <span class="comment">/* Prepare a save menu for this diagram */</span> -<a name="l00204"></a>00204 pDiag->pSaveMenu = Menu_New(szTask+1, -<a name="l00205"></a>00205 <span class="stringliteral">">Scale view,"</span> -<a name="l00206"></a>00206 <span class="stringliteral">">Save (Drawfile) F3,"</span> -<a name="l00207"></a>00207 <span class="stringliteral">">Save (Text only) \213F3"</span>); -<a name="l00208"></a>00208 <span class="keywordflow">if</span> (pDiag->pSaveMenu == NULL) { -<a name="l00209"></a>00209 werr(1, <span class="stringliteral">"Sorry, no Savemenu object"</span>); -<a name="l00210"></a>00210 } -<a name="l00211"></a>00211 Menu_Warn(pDiag->pSaveMenu, SAVEMENU_SCALEVIEW, -<a name="l00212"></a>00212 TRUE, bScaleOpenAction, pDiag); -<a name="l00213"></a>00213 Menu_Warn(pDiag->pSaveMenu, SAVEMENU_SAVEDRAW, -<a name="l00214"></a>00214 TRUE, bSaveDrawfile, pDiag); -<a name="l00215"></a>00215 Menu_Warn(pDiag->pSaveMenu, SAVEMENU_SAVETEXT, -<a name="l00216"></a>00216 TRUE, bSaveTextfile, pDiag); -<a name="l00217"></a>00217 -<a name="l00218"></a>00218 <span class="comment">/* Claim events for the main window */</span> -<a name="l00219"></a>00219 Event_Claim(event_REDRAW, pDiag->tMainWindow, icon_ANY, -<a name="l00220"></a>00220 bRedrawMainWindow, pDiag); -<a name="l00221"></a>00221 Event_Claim(event_CLOSE, pDiag->tMainWindow, icon_ANY, -<a name="l00222"></a>00222 bDestroyDiagram, pDiag); -<a name="l00223"></a>00223 Event_Claim(event_CLICK, pDiag->tMainWindow, icon_ANY, -<a name="l00224"></a>00224 bMouseButtonClick, pDiag); -<a name="l00225"></a>00225 Event_Claim(event_KEY, pDiag->tMainWindow, icon_ANY, -<a name="l00226"></a>00226 bMainKeyPressed, pDiag); -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 <span class="comment">/* Claim events for the scale window */</span> -<a name="l00229"></a>00229 Event_Claim(event_REDRAW, pDiag->tScaleWindow, icon_ANY, -<a name="l00230"></a>00230 bAutoRedrawWindow, NULL); -<a name="l00231"></a>00231 Event_Claim(event_CLICK, pDiag->tScaleWindow, icon_ANY, -<a name="l00232"></a>00232 bMouseButtonClick, pDiag); -<a name="l00233"></a>00233 Event_Claim(event_KEY, pDiag->tScaleWindow, icon_ANY, -<a name="l00234"></a>00234 bScaleKeyPressed, pDiag); -<a name="l00235"></a>00235 -<a name="l00236"></a>00236 <span class="comment">/* Set the window title */</span> -<a name="l00237"></a>00237 vSetTitle(pDiag); -<a name="l00238"></a>00238 <span class="keywordflow">return</span> pDiag; -<a name="l00239"></a>00239 } <span class="comment">/* end of pCreateTextWindow */</span> -<a name="l00240"></a>00240 -<a name="l00241"></a>00241 <span class="comment">/*</span> -<a name="l00242"></a>00242 <span class="comment"> * vProcessFile - process one file</span> -<a name="l00243"></a>00243 <span class="comment"> */</span> -<a name="l00244"></a>00244 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00245"></a>00245 vProcessFile(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename, <span class="keywordtype">int</span> iFiletype) -<a name="l00246"></a>00246 { -<a name="l00247"></a>00247 options_type tOptions; -<a name="l00248"></a>00248 FILE *pFile; -<a name="l00249"></a>00249 diagram_type *pDiag; -<a name="l00250"></a>00250 <span class="keywordtype">long</span> lFilesize; -<a name="l00251"></a>00251 <span class="keywordtype">int</span> iWordVersion; -<a name="l00252"></a>00252 -<a name="l00253"></a>00253 TRACE_MSG(<span class="stringliteral">"vProcessFile"</span>); -<a name="l00254"></a>00254 -<a name="l00255"></a>00255 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00256"></a>00256 -<a name="l00257"></a>00257 DBG_MSG(szFilename); -<a name="l00258"></a>00258 -<a name="l00259"></a>00259 pFile = fopen(szFilename, <span class="stringliteral">"rb"</span>); -<a name="l00260"></a>00260 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00261"></a>00261 werr(0, <span class="stringliteral">"I can't open '%s' for reading"</span>, szFilename); -<a name="l00262"></a>00262 <span class="keywordflow">return</span>; -<a name="l00263"></a>00263 } -<a name="l00264"></a>00264 -<a name="l00265"></a>00265 lFilesize = lGetFilesize(szFilename); -<a name="l00266"></a>00266 <span class="keywordflow">if</span> (lFilesize < 0) { -<a name="l00267"></a>00267 (void)fclose(pFile); -<a name="l00268"></a>00268 werr(0, <span class="stringliteral">"I can't get the size of '%s'"</span>, szFilename); -<a name="l00269"></a>00269 <span class="keywordflow">return</span>; -<a name="l00270"></a>00270 } -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 iWordVersion = iGuessVersionNumber(pFile, lFilesize); -<a name="l00273"></a>00273 <span class="keywordflow">if</span> (iWordVersion < 0 || iWordVersion == 3) { -<a name="l00274"></a>00274 <span class="keywordflow">if</span> (bIsRtfFile(pFile)) { -<a name="l00275"></a>00275 werr(0, <span class="stringliteral">"%s is not a Word Document."</span> -<a name="l00276"></a>00276 <span class="stringliteral">" It is probably a Rich Text Format file"</span>, -<a name="l00277"></a>00277 szFilename); -<a name="l00278"></a>00278 } <span class="keywordflow">if</span> (bIsWordPerfectFile(pFile)) { -<a name="l00279"></a>00279 werr(0, <span class="stringliteral">"%s is not a Word Document."</span> -<a name="l00280"></a>00280 <span class="stringliteral">" It is probably a Word Perfect file"</span>, -<a name="l00281"></a>00281 szFilename); -<a name="l00282"></a>00282 } <span class="keywordflow">else</span> { -<a name="l00283"></a>00283 werr(0, <span class="stringliteral">"%s is not a Word Document."</span>, szFilename); -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 (void)fclose(pFile); -<a name="l00286"></a>00286 <span class="keywordflow">return</span>; -<a name="l00287"></a>00287 } -<a name="l00288"></a>00288 <span class="comment">/* Reset any reading done during file-testing */</span> -<a name="l00289"></a>00289 rewind(pFile); -<a name="l00290"></a>00290 -<a name="l00291"></a>00291 <span class="keywordflow">if</span> (iFiletype != FILETYPE_MSWORD) { -<a name="l00292"></a>00292 vGetOptions(&tOptions); -<a name="l00293"></a>00293 <span class="keywordflow">if</span> (tOptions.bAutofiletypeAllowed) { -<a name="l00294"></a>00294 vSetFiletype(szFilename, FILETYPE_MSWORD); -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 } -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 pDiag = pCreateTextWindow(szFilename); -<a name="l00299"></a>00299 <span class="keywordflow">if</span> (pDiag == NULL) { -<a name="l00300"></a>00300 (void)fclose(pFile); -<a name="l00301"></a>00301 <span class="keywordflow">return</span>; -<a name="l00302"></a>00302 } -<a name="l00303"></a>00303 -<a name="l00304"></a>00304 (void)bWordDecryptor(pFile, lFilesize, pDiag); -<a name="l00305"></a>00305 Error_CheckFatal(Drawfile_VerifyDiagram(&pDiag->tInfo)); -<a name="l00306"></a>00306 vShowDiagram(pDiag); -<a name="l00307"></a>00307 TRACE_MSG(<span class="stringliteral">"After vShowDiagram"</span>); -<a name="l00308"></a>00308 -<a name="l00309"></a>00309 TRACE_MSG(<span class="stringliteral">"before debug print"</span>); -<a name="l00310"></a>00310 DBG_HEX(pFile); -<a name="l00311"></a>00311 TRACE_MSG(<span class="stringliteral">"before fclose"</span>); -<a name="l00312"></a>00312 (void)fclose(pFile); -<a name="l00313"></a>00313 TRACE_MSG(<span class="stringliteral">"after fclose"</span>); -<a name="l00314"></a>00314 } <span class="comment">/* end of vProcessFile */</span> -<a name="l00315"></a>00315 -<a name="l00316"></a>00316 <span class="comment">/*</span> -<a name="l00317"></a>00317 <span class="comment"> * vSendAck - send an acknowledge</span> -<a name="l00318"></a>00318 <span class="comment"> */</span> -<a name="l00319"></a>00319 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00320"></a>00320 vSendAck(event_pollblock *pEvent) -<a name="l00321"></a>00321 { -<a name="l00322"></a>00322 message_block tMessage; -<a name="l00323"></a>00323 -<a name="l00324"></a>00324 TRACE_MSG(<span class="stringliteral">"vSendAck"</span>); -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 fail(pEvent == NULL); -<a name="l00327"></a>00327 fail(pEvent->type != event_SEND && pEvent->type != event_SENDWANTACK); -<a name="l00328"></a>00328 fail(pEvent->data.message.header.action != message_DATALOAD && -<a name="l00329"></a>00329 pEvent->data.message.header.action != message_DATAOPEN); -<a name="l00330"></a>00330 -<a name="l00331"></a>00331 tMessage.header.action = message_DATALOADACK; -<a name="l00332"></a>00332 tMessage.header.size = <span class="keyword">sizeof</span>(tMessage); -<a name="l00333"></a>00333 tMessage.header.yourref = pEvent->data.message.header.myref; -<a name="l00334"></a>00334 Error_CheckFatal(Wimp_SendMessage(event_SEND, &tMessage, -<a name="l00335"></a>00335 pEvent->data.message.header.sender, 0)); -<a name="l00336"></a>00336 } <span class="comment">/* end of vSendAck */</span> -<a name="l00337"></a>00337 -<a name="l00338"></a>00338 <span class="keyword">static</span> BOOL -<a name="l00339"></a>00339 bEventMsgHandler(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00340"></a>00340 { -<a name="l00341"></a>00341 TRACE_MSG(<span class="stringliteral">"bEventMsgHandler"</span>); -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 fail(pEvent == NULL); -<a name="l00344"></a>00344 -<a name="l00345"></a>00345 <span class="keywordflow">switch</span> (pEvent->type) { -<a name="l00346"></a>00346 <span class="keywordflow">case</span> event_SEND: -<a name="l00347"></a>00347 <span class="keywordflow">case</span> event_SENDWANTACK: -<a name="l00348"></a>00348 <span class="keywordflow">switch</span> (pEvent->data.message.header.action) { -<a name="l00349"></a>00349 <span class="keywordflow">case</span> message_CLOSEDOWN: -<a name="l00350"></a>00350 exit(EXIT_SUCCESS); -<a name="l00351"></a>00351 <span class="keywordflow">break</span>; -<a name="l00352"></a>00352 <span class="keywordflow">case</span> message_DATALOAD: -<a name="l00353"></a>00353 <span class="keywordflow">case</span> message_DATAOPEN: -<a name="l00354"></a>00354 vProcessFile( -<a name="l00355"></a>00355 pEvent->data.message.data.dataload.filename, -<a name="l00356"></a>00356 pEvent->data.message.data.dataload.filetype); -<a name="l00357"></a>00357 vSendAck(pEvent); -<a name="l00358"></a>00358 <span class="keywordflow">break</span>; -<a name="l00359"></a>00359 <span class="keywordflow">default</span>: -<a name="l00360"></a>00360 DBG_DEC(pEvent->data.message.header.action); -<a name="l00361"></a>00361 <span class="keywordflow">break</span>; -<a name="l00362"></a>00362 } -<a name="l00363"></a>00363 <span class="keywordflow">return</span> TRUE; -<a name="l00364"></a>00364 <span class="keywordflow">default</span>: -<a name="l00365"></a>00365 DBG_DEC(pEvent->type); -<a name="l00366"></a>00366 <span class="keywordflow">return</span> FALSE; -<a name="l00367"></a>00367 } -<a name="l00368"></a>00368 } <span class="comment">/* end of bEventMsgHandler */</span> -<a name="l00369"></a>00369 -<a name="l00370"></a>00370 <span class="comment">/*</span> -<a name="l00371"></a>00371 <span class="comment"> * bMenuSelect - select from the iconbar menu</span> -<a name="l00372"></a>00372 <span class="comment"> */</span> -<a name="l00373"></a>00373 <span class="keyword">static</span> BOOL -<a name="l00374"></a>00374 bMenuSelect(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00375"></a>00375 { -<a name="l00376"></a>00376 TRACE_MSG(<span class="stringliteral">"bMenuSelect"</span>); -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 fail(pEvent == NULL); -<a name="l00379"></a>00379 fail(pEvent->type != event_MENU); -<a name="l00380"></a>00380 -<a name="l00381"></a>00381 DBG_DEC(pEvent->data.selection[0]); -<a name="l00382"></a>00382 -<a name="l00383"></a>00383 <span class="keywordflow">switch</span> (pEvent->data.selection[0]) { -<a name="l00384"></a>00384 <span class="keywordflow">case</span> ICONBAR_INFO_FIELD: -<a name="l00385"></a>00385 <span class="keywordflow">return</span> bBarInfo(pEvent, pvReference); -<a name="l00386"></a>00386 <span class="keywordflow">case</span> ICONBAR_CHOICES_FIELD: -<a name="l00387"></a>00387 vChoicesOpenAction(tChoicesWindow); -<a name="l00388"></a>00388 Window_BringToFront(tChoicesWindow); -<a name="l00389"></a>00389 <span class="keywordflow">break</span>; -<a name="l00390"></a>00390 <span class="keywordflow">case</span> ICONBAR_QUIT_FIELD: -<a name="l00391"></a>00391 TRACE_MSG(<span class="stringliteral">"before exit"</span>); -<a name="l00392"></a>00392 exit(EXIT_SUCCESS); -<a name="l00393"></a>00393 <span class="keywordflow">break</span>; -<a name="l00394"></a>00394 <span class="keywordflow">default</span>: -<a name="l00395"></a>00395 DBG_DEC(pEvent->data.selection[0]); -<a name="l00396"></a>00396 <span class="keywordflow">break</span>; -<a name="l00397"></a>00397 } -<a name="l00398"></a>00398 <span class="keywordflow">return</span> TRUE; -<a name="l00399"></a>00399 } <span class="comment">/* end of bMenuSelect */</span> -<a name="l00400"></a>00400 -<a name="l00401"></a>00401 <span class="comment">/*</span> -<a name="l00402"></a>00402 <span class="comment"> * bMenuClick - respond to an menu click</span> -<a name="l00403"></a>00403 <span class="comment"> */</span> -<a name="l00404"></a>00404 <span class="keyword">static</span> BOOL -<a name="l00405"></a>00405 bMenuClick(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00406"></a>00406 { -<a name="l00407"></a>00407 TRACE_MSG(<span class="stringliteral">"bMenuClick"</span>); -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 fail(pEvent == NULL); -<a name="l00410"></a>00410 fail(pEvent->type != event_MENU); -<a name="l00411"></a>00411 -<a name="l00412"></a>00412 <span class="keywordflow">if</span> (menu_currentopen == tDummyDiagram.pSaveMenu) { -<a name="l00413"></a>00413 <span class="keywordflow">return</span> bMenuSelect(pEvent, pvReference); -<a name="l00414"></a>00414 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pvReference == NULL) { -<a name="l00415"></a>00415 <span class="keywordflow">return</span> FALSE; -<a name="l00416"></a>00416 } -<a name="l00417"></a>00417 <span class="keywordflow">return</span> bSaveSelect(pEvent, pvReference); -<a name="l00418"></a>00418 } <span class="comment">/* end of bMenuClick */</span> -<a name="l00419"></a>00419 -<a name="l00420"></a>00420 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00421"></a>00421 vTemplates(<span class="keywordtype">void</span>) -<a name="l00422"></a>00422 { -<a name="l00423"></a>00423 TRACE_MSG(<span class="stringliteral">"vTemplates"</span>); -<a name="l00424"></a>00424 -<a name="l00425"></a>00425 Template_Initialise(); -<a name="l00426"></a>00426 Template_LoadFile(<span class="stringliteral">"Templates"</span>); -<a name="l00427"></a>00427 -<a name="l00428"></a>00428 tChoicesWindow = Window_Create(<span class="stringliteral">"Choices"</span>, template_TITLEMIN); -<a name="l00429"></a>00429 <span class="keywordflow">if</span> (tChoicesWindow == 0) { -<a name="l00430"></a>00430 werr(1, <span class="stringliteral">"I can't find the 'Choices' template"</span>); -<a name="l00431"></a>00431 } -<a name="l00432"></a>00432 -<a name="l00433"></a>00433 <span class="comment">/* Claim events for the choices window */</span> -<a name="l00434"></a>00434 Event_Claim(event_REDRAW, tChoicesWindow, icon_ANY, -<a name="l00435"></a>00435 bAutoRedrawWindow, NULL); -<a name="l00436"></a>00436 Event_Claim(event_CLICK, tChoicesWindow, icon_ANY, -<a name="l00437"></a>00437 bChoicesMouseClick, NULL); -<a name="l00438"></a>00438 Event_Claim(event_KEY, tChoicesWindow, icon_ANY, -<a name="l00439"></a>00439 bChoicesKeyPressed, NULL); -<a name="l00440"></a>00440 } <span class="comment">/* end of vTemplates */</span> -<a name="l00441"></a>00441 -<a name="l00442"></a>00442 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00443"></a>00443 vInitialise(<span class="keywordtype">void</span>) -<a name="l00444"></a>00444 { -<a name="l00445"></a>00445 <span class="keywordtype">int</span> aiMessages[] = {0}; -<a name="l00446"></a>00446 icon_handle tBarIcon; -<a name="l00447"></a>00447 -<a name="l00448"></a>00448 -<a name="l00449"></a>00449 TRACE_MSG(<span class="stringliteral">"vInitialise"</span>); -<a name="l00450"></a>00450 -<a name="l00451"></a>00451 Resource_Initialise(szTask+1); -<a name="l00452"></a>00452 Event_Initialise3(szTask+1, 310, aiMessages); -<a name="l00453"></a>00453 EventMsg_Initialise(); -<a name="l00454"></a>00454 Screen_CacheModeInfo(); -<a name="l00455"></a>00455 <span class="preprocessor">#if defined(__GNUC__)</span> -<a name="l00456"></a>00456 <span class="preprocessor"></span> flex_init(szTask+1, 0, 0); -<a name="l00457"></a>00457 flex_set_budge(1); -<a name="l00458"></a>00458 <span class="preprocessor">#endif </span><span class="comment">/* __GNUC__ */</span> -<a name="l00459"></a>00459 vTemplates(); -<a name="l00460"></a>00460 -<a name="l00461"></a>00461 <span class="comment">/* Prepare iconbar menu */</span> -<a name="l00462"></a>00462 tDummyDiagram.tInfo.data = NULL; -<a name="l00463"></a>00463 tDummyDiagram.tInfo.length = 0; -<a name="l00464"></a>00464 tDummyDiagram.pSaveMenu = Menu_New(szTask+1, <span class="stringliteral">">Info,Choices...,Quit"</span>); -<a name="l00465"></a>00465 <span class="keywordflow">if</span> (tDummyDiagram.pSaveMenu == NULL) { -<a name="l00466"></a>00466 werr(1, <span class="stringliteral">"Sorry, no Barmenu object"</span>); -<a name="l00467"></a>00467 } -<a name="l00468"></a>00468 pInfoBox = Dialog2_CreateDialogBlock(<span class="stringliteral">"ProgInfo"</span>, -1, -1, -<a name="l00469"></a>00469 vBarInfoSetText, NULL, NULL); -<a name="l00470"></a>00470 -<a name="l00471"></a>00471 <span class="keywordflow">if</span> (pInfoBox == NULL) { -<a name="l00472"></a>00472 werr(1, <span class="stringliteral">"Sorry, no Infobox object"</span>); -<a name="l00473"></a>00473 } -<a name="l00474"></a>00474 Menu_Warn(tDummyDiagram.pSaveMenu, ICONBAR_INFO_FIELD, -<a name="l00475"></a>00475 TRUE, bBarInfo, &tDummyDiagram); -<a name="l00476"></a>00476 -<a name="l00477"></a>00477 <span class="comment">/* Create an icon on the icon bar */</span> -<a name="l00478"></a>00478 tBarIcon = Icon_BarIcon(szTask, iconbar_RIGHT); -<a name="l00479"></a>00479 Event_Claim(event_CLICK, window_ICONBAR, tBarIcon, -<a name="l00480"></a>00480 bMouseButtonClick, &tDummyDiagram); -<a name="l00481"></a>00481 -<a name="l00482"></a>00482 <span class="comment">/* Generic claims */</span> -<a name="l00483"></a>00483 Event_Claim(event_OPEN, window_ANY, icon_ANY, -<a name="l00484"></a>00484 Handler_OpenWindow, NULL); -<a name="l00485"></a>00485 Event_Claim(event_CLOSE, window_ANY, icon_ANY, -<a name="l00486"></a>00486 Handler_CloseWindow, NULL); -<a name="l00487"></a>00487 Event_Claim(event_MENU, window_ANY, icon_ANY, -<a name="l00488"></a>00488 bMenuClick, NULL); -<a name="l00489"></a>00489 EventMsg_Claim(message_DATALOAD, window_ICONBAR, -<a name="l00490"></a>00490 bEventMsgHandler, NULL); -<a name="l00491"></a>00491 EventMsg_Claim(message_MODECHANGE, window_ANY, -<a name="l00492"></a>00492 Handler_ModeChange, NULL); -<a name="l00493"></a>00493 } <span class="comment">/* end of vInitialise */</span> -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 <span class="keywordtype">int</span> -<a name="l00496"></a>00496 <a class="code" href="redirectprintf_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) -<a name="l00497"></a>00497 { -<a name="l00498"></a>00498 <span class="keywordtype">int</span> iFirst, iFiletype; -<a name="l00499"></a>00499 -<a name="l00500"></a>00500 TRACE_MSG(<span class="stringliteral">"main"</span>); -<a name="l00501"></a>00501 -<a name="l00502"></a>00502 vInitialise(); -<a name="l00503"></a>00503 iFirst = iReadOptions(argc, argv); -<a name="l00504"></a>00504 <span class="keywordflow">if</span> (iFirst != 1) { -<a name="l00505"></a>00505 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00506"></a>00506 } -<a name="l00507"></a>00507 -<a name="l00508"></a>00508 <span class="keywordflow">if</span> (argc > 1) { -<a name="l00509"></a>00509 iFiletype = iGetFiletype(argv[1]); -<a name="l00510"></a>00510 <span class="keywordflow">if</span> (iFiletype < 0) { -<a name="l00511"></a>00511 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00512"></a>00512 } -<a name="l00513"></a>00513 vProcessFile(argv[1], iFiletype); -<a name="l00514"></a>00514 TRACE_MSG(<span class="stringliteral">"main after vProcessFile"</span>); -<a name="l00515"></a>00515 } -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 <span class="keywordflow">for</span> (;;) { -<a name="l00518"></a>00518 Event_Poll(); -<a name="l00519"></a>00519 } -<a name="l00520"></a>00520 } <span class="comment">/* end of main */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/main__u_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/main_u.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/main_u.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * main_u.c</span> -<a name="l00003"></a>00003 <span class="comment"> *</span> -<a name="l00004"></a>00004 <span class="comment"> * Released under GPL</span> -<a name="l00005"></a>00005 <span class="comment"> *</span> -<a name="l00006"></a>00006 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or</span> -<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU General Public License</span> -<a name="l00010"></a>00010 <span class="comment"> * as published by the Free Software Foundation; either version 2</span> -<a name="l00011"></a>00011 <span class="comment"> * of the License, or (at your option) any later version.</span> -<a name="l00012"></a>00012 <span class="comment"> *</span> -<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> -<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> -<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> -<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span> -<a name="l00017"></a>00017 <span class="comment"> *</span> -<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span> -<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span> -<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span> -<a name="l00021"></a>00021 <span class="comment"> *</span> -<a name="l00022"></a>00022 <span class="comment"> * Description:</span> -<a name="l00023"></a>00023 <span class="comment"> * The main program of 'antiword' (Unix version)</span> -<a name="l00024"></a>00024 <span class="comment"> */</span> -<a name="l00025"></a>00025 <span class="preprocessor">#ifdef SYMBIAN</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="comment">//GCCE header</span> -<a name="l00027"></a>00027 <span class="comment">//#include <staticlibinit_gcce.h></span> -<a name="l00028"></a>00028 <span class="preprocessor">#include <string.h></span> -<a name="l00029"></a>00029 <span class="preprocessor">#endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 <span class="preprocessor">#include <stdio.h></span> -<a name="l00032"></a>00032 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00033"></a>00033 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#include <fcntl.h></span> -<a name="l00035"></a>00035 <span class="preprocessor">#include <io.h></span> -<a name="l00036"></a>00036 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00037"></a>00037 <span class="preprocessor">#if defined(__CYGWIN__) || defined(__CYGMING__)</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor"># ifdef X_LOCALE</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor"># include <X11/Xlocale.h></span> -<a name="l00040"></a>00040 <span class="preprocessor"># else</span> -<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor"># include <locale.h></span> -<a name="l00042"></a>00042 <span class="preprocessor"># endif</span> -<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#include <locale.h></span> -<a name="l00045"></a>00045 <span class="preprocessor">#endif </span><span class="comment">/* __CYGWIN__ || __CYGMING__ */</span> -<a name="l00046"></a>00046 <span class="preprocessor">#if defined(N_PLAT_NLM)</span> -<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#if !defined(_VA_LIST)</span> -<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#include "NW-only/nw_os.h"</span> -<a name="l00049"></a>00049 <span class="preprocessor">#endif </span><span class="comment">/* !_VA_LIST */</span> -<a name="l00050"></a>00050 <span class="preprocessor">#include "getopt.h"</span> -<a name="l00051"></a>00051 <span class="preprocessor">#endif </span><span class="comment">/* N_PLAT_NLM */</span> -<a name="l00052"></a>00052 <span class="preprocessor">#include "version.h"</span> -<a name="l00053"></a>00053 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00054"></a>00054 <span class="preprocessor">#include <unistd.h></span> -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 <span class="comment">/* The name of this program */</span> -<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szTask = NULL; -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00061"></a>00061 vUsage(<span class="keywordtype">void</span>) -<a name="l00062"></a>00062 { -<a name="l00063"></a>00063 fprintf(stderr, <span class="stringliteral">"\tName: %s\n"</span>, szTask); -<a name="l00064"></a>00064 fprintf(stderr, <span class="stringliteral">"\tPurpose: "</span>PURPOSESTRING<span class="stringliteral">"\n"</span>); -<a name="l00065"></a>00065 fprintf(stderr, <span class="stringliteral">"\tAuthor: "</span>AUTHORSTRING<span class="stringliteral">"\n"</span>); -<a name="l00066"></a>00066 fprintf(stderr, <span class="stringliteral">"\tVersion: "</span>VERSIONSTRING); -<a name="l00067"></a>00067 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00068"></a>00068 <span class="preprocessor"></span> fprintf(stderr, VERSIONSTRING2); -<a name="l00069"></a>00069 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00070"></a>00070 fprintf(stderr, <span class="stringliteral">"\n"</span>); -<a name="l00071"></a>00071 fprintf(stderr, <span class="stringliteral">"\tStatus: "</span>STATUSSTRING<span class="stringliteral">"\n"</span>); -<a name="l00072"></a>00072 fprintf(stderr, -<a name="l00073"></a>00073 <span class="stringliteral">"\tUsage: %s [switches] wordfile1 [wordfile2 ...]\n"</span>, szTask); -<a name="l00074"></a>00074 fprintf(stderr, -<a name="l00075"></a>00075 <span class="stringliteral">"\tSwitches: [-f|-t|-a papersize|-p papersize|-x dtd]"</span> -<a name="l00076"></a>00076 <span class="stringliteral">"[-m mapping][-w #][-i #][-Ls]\n"</span>); -<a name="l00077"></a>00077 fprintf(stderr, <span class="stringliteral">"\t-f formatted text output\n"</span>); -<a name="l00078"></a>00078 fprintf(stderr, <span class="stringliteral">"\t-t text output (default)\n"</span>); -<a name="l00079"></a>00079 fprintf(stderr, <span class="stringliteral">"\t-a <paper size name> Adobe PDF output\n"</span>); -<a name="l00080"></a>00080 fprintf(stderr, <span class="stringliteral">"\t-p <paper size name> PostScript output\n"</span>); -<a name="l00081"></a>00081 fprintf(stderr, <span class="stringliteral">"\t paper size like: a4, letter or legal\n"</span>); -<a name="l00082"></a>00082 fprintf(stderr, <span class="stringliteral">"\t-x <dtd> XML output\n"</span>); -<a name="l00083"></a>00083 fprintf(stderr, <span class="stringliteral">"\t like: db (DocBook)\n"</span>); -<a name="l00084"></a>00084 fprintf(stderr, <span class="stringliteral">"\t-m <mapping> character mapping file\n"</span>); -<a name="l00085"></a>00085 fprintf(stderr, <span class="stringliteral">"\t-w <width> in characters of text output\n"</span>); -<a name="l00086"></a>00086 fprintf(stderr, <span class="stringliteral">"\t-i <level> image level (PostScript only)\n"</span>); -<a name="l00087"></a>00087 fprintf(stderr, <span class="stringliteral">"\t-L use landscape mode (PostScript only)\n"</span>); -<a name="l00088"></a>00088 fprintf(stderr, <span class="stringliteral">"\t-r Show removed text\n"</span>); -<a name="l00089"></a>00089 fprintf(stderr, <span class="stringliteral">"\t-s Show hidden (by Word) text\n"</span>); -<a name="l00090"></a>00090 } <span class="comment">/* end of vUsage */</span> -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 <span class="comment">/*</span> -<a name="l00093"></a>00093 <span class="comment"> * pStdin2TmpFile - save stdin in a temporary file</span> -<a name="l00094"></a>00094 <span class="comment"> *</span> -<a name="l00095"></a>00095 <span class="comment"> * returns: the pointer to the temporary file or NULL</span> -<a name="l00096"></a>00096 <span class="comment"> */</span> -<a name="l00097"></a>00097 <span class="keyword">static</span> FILE * -<a name="l00098"></a>00098 pStdin2TmpFile(<span class="keywordtype">long</span> *lFilesize) -<a name="l00099"></a>00099 { -<a name="l00100"></a>00100 FILE *pTmpFile; -<a name="l00101"></a>00101 <span class="keywordtype">size_t</span> tSize; -<a name="l00102"></a>00102 BOOL bFailure; -<a name="l00103"></a>00103 UCHAR aucBytes[BUFSIZ]; -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 DBG_MSG(<span class="stringliteral">"pStdin2TmpFile"</span>); -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 fail(lFilesize == NULL); -<a name="l00108"></a>00108 -<a name="l00109"></a>00109 <span class="comment">/* Open the temporary file */</span> -<a name="l00110"></a>00110 pTmpFile = tmpfile(); -<a name="l00111"></a>00111 <span class="keywordflow">if</span> (pTmpFile == NULL) { -<a name="l00112"></a>00112 <span class="keywordflow">return</span> NULL; -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 -<a name="l00115"></a>00115 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00116"></a>00116 <span class="preprocessor"></span> <span class="comment">/* Stdin must be read as a binary stream */</span> -<a name="l00117"></a>00117 setmode(fileno(stdin), O_BINARY); -<a name="l00118"></a>00118 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00119"></a>00119 -<a name="l00120"></a>00120 <span class="comment">/* Copy stdin to the temporary file */</span> -<a name="l00121"></a>00121 *lFilesize = 0; -<a name="l00122"></a>00122 bFailure = TRUE; -<a name="l00123"></a>00123 <span class="keywordflow">for</span> (;;) { -<a name="l00124"></a>00124 tSize = fread(aucBytes, 1, <span class="keyword">sizeof</span>(aucBytes), stdin); -<a name="l00125"></a>00125 <span class="keywordflow">if</span> (tSize == 0) { -<a name="l00126"></a>00126 bFailure = feof(stdin) == 0; -<a name="l00127"></a>00127 <span class="keywordflow">break</span>; -<a name="l00128"></a>00128 } -<a name="l00129"></a>00129 <span class="keywordflow">if</span> (fwrite(aucBytes, 1, tSize, pTmpFile) != tSize) { -<a name="l00130"></a>00130 bFailure = TRUE; -<a name="l00131"></a>00131 <span class="keywordflow">break</span>; -<a name="l00132"></a>00132 } -<a name="l00133"></a>00133 *lFilesize += (long)tSize; -<a name="l00134"></a>00134 } -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00137"></a>00137 <span class="preprocessor"></span> <span class="comment">/* Switch stdin back to a text stream */</span> -<a name="l00138"></a>00138 setmode(fileno(stdin), O_TEXT); -<a name="l00139"></a>00139 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 <span class="comment">/* Deal with the result of the copy action */</span> -<a name="l00142"></a>00142 <span class="keywordflow">if</span> (bFailure) { -<a name="l00143"></a>00143 *lFilesize = 0; -<a name="l00144"></a>00144 (void)fclose(pTmpFile); -<a name="l00145"></a>00145 <span class="keywordflow">return</span> NULL; -<a name="l00146"></a>00146 } -<a name="l00147"></a>00147 rewind(pTmpFile); -<a name="l00148"></a>00148 <span class="keywordflow">return</span> pTmpFile; -<a name="l00149"></a>00149 } <span class="comment">/* end of pStdin2TmpFile */</span> -<a name="l00150"></a>00150 -<a name="l00151"></a>00151 <span class="comment">/*</span> -<a name="l00152"></a>00152 <span class="comment"> * bProcessFile - process a single file</span> -<a name="l00153"></a>00153 <span class="comment"> *</span> -<a name="l00154"></a>00154 <span class="comment"> * returns: TRUE when the given file is a supported Word file, otherwise FALSE</span> -<a name="l00155"></a>00155 <span class="comment"> */</span> -<a name="l00156"></a>00156 <span class="preprocessor">#ifndef SYMBIAN </span> -<a name="l00157"></a>00157 <span class="preprocessor"></span><span class="keyword">static</span> BOOL -<a name="l00158"></a>00158 bProcessFile(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename ) -<a name="l00159"></a>00159 <span class="preprocessor">#else</span> -<a name="l00160"></a>00160 <span class="preprocessor"></span><span class="keyword">static</span> BOOL -<a name="l00161"></a>00161 bProcessFile(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename, FILE *ofp) -<a name="l00162"></a>00162 <span class="preprocessor">#endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00163"></a>00163 { -<a name="l00164"></a>00164 FILE *pFile; -<a name="l00165"></a>00165 diagram_type *pDiag; -<a name="l00166"></a>00166 <span class="keywordtype">long</span> lFilesize; -<a name="l00167"></a>00167 <span class="keywordtype">int</span> iWordVersion; -<a name="l00168"></a>00168 BOOL bResult; -<a name="l00169"></a>00169 -<a name="l00170"></a>00170 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00171"></a>00171 -<a name="l00172"></a>00172 DBG_MSG(szFilename); -<a name="l00173"></a>00173 -<a name="l00174"></a>00174 <span class="keywordflow">if</span> (szFilename[0] == <span class="charliteral">'-'</span> && szFilename[1] == <span class="charliteral">'\0'</span>) { -<a name="l00175"></a>00175 pFile = pStdin2TmpFile(&lFilesize); -<a name="l00176"></a>00176 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00177"></a>00177 werr(0, <span class="stringliteral">"I can't save the standard input to a file"</span>); -<a name="l00178"></a>00178 <span class="keywordflow">return</span> FALSE; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 } <span class="keywordflow">else</span> { -<a name="l00181"></a>00181 pFile = fopen(szFilename, <span class="stringliteral">"rb"</span>); -<a name="l00182"></a>00182 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00183"></a>00183 werr(0, <span class="stringliteral">"I can't open '%s' for reading"</span>, szFilename); -<a name="l00184"></a>00184 <span class="keywordflow">return</span> FALSE; -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 lFilesize = lGetFilesize(szFilename); -<a name="l00188"></a>00188 <span class="keywordflow">if</span> (lFilesize < 0) { -<a name="l00189"></a>00189 (void)fclose(pFile); -<a name="l00190"></a>00190 werr(0, <span class="stringliteral">"I can't get the size of '%s'"</span>, szFilename); -<a name="l00191"></a>00191 <span class="keywordflow">return</span> FALSE; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 } -<a name="l00194"></a>00194 -<a name="l00195"></a>00195 iWordVersion = iGuessVersionNumber(pFile, lFilesize); -<a name="l00196"></a>00196 <span class="keywordflow">if</span> (iWordVersion < 0 || iWordVersion == 3) { -<a name="l00197"></a>00197 <span class="keywordflow">if</span> (bIsRtfFile(pFile)) { -<a name="l00198"></a>00198 werr(0, <span class="stringliteral">"%s is not a Word Document."</span> -<a name="l00199"></a>00199 <span class="stringliteral">" It is probably a Rich Text Format file"</span>, -<a name="l00200"></a>00200 szFilename); -<a name="l00201"></a>00201 } <span class="keywordflow">if</span> (bIsWordPerfectFile(pFile)) { -<a name="l00202"></a>00202 werr(0, <span class="stringliteral">"%s is not a Word Document."</span> -<a name="l00203"></a>00203 <span class="stringliteral">" It is probably a Word Perfect file"</span>, -<a name="l00204"></a>00204 szFilename); -<a name="l00205"></a>00205 } <span class="keywordflow">else</span> { -<a name="l00206"></a>00206 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00207"></a>00207 <span class="preprocessor"></span> werr(0, <span class="stringliteral">"%s is not a Word Document or the filename"</span> -<a name="l00208"></a>00208 <span class="stringliteral">" is not in the 8+3 format."</span>, szFilename); -<a name="l00209"></a>00209 <span class="preprocessor">#else</span> -<a name="l00210"></a>00210 <span class="preprocessor"></span> werr(0, <span class="stringliteral">"%s is not a Word Document."</span>, szFilename); -<a name="l00211"></a>00211 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00212"></a>00212 } -<a name="l00213"></a>00213 (void)fclose(pFile); -<a name="l00214"></a>00214 <span class="keywordflow">return</span> FALSE; -<a name="l00215"></a>00215 } -<a name="l00216"></a>00216 <span class="comment">/* Reset any reading done during file testing */</span> -<a name="l00217"></a>00217 rewind(pFile); -<a name="l00218"></a>00218 -<a name="l00219"></a>00219 <span class="preprocessor"> #ifndef SYMBIAN</span> -<a name="l00220"></a>00220 <span class="preprocessor"></span> pDiag = pCreateDiagram(szTask, szFilename); -<a name="l00221"></a>00221 <span class="preprocessor"> #else</span> -<a name="l00222"></a>00222 <span class="preprocessor"></span> pDiag = pCreateDiagram(szTask, szFilename, ofp ); -<a name="l00223"></a>00223 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00224"></a>00224 <span class="keywordflow">if</span> (pDiag == NULL) { -<a name="l00225"></a>00225 (void)fclose(pFile); -<a name="l00226"></a>00226 <span class="keywordflow">return</span> FALSE; -<a name="l00227"></a>00227 } -<a name="l00228"></a>00228 -<a name="l00229"></a>00229 bResult = bWordDecryptor(pFile, lFilesize, pDiag); -<a name="l00230"></a>00230 vDestroyDiagram(pDiag); -<a name="l00231"></a>00231 -<a name="l00232"></a>00232 (void)fclose(pFile); -<a name="l00233"></a>00233 <span class="keywordflow">return</span> bResult; -<a name="l00234"></a>00234 } <span class="comment">/* end of bProcessFile */</span> -<a name="l00235"></a>00235 -<a name="l00236"></a>00236 -<a name="l00237"></a>00237 <span class="preprocessor">#ifdef SYMBIAN</span> -<a name="l00238"></a>00238 <span class="preprocessor"></span><span class="keywordtype">int</span> fillArg( <span class="keywordtype">char</span> **argv, <span class="keywordtype">char</span> *inpStr) -<a name="l00239"></a>00239 { -<a name="l00240"></a>00240 <span class="keywordtype">int</span> count =0; -<a name="l00241"></a>00241 <span class="keyword">const</span> <span class="keywordtype">char</span> *search = <span class="stringliteral">" "</span>; -<a name="l00242"></a>00242 -<a name="l00243"></a>00243 <span class="keywordtype">char</span> *token = strtok( inpStr, search); -<a name="l00244"></a>00244 argv[0] = token; -<a name="l00245"></a>00245 count = 1; -<a name="l00246"></a>00246 <span class="keywordflow">while</span>( token != NULL ) -<a name="l00247"></a>00247 { -<a name="l00248"></a>00248 token = strtok( NULL, search); -<a name="l00249"></a>00249 argv[count++] = token; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 <span class="keywordflow">return</span> count-1; -<a name="l00252"></a>00252 } -<a name="l00253"></a>00253 <span class="preprocessor">#endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00254"></a>00254 <span class="keywordtype">int</span> -<a name="l00255"></a>00255 <a class="code" href="redirectprintf_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) -<a name="l00256"></a>00256 { -<a name="l00257"></a>00257 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00258"></a>00258 <span class="preprocessor"></span> FILE *ofp = NULL; -<a name="l00259"></a>00259 <span class="keywordtype">char</span> *buf; -<a name="l00260"></a>00260 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00261"></a>00261 -<a name="l00262"></a>00262 options_type tOptions; -<a name="l00263"></a>00263 <span class="keyword">const</span> <span class="keywordtype">char</span> *szWordfile; -<a name="l00264"></a>00264 <span class="keywordtype">int</span> iFirst, iIndex, iGoodCount; -<a name="l00265"></a>00265 BOOL bUsage, bMultiple, bUseTXT, bUseXML; -<a name="l00266"></a>00266 -<a name="l00267"></a>00267 <span class="keywordflow">if</span> (argc <= 0) { -<a name="l00268"></a>00268 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00269"></a>00269 } -<a name="l00270"></a>00270 -<a name="l00271"></a>00271 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00272"></a>00272 <span class="preprocessor"></span> <span class="comment">//Adding HOME environment Variable explicitly</span> -<a name="l00273"></a>00273 -<a name="l00274"></a>00274 buf = (<span class="keywordtype">char</span> *)malloc(FILENAME_MAX); -<a name="l00275"></a>00275 <span class="comment">// get path to the private folder</span> -<a name="l00276"></a>00276 getcwd(buf, FILENAME_MAX); -<a name="l00277"></a>00277 <span class="preprocessor"> #ifndef __WINS__</span> -<a name="l00278"></a>00278 <span class="preprocessor"></span> <span class="comment">// acquire installation location and get the drive letter </span> -<a name="l00279"></a>00279 buf[0] = argv[0][0]; <span class="comment">// argv[0] contains full path to exe including drive</span> -<a name="l00280"></a>00280 <span class="preprocessor"> #endif</span> -<a name="l00281"></a>00281 <span class="preprocessor"></span> -<a name="l00282"></a>00282 strcat(buf, <span class="stringliteral">"\\Resources\\"</span>); -<a name="l00283"></a>00283 <span class="keywordflow">if</span> (setenv(<span class="stringliteral">"HOME"</span>, buf, 1) != 0) { -<a name="l00284"></a>00284 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 free(buf); -<a name="l00287"></a>00287 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00288"></a>00288 -<a name="l00289"></a>00289 szTask = szBasename(argv[0]); -<a name="l00290"></a>00290 -<a name="l00291"></a>00291 <span class="keywordflow">if</span> (argc <= 1) { -<a name="l00292"></a>00292 <span class="preprocessor">#ifdef SYMBIAN</span> -<a name="l00293"></a>00293 <span class="preprocessor"></span> <span class="keywordtype">char</span>* inpStr = (<span class="keywordtype">char</span>*) malloc(_POSIX_ARG_MAX); -<a name="l00294"></a>00294 <span class="comment">/*If there is no command-line input, Prompt for it!*/</span> -<a name="l00295"></a>00295 vUsage(); -<a name="l00296"></a>00296 -<a name="l00297"></a>00297 fprintf(stdout, <span class="stringliteral">"\n\nEnter the input Command String:"</span>); -<a name="l00298"></a>00298 fgets( inpStr, _POSIX_ARG_MAX, stdin ); -<a name="l00299"></a>00299 -<a name="l00300"></a>00300 argc = fillArg( argv, inpStr); -<a name="l00301"></a>00301 <span class="comment">/* Check whether the first argument is valid or not */</span> -<a name="l00302"></a>00302 <span class="keywordflow">if</span> ( strcasecmp ( <span class="stringliteral">"antiword"</span>, argv[0])) -<a name="l00303"></a>00303 { -<a name="l00304"></a>00304 fprintf(stdout, <span class="stringliteral">"\nInvalid command syntax, Please read the syntax properly\n\n\n"</span>); -<a name="l00305"></a>00305 bUsage = TRUE; -<a name="l00306"></a>00306 getchar(); -<a name="l00307"></a>00307 } -<a name="l00308"></a>00308 <span class="keywordflow">else</span> -<a name="l00309"></a>00309 { -<a name="l00310"></a>00310 iFirst = iReadOptions(argc, argv); -<a name="l00311"></a>00311 bUsage = iFirst <= 0; -<a name="l00312"></a>00312 } -<a name="l00313"></a>00313 <span class="preprocessor"> #else </span> -<a name="l00314"></a>00314 <span class="preprocessor"></span> bUsage = TRUE; -<a name="l00315"></a>00315 iFirst = 1; -<a name="l00316"></a>00316 free(inputStr); -<a name="l00317"></a>00317 <span class="preprocessor">#endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00318"></a>00318 } <span class="keywordflow">else</span> { -<a name="l00319"></a>00319 iFirst = iReadOptions(argc, argv); -<a name="l00320"></a>00320 bUsage = iFirst <= 0; -<a name="l00321"></a>00321 } -<a name="l00322"></a>00322 <span class="keywordflow">if</span> (bUsage) { -<a name="l00323"></a>00323 vUsage(); -<a name="l00324"></a>00324 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00325"></a>00325 <span class="preprocessor"></span> getchar(); -<a name="l00326"></a>00326 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00327"></a>00327 <span class="keywordflow">return</span> iFirst < 0 ? EXIT_FAILURE : EXIT_SUCCESS; -<a name="l00328"></a>00328 } -<a name="l00329"></a>00329 -<a name="l00330"></a>00330 <span class="preprocessor">#if defined(N_PLAT_NLM) && !defined(_VA_LIST)</span> -<a name="l00331"></a>00331 <span class="preprocessor"></span> nwinit(); -<a name="l00332"></a>00332 <span class="preprocessor">#endif </span><span class="comment">/* N_PLAT_NLM && !_VA_LIST */</span> -<a name="l00333"></a>00333 -<a name="l00334"></a>00334 vGetOptions(&tOptions); -<a name="l00335"></a>00335 -<a name="l00336"></a>00336 <span class="preprocessor">#if !defined(__dos)</span> -<a name="l00337"></a>00337 <span class="preprocessor"></span> <span class="keywordflow">if</span> (is_locale_utf8()) { -<a name="l00338"></a>00338 <span class="preprocessor">#if defined(__STDC_ISO_10646__)</span> -<a name="l00339"></a>00339 <span class="preprocessor"></span> <span class="comment">/*</span> -<a name="l00340"></a>00340 <span class="comment"> * If the user wants UTF-8 and the envirionment variables</span> -<a name="l00341"></a>00341 <span class="comment"> * support UTF-8, than set the locale accordingly</span> -<a name="l00342"></a>00342 <span class="comment"> */</span> -<a name="l00343"></a>00343 <span class="keywordflow">if</span> (tOptions.eEncoding == encoding_utf_8) { -<a name="l00344"></a>00344 <span class="keywordflow">if</span> (setlocale(LC_CTYPE, <span class="stringliteral">""</span>) == NULL) { -<a name="l00345"></a>00345 werr(1, <span class="stringliteral">"Can't set the UTF-8 locale! "</span> -<a name="l00346"></a>00346 <span class="stringliteral">"Check LANG, LC_CTYPE, LC_ALL."</span>); -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 DBG_MSG(<span class="stringliteral">"The UTF-8 locale has been set"</span>); -<a name="l00349"></a>00349 } <span class="keywordflow">else</span> { -<a name="l00350"></a>00350 (void)setlocale(LC_CTYPE, <span class="stringliteral">"C"</span>); -<a name="l00351"></a>00351 } -<a name="l00352"></a>00352 <span class="preprocessor">#endif </span><span class="comment">/* __STDC_ISO_10646__ */</span> -<a name="l00353"></a>00353 } <span class="keywordflow">else</span> { -<a name="l00354"></a>00354 <span class="keywordflow">if</span> (setlocale(LC_CTYPE, <span class="stringliteral">""</span>) == NULL) { -<a name="l00355"></a>00355 werr(0, <span class="stringliteral">"Can't set the locale! Will use defaults"</span>); -<a name="l00356"></a>00356 (void)setlocale(LC_CTYPE, <span class="stringliteral">"C"</span>); -<a name="l00357"></a>00357 } -<a name="l00358"></a>00358 DBG_MSG(<span class="stringliteral">"The locale has been set"</span>); -<a name="l00359"></a>00359 } -<a name="l00360"></a>00360 <span class="preprocessor">#endif </span><span class="comment">/* !__dos */</span> -<a name="l00361"></a>00361 -<a name="l00362"></a>00362 bMultiple = argc - iFirst > 1; -<a name="l00363"></a>00363 bUseTXT = tOptions.eConversionType == conversion_text || -<a name="l00364"></a>00364 tOptions.eConversionType == conversion_fmt_text; -<a name="l00365"></a>00365 bUseXML = tOptions.eConversionType == conversion_xml; -<a name="l00366"></a>00366 iGoodCount = 0; -<a name="l00367"></a>00367 -<a name="l00368"></a>00368 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00369"></a>00369 <span class="preprocessor"></span> <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_pdf) { -<a name="l00370"></a>00370 <span class="comment">/* PDF must be written as a binary stream */</span> -<a name="l00371"></a>00371 setmode(fileno(stdout), O_BINARY); -<a name="l00372"></a>00372 } -<a name="l00373"></a>00373 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00374"></a>00374 -<a name="l00375"></a>00375 <span class="keywordflow">if</span> (bUseXML) { -<a name="l00376"></a>00376 fprintf(stdout, -<a name="l00377"></a>00377 <span class="stringliteral">"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"</span> -<a name="l00378"></a>00378 <span class="stringliteral">"<!DOCTYPE %s PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\"\n"</span> -<a name="l00379"></a>00379 <span class="stringliteral">"\t\"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\">\n"</span>, -<a name="l00380"></a>00380 bMultiple ? <span class="stringliteral">"set"</span> : <span class="stringliteral">"book"</span>); -<a name="l00381"></a>00381 <span class="keywordflow">if</span> (bMultiple) { -<a name="l00382"></a>00382 fprintf(stdout, <span class="stringliteral">"<set>\n"</span>); -<a name="l00383"></a>00383 } -<a name="l00384"></a>00384 } -<a name="l00385"></a>00385 -<a name="l00386"></a>00386 <span class="comment">//Output file</span> -<a name="l00387"></a>00387 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00388"></a>00388 <span class="preprocessor"></span> ofp = fopen( argv[argc-1], <span class="stringliteral">"w"</span>); -<a name="l00389"></a>00389 <span class="keywordflow">if</span> ( ofp == NULL) -<a name="l00390"></a>00390 { -<a name="l00391"></a>00391 printf(<span class="stringliteral">"Unable to open the output file: %s\n"</span>,argv[argc-1]); -<a name="l00392"></a>00392 exit(0); -<a name="l00393"></a>00393 } -<a name="l00394"></a>00394 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00395"></a>00395 -<a name="l00396"></a>00396 <span class="keywordflow">for</span> (iIndex = iFirst; iIndex < argc-1; iIndex++) { -<a name="l00397"></a>00397 <span class="keywordflow">if</span> (bMultiple && bUseTXT) { -<a name="l00398"></a>00398 szWordfile = szBasename(argv[iIndex]); -<a name="l00399"></a>00399 fprintf(stdout, <span class="stringliteral">"::::::::::::::\n"</span>); -<a name="l00400"></a>00400 fprintf(stdout, <span class="stringliteral">"%s\n"</span>, szWordfile); -<a name="l00401"></a>00401 fprintf(stdout, <span class="stringliteral">"::::::::::::::\n"</span>); -<a name="l00402"></a>00402 } -<a name="l00403"></a>00403 <span class="preprocessor"> #ifndef SYMBIAN</span> -<a name="l00404"></a>00404 <span class="preprocessor"></span> <span class="keywordflow">if</span> (bProcessFile(argv[iIndex])) { -<a name="l00405"></a>00405 <span class="preprocessor"> #else</span> -<a name="l00406"></a>00406 <span class="preprocessor"></span> <span class="keywordflow">if</span> (bProcessFile(argv[iIndex],ofp )) { -<a name="l00407"></a>00407 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 iGoodCount++; -<a name="l00410"></a>00410 } -<a name="l00411"></a>00411 } -<a name="l00412"></a>00412 -<a name="l00413"></a>00413 <span class="keywordflow">if</span> (bMultiple && bUseXML) { -<a name="l00414"></a>00414 fprintf(stdout, <span class="stringliteral">"</set>\n"</span>); -<a name="l00415"></a>00415 } -<a name="l00416"></a>00416 -<a name="l00417"></a>00417 DBG_DEC(iGoodCount); -<a name="l00418"></a>00418 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00419"></a>00419 <span class="preprocessor"></span> fclose(ofp); -<a name="l00420"></a>00420 fprintf(stdout, <span class="stringliteral">"\n\nConversion is successful!!, check out this file : %s\n"</span>, argv[argc-1]); -<a name="l00421"></a>00421 getchar(); -<a name="l00422"></a>00422 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 <span class="keywordflow">return</span> iGoodCount <= 0 ? EXIT_FAILURE : EXIT_SUCCESS; -<a name="l00425"></a>00425 } <span class="comment">/* end of main */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/misc_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,910 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/misc.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/misc.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * misc.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Miscellaneous functions</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include <ctype.h></span> -<a name="l00013"></a>00013 <span class="preprocessor">#include <time.h></span> -<a name="l00014"></a>00014 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#include "DeskLib:SWI.h"</span> -<a name="l00016"></a>00016 <span class="preprocessor">#else</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#include <errno.h></span> -<a name="l00018"></a>00018 <span class="preprocessor">#include <sys/types.h></span> -<a name="l00019"></a>00019 <span class="preprocessor">#include <sys/stat.h></span> -<a name="l00020"></a>00020 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00021"></a>00021 <span class="preprocessor">#if !defined(S_ISREG)</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !S_ISREG */</span> -<a name="l00024"></a>00024 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00025"></a>00025 <span class="preprocessor">#if defined(__vms)</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#include <unixlib.h></span> -<a name="l00027"></a>00027 <span class="preprocessor">#endif</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span> -<a name="l00029"></a>00029 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00031"></a>00031 <span class="comment"> * szGetHomeDirectory - get the name of the home directory</span> -<a name="l00032"></a>00032 <span class="comment"> */</span> -<a name="l00033"></a>00033 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00034"></a>00034 szGetHomeDirectory(<span class="keywordtype">void</span>) -<a name="l00035"></a>00035 { -<a name="l00036"></a>00036 <span class="keyword">const</span> <span class="keywordtype">char</span> *szHome; -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 <span class="preprocessor">#if defined(__vms)</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span> szHome = decc$translate_vms(getenv(<span class="stringliteral">"HOME"</span>)); -<a name="l00040"></a>00040 <span class="preprocessor">#elif defined(__Plan9__)</span> -<a name="l00041"></a>00041 <span class="preprocessor"></span> szHome = getenv(<span class="stringliteral">"home"</span>); -<a name="l00042"></a>00042 <span class="preprocessor">#else</span> -<a name="l00043"></a>00043 <span class="preprocessor"></span> szHome = getenv(<span class="stringliteral">"HOME"</span>); -<a name="l00044"></a>00044 <span class="preprocessor">#endif </span><span class="comment">/* __vms */</span> -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="keywordflow">if</span> (szHome == NULL || szHome[0] == <span class="charliteral">'\0'</span>) { -<a name="l00047"></a>00047 <span class="preprocessor">#if defined(N_PLAT_NLM)</span> -<a name="l00048"></a>00048 <span class="preprocessor"></span> szHome = <span class="stringliteral">"SYS:"</span>; -<a name="l00049"></a>00049 <span class="preprocessor">#elif defined(__dos)</span> -<a name="l00050"></a>00050 <span class="preprocessor"></span> szHome = <span class="stringliteral">"C:"</span>; -<a name="l00051"></a>00051 <span class="preprocessor">#else</span> -<a name="l00052"></a>00052 <span class="preprocessor"></span> werr(0, <span class="stringliteral">"I can't find the name of your HOME directory"</span>); -<a name="l00053"></a>00053 szHome = <span class="stringliteral">""</span>; -<a name="l00054"></a>00054 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 <span class="keywordflow">return</span> szHome; -<a name="l00057"></a>00057 } <span class="comment">/* end of szGetHomeDirectory */</span> -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 <span class="comment">/*</span> -<a name="l00060"></a>00060 <span class="comment"> * szGetAntiwordDirectory - get the name of the Antiword directory</span> -<a name="l00061"></a>00061 <span class="comment"> */</span> -<a name="l00062"></a>00062 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00063"></a>00063 szGetAntiwordDirectory(<span class="keywordtype">void</span>) -<a name="l00064"></a>00064 { -<a name="l00065"></a>00065 <span class="preprocessor">#if defined(__vms)</span> -<a name="l00066"></a>00066 <span class="preprocessor"></span> <span class="keywordflow">return</span> decc$translate_vms(getenv(<span class="stringliteral">"ANTIWORDHOME"</span>)); -<a name="l00067"></a>00067 <span class="preprocessor">#else</span> -<a name="l00068"></a>00068 <span class="preprocessor"></span> <span class="keywordflow">return</span> getenv(<span class="stringliteral">"ANTIWORDHOME"</span>); -<a name="l00069"></a>00069 <span class="preprocessor">#endif </span><span class="comment">/* __vms */</span> -<a name="l00070"></a>00070 } <span class="comment">/* end of szGetAntiwordDirectory */</span> -<a name="l00071"></a>00071 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="comment">/*</span> -<a name="l00074"></a>00074 <span class="comment"> * Get the size of the specified file.</span> -<a name="l00075"></a>00075 <span class="comment"> * Returns -1 if the file does not exist or is not a proper file.</span> -<a name="l00076"></a>00076 <span class="comment"> */</span> -<a name="l00077"></a>00077 <span class="keywordtype">long</span> -<a name="l00078"></a>00078 lGetFilesize(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00079"></a>00079 { -<a name="l00080"></a>00080 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00081"></a>00081 <span class="preprocessor"></span> os_error *e; -<a name="l00082"></a>00082 <span class="keywordtype">int</span> iType, iSize; -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 e = SWI(2, 5, SWI_OS_File | XOS_Bit, -<a name="l00085"></a>00085 17, szFilename, -<a name="l00086"></a>00086 &iType, NULL, NULL, NULL, &iSize); -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00088"></a>00088 werr(0, <span class="stringliteral">"Get Filesize error %d: %s"</span>, -<a name="l00089"></a>00089 e->errnum, e->errmess); -<a name="l00090"></a>00090 <span class="keywordflow">return</span> -1; -<a name="l00091"></a>00091 } -<a name="l00092"></a>00092 <span class="keywordflow">if</span> (iType != 1) { -<a name="l00093"></a>00093 <span class="comment">/* It's not a proper file or the file does not exist */</span> -<a name="l00094"></a>00094 <span class="keywordflow">return</span> -1; -<a name="l00095"></a>00095 } -<a name="l00096"></a>00096 <span class="keywordflow">return</span> (<span class="keywordtype">long</span>)iSize; -<a name="l00097"></a>00097 <span class="preprocessor">#else</span> -<a name="l00098"></a>00098 <span class="preprocessor"></span> <span class="keyword">struct </span>stat tBuffer; -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 errno = 0; -<a name="l00101"></a>00101 <span class="keywordflow">if</span> (stat(szFilename, &tBuffer) != 0) { -<a name="l00102"></a>00102 werr(0, <span class="stringliteral">"Get Filesize error %d"</span>, errno); -<a name="l00103"></a>00103 <span class="keywordflow">return</span> -1; -<a name="l00104"></a>00104 } -<a name="l00105"></a>00105 <span class="keywordflow">if</span> (!S_ISREG(tBuffer.st_mode)) { -<a name="l00106"></a>00106 <span class="comment">/* It's not a regular file */</span> -<a name="l00107"></a>00107 <span class="keywordflow">return</span> -1; -<a name="l00108"></a>00108 } -<a name="l00109"></a>00109 <span class="keywordflow">return</span> (<span class="keywordtype">long</span>)tBuffer.st_size; -<a name="l00110"></a>00110 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00111"></a>00111 } <span class="comment">/* end of lGetFilesize */</span> -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="keywordtype">void</span> -<a name="l00115"></a>00115 vPrintBlock(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFile, <span class="keywordtype">int</span> iLine, -<a name="l00116"></a>00116 <span class="keyword">const</span> UCHAR *aucBlock, <span class="keywordtype">size_t</span> tLength) -<a name="l00117"></a>00117 { -<a name="l00118"></a>00118 <span class="keywordtype">int</span> i, j; -<a name="l00119"></a>00119 -<a name="l00120"></a>00120 fail(szFile == NULL || iLine < 0 || aucBlock == NULL); -<a name="l00121"></a>00121 -<a name="l00122"></a>00122 fprintf(stderr, <span class="stringliteral">"%s[%3d]:\n"</span>, szFile, iLine); -<a name="l00123"></a>00123 <span class="keywordflow">for</span> (i = 0; i < 32; i++) { -<a name="l00124"></a>00124 <span class="keywordflow">if</span> (16 * i >= (<span class="keywordtype">int</span>)tLength) { -<a name="l00125"></a>00125 <span class="keywordflow">return</span>; -<a name="l00126"></a>00126 } -<a name="l00127"></a>00127 fprintf(stderr, <span class="stringliteral">"%03x: "</span>, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)(16 * i)); -<a name="l00128"></a>00128 <span class="keywordflow">for</span> (j = 0; j < 16; j++) { -<a name="l00129"></a>00129 <span class="keywordflow">if</span> (16 * i + j < (<span class="keywordtype">int</span>)tLength) { -<a name="l00130"></a>00130 fprintf(stderr, <span class="stringliteral">"%02x "</span>, -<a name="l00131"></a>00131 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)aucBlock[16 * i + j]); -<a name="l00132"></a>00132 } -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 fprintf(stderr, <span class="stringliteral">"\n"</span>); -<a name="l00135"></a>00135 } -<a name="l00136"></a>00136 } <span class="comment">/* end of vPrintBlock */</span> -<a name="l00137"></a>00137 -<a name="l00138"></a>00138 <span class="keywordtype">void</span> -<a name="l00139"></a>00139 vPrintUnicode(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFile, <span class="keywordtype">int</span> iLine, <span class="keyword">const</span> UCHAR *aucUni, <span class="keywordtype">size_t</span> tLen) -<a name="l00140"></a>00140 { -<a name="l00141"></a>00141 <span class="keywordtype">char</span> *szASCII; -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 fail(tLen % 2 != 0); -<a name="l00144"></a>00144 -<a name="l00145"></a>00145 tLen /= 2; <span class="comment">/* Length in bytes to length in characters */</span> -<a name="l00146"></a>00146 szASCII = xmalloc(tLen + 1); -<a name="l00147"></a>00147 (void)unincpy(szASCII, aucUni, tLen); -<a name="l00148"></a>00148 szASCII[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00149"></a>00149 (void)fprintf(stderr, <span class="stringliteral">"%s[%3d]: %.*s\n"</span>, -<a name="l00150"></a>00150 szFile, iLine, (<span class="keywordtype">int</span>)tLen, szASCII); -<a name="l00151"></a>00151 szASCII = xfree(szASCII); -<a name="l00152"></a>00152 } <span class="comment">/* end of vPrintUnicode */</span> -<a name="l00153"></a>00153 -<a name="l00154"></a>00154 BOOL -<a name="l00155"></a>00155 bCheckDoubleLinkedList(output_type *pAnchor) -<a name="l00156"></a>00156 { -<a name="l00157"></a>00157 output_type *pCurr, *pLast; -<a name="l00158"></a>00158 <span class="keywordtype">int</span> iInList; -<a name="l00159"></a>00159 -<a name="l00160"></a>00160 pLast = pAnchor; -<a name="l00161"></a>00161 iInList = 0; -<a name="l00162"></a>00162 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00163"></a>00163 pLast = pCurr; -<a name="l00164"></a>00164 iInList++; -<a name="l00165"></a>00165 } -<a name="l00166"></a>00166 NO_DBG_DEC(iInList); -<a name="l00167"></a>00167 <span class="keywordflow">for</span> (pCurr = pLast; pCurr != NULL; pCurr = pCurr->pPrev) { -<a name="l00168"></a>00168 pLast = pCurr; -<a name="l00169"></a>00169 iInList--; -<a name="l00170"></a>00170 } -<a name="l00171"></a>00171 DBG_DEC_C(iInList != 0, iInList); -<a name="l00172"></a>00172 <span class="keywordflow">return</span> pAnchor == pLast && iInList == 0; -<a name="l00173"></a>00173 } <span class="comment">/* end of bCheckDoubleLinkedList */</span> -<a name="l00174"></a>00174 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00175"></a>00175 -<a name="l00176"></a>00176 <span class="comment">/*</span> -<a name="l00177"></a>00177 <span class="comment"> * bReadBytes</span> -<a name="l00178"></a>00178 <span class="comment"> * This function reads the specified number of bytes from the specified file,</span> -<a name="l00179"></a>00179 <span class="comment"> * starting from the specified offset.</span> -<a name="l00180"></a>00180 <span class="comment"> * Returns TRUE when successfull, otherwise FALSE</span> -<a name="l00181"></a>00181 <span class="comment"> */</span> -<a name="l00182"></a>00182 BOOL -<a name="l00183"></a>00183 bReadBytes(UCHAR *aucBytes, <span class="keywordtype">size_t</span> tMemb, ULONG ulOffset, FILE *pFile) -<a name="l00184"></a>00184 { -<a name="l00185"></a>00185 fail(aucBytes == NULL || pFile == NULL || ulOffset > (ULONG)LONG_MAX); -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 <span class="keywordflow">if</span> (ulOffset > (ULONG)LONG_MAX) { -<a name="l00188"></a>00188 <span class="keywordflow">return</span> FALSE; -<a name="l00189"></a>00189 } -<a name="l00190"></a>00190 <span class="keywordflow">if</span> (fseek(pFile, (<span class="keywordtype">long</span>)ulOffset, SEEK_SET) != 0) { -<a name="l00191"></a>00191 <span class="keywordflow">return</span> FALSE; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 <span class="keywordflow">if</span> (fread(aucBytes, <span class="keyword">sizeof</span>(UCHAR), tMemb, pFile) != tMemb) { -<a name="l00194"></a>00194 <span class="keywordflow">return</span> FALSE; -<a name="l00195"></a>00195 } -<a name="l00196"></a>00196 <span class="keywordflow">return</span> TRUE; -<a name="l00197"></a>00197 } <span class="comment">/* end of bReadBytes */</span> -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 <span class="comment">/*</span> -<a name="l00200"></a>00200 <span class="comment"> * bReadBuffer</span> -<a name="l00201"></a>00201 <span class="comment"> * This function fills the specified buffer with the specified number of bytes,</span> -<a name="l00202"></a>00202 <span class="comment"> * starting at the specified offset within the Big/Small Block Depot.</span> -<a name="l00203"></a>00203 <span class="comment"> *</span> -<a name="l00204"></a>00204 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00205"></a>00205 <span class="comment"> */</span> -<a name="l00206"></a>00206 BOOL -<a name="l00207"></a>00207 bReadBuffer(FILE *pFile, ULONG ulStartBlock, -<a name="l00208"></a>00208 <span class="keyword">const</span> ULONG *aulBlockDepot, <span class="keywordtype">size_t</span> tBlockDepotLen, <span class="keywordtype">size_t</span> tBlockSize, -<a name="l00209"></a>00209 UCHAR *aucBuffer, ULONG ulOffset, <span class="keywordtype">size_t</span> tToRead) -<a name="l00210"></a>00210 { -<a name="l00211"></a>00211 ULONG ulBegin, ulIndex; -<a name="l00212"></a>00212 <span class="keywordtype">size_t</span> tLen; -<a name="l00213"></a>00213 -<a name="l00214"></a>00214 fail(pFile == NULL); -<a name="l00215"></a>00215 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00216"></a>00216 fail(aulBlockDepot == NULL); -<a name="l00217"></a>00217 fail(tBlockSize != BIG_BLOCK_SIZE && tBlockSize != SMALL_BLOCK_SIZE); -<a name="l00218"></a>00218 fail(aucBuffer == NULL); -<a name="l00219"></a>00219 fail(tToRead == 0); -<a name="l00220"></a>00220 -<a name="l00221"></a>00221 <span class="keywordflow">for</span> (ulIndex = ulStartBlock; -<a name="l00222"></a>00222 ulIndex != END_OF_CHAIN && tToRead != 0; -<a name="l00223"></a>00223 ulIndex = aulBlockDepot[ulIndex]) { -<a name="l00224"></a>00224 <span class="keywordflow">if</span> (ulIndex >= (ULONG)tBlockDepotLen) { -<a name="l00225"></a>00225 DBG_DEC(ulIndex); -<a name="l00226"></a>00226 DBG_DEC(tBlockDepotLen); -<a name="l00227"></a>00227 <span class="keywordflow">if</span> (tBlockSize >= BIG_BLOCK_SIZE) { -<a name="l00228"></a>00228 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00229"></a>00229 } <span class="keywordflow">else</span> { -<a name="l00230"></a>00230 werr(1, <span class="stringliteral">"The Small Block Depot is damaged"</span>); -<a name="l00231"></a>00231 } -<a name="l00232"></a>00232 } -<a name="l00233"></a>00233 <span class="keywordflow">if</span> (ulOffset >= (ULONG)tBlockSize) { -<a name="l00234"></a>00234 ulOffset -= tBlockSize; -<a name="l00235"></a>00235 <span class="keywordflow">continue</span>; -<a name="l00236"></a>00236 } -<a name="l00237"></a>00237 ulBegin = ulDepotOffset(ulIndex, tBlockSize) + ulOffset; -<a name="l00238"></a>00238 tLen = min(tBlockSize - (<span class="keywordtype">size_t</span>)ulOffset, tToRead); -<a name="l00239"></a>00239 ulOffset = 0; -<a name="l00240"></a>00240 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tLen, ulBegin, pFile)) { -<a name="l00241"></a>00241 werr(0, <span class="stringliteral">"Read big block 0x%lx not possible"</span>, ulBegin); -<a name="l00242"></a>00242 <span class="keywordflow">return</span> FALSE; -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 aucBuffer += tLen; -<a name="l00245"></a>00245 tToRead -= tLen; -<a name="l00246"></a>00246 } -<a name="l00247"></a>00247 DBG_DEC_C(tToRead != 0, tToRead); -<a name="l00248"></a>00248 <span class="keywordflow">return</span> tToRead == 0; -<a name="l00249"></a>00249 } <span class="comment">/* end of bReadBuffer */</span> -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 <span class="comment">/*</span> -<a name="l00252"></a>00252 <span class="comment"> * Convert a Word colornumber into a true color for use in a drawfile</span> -<a name="l00253"></a>00253 <span class="comment"> *</span> -<a name="l00254"></a>00254 <span class="comment"> * Returns the true color</span> -<a name="l00255"></a>00255 <span class="comment"> */</span> -<a name="l00256"></a>00256 ULONG -<a name="l00257"></a>00257 ulColor2Color(UCHAR ucFontColor) -<a name="l00258"></a>00258 { -<a name="l00259"></a>00259 <span class="keyword">static</span> <span class="keyword">const</span> ULONG aulColorTable[] = { -<a name="l00260"></a>00260 <span class="comment">/* 0 */</span> 0x00000000UL, <span class="comment">/* Automatic */</span> -<a name="l00261"></a>00261 <span class="comment">/* 1 */</span> 0x00000000UL, <span class="comment">/* Black */</span> -<a name="l00262"></a>00262 <span class="comment">/* 2 */</span> 0xff000000UL, <span class="comment">/* Blue */</span> -<a name="l00263"></a>00263 <span class="comment">/* 3 */</span> 0xffff0000UL, <span class="comment">/* Turquoise */</span> -<a name="l00264"></a>00264 <span class="comment">/* 4 */</span> 0x00ff0000UL, <span class="comment">/* Bright Green */</span> -<a name="l00265"></a>00265 <span class="comment">/* 5 */</span> 0xff00ff00UL, <span class="comment">/* Pink */</span> -<a name="l00266"></a>00266 <span class="comment">/* 6 */</span> 0x0000ff00UL, <span class="comment">/* Red */</span> -<a name="l00267"></a>00267 <span class="comment">/* 7 */</span> 0x00ffff00UL, <span class="comment">/* Yellow */</span> -<a name="l00268"></a>00268 <span class="comment">/* 8 */</span> 0xffffff00UL, <span class="comment">/* White */</span> -<a name="l00269"></a>00269 <span class="comment">/* 9 */</span> 0x80000000UL, <span class="comment">/* Dark Blue */</span> -<a name="l00270"></a>00270 <span class="comment">/* 10 */</span> 0x80800000UL, <span class="comment">/* Teal */</span> -<a name="l00271"></a>00271 <span class="comment">/* 11 */</span> 0x00800000UL, <span class="comment">/* Green */</span> -<a name="l00272"></a>00272 <span class="comment">/* 12 */</span> 0x80008000UL, <span class="comment">/* Violet */</span> -<a name="l00273"></a>00273 <span class="comment">/* 13 */</span> 0x00008000UL, <span class="comment">/* Dark Red */</span> -<a name="l00274"></a>00274 <span class="comment">/* 14 */</span> 0x00808000UL, <span class="comment">/* Dark Yellow */</span> -<a name="l00275"></a>00275 <span class="comment">/* 15 */</span> 0x80808000UL, <span class="comment">/* Gray 50% */</span> -<a name="l00276"></a>00276 <span class="comment">/* 16 */</span> 0xc0c0c000UL, <span class="comment">/* Gray 25% */</span> -<a name="l00277"></a>00277 }; -<a name="l00278"></a>00278 <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)ucFontColor >= elementsof(aulColorTable)) { -<a name="l00279"></a>00279 <span class="keywordflow">return</span> aulColorTable[0]; -<a name="l00280"></a>00280 } -<a name="l00281"></a>00281 <span class="keywordflow">return</span> aulColorTable[(int)ucFontColor]; -<a name="l00282"></a>00282 } <span class="comment">/* end of ulColor2Color */</span> -<a name="l00283"></a>00283 -<a name="l00284"></a>00284 <span class="comment">/*</span> -<a name="l00285"></a>00285 <span class="comment"> * iFindSplit - find a place to split the string</span> -<a name="l00286"></a>00286 <span class="comment"> *</span> -<a name="l00287"></a>00287 <span class="comment"> * returns the index of the split character or -1 if no split found.</span> -<a name="l00288"></a>00288 <span class="comment"> */</span> -<a name="l00289"></a>00289 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00290"></a>00290 iFindSplit(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLen) -<a name="l00291"></a>00291 { -<a name="l00292"></a>00292 <span class="keywordtype">size_t</span> tSplit; -<a name="l00293"></a>00293 -<a name="l00294"></a>00294 <span class="keywordflow">if</span> (tStringLen == 0) { -<a name="l00295"></a>00295 <span class="keywordflow">return</span> -1; -<a name="l00296"></a>00296 } -<a name="l00297"></a>00297 tSplit = tStringLen - 1; -<a name="l00298"></a>00298 <span class="keywordflow">while</span> (tSplit >= 1) { -<a name="l00299"></a>00299 <span class="keywordflow">if</span> (szString[tSplit] == <span class="charliteral">' '</span> || -<a name="l00300"></a>00300 (szString[tSplit] == <span class="charliteral">'-'</span> && szString[tSplit - 1] != <span class="charliteral">' '</span>)) { -<a name="l00301"></a>00301 <span class="keywordflow">return</span> (<span class="keywordtype">int</span>)tSplit; -<a name="l00302"></a>00302 } -<a name="l00303"></a>00303 tSplit--; -<a name="l00304"></a>00304 } -<a name="l00305"></a>00305 <span class="keywordflow">return</span> -1; -<a name="l00306"></a>00306 } <span class="comment">/* end of iFindSplit */</span> -<a name="l00307"></a>00307 -<a name="l00308"></a>00308 <span class="comment">/*</span> -<a name="l00309"></a>00309 <span class="comment"> * pSplitList - split the specified list in a printable part and a leftover part</span> -<a name="l00310"></a>00310 <span class="comment"> *</span> -<a name="l00311"></a>00311 <span class="comment"> * returns the pointer to the leftover part</span> -<a name="l00312"></a>00312 <span class="comment"> */</span> -<a name="l00313"></a>00313 output_type * -<a name="l00314"></a>00314 pSplitList(output_type *pAnchor) -<a name="l00315"></a>00315 { -<a name="l00316"></a>00316 output_type *pCurr, *pLeftOver; -<a name="l00317"></a>00317 <span class="keywordtype">int</span> iIndex; -<a name="l00318"></a>00318 -<a name="l00319"></a>00319 fail(pAnchor == NULL); -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr->pNext != NULL; pCurr = pCurr->pNext) -<a name="l00322"></a>00322 ; <span class="comment">/* EMPTY */</span> -<a name="l00323"></a>00323 iIndex = -1; -<a name="l00324"></a>00324 <span class="keywordflow">for</span> (; pCurr != NULL; pCurr = pCurr->pPrev) { -<a name="l00325"></a>00325 iIndex = iFindSplit(pCurr->szStorage, pCurr->tNextFree); -<a name="l00326"></a>00326 <span class="keywordflow">if</span> (iIndex >= 0) { -<a name="l00327"></a>00327 <span class="keywordflow">break</span>; -<a name="l00328"></a>00328 } -<a name="l00329"></a>00329 } -<a name="l00330"></a>00330 -<a name="l00331"></a>00331 <span class="keywordflow">if</span> (pCurr == NULL || iIndex < 0) { -<a name="l00332"></a>00332 <span class="comment">/* No split, no leftover */</span> -<a name="l00333"></a>00333 <span class="keywordflow">return</span> NULL; -<a name="l00334"></a>00334 } -<a name="l00335"></a>00335 <span class="comment">/* Split over the iIndex-th character */</span> -<a name="l00336"></a>00336 NO_DBG_MSG(<span class="stringliteral">"pLeftOver"</span>); -<a name="l00337"></a>00337 pLeftOver = xmalloc(<span class="keyword">sizeof</span>(*pLeftOver)); -<a name="l00338"></a>00338 fail(pCurr->tNextFree < (<span class="keywordtype">size_t</span>)iIndex); -<a name="l00339"></a>00339 pLeftOver->tStorageSize = pCurr->tNextFree - (size_t)iIndex; -<a name="l00340"></a>00340 pLeftOver->szStorage = xmalloc(pLeftOver->tStorageSize); -<a name="l00341"></a>00341 pLeftOver->tNextFree = pCurr->tNextFree - (size_t)iIndex - 1; -<a name="l00342"></a>00342 (void)strncpy(pLeftOver->szStorage, -<a name="l00343"></a>00343 pCurr->szStorage + iIndex + 1, pLeftOver->tNextFree); -<a name="l00344"></a>00344 pLeftOver->szStorage[pLeftOver->tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l00345"></a>00345 NO_DBG_MSG(pLeftOver->szStorage); -<a name="l00346"></a>00346 pLeftOver->ucFontColor = pCurr->ucFontColor; -<a name="l00347"></a>00347 pLeftOver->usFontStyle = pCurr->usFontStyle; -<a name="l00348"></a>00348 pLeftOver->tFontRef = pCurr->tFontRef; -<a name="l00349"></a>00349 pLeftOver->usFontSize = pCurr->usFontSize; -<a name="l00350"></a>00350 pLeftOver->lStringWidth = lComputeStringWidth( -<a name="l00351"></a>00351 pLeftOver->szStorage, -<a name="l00352"></a>00352 pLeftOver->tNextFree, -<a name="l00353"></a>00353 pLeftOver->tFontRef, -<a name="l00354"></a>00354 pLeftOver->usFontSize); -<a name="l00355"></a>00355 pLeftOver->pPrev = NULL; -<a name="l00356"></a>00356 pLeftOver->pNext = pCurr->pNext; -<a name="l00357"></a>00357 <span class="keywordflow">if</span> (pLeftOver->pNext != NULL) { -<a name="l00358"></a>00358 pLeftOver->pNext->pPrev = pLeftOver; -<a name="l00359"></a>00359 } -<a name="l00360"></a>00360 fail(!bCheckDoubleLinkedList(pLeftOver)); -<a name="l00361"></a>00361 -<a name="l00362"></a>00362 NO_DBG_MSG(<span class="stringliteral">"pAnchor"</span>); -<a name="l00363"></a>00363 NO_DBG_HEX(pCurr->szStorage[iIndex]); -<a name="l00364"></a>00364 <span class="keywordflow">while</span> (iIndex >= 0 && isspace((<span class="keywordtype">int</span>)(UCHAR)pCurr->szStorage[iIndex])) { -<a name="l00365"></a>00365 iIndex--; -<a name="l00366"></a>00366 } -<a name="l00367"></a>00367 pCurr->tNextFree = (size_t)iIndex + 1; -<a name="l00368"></a>00368 pCurr->szStorage[pCurr->tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l00369"></a>00369 NO_DBG_MSG(pCurr->szStorage); -<a name="l00370"></a>00370 pCurr->lStringWidth = lComputeStringWidth( -<a name="l00371"></a>00371 pCurr->szStorage, -<a name="l00372"></a>00372 pCurr->tNextFree, -<a name="l00373"></a>00373 pCurr->tFontRef, -<a name="l00374"></a>00374 pCurr->usFontSize); -<a name="l00375"></a>00375 pCurr->pNext = NULL; -<a name="l00376"></a>00376 fail(!bCheckDoubleLinkedList(pAnchor)); -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 <span class="keywordflow">return</span> pLeftOver; -<a name="l00379"></a>00379 } <span class="comment">/* end of pSplitList */</span> -<a name="l00380"></a>00380 -<a name="l00381"></a>00381 <span class="comment">/*</span> -<a name="l00382"></a>00382 <span class="comment"> * tNumber2Roman - convert a number to Roman Numerals</span> -<a name="l00383"></a>00383 <span class="comment"> *</span> -<a name="l00384"></a>00384 <span class="comment"> * returns the number of characters written</span> -<a name="l00385"></a>00385 <span class="comment"> */</span> -<a name="l00386"></a>00386 <span class="keywordtype">size_t</span> -<a name="l00387"></a>00387 tNumber2Roman(UINT uiNumber, BOOL bUpperCase, <span class="keywordtype">char</span> *szOutput) -<a name="l00388"></a>00388 { -<a name="l00389"></a>00389 <span class="keywordtype">char</span> *outp, *p, *q; -<a name="l00390"></a>00390 UINT uiNextVal, uiValue; -<a name="l00391"></a>00391 -<a name="l00392"></a>00392 fail(szOutput == NULL); -<a name="l00393"></a>00393 -<a name="l00394"></a>00394 uiNumber %= 4000; <span class="comment">/* Very high numbers can't be represented */</span> -<a name="l00395"></a>00395 <span class="keywordflow">if</span> (uiNumber == 0) { -<a name="l00396"></a>00396 szOutput[0] = <span class="charliteral">'\0'</span>; -<a name="l00397"></a>00397 <span class="keywordflow">return</span> 0; -<a name="l00398"></a>00398 } -<a name="l00399"></a>00399 -<a name="l00400"></a>00400 outp = szOutput; -<a name="l00401"></a>00401 p = bUpperCase ? <span class="stringliteral">"M\2D\5C\2L\5X\2V\5I"</span> : <span class="stringliteral">"m\2d\5c\2l\5x\2v\5i"</span>; -<a name="l00402"></a>00402 uiValue = 1000; -<a name="l00403"></a>00403 <span class="keywordflow">for</span> (;;) { -<a name="l00404"></a>00404 <span class="keywordflow">while</span> (uiNumber >= uiValue) { -<a name="l00405"></a>00405 *outp++ = *p; -<a name="l00406"></a>00406 uiNumber -= uiValue; -<a name="l00407"></a>00407 } -<a name="l00408"></a>00408 <span class="keywordflow">if</span> (uiNumber == 0) { -<a name="l00409"></a>00409 *outp = <span class="charliteral">'\0'</span>; -<a name="l00410"></a>00410 fail(outp < szOutput); -<a name="l00411"></a>00411 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)(outp - szOutput); -<a name="l00412"></a>00412 } -<a name="l00413"></a>00413 q = p + 1; -<a name="l00414"></a>00414 uiNextVal = uiValue / (UINT)(UCHAR)*q; -<a name="l00415"></a>00415 <span class="keywordflow">if</span> ((<span class="keywordtype">int</span>)*q == 2) { <span class="comment">/* magic */</span> -<a name="l00416"></a>00416 uiNextVal /= (UINT)(UCHAR)*(q += 2); -<a name="l00417"></a>00417 } -<a name="l00418"></a>00418 <span class="keywordflow">if</span> (uiNumber + uiNextVal >= uiValue) { -<a name="l00419"></a>00419 *outp++ = *++q; -<a name="l00420"></a>00420 uiNumber += uiNextVal; -<a name="l00421"></a>00421 } <span class="keywordflow">else</span> { -<a name="l00422"></a>00422 p++; -<a name="l00423"></a>00423 uiValue /= (UINT)(UCHAR)(*p++); -<a name="l00424"></a>00424 } -<a name="l00425"></a>00425 } -<a name="l00426"></a>00426 } <span class="comment">/* end of tNumber2Roman */</span> -<a name="l00427"></a>00427 -<a name="l00428"></a>00428 <span class="comment">/*</span> -<a name="l00429"></a>00429 <span class="comment"> * iNumber2Alpha - convert a number to alphabetic "numbers"</span> -<a name="l00430"></a>00430 <span class="comment"> *</span> -<a name="l00431"></a>00431 <span class="comment"> * returns the number of characters written</span> -<a name="l00432"></a>00432 <span class="comment"> */</span> -<a name="l00433"></a>00433 <span class="keywordtype">size_t</span> -<a name="l00434"></a>00434 tNumber2Alpha(UINT uiNumber, BOOL bUpperCase, <span class="keywordtype">char</span> *szOutput) -<a name="l00435"></a>00435 { -<a name="l00436"></a>00436 <span class="keywordtype">char</span> *outp; -<a name="l00437"></a>00437 UINT uiTmp; -<a name="l00438"></a>00438 -<a name="l00439"></a>00439 fail(szOutput == NULL); -<a name="l00440"></a>00440 -<a name="l00441"></a>00441 <span class="keywordflow">if</span> (uiNumber == 0) { -<a name="l00442"></a>00442 szOutput[0] = <span class="charliteral">'\0'</span>; -<a name="l00443"></a>00443 <span class="keywordflow">return</span> 0; -<a name="l00444"></a>00444 } -<a name="l00445"></a>00445 -<a name="l00446"></a>00446 outp = szOutput; -<a name="l00447"></a>00447 uiTmp = (UINT)(bUpperCase ? <span class="charliteral">'A'</span>: <span class="charliteral">'a'</span>); -<a name="l00448"></a>00448 <span class="keywordflow">if</span> (uiNumber <= 26) { -<a name="l00449"></a>00449 uiNumber -= 1; -<a name="l00450"></a>00450 *outp++ = (char)(uiTmp + uiNumber); -<a name="l00451"></a>00451 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiNumber <= 26U + 26U*26U) { -<a name="l00452"></a>00452 uiNumber -= 26 + 1; -<a name="l00453"></a>00453 *outp++ = (char)(uiTmp + uiNumber / 26); -<a name="l00454"></a>00454 *outp++ = (char)(uiTmp + uiNumber % 26); -<a name="l00455"></a>00455 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiNumber <= 26U + 26U*26U + 26U*26U*26U) { -<a name="l00456"></a>00456 uiNumber -= 26 + 26*26 + 1; -<a name="l00457"></a>00457 *outp++ = (char)(uiTmp + uiNumber / (26*26)); -<a name="l00458"></a>00458 *outp++ = (char)(uiTmp + uiNumber / 26 % 26); -<a name="l00459"></a>00459 *outp++ = (char)(uiTmp + uiNumber % 26); -<a name="l00460"></a>00460 } -<a name="l00461"></a>00461 *outp = <span class="charliteral">'\0'</span>; -<a name="l00462"></a>00462 fail(outp < szOutput); -<a name="l00463"></a>00463 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)(outp - szOutput); -<a name="l00464"></a>00464 } <span class="comment">/* end of tNumber2Alpha */</span> -<a name="l00465"></a>00465 -<a name="l00466"></a>00466 <span class="comment">/*</span> -<a name="l00467"></a>00467 <span class="comment"> * unincpy - copy a counted Unicode string to an single-byte string</span> -<a name="l00468"></a>00468 <span class="comment"> */</span> -<a name="l00469"></a>00469 <span class="keywordtype">char</span> * -<a name="l00470"></a>00470 unincpy(<span class="keywordtype">char</span> *s1, <span class="keyword">const</span> UCHAR *s2, <span class="keywordtype">size_t</span> n) -<a name="l00471"></a>00471 { -<a name="l00472"></a>00472 <span class="keywordtype">char</span> *pcDest; -<a name="l00473"></a>00473 ULONG ulChar; -<a name="l00474"></a>00474 <span class="keywordtype">size_t</span> tLen; -<a name="l00475"></a>00475 USHORT usUni; -<a name="l00476"></a>00476 -<a name="l00477"></a>00477 <span class="keywordflow">for</span> (pcDest = s1, tLen = 0; tLen < n; pcDest++, tLen++) { -<a name="l00478"></a>00478 usUni = usGetWord(tLen * 2, s2); -<a name="l00479"></a>00479 <span class="keywordflow">if</span> (usUni == 0) { -<a name="l00480"></a>00480 <span class="keywordflow">break</span>; -<a name="l00481"></a>00481 } -<a name="l00482"></a>00482 ulChar = ulTranslateCharacters(usUni, 0, 8, -<a name="l00483"></a>00483 conversion_unknown, encoding_neutral, FALSE); -<a name="l00484"></a>00484 <span class="keywordflow">if</span> (ulChar == IGNORE_CHARACTER) { -<a name="l00485"></a>00485 ulChar = (ULONG)<span class="charliteral">'?'</span>; -<a name="l00486"></a>00486 } -<a name="l00487"></a>00487 *pcDest = (char)ulChar; -<a name="l00488"></a>00488 } -<a name="l00489"></a>00489 <span class="keywordflow">for</span> (; tLen < n; tLen++) { -<a name="l00490"></a>00490 *pcDest++ = <span class="charliteral">'\0'</span>; -<a name="l00491"></a>00491 } -<a name="l00492"></a>00492 <span class="keywordflow">return</span> s1; -<a name="l00493"></a>00493 } <span class="comment">/* end of unincpy */</span> -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 <span class="comment">/*</span> -<a name="l00496"></a>00496 <span class="comment"> * unilen - calculate the length of a Unicode string</span> -<a name="l00497"></a>00497 <span class="comment"> *</span> -<a name="l00498"></a>00498 <span class="comment"> * returns the length in bytes</span> -<a name="l00499"></a>00499 <span class="comment"> */</span> -<a name="l00500"></a>00500 <span class="keywordtype">size_t</span> -<a name="l00501"></a>00501 unilen(<span class="keyword">const</span> UCHAR *s) -<a name="l00502"></a>00502 { -<a name="l00503"></a>00503 <span class="keywordtype">size_t</span> tLen; -<a name="l00504"></a>00504 USHORT usUni; -<a name="l00505"></a>00505 -<a name="l00506"></a>00506 tLen = 0; -<a name="l00507"></a>00507 <span class="keywordflow">for</span> (;;) { -<a name="l00508"></a>00508 usUni = usGetWord(tLen, s); -<a name="l00509"></a>00509 <span class="keywordflow">if</span> (usUni == 0) { -<a name="l00510"></a>00510 <span class="keywordflow">return</span> tLen; -<a name="l00511"></a>00511 } -<a name="l00512"></a>00512 tLen += 2; -<a name="l00513"></a>00513 } -<a name="l00514"></a>00514 } <span class="comment">/* end of unilen */</span> -<a name="l00515"></a>00515 -<a name="l00516"></a>00516 <span class="comment">/*</span> -<a name="l00517"></a>00517 <span class="comment"> * szBaseName - get the basename of the specified filename</span> -<a name="l00518"></a>00518 <span class="comment"> */</span> -<a name="l00519"></a>00519 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00520"></a>00520 szBasename(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00521"></a>00521 { -<a name="l00522"></a>00522 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTmp; -<a name="l00523"></a>00523 -<a name="l00524"></a>00524 fail(szFilename == NULL); -<a name="l00525"></a>00525 -<a name="l00526"></a>00526 <span class="keywordflow">if</span> (szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>) { -<a name="l00527"></a>00527 <span class="keywordflow">return</span> <span class="stringliteral">"null"</span>; -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 -<a name="l00530"></a>00530 szTmp = strrchr(szFilename, FILE_SEPARATOR[0]); -<a name="l00531"></a>00531 <span class="keywordflow">if</span> (szTmp == NULL) { -<a name="l00532"></a>00532 <span class="keywordflow">return</span> szFilename; -<a name="l00533"></a>00533 } -<a name="l00534"></a>00534 <span class="keywordflow">return</span> ++szTmp; -<a name="l00535"></a>00535 } <span class="comment">/* end of szBasename */</span> -<a name="l00536"></a>00536 -<a name="l00537"></a>00537 <span class="comment">/*</span> -<a name="l00538"></a>00538 <span class="comment"> * lComputeLeading - compute the leading</span> -<a name="l00539"></a>00539 <span class="comment"> *</span> -<a name="l00540"></a>00540 <span class="comment"> * NOTE: the fontsize is specified in half points</span> -<a name="l00541"></a>00541 <span class="comment"> *</span> -<a name="l00542"></a>00542 <span class="comment"> * Returns the leading in drawunits</span> -<a name="l00543"></a>00543 <span class="comment"> */</span> -<a name="l00544"></a>00544 <span class="keywordtype">long</span> -<a name="l00545"></a>00545 lComputeLeading(USHORT usFontSize) -<a name="l00546"></a>00546 { -<a name="l00547"></a>00547 <span class="keywordtype">long</span> lLeading; -<a name="l00548"></a>00548 -<a name="l00549"></a>00549 lLeading = (long)usFontSize * 500L; -<a name="l00550"></a>00550 <span class="keywordflow">if</span> (usFontSize < 18) { <span class="comment">/* Small text: 112% */</span> -<a name="l00551"></a>00551 lLeading *= 112; -<a name="l00552"></a>00552 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usFontSize < 28) { <span class="comment">/* Normal text: 124% */</span> -<a name="l00553"></a>00553 lLeading *= 124; -<a name="l00554"></a>00554 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usFontSize < 48) { <span class="comment">/* Small headlines: 104% */</span> -<a name="l00555"></a>00555 lLeading *= 104; -<a name="l00556"></a>00556 } <span class="keywordflow">else</span> { <span class="comment">/* Large headlines: 100% */</span> -<a name="l00557"></a>00557 lLeading *= 100; -<a name="l00558"></a>00558 } -<a name="l00559"></a>00559 lLeading = lMilliPoints2DrawUnits(lLeading); -<a name="l00560"></a>00560 lLeading += 50; -<a name="l00561"></a>00561 lLeading /= 100; -<a name="l00562"></a>00562 <span class="keywordflow">return</span> lLeading; -<a name="l00563"></a>00563 } <span class="comment">/* end of lComputeLeading */</span> -<a name="l00564"></a>00564 -<a name="l00565"></a>00565 <span class="comment">/*</span> -<a name="l00566"></a>00566 <span class="comment"> * Convert a UCS character to an UTF-8 string</span> -<a name="l00567"></a>00567 <span class="comment"> *</span> -<a name="l00568"></a>00568 <span class="comment"> * Returns the string length of the result</span> -<a name="l00569"></a>00569 <span class="comment"> */</span> -<a name="l00570"></a>00570 <span class="keywordtype">size_t</span> -<a name="l00571"></a>00571 tUcs2Utf8(ULONG ulChar, <span class="keywordtype">char</span> *szResult, <span class="keywordtype">size_t</span> tMaxResultLen) -<a name="l00572"></a>00572 { -<a name="l00573"></a>00573 <span class="keywordflow">if</span> (szResult == NULL || tMaxResultLen == 0) { -<a name="l00574"></a>00574 <span class="keywordflow">return</span> 0; -<a name="l00575"></a>00575 } -<a name="l00576"></a>00576 -<a name="l00577"></a>00577 <span class="keywordflow">if</span> (ulChar < 0x80 && tMaxResultLen >= 2) { -<a name="l00578"></a>00578 szResult[0] = (char)ulChar; -<a name="l00579"></a>00579 szResult[1] = <span class="charliteral">'\0'</span>; -<a name="l00580"></a>00580 <span class="keywordflow">return</span> 1; -<a name="l00581"></a>00581 } -<a name="l00582"></a>00582 <span class="keywordflow">if</span> (ulChar < 0x800 && tMaxResultLen >= 3) { -<a name="l00583"></a>00583 szResult[0] = (char)(0xc0 | ulChar >> 6); -<a name="l00584"></a>00584 szResult[1] = (char)(0x80 | (ulChar & 0x3f)); -<a name="l00585"></a>00585 szResult[2] = <span class="charliteral">'\0'</span>; -<a name="l00586"></a>00586 <span class="keywordflow">return</span> 2; -<a name="l00587"></a>00587 } -<a name="l00588"></a>00588 <span class="keywordflow">if</span> (ulChar < 0x10000 && tMaxResultLen >= 4) { -<a name="l00589"></a>00589 szResult[0] = (char)(0xe0 | ulChar >> 12); -<a name="l00590"></a>00590 szResult[1] = (char)(0x80 | (ulChar >> 6 & 0x3f)); -<a name="l00591"></a>00591 szResult[2] = (char)(0x80 | (ulChar & 0x3f)); -<a name="l00592"></a>00592 szResult[3] = <span class="charliteral">'\0'</span>; -<a name="l00593"></a>00593 <span class="keywordflow">return</span> 3; -<a name="l00594"></a>00594 } -<a name="l00595"></a>00595 <span class="keywordflow">if</span> (ulChar < 0x200000 && tMaxResultLen >= 5) { -<a name="l00596"></a>00596 szResult[0] = (char)(0xf0 | ulChar >> 18); -<a name="l00597"></a>00597 szResult[1] = (char)(0x80 | (ulChar >> 12 & 0x3f)); -<a name="l00598"></a>00598 szResult[2] = (char)(0x80 | (ulChar >> 6 & 0x3f)); -<a name="l00599"></a>00599 szResult[3] = (char)(0x80 | (ulChar & 0x3f)); -<a name="l00600"></a>00600 szResult[4] = <span class="charliteral">'\0'</span>; -<a name="l00601"></a>00601 <span class="keywordflow">return</span> 4; -<a name="l00602"></a>00602 } -<a name="l00603"></a>00603 szResult[0] = <span class="charliteral">'\0'</span>; -<a name="l00604"></a>00604 <span class="keywordflow">return</span> 0; -<a name="l00605"></a>00605 } <span class="comment">/* end of tUcs2Utf8 */</span> -<a name="l00606"></a>00606 -<a name="l00607"></a>00607 <span class="comment">/*</span> -<a name="l00608"></a>00608 <span class="comment"> * vGetBulletValue - get the bullet value for the conversing type and encoding</span> -<a name="l00609"></a>00609 <span class="comment"> */</span> -<a name="l00610"></a>00610 <span class="keywordtype">void</span> -<a name="l00611"></a>00611 vGetBulletValue(conversion_type eConversionType, encoding_type eEncoding, -<a name="l00612"></a>00612 <span class="keywordtype">char</span> *szResult, <span class="keywordtype">size_t</span> tMaxResultLen) -<a name="l00613"></a>00613 { -<a name="l00614"></a>00614 fail(szResult == NULL); -<a name="l00615"></a>00615 fail(tMaxResultLen < 2); -<a name="l00616"></a>00616 -<a name="l00617"></a>00617 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00618"></a>00618 (void)tUcs2Utf8(UNICODE_BULLET, szResult, tMaxResultLen); -<a name="l00619"></a>00619 } <span class="keywordflow">else</span> { -<a name="l00620"></a>00620 szResult[0] = (char)ucGetBulletCharacter(eConversionType, -<a name="l00621"></a>00621 eEncoding); -<a name="l00622"></a>00622 szResult[1] = <span class="charliteral">'\0'</span>; -<a name="l00623"></a>00623 } -<a name="l00624"></a>00624 } <span class="comment">/* end of vGetBulletValue */</span> -<a name="l00625"></a>00625 -<a name="l00626"></a>00626 <span class="comment">/*</span> -<a name="l00627"></a>00627 <span class="comment"> * bAllZero - are all bytes zero?</span> -<a name="l00628"></a>00628 <span class="comment"> */</span> -<a name="l00629"></a>00629 BOOL -<a name="l00630"></a>00630 bAllZero(<span class="keyword">const</span> UCHAR *aucBytes, <span class="keywordtype">size_t</span> tLength) -<a name="l00631"></a>00631 { -<a name="l00632"></a>00632 <span class="keywordtype">size_t</span> tIndex; -<a name="l00633"></a>00633 -<a name="l00634"></a>00634 <span class="keywordflow">if</span> (aucBytes == NULL || tLength == 0) { -<a name="l00635"></a>00635 <span class="keywordflow">return</span> TRUE; -<a name="l00636"></a>00636 } -<a name="l00637"></a>00637 -<a name="l00638"></a>00638 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLength; tIndex++) { -<a name="l00639"></a>00639 <span class="keywordflow">if</span> (aucBytes[tIndex] != 0) { -<a name="l00640"></a>00640 <span class="keywordflow">return</span> FALSE; -<a name="l00641"></a>00641 } -<a name="l00642"></a>00642 } -<a name="l00643"></a>00643 <span class="keywordflow">return</span> TRUE; -<a name="l00644"></a>00644 } <span class="comment">/* end of bAllZero */</span> -<a name="l00645"></a>00645 -<a name="l00646"></a>00646 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00647"></a>00647 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00648"></a>00648 <span class="comment"> * GetCodesetFromLocale - get the codeset from the current locale</span> -<a name="l00649"></a>00649 <span class="comment"> *</span> -<a name="l00650"></a>00650 <span class="comment"> * Original version: Copyright (C) 1999 Bruno Haible</span> -<a name="l00651"></a>00651 <span class="comment"> * Syntax:</span> -<a name="l00652"></a>00652 <span class="comment"> * language[_territory][.codeset][@modifier][+special][,[sponsor][_revision]]</span> -<a name="l00653"></a>00653 <span class="comment"> *</span> -<a name="l00654"></a>00654 <span class="comment"> * Returns TRUE when sucessful, otherwise FALSE</span> -<a name="l00655"></a>00655 <span class="comment"> */</span> -<a name="l00656"></a>00656 <span class="keyword">static</span> BOOL -<a name="l00657"></a>00657 bGetCodesetFromLocale(<span class="keywordtype">char</span> *szCodeset, <span class="keywordtype">size_t</span> tMaxCodesetLength, BOOL *pbEuro) -<a name="l00658"></a>00658 { -<a name="l00659"></a>00659 <span class="preprocessor">#if !defined(__dos)</span> -<a name="l00660"></a>00660 <span class="preprocessor"></span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szLocale; -<a name="l00661"></a>00661 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00662"></a>00662 <span class="keywordtype">size_t</span> tIndex; -<a name="l00663"></a>00663 <span class="keywordtype">char</span> szModifier[6]; -<a name="l00664"></a>00664 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00665"></a>00665 -<a name="l00666"></a>00666 <span class="keywordflow">if</span> (pbEuro != NULL) { -<a name="l00667"></a>00667 *pbEuro = FALSE; <span class="comment">/* Until proven otherwise */</span> -<a name="l00668"></a>00668 } -<a name="l00669"></a>00669 <span class="keywordflow">if</span> (szCodeset == NULL || tMaxCodesetLength == 0) { -<a name="l00670"></a>00670 <span class="keywordflow">return</span> FALSE; -<a name="l00671"></a>00671 } -<a name="l00672"></a>00672 -<a name="l00673"></a>00673 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00674"></a>00674 <span class="preprocessor"></span> <span class="keywordflow">if</span> (tMaxCodesetLength < 2 + <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * 3 + 1) { -<a name="l00675"></a>00675 DBG_DEC(tMaxCodesetLength); -<a name="l00676"></a>00676 DBG_DEC(2 + <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>) * 3 + 1); -<a name="l00677"></a>00677 <span class="keywordflow">return</span> FALSE; -<a name="l00678"></a>00678 } -<a name="l00679"></a>00679 <span class="comment">/* Get the active codepage from DOS */</span> -<a name="l00680"></a>00680 sprintf(szCodeset, <span class="stringliteral">"cp%d"</span>, iGetCodepage()); -<a name="l00681"></a>00681 DBG_MSG(szCodeset); -<a name="l00682"></a>00682 <span class="preprocessor">#else</span> -<a name="l00683"></a>00683 <span class="preprocessor"></span> <span class="comment">/* Get the locale from the environment */</span> -<a name="l00684"></a>00684 szLocale = getenv(<span class="stringliteral">"LC_ALL"</span>); -<a name="l00685"></a>00685 <span class="keywordflow">if</span> (szLocale == NULL || szLocale[0] == <span class="charliteral">'\0'</span>) { -<a name="l00686"></a>00686 szLocale = getenv(<span class="stringliteral">"LC_CTYPE"</span>); -<a name="l00687"></a>00687 <span class="keywordflow">if</span> (szLocale == NULL || szLocale[0] == <span class="charliteral">'\0'</span>) { -<a name="l00688"></a>00688 szLocale = getenv(<span class="stringliteral">"LANG"</span>); -<a name="l00689"></a>00689 } -<a name="l00690"></a>00690 } -<a name="l00691"></a>00691 <span class="keywordflow">if</span> (szLocale == NULL || szLocale[0] == <span class="charliteral">'\0'</span>) { -<a name="l00692"></a>00692 <span class="comment">/* No locale, so no codeset name and no modifier */</span> -<a name="l00693"></a>00693 <span class="keywordflow">return</span> FALSE; -<a name="l00694"></a>00694 } -<a name="l00695"></a>00695 DBG_MSG(szLocale); -<a name="l00696"></a>00696 pcTmp = strchr(szLocale, <span class="charliteral">'.'</span>); -<a name="l00697"></a>00697 <span class="keywordflow">if</span> (pcTmp == NULL) { -<a name="l00698"></a>00698 <span class="comment">/* No codeset name */</span> -<a name="l00699"></a>00699 szCodeset[0] = <span class="charliteral">'\0'</span>; -<a name="l00700"></a>00700 } <span class="keywordflow">else</span> { -<a name="l00701"></a>00701 <span class="comment">/* Copy the codeset name */</span> -<a name="l00702"></a>00702 pcTmp++; -<a name="l00703"></a>00703 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tMaxCodesetLength; tIndex++) { -<a name="l00704"></a>00704 <span class="keywordflow">if</span> (*pcTmp == <span class="charliteral">'@'</span> || *pcTmp == <span class="charliteral">'+'</span> || -<a name="l00705"></a>00705 *pcTmp == <span class="charliteral">','</span> || *pcTmp == <span class="charliteral">'_'</span> || -<a name="l00706"></a>00706 *pcTmp == <span class="charliteral">'\0'</span>) { -<a name="l00707"></a>00707 szCodeset[tIndex] = <span class="charliteral">'\0'</span>; -<a name="l00708"></a>00708 <span class="keywordflow">break</span>; -<a name="l00709"></a>00709 } -<a name="l00710"></a>00710 szCodeset[tIndex] = *pcTmp; -<a name="l00711"></a>00711 pcTmp++; -<a name="l00712"></a>00712 } -<a name="l00713"></a>00713 szCodeset[tMaxCodesetLength - 1] = <span class="charliteral">'\0'</span>; -<a name="l00714"></a>00714 } -<a name="l00715"></a>00715 <span class="keywordflow">if</span> (pbEuro == NULL) { -<a name="l00716"></a>00716 <span class="comment">/* No need to get the modifier */</span> -<a name="l00717"></a>00717 <span class="keywordflow">return</span> TRUE; -<a name="l00718"></a>00718 } -<a name="l00719"></a>00719 pcTmp = strchr(szLocale, <span class="charliteral">'@'</span>); -<a name="l00720"></a>00720 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00721"></a>00721 <span class="comment">/* Copy the modifier */</span> -<a name="l00722"></a>00722 pcTmp++; -<a name="l00723"></a>00723 <span class="keywordflow">for</span> (tIndex = 0; tIndex < <span class="keyword">sizeof</span>(szModifier); tIndex++) { -<a name="l00724"></a>00724 <span class="keywordflow">if</span> (*pcTmp == <span class="charliteral">'+'</span> || *pcTmp == <span class="charliteral">','</span> || -<a name="l00725"></a>00725 *pcTmp == <span class="charliteral">'_'</span> || *pcTmp == <span class="charliteral">'\0'</span>) { -<a name="l00726"></a>00726 szModifier[tIndex] = <span class="charliteral">'\0'</span>; -<a name="l00727"></a>00727 <span class="keywordflow">break</span>; -<a name="l00728"></a>00728 } -<a name="l00729"></a>00729 szModifier[tIndex] = *pcTmp; -<a name="l00730"></a>00730 pcTmp++; -<a name="l00731"></a>00731 } -<a name="l00732"></a>00732 szModifier[<span class="keyword">sizeof</span>(szModifier) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00733"></a>00733 *pbEuro = STRCEQ(szModifier, <span class="stringliteral">"Euro"</span>); -<a name="l00734"></a>00734 } -<a name="l00735"></a>00735 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00736"></a>00736 <span class="keywordflow">return</span> TRUE; -<a name="l00737"></a>00737 } <span class="comment">/* end of bGetCodesetFromLocale */</span> -<a name="l00738"></a>00738 -<a name="l00739"></a>00739 <span class="comment">/*</span> -<a name="l00740"></a>00740 <span class="comment"> * GetNormalizedCodeset - get the normalized codeset from the current locale</span> -<a name="l00741"></a>00741 <span class="comment"> *</span> -<a name="l00742"></a>00742 <span class="comment"> * Returns TRUE when sucessful, otherwise FALSE</span> -<a name="l00743"></a>00743 <span class="comment"> */</span> -<a name="l00744"></a>00744 BOOL -<a name="l00745"></a>00745 bGetNormalizedCodeset(<span class="keywordtype">char</span> *szCodeset, <span class="keywordtype">size_t</span> tMaxCodesetLength, BOOL *pbEuro) -<a name="l00746"></a>00746 { -<a name="l00747"></a>00747 BOOL bOnlyDigits; -<a name="l00748"></a>00748 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcSrc; -<a name="l00749"></a>00749 <span class="keywordtype">char</span> *pcDest; -<a name="l00750"></a>00750 <span class="keywordtype">char</span> *szTmp, *szCodesetNorm; -<a name="l00751"></a>00751 -<a name="l00752"></a>00752 <span class="keywordflow">if</span> (pbEuro != NULL) { -<a name="l00753"></a>00753 *pbEuro = FALSE; <span class="comment">/* Until proven otherwise */</span> -<a name="l00754"></a>00754 } -<a name="l00755"></a>00755 <span class="keywordflow">if</span> (szCodeset == NULL || tMaxCodesetLength < 4) { -<a name="l00756"></a>00756 <span class="keywordflow">return</span> FALSE; -<a name="l00757"></a>00757 } -<a name="l00758"></a>00758 -<a name="l00759"></a>00759 <span class="comment">/* Get the codeset name */</span> -<a name="l00760"></a>00760 szTmp = xmalloc(tMaxCodesetLength - 3); -<a name="l00761"></a>00761 <span class="keywordflow">if</span> (!bGetCodesetFromLocale(szTmp, tMaxCodesetLength - 3, pbEuro)) { -<a name="l00762"></a>00762 szTmp = xfree(szTmp); -<a name="l00763"></a>00763 <span class="keywordflow">return</span> FALSE; -<a name="l00764"></a>00764 } -<a name="l00765"></a>00765 <span class="comment">/* Normalize the codeset name */</span> -<a name="l00766"></a>00766 szCodesetNorm = xmalloc(tMaxCodesetLength - 3); -<a name="l00767"></a>00767 bOnlyDigits = TRUE; -<a name="l00768"></a>00768 pcDest = szCodesetNorm; -<a name="l00769"></a>00769 <span class="keywordflow">for</span> (pcSrc = szTmp; *pcSrc != <span class="charliteral">'\0'</span>; pcSrc++) { -<a name="l00770"></a>00770 <span class="keywordflow">if</span> (isalnum(*pcSrc)) { -<a name="l00771"></a>00771 *pcDest = tolower(*pcSrc); -<a name="l00772"></a>00772 <span class="keywordflow">if</span> (!isdigit(*pcDest)) { -<a name="l00773"></a>00773 bOnlyDigits = FALSE; -<a name="l00774"></a>00774 } -<a name="l00775"></a>00775 pcDest++; -<a name="l00776"></a>00776 } -<a name="l00777"></a>00777 } -<a name="l00778"></a>00778 *pcDest = <span class="charliteral">'\0'</span>; -<a name="l00779"></a>00779 DBG_MSG(szCodesetNorm); -<a name="l00780"></a>00780 <span class="comment">/* Add "iso" when szCodesetNorm contains all digits */</span> -<a name="l00781"></a>00781 <span class="keywordflow">if</span> (bOnlyDigits && szCodesetNorm[0] != <span class="charliteral">'\0'</span>) { -<a name="l00782"></a>00782 fail(strlen(szCodesetNorm) + 3 >= tMaxCodesetLength); -<a name="l00783"></a>00783 sprintf(szCodeset, <span class="stringliteral">"iso%s"</span>, szCodesetNorm); -<a name="l00784"></a>00784 } <span class="keywordflow">else</span> { -<a name="l00785"></a>00785 fail(strlen(szCodesetNorm) >= tMaxCodesetLength); -<a name="l00786"></a>00786 strncpy(szCodeset, szCodesetNorm, pcDest - szCodesetNorm + 1); -<a name="l00787"></a>00787 szCodeset[tMaxCodesetLength - 1] = <span class="charliteral">'\0'</span>; -<a name="l00788"></a>00788 } -<a name="l00789"></a>00789 DBG_MSG(szCodeset); -<a name="l00790"></a>00790 <span class="comment">/* Clean up and leave */</span> -<a name="l00791"></a>00791 szCodesetNorm = xfree(szCodesetNorm); -<a name="l00792"></a>00792 szTmp = xfree(szTmp); -<a name="l00793"></a>00793 <span class="keywordflow">return</span> TRUE; -<a name="l00794"></a>00794 } <span class="comment">/* end of bGetNormalizedCodeset */</span> -<a name="l00795"></a>00795 -<a name="l00796"></a>00796 <span class="comment">/*</span> -<a name="l00797"></a>00797 <span class="comment"> * szGetDefaultMappingFile - get the default mapping file</span> -<a name="l00798"></a>00798 <span class="comment"> *</span> -<a name="l00799"></a>00799 <span class="comment"> * Returns the basename of the default mapping file</span> -<a name="l00800"></a>00800 <span class="comment"> */</span> -<a name="l00801"></a>00801 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00802"></a>00802 szGetDefaultMappingFile(<span class="keywordtype">void</span>) -<a name="l00803"></a>00803 { -<a name="l00804"></a>00804 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span>{ -<a name="l00805"></a>00805 <span class="keyword">const</span> <span class="keywordtype">char</span> *szCodeset; -<a name="l00806"></a>00806 <span class="keyword">const</span> <span class="keywordtype">char</span> *szMappingFile; -<a name="l00807"></a>00807 } atMappingFile[] = { -<a name="l00808"></a>00808 { <span class="stringliteral">"iso88591"</span>, MAPPING_FILE_8859_1 }, -<a name="l00809"></a>00809 { <span class="stringliteral">"iso88592"</span>, MAPPING_FILE_8859_2 }, -<a name="l00810"></a>00810 { <span class="stringliteral">"iso88593"</span>, <span class="stringliteral">"8859-3.txt"</span> }, -<a name="l00811"></a>00811 { <span class="stringliteral">"iso88594"</span>, <span class="stringliteral">"8859-4.txt"</span> }, -<a name="l00812"></a>00812 { <span class="stringliteral">"iso88595"</span>, <span class="stringliteral">"8859-5.txt"</span> }, -<a name="l00813"></a>00813 { <span class="stringliteral">"iso88596"</span>, MAPPING_FILE_8859_5 }, -<a name="l00814"></a>00814 { <span class="stringliteral">"iso88597"</span>, <span class="stringliteral">"8859-7.txt"</span> }, -<a name="l00815"></a>00815 { <span class="stringliteral">"iso88598"</span>, <span class="stringliteral">"8859-8.txt"</span> }, -<a name="l00816"></a>00816 { <span class="stringliteral">"iso88599"</span>, <span class="stringliteral">"8859-9.txt"</span> }, -<a name="l00817"></a>00817 { <span class="stringliteral">"iso885910"</span>, <span class="stringliteral">"8859-10.txt"</span> }, -<a name="l00818"></a>00818 { <span class="stringliteral">"iso885913"</span>, <span class="stringliteral">"8859-13.txt"</span> }, -<a name="l00819"></a>00819 { <span class="stringliteral">"iso885914"</span>, <span class="stringliteral">"8859-14.txt"</span> }, -<a name="l00820"></a>00820 { <span class="stringliteral">"iso885915"</span>, MAPPING_FILE_8859_15 }, -<a name="l00821"></a>00821 { <span class="stringliteral">"iso885916"</span>, <span class="stringliteral">"8859-16.txt"</span> }, -<a name="l00822"></a>00822 { <span class="stringliteral">"koi8r"</span>, MAPPING_FILE_KOI8_R }, -<a name="l00823"></a>00823 { <span class="stringliteral">"koi8u"</span>, MAPPING_FILE_KOI8_U }, -<a name="l00824"></a>00824 { <span class="stringliteral">"utf8"</span>, MAPPING_FILE_UTF_8 }, -<a name="l00825"></a>00825 { <span class="stringliteral">"cp437"</span>, MAPPING_FILE_CP437 }, -<a name="l00826"></a>00826 { <span class="stringliteral">"cp850"</span>, <span class="stringliteral">"cp850.txt"</span> }, -<a name="l00827"></a>00827 { <span class="stringliteral">"cp852"</span>, MAPPING_FILE_CP852 }, -<a name="l00828"></a>00828 { <span class="stringliteral">"cp862"</span>, <span class="stringliteral">"cp862.txt"</span> }, -<a name="l00829"></a>00829 { <span class="stringliteral">"cp864"</span>, <span class="stringliteral">"cp864.txt"</span> }, -<a name="l00830"></a>00830 { <span class="stringliteral">"cp866"</span>, MAPPING_FILE_CP866 }, -<a name="l00831"></a>00831 { <span class="stringliteral">"cp1250"</span>, MAPPING_FILE_CP1250 }, -<a name="l00832"></a>00832 { <span class="stringliteral">"cp1251"</span>, MAPPING_FILE_CP1251 }, -<a name="l00833"></a>00833 { <span class="stringliteral">"cp1252"</span>, <span class="stringliteral">"cp1252.txt"</span> }, -<a name="l00834"></a>00834 }; -<a name="l00835"></a>00835 <span class="keywordtype">size_t</span> tIndex; -<a name="l00836"></a>00836 BOOL bEuro; -<a name="l00837"></a>00837 <span class="keywordtype">char</span> szCodeset[20]; -<a name="l00838"></a>00838 -<a name="l00839"></a>00839 szCodeset[0] = <span class="charliteral">'\0'</span>; -<a name="l00840"></a>00840 bEuro = FALSE; -<a name="l00841"></a>00841 <span class="comment">/* Get the normalized codeset name */</span> -<a name="l00842"></a>00842 <span class="keywordflow">if</span> (!bGetNormalizedCodeset(szCodeset, <span class="keyword">sizeof</span>(szCodeset), &bEuro)) { -<a name="l00843"></a>00843 <span class="keywordflow">return</span> MAPPING_FILE_8859_1; -<a name="l00844"></a>00844 } -<a name="l00845"></a>00845 <span class="keywordflow">if</span> (szCodeset[0] == <span class="charliteral">'\0'</span>) { -<a name="l00846"></a>00846 <span class="keywordflow">if</span> (bEuro) { -<a name="l00847"></a>00847 <span class="comment">/* Default mapping file (with Euro sign) */</span> -<a name="l00848"></a>00848 <span class="keywordflow">return</span> MAPPING_FILE_8859_15; -<a name="l00849"></a>00849 } <span class="keywordflow">else</span> { -<a name="l00850"></a>00850 <span class="comment">/* Default mapping file (without Euro sign) */</span> -<a name="l00851"></a>00851 <span class="keywordflow">return</span> MAPPING_FILE_8859_1; -<a name="l00852"></a>00852 } -<a name="l00853"></a>00853 } -<a name="l00854"></a>00854 <span class="comment">/* Find the name in the table */</span> -<a name="l00855"></a>00855 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(atMappingFile); tIndex++) { -<a name="l00856"></a>00856 <span class="keywordflow">if</span> (STREQ(atMappingFile[tIndex].szCodeset, szCodeset)) { -<a name="l00857"></a>00857 <span class="keywordflow">return</span> atMappingFile[tIndex].szMappingFile; -<a name="l00858"></a>00858 } -<a name="l00859"></a>00859 } -<a name="l00860"></a>00860 <span class="comment">/* Default default mapping file */</span> -<a name="l00861"></a>00861 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00862"></a>00862 <span class="preprocessor"></span> <span class="keywordflow">return</span> MAPPING_FILE_CP437; -<a name="l00863"></a>00863 <span class="preprocessor">#else</span> -<a name="l00864"></a>00864 <span class="preprocessor"></span> <span class="keywordflow">return</span> MAPPING_FILE_8859_1; -<a name="l00865"></a>00865 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00866"></a>00866 } <span class="comment">/* end of szGetDefaultMappingFile */</span> -<a name="l00867"></a>00867 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00868"></a>00868 -<a name="l00869"></a>00869 <span class="comment">/*</span> -<a name="l00870"></a>00870 <span class="comment"> * tConvertDTTM - convert Windows Date and Time format</span> -<a name="l00871"></a>00871 <span class="comment"> *</span> -<a name="l00872"></a>00872 <span class="comment"> * returns Unix time_t or -1</span> -<a name="l00873"></a>00873 <span class="comment"> */</span> -<a name="l00874"></a>00874 time_t -<a name="l00875"></a>00875 tConvertDTTM(ULONG ulDTTM) -<a name="l00876"></a>00876 { -<a name="l00877"></a>00877 <span class="keyword">struct </span>tm tTime; -<a name="l00878"></a>00878 time_t tResult; -<a name="l00879"></a>00879 -<a name="l00880"></a>00880 <span class="keywordflow">if</span> (ulDTTM == 0) { -<a name="l00881"></a>00881 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00882"></a>00882 } -<a name="l00883"></a>00883 memset(&tTime, 0, <span class="keyword">sizeof</span>(tTime)); -<a name="l00884"></a>00884 tTime.tm_min = (int)(ulDTTM & 0x0000003f); -<a name="l00885"></a>00885 tTime.tm_hour = (int)((ulDTTM & 0x000007c0) >> 6); -<a name="l00886"></a>00886 tTime.tm_mday = (int)((ulDTTM & 0x0000f800) >> 11); -<a name="l00887"></a>00887 tTime.tm_mon = (int)((ulDTTM & 0x000f0000) >> 16); -<a name="l00888"></a>00888 tTime.tm_year = (int)((ulDTTM & 0x1ff00000) >> 20); -<a name="l00889"></a>00889 tTime.tm_isdst = -1; -<a name="l00890"></a>00890 tTime.tm_mon--; <span class="comment">/* From 01-12 to 00-11 */</span> -<a name="l00891"></a>00891 tResult = mktime(&tTime); -<a name="l00892"></a>00892 NO_DBG_MSG(ctime(&tResult)); -<a name="l00893"></a>00893 <span class="keywordflow">return</span> tResult; -<a name="l00894"></a>00894 } <span class="comment">/* end of tConvertDTTM */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/notes_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,892 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/notes.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/notes.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * notes.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to tell the difference between footnotes and endnotes</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 <span class="comment">/*</span> -<a name="l00012"></a>00012 <span class="comment"> * Private structures to hide the way the information</span> -<a name="l00013"></a>00013 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00014"></a>00014 <span class="comment"> */</span> -<a name="l00015"></a>00015 <span class="keyword">typedef</span> <span class="keyword">struct </span>footnote_local_tag { -<a name="l00016"></a>00016 footnote_block_type tInfo; -<a name="l00017"></a>00017 ULONG ulCharPosStart; -<a name="l00018"></a>00018 ULONG ulCharPosNext; -<a name="l00019"></a>00019 BOOL bUseful; -<a name="l00020"></a>00020 } footnote_local_type; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* Variables needed to write the Footnote and Endnote information */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> ULONG *aulFootnoteList = NULL; -<a name="l00024"></a>00024 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tFootnoteListLength = 0; -<a name="l00025"></a>00025 <span class="keyword">static</span> ULONG *aulEndnoteList = NULL; -<a name="l00026"></a>00026 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tEndnoteListLength = 0; -<a name="l00027"></a>00027 <span class="comment">/* Variables needed to write the Footnote Text */</span> -<a name="l00028"></a>00028 <span class="keyword">static</span> footnote_local_type *pFootnoteText = NULL; -<a name="l00029"></a>00029 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tFootnoteTextLength = 0; -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 <span class="comment">/*</span> -<a name="l00033"></a>00033 <span class="comment"> * Destroy the lists with footnote and endnote information</span> -<a name="l00034"></a>00034 <span class="comment"> */</span> -<a name="l00035"></a>00035 <span class="keywordtype">void</span> -<a name="l00036"></a>00036 vDestroyNotesInfoLists(<span class="keywordtype">void</span>) -<a name="l00037"></a>00037 { -<a name="l00038"></a>00038 footnote_local_type *pRecord; -<a name="l00039"></a>00039 <span class="keywordtype">size_t</span> tFootnote; -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 TRACE_MSG(<span class="stringliteral">"vDestroyNotesInfoLists"</span>); -<a name="l00042"></a>00042 -<a name="l00043"></a>00043 <span class="comment">/* Free the lists and reset all control variables */</span> -<a name="l00044"></a>00044 aulEndnoteList = xfree(aulEndnoteList); -<a name="l00045"></a>00045 aulFootnoteList = xfree(aulFootnoteList); -<a name="l00046"></a>00046 tEndnoteListLength = 0; -<a name="l00047"></a>00047 tFootnoteListLength = 0; -<a name="l00048"></a>00048 <span class="keywordflow">for</span> (tFootnote = 0; tFootnote < tFootnoteTextLength; tFootnote++) { -<a name="l00049"></a>00049 pRecord = pFootnoteText + tFootnote; -<a name="l00050"></a>00050 pRecord->tInfo.szText = xfree(pRecord->tInfo.szText); -<a name="l00051"></a>00051 } -<a name="l00052"></a>00052 pFootnoteText = xfree(pFootnoteText); -<a name="l00053"></a>00053 tFootnoteTextLength = 0; -<a name="l00054"></a>00054 } <span class="comment">/* end of vDestroyNotesInfoLists */</span> -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 <span class="comment">/*</span> -<a name="l00057"></a>00057 <span class="comment"> * Build the list with footnote information for Word for DOS files</span> -<a name="l00058"></a>00058 <span class="comment"> */</span> -<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00060"></a>00060 vGet0FootnotesInfoAndText(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00061"></a>00061 { -<a name="l00062"></a>00062 footnote_local_type *pCurr; -<a name="l00063"></a>00063 UCHAR *aucBuffer; -<a name="l00064"></a>00064 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginFootnoteInfo; -<a name="l00065"></a>00065 ULONG ulCharPos, ulBeginNextBlock; -<a name="l00066"></a>00066 <span class="keywordtype">size_t</span> tFootnotes, tFootnoteInfoLen; -<a name="l00067"></a>00067 <span class="keywordtype">size_t</span> tIndex; -<a name="l00068"></a>00068 UCHAR aucTmp[2]; -<a name="l00069"></a>00069 -<a name="l00070"></a>00070 TRACE_MSG(<span class="stringliteral">"vGet0FootnotesInfoAndText"</span>); -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 fail(pFile == NULL || aucHeader == NULL); -<a name="l00073"></a>00073 -<a name="l00074"></a>00074 ulBeginOfText = 128; -<a name="l00075"></a>00075 NO_DBG_HEX(ulBeginOfText); -<a name="l00076"></a>00076 ulBeginFootnoteInfo = 128 * (ULONG)usGetWord(0x14, aucHeader); -<a name="l00077"></a>00077 DBG_HEX(ulBeginFootnoteInfo); -<a name="l00078"></a>00078 ulBeginNextBlock = 128 * (ULONG)usGetWord(0x16, aucHeader); -<a name="l00079"></a>00079 DBG_HEX(ulBeginNextBlock); -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 <span class="keywordflow">if</span> (ulBeginFootnoteInfo == ulBeginNextBlock) { -<a name="l00082"></a>00082 DBG_MSG(<span class="stringliteral">"No Footnotes in this document"</span>); -<a name="l00083"></a>00083 <span class="keywordflow">return</span>; -<a name="l00084"></a>00084 } -<a name="l00085"></a>00085 -<a name="l00086"></a>00086 <span class="comment">/* Read the the number of footnotes + 1 */</span> -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (!bReadBytes(aucTmp, 2, ulBeginFootnoteInfo, pFile)) { -<a name="l00088"></a>00088 <span class="keywordflow">return</span>; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 tFootnotes = (size_t)usGetWord(0, aucTmp); -<a name="l00091"></a>00091 <span class="keywordflow">if</span> (tFootnotes < 2) { -<a name="l00092"></a>00092 DBG_MSG(<span class="stringliteral">"No Footnotes in this document (2)"</span>); -<a name="l00093"></a>00093 } -<a name="l00094"></a>00094 DBG_DEC(tFootnotes); -<a name="l00095"></a>00095 tFootnoteInfoLen = 8 * tFootnotes; -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 aucBuffer = xmalloc(tFootnoteInfoLen); -<a name="l00098"></a>00098 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, -<a name="l00099"></a>00099 tFootnoteInfoLen, ulBeginFootnoteInfo + 4, pFile)) { -<a name="l00100"></a>00100 aucBuffer = xfree(aucBuffer); -<a name="l00101"></a>00101 <span class="keywordflow">return</span>; -<a name="l00102"></a>00102 } -<a name="l00103"></a>00103 DBG_PRINT_BLOCK(aucBuffer, tFootnoteInfoLen); -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 <span class="comment">/* Get footnote information */</span> -<a name="l00106"></a>00106 fail(tFootnoteListLength != 0); -<a name="l00107"></a>00107 tFootnoteListLength = tFootnotes - 1; -<a name="l00108"></a>00108 fail(tFootnoteListLength == 0); -<a name="l00109"></a>00109 -<a name="l00110"></a>00110 fail(aulFootnoteList != NULL); -<a name="l00111"></a>00111 aulFootnoteList = xcalloc(tFootnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteListLength; tIndex++) { -<a name="l00114"></a>00114 ulOffset = ulGetLong(tIndex * 8, aucBuffer); -<a name="l00115"></a>00115 DBG_HEX(ulOffset); -<a name="l00116"></a>00116 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00117"></a>00117 DBG_HEX(ulFileOffset); -<a name="l00118"></a>00118 aulFootnoteList[tIndex] = ulFileOffset; -<a name="l00119"></a>00119 } -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 <span class="comment">/* Get footnote text */</span> -<a name="l00122"></a>00122 fail(tFootnoteTextLength != 0); -<a name="l00123"></a>00123 tFootnoteTextLength = tFootnotes - 1; -<a name="l00124"></a>00124 fail(tFootnoteTextLength == 0); -<a name="l00125"></a>00125 -<a name="l00126"></a>00126 fail(pFootnoteText != NULL); -<a name="l00127"></a>00127 pFootnoteText = xcalloc(tFootnoteTextLength, -<a name="l00128"></a>00128 <span class="keyword">sizeof</span>(footnote_local_type)); -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteTextLength; tIndex++) { -<a name="l00131"></a>00131 pCurr = pFootnoteText + tIndex; -<a name="l00132"></a>00132 pCurr->tInfo.szText = NULL; -<a name="l00133"></a>00133 ulOffset = ulGetLong(tIndex * 8 + 4, aucBuffer); -<a name="l00134"></a>00134 DBG_HEX(ulOffset); -<a name="l00135"></a>00135 ulCharPos = ulBeginOfText + ulOffset; -<a name="l00136"></a>00136 DBG_HEX(ulCharPos); -<a name="l00137"></a>00137 DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00138"></a>00138 pCurr->ulCharPosStart = ulCharPos; -<a name="l00139"></a>00139 ulOffset = ulGetLong((tIndex + 1) * 8 + 4, aucBuffer); -<a name="l00140"></a>00140 DBG_HEX(ulOffset); -<a name="l00141"></a>00141 ulCharPos = ulBeginOfText + ulOffset; -<a name="l00142"></a>00142 DBG_HEX(ulCharPos); -<a name="l00143"></a>00143 DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00144"></a>00144 pCurr->ulCharPosNext = ulCharPos; -<a name="l00145"></a>00145 pCurr->bUseful = pCurr->ulCharPosStart != pCurr->ulCharPosNext; -<a name="l00146"></a>00146 } -<a name="l00147"></a>00147 aucBuffer = xfree(aucBuffer); -<a name="l00148"></a>00148 } <span class="comment">/* end of vGet0FootnotesInfoAndText */</span> -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 <span class="comment">/*</span> -<a name="l00151"></a>00151 <span class="comment"> * Build the lists note information for Word for DOS files</span> -<a name="l00152"></a>00152 <span class="comment"> */</span> -<a name="l00153"></a>00153 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00154"></a>00154 vGet0NotesInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00155"></a>00155 { -<a name="l00156"></a>00156 TRACE_MSG(<span class="stringliteral">"vGet0NotesInfo"</span>); -<a name="l00157"></a>00157 -<a name="l00158"></a>00158 vGet0FootnotesInfoAndText(pFile, aucHeader); -<a name="l00159"></a>00159 <span class="comment">/* There are no endnotes in a Word for DOS file */</span> -<a name="l00160"></a>00160 } <span class="comment">/* end of vGet0NotesInfo */</span> -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="comment">/*</span> -<a name="l00163"></a>00163 <span class="comment"> * Build the list with footnote information for WinWord 1/2 files</span> -<a name="l00164"></a>00164 <span class="comment"> */</span> -<a name="l00165"></a>00165 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00166"></a>00166 vGet2FootnotesInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00167"></a>00167 { -<a name="l00168"></a>00168 UCHAR *aucBuffer; -<a name="l00169"></a>00169 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginFootnoteInfo; -<a name="l00170"></a>00170 <span class="keywordtype">size_t</span> tFootnoteInfoLen; -<a name="l00171"></a>00171 <span class="keywordtype">size_t</span> tIndex; -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 TRACE_MSG(<span class="stringliteral">"vGet2FootnotesInfo"</span>); -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 fail(pFile == NULL || aucHeader == NULL); -<a name="l00176"></a>00176 -<a name="l00177"></a>00177 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00178"></a>00178 NO_DBG_HEX(ulBeginOfText); -<a name="l00179"></a>00179 ulBeginFootnoteInfo = ulGetLong(0x64, aucHeader); <span class="comment">/* fcPlcffndRef */</span> -<a name="l00180"></a>00180 NO_DBG_HEX(ulBeginFootnoteInfo); -<a name="l00181"></a>00181 tFootnoteInfoLen = (size_t)usGetWord(0x68, aucHeader); <span class="comment">/* cbPlcffndRef */</span> -<a name="l00182"></a>00182 NO_DBG_DEC(tFootnoteInfoLen); -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 <span class="keywordflow">if</span> (tFootnoteInfoLen < 10) { -<a name="l00185"></a>00185 DBG_MSG(<span class="stringliteral">"No Footnotes in this document"</span>); -<a name="l00186"></a>00186 <span class="keywordflow">return</span>; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 -<a name="l00189"></a>00189 aucBuffer = xmalloc(tFootnoteInfoLen); -<a name="l00190"></a>00190 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, -<a name="l00191"></a>00191 tFootnoteInfoLen, ulBeginFootnoteInfo, pFile)) { -<a name="l00192"></a>00192 aucBuffer = xfree(aucBuffer); -<a name="l00193"></a>00193 <span class="keywordflow">return</span>; -<a name="l00194"></a>00194 } -<a name="l00195"></a>00195 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteInfoLen); -<a name="l00196"></a>00196 -<a name="l00197"></a>00197 fail(tFootnoteListLength != 0); -<a name="l00198"></a>00198 tFootnoteListLength = (tFootnoteInfoLen - 4) / 6; -<a name="l00199"></a>00199 fail(tFootnoteListLength == 0); -<a name="l00200"></a>00200 -<a name="l00201"></a>00201 fail(aulFootnoteList != NULL); -<a name="l00202"></a>00202 aulFootnoteList = xcalloc(tFootnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00203"></a>00203 -<a name="l00204"></a>00204 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteListLength; tIndex++) { -<a name="l00205"></a>00205 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00206"></a>00206 NO_DBG_HEX(ulOffset); -<a name="l00207"></a>00207 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00208"></a>00208 NO_DBG_HEX(ulFileOffset); -<a name="l00209"></a>00209 aulFootnoteList[tIndex] = ulFileOffset; -<a name="l00210"></a>00210 } -<a name="l00211"></a>00211 aucBuffer = xfree(aucBuffer); -<a name="l00212"></a>00212 } <span class="comment">/* end of vGet2FootnotesInfo */</span> -<a name="l00213"></a>00213 -<a name="l00214"></a>00214 <span class="comment">/*</span> -<a name="l00215"></a>00215 <span class="comment"> * Build the list with footnote text information for WinWord 1/2 files</span> -<a name="l00216"></a>00216 <span class="comment"> */</span> -<a name="l00217"></a>00217 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00218"></a>00218 vGet2FootnotesText(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00219"></a>00219 { -<a name="l00220"></a>00220 footnote_local_type *pCurr; -<a name="l00221"></a>00221 UCHAR *aucBuffer; -<a name="l00222"></a>00222 ULONG ulCharPos, ulBeginOfFootnotes, ulOffset, ulBeginFootnoteText; -<a name="l00223"></a>00223 <span class="keywordtype">size_t</span> tFootnoteTextLen; -<a name="l00224"></a>00224 <span class="keywordtype">size_t</span> tIndex; -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 TRACE_MSG(<span class="stringliteral">"vGet2FootnotesText"</span>); -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 fail(pFile == NULL || aucHeader == NULL); -<a name="l00229"></a>00229 -<a name="l00230"></a>00230 ulBeginOfFootnotes = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00231"></a>00231 ulBeginOfFootnotes += ulGetLong(0x34, aucHeader); <span class="comment">/* ccpText */</span> -<a name="l00232"></a>00232 NO_DBG_HEX(ulBeginOfFootnotes); -<a name="l00233"></a>00233 -<a name="l00234"></a>00234 ulBeginFootnoteText = ulGetLong(0x6a, aucHeader); <span class="comment">/* fcPlcffndTxt */</span> -<a name="l00235"></a>00235 NO_DBG_HEX(ulBeginFootnoteText); -<a name="l00236"></a>00236 tFootnoteTextLen = -<a name="l00237"></a>00237 (size_t)usGetWord(0x6e, aucHeader); <span class="comment">/* cbPlcffndTxt */</span> -<a name="l00238"></a>00238 NO_DBG_DEC(tFootnoteTextLen); -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 <span class="keywordflow">if</span> (tFootnoteTextLen < 12) { -<a name="l00241"></a>00241 DBG_MSG(<span class="stringliteral">"No Footnote text in this document"</span>); -<a name="l00242"></a>00242 <span class="keywordflow">return</span>; -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 aucBuffer = xmalloc(tFootnoteTextLen); -<a name="l00246"></a>00246 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, -<a name="l00247"></a>00247 tFootnoteTextLen, ulBeginFootnoteText, pFile)) { -<a name="l00248"></a>00248 aucBuffer = xfree(aucBuffer); -<a name="l00249"></a>00249 <span class="keywordflow">return</span>; -<a name="l00250"></a>00250 } -<a name="l00251"></a>00251 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteTextLen); -<a name="l00252"></a>00252 -<a name="l00253"></a>00253 fail(tFootnoteTextLength != 0); -<a name="l00254"></a>00254 tFootnoteTextLength = tFootnoteTextLen / 4 - 2; -<a name="l00255"></a>00255 fail(tFootnoteTextLength == 0); -<a name="l00256"></a>00256 -<a name="l00257"></a>00257 fail(pFootnoteText != NULL); -<a name="l00258"></a>00258 pFootnoteText = xcalloc(tFootnoteTextLength, -<a name="l00259"></a>00259 <span class="keyword">sizeof</span>(footnote_local_type)); -<a name="l00260"></a>00260 -<a name="l00261"></a>00261 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteTextLength; tIndex++) { -<a name="l00262"></a>00262 pCurr = pFootnoteText + tIndex; -<a name="l00263"></a>00263 pCurr->tInfo.szText = NULL; -<a name="l00264"></a>00264 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00265"></a>00265 NO_DBG_HEX(ulOffset); -<a name="l00266"></a>00266 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00267"></a>00267 NO_DBG_HEX(ulCharPos); -<a name="l00268"></a>00268 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00269"></a>00269 pCurr->ulCharPosStart = ulCharPos; -<a name="l00270"></a>00270 ulOffset = ulGetLong(tIndex * 4 + 4, aucBuffer); -<a name="l00271"></a>00271 NO_DBG_HEX(ulOffset); -<a name="l00272"></a>00272 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00273"></a>00273 NO_DBG_HEX(ulCharPos); -<a name="l00274"></a>00274 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00275"></a>00275 pCurr->ulCharPosNext = ulCharPos; -<a name="l00276"></a>00276 pCurr->bUseful = pCurr->ulCharPosStart != pCurr->ulCharPosNext; -<a name="l00277"></a>00277 } -<a name="l00278"></a>00278 aucBuffer = xfree(aucBuffer); -<a name="l00279"></a>00279 } <span class="comment">/* end of vGet2FootnotesText */</span> -<a name="l00280"></a>00280 -<a name="l00281"></a>00281 <span class="comment">/*</span> -<a name="l00282"></a>00282 <span class="comment"> * Build the lists note information for WinWord 1/2 files</span> -<a name="l00283"></a>00283 <span class="comment"> */</span> -<a name="l00284"></a>00284 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00285"></a>00285 vGet2NotesInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00286"></a>00286 { -<a name="l00287"></a>00287 TRACE_MSG(<span class="stringliteral">"vGet2NotesInfo"</span>); -<a name="l00288"></a>00288 -<a name="l00289"></a>00289 vGet2FootnotesInfo(pFile, aucHeader); -<a name="l00290"></a>00290 vGet2FootnotesText(pFile, aucHeader); -<a name="l00291"></a>00291 <span class="comment">/* There are no endnotes in a WinWord 1/2 file */</span> -<a name="l00292"></a>00292 } <span class="comment">/* end of vGet2NotesInfo */</span> -<a name="l00293"></a>00293 -<a name="l00294"></a>00294 <span class="comment">/*</span> -<a name="l00295"></a>00295 <span class="comment"> * Build the list with footnote information for Word 6/7 files</span> -<a name="l00296"></a>00296 <span class="comment"> */</span> -<a name="l00297"></a>00297 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00298"></a>00298 vGet6FootnotesInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00299"></a>00299 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00300"></a>00300 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00301"></a>00301 { -<a name="l00302"></a>00302 UCHAR *aucBuffer; -<a name="l00303"></a>00303 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginFootnoteInfo; -<a name="l00304"></a>00304 <span class="keywordtype">size_t</span> tFootnoteInfoLen; -<a name="l00305"></a>00305 <span class="keywordtype">size_t</span> tIndex; -<a name="l00306"></a>00306 -<a name="l00307"></a>00307 TRACE_MSG(<span class="stringliteral">"vGet6FootnotesInfo"</span>); -<a name="l00308"></a>00308 -<a name="l00309"></a>00309 fail(pFile == NULL || aucHeader == NULL); -<a name="l00310"></a>00310 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00311"></a>00311 fail(aulBBD == NULL); -<a name="l00312"></a>00312 -<a name="l00313"></a>00313 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00314"></a>00314 NO_DBG_HEX(ulBeginOfText); -<a name="l00315"></a>00315 ulBeginFootnoteInfo = ulGetLong(0x68, aucHeader); <span class="comment">/* fcPlcffndRef */</span> -<a name="l00316"></a>00316 NO_DBG_HEX(ulBeginFootnoteInfo); -<a name="l00317"></a>00317 tFootnoteInfoLen = -<a name="l00318"></a>00318 (size_t)ulGetLong(0x6c, aucHeader); <span class="comment">/* lcbPlcffndRef */</span> -<a name="l00319"></a>00319 NO_DBG_DEC(tFootnoteInfoLen); -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 <span class="keywordflow">if</span> (tFootnoteInfoLen < 10) { -<a name="l00322"></a>00322 DBG_MSG(<span class="stringliteral">"No Footnotes in this document"</span>); -<a name="l00323"></a>00323 <span class="keywordflow">return</span>; -<a name="l00324"></a>00324 } -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 aucBuffer = xmalloc(tFootnoteInfoLen); -<a name="l00327"></a>00327 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00328"></a>00328 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00329"></a>00329 aucBuffer, ulBeginFootnoteInfo, tFootnoteInfoLen)) { -<a name="l00330"></a>00330 aucBuffer = xfree(aucBuffer); -<a name="l00331"></a>00331 <span class="keywordflow">return</span>; -<a name="l00332"></a>00332 } -<a name="l00333"></a>00333 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteInfoLen); -<a name="l00334"></a>00334 -<a name="l00335"></a>00335 fail(tFootnoteListLength != 0); -<a name="l00336"></a>00336 tFootnoteListLength = (tFootnoteInfoLen - 4) / 6; -<a name="l00337"></a>00337 fail(tFootnoteListLength == 0); -<a name="l00338"></a>00338 -<a name="l00339"></a>00339 fail(aulFootnoteList != NULL); -<a name="l00340"></a>00340 aulFootnoteList = xcalloc(tFootnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00341"></a>00341 -<a name="l00342"></a>00342 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteListLength; tIndex++) { -<a name="l00343"></a>00343 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00344"></a>00344 NO_DBG_HEX(ulOffset); -<a name="l00345"></a>00345 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00346"></a>00346 NO_DBG_HEX(ulFileOffset); -<a name="l00347"></a>00347 aulFootnoteList[tIndex] = ulFileOffset; -<a name="l00348"></a>00348 } -<a name="l00349"></a>00349 aucBuffer = xfree(aucBuffer); -<a name="l00350"></a>00350 } <span class="comment">/* end of vGet6FootnotesInfo */</span> -<a name="l00351"></a>00351 -<a name="l00352"></a>00352 <span class="comment">/*</span> -<a name="l00353"></a>00353 <span class="comment"> * Build the list with footnote text information for Word 6/7 files</span> -<a name="l00354"></a>00354 <span class="comment"> */</span> -<a name="l00355"></a>00355 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00356"></a>00356 vGet6FootnotesText(FILE *pFile, ULONG ulStartBlock, -<a name="l00357"></a>00357 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00358"></a>00358 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00359"></a>00359 { -<a name="l00360"></a>00360 footnote_local_type *pCurr; -<a name="l00361"></a>00361 UCHAR *aucBuffer; -<a name="l00362"></a>00362 ULONG ulCharPos, ulBeginOfFootnotes, ulOffset, ulBeginFootnoteText; -<a name="l00363"></a>00363 <span class="keywordtype">size_t</span> tFootnoteTextLen; -<a name="l00364"></a>00364 <span class="keywordtype">size_t</span> tIndex; -<a name="l00365"></a>00365 -<a name="l00366"></a>00366 TRACE_MSG(<span class="stringliteral">"vGet6FootnotesText"</span>); -<a name="l00367"></a>00367 -<a name="l00368"></a>00368 fail(pFile == NULL || aucHeader == NULL); -<a name="l00369"></a>00369 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00370"></a>00370 fail(aulBBD == NULL); -<a name="l00371"></a>00371 -<a name="l00372"></a>00372 ulBeginOfFootnotes = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00373"></a>00373 ulBeginOfFootnotes += ulGetLong(0x34, aucHeader); <span class="comment">/* ccpText */</span> -<a name="l00374"></a>00374 NO_DBG_HEX(ulBeginOfFootnotes); -<a name="l00375"></a>00375 -<a name="l00376"></a>00376 ulBeginFootnoteText = ulGetLong(0x70, aucHeader); <span class="comment">/* fcPlcffndTxt */</span> -<a name="l00377"></a>00377 NO_DBG_HEX(ulBeginFootnoteText); -<a name="l00378"></a>00378 tFootnoteTextLen = -<a name="l00379"></a>00379 (size_t)ulGetLong(0x74, aucHeader); <span class="comment">/* lcbPlcffndTxt */</span> -<a name="l00380"></a>00380 NO_DBG_DEC(tFootnoteTextLen); -<a name="l00381"></a>00381 -<a name="l00382"></a>00382 <span class="keywordflow">if</span> (tFootnoteTextLen < 12) { -<a name="l00383"></a>00383 DBG_MSG(<span class="stringliteral">"No Footnote text in this document"</span>); -<a name="l00384"></a>00384 <span class="keywordflow">return</span>; -<a name="l00385"></a>00385 } -<a name="l00386"></a>00386 -<a name="l00387"></a>00387 aucBuffer = xmalloc(tFootnoteTextLen); -<a name="l00388"></a>00388 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00389"></a>00389 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00390"></a>00390 aucBuffer, ulBeginFootnoteText, tFootnoteTextLen)) { -<a name="l00391"></a>00391 aucBuffer = xfree(aucBuffer); -<a name="l00392"></a>00392 <span class="keywordflow">return</span>; -<a name="l00393"></a>00393 } -<a name="l00394"></a>00394 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteTextLen); -<a name="l00395"></a>00395 -<a name="l00396"></a>00396 fail(tFootnoteTextLength != 0); -<a name="l00397"></a>00397 tFootnoteTextLength = tFootnoteTextLen / 4 - 2; -<a name="l00398"></a>00398 fail(tFootnoteTextLength == 0); -<a name="l00399"></a>00399 -<a name="l00400"></a>00400 fail(pFootnoteText != NULL); -<a name="l00401"></a>00401 pFootnoteText = xcalloc(tFootnoteTextLength, -<a name="l00402"></a>00402 <span class="keyword">sizeof</span>(footnote_local_type)); -<a name="l00403"></a>00403 -<a name="l00404"></a>00404 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteTextLength; tIndex++) { -<a name="l00405"></a>00405 pCurr = pFootnoteText + tIndex; -<a name="l00406"></a>00406 pCurr->tInfo.szText = NULL; -<a name="l00407"></a>00407 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00408"></a>00408 NO_DBG_HEX(ulOffset); -<a name="l00409"></a>00409 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00410"></a>00410 NO_DBG_HEX(ulCharPos); -<a name="l00411"></a>00411 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00412"></a>00412 pCurr->ulCharPosStart = ulCharPos; -<a name="l00413"></a>00413 ulOffset = ulGetLong(tIndex * 4 + 4, aucBuffer); -<a name="l00414"></a>00414 NO_DBG_HEX(ulOffset); -<a name="l00415"></a>00415 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00416"></a>00416 NO_DBG_HEX(ulCharPos); -<a name="l00417"></a>00417 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00418"></a>00418 pCurr->ulCharPosNext = ulCharPos; -<a name="l00419"></a>00419 pCurr->bUseful = pCurr->ulCharPosStart != pCurr->ulCharPosNext; -<a name="l00420"></a>00420 } -<a name="l00421"></a>00421 aucBuffer = xfree(aucBuffer); -<a name="l00422"></a>00422 } <span class="comment">/* end of vGet6FootnotesText */</span> -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 <span class="comment">/*</span> -<a name="l00425"></a>00425 <span class="comment"> * Build the list with endnote information for Word 6/7 files</span> -<a name="l00426"></a>00426 <span class="comment"> */</span> -<a name="l00427"></a>00427 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00428"></a>00428 vGet6EndnotesInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00429"></a>00429 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00430"></a>00430 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00431"></a>00431 { -<a name="l00432"></a>00432 UCHAR *aucBuffer; -<a name="l00433"></a>00433 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginEndnoteInfo; -<a name="l00434"></a>00434 <span class="keywordtype">size_t</span> tEndnoteInfoLen; -<a name="l00435"></a>00435 <span class="keywordtype">size_t</span> tIndex; -<a name="l00436"></a>00436 -<a name="l00437"></a>00437 TRACE_MSG(<span class="stringliteral">"vGet6EndnotesInfo"</span>); -<a name="l00438"></a>00438 -<a name="l00439"></a>00439 fail(pFile == NULL || aucHeader == NULL); -<a name="l00440"></a>00440 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00441"></a>00441 fail(aulBBD == NULL); -<a name="l00442"></a>00442 -<a name="l00443"></a>00443 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00444"></a>00444 NO_DBG_HEX(ulBeginOfText); -<a name="l00445"></a>00445 ulBeginEndnoteInfo = ulGetLong(0x1d2, aucHeader); <span class="comment">/* fcPlcfendRef */</span> -<a name="l00446"></a>00446 NO_DBG_HEX(ulBeginEndnoteInfo); -<a name="l00447"></a>00447 tEndnoteInfoLen = -<a name="l00448"></a>00448 (size_t)ulGetLong(0x1d6, aucHeader); <span class="comment">/* lcbPlcfendRef */</span> -<a name="l00449"></a>00449 NO_DBG_DEC(tEndnoteInfoLen); -<a name="l00450"></a>00450 -<a name="l00451"></a>00451 <span class="keywordflow">if</span> (tEndnoteInfoLen < 10) { -<a name="l00452"></a>00452 DBG_MSG(<span class="stringliteral">"No Endnotes in this document"</span>); -<a name="l00453"></a>00453 <span class="keywordflow">return</span>; -<a name="l00454"></a>00454 } -<a name="l00455"></a>00455 -<a name="l00456"></a>00456 aucBuffer = xmalloc(tEndnoteInfoLen); -<a name="l00457"></a>00457 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00458"></a>00458 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00459"></a>00459 aucBuffer, ulBeginEndnoteInfo, tEndnoteInfoLen)) { -<a name="l00460"></a>00460 aucBuffer = xfree(aucBuffer); -<a name="l00461"></a>00461 <span class="keywordflow">return</span>; -<a name="l00462"></a>00462 } -<a name="l00463"></a>00463 NO_DBG_PRINT_BLOCK(aucBuffer, tEndnoteInfoLen); -<a name="l00464"></a>00464 -<a name="l00465"></a>00465 fail(tEndnoteListLength != 0); -<a name="l00466"></a>00466 tEndnoteListLength = (tEndnoteInfoLen - 4) / 6; -<a name="l00467"></a>00467 fail(tEndnoteListLength == 0); -<a name="l00468"></a>00468 -<a name="l00469"></a>00469 fail(aulEndnoteList != NULL); -<a name="l00470"></a>00470 aulEndnoteList = xcalloc(tEndnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00471"></a>00471 -<a name="l00472"></a>00472 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tEndnoteListLength; tIndex++) { -<a name="l00473"></a>00473 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00474"></a>00474 NO_DBG_HEX(ulOffset); -<a name="l00475"></a>00475 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00476"></a>00476 NO_DBG_HEX(ulFileOffset); -<a name="l00477"></a>00477 aulEndnoteList[tIndex] = ulFileOffset; -<a name="l00478"></a>00478 } -<a name="l00479"></a>00479 aucBuffer = xfree(aucBuffer); -<a name="l00480"></a>00480 } <span class="comment">/* end of vGet6EndnotesInfo */</span> -<a name="l00481"></a>00481 -<a name="l00482"></a>00482 <span class="comment">/*</span> -<a name="l00483"></a>00483 <span class="comment"> * Build the lists note information for Word 6/7 files</span> -<a name="l00484"></a>00484 <span class="comment"> */</span> -<a name="l00485"></a>00485 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00486"></a>00486 vGet6NotesInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00487"></a>00487 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00488"></a>00488 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00489"></a>00489 { -<a name="l00490"></a>00490 TRACE_MSG(<span class="stringliteral">"vGet6NotesInfo"</span>); -<a name="l00491"></a>00491 -<a name="l00492"></a>00492 vGet6FootnotesInfo(pFile, ulStartBlock, -<a name="l00493"></a>00493 aulBBD, tBBDLen, aucHeader); -<a name="l00494"></a>00494 vGet6FootnotesText(pFile, ulStartBlock, -<a name="l00495"></a>00495 aulBBD, tBBDLen, aucHeader); -<a name="l00496"></a>00496 vGet6EndnotesInfo(pFile, ulStartBlock, -<a name="l00497"></a>00497 aulBBD, tBBDLen, aucHeader); -<a name="l00498"></a>00498 } <span class="comment">/* end of vGet6NotesInfo */</span> -<a name="l00499"></a>00499 -<a name="l00500"></a>00500 <span class="comment">/*</span> -<a name="l00501"></a>00501 <span class="comment"> * Build the list with footnote information for Word 8/9/10 files</span> -<a name="l00502"></a>00502 <span class="comment"> */</span> -<a name="l00503"></a>00503 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00504"></a>00504 vGet8FootnotesInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00505"></a>00505 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00506"></a>00506 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00507"></a>00507 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00508"></a>00508 { -<a name="l00509"></a>00509 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00510"></a>00510 UCHAR *aucBuffer; -<a name="l00511"></a>00511 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginFootnoteInfo; -<a name="l00512"></a>00512 <span class="keywordtype">size_t</span> tFootnoteInfoLen, tBlockDepotLen, tBlockSize; -<a name="l00513"></a>00513 <span class="keywordtype">size_t</span> tIndex; -<a name="l00514"></a>00514 -<a name="l00515"></a>00515 TRACE_MSG(<span class="stringliteral">"vGet8FootnotesInfo"</span>); -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00518"></a>00518 NO_DBG_HEX(ulBeginOfText); -<a name="l00519"></a>00519 ulBeginFootnoteInfo = ulGetLong(0xaa, aucHeader); <span class="comment">/* fcPlcffndRef */</span> -<a name="l00520"></a>00520 NO_DBG_HEX(ulBeginFootnoteInfo); -<a name="l00521"></a>00521 tFootnoteInfoLen = -<a name="l00522"></a>00522 (size_t)ulGetLong(0xae, aucHeader); <span class="comment">/* lcbPlcffndRef */</span> -<a name="l00523"></a>00523 NO_DBG_DEC(tFootnoteInfoLen); -<a name="l00524"></a>00524 -<a name="l00525"></a>00525 <span class="keywordflow">if</span> (tFootnoteInfoLen < 10) { -<a name="l00526"></a>00526 DBG_MSG(<span class="stringliteral">"No Footnotes in this document"</span>); -<a name="l00527"></a>00527 <span class="keywordflow">return</span>; -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 -<a name="l00530"></a>00530 NO_DBG_DEC(pPPS->tTable.ulSB); -<a name="l00531"></a>00531 NO_DBG_HEX(pPPS->tTable.ulSize); -<a name="l00532"></a>00532 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00533"></a>00533 DBG_MSG(<span class="stringliteral">"No footnotes information"</span>); -<a name="l00534"></a>00534 <span class="keywordflow">return</span>; -<a name="l00535"></a>00535 } -<a name="l00536"></a>00536 -<a name="l00537"></a>00537 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00538"></a>00538 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00539"></a>00539 aulBlockDepot = aulSBD; -<a name="l00540"></a>00540 tBlockDepotLen = tSBDLen; -<a name="l00541"></a>00541 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00542"></a>00542 } <span class="keywordflow">else</span> { -<a name="l00543"></a>00543 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00544"></a>00544 aulBlockDepot = aulBBD; -<a name="l00545"></a>00545 tBlockDepotLen = tBBDLen; -<a name="l00546"></a>00546 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00547"></a>00547 } -<a name="l00548"></a>00548 aucBuffer = xmalloc(tFootnoteInfoLen); -<a name="l00549"></a>00549 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00550"></a>00550 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00551"></a>00551 aucBuffer, ulBeginFootnoteInfo, tFootnoteInfoLen)) { -<a name="l00552"></a>00552 aucBuffer = xfree(aucBuffer); -<a name="l00553"></a>00553 <span class="keywordflow">return</span>; -<a name="l00554"></a>00554 } -<a name="l00555"></a>00555 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteInfoLen); -<a name="l00556"></a>00556 -<a name="l00557"></a>00557 fail(tFootnoteListLength != 0); -<a name="l00558"></a>00558 tFootnoteListLength = (tFootnoteInfoLen - 4) / 6; -<a name="l00559"></a>00559 fail(tFootnoteListLength == 0); -<a name="l00560"></a>00560 -<a name="l00561"></a>00561 fail(aulFootnoteList != NULL); -<a name="l00562"></a>00562 aulFootnoteList = xcalloc(tFootnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00563"></a>00563 -<a name="l00564"></a>00564 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteListLength; tIndex++) { -<a name="l00565"></a>00565 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00566"></a>00566 NO_DBG_HEX(ulOffset); -<a name="l00567"></a>00567 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00568"></a>00568 NO_DBG_HEX(ulFileOffset); -<a name="l00569"></a>00569 aulFootnoteList[tIndex] = ulFileOffset; -<a name="l00570"></a>00570 } -<a name="l00571"></a>00571 aucBuffer = xfree(aucBuffer); -<a name="l00572"></a>00572 } <span class="comment">/* end of vGet8FootnotesInfo */</span> -<a name="l00573"></a>00573 -<a name="l00574"></a>00574 <span class="comment">/*</span> -<a name="l00575"></a>00575 <span class="comment"> * Build the list with footnote text information for Word 8/9/10 files</span> -<a name="l00576"></a>00576 <span class="comment"> */</span> -<a name="l00577"></a>00577 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00578"></a>00578 vGet8FootnotesText(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00579"></a>00579 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00580"></a>00580 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00581"></a>00581 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00582"></a>00582 { -<a name="l00583"></a>00583 footnote_local_type *pCurr; -<a name="l00584"></a>00584 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00585"></a>00585 UCHAR *aucBuffer; -<a name="l00586"></a>00586 ULONG ulCharPos, ulBeginOfFootnotes, ulOffset, ulBeginFootnoteText; -<a name="l00587"></a>00587 <span class="keywordtype">size_t</span> tFootnoteTextLen, tBlockDepotLen, tBlockSize; -<a name="l00588"></a>00588 <span class="keywordtype">size_t</span> tIndex; -<a name="l00589"></a>00589 -<a name="l00590"></a>00590 TRACE_MSG(<span class="stringliteral">"vGet8FootnotesText"</span>); -<a name="l00591"></a>00591 -<a name="l00592"></a>00592 ulBeginOfFootnotes = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00593"></a>00593 ulBeginOfFootnotes += ulGetLong(0x4c, aucHeader); <span class="comment">/* ccpText */</span> -<a name="l00594"></a>00594 NO_DBG_HEX(ulBeginOfFootnotes); -<a name="l00595"></a>00595 -<a name="l00596"></a>00596 ulBeginFootnoteText = ulGetLong(0xb2, aucHeader); <span class="comment">/* fcPlcffndTxt */</span> -<a name="l00597"></a>00597 NO_DBG_HEX(ulBeginFootnoteText); -<a name="l00598"></a>00598 tFootnoteTextLen = -<a name="l00599"></a>00599 (size_t)ulGetLong(0xb6, aucHeader); <span class="comment">/* lcbPlcffndTxt */</span> -<a name="l00600"></a>00600 NO_DBG_DEC(tFootnoteTextLen); -<a name="l00601"></a>00601 -<a name="l00602"></a>00602 <span class="keywordflow">if</span> (tFootnoteTextLen < 12) { -<a name="l00603"></a>00603 DBG_MSG(<span class="stringliteral">"No Footnote text in this document"</span>); -<a name="l00604"></a>00604 <span class="keywordflow">return</span>; -<a name="l00605"></a>00605 } -<a name="l00606"></a>00606 -<a name="l00607"></a>00607 NO_DBG_DEC(pPPS->tTable.ulSB); -<a name="l00608"></a>00608 NO_DBG_HEX(pPPS->tTable.ulSize); -<a name="l00609"></a>00609 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00610"></a>00610 DBG_MSG(<span class="stringliteral">"No footnote text information"</span>); -<a name="l00611"></a>00611 <span class="keywordflow">return</span>; -<a name="l00612"></a>00612 } -<a name="l00613"></a>00613 -<a name="l00614"></a>00614 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00615"></a>00615 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00616"></a>00616 aulBlockDepot = aulSBD; -<a name="l00617"></a>00617 tBlockDepotLen = tSBDLen; -<a name="l00618"></a>00618 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00619"></a>00619 } <span class="keywordflow">else</span> { -<a name="l00620"></a>00620 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00621"></a>00621 aulBlockDepot = aulBBD; -<a name="l00622"></a>00622 tBlockDepotLen = tBBDLen; -<a name="l00623"></a>00623 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00624"></a>00624 } -<a name="l00625"></a>00625 aucBuffer = xmalloc(tFootnoteTextLen); -<a name="l00626"></a>00626 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00627"></a>00627 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00628"></a>00628 aucBuffer, ulBeginFootnoteText, tFootnoteTextLen)) { -<a name="l00629"></a>00629 aucBuffer = xfree(aucBuffer); -<a name="l00630"></a>00630 <span class="keywordflow">return</span>; -<a name="l00631"></a>00631 } -<a name="l00632"></a>00632 NO_DBG_PRINT_BLOCK(aucBuffer, tFootnoteTextLen); -<a name="l00633"></a>00633 -<a name="l00634"></a>00634 fail(tFootnoteTextLength != 0); -<a name="l00635"></a>00635 tFootnoteTextLength = tFootnoteTextLen / 4 - 2; -<a name="l00636"></a>00636 fail(tFootnoteTextLength == 0); -<a name="l00637"></a>00637 -<a name="l00638"></a>00638 fail(pFootnoteText != NULL); -<a name="l00639"></a>00639 pFootnoteText = xcalloc(tFootnoteTextLength, -<a name="l00640"></a>00640 <span class="keyword">sizeof</span>(footnote_local_type)); -<a name="l00641"></a>00641 -<a name="l00642"></a>00642 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteTextLength; tIndex++) { -<a name="l00643"></a>00643 pCurr = pFootnoteText + tIndex; -<a name="l00644"></a>00644 pCurr->tInfo.szText = NULL; -<a name="l00645"></a>00645 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00646"></a>00646 NO_DBG_HEX(ulOffset); -<a name="l00647"></a>00647 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00648"></a>00648 NO_DBG_HEX(ulCharPos); -<a name="l00649"></a>00649 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00650"></a>00650 pCurr->ulCharPosStart = ulCharPos; -<a name="l00651"></a>00651 ulOffset = ulGetLong(tIndex * 4 + 4, aucBuffer); -<a name="l00652"></a>00652 NO_DBG_HEX(ulOffset); -<a name="l00653"></a>00653 ulCharPos = ulBeginOfFootnotes + ulOffset; -<a name="l00654"></a>00654 NO_DBG_HEX(ulCharPos); -<a name="l00655"></a>00655 NO_DBG_HEX(ulCharPos2FileOffset(ulCharPos)); -<a name="l00656"></a>00656 pCurr->ulCharPosNext = ulCharPos; -<a name="l00657"></a>00657 pCurr->bUseful = pCurr->ulCharPosStart != pCurr->ulCharPosNext; -<a name="l00658"></a>00658 } -<a name="l00659"></a>00659 aucBuffer = xfree(aucBuffer); -<a name="l00660"></a>00660 } <span class="comment">/* end of vGet8FootnotesText */</span> -<a name="l00661"></a>00661 -<a name="l00662"></a>00662 <span class="comment">/*</span> -<a name="l00663"></a>00663 <span class="comment"> * Build the list with endnote information for Word 8/9/10 files</span> -<a name="l00664"></a>00664 <span class="comment"> */</span> -<a name="l00665"></a>00665 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00666"></a>00666 vGet8EndnotesInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00667"></a>00667 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00668"></a>00668 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00669"></a>00669 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00670"></a>00670 { -<a name="l00671"></a>00671 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00672"></a>00672 UCHAR *aucBuffer; -<a name="l00673"></a>00673 ULONG ulFileOffset, ulBeginOfText, ulOffset, ulBeginEndnoteInfo; -<a name="l00674"></a>00674 <span class="keywordtype">size_t</span> tEndnoteInfoLen, tBlockDepotLen, tBlockSize; -<a name="l00675"></a>00675 <span class="keywordtype">size_t</span> tIndex; -<a name="l00676"></a>00676 -<a name="l00677"></a>00677 TRACE_MSG(<span class="stringliteral">"vGet8EndnotesInfo"</span>); -<a name="l00678"></a>00678 -<a name="l00679"></a>00679 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00680"></a>00680 NO_DBG_HEX(ulBeginOfText); -<a name="l00681"></a>00681 ulBeginEndnoteInfo = ulGetLong(0x20a, aucHeader); <span class="comment">/* fcPlcfendRef */</span> -<a name="l00682"></a>00682 NO_DBG_HEX(ulBeginEndnoteInfo); -<a name="l00683"></a>00683 tEndnoteInfoLen = (size_t)ulGetLong(0x20e, aucHeader); <span class="comment">/* lcbPlcfendRef */</span> -<a name="l00684"></a>00684 NO_DBG_DEC(tEndnoteInfoLen); -<a name="l00685"></a>00685 -<a name="l00686"></a>00686 <span class="keywordflow">if</span> (tEndnoteInfoLen < 10) { -<a name="l00687"></a>00687 DBG_MSG(<span class="stringliteral">"No endnotes in this document"</span>); -<a name="l00688"></a>00688 <span class="keywordflow">return</span>; -<a name="l00689"></a>00689 } -<a name="l00690"></a>00690 -<a name="l00691"></a>00691 NO_DBG_DEC(pPPS->tTable.ulSB); -<a name="l00692"></a>00692 NO_DBG_HEX(pPPS->tTable.ulSize); -<a name="l00693"></a>00693 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00694"></a>00694 DBG_MSG(<span class="stringliteral">"No endnotes information"</span>); -<a name="l00695"></a>00695 <span class="keywordflow">return</span>; -<a name="l00696"></a>00696 } -<a name="l00697"></a>00697 -<a name="l00698"></a>00698 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00699"></a>00699 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00700"></a>00700 aulBlockDepot = aulSBD; -<a name="l00701"></a>00701 tBlockDepotLen = tSBDLen; -<a name="l00702"></a>00702 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00703"></a>00703 } <span class="keywordflow">else</span> { -<a name="l00704"></a>00704 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00705"></a>00705 aulBlockDepot = aulBBD; -<a name="l00706"></a>00706 tBlockDepotLen = tBBDLen; -<a name="l00707"></a>00707 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00708"></a>00708 } -<a name="l00709"></a>00709 aucBuffer = xmalloc(tEndnoteInfoLen); -<a name="l00710"></a>00710 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00711"></a>00711 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00712"></a>00712 aucBuffer, ulBeginEndnoteInfo, tEndnoteInfoLen)) { -<a name="l00713"></a>00713 aucBuffer = xfree(aucBuffer); -<a name="l00714"></a>00714 <span class="keywordflow">return</span>; -<a name="l00715"></a>00715 } -<a name="l00716"></a>00716 NO_DBG_PRINT_BLOCK(aucBuffer, tEndnoteInfoLen); -<a name="l00717"></a>00717 -<a name="l00718"></a>00718 fail(tEndnoteListLength != 0); -<a name="l00719"></a>00719 tEndnoteListLength = (tEndnoteInfoLen - 4) / 6; -<a name="l00720"></a>00720 fail(tEndnoteListLength == 0); -<a name="l00721"></a>00721 -<a name="l00722"></a>00722 fail(aulEndnoteList != NULL); -<a name="l00723"></a>00723 aulEndnoteList = xcalloc(tEndnoteListLength, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00724"></a>00724 -<a name="l00725"></a>00725 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tEndnoteListLength; tIndex++) { -<a name="l00726"></a>00726 ulOffset = ulGetLong(tIndex * 4, aucBuffer); -<a name="l00727"></a>00727 NO_DBG_HEX(ulOffset); -<a name="l00728"></a>00728 ulFileOffset = ulCharPos2FileOffset(ulBeginOfText + ulOffset); -<a name="l00729"></a>00729 NO_DBG_HEX(ulFileOffset); -<a name="l00730"></a>00730 aulEndnoteList[tIndex] = ulFileOffset; -<a name="l00731"></a>00731 } -<a name="l00732"></a>00732 aucBuffer = xfree(aucBuffer); -<a name="l00733"></a>00733 } <span class="comment">/* end of vGet8EndnotesInfo */</span> -<a name="l00734"></a>00734 -<a name="l00735"></a>00735 <span class="comment">/*</span> -<a name="l00736"></a>00736 <span class="comment"> * Build the lists with footnote and endnote information for Word 8/9/10 files</span> -<a name="l00737"></a>00737 <span class="comment"> */</span> -<a name="l00738"></a>00738 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00739"></a>00739 vGet8NotesInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00740"></a>00740 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00741"></a>00741 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00742"></a>00742 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00743"></a>00743 { -<a name="l00744"></a>00744 TRACE_MSG(<span class="stringliteral">"vGet8NotesInfo"</span>); -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 vGet8FootnotesInfo(pFile, pPPS, -<a name="l00747"></a>00747 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00748"></a>00748 vGet8FootnotesText(pFile, pPPS, -<a name="l00749"></a>00749 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00750"></a>00750 vGet8EndnotesInfo(pFile, pPPS, -<a name="l00751"></a>00751 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00752"></a>00752 } <span class="comment">/* end of vGet8NotesInfo */</span> -<a name="l00753"></a>00753 -<a name="l00754"></a>00754 <span class="comment">/*</span> -<a name="l00755"></a>00755 <span class="comment"> * Build the lists with footnote and endnote information</span> -<a name="l00756"></a>00756 <span class="comment"> */</span> -<a name="l00757"></a>00757 <span class="keywordtype">void</span> -<a name="l00758"></a>00758 vGetNotesInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00759"></a>00759 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00760"></a>00760 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00761"></a>00761 <span class="keyword">const</span> UCHAR *aucHeader, <span class="keywordtype">int</span> iWordVersion) -<a name="l00762"></a>00762 { -<a name="l00763"></a>00763 TRACE_MSG(<span class="stringliteral">"vGetNotesInfo"</span>); -<a name="l00764"></a>00764 -<a name="l00765"></a>00765 fail(pFile == NULL); -<a name="l00766"></a>00766 fail(pPPS == NULL && iWordVersion >= 6); -<a name="l00767"></a>00767 fail(aulBBD == NULL && tBBDLen != 0); -<a name="l00768"></a>00768 fail(aulSBD == NULL && tSBDLen != 0); -<a name="l00769"></a>00769 fail(aucHeader == NULL); -<a name="l00770"></a>00770 -<a name="l00771"></a>00771 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00772"></a>00772 <span class="keywordflow">case</span> 0: -<a name="l00773"></a>00773 vGet0NotesInfo(pFile, aucHeader); -<a name="l00774"></a>00774 <span class="keywordflow">break</span>; -<a name="l00775"></a>00775 <span class="keywordflow">case</span> 1: -<a name="l00776"></a>00776 <span class="keywordflow">case</span> 2: -<a name="l00777"></a>00777 vGet2NotesInfo(pFile, aucHeader); -<a name="l00778"></a>00778 <span class="keywordflow">break</span>; -<a name="l00779"></a>00779 <span class="keywordflow">case</span> 4: -<a name="l00780"></a>00780 <span class="keywordflow">case</span> 5: -<a name="l00781"></a>00781 <span class="keywordflow">break</span>; -<a name="l00782"></a>00782 <span class="keywordflow">case</span> 6: -<a name="l00783"></a>00783 <span class="keywordflow">case</span> 7: -<a name="l00784"></a>00784 vGet6NotesInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00785"></a>00785 aulBBD, tBBDLen, aucHeader); -<a name="l00786"></a>00786 <span class="keywordflow">break</span>; -<a name="l00787"></a>00787 <span class="keywordflow">case</span> 8: -<a name="l00788"></a>00788 vGet8NotesInfo(pFile, pPPS, -<a name="l00789"></a>00789 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00790"></a>00790 <span class="keywordflow">break</span>; -<a name="l00791"></a>00791 <span class="keywordflow">default</span>: -<a name="l00792"></a>00792 werr(0, <span class="stringliteral">"Sorry, no notes information"</span>); -<a name="l00793"></a>00793 <span class="keywordflow">break</span>; -<a name="l00794"></a>00794 } -<a name="l00795"></a>00795 } <span class="comment">/* end of vGetNotesInfo */</span> -<a name="l00796"></a>00796 -<a name="l00797"></a>00797 <span class="comment">/*</span> -<a name="l00798"></a>00798 <span class="comment"> * vPrepareFootnoteText - prepare the footnote text</span> -<a name="l00799"></a>00799 <span class="comment"> */</span> -<a name="l00800"></a>00800 <span class="keywordtype">void</span> -<a name="l00801"></a>00801 vPrepareFootnoteText(FILE *pFile) -<a name="l00802"></a>00802 { -<a name="l00803"></a>00803 footnote_local_type *pCurr; -<a name="l00804"></a>00804 <span class="keywordtype">size_t</span> tFootnote; -<a name="l00805"></a>00805 -<a name="l00806"></a>00806 fail(pFile == NULL); -<a name="l00807"></a>00807 fail(pFootnoteText == NULL && tFootnoteTextLength != 0); -<a name="l00808"></a>00808 -<a name="l00809"></a>00809 <span class="keywordflow">if</span> (pFootnoteText == NULL || tFootnoteTextLength == 0) { -<a name="l00810"></a>00810 <span class="comment">/* No information */</span> -<a name="l00811"></a>00811 <span class="keywordflow">return</span>; -<a name="l00812"></a>00812 } -<a name="l00813"></a>00813 -<a name="l00814"></a>00814 <span class="comment">/* Fill text and useful-ness */</span> -<a name="l00815"></a>00815 <span class="keywordflow">for</span> (tFootnote = 0; tFootnote < tFootnoteTextLength; tFootnote++) { -<a name="l00816"></a>00816 pCurr = pFootnoteText + tFootnote; -<a name="l00817"></a>00817 pCurr->bUseful = pCurr->ulCharPosStart != pCurr->ulCharPosNext; -<a name="l00818"></a>00818 <span class="keywordflow">if</span> (pCurr->bUseful) { -<a name="l00819"></a>00819 pCurr->tInfo.szText = szFootnoteDecryptor(pFile, -<a name="l00820"></a>00820 pCurr->ulCharPosStart, -<a name="l00821"></a>00821 pCurr->ulCharPosNext); -<a name="l00822"></a>00822 } <span class="keywordflow">else</span> { -<a name="l00823"></a>00823 pCurr->tInfo.szText = NULL; -<a name="l00824"></a>00824 } -<a name="l00825"></a>00825 } -<a name="l00826"></a>00826 } <span class="comment">/* end of vPrepareFootnoteText */</span> -<a name="l00827"></a>00827 -<a name="l00828"></a>00828 <span class="comment">/*</span> -<a name="l00829"></a>00829 <span class="comment"> * szGetFootnootText - get the text of the spefified footnote</span> -<a name="l00830"></a>00830 <span class="comment"> */</span> -<a name="l00831"></a>00831 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00832"></a>00832 szGetFootnootText(UINT uiFootnoteIndex) -<a name="l00833"></a>00833 { -<a name="l00834"></a>00834 <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)uiFootnoteIndex >= tFootnoteTextLength) { -<a name="l00835"></a>00835 <span class="keywordflow">return</span> NULL; -<a name="l00836"></a>00836 } -<a name="l00837"></a>00837 <span class="keywordflow">return</span> pFootnoteText[uiFootnoteIndex].tInfo.szText; -<a name="l00838"></a>00838 } <span class="comment">/* end of szGetFootnootText */</span> -<a name="l00839"></a>00839 -<a name="l00840"></a>00840 <span class="comment">/*</span> -<a name="l00841"></a>00841 <span class="comment"> * Get the notetype of the note at the given fileoffset</span> -<a name="l00842"></a>00842 <span class="comment"> */</span> -<a name="l00843"></a>00843 notetype_enum -<a name="l00844"></a>00844 eGetNotetype(ULONG ulFileOffset) -<a name="l00845"></a>00845 { -<a name="l00846"></a>00846 <span class="keywordtype">size_t</span> tIndex; -<a name="l00847"></a>00847 -<a name="l00848"></a>00848 TRACE_MSG(<span class="stringliteral">"eGetNotetype"</span>); -<a name="l00849"></a>00849 -<a name="l00850"></a>00850 fail(aulFootnoteList == NULL && tFootnoteListLength != 0); -<a name="l00851"></a>00851 fail(aulEndnoteList == NULL && tEndnoteListLength != 0); -<a name="l00852"></a>00852 -<a name="l00853"></a>00853 <span class="comment">/* Go for the easy answers first */</span> -<a name="l00854"></a>00854 <span class="keywordflow">if</span> (tFootnoteListLength == 0 && tEndnoteListLength == 0) { -<a name="l00855"></a>00855 <span class="keywordflow">return</span> notetype_is_unknown; -<a name="l00856"></a>00856 } -<a name="l00857"></a>00857 <span class="keywordflow">if</span> (tEndnoteListLength == 0) { -<a name="l00858"></a>00858 <span class="keywordflow">return</span> notetype_is_footnote; -<a name="l00859"></a>00859 } -<a name="l00860"></a>00860 <span class="keywordflow">if</span> (tFootnoteListLength == 0) { -<a name="l00861"></a>00861 <span class="keywordflow">return</span> notetype_is_endnote; -<a name="l00862"></a>00862 } -<a name="l00863"></a>00863 <span class="comment">/* No easy answer, so we search */</span> -<a name="l00864"></a>00864 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tFootnoteListLength; tIndex++) { -<a name="l00865"></a>00865 <span class="keywordflow">if</span> (aulFootnoteList[tIndex] == ulFileOffset) { -<a name="l00866"></a>00866 <span class="keywordflow">return</span> notetype_is_footnote; -<a name="l00867"></a>00867 } -<a name="l00868"></a>00868 } -<a name="l00869"></a>00869 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tEndnoteListLength; tIndex++) { -<a name="l00870"></a>00870 <span class="keywordflow">if</span> (aulEndnoteList[tIndex] == ulFileOffset) { -<a name="l00871"></a>00871 <span class="keywordflow">return</span> notetype_is_endnote; -<a name="l00872"></a>00872 } -<a name="l00873"></a>00873 } -<a name="l00874"></a>00874 <span class="comment">/* Not found */</span> -<a name="l00875"></a>00875 <span class="keywordflow">return</span> notetype_is_unknown; -<a name="l00876"></a>00876 } <span class="comment">/* end of eGetNotetype */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/options_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,978 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/options.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/options.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * options.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read and write the options</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "DeskLib:Wimp.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#else</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#include <stdlib.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#if defined(__dos) || defined(N_PLAT_NLM)</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">int</span> getopt(<span class="keywordtype">int</span>, <span class="keywordtype">char</span> **, <span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00019"></a>00019 <span class="preprocessor">#else</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#include <unistd.h></span> -<a name="l00021"></a>00021 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00022"></a>00022 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00023"></a>00023 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define PARAGRAPH_BREAK "set paragraph_break=%d"</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define AUTOFILETYPE "set autofiletype_allowed=%d"</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define USE_OUTLINEFONTS "set use_outlinefonts=%d"</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#define SHOW_IMAGES "set show_images=%d"</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define HIDE_HIDDEN_TEXT "set hide_hidden_text=%d"</span> -<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define SCALE_FACTOR_START "set scale_factor_start=%d"</span> -<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define LEAFNAME_SIZE (32+1)</span> -<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00035"></a>00035 -<a name="l00036"></a>00036 <span class="comment">/* Current values for options */</span> -<a name="l00037"></a>00037 <span class="keyword">static</span> options_type tOptionsCurr; -<a name="l00038"></a>00038 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="comment">/* Temporary values for options */</span> -<a name="l00040"></a>00040 <span class="keyword">static</span> options_type tOptionsTemp; -<a name="l00041"></a>00041 <span class="preprocessor">#else</span> -<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>papersize_tag { -<a name="l00043"></a>00043 <span class="keywordtype">char</span> szName[16]; <span class="comment">/* Papersize name */</span> -<a name="l00044"></a>00044 USHORT usWidth; <span class="comment">/* In points */</span> -<a name="l00045"></a>00045 USHORT usHeight; <span class="comment">/* In points */</span> -<a name="l00046"></a>00046 } papersize_type; -<a name="l00047"></a>00047 -<a name="l00048"></a>00048 <span class="keyword">static</span> <span class="keyword">const</span> papersize_type atPaperSizes[] = { -<a name="l00049"></a>00049 { <span class="stringliteral">"10x14"</span>, 720, 1008 }, -<a name="l00050"></a>00050 { <span class="stringliteral">"a3"</span>, 842, 1191 }, -<a name="l00051"></a>00051 { <span class="stringliteral">"a4"</span>, 595, 842 }, -<a name="l00052"></a>00052 { <span class="stringliteral">"a5"</span>, 420, 595 }, -<a name="l00053"></a>00053 { <span class="stringliteral">"b4"</span>, 729, 1032 }, -<a name="l00054"></a>00054 { <span class="stringliteral">"b5"</span>, 516, 729 }, -<a name="l00055"></a>00055 { <span class="stringliteral">"executive"</span>, 540, 720 }, -<a name="l00056"></a>00056 { <span class="stringliteral">"folio"</span>, 612, 936 }, -<a name="l00057"></a>00057 { <span class="stringliteral">"legal"</span>, 612, 1008 }, -<a name="l00058"></a>00058 { <span class="stringliteral">"letter"</span>, 612, 792 }, -<a name="l00059"></a>00059 { <span class="stringliteral">"note"</span>, 540, 720 }, -<a name="l00060"></a>00060 { <span class="stringliteral">"quarto"</span>, 610, 780 }, -<a name="l00061"></a>00061 { <span class="stringliteral">"statement"</span>, 396, 612 }, -<a name="l00062"></a>00062 { <span class="stringliteral">"tabloid"</span>, 792, 1224 }, -<a name="l00063"></a>00063 { <span class="stringliteral">""</span>, 0, 0 }, -<a name="l00064"></a>00064 }; -<a name="l00065"></a>00065 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00066"></a>00066 <span class="comment">/* Default values for options */</span> -<a name="l00067"></a>00067 <span class="keyword">static</span> <span class="keyword">const</span> options_type tOptionsDefault = { -<a name="l00068"></a>00068 DEFAULT_SCREEN_WIDTH, -<a name="l00069"></a>00069 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00070"></a>00070 <span class="preprocessor"></span> conversion_draw, -<a name="l00071"></a>00071 <span class="preprocessor">#else</span> -<a name="l00072"></a>00072 <span class="preprocessor"></span> conversion_text, -<a name="l00073"></a>00073 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00074"></a>00074 TRUE, -<a name="l00075"></a>00075 TRUE, -<a name="l00076"></a>00076 FALSE, -<a name="l00077"></a>00077 encoding_latin_1, -<a name="l00078"></a>00078 INT_MAX, -<a name="l00079"></a>00079 INT_MAX, -<a name="l00080"></a>00080 level_default, -<a name="l00081"></a>00081 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00082"></a>00082 <span class="preprocessor"></span> TRUE, -<a name="l00083"></a>00083 DEFAULT_SCALE_FACTOR, -<a name="l00084"></a>00084 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00085"></a>00085 }; -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00090"></a>00090 <span class="comment"> * bCorrectPapersize - see if the papersize is correct</span> -<a name="l00091"></a>00091 <span class="comment"> *</span> -<a name="l00092"></a>00092 <span class="comment"> * TRUE if the papersize is correct, otherwise FALSE</span> -<a name="l00093"></a>00093 <span class="comment"> */</span> -<a name="l00094"></a>00094 <span class="keyword">static</span> BOOL -<a name="l00095"></a>00095 bCorrectPapersize(<span class="keyword">const</span> <span class="keywordtype">char</span> *szName, conversion_type eConversionType) -<a name="l00096"></a>00096 { -<a name="l00097"></a>00097 <span class="keyword">const</span> papersize_type *pPaperSize; -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 <span class="keywordflow">for</span> (pPaperSize = atPaperSizes; -<a name="l00100"></a>00100 pPaperSize->szName[0] != <span class="charliteral">'\0'</span>; -<a name="l00101"></a>00101 pPaperSize++) { -<a name="l00102"></a>00102 <span class="keywordflow">if</span> (!STRCEQ(pPaperSize->szName, szName)) { -<a name="l00103"></a>00103 <span class="keywordflow">continue</span>; -<a name="l00104"></a>00104 } -<a name="l00105"></a>00105 DBG_DEC(pPaperSize->usWidth); -<a name="l00106"></a>00106 DBG_DEC(pPaperSize->usHeight); -<a name="l00107"></a>00107 tOptionsCurr.eConversionType = eConversionType; -<a name="l00108"></a>00108 tOptionsCurr.iPageHeight = (int)pPaperSize->usHeight; -<a name="l00109"></a>00109 tOptionsCurr.iPageWidth = (<span class="keywordtype">int</span>)pPaperSize->usWidth; -<a name="l00110"></a>00110 <span class="keywordflow">return</span> TRUE; -<a name="l00111"></a>00111 } -<a name="l00112"></a>00112 <span class="keywordflow">return</span> FALSE; -<a name="l00113"></a>00113 } <span class="comment">/* end of bCorrectPapersize */</span> -<a name="l00114"></a>00114 -<a name="l00115"></a>00115 <span class="comment">/*</span> -<a name="l00116"></a>00116 <span class="comment"> * szCreateSuffix - create a suffix for the file</span> -<a name="l00117"></a>00117 <span class="comment"> *</span> -<a name="l00118"></a>00118 <span class="comment"> * Returns the suffix</span> -<a name="l00119"></a>00119 <span class="comment"> */</span> -<a name="l00120"></a>00120 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00121"></a>00121 szCreateSuffix(<span class="keyword">const</span> <span class="keywordtype">char</span> *szLeafname) -<a name="l00122"></a>00122 { -<a name="l00123"></a>00123 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcDot; -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 pcDot = strrchr(szLeafname, <span class="charliteral">'.'</span>); -<a name="l00126"></a>00126 <span class="keywordflow">if</span> (pcDot != NULL && STRCEQ(pcDot, <span class="stringliteral">".txt"</span>)) { -<a name="l00127"></a>00127 <span class="comment">/* There is already a .txt suffix, no need for another one */</span> -<a name="l00128"></a>00128 <span class="keywordflow">return</span> <span class="stringliteral">""</span>; -<a name="l00129"></a>00129 } -<a name="l00130"></a>00130 <span class="keywordflow">return</span> <span class="stringliteral">".txt"</span>; -<a name="l00131"></a>00131 } <span class="comment">/* end of szCreateSuffix */</span> -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 <span class="comment">/*</span> -<a name="l00134"></a>00134 <span class="comment"> * eMappingFile2Encoding - convert the mapping file to an encoding</span> -<a name="l00135"></a>00135 <span class="comment"> */</span> -<a name="l00136"></a>00136 <span class="keyword">static</span> encoding_type -<a name="l00137"></a>00137 eMappingFile2Encoding(<span class="keyword">const</span> <span class="keywordtype">char</span> *szLeafname) -<a name="l00138"></a>00138 { -<a name="l00139"></a>00139 <span class="keywordtype">char</span> szMappingFile[LEAFNAME_SIZE+4]; -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 fail(szLeafname == NULL); -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (strlen(szLeafname) + 4 >= <span class="keyword">sizeof</span>(szMappingFile)) { -<a name="l00144"></a>00144 DBG_MSG(szLeafname); -<a name="l00145"></a>00145 <span class="keywordflow">return</span> encoding_latin_1; -<a name="l00146"></a>00146 } -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 sprintf(szMappingFile, <span class="stringliteral">"%s%s"</span>, szLeafname, szCreateSuffix(szLeafname)); -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 DBG_MSG(szMappingFile); -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 <span class="keywordflow">if</span> (STRCEQ(szMappingFile, MAPPING_FILE_UTF_8)) { -<a name="l00153"></a>00153 <span class="keywordflow">return</span> encoding_utf_8; -<a name="l00154"></a>00154 } -<a name="l00155"></a>00155 <span class="keywordflow">if</span> (STRCEQ(szMappingFile, MAPPING_FILE_CP852) || -<a name="l00156"></a>00156 STRCEQ(szMappingFile, MAPPING_FILE_CP1250) || -<a name="l00157"></a>00157 STRCEQ(szMappingFile, MAPPING_FILE_8859_2)) { -<a name="l00158"></a>00158 <span class="keywordflow">return</span> encoding_latin_2; -<a name="l00159"></a>00159 } -<a name="l00160"></a>00160 <span class="keywordflow">if</span> (STRCEQ(szMappingFile, MAPPING_FILE_KOI8_R) || -<a name="l00161"></a>00161 STRCEQ(szMappingFile, MAPPING_FILE_KOI8_U) || -<a name="l00162"></a>00162 STRCEQ(szMappingFile, MAPPING_FILE_CP866) || -<a name="l00163"></a>00163 STRCEQ(szMappingFile, MAPPING_FILE_CP1251) || -<a name="l00164"></a>00164 STRCEQ(szMappingFile, MAPPING_FILE_8859_5)) { -<a name="l00165"></a>00165 <span class="keywordflow">return</span> encoding_cyrillic; -<a name="l00166"></a>00166 } -<a name="l00167"></a>00167 <span class="keywordflow">return</span> encoding_latin_1; -<a name="l00168"></a>00168 } <span class="comment">/* end of eMappingFile2Encoding */</span> -<a name="l00169"></a>00169 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 <span class="comment">/*</span> -<a name="l00172"></a>00172 <span class="comment"> * pOpenCharacterMappingFile - open the mapping file</span> -<a name="l00173"></a>00173 <span class="comment"> *</span> -<a name="l00174"></a>00174 <span class="comment"> * Returns the file pointer or NULL</span> -<a name="l00175"></a>00175 <span class="comment"> */</span> -<a name="l00176"></a>00176 <span class="keyword">static</span> FILE * -<a name="l00177"></a>00177 pOpenCharacterMappingFile(<span class="keyword">const</span> <span class="keywordtype">char</span> *szLeafname) -<a name="l00178"></a>00178 { -<a name="l00179"></a>00179 <span class="preprocessor">#if !defined(__riscos)</span> -<a name="l00180"></a>00180 <span class="preprocessor"></span> FILE *pFile; -<a name="l00181"></a>00181 <span class="keyword">const</span> <span class="keywordtype">char</span> *szHome, *szAntiword, *szSuffix; -<a name="l00182"></a>00182 <span class="keywordtype">size_t</span> tFilenameLen; -<a name="l00183"></a>00183 <span class="keywordtype">char</span> szMappingFile[PATH_MAX+1]; -<a name="l00184"></a>00184 <span class="preprocessor">#endif </span><span class="comment">/* !__riscos */</span> -<a name="l00185"></a>00185 -<a name="l00186"></a>00186 <span class="keywordflow">if</span> (szLeafname == NULL || szLeafname[0] == <span class="charliteral">'\0'</span>) { -<a name="l00187"></a>00187 <span class="keywordflow">return</span> NULL; -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 -<a name="l00190"></a>00190 DBG_MSG(szLeafname); -<a name="l00191"></a>00191 -<a name="l00192"></a>00192 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00193"></a>00193 <span class="preprocessor"></span> <span class="keywordflow">return</span> fopen(szLeafname, <span class="stringliteral">"r"</span>); -<a name="l00194"></a>00194 <span class="preprocessor">#else</span> -<a name="l00195"></a>00195 <span class="preprocessor"></span> <span class="comment">/* Set the suffix */</span> -<a name="l00196"></a>00196 szSuffix = szCreateSuffix(szLeafname); -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 <span class="comment">/* Set length */</span> -<a name="l00199"></a>00199 tFilenameLen = strlen(szLeafname) + strlen(szSuffix); -<a name="l00200"></a>00200 -<a name="l00201"></a>00201 <span class="comment">/* Try the environment version of the mapping file */</span> -<a name="l00202"></a>00202 szAntiword = szGetAntiwordDirectory(); -<a name="l00203"></a>00203 <span class="keywordflow">if</span> (szAntiword != NULL && szAntiword[0] != <span class="charliteral">'\0'</span>) { -<a name="l00204"></a>00204 <span class="keywordflow">if</span> (strlen(szAntiword) + tFilenameLen < -<a name="l00205"></a>00205 <span class="keyword">sizeof</span>(szMappingFile) - -<a name="l00206"></a>00206 <span class="keyword">sizeof</span>(FILE_SEPARATOR)) { -<a name="l00207"></a>00207 sprintf(szMappingFile, -<a name="l00208"></a>00208 <span class="stringliteral">"%s"</span> FILE_SEPARATOR <span class="stringliteral">"%s%s"</span>, -<a name="l00209"></a>00209 szAntiword, szLeafname, szSuffix); -<a name="l00210"></a>00210 DBG_MSG(szMappingFile); -<a name="l00211"></a>00211 pFile = fopen(szMappingFile, <span class="stringliteral">"r"</span>); -<a name="l00212"></a>00212 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00213"></a>00213 <span class="keywordflow">return</span> pFile; -<a name="l00214"></a>00214 } -<a name="l00215"></a>00215 } <span class="keywordflow">else</span> { -<a name="l00216"></a>00216 werr(0, <span class="stringliteral">"Environment mappingfilename ignored"</span>); -<a name="l00217"></a>00217 } -<a name="l00218"></a>00218 } -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 <span class="comment">/* Try the local version of the mapping file */</span> -<a name="l00221"></a>00221 szHome = szGetHomeDirectory(); -<a name="l00222"></a>00222 <span class="keywordflow">if</span> (strlen(szHome) + tFilenameLen < -<a name="l00223"></a>00223 <span class="keyword">sizeof</span>(szMappingFile) - -<a name="l00224"></a>00224 <span class="keyword">sizeof</span>(ANTIWORD_DIR) - -<a name="l00225"></a>00225 2 * <span class="keyword">sizeof</span>(FILE_SEPARATOR)) { -<a name="l00226"></a>00226 <span class="preprocessor"> #ifndef SYMBIAN</span> -<a name="l00227"></a>00227 <span class="preprocessor"></span> sprintf(szMappingFile, -<a name="l00228"></a>00228 <span class="stringliteral">"%s%s%s"</span>, -<a name="l00229"></a>00229 szHome, szLeafname, szSuffix); -<a name="l00230"></a>00230 <span class="preprocessor"> #else </span> -<a name="l00231"></a>00231 <span class="preprocessor"></span> sprintf(szMappingFile, -<a name="l00232"></a>00232 <span class="stringliteral">"%s%s%s"</span>, -<a name="l00233"></a>00233 szHome, szLeafname, szSuffix); -<a name="l00234"></a>00234 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00235"></a>00235 DBG_MSG(szMappingFile); -<a name="l00236"></a>00236 pFile = fopen(szMappingFile, <span class="stringliteral">"r"</span>); -<a name="l00237"></a>00237 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00238"></a>00238 <span class="keywordflow">return</span> pFile; -<a name="l00239"></a>00239 } -<a name="l00240"></a>00240 } <span class="keywordflow">else</span> { -<a name="l00241"></a>00241 werr(0, <span class="stringliteral">"Local mappingfilename too long, ignored"</span>); -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 -<a name="l00244"></a>00244 <span class="comment">/* Try the global version of the mapping file */</span> -<a name="l00245"></a>00245 <span class="keywordflow">if</span> (tFilenameLen < -<a name="l00246"></a>00246 <span class="keyword">sizeof</span>(szMappingFile) - -<a name="l00247"></a>00247 <span class="keyword">sizeof</span>(GLOBAL_ANTIWORD_DIR) - -<a name="l00248"></a>00248 <span class="keyword">sizeof</span>(FILE_SEPARATOR)) { -<a name="l00249"></a>00249 sprintf(szMappingFile, -<a name="l00250"></a>00250 GLOBAL_ANTIWORD_DIR FILE_SEPARATOR <span class="stringliteral">"%s%s"</span>, -<a name="l00251"></a>00251 szLeafname, szSuffix); -<a name="l00252"></a>00252 DBG_MSG(szMappingFile); -<a name="l00253"></a>00253 pFile = fopen(szMappingFile, <span class="stringliteral">"r"</span>); -<a name="l00254"></a>00254 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00255"></a>00255 <span class="keywordflow">return</span> pFile; -<a name="l00256"></a>00256 } -<a name="l00257"></a>00257 } <span class="keywordflow">else</span> { -<a name="l00258"></a>00258 werr(0, <span class="stringliteral">"Global mappingfilename too long, ignored"</span>); -<a name="l00259"></a>00259 } -<a name="l00260"></a>00260 werr(0, <span class="stringliteral">"I can't open your mapping file (%s%s)\n"</span> -<a name="l00261"></a>00261 <span class="stringliteral">"It is not in '%s"</span> FILE_SEPARATOR ANTIWORD_DIR <span class="stringliteral">"' nor in '"</span> -<a name="l00262"></a>00262 GLOBAL_ANTIWORD_DIR <span class="stringliteral">"'."</span>, szLeafname, szSuffix, szHome); -<a name="l00263"></a>00263 <span class="keywordflow">return</span> NULL; -<a name="l00264"></a>00264 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00265"></a>00265 } <span class="comment">/* end of pOpenCharacterMappingFile */</span> -<a name="l00266"></a>00266 -<a name="l00267"></a>00267 <span class="comment">/*</span> -<a name="l00268"></a>00268 <span class="comment"> * vCloseCharacterMappingFile - close the mapping file</span> -<a name="l00269"></a>00269 <span class="comment"> */</span> -<a name="l00270"></a>00270 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00271"></a>00271 vCloseCharacterMappingFile(FILE *pFile) -<a name="l00272"></a>00272 { -<a name="l00273"></a>00273 (void)fclose(pFile); -<a name="l00274"></a>00274 } <span class="comment">/* end of pCloseCharacterMappingFile */</span> -<a name="l00275"></a>00275 -<a name="l00276"></a>00276 -<a name="l00277"></a>00277 <span class="comment">/*</span> -<a name="l00278"></a>00278 <span class="comment"> * iReadOptions - read options</span> -<a name="l00279"></a>00279 <span class="comment"> *</span> -<a name="l00280"></a>00280 <span class="comment"> * returns: -1: error</span> -<a name="l00281"></a>00281 <span class="comment"> * 0: help</span> -<a name="l00282"></a>00282 <span class="comment"> * >0: index first file argument</span> -<a name="l00283"></a>00283 <span class="comment"> */</span> -<a name="l00284"></a>00284 <span class="keywordtype">int</span> -<a name="l00285"></a>00285 iReadOptions(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) -<a name="l00286"></a>00286 { -<a name="l00287"></a>00287 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00288"></a>00288 <span class="preprocessor"></span> FILE *pFile; -<a name="l00289"></a>00289 <span class="keyword">const</span> <span class="keywordtype">char</span> *szAlphabet; -<a name="l00290"></a>00290 <span class="keywordtype">int</span> iAlphabet; -<a name="l00291"></a>00291 <span class="keywordtype">char</span> szLine[81]; -<a name="l00292"></a>00292 <span class="preprocessor">#else</span> -<a name="l00293"></a>00293 <span class="preprocessor"></span> <span class="keyword">extern</span> <span class="keywordtype">char</span> *optarg; -<a name="l00294"></a>00294 <span class="keyword">extern</span> <span class="keywordtype">int</span> optind; -<a name="l00295"></a>00295 <span class="keywordtype">char</span> *pcChar, *szTmp; -<a name="l00296"></a>00296 <span class="keywordtype">int</span> iChar; -<a name="l00297"></a>00297 <span class="keywordtype">char</span> szLeafname[LEAFNAME_SIZE]; -<a name="l00298"></a>00298 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00299"></a>00299 FILE *pCharacterMappingFile; -<a name="l00300"></a>00300 <span class="keywordtype">int</span> iTmp; -<a name="l00301"></a>00301 BOOL bSuccess; -<a name="l00302"></a>00302 -<a name="l00303"></a>00303 DBG_MSG(<span class="stringliteral">"iReadOptions"</span>); -<a name="l00304"></a>00304 -<a name="l00305"></a>00305 <span class="comment">/* Defaults */</span> -<a name="l00306"></a>00306 tOptionsCurr = tOptionsDefault; -<a name="l00307"></a>00307 -<a name="l00308"></a>00308 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00309"></a>00309 <span class="preprocessor"></span><span class="comment">/* Choices file */</span> -<a name="l00310"></a>00310 pFile = fopen(<span class="stringliteral">"<AntiWord$ChoicesFile>"</span>, <span class="stringliteral">"r"</span>); -<a name="l00311"></a>00311 DBG_MSG_C(pFile == NULL, <span class="stringliteral">"Choices file not found"</span>); -<a name="l00312"></a>00312 DBG_HEX_C(pFile != NULL, pFile); -<a name="l00313"></a>00313 <span class="keywordflow">if</span> (pFile != NULL) { -<a name="l00314"></a>00314 <span class="keywordflow">while</span> (fgets(szLine, (<span class="keywordtype">int</span>)<span class="keyword">sizeof</span>(szLine), pFile) != NULL) { -<a name="l00315"></a>00315 DBG_MSG(szLine); -<a name="l00316"></a>00316 <span class="keywordflow">if</span> (szLine[0] == <span class="charliteral">'#'</span> || -<a name="l00317"></a>00317 szLine[0] == <span class="charliteral">'\r'</span> || -<a name="l00318"></a>00318 szLine[0] == <span class="charliteral">'\n'</span>) { -<a name="l00319"></a>00319 <span class="keywordflow">continue</span>; -<a name="l00320"></a>00320 } -<a name="l00321"></a>00321 <span class="keywordflow">if</span> (sscanf(szLine, PARAGRAPH_BREAK, &iTmp) == 1 && -<a name="l00322"></a>00322 (iTmp == 0 || -<a name="l00323"></a>00323 (iTmp >= MIN_SCREEN_WIDTH && -<a name="l00324"></a>00324 iTmp <= MAX_SCREEN_WIDTH))) { -<a name="l00325"></a>00325 tOptionsCurr.iParagraphBreak = iTmp; -<a name="l00326"></a>00326 DBG_DEC(tOptionsCurr.iParagraphBreak); -<a name="l00327"></a>00327 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(szLine, AUTOFILETYPE, &iTmp) -<a name="l00328"></a>00328 == 1) { -<a name="l00329"></a>00329 tOptionsCurr.bAutofiletypeAllowed = -<a name="l00330"></a>00330 iTmp != 0; -<a name="l00331"></a>00331 DBG_DEC(tOptionsCurr.bAutofiletypeAllowed); -<a name="l00332"></a>00332 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(szLine, USE_OUTLINEFONTS, &iTmp) -<a name="l00333"></a>00333 == 1) { -<a name="l00334"></a>00334 tOptionsCurr.eConversionType = -<a name="l00335"></a>00335 iTmp == 0 ? -<a name="l00336"></a>00336 conversion_text : conversion_draw; -<a name="l00337"></a>00337 DBG_DEC(tOptionsCurr.eConversionType); -<a name="l00338"></a>00338 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(szLine, SHOW_IMAGES, &iTmp) -<a name="l00339"></a>00339 == 1) { -<a name="l00340"></a>00340 tOptionsCurr.eImageLevel = iTmp != 0 ? -<a name="l00341"></a>00341 level_default : level_no_images; -<a name="l00342"></a>00342 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(szLine, HIDE_HIDDEN_TEXT, &iTmp) -<a name="l00343"></a>00343 == 1) { -<a name="l00344"></a>00344 tOptionsCurr.bHideHiddenText = iTmp != 0; -<a name="l00345"></a>00345 DBG_DEC(tOptionsCurr.bHideHiddenText); -<a name="l00346"></a>00346 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (sscanf(szLine, SCALE_FACTOR_START, &iTmp) -<a name="l00347"></a>00347 == 1) { -<a name="l00348"></a>00348 <span class="keywordflow">if</span> (iTmp >= MIN_SCALE_FACTOR && -<a name="l00349"></a>00349 iTmp <= MAX_SCALE_FACTOR) { -<a name="l00350"></a>00350 tOptionsCurr.iScaleFactor = iTmp; -<a name="l00351"></a>00351 DBG_DEC(tOptionsCurr.iScaleFactor); -<a name="l00352"></a>00352 } -<a name="l00353"></a>00353 } -<a name="l00354"></a>00354 } -<a name="l00355"></a>00355 (void)fclose(pFile); -<a name="l00356"></a>00356 } -<a name="l00357"></a>00357 iAlphabet = iReadCurrentAlphabetNumber(); -<a name="l00358"></a>00358 <span class="keywordflow">switch</span> (iAlphabet) { -<a name="l00359"></a>00359 <span class="keywordflow">case</span> 101: <span class="comment">/* ISO-8859-1 aka Latin1 */</span> -<a name="l00360"></a>00360 szAlphabet = <span class="stringliteral">"<AntiWord$Latin1>"</span>; -<a name="l00361"></a>00361 <span class="keywordflow">break</span>; -<a name="l00362"></a>00362 <span class="keywordflow">case</span> 112: <span class="comment">/* ISO-8859-15 aka Latin9 */</span> -<a name="l00363"></a>00363 szAlphabet = <span class="stringliteral">"<AntiWord$Latin9>"</span>; -<a name="l00364"></a>00364 <span class="keywordflow">break</span>; -<a name="l00365"></a>00365 <span class="keywordflow">default</span>: -<a name="l00366"></a>00366 werr(0, <span class="stringliteral">"Alphabet '%d' is not supported"</span>, iAlphabet); -<a name="l00367"></a>00367 <span class="keywordflow">return</span> -1; -<a name="l00368"></a>00368 } -<a name="l00369"></a>00369 pCharacterMappingFile = pOpenCharacterMappingFile(szAlphabet); -<a name="l00370"></a>00370 <span class="keywordflow">if</span> (pCharacterMappingFile != NULL) { -<a name="l00371"></a>00371 bSuccess = bReadCharacterMappingTable(pCharacterMappingFile); -<a name="l00372"></a>00372 vCloseCharacterMappingFile(pCharacterMappingFile); -<a name="l00373"></a>00373 } <span class="keywordflow">else</span> { -<a name="l00374"></a>00374 bSuccess = FALSE; -<a name="l00375"></a>00375 } -<a name="l00376"></a>00376 <span class="keywordflow">return</span> bSuccess ? 1 : -1; -<a name="l00377"></a>00377 <span class="preprocessor">#else</span> -<a name="l00378"></a>00378 <span class="preprocessor"></span><span class="comment">/* Environment */</span> -<a name="l00379"></a>00379 -<a name="l00380"></a>00380 <span class="preprocessor"> #ifdef SYMBIAN</span> -<a name="l00381"></a>00381 <span class="preprocessor"></span> <span class="comment">//Adding Some environment Variable explicitly</span> -<a name="l00382"></a>00382 <span class="keywordflow">if</span> ( setenv(<span class="stringliteral">"COLUMNS"</span>, <span class="stringliteral">"80"</span>, 1) == 0) -<a name="l00383"></a>00383 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00384"></a>00384 szTmp = getenv(<span class="stringliteral">"COLUMNS"</span>); -<a name="l00385"></a>00385 -<a name="l00386"></a>00386 <span class="keywordflow">if</span> (szTmp != NULL) { -<a name="l00387"></a>00387 DBG_MSG(szTmp); -<a name="l00388"></a>00388 iTmp = (int)strtol(szTmp, &pcChar, 10); -<a name="l00389"></a>00389 <span class="keywordflow">if</span> (*pcChar == <span class="charliteral">'\0'</span>) { -<a name="l00390"></a>00390 iTmp -= 4; <span class="comment">/* This is for the edge */</span> -<a name="l00391"></a>00391 <span class="keywordflow">if</span> (iTmp < MIN_SCREEN_WIDTH) { -<a name="l00392"></a>00392 iTmp = MIN_SCREEN_WIDTH; -<a name="l00393"></a>00393 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp > MAX_SCREEN_WIDTH) { -<a name="l00394"></a>00394 iTmp = MAX_SCREEN_WIDTH; -<a name="l00395"></a>00395 } -<a name="l00396"></a>00396 tOptionsCurr.iParagraphBreak = iTmp; -<a name="l00397"></a>00397 DBG_DEC(tOptionsCurr.iParagraphBreak); -<a name="l00398"></a>00398 } -<a name="l00399"></a>00399 } -<a name="l00400"></a>00400 strncpy(szLeafname, szGetDefaultMappingFile(), <span class="keyword">sizeof</span>(szLeafname) - 1); -<a name="l00401"></a>00401 szLeafname[<span class="keyword">sizeof</span>(szLeafname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00402"></a>00402 <span class="comment">/* Command line */</span> -<a name="l00403"></a>00403 <span class="keywordflow">while</span> ((iChar = getopt(argc, argv, <span class="stringliteral">"La:fhi:m:p:rstw:x:"</span>)) != -1) { -<a name="l00404"></a>00404 <span class="keywordflow">switch</span> (iChar) { -<a name="l00405"></a>00405 <span class="keywordflow">case</span> <span class="charliteral">'L'</span>: -<a name="l00406"></a>00406 tOptionsCurr.bUseLandscape = TRUE; -<a name="l00407"></a>00407 <span class="keywordflow">break</span>; -<a name="l00408"></a>00408 <span class="keywordflow">case</span> <span class="charliteral">'a'</span>: -<a name="l00409"></a>00409 <span class="keywordflow">if</span> (!bCorrectPapersize(optarg, conversion_pdf)) { -<a name="l00410"></a>00410 werr(0, <span class="stringliteral">"-a without a valid papersize"</span>); -<a name="l00411"></a>00411 <span class="keywordflow">return</span> -1; -<a name="l00412"></a>00412 } -<a name="l00413"></a>00413 <span class="keywordflow">break</span>; -<a name="l00414"></a>00414 <span class="keywordflow">case</span> <span class="charliteral">'f'</span>: -<a name="l00415"></a>00415 tOptionsCurr.eConversionType = conversion_fmt_text; -<a name="l00416"></a>00416 <span class="keywordflow">break</span>; -<a name="l00417"></a>00417 <span class="keywordflow">case</span> <span class="charliteral">'h'</span>: -<a name="l00418"></a>00418 <span class="keywordflow">return</span> 0; -<a name="l00419"></a>00419 <span class="keywordflow">case</span> <span class="charliteral">'i'</span>: -<a name="l00420"></a>00420 iTmp = (int)strtol(optarg, &pcChar, 10); -<a name="l00421"></a>00421 <span class="keywordflow">if</span> (*pcChar != <span class="charliteral">'\0'</span>) { -<a name="l00422"></a>00422 <span class="keywordflow">break</span>; -<a name="l00423"></a>00423 } -<a name="l00424"></a>00424 <span class="keywordflow">switch</span> (iTmp) { -<a name="l00425"></a>00425 <span class="keywordflow">case</span> 0: -<a name="l00426"></a>00426 tOptionsCurr.eImageLevel = level_gs_special; -<a name="l00427"></a>00427 <span class="keywordflow">break</span>; -<a name="l00428"></a>00428 <span class="keywordflow">case</span> 1: -<a name="l00429"></a>00429 tOptionsCurr.eImageLevel = level_no_images; -<a name="l00430"></a>00430 <span class="keywordflow">break</span>; -<a name="l00431"></a>00431 <span class="keywordflow">case</span> 2: -<a name="l00432"></a>00432 tOptionsCurr.eImageLevel = level_ps_2; -<a name="l00433"></a>00433 <span class="keywordflow">break</span>; -<a name="l00434"></a>00434 <span class="keywordflow">case</span> 3: -<a name="l00435"></a>00435 tOptionsCurr.eImageLevel = level_ps_3; -<a name="l00436"></a>00436 <span class="keywordflow">break</span>; -<a name="l00437"></a>00437 <span class="keywordflow">default</span>: -<a name="l00438"></a>00438 tOptionsCurr.eImageLevel = level_default; -<a name="l00439"></a>00439 <span class="keywordflow">break</span>; -<a name="l00440"></a>00440 } -<a name="l00441"></a>00441 DBG_DEC(tOptionsCurr.eImageLevel); -<a name="l00442"></a>00442 <span class="keywordflow">break</span>; -<a name="l00443"></a>00443 <span class="keywordflow">case</span> <span class="charliteral">'m'</span>: -<a name="l00444"></a>00444 <span class="keywordflow">if</span> (tOptionsCurr.eConversionType == conversion_xml) { -<a name="l00445"></a>00445 werr(0, <span class="stringliteral">"XML doesn't need a mapping file"</span>); -<a name="l00446"></a>00446 <span class="keywordflow">break</span>; -<a name="l00447"></a>00447 } -<a name="l00448"></a>00448 strncpy(szLeafname, optarg, <span class="keyword">sizeof</span>(szLeafname) - 1); -<a name="l00449"></a>00449 szLeafname[<span class="keyword">sizeof</span>(szLeafname) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00450"></a>00450 DBG_MSG(szLeafname); -<a name="l00451"></a>00451 <span class="keywordflow">break</span>; -<a name="l00452"></a>00452 <span class="keywordflow">case</span> <span class="charliteral">'p'</span>: -<a name="l00453"></a>00453 <span class="keywordflow">if</span> (!bCorrectPapersize(optarg, conversion_ps)) { -<a name="l00454"></a>00454 werr(0, <span class="stringliteral">"-p without a valid papersize"</span>); -<a name="l00455"></a>00455 <span class="keywordflow">return</span> -1; -<a name="l00456"></a>00456 } -<a name="l00457"></a>00457 <span class="keywordflow">break</span>; -<a name="l00458"></a>00458 <span class="keywordflow">case</span> <span class="charliteral">'r'</span>: -<a name="l00459"></a>00459 tOptionsCurr.bRemoveRemovedText = FALSE; -<a name="l00460"></a>00460 <span class="keywordflow">break</span>; -<a name="l00461"></a>00461 <span class="keywordflow">case</span> <span class="charliteral">'s'</span>: -<a name="l00462"></a>00462 tOptionsCurr.bHideHiddenText = FALSE; -<a name="l00463"></a>00463 <span class="keywordflow">break</span>; -<a name="l00464"></a>00464 <span class="keywordflow">case</span> <span class="charliteral">'t'</span>: -<a name="l00465"></a>00465 tOptionsCurr.eConversionType = conversion_text; -<a name="l00466"></a>00466 <span class="keywordflow">break</span>; -<a name="l00467"></a>00467 <span class="keywordflow">case</span> <span class="charliteral">'w'</span>: -<a name="l00468"></a>00468 iTmp = (int)strtol(optarg, &pcChar, 10); -<a name="l00469"></a>00469 <span class="keywordflow">if</span> (*pcChar == <span class="charliteral">'\0'</span>) { -<a name="l00470"></a>00470 <span class="keywordflow">if</span> (iTmp != 0 && iTmp < MIN_SCREEN_WIDTH) { -<a name="l00471"></a>00471 iTmp = MIN_SCREEN_WIDTH; -<a name="l00472"></a>00472 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iTmp > MAX_SCREEN_WIDTH) { -<a name="l00473"></a>00473 iTmp = MAX_SCREEN_WIDTH; -<a name="l00474"></a>00474 } -<a name="l00475"></a>00475 tOptionsCurr.iParagraphBreak = iTmp; -<a name="l00476"></a>00476 DBG_DEC(tOptionsCurr.iParagraphBreak); -<a name="l00477"></a>00477 } -<a name="l00478"></a>00478 <span class="keywordflow">break</span>; -<a name="l00479"></a>00479 <span class="keywordflow">case</span> <span class="charliteral">'x'</span>: -<a name="l00480"></a>00480 <span class="keywordflow">if</span> (STREQ(optarg, <span class="stringliteral">"db"</span>)) { -<a name="l00481"></a>00481 tOptionsCurr.iParagraphBreak = 0; -<a name="l00482"></a>00482 tOptionsCurr.eConversionType = conversion_xml; -<a name="l00483"></a>00483 strcpy(szLeafname, MAPPING_FILE_UTF_8); -<a name="l00484"></a>00484 } <span class="keywordflow">else</span> { -<a name="l00485"></a>00485 werr(0, <span class="stringliteral">"-x %s is not supported"</span>, optarg); -<a name="l00486"></a>00486 <span class="keywordflow">return</span> -1; -<a name="l00487"></a>00487 } -<a name="l00488"></a>00488 <span class="keywordflow">break</span>; -<a name="l00489"></a>00489 <span class="keywordflow">default</span>: -<a name="l00490"></a>00490 <span class="keywordflow">return</span> -1; -<a name="l00491"></a>00491 } -<a name="l00492"></a>00492 } -<a name="l00493"></a>00493 -<a name="l00494"></a>00494 tOptionsCurr.eEncoding = eMappingFile2Encoding(szLeafname); -<a name="l00495"></a>00495 DBG_DEC(tOptionsCurr.eEncoding); -<a name="l00496"></a>00496 -<a name="l00497"></a>00497 <span class="keywordflow">if</span> (tOptionsCurr.eConversionType == conversion_ps && -<a name="l00498"></a>00498 tOptionsCurr.eEncoding == encoding_utf_8) { -<a name="l00499"></a>00499 werr(0, -<a name="l00500"></a>00500 <span class="stringliteral">"The combination PostScript and UTF-8 is not supported"</span>); -<a name="l00501"></a>00501 <span class="keywordflow">return</span> -1; -<a name="l00502"></a>00502 } -<a name="l00503"></a>00503 -<a name="l00504"></a>00504 <span class="keywordflow">if</span> (tOptionsCurr.eConversionType == conversion_pdf && -<a name="l00505"></a>00505 tOptionsCurr.eEncoding == encoding_utf_8) { -<a name="l00506"></a>00506 werr(0, -<a name="l00507"></a>00507 <span class="stringliteral">"The combination PDF and UTF-8 is not supported"</span>); -<a name="l00508"></a>00508 <span class="keywordflow">return</span> -1; -<a name="l00509"></a>00509 } -<a name="l00510"></a>00510 -<a name="l00511"></a>00511 <span class="keywordflow">if</span> (tOptionsCurr.eConversionType == conversion_pdf && -<a name="l00512"></a>00512 tOptionsCurr.eEncoding == encoding_cyrillic) { -<a name="l00513"></a>00513 werr(0, -<a name="l00514"></a>00514 <span class="stringliteral">"The combination PDF and Cyrillic is not supported"</span>); -<a name="l00515"></a>00515 <span class="keywordflow">return</span> -1; -<a name="l00516"></a>00516 } -<a name="l00517"></a>00517 -<a name="l00518"></a>00518 <span class="keywordflow">if</span> (tOptionsCurr.eConversionType == conversion_ps || -<a name="l00519"></a>00519 tOptionsCurr.eConversionType == conversion_pdf) { -<a name="l00520"></a>00520 <span class="comment">/* PostScript or PDF mode */</span> -<a name="l00521"></a>00521 <span class="keywordflow">if</span> (tOptionsCurr.bUseLandscape) { -<a name="l00522"></a>00522 <span class="comment">/* Swap the page height and width */</span> -<a name="l00523"></a>00523 iTmp = tOptionsCurr.iPageHeight; -<a name="l00524"></a>00524 tOptionsCurr.iPageHeight = tOptionsCurr.iPageWidth; -<a name="l00525"></a>00525 tOptionsCurr.iPageWidth = iTmp; -<a name="l00526"></a>00526 } -<a name="l00527"></a>00527 <span class="comment">/* The paragraph break depends on the width of the paper */</span> -<a name="l00528"></a>00528 tOptionsCurr.iParagraphBreak = iMilliPoints2Char( -<a name="l00529"></a>00529 (<span class="keywordtype">long</span>)tOptionsCurr.iPageWidth * 1000 - -<a name="l00530"></a>00530 lDrawUnits2MilliPoints( -<a name="l00531"></a>00531 PS_LEFT_MARGIN + PS_RIGHT_MARGIN)); -<a name="l00532"></a>00532 DBG_DEC(tOptionsCurr.iParagraphBreak); -<a name="l00533"></a>00533 } -<a name="l00534"></a>00534 -<a name="l00535"></a>00535 pCharacterMappingFile = pOpenCharacterMappingFile(szLeafname); -<a name="l00536"></a>00536 <span class="keywordflow">if</span> (pCharacterMappingFile != NULL) { -<a name="l00537"></a>00537 bSuccess = bReadCharacterMappingTable(pCharacterMappingFile); -<a name="l00538"></a>00538 vCloseCharacterMappingFile(pCharacterMappingFile); -<a name="l00539"></a>00539 } <span class="keywordflow">else</span> { -<a name="l00540"></a>00540 bSuccess = FALSE; -<a name="l00541"></a>00541 } -<a name="l00542"></a>00542 <span class="keywordflow">return</span> bSuccess ? optind : -1; -<a name="l00543"></a>00543 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00544"></a>00544 } <span class="comment">/* end of iReadOptions */</span> -<a name="l00545"></a>00545 -<a name="l00546"></a>00546 <span class="comment">/*</span> -<a name="l00547"></a>00547 <span class="comment"> * vGetOptions - get a copy of the current option values</span> -<a name="l00548"></a>00548 <span class="comment"> */</span> -<a name="l00549"></a>00549 <span class="keywordtype">void</span> -<a name="l00550"></a>00550 vGetOptions(options_type *pOptions) -<a name="l00551"></a>00551 { -<a name="l00552"></a>00552 fail(pOptions == NULL); -<a name="l00553"></a>00553 -<a name="l00554"></a>00554 *pOptions = tOptionsCurr; -<a name="l00555"></a>00555 } <span class="comment">/* end of vGetOptions */</span> -<a name="l00556"></a>00556 -<a name="l00557"></a>00557 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00558"></a>00558 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00559"></a>00559 <span class="comment"> * vWriteOptions - write the current options to the Options file</span> -<a name="l00560"></a>00560 <span class="comment"> */</span> -<a name="l00561"></a>00561 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00562"></a>00562 vWriteOptions(<span class="keywordtype">void</span>) -<a name="l00563"></a>00563 { -<a name="l00564"></a>00564 FILE *pFile; -<a name="l00565"></a>00565 <span class="keywordtype">char</span> *szOptionsFile; -<a name="l00566"></a>00566 -<a name="l00567"></a>00567 TRACE_MSG(<span class="stringliteral">"vWriteOptions"</span>); -<a name="l00568"></a>00568 -<a name="l00569"></a>00569 szOptionsFile = getenv(<span class="stringliteral">"AntiWord$ChoicesSave"</span>); -<a name="l00570"></a>00570 <span class="keywordflow">if</span> (szOptionsFile == NULL) { -<a name="l00571"></a>00571 werr(0, <span class="stringliteral">"Warning: Name of the Choices file not found"</span>); -<a name="l00572"></a>00572 <span class="keywordflow">return</span>; -<a name="l00573"></a>00573 } -<a name="l00574"></a>00574 <span class="keywordflow">if</span> (!bMakeDirectory(szOptionsFile)) { -<a name="l00575"></a>00575 werr(0, -<a name="l00576"></a>00576 <span class="stringliteral">"Warning: I can't make a directory for the Choices file"</span>); -<a name="l00577"></a>00577 <span class="keywordflow">return</span>; -<a name="l00578"></a>00578 } -<a name="l00579"></a>00579 pFile = fopen(szOptionsFile, <span class="stringliteral">"w"</span>); -<a name="l00580"></a>00580 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00581"></a>00581 werr(0, <span class="stringliteral">"Warning: I can't write the Choices file"</span>); -<a name="l00582"></a>00582 <span class="keywordflow">return</span>; -<a name="l00583"></a>00583 } -<a name="l00584"></a>00584 (void)fprintf(pFile, PARAGRAPH_BREAK<span class="stringliteral">"\n"</span>, -<a name="l00585"></a>00585 tOptionsCurr.iParagraphBreak); -<a name="l00586"></a>00586 (void)fprintf(pFile, AUTOFILETYPE<span class="stringliteral">"\n"</span>, -<a name="l00587"></a>00587 tOptionsCurr.bAutofiletypeAllowed); -<a name="l00588"></a>00588 (void)fprintf(pFile, USE_OUTLINEFONTS<span class="stringliteral">"\n"</span>, -<a name="l00589"></a>00589 tOptionsCurr.eConversionType == conversion_text ? 0 : 1); -<a name="l00590"></a>00590 (void)fprintf(pFile, SHOW_IMAGES<span class="stringliteral">"\n"</span>, -<a name="l00591"></a>00591 tOptionsCurr.eImageLevel == level_no_images ? 0 : 1); -<a name="l00592"></a>00592 (void)fprintf(pFile, HIDE_HIDDEN_TEXT<span class="stringliteral">"\n"</span>, -<a name="l00593"></a>00593 tOptionsCurr.bHideHiddenText); -<a name="l00594"></a>00594 (void)fprintf(pFile, SCALE_FACTOR_START<span class="stringliteral">"\n"</span>, -<a name="l00595"></a>00595 tOptionsCurr.iScaleFactor); -<a name="l00596"></a>00596 (void)fclose(pFile); -<a name="l00597"></a>00597 } <span class="comment">/* end of vWriteOptions */</span> -<a name="l00598"></a>00598 -<a name="l00599"></a>00599 <span class="comment">/*</span> -<a name="l00600"></a>00600 <span class="comment"> * vChoicesOpenAction - action to be taken when the Choices window opens</span> -<a name="l00601"></a>00601 <span class="comment"> */</span> -<a name="l00602"></a>00602 <span class="keywordtype">void</span> -<a name="l00603"></a>00603 vChoicesOpenAction(window_handle tWindow) -<a name="l00604"></a>00604 { -<a name="l00605"></a>00605 TRACE_MSG(<span class="stringliteral">"vChoicesOpenAction"</span>); -<a name="l00606"></a>00606 -<a name="l00607"></a>00607 tOptionsTemp = tOptionsCurr; -<a name="l00608"></a>00608 <span class="keywordflow">if</span> (tOptionsTemp.iParagraphBreak == 0) { -<a name="l00609"></a>00609 vUpdateRadioButton(tWindow, CHOICES_BREAK_BUTTON, FALSE); -<a name="l00610"></a>00610 vUpdateRadioButton(tWindow, CHOICES_NO_BREAK_BUTTON, TRUE); -<a name="l00611"></a>00611 vUpdateWriteableNumber(tWindow, CHOICES_BREAK_WRITEABLE, -<a name="l00612"></a>00612 DEFAULT_SCREEN_WIDTH); -<a name="l00613"></a>00613 } <span class="keywordflow">else</span> { -<a name="l00614"></a>00614 vUpdateRadioButton(tWindow, CHOICES_BREAK_BUTTON, TRUE); -<a name="l00615"></a>00615 vUpdateRadioButton(tWindow, CHOICES_NO_BREAK_BUTTON, FALSE); -<a name="l00616"></a>00616 vUpdateWriteableNumber(tWindow, -<a name="l00617"></a>00617 CHOICES_BREAK_WRITEABLE, -<a name="l00618"></a>00618 tOptionsTemp.iParagraphBreak); -<a name="l00619"></a>00619 } -<a name="l00620"></a>00620 vUpdateRadioButton(tWindow, CHOICES_AUTOFILETYPE_BUTTON, -<a name="l00621"></a>00621 tOptionsTemp.bAutofiletypeAllowed); -<a name="l00622"></a>00622 vUpdateRadioButton(tWindow, CHOICES_HIDDEN_TEXT_BUTTON, -<a name="l00623"></a>00623 tOptionsTemp.bHideHiddenText); -<a name="l00624"></a>00624 <span class="keywordflow">if</span> (tOptionsTemp.eConversionType == conversion_draw) { -<a name="l00625"></a>00625 vUpdateRadioButton(tWindow, -<a name="l00626"></a>00626 CHOICES_WITH_IMAGES_BUTTON, -<a name="l00627"></a>00627 tOptionsTemp.eImageLevel != level_no_images); -<a name="l00628"></a>00628 vUpdateRadioButton(tWindow, -<a name="l00629"></a>00629 CHOICES_NO_IMAGES_BUTTON, -<a name="l00630"></a>00630 tOptionsTemp.eImageLevel == level_no_images); -<a name="l00631"></a>00631 vUpdateRadioButton(tWindow, -<a name="l00632"></a>00632 CHOICES_TEXTONLY_BUTTON, FALSE); -<a name="l00633"></a>00633 } <span class="keywordflow">else</span> { -<a name="l00634"></a>00634 vUpdateRadioButton(tWindow, -<a name="l00635"></a>00635 CHOICES_WITH_IMAGES_BUTTON, FALSE); -<a name="l00636"></a>00636 vUpdateRadioButton(tWindow, -<a name="l00637"></a>00637 CHOICES_NO_IMAGES_BUTTON, FALSE); -<a name="l00638"></a>00638 vUpdateRadioButton(tWindow, -<a name="l00639"></a>00639 CHOICES_TEXTONLY_BUTTON, TRUE); -<a name="l00640"></a>00640 } -<a name="l00641"></a>00641 vUpdateWriteableNumber(tWindow, -<a name="l00642"></a>00642 CHOICES_SCALE_WRITEABLE, tOptionsTemp.iScaleFactor); -<a name="l00643"></a>00643 TRACE_MSG(<span class="stringliteral">"end of vChoicesOpenAction"</span>); -<a name="l00644"></a>00644 } <span class="comment">/* end of vChoicesOpenAction */</span> -<a name="l00645"></a>00645 -<a name="l00646"></a>00646 <span class="comment">/*</span> -<a name="l00647"></a>00647 <span class="comment"> * vDefaultButtonAction - action when the default button is clicked</span> -<a name="l00648"></a>00648 <span class="comment"> */</span> -<a name="l00649"></a>00649 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00650"></a>00650 vDefaultButtonAction(window_handle tWindow) -<a name="l00651"></a>00651 { -<a name="l00652"></a>00652 TRACE_MSG(<span class="stringliteral">"vDefaultButtonAction"</span>); -<a name="l00653"></a>00653 -<a name="l00654"></a>00654 tOptionsTemp = tOptionsDefault; -<a name="l00655"></a>00655 vUpdateRadioButton(tWindow, CHOICES_BREAK_BUTTON, TRUE); -<a name="l00656"></a>00656 vUpdateRadioButton(tWindow, CHOICES_NO_BREAK_BUTTON, FALSE); -<a name="l00657"></a>00657 vUpdateWriteableNumber(tWindow, CHOICES_BREAK_WRITEABLE, -<a name="l00658"></a>00658 tOptionsTemp.iParagraphBreak); -<a name="l00659"></a>00659 vUpdateRadioButton(tWindow, CHOICES_AUTOFILETYPE_BUTTON, -<a name="l00660"></a>00660 tOptionsTemp.bAutofiletypeAllowed); -<a name="l00661"></a>00661 vUpdateRadioButton(tWindow, CHOICES_HIDDEN_TEXT_BUTTON, -<a name="l00662"></a>00662 tOptionsTemp.bHideHiddenText); -<a name="l00663"></a>00663 vUpdateRadioButton(tWindow, CHOICES_WITH_IMAGES_BUTTON, -<a name="l00664"></a>00664 tOptionsTemp.eConversionType == conversion_draw && -<a name="l00665"></a>00665 tOptionsTemp.eImageLevel != level_no_images); -<a name="l00666"></a>00666 vUpdateRadioButton(tWindow, CHOICES_NO_IMAGES_BUTTON, -<a name="l00667"></a>00667 tOptionsTemp.eConversionType == conversion_draw && -<a name="l00668"></a>00668 tOptionsTemp.eImageLevel == level_no_images); -<a name="l00669"></a>00669 vUpdateRadioButton(tWindow, CHOICES_TEXTONLY_BUTTON, -<a name="l00670"></a>00670 tOptionsTemp.eConversionType == conversion_text); -<a name="l00671"></a>00671 vUpdateWriteableNumber(tWindow, CHOICES_SCALE_WRITEABLE, -<a name="l00672"></a>00672 tOptionsTemp.iScaleFactor); -<a name="l00673"></a>00673 } <span class="comment">/* end of vDefaultButtonAction */</span> -<a name="l00674"></a>00674 -<a name="l00675"></a>00675 <span class="comment">/*</span> -<a name="l00676"></a>00676 <span class="comment"> * vApplyButtonAction - action to be taken when the OK button is clicked</span> -<a name="l00677"></a>00677 <span class="comment"> */</span> -<a name="l00678"></a>00678 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00679"></a>00679 vApplyButtonAction(<span class="keywordtype">void</span>) -<a name="l00680"></a>00680 { -<a name="l00681"></a>00681 TRACE_MSG(<span class="stringliteral">"vApplyButtonAction"</span>); -<a name="l00682"></a>00682 -<a name="l00683"></a>00683 tOptionsCurr = tOptionsTemp; -<a name="l00684"></a>00684 } <span class="comment">/* end of vApplyButtonAction */</span> -<a name="l00685"></a>00685 -<a name="l00686"></a>00686 <span class="comment">/*</span> -<a name="l00687"></a>00687 <span class="comment"> * vSaveButtonAction - action to be taken when the save button is clicked</span> -<a name="l00688"></a>00688 <span class="comment"> */</span> -<a name="l00689"></a>00689 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00690"></a>00690 vSaveButtonAction(<span class="keywordtype">void</span>) -<a name="l00691"></a>00691 { -<a name="l00692"></a>00692 TRACE_MSG(<span class="stringliteral">"vSaveButtonAction"</span>); -<a name="l00693"></a>00693 -<a name="l00694"></a>00694 vApplyButtonAction(); -<a name="l00695"></a>00695 vWriteOptions(); -<a name="l00696"></a>00696 } <span class="comment">/* end of vSaveButtonAction */</span> -<a name="l00697"></a>00697 -<a name="l00698"></a>00698 <span class="comment">/*</span> -<a name="l00699"></a>00699 <span class="comment"> * vSetParagraphBreak - set the paragraph break to the given number</span> -<a name="l00700"></a>00700 <span class="comment"> */</span> -<a name="l00701"></a>00701 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00702"></a>00702 vSetParagraphBreak(window_handle tWindow, <span class="keywordtype">int</span> iNumber) -<a name="l00703"></a>00703 { -<a name="l00704"></a>00704 tOptionsTemp.iParagraphBreak = iNumber; -<a name="l00705"></a>00705 <span class="keywordflow">if</span> (tOptionsTemp.iParagraphBreak == 0) { -<a name="l00706"></a>00706 <span class="keywordflow">return</span>; -<a name="l00707"></a>00707 } -<a name="l00708"></a>00708 vUpdateWriteableNumber(tWindow, -<a name="l00709"></a>00709 CHOICES_BREAK_WRITEABLE, -<a name="l00710"></a>00710 tOptionsTemp.iParagraphBreak); -<a name="l00711"></a>00711 } <span class="comment">/* end of vSetParagraphBreak */</span> -<a name="l00712"></a>00712 -<a name="l00713"></a>00713 <span class="comment">/*</span> -<a name="l00714"></a>00714 <span class="comment"> * vChangeParagraphBreak - change the paragraph break with the given number</span> -<a name="l00715"></a>00715 <span class="comment"> */</span> -<a name="l00716"></a>00716 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00717"></a>00717 vChangeParagraphBreak(window_handle tWindow, <span class="keywordtype">int</span> iNumber) -<a name="l00718"></a>00718 { -<a name="l00719"></a>00719 <span class="keywordtype">int</span> iTmp; -<a name="l00720"></a>00720 -<a name="l00721"></a>00721 iTmp = tOptionsTemp.iParagraphBreak + iNumber; -<a name="l00722"></a>00722 <span class="keywordflow">if</span> (iTmp < MIN_SCREEN_WIDTH || iTmp > MAX_SCREEN_WIDTH) { -<a name="l00723"></a>00723 <span class="comment">/* Ignore */</span> -<a name="l00724"></a>00724 <span class="keywordflow">return</span>; -<a name="l00725"></a>00725 } -<a name="l00726"></a>00726 tOptionsTemp.iParagraphBreak = iTmp; -<a name="l00727"></a>00727 vUpdateWriteableNumber(tWindow, -<a name="l00728"></a>00728 CHOICES_BREAK_WRITEABLE, -<a name="l00729"></a>00729 tOptionsTemp.iParagraphBreak); -<a name="l00730"></a>00730 } <span class="comment">/* end of vChangeParagraphBreak */</span> -<a name="l00731"></a>00731 -<a name="l00732"></a>00732 <span class="comment">/*</span> -<a name="l00733"></a>00733 <span class="comment"> * vChangeAutofiletype - invert the permission to autofiletype</span> -<a name="l00734"></a>00734 <span class="comment"> */</span> -<a name="l00735"></a>00735 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00736"></a>00736 vChangeAutofiletype(window_handle tWindow) -<a name="l00737"></a>00737 { -<a name="l00738"></a>00738 tOptionsTemp.bAutofiletypeAllowed = -<a name="l00739"></a>00739 !tOptionsTemp.bAutofiletypeAllowed; -<a name="l00740"></a>00740 vUpdateRadioButton(tWindow, -<a name="l00741"></a>00741 CHOICES_AUTOFILETYPE_BUTTON, -<a name="l00742"></a>00742 tOptionsTemp.bAutofiletypeAllowed); -<a name="l00743"></a>00743 } <span class="comment">/* end of vChangeAutofiletype */</span> -<a name="l00744"></a>00744 -<a name="l00745"></a>00745 <span class="comment">/*</span> -<a name="l00746"></a>00746 <span class="comment"> * vChangeHiddenText - invert the hide/show hidden text</span> -<a name="l00747"></a>00747 <span class="comment"> */</span> -<a name="l00748"></a>00748 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00749"></a>00749 vChangeHiddenText(window_handle tWindow) -<a name="l00750"></a>00750 { -<a name="l00751"></a>00751 tOptionsTemp.bHideHiddenText = !tOptionsTemp.bHideHiddenText; -<a name="l00752"></a>00752 vUpdateRadioButton(tWindow, -<a name="l00753"></a>00753 CHOICES_HIDDEN_TEXT_BUTTON, -<a name="l00754"></a>00754 tOptionsTemp.bHideHiddenText); -<a name="l00755"></a>00755 } <span class="comment">/* end of vChangeHiddenText */</span> -<a name="l00756"></a>00756 -<a name="l00757"></a>00757 <span class="comment">/*</span> -<a name="l00758"></a>00758 <span class="comment"> * vUseFontsImages - use outline fonts, show images</span> -<a name="l00759"></a>00759 <span class="comment"> */</span> -<a name="l00760"></a>00760 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00761"></a>00761 vUseFontsImages(BOOL bUseOutlineFonts, BOOL bShowImages) -<a name="l00762"></a>00762 { -<a name="l00763"></a>00763 tOptionsTemp.eConversionType = -<a name="l00764"></a>00764 bUseOutlineFonts ? conversion_draw : conversion_text; -<a name="l00765"></a>00765 tOptionsTemp.eImageLevel = -<a name="l00766"></a>00766 bUseOutlineFonts && bShowImages ? -<a name="l00767"></a>00767 level_default : level_no_images; -<a name="l00768"></a>00768 } <span class="comment">/* end of vUseFontsImages */</span> -<a name="l00769"></a>00769 -<a name="l00770"></a>00770 <span class="comment">/*</span> -<a name="l00771"></a>00771 <span class="comment"> * vSetScaleFactor - set the scale factor to the given number</span> -<a name="l00772"></a>00772 <span class="comment"> */</span> -<a name="l00773"></a>00773 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00774"></a>00774 vSetScaleFactor(window_handle tWindow, <span class="keywordtype">int</span> iNumber) -<a name="l00775"></a>00775 { -<a name="l00776"></a>00776 tOptionsTemp.iScaleFactor = iNumber; -<a name="l00777"></a>00777 vUpdateWriteableNumber(tWindow, -<a name="l00778"></a>00778 CHOICES_SCALE_WRITEABLE, -<a name="l00779"></a>00779 tOptionsTemp.iScaleFactor); -<a name="l00780"></a>00780 } <span class="comment">/* end of vSetScaleFactor */</span> -<a name="l00781"></a>00781 -<a name="l00782"></a>00782 <span class="comment">/*</span> -<a name="l00783"></a>00783 <span class="comment"> * vChangeScaleFactor - change the scale factor with the given number</span> -<a name="l00784"></a>00784 <span class="comment"> */</span> -<a name="l00785"></a>00785 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00786"></a>00786 vChangeScaleFactor(window_handle tWindow, <span class="keywordtype">int</span> iNumber) -<a name="l00787"></a>00787 { -<a name="l00788"></a>00788 <span class="keywordtype">int</span> iTmp; -<a name="l00789"></a>00789 -<a name="l00790"></a>00790 iTmp = tOptionsTemp.iScaleFactor + iNumber; -<a name="l00791"></a>00791 <span class="keywordflow">if</span> (iTmp < MIN_SCALE_FACTOR || iTmp > MAX_SCALE_FACTOR) { -<a name="l00792"></a>00792 <span class="comment">/* Ignore */</span> -<a name="l00793"></a>00793 <span class="keywordflow">return</span>; -<a name="l00794"></a>00794 } -<a name="l00795"></a>00795 tOptionsTemp.iScaleFactor = iTmp; -<a name="l00796"></a>00796 vUpdateWriteableNumber(tWindow, -<a name="l00797"></a>00797 CHOICES_SCALE_WRITEABLE, -<a name="l00798"></a>00798 tOptionsTemp.iScaleFactor); -<a name="l00799"></a>00799 } <span class="comment">/* end of vChangeScaleFactor */</span> -<a name="l00800"></a>00800 -<a name="l00801"></a>00801 <span class="comment">/*</span> -<a name="l00802"></a>00802 <span class="comment"> * bChoicesMouseClick - handle a mouse click in the Choices window</span> -<a name="l00803"></a>00803 <span class="comment"> */</span> -<a name="l00804"></a>00804 BOOL -<a name="l00805"></a>00805 bChoicesMouseClick(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00806"></a>00806 { -<a name="l00807"></a>00807 icon_handle tAction; -<a name="l00808"></a>00808 mouse_block *pMouse; -<a name="l00809"></a>00809 BOOL bCloseWindow; -<a name="l00810"></a>00810 -<a name="l00811"></a>00811 TRACE_MSG(<span class="stringliteral">"bChoicesMouseClick"</span>); -<a name="l00812"></a>00812 -<a name="l00813"></a>00813 fail(pEvent == NULL); -<a name="l00814"></a>00814 fail(pEvent->type != event_CLICK); -<a name="l00815"></a>00815 -<a name="l00816"></a>00816 pMouse = &pEvent->data.mouse; -<a name="l00817"></a>00817 <span class="keywordflow">if</span> (!pMouse->button.data.select && !pMouse->button.data.adjust) { -<a name="l00818"></a>00818 <span class="comment">/* Not handled here */</span> -<a name="l00819"></a>00819 DBG_HEX(pMouse->button.value); -<a name="l00820"></a>00820 <span class="keywordflow">return</span> FALSE; -<a name="l00821"></a>00821 } -<a name="l00822"></a>00822 -<a name="l00823"></a>00823 <span class="comment">/* Which action should be taken */</span> -<a name="l00824"></a>00824 tAction = pMouse->icon; -<a name="l00825"></a>00825 <span class="keywordflow">if</span> (pMouse->button.data.adjust) { -<a name="l00826"></a>00826 <span class="comment">/* The adjust button reverses the direction */</span> -<a name="l00827"></a>00827 <span class="keywordflow">switch</span> (pMouse->icon) { -<a name="l00828"></a>00828 <span class="keywordflow">case</span> CHOICES_BREAK_UP_BUTTON: -<a name="l00829"></a>00829 tAction = CHOICES_BREAK_DOWN_BUTTON; -<a name="l00830"></a>00830 <span class="keywordflow">break</span>; -<a name="l00831"></a>00831 <span class="keywordflow">case</span> CHOICES_BREAK_DOWN_BUTTON: -<a name="l00832"></a>00832 tAction = CHOICES_BREAK_UP_BUTTON; -<a name="l00833"></a>00833 <span class="keywordflow">break</span>; -<a name="l00834"></a>00834 <span class="keywordflow">case</span> CHOICES_SCALE_UP_BUTTON: -<a name="l00835"></a>00835 tAction = CHOICES_SCALE_DOWN_BUTTON; -<a name="l00836"></a>00836 <span class="keywordflow">break</span>; -<a name="l00837"></a>00837 <span class="keywordflow">case</span> CHOICES_SCALE_DOWN_BUTTON: -<a name="l00838"></a>00838 tAction = CHOICES_SCALE_UP_BUTTON; -<a name="l00839"></a>00839 <span class="keywordflow">break</span>; -<a name="l00840"></a>00840 <span class="keywordflow">default</span>: -<a name="l00841"></a>00841 <span class="keywordflow">break</span>; -<a name="l00842"></a>00842 } -<a name="l00843"></a>00843 } -<a name="l00844"></a>00844 -<a name="l00845"></a>00845 <span class="comment">/* Actions */</span> -<a name="l00846"></a>00846 bCloseWindow = FALSE; -<a name="l00847"></a>00847 <span class="keywordflow">switch</span> (tAction) { -<a name="l00848"></a>00848 <span class="keywordflow">case</span> CHOICES_DEFAULT_BUTTON: -<a name="l00849"></a>00849 vDefaultButtonAction(pMouse->window); -<a name="l00850"></a>00850 <span class="keywordflow">break</span>; -<a name="l00851"></a>00851 <span class="keywordflow">case</span> CHOICES_SAVE_BUTTON: -<a name="l00852"></a>00852 vSaveButtonAction(); -<a name="l00853"></a>00853 <span class="keywordflow">break</span>; -<a name="l00854"></a>00854 <span class="keywordflow">case</span> CHOICES_CANCEL_BUTTON: -<a name="l00855"></a>00855 bCloseWindow = TRUE; -<a name="l00856"></a>00856 <span class="keywordflow">break</span>; -<a name="l00857"></a>00857 <span class="keywordflow">case</span> CHOICES_APPLY_BUTTON: -<a name="l00858"></a>00858 vApplyButtonAction(); -<a name="l00859"></a>00859 bCloseWindow = TRUE; -<a name="l00860"></a>00860 <span class="keywordflow">break</span>; -<a name="l00861"></a>00861 <span class="keywordflow">case</span> CHOICES_BREAK_BUTTON: -<a name="l00862"></a>00862 vSetParagraphBreak(pMouse->window, DEFAULT_SCREEN_WIDTH); -<a name="l00863"></a>00863 <span class="keywordflow">break</span>; -<a name="l00864"></a>00864 <span class="keywordflow">case</span> CHOICES_BREAK_UP_BUTTON: -<a name="l00865"></a>00865 vChangeParagraphBreak(pMouse->window, 1); -<a name="l00866"></a>00866 <span class="keywordflow">break</span>; -<a name="l00867"></a>00867 <span class="keywordflow">case</span> CHOICES_BREAK_DOWN_BUTTON: -<a name="l00868"></a>00868 vChangeParagraphBreak(pMouse->window, -1); -<a name="l00869"></a>00869 <span class="keywordflow">break</span>; -<a name="l00870"></a>00870 <span class="keywordflow">case</span> CHOICES_NO_BREAK_BUTTON: -<a name="l00871"></a>00871 vSetParagraphBreak(pMouse->window, 0); -<a name="l00872"></a>00872 <span class="keywordflow">break</span>; -<a name="l00873"></a>00873 <span class="keywordflow">case</span> CHOICES_AUTOFILETYPE_BUTTON: -<a name="l00874"></a>00874 vChangeAutofiletype(pMouse->window); -<a name="l00875"></a>00875 <span class="keywordflow">break</span>; -<a name="l00876"></a>00876 <span class="keywordflow">case</span> CHOICES_HIDDEN_TEXT_BUTTON: -<a name="l00877"></a>00877 vChangeHiddenText(pMouse->window); -<a name="l00878"></a>00878 <span class="keywordflow">break</span>; -<a name="l00879"></a>00879 <span class="keywordflow">case</span> CHOICES_WITH_IMAGES_BUTTON: -<a name="l00880"></a>00880 vUseFontsImages(TRUE, TRUE); -<a name="l00881"></a>00881 <span class="keywordflow">break</span>; -<a name="l00882"></a>00882 <span class="keywordflow">case</span> CHOICES_NO_IMAGES_BUTTON: -<a name="l00883"></a>00883 vUseFontsImages(TRUE, FALSE); -<a name="l00884"></a>00884 <span class="keywordflow">break</span>; -<a name="l00885"></a>00885 <span class="keywordflow">case</span> CHOICES_TEXTONLY_BUTTON: -<a name="l00886"></a>00886 vUseFontsImages(FALSE, FALSE); -<a name="l00887"></a>00887 <span class="keywordflow">break</span>; -<a name="l00888"></a>00888 <span class="keywordflow">case</span> CHOICES_SCALE_UP_BUTTON: -<a name="l00889"></a>00889 vChangeScaleFactor(pMouse->window, 5); -<a name="l00890"></a>00890 <span class="keywordflow">break</span>; -<a name="l00891"></a>00891 <span class="keywordflow">case</span> CHOICES_SCALE_DOWN_BUTTON: -<a name="l00892"></a>00892 vChangeScaleFactor(pMouse->window, -5); -<a name="l00893"></a>00893 <span class="keywordflow">break</span>; -<a name="l00894"></a>00894 <span class="keywordflow">default</span>: -<a name="l00895"></a>00895 DBG_DEC(pMouse->icon); -<a name="l00896"></a>00896 <span class="keywordflow">break</span>; -<a name="l00897"></a>00897 } -<a name="l00898"></a>00898 <span class="keywordflow">if</span> (bCloseWindow) { -<a name="l00899"></a>00899 Error_CheckFatal(Wimp_CloseWindow(pMouse->window)); -<a name="l00900"></a>00900 } -<a name="l00901"></a>00901 <span class="keywordflow">return</span> TRUE; -<a name="l00902"></a>00902 } <span class="comment">/* end of bChoicesMouseClick */</span> -<a name="l00903"></a>00903 -<a name="l00904"></a>00904 <span class="comment">/*</span> -<a name="l00905"></a>00905 <span class="comment"> * bChoicesKeyPressed - handle a key in the Choices window</span> -<a name="l00906"></a>00906 <span class="comment"> */</span> -<a name="l00907"></a>00907 BOOL -<a name="l00908"></a>00908 bChoicesKeyPressed(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00909"></a>00909 { -<a name="l00910"></a>00910 icon_block tIcon; -<a name="l00911"></a>00911 caret_block *pCaret; -<a name="l00912"></a>00912 <span class="keywordtype">char</span> *pcChar; -<a name="l00913"></a>00913 <span class="keywordtype">int</span> iNumber; -<a name="l00914"></a>00914 -<a name="l00915"></a>00915 DBG_MSG(<span class="stringliteral">"bChoicesKeyPressed"</span>); -<a name="l00916"></a>00916 -<a name="l00917"></a>00917 fail(pEvent == NULL); -<a name="l00918"></a>00918 fail(pEvent->type != event_KEY); -<a name="l00919"></a>00919 -<a name="l00920"></a>00920 <span class="keywordflow">if</span> (pEvent->data.key.code != <span class="charliteral">'\r'</span>) { -<a name="l00921"></a>00921 Error_CheckFatal(Wimp_ProcessKey(pEvent->data.key.code)); -<a name="l00922"></a>00922 <span class="keywordflow">return</span> TRUE; -<a name="l00923"></a>00923 } -<a name="l00924"></a>00924 -<a name="l00925"></a>00925 pCaret = &pEvent->data.key.caret; -<a name="l00926"></a>00926 -<a name="l00927"></a>00927 Error_CheckFatal(Wimp_GetIconState(pCaret->window, pCaret->icon, &tIcon)); -<a name="l00928"></a>00928 <span class="keywordflow">if</span> (!tIcon.flags.data.text || !tIcon.flags.data.indirected) { -<a name="l00929"></a>00929 werr(1, <span class="stringliteral">"Icon %d must be indirected text"</span>, (<span class="keywordtype">int</span>)pCaret->icon); -<a name="l00930"></a>00930 } -<a name="l00931"></a>00931 iNumber = (int)strtol(tIcon.data.indirecttext.buffer, &pcChar, 10); -<a name="l00932"></a>00932 -<a name="l00933"></a>00933 <span class="keywordflow">switch</span>(pCaret->icon) { -<a name="l00934"></a>00934 <span class="keywordflow">case</span> CHOICES_BREAK_WRITEABLE: -<a name="l00935"></a>00935 <span class="keywordflow">if</span> (*pcChar != <span class="charliteral">'\0'</span> && *pcChar != <span class="charliteral">'\r'</span>) { -<a name="l00936"></a>00936 DBG_DEC(*pcChar); -<a name="l00937"></a>00937 iNumber = DEFAULT_SCREEN_WIDTH; -<a name="l00938"></a>00938 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iNumber < MIN_SCREEN_WIDTH) { -<a name="l00939"></a>00939 iNumber = MIN_SCREEN_WIDTH; -<a name="l00940"></a>00940 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iNumber > MAX_SCREEN_WIDTH) { -<a name="l00941"></a>00941 iNumber = MAX_SCREEN_WIDTH; -<a name="l00942"></a>00942 } -<a name="l00943"></a>00943 vSetParagraphBreak(pCaret->window, iNumber); -<a name="l00944"></a>00944 <span class="keywordflow">break</span>; -<a name="l00945"></a>00945 <span class="keywordflow">case</span> CHOICES_SCALE_WRITEABLE: -<a name="l00946"></a>00946 <span class="keywordflow">if</span> (*pcChar != <span class="charliteral">'\0'</span> && *pcChar != <span class="charliteral">'\r'</span>) { -<a name="l00947"></a>00947 DBG_DEC(*pcChar); -<a name="l00948"></a>00948 iNumber = DEFAULT_SCALE_FACTOR; -<a name="l00949"></a>00949 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iNumber < MIN_SCALE_FACTOR) { -<a name="l00950"></a>00950 iNumber = MIN_SCALE_FACTOR; -<a name="l00951"></a>00951 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iNumber > MAX_SCALE_FACTOR) { -<a name="l00952"></a>00952 iNumber = MAX_SCALE_FACTOR; -<a name="l00953"></a>00953 } -<a name="l00954"></a>00954 vSetScaleFactor(pCaret->window, iNumber); -<a name="l00955"></a>00955 <span class="keywordflow">break</span>; -<a name="l00956"></a>00956 <span class="keywordflow">default</span>: -<a name="l00957"></a>00957 DBG_DEC(pCaret->icon); -<a name="l00958"></a>00958 <span class="keywordflow">break</span>; -<a name="l00959"></a>00959 } -<a name="l00960"></a>00960 <span class="keywordflow">return</span> TRUE; -<a name="l00961"></a>00961 } <span class="comment">/* end of bChoicesKeyPressed */</span> -<a name="l00962"></a>00962 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/out2window_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,784 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/out2window.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/out2window.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * out2window.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Output to a text window</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <ctype.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/* Used for numbering the chapters */</span> -<a name="l00015"></a>00015 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> auiHdrCounter[9]; -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="comment">/*</span> -<a name="l00019"></a>00019 <span class="comment"> * vString2Diagram - put a string into a diagram</span> -<a name="l00020"></a>00020 <span class="comment"> */</span> -<a name="l00021"></a>00021 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00022"></a>00022 vString2Diagram(diagram_type *pDiag, output_type *pAnchor) -<a name="l00023"></a>00023 { -<a name="l00024"></a>00024 output_type *pOutput; -<a name="l00025"></a>00025 <span class="keywordtype">long</span> lWidth; -<a name="l00026"></a>00026 USHORT usMaxFontSize; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 TRACE_MSG(<span class="stringliteral">"vString2Diagram"</span>); -<a name="l00029"></a>00029 -<a name="l00030"></a>00030 fail(pDiag == NULL); -<a name="l00031"></a>00031 fail(pAnchor == NULL); -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Compute the maximum fontsize in this string */</span> -<a name="l00034"></a>00034 usMaxFontSize = MIN_FONT_SIZE; -<a name="l00035"></a>00035 <span class="keywordflow">for</span> (pOutput = pAnchor; pOutput != NULL; pOutput = pOutput->pNext) { -<a name="l00036"></a>00036 <span class="keywordflow">if</span> (pOutput->usFontSize > usMaxFontSize) { -<a name="l00037"></a>00037 usMaxFontSize = pOutput->usFontSize; -<a name="l00038"></a>00038 } -<a name="l00039"></a>00039 } -<a name="l00040"></a>00040 -<a name="l00041"></a>00041 <span class="comment">/* Goto the next line */</span> -<a name="l00042"></a>00042 vMove2NextLine(pDiag, pAnchor->tFontRef, usMaxFontSize); -<a name="l00043"></a>00043 -<a name="l00044"></a>00044 <span class="comment">/* Output all substrings */</span> -<a name="l00045"></a>00045 <span class="keywordflow">for</span> (pOutput = pAnchor; pOutput != NULL; pOutput = pOutput->pNext) { -<a name="l00046"></a>00046 lWidth = lMilliPoints2DrawUnits(pOutput->lStringWidth); -<a name="l00047"></a>00047 vSubstring2Diagram(pDiag, pOutput->szStorage, -<a name="l00048"></a>00048 pOutput->tNextFree, lWidth, pOutput->ucFontColor, -<a name="l00049"></a>00049 pOutput->usFontStyle, pOutput->tFontRef, -<a name="l00050"></a>00050 pOutput->usFontSize, usMaxFontSize); -<a name="l00051"></a>00051 } -<a name="l00052"></a>00052 -<a name="l00053"></a>00053 <span class="comment">/* Goto the start of the line */</span> -<a name="l00054"></a>00054 pDiag->lXleft = 0; -<a name="l00055"></a>00055 TRACE_MSG(<span class="stringliteral">"leaving vString2Diagram"</span>); -<a name="l00056"></a>00056 } <span class="comment">/* end of vString2Diagram */</span> -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/*</span> -<a name="l00059"></a>00059 <span class="comment"> * vSetLeftIndentation - set the left indentation of the specified diagram</span> -<a name="l00060"></a>00060 <span class="comment"> */</span> -<a name="l00061"></a>00061 <span class="keywordtype">void</span> -<a name="l00062"></a>00062 vSetLeftIndentation(diagram_type *pDiag, <span class="keywordtype">long</span> lLeftIndentation) -<a name="l00063"></a>00063 { -<a name="l00064"></a>00064 <span class="keywordtype">long</span> lX; -<a name="l00065"></a>00065 -<a name="l00066"></a>00066 TRACE_MSG(<span class="stringliteral">"vSetLeftIndentation"</span>); -<a name="l00067"></a>00067 -<a name="l00068"></a>00068 fail(pDiag == NULL); -<a name="l00069"></a>00069 fail(lLeftIndentation < 0); -<a name="l00070"></a>00070 -<a name="l00071"></a>00071 lX = lMilliPoints2DrawUnits(lLeftIndentation); -<a name="l00072"></a>00072 <span class="keywordflow">if</span> (lX > 0) { -<a name="l00073"></a>00073 pDiag->lXleft = lX; -<a name="l00074"></a>00074 } <span class="keywordflow">else</span> { -<a name="l00075"></a>00075 pDiag->lXleft = 0; -<a name="l00076"></a>00076 } -<a name="l00077"></a>00077 } <span class="comment">/* end of vSetLeftIndentation */</span> -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 <span class="comment">/*</span> -<a name="l00080"></a>00080 <span class="comment"> * lComputeNetWidth - compute the net string width</span> -<a name="l00081"></a>00081 <span class="comment"> */</span> -<a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">long</span> -<a name="l00083"></a>00083 lComputeNetWidth(output_type *pAnchor) -<a name="l00084"></a>00084 { -<a name="l00085"></a>00085 output_type *pTmp; -<a name="l00086"></a>00086 <span class="keywordtype">long</span> lNetWidth; -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 TRACE_MSG(<span class="stringliteral">"lComputeNetWidth"</span>); -<a name="l00089"></a>00089 -<a name="l00090"></a>00090 fail(pAnchor == NULL); -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 <span class="comment">/* Step 1: Count all but the last sub-string */</span> -<a name="l00093"></a>00093 lNetWidth = 0; -<a name="l00094"></a>00094 <span class="keywordflow">for</span> (pTmp = pAnchor; pTmp->pNext != NULL; pTmp = pTmp->pNext) { -<a name="l00095"></a>00095 fail(pTmp->lStringWidth < 0); -<a name="l00096"></a>00096 lNetWidth += pTmp->lStringWidth; -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 fail(pTmp == NULL); -<a name="l00099"></a>00099 fail(pTmp->pNext != NULL); -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 <span class="comment">/* Step 2: remove the white-space from the end of the string */</span> -<a name="l00102"></a>00102 <span class="keywordflow">while</span> (pTmp->tNextFree != 0 && -<a name="l00103"></a>00103 isspace((<span class="keywordtype">int</span>)(UCHAR)pTmp->szStorage[pTmp->tNextFree - 1])) { -<a name="l00104"></a>00104 pTmp->szStorage[pTmp->tNextFree - 1] = <span class="charliteral">'\0'</span>; -<a name="l00105"></a>00105 pTmp->tNextFree--; -<a name="l00106"></a>00106 NO_DBG_DEC(pTmp->lStringWidth); -<a name="l00107"></a>00107 pTmp->lStringWidth = lComputeStringWidth( -<a name="l00108"></a>00108 pTmp->szStorage, -<a name="l00109"></a>00109 pTmp->tNextFree, -<a name="l00110"></a>00110 pTmp->tFontRef, -<a name="l00111"></a>00111 pTmp->usFontSize); -<a name="l00112"></a>00112 NO_DBG_DEC(pTmp->lStringWidth); -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 -<a name="l00115"></a>00115 <span class="comment">/* Step 3: Count the last sub-string */</span> -<a name="l00116"></a>00116 lNetWidth += pTmp->lStringWidth; -<a name="l00117"></a>00117 <span class="keywordflow">return</span> lNetWidth; -<a name="l00118"></a>00118 } <span class="comment">/* end of lComputeNetWidth */</span> -<a name="l00119"></a>00119 -<a name="l00120"></a>00120 <span class="comment">/*</span> -<a name="l00121"></a>00121 <span class="comment"> * iComputeHoles - compute number of holes</span> -<a name="l00122"></a>00122 <span class="comment"> * (A hole is a number of whitespace characters followed by a</span> -<a name="l00123"></a>00123 <span class="comment"> * non-whitespace character)</span> -<a name="l00124"></a>00124 <span class="comment"> */</span> -<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00126"></a>00126 iComputeHoles(output_type *pAnchor) -<a name="l00127"></a>00127 { -<a name="l00128"></a>00128 output_type *pTmp; -<a name="l00129"></a>00129 <span class="keywordtype">size_t</span> tIndex; -<a name="l00130"></a>00130 <span class="keywordtype">int</span> iCounter; -<a name="l00131"></a>00131 BOOL bWasSpace, bIsSpace; -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 TRACE_MSG(<span class="stringliteral">"iComputeHoles"</span>); -<a name="l00134"></a>00134 -<a name="l00135"></a>00135 fail(pAnchor == NULL); -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 iCounter = 0; -<a name="l00138"></a>00138 bIsSpace = FALSE; -<a name="l00139"></a>00139 <span class="comment">/* Count the holes */</span> -<a name="l00140"></a>00140 <span class="keywordflow">for</span> (pTmp = pAnchor; pTmp != NULL; pTmp = pTmp->pNext) { -<a name="l00141"></a>00141 fail(pTmp->tNextFree != strlen(pTmp->szStorage)); -<a name="l00142"></a>00142 <span class="keywordflow">for</span> (tIndex = 0; tIndex <= pTmp->tNextFree; tIndex++) { -<a name="l00143"></a>00143 bWasSpace = bIsSpace; -<a name="l00144"></a>00144 bIsSpace = isspace((<span class="keywordtype">int</span>)(UCHAR)pTmp->szStorage[tIndex]); -<a name="l00145"></a>00145 <span class="keywordflow">if</span> (bWasSpace && !bIsSpace) { -<a name="l00146"></a>00146 iCounter++; -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 } -<a name="l00150"></a>00150 <span class="keywordflow">return</span> iCounter; -<a name="l00151"></a>00151 } <span class="comment">/* end of iComputeHoles */</span> -<a name="l00152"></a>00152 -<a name="l00153"></a>00153 <span class="comment">/*</span> -<a name="l00154"></a>00154 <span class="comment"> * vAlign2Window - Align a string and insert it into the text</span> -<a name="l00155"></a>00155 <span class="comment"> */</span> -<a name="l00156"></a>00156 <span class="keywordtype">void</span> -<a name="l00157"></a>00157 vAlign2Window(diagram_type *pDiag, output_type *pAnchor, -<a name="l00158"></a>00158 <span class="keywordtype">long</span> lScreenWidth, UCHAR ucAlignment) -<a name="l00159"></a>00159 { -<a name="l00160"></a>00160 <span class="keywordtype">long</span> lNetWidth, lLeftIndentation; -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 TRACE_MSG(<span class="stringliteral">"vAlign2Window"</span>); -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 fail(pDiag == NULL || pAnchor == NULL); -<a name="l00165"></a>00165 fail(lScreenWidth < lChar2MilliPoints(MIN_SCREEN_WIDTH)); -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 lNetWidth = lComputeNetWidth(pAnchor); -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="keywordflow">if</span> (lScreenWidth > lChar2MilliPoints(MAX_SCREEN_WIDTH) || -<a name="l00170"></a>00170 lNetWidth <= 0) { -<a name="l00171"></a>00171 <span class="comment">/*</span> -<a name="l00172"></a>00172 <span class="comment"> * Screenwidth is "infinite", so no alignment is possible</span> -<a name="l00173"></a>00173 <span class="comment"> * Don't bother to align an empty line</span> -<a name="l00174"></a>00174 <span class="comment"> */</span> -<a name="l00175"></a>00175 vString2Diagram(pDiag, pAnchor); -<a name="l00176"></a>00176 TRACE_MSG(<span class="stringliteral">"leaving vAlign2Window #1"</span>); -<a name="l00177"></a>00177 <span class="keywordflow">return</span>; -<a name="l00178"></a>00178 } -<a name="l00179"></a>00179 -<a name="l00180"></a>00180 <span class="keywordflow">switch</span> (ucAlignment) { -<a name="l00181"></a>00181 <span class="keywordflow">case</span> ALIGNMENT_CENTER: -<a name="l00182"></a>00182 lLeftIndentation = (lScreenWidth - lNetWidth) / 2; -<a name="l00183"></a>00183 DBG_DEC_C(lLeftIndentation < 0, lLeftIndentation); -<a name="l00184"></a>00184 <span class="keywordflow">if</span> (lLeftIndentation > 0) { -<a name="l00185"></a>00185 vSetLeftIndentation(pDiag, lLeftIndentation); -<a name="l00186"></a>00186 } -<a name="l00187"></a>00187 <span class="keywordflow">break</span>; -<a name="l00188"></a>00188 <span class="keywordflow">case</span> ALIGNMENT_RIGHT: -<a name="l00189"></a>00189 lLeftIndentation = lScreenWidth - lNetWidth; -<a name="l00190"></a>00190 DBG_DEC_C(lLeftIndentation < 0, lLeftIndentation); -<a name="l00191"></a>00191 <span class="keywordflow">if</span> (lLeftIndentation > 0) { -<a name="l00192"></a>00192 vSetLeftIndentation(pDiag, lLeftIndentation); -<a name="l00193"></a>00193 } -<a name="l00194"></a>00194 <span class="keywordflow">break</span>; -<a name="l00195"></a>00195 <span class="keywordflow">case</span> ALIGNMENT_JUSTIFY: -<a name="l00196"></a>00196 <span class="keywordflow">case</span> ALIGNMENT_LEFT: -<a name="l00197"></a>00197 <span class="keywordflow">default</span>: -<a name="l00198"></a>00198 <span class="keywordflow">break</span>; -<a name="l00199"></a>00199 } -<a name="l00200"></a>00200 vString2Diagram(pDiag, pAnchor); -<a name="l00201"></a>00201 TRACE_MSG(<span class="stringliteral">"leaving vAlign2Window #2"</span>); -<a name="l00202"></a>00202 } <span class="comment">/* end of vAlign2Window */</span> -<a name="l00203"></a>00203 -<a name="l00204"></a>00204 <span class="comment">/*</span> -<a name="l00205"></a>00205 <span class="comment"> * vJustify2Window - Justify a string and insert it into the text</span> -<a name="l00206"></a>00206 <span class="comment"> */</span> -<a name="l00207"></a>00207 <span class="keywordtype">void</span> -<a name="l00208"></a>00208 vJustify2Window(diagram_type *pDiag, output_type *pAnchor, -<a name="l00209"></a>00209 <span class="keywordtype">long</span> lScreenWidth, <span class="keywordtype">long</span> lRightIndentation, UCHAR ucAlignment) -<a name="l00210"></a>00210 { -<a name="l00211"></a>00211 output_type *pTmp; -<a name="l00212"></a>00212 <span class="keywordtype">char</span> *pcNew, *pcOld, *szStorage; -<a name="l00213"></a>00213 <span class="keywordtype">long</span> lNetWidth, lSpaceWidth, lToAdd; -<a name="l00214"></a>00214 <span class="keywordtype">int</span> iFillerLen, iHoles; -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 TRACE_MSG(<span class="stringliteral">"vJustify2Window"</span>); -<a name="l00217"></a>00217 -<a name="l00218"></a>00218 fail(pDiag == NULL || pAnchor == NULL); -<a name="l00219"></a>00219 fail(lScreenWidth < MIN_SCREEN_WIDTH); -<a name="l00220"></a>00220 fail(lRightIndentation > 0); -<a name="l00221"></a>00221 -<a name="l00222"></a>00222 <span class="keywordflow">if</span> (ucAlignment != ALIGNMENT_JUSTIFY) { -<a name="l00223"></a>00223 vAlign2Window(pDiag, pAnchor, lScreenWidth, ucAlignment); -<a name="l00224"></a>00224 <span class="keywordflow">return</span>; -<a name="l00225"></a>00225 } -<a name="l00226"></a>00226 -<a name="l00227"></a>00227 lNetWidth = lComputeNetWidth(pAnchor); -<a name="l00228"></a>00228 -<a name="l00229"></a>00229 <span class="keywordflow">if</span> (lScreenWidth > lChar2MilliPoints(MAX_SCREEN_WIDTH) || -<a name="l00230"></a>00230 lNetWidth <= 0) { -<a name="l00231"></a>00231 <span class="comment">/*</span> -<a name="l00232"></a>00232 <span class="comment"> * Screenwidth is "infinite", so justify is not possible</span> -<a name="l00233"></a>00233 <span class="comment"> * Don't bother to justify an empty line</span> -<a name="l00234"></a>00234 <span class="comment"> */</span> -<a name="l00235"></a>00235 vString2Diagram(pDiag, pAnchor); -<a name="l00236"></a>00236 TRACE_MSG(<span class="stringliteral">"leaving vJustify2Window #1"</span>); -<a name="l00237"></a>00237 <span class="keywordflow">return</span>; -<a name="l00238"></a>00238 } -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 <span class="comment">/* Justify */</span> -<a name="l00241"></a>00241 fail(ucAlignment != ALIGNMENT_JUSTIFY); -<a name="l00242"></a>00242 lSpaceWidth = lComputeStringWidth(<span class="stringliteral">" "</span>, 1, -<a name="l00243"></a>00243 pAnchor->tFontRef, pAnchor->usFontSize); -<a name="l00244"></a>00244 lToAdd = lScreenWidth - -<a name="l00245"></a>00245 lNetWidth - -<a name="l00246"></a>00246 lDrawUnits2MilliPoints(pDiag->lXleft) + -<a name="l00247"></a>00247 lRightIndentation; -<a name="l00248"></a>00248 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00249"></a>00249 <span class="preprocessor"></span> <span class="keywordflow">if</span> (lToAdd / lSpaceWidth < -1) { -<a name="l00250"></a>00250 DBG_DEC(lSpaceWidth); -<a name="l00251"></a>00251 DBG_DEC(lToAdd); -<a name="l00252"></a>00252 DBG_DEC(lScreenWidth); -<a name="l00253"></a>00253 DBG_DEC(lNetWidth); -<a name="l00254"></a>00254 DBG_DEC(lDrawUnits2MilliPoints(pDiag->lXleft)); -<a name="l00255"></a>00255 DBG_DEC(pDiag->lXleft); -<a name="l00256"></a>00256 DBG_DEC(lRightIndentation); -<a name="l00257"></a>00257 } -<a name="l00258"></a>00258 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00259"></a>00259 lToAdd /= lSpaceWidth; -<a name="l00260"></a>00260 DBG_DEC_C(lToAdd < 0, lToAdd); -<a name="l00261"></a>00261 <span class="keywordflow">if</span> (lToAdd <= 0) { -<a name="l00262"></a>00262 vString2Diagram(pDiag, pAnchor); -<a name="l00263"></a>00263 TRACE_MSG(<span class="stringliteral">"leaving vJustify2Window #2"</span>); -<a name="l00264"></a>00264 <span class="keywordflow">return</span>; -<a name="l00265"></a>00265 } -<a name="l00266"></a>00266 -<a name="l00267"></a>00267 <span class="comment">/* Justify by adding spaces */</span> -<a name="l00268"></a>00268 iHoles = iComputeHoles(pAnchor); -<a name="l00269"></a>00269 <span class="keywordflow">for</span> (pTmp = pAnchor; pTmp != NULL; pTmp = pTmp->pNext) { -<a name="l00270"></a>00270 fail(pTmp->tNextFree != strlen(pTmp->szStorage)); -<a name="l00271"></a>00271 fail(lToAdd < 0); -<a name="l00272"></a>00272 szStorage = xmalloc(pTmp->tNextFree + (<span class="keywordtype">size_t</span>)lToAdd + 1); -<a name="l00273"></a>00273 pcNew = szStorage; -<a name="l00274"></a>00274 <span class="keywordflow">for</span> (pcOld = pTmp->szStorage; *pcOld != <span class="charliteral">'\0'</span>; pcOld++) { -<a name="l00275"></a>00275 *pcNew++ = *pcOld; -<a name="l00276"></a>00276 <span class="keywordflow">if</span> (*pcOld == <span class="charliteral">' '</span> && -<a name="l00277"></a>00277 *(pcOld + 1) != <span class="charliteral">' '</span> && -<a name="l00278"></a>00278 iHoles > 0) { -<a name="l00279"></a>00279 iFillerLen = (int)(lToAdd / iHoles); -<a name="l00280"></a>00280 lToAdd -= iFillerLen; -<a name="l00281"></a>00281 iHoles--; -<a name="l00282"></a>00282 <span class="keywordflow">for</span> (; iFillerLen > 0; iFillerLen--) { -<a name="l00283"></a>00283 *pcNew++ = <span class="charliteral">' '</span>; -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 } -<a name="l00287"></a>00287 *pcNew = <span class="charliteral">'\0'</span>; -<a name="l00288"></a>00288 pTmp->szStorage = xfree(pTmp->szStorage); -<a name="l00289"></a>00289 pTmp->szStorage = szStorage; -<a name="l00290"></a>00290 pTmp->tStorageSize = pTmp->tNextFree + (size_t)lToAdd + 1; -<a name="l00291"></a>00291 pTmp->lStringWidth += -<a name="l00292"></a>00292 (pcNew - szStorage - (long)pTmp->tNextFree) * -<a name="l00293"></a>00293 lSpaceWidth; -<a name="l00294"></a>00294 fail(pcNew < szStorage); -<a name="l00295"></a>00295 pTmp->tNextFree = (size_t)(pcNew - szStorage); -<a name="l00296"></a>00296 fail(pTmp->tNextFree != strlen(pTmp->szStorage)); -<a name="l00297"></a>00297 } -<a name="l00298"></a>00298 DBG_DEC_C(lToAdd != 0, lToAdd); -<a name="l00299"></a>00299 vString2Diagram(pDiag, pAnchor); -<a name="l00300"></a>00300 TRACE_MSG(<span class="stringliteral">"leaving vJustify2Window #3"</span>); -<a name="l00301"></a>00301 } <span class="comment">/* end of vJustify2Window */</span> -<a name="l00302"></a>00302 -<a name="l00303"></a>00303 <span class="comment">/*</span> -<a name="l00304"></a>00304 <span class="comment"> * vResetStyles - reset the style information variables</span> -<a name="l00305"></a>00305 <span class="comment"> */</span> -<a name="l00306"></a>00306 <span class="keywordtype">void</span> -<a name="l00307"></a>00307 vResetStyles(<span class="keywordtype">void</span>) -<a name="l00308"></a>00308 { -<a name="l00309"></a>00309 TRACE_MSG(<span class="stringliteral">"vResetStyles"</span>); -<a name="l00310"></a>00310 -<a name="l00311"></a>00311 (void)memset(auiHdrCounter, 0, <span class="keyword">sizeof</span>(auiHdrCounter)); -<a name="l00312"></a>00312 } <span class="comment">/* end of vResetStyles */</span> -<a name="l00313"></a>00313 -<a name="l00314"></a>00314 <span class="comment">/*</span> -<a name="l00315"></a>00315 <span class="comment"> * tStyle2Window - Add the style characters to the line</span> -<a name="l00316"></a>00316 <span class="comment"> *</span> -<a name="l00317"></a>00317 <span class="comment"> * Returns the length of the resulting string</span> -<a name="l00318"></a>00318 <span class="comment"> */</span> -<a name="l00319"></a>00319 <span class="keywordtype">size_t</span> -<a name="l00320"></a>00320 tStyle2Window(<span class="keywordtype">char</span> *szLine, <span class="keywordtype">size_t</span> tLineSize, <span class="keyword">const</span> style_block_type *pStyle, -<a name="l00321"></a>00321 <span class="keyword">const</span> section_block_type *pSection) -<a name="l00322"></a>00322 { -<a name="l00323"></a>00323 <span class="keywordtype">char</span> *pcTxt; -<a name="l00324"></a>00324 <span class="keywordtype">size_t</span> tIndex, tStyleIndex; -<a name="l00325"></a>00325 BOOL bNeedPrevLvl; -<a name="l00326"></a>00326 level_type_enum eNumType; -<a name="l00327"></a>00327 UCHAR ucNFC; -<a name="l00328"></a>00328 -<a name="l00329"></a>00329 TRACE_MSG(<span class="stringliteral">"tStyle2Window"</span>); -<a name="l00330"></a>00330 -<a name="l00331"></a>00331 fail(szLine == NULL || pStyle == NULL || pSection == NULL); -<a name="l00332"></a>00332 -<a name="l00333"></a>00333 <span class="keywordflow">if</span> (pStyle->usIstd == 0 || pStyle->usIstd > 9) { -<a name="l00334"></a>00334 szLine[0] = <span class="charliteral">'\0'</span>; -<a name="l00335"></a>00335 <span class="keywordflow">return</span> 0; -<a name="l00336"></a>00336 } -<a name="l00337"></a>00337 -<a name="l00338"></a>00338 <span class="comment">/* Set the numbers */</span> -<a name="l00339"></a>00339 tStyleIndex = (size_t)pStyle->usIstd - 1; -<a name="l00340"></a>00340 <a class="code" href="interfacefor.html">for</a> (tIndex = 0; tIndex < 9; tIndex++) { -<a name="l00341"></a>00341 <span class="keywordflow">if</span> (tIndex == tStyleIndex) { -<a name="l00342"></a>00342 auiHdrCounter[tIndex]++; -<a name="l00343"></a>00343 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tIndex > tStyleIndex) { -<a name="l00344"></a>00344 auiHdrCounter[tIndex] = 0; -<a name="l00345"></a>00345 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (auiHdrCounter[tIndex] == 0) { -<a name="l00346"></a>00346 auiHdrCounter[tIndex] = 1; -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 } -<a name="l00349"></a>00349 -<a name="l00350"></a>00350 eNumType = eGetNumType(pStyle->ucNumLevel); -<a name="l00351"></a>00351 <span class="keywordflow">if</span> (eNumType != level_type_outline) { -<a name="l00352"></a>00352 szLine[0] = <span class="charliteral">'\0'</span>; -<a name="l00353"></a>00353 <span class="keywordflow">return</span> 0; -<a name="l00354"></a>00354 } -<a name="l00355"></a>00355 -<a name="l00356"></a>00356 <span class="comment">/* Print the numbers */</span> -<a name="l00357"></a>00357 pcTxt = szLine; -<a name="l00358"></a>00358 bNeedPrevLvl = (pSection->usNeedPrevLvl & BIT(tStyleIndex)) != 0; -<a name="l00359"></a>00359 <span class="keywordflow">for</span> (tIndex = 0; tIndex <= tStyleIndex; tIndex++) { -<a name="l00360"></a>00360 <span class="keywordflow">if</span> (tIndex == tStyleIndex || -<a name="l00361"></a>00361 (bNeedPrevLvl && tIndex < tStyleIndex)) { -<a name="l00362"></a>00362 <span class="keywordflow">if</span> (pcTxt - szLine >= tLineSize - 25) { -<a name="l00363"></a>00363 <span class="comment">/* Prevent a possible buffer overflow */</span> -<a name="l00364"></a>00364 DBG_DEC(pcTxt - szLine); -<a name="l00365"></a>00365 DBG_DEC(tLineSize - 25); -<a name="l00366"></a>00366 DBG_FIXME(); -<a name="l00367"></a>00367 szLine[0] = <span class="charliteral">'\0'</span>; -<a name="l00368"></a>00368 <span class="keywordflow">return</span> 0; -<a name="l00369"></a>00369 } -<a name="l00370"></a>00370 ucNFC = pSection->aucNFC[tIndex]; -<a name="l00371"></a>00371 <span class="keywordflow">switch</span>(ucNFC) { -<a name="l00372"></a>00372 <span class="keywordflow">case</span> LIST_ARABIC_NUM: -<a name="l00373"></a>00373 <span class="keywordflow">case</span> LIST_NUMBER_TXT: -<a name="l00374"></a>00374 <span class="keywordflow">case</span> LIST_ORDINAL_TXT: -<a name="l00375"></a>00375 pcTxt += sprintf(pcTxt, <span class="stringliteral">"%u"</span>, -<a name="l00376"></a>00376 auiHdrCounter[tIndex]); -<a name="l00377"></a>00377 <span class="keywordflow">break</span>; -<a name="l00378"></a>00378 <span class="keywordflow">case</span> LIST_UPPER_ROMAN: -<a name="l00379"></a>00379 <span class="keywordflow">case</span> LIST_LOWER_ROMAN: -<a name="l00380"></a>00380 pcTxt += tNumber2Roman( -<a name="l00381"></a>00381 auiHdrCounter[tIndex], -<a name="l00382"></a>00382 ucNFC == LIST_UPPER_ROMAN, -<a name="l00383"></a>00383 pcTxt); -<a name="l00384"></a>00384 <span class="keywordflow">break</span>; -<a name="l00385"></a>00385 <span class="keywordflow">case</span> LIST_UPPER_ALPHA: -<a name="l00386"></a>00386 <span class="keywordflow">case</span> LIST_LOWER_ALPHA: -<a name="l00387"></a>00387 pcTxt += tNumber2Alpha( -<a name="l00388"></a>00388 auiHdrCounter[tIndex], -<a name="l00389"></a>00389 ucNFC == LIST_UPPER_ALPHA, -<a name="l00390"></a>00390 pcTxt); -<a name="l00391"></a>00391 <span class="keywordflow">break</span>; -<a name="l00392"></a>00392 <span class="keywordflow">case</span> LIST_OUTLINE_NUM: -<a name="l00393"></a>00393 pcTxt += sprintf(pcTxt, <span class="stringliteral">"%02u"</span>, -<a name="l00394"></a>00394 auiHdrCounter[tIndex]); -<a name="l00395"></a>00395 <span class="keywordflow">break</span>; -<a name="l00396"></a>00396 <span class="keywordflow">default</span>: -<a name="l00397"></a>00397 DBG_DEC(ucNFC); -<a name="l00398"></a>00398 DBG_FIXME(); -<a name="l00399"></a>00399 pcTxt += sprintf(pcTxt, <span class="stringliteral">"%u"</span>, -<a name="l00400"></a>00400 auiHdrCounter[tIndex]); -<a name="l00401"></a>00401 <span class="keywordflow">break</span>; -<a name="l00402"></a>00402 } -<a name="l00403"></a>00403 <span class="keywordflow">if</span> (tIndex < tStyleIndex) { -<a name="l00404"></a>00404 *pcTxt++ = <span class="charliteral">'.'</span>; -<a name="l00405"></a>00405 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tIndex == tStyleIndex) { -<a name="l00406"></a>00406 *pcTxt++ = <span class="charliteral">' '</span>; -<a name="l00407"></a>00407 } -<a name="l00408"></a>00408 } -<a name="l00409"></a>00409 } -<a name="l00410"></a>00410 *pcTxt = <span class="charliteral">'\0'</span>; -<a name="l00411"></a>00411 NO_DBG_MSG_C((<span class="keywordtype">int</span>)pStyle->usIstd >= 1 && -<a name="l00412"></a>00412 (<span class="keywordtype">int</span>)pStyle->usIstd <= 9 && -<a name="l00413"></a>00413 eNumType != level_type_none && -<a name="l00414"></a>00414 eNumType != level_type_outline, szLine); -<a name="l00415"></a>00415 NO_DBG_MSG_C(szLine[0] != <span class="charliteral">'\0'</span>, szLine); -<a name="l00416"></a>00416 fail(pcTxt < szLine); -<a name="l00417"></a>00417 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)(pcTxt - szLine); -<a name="l00418"></a>00418 } <span class="comment">/* end of tStyle2Window */</span> -<a name="l00419"></a>00419 -<a name="l00420"></a>00420 <span class="comment">/*</span> -<a name="l00421"></a>00421 <span class="comment"> * vRemoveRowEnd - remove the end of table row indicator</span> -<a name="l00422"></a>00422 <span class="comment"> *</span> -<a name="l00423"></a>00423 <span class="comment"> * Remove the double TABLE_SEPARATOR characters from the end of the string.</span> -<a name="l00424"></a>00424 <span class="comment"> * Special: remove the TABLE_SEPARATOR, 0x0a sequence</span> -<a name="l00425"></a>00425 <span class="comment"> */</span> -<a name="l00426"></a>00426 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00427"></a>00427 vRemoveRowEnd(<span class="keywordtype">char</span> *szRowTxt) -<a name="l00428"></a>00428 { -<a name="l00429"></a>00429 <span class="keywordtype">int</span> iLastIndex; -<a name="l00430"></a>00430 -<a name="l00431"></a>00431 TRACE_MSG(<span class="stringliteral">"vRemoveRowEnd"</span>); -<a name="l00432"></a>00432 -<a name="l00433"></a>00433 fail(szRowTxt == NULL || szRowTxt[0] == <span class="charliteral">'\0'</span>); -<a name="l00434"></a>00434 -<a name="l00435"></a>00435 iLastIndex = (int)strlen(szRowTxt) - 1; -<a name="l00436"></a>00436 -<a name="l00437"></a>00437 <span class="keywordflow">if</span> (szRowTxt[iLastIndex] == TABLE_SEPARATOR || -<a name="l00438"></a>00438 szRowTxt[iLastIndex] == (<span class="keywordtype">char</span>)0x0a) { -<a name="l00439"></a>00439 szRowTxt[iLastIndex] = <span class="charliteral">'\0'</span>; -<a name="l00440"></a>00440 iLastIndex--; -<a name="l00441"></a>00441 } <span class="keywordflow">else</span> { -<a name="l00442"></a>00442 DBG_HEX(szRowTxt[iLastIndex]); -<a name="l00443"></a>00443 } -<a name="l00444"></a>00444 -<a name="l00445"></a>00445 <span class="keywordflow">if</span> (iLastIndex >= 0 && szRowTxt[iLastIndex] == (<span class="keywordtype">char</span>)0x0a) { -<a name="l00446"></a>00446 szRowTxt[iLastIndex] = <span class="charliteral">'\0'</span>; -<a name="l00447"></a>00447 iLastIndex--; -<a name="l00448"></a>00448 } -<a name="l00449"></a>00449 -<a name="l00450"></a>00450 <span class="keywordflow">if</span> (iLastIndex >= 0 && szRowTxt[iLastIndex] == TABLE_SEPARATOR) { -<a name="l00451"></a>00451 szRowTxt[iLastIndex] = <span class="charliteral">'\0'</span>; -<a name="l00452"></a>00452 <span class="keywordflow">return</span>; -<a name="l00453"></a>00453 } -<a name="l00454"></a>00454 -<a name="l00455"></a>00455 DBG_DEC(iLastIndex); -<a name="l00456"></a>00456 DBG_HEX(szRowTxt[iLastIndex]); -<a name="l00457"></a>00457 DBG_MSG(szRowTxt); -<a name="l00458"></a>00458 } <span class="comment">/* end of vRemoveRowEnd */</span> -<a name="l00459"></a>00459 -<a name="l00460"></a>00460 <span class="comment">/*</span> -<a name="l00461"></a>00461 <span class="comment"> * tComputeStringLengthMax - max string length in relation to max column width</span> -<a name="l00462"></a>00462 <span class="comment"> *</span> -<a name="l00463"></a>00463 <span class="comment"> * Return the maximum string length</span> -<a name="l00464"></a>00464 <span class="comment"> */</span> -<a name="l00465"></a>00465 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00466"></a>00466 tComputeStringLengthMax(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tColumnWidthMax) -<a name="l00467"></a>00467 { -<a name="l00468"></a>00468 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00469"></a>00469 <span class="keywordtype">size_t</span> tLengthMax, tLenPrev, tLen, tWidth; -<a name="l00470"></a>00470 -<a name="l00471"></a>00471 TRACE_MSG(<span class="stringliteral">"tComputeStringLengthMax"</span>); -<a name="l00472"></a>00472 -<a name="l00473"></a>00473 fail(szString == NULL); -<a name="l00474"></a>00474 fail(tColumnWidthMax == 0); -<a name="l00475"></a>00475 -<a name="l00476"></a>00476 pcTmp = strchr(szString, <span class="charliteral">'\n'</span>); -<a name="l00477"></a>00477 <span class="keywordflow">if</span> (pcTmp != NULL) { -<a name="l00478"></a>00478 tLengthMax = (size_t)(pcTmp - szString + 1); -<a name="l00479"></a>00479 } <span class="keywordflow">else</span> { -<a name="l00480"></a>00480 tLengthMax = strlen(szString); -<a name="l00481"></a>00481 } -<a name="l00482"></a>00482 <span class="keywordflow">if</span> (tLengthMax == 0) { -<a name="l00483"></a>00483 <span class="keywordflow">return</span> 0; -<a name="l00484"></a>00484 } -<a name="l00485"></a>00485 -<a name="l00486"></a>00486 tLen = 0; -<a name="l00487"></a>00487 tWidth = 0; -<a name="l00488"></a>00488 <span class="keywordflow">for</span> (;;) { -<a name="l00489"></a>00489 tLenPrev = tLen; -<a name="l00490"></a>00490 tLen += tGetCharacterLength(szString + tLen); -<a name="l00491"></a>00491 DBG_DEC_C(tLen > tLengthMax, tLen); -<a name="l00492"></a>00492 DBG_DEC_C(tLen > tLengthMax, tLengthMax); -<a name="l00493"></a>00493 fail(tLen > tLengthMax); -<a name="l00494"></a>00494 tWidth = tCountColumns(szString, tLen); -<a name="l00495"></a>00495 <span class="keywordflow">if</span> (tWidth > tColumnWidthMax) { -<a name="l00496"></a>00496 <span class="keywordflow">return</span> tLenPrev; -<a name="l00497"></a>00497 } -<a name="l00498"></a>00498 <span class="keywordflow">if</span> (tLen >= tLengthMax) { -<a name="l00499"></a>00499 <span class="keywordflow">return</span> tLengthMax; -<a name="l00500"></a>00500 } -<a name="l00501"></a>00501 } -<a name="l00502"></a>00502 } <span class="comment">/* end of tComputeStringLengthMax */</span> -<a name="l00503"></a>00503 -<a name="l00504"></a>00504 <span class="comment">/*</span> -<a name="l00505"></a>00505 <span class="comment"> * tGetBreakingPoint - get the number of bytes that fit the column</span> -<a name="l00506"></a>00506 <span class="comment"> *</span> -<a name="l00507"></a>00507 <span class="comment"> * Returns the number of bytes that fit the column</span> -<a name="l00508"></a>00508 <span class="comment"> */</span> -<a name="l00509"></a>00509 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00510"></a>00510 tGetBreakingPoint(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, -<a name="l00511"></a>00511 <span class="keywordtype">size_t</span> tLen, <span class="keywordtype">size_t</span> tWidth, <span class="keywordtype">size_t</span> tColumnWidthMax) -<a name="l00512"></a>00512 { -<a name="l00513"></a>00513 <span class="keywordtype">int</span> iIndex; -<a name="l00514"></a>00514 -<a name="l00515"></a>00515 TRACE_MSG(<span class="stringliteral">"tGetBreakingPoint"</span>); -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 fail(szString == NULL); -<a name="l00518"></a>00518 fail(tLen > strlen(szString)); -<a name="l00519"></a>00519 fail(tWidth > tColumnWidthMax); -<a name="l00520"></a>00520 -<a name="l00521"></a>00521 <span class="keywordflow">if</span> (tWidth < tColumnWidthMax || -<a name="l00522"></a>00522 (tWidth == tColumnWidthMax && -<a name="l00523"></a>00523 (szString[tLen] == <span class="charliteral">' '</span> || -<a name="l00524"></a>00524 szString[tLen] == <span class="charliteral">'\n'</span> || -<a name="l00525"></a>00525 szString[tLen] == <span class="charliteral">'\0'</span>))) { -<a name="l00526"></a>00526 <span class="comment">/* The string already fits, do nothing */</span> -<a name="l00527"></a>00527 <span class="keywordflow">return</span> tLen; -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 <span class="comment">/* Search for a breaking point */</span> -<a name="l00530"></a>00530 <span class="keywordflow">for</span> (iIndex = (<span class="keywordtype">int</span>)tLen - 1; iIndex >= 0; iIndex--) { -<a name="l00531"></a>00531 <span class="keywordflow">if</span> (szString[iIndex] == <span class="charliteral">' '</span>) { -<a name="l00532"></a>00532 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)iIndex; -<a name="l00533"></a>00533 } -<a name="l00534"></a>00534 } -<a name="l00535"></a>00535 <span class="comment">/* No breaking point found, just fill the column */</span> -<a name="l00536"></a>00536 <span class="keywordflow">return</span> tLen; -<a name="l00537"></a>00537 } <span class="comment">/* end of tGetBreakingPoint */</span> -<a name="l00538"></a>00538 -<a name="l00539"></a>00539 <span class="comment">/*</span> -<a name="l00540"></a>00540 <span class="comment"> * tComputeColumnWidthMax - compute the maximum column width</span> -<a name="l00541"></a>00541 <span class="comment"> */</span> -<a name="l00542"></a>00542 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00543"></a>00543 tComputeColumnWidthMax(<span class="keywordtype">short</span> sWidth, <span class="keywordtype">long</span> lCharWidth, <span class="keywordtype">double</span> dFactor) -<a name="l00544"></a>00544 { -<a name="l00545"></a>00545 <span class="keywordtype">size_t</span> tColumnWidthMax; -<a name="l00546"></a>00546 -<a name="l00547"></a>00547 TRACE_MSG(<span class="stringliteral">"tComputeColumnWidthMax"</span>); -<a name="l00548"></a>00548 -<a name="l00549"></a>00549 fail(sWidth < 0); -<a name="l00550"></a>00550 fail(lCharWidth <= 0); -<a name="l00551"></a>00551 fail(dFactor <= 0.0); -<a name="l00552"></a>00552 -<a name="l00553"></a>00553 tColumnWidthMax = (size_t)( -<a name="l00554"></a>00554 (lTwips2MilliPoints(sWidth) * dFactor + lCharWidth / 2.0) / -<a name="l00555"></a>00555 lCharWidth); -<a name="l00556"></a>00556 <span class="keywordflow">if</span> (tColumnWidthMax == 0) { -<a name="l00557"></a>00557 <span class="comment">/* Minimum column width */</span> -<a name="l00558"></a>00558 <span class="keywordflow">return</span> 1; -<a name="l00559"></a>00559 } -<a name="l00560"></a>00560 <span class="keywordflow">if</span> (tColumnWidthMax > 1) { -<a name="l00561"></a>00561 <span class="comment">/* Make room for the TABLE_SEPARATOR_CHAR */</span> -<a name="l00562"></a>00562 tColumnWidthMax--; -<a name="l00563"></a>00563 } -<a name="l00564"></a>00564 NO_DBG_DEC(tColumnWidthMax); -<a name="l00565"></a>00565 <span class="keywordflow">return</span> tColumnWidthMax; -<a name="l00566"></a>00566 } <span class="comment">/* end of tComputeColumnWidthMax */</span> -<a name="l00567"></a>00567 -<a name="l00568"></a>00568 <span class="comment">/*</span> -<a name="l00569"></a>00569 <span class="comment"> * vTableRow2Window - put a table row into a diagram</span> -<a name="l00570"></a>00570 <span class="comment"> */</span> -<a name="l00571"></a>00571 <span class="keywordtype">void</span> -<a name="l00572"></a>00572 vTableRow2Window(diagram_type *pDiag, output_type *pOutput, -<a name="l00573"></a>00573 <span class="keyword">const</span> row_block_type *pRowInfo, -<a name="l00574"></a>00574 conversion_type eConversionType, <span class="keywordtype">int</span> iParagraphBreak) -<a name="l00575"></a>00575 { -<a name="l00576"></a>00576 output_type tRow; -<a name="l00577"></a>00577 <span class="keywordtype">char</span> *aszColTxt[TABLE_COLUMN_MAX]; -<a name="l00578"></a>00578 <span class="keywordtype">char</span> *szLine, *pcTxt; -<a name="l00579"></a>00579 <span class="keywordtype">double</span> dMagnify; -<a name="l00580"></a>00580 <span class="keywordtype">long</span> lCharWidthLarge, lCharWidthSmall; -<a name="l00581"></a>00581 <span class="keywordtype">size_t</span> tColumnWidthTotal, atColumnWidthMax[TABLE_COLUMN_MAX]; -<a name="l00582"></a>00582 <span class="keywordtype">size_t</span> tSize, tColumnWidthMax, tWidth, tLen; -<a name="l00583"></a>00583 <span class="keywordtype">int</span> iIndex, iNbrOfColumns, iTmp; -<a name="l00584"></a>00584 BOOL bNotReady; -<a name="l00585"></a>00585 -<a name="l00586"></a>00586 TRACE_MSG(<span class="stringliteral">"vTableRow2Window"</span>); -<a name="l00587"></a>00587 -<a name="l00588"></a>00588 fail(pDiag == NULL || pOutput == NULL || pRowInfo == NULL); -<a name="l00589"></a>00589 fail(pOutput->szStorage == NULL); -<a name="l00590"></a>00590 fail(pOutput->pNext != NULL); -<a name="l00591"></a>00591 fail(iParagraphBreak < 0); -<a name="l00592"></a>00592 -<a name="l00593"></a>00593 <span class="comment">/* Character sizes */</span> -<a name="l00594"></a>00594 lCharWidthLarge = lComputeStringWidth(<span class="stringliteral">"W"</span>, 1, -<a name="l00595"></a>00595 pOutput->tFontRef, pOutput->usFontSize); -<a name="l00596"></a>00596 NO_DBG_DEC(lCharWidthLarge); -<a name="l00597"></a>00597 lCharWidthSmall = lComputeStringWidth(<span class="stringliteral">"i"</span>, 1, -<a name="l00598"></a>00598 pOutput->tFontRef, pOutput->usFontSize); -<a name="l00599"></a>00599 NO_DBG_DEC(lCharWidthSmall); -<a name="l00600"></a>00600 <span class="comment">/* For the time being: use a fixed width font */</span> -<a name="l00601"></a>00601 fail(lCharWidthLarge != lCharWidthSmall); -<a name="l00602"></a>00602 -<a name="l00603"></a>00603 vRemoveRowEnd(pOutput->szStorage); -<a name="l00604"></a>00604 -<a name="l00605"></a>00605 <span class="comment">/* Split the row text into a set of column texts */</span> -<a name="l00606"></a>00606 aszColTxt[0] = pOutput->szStorage; -<a name="l00607"></a>00607 <span class="keywordflow">for</span> (iNbrOfColumns = 1; -<a name="l00608"></a>00608 iNbrOfColumns < TABLE_COLUMN_MAX; -<a name="l00609"></a>00609 iNbrOfColumns++) { -<a name="l00610"></a>00610 aszColTxt[iNbrOfColumns] = -<a name="l00611"></a>00611 strchr(aszColTxt[iNbrOfColumns - 1], -<a name="l00612"></a>00612 TABLE_SEPARATOR); -<a name="l00613"></a>00613 <span class="keywordflow">if</span> (aszColTxt[iNbrOfColumns] == NULL) { -<a name="l00614"></a>00614 <span class="keywordflow">break</span>; -<a name="l00615"></a>00615 } -<a name="l00616"></a>00616 *aszColTxt[iNbrOfColumns] = <span class="charliteral">'\0'</span>; -<a name="l00617"></a>00617 aszColTxt[iNbrOfColumns]++; -<a name="l00618"></a>00618 NO_DBG_DEC(iNbrOfColumns); -<a name="l00619"></a>00619 NO_DBG_MSG(aszColTxt[iNbrOfColumns]); -<a name="l00620"></a>00620 } -<a name="l00621"></a>00621 -<a name="l00622"></a>00622 <span class="comment">/* Work around a bug in Word */</span> -<a name="l00623"></a>00623 <span class="keywordflow">while</span> (iNbrOfColumns > (<span class="keywordtype">int</span>)pRowInfo->ucNumberOfColumns && -<a name="l00624"></a>00624 pRowInfo->asColumnWidth[iNbrOfColumns] == 0) { -<a name="l00625"></a>00625 iNbrOfColumns--; -<a name="l00626"></a>00626 } -<a name="l00627"></a>00627 -<a name="l00628"></a>00628 DBG_DEC_C(iNbrOfColumns != (<span class="keywordtype">int</span>)pRowInfo->ucNumberOfColumns, -<a name="l00629"></a>00629 iNbrOfColumns); -<a name="l00630"></a>00630 DBG_DEC_C(iNbrOfColumns != (<span class="keywordtype">int</span>)pRowInfo->ucNumberOfColumns, -<a name="l00631"></a>00631 pRowInfo->ucNumberOfColumns); -<a name="l00632"></a>00632 <span class="keywordflow">if</span> (iNbrOfColumns != (<span class="keywordtype">int</span>)pRowInfo->ucNumberOfColumns) { -<a name="l00633"></a>00633 werr(0, <span class="stringliteral">"Skipping an unmatched table row"</span>); -<a name="l00634"></a>00634 <span class="keywordflow">return</span>; -<a name="l00635"></a>00635 } -<a name="l00636"></a>00636 -<a name="l00637"></a>00637 <span class="preprocessor">#if defined(__FULL_TEXT_SEARCH)</span> -<a name="l00638"></a>00638 <span class="preprocessor"></span> <span class="comment">/* No table formatting: use for full-text search (untested) */</span> -<a name="l00639"></a>00639 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iNbrOfColumns; iIndex++) { -<a name="l00640"></a>00640 fprintf(pDiag->pOutFile, <span class="stringliteral">"%s\n"</span> , aszColTxt[iIndex]); -<a name="l00641"></a>00641 } -<a name="l00642"></a>00642 <span class="preprocessor">#else</span> -<a name="l00643"></a>00643 <span class="preprocessor"></span> <span class="keywordflow">if</span> (bAddTableRow(pDiag, aszColTxt, iNbrOfColumns, -<a name="l00644"></a>00644 pRowInfo->asColumnWidth, pRowInfo->ucBorderInfo)) { -<a name="l00645"></a>00645 <span class="comment">/* All work has been done */</span> -<a name="l00646"></a>00646 <span class="keywordflow">return</span>; -<a name="l00647"></a>00647 } -<a name="l00648"></a>00648 -<a name="l00649"></a>00649 <span class="comment">/* Fill the table with maximum column widths */</span> -<a name="l00650"></a>00650 <span class="keywordflow">if</span> (eConversionType == conversion_text || -<a name="l00651"></a>00651 eConversionType == conversion_fmt_text) { -<a name="l00652"></a>00652 <span class="keywordflow">if</span> (iParagraphBreak == 0 || -<a name="l00653"></a>00653 iParagraphBreak >= MAX_SCREEN_WIDTH) { -<a name="l00654"></a>00654 dMagnify = (double)MAX_SCREEN_WIDTH; -<a name="l00655"></a>00655 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iParagraphBreak <= MIN_SCREEN_WIDTH) { -<a name="l00656"></a>00656 dMagnify = (double)MIN_SCREEN_WIDTH; -<a name="l00657"></a>00657 } <span class="keywordflow">else</span> { -<a name="l00658"></a>00658 dMagnify = (double)iParagraphBreak; -<a name="l00659"></a>00659 } -<a name="l00660"></a>00660 dMagnify /= (double)DEFAULT_SCREEN_WIDTH; -<a name="l00661"></a>00661 DBG_FLT_C(dMagnify < 0.99 || dMagnify > 1.01, dMagnify); -<a name="l00662"></a>00662 } <span class="keywordflow">else</span> { -<a name="l00663"></a>00663 dMagnify = 1.0; -<a name="l00664"></a>00664 } -<a name="l00665"></a>00665 tColumnWidthTotal = 0; -<a name="l00666"></a>00666 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iNbrOfColumns; iIndex++) { -<a name="l00667"></a>00667 atColumnWidthMax[iIndex] = tComputeColumnWidthMax( -<a name="l00668"></a>00668 pRowInfo->asColumnWidth[iIndex], -<a name="l00669"></a>00669 lCharWidthLarge, -<a name="l00670"></a>00670 dMagnify); -<a name="l00671"></a>00671 tColumnWidthTotal += atColumnWidthMax[iIndex]; -<a name="l00672"></a>00672 } -<a name="l00673"></a>00673 -<a name="l00674"></a>00674 <span class="comment">/*</span> -<a name="l00675"></a>00675 <span class="comment"> * Get enough space for the row.</span> -<a name="l00676"></a>00676 <span class="comment"> * Worst case: three bytes per UTF-8 character</span> -<a name="l00677"></a>00677 <span class="comment"> */</span> -<a name="l00678"></a>00678 tSize = 3 * (1 + tColumnWidthTotal + (size_t)iNbrOfColumns + 3); -<a name="l00679"></a>00679 szLine = xmalloc(tSize); -<a name="l00680"></a>00680 -<a name="l00681"></a>00681 <span class="keywordflow">do</span> { -<a name="l00682"></a>00682 <span class="comment">/* Print one line of a table row */</span> -<a name="l00683"></a>00683 bNotReady = FALSE; -<a name="l00684"></a>00684 pcTxt = szLine; -<a name="l00685"></a>00685 *pcTxt++ = TABLE_SEPARATOR_CHAR; -<a name="l00686"></a>00686 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iNbrOfColumns; iIndex++) { -<a name="l00687"></a>00687 tColumnWidthMax = atColumnWidthMax[iIndex]; -<a name="l00688"></a>00688 <span class="keywordflow">if</span> (aszColTxt[iIndex] == NULL) { -<a name="l00689"></a>00689 <span class="comment">/* Add an empty column */</span> -<a name="l00690"></a>00690 <span class="keywordflow">for</span> (iTmp = 0; -<a name="l00691"></a>00691 iTmp < (int)tColumnWidthMax; -<a name="l00692"></a>00692 iTmp++) { -<a name="l00693"></a>00693 *pcTxt++ = (char)FILLER_CHAR; -<a name="l00694"></a>00694 } -<a name="l00695"></a>00695 *pcTxt++ = TABLE_SEPARATOR_CHAR; -<a name="l00696"></a>00696 *pcTxt = <span class="charliteral">'\0'</span>; -<a name="l00697"></a>00697 <span class="keywordflow">continue</span>; -<a name="l00698"></a>00698 } -<a name="l00699"></a>00699 <span class="comment">/* Compute the length and width of the column text */</span> -<a name="l00700"></a>00700 tLen = tComputeStringLengthMax( -<a name="l00701"></a>00701 aszColTxt[iIndex], tColumnWidthMax); -<a name="l00702"></a>00702 NO_DBG_DEC(tLen); -<a name="l00703"></a>00703 <span class="keywordflow">while</span> (tLen != 0 && -<a name="l00704"></a>00704 (aszColTxt[iIndex][tLen - 1] == <span class="charliteral">'\n'</span> || -<a name="l00705"></a>00705 aszColTxt[iIndex][tLen - 1] == <span class="charliteral">' '</span>)) { -<a name="l00706"></a>00706 aszColTxt[iIndex][tLen - 1] = <span class="charliteral">' '</span>; -<a name="l00707"></a>00707 tLen--; -<a name="l00708"></a>00708 } -<a name="l00709"></a>00709 tWidth = tCountColumns(aszColTxt[iIndex], tLen); -<a name="l00710"></a>00710 fail(tWidth > tColumnWidthMax); -<a name="l00711"></a>00711 tLen = tGetBreakingPoint(aszColTxt[iIndex], -<a name="l00712"></a>00712 tLen, tWidth, tColumnWidthMax); -<a name="l00713"></a>00713 tWidth = tCountColumns(aszColTxt[iIndex], tLen); -<a name="l00714"></a>00714 <span class="keywordflow">if</span> (tLen == 0 && *aszColTxt[iIndex] == <span class="charliteral">'\0'</span>) { -<a name="l00715"></a>00715 <span class="comment">/* No text at all */</span> -<a name="l00716"></a>00716 aszColTxt[iIndex] = NULL; -<a name="l00717"></a>00717 } <span class="keywordflow">else</span> { -<a name="l00718"></a>00718 <span class="comment">/* Add the text */</span> -<a name="l00719"></a>00719 pcTxt += sprintf(pcTxt, -<a name="l00720"></a>00720 <span class="stringliteral">"%.*s"</span>, (<span class="keywordtype">int</span>)tLen, aszColTxt[iIndex]); -<a name="l00721"></a>00721 <span class="keywordflow">if</span> (tLen == 0 && *aszColTxt[iIndex] != <span class="charliteral">' '</span>) { -<a name="l00722"></a>00722 tLen = tGetCharacterLength( -<a name="l00723"></a>00723 aszColTxt[iIndex]); -<a name="l00724"></a>00724 DBG_CHR(*aszColTxt[iIndex]); -<a name="l00725"></a>00725 DBG_FIXME(); -<a name="l00726"></a>00726 fail(tLen == 0); -<a name="l00727"></a>00727 } -<a name="l00728"></a>00728 aszColTxt[iIndex] += tLen; -<a name="l00729"></a>00729 <span class="keywordflow">while</span> (*aszColTxt[iIndex] == <span class="charliteral">' '</span>) { -<a name="l00730"></a>00730 aszColTxt[iIndex]++; -<a name="l00731"></a>00731 } -<a name="l00732"></a>00732 <span class="keywordflow">if</span> (*aszColTxt[iIndex] == <span class="charliteral">'\0'</span>) { -<a name="l00733"></a>00733 <span class="comment">/* This row is now complete */</span> -<a name="l00734"></a>00734 aszColTxt[iIndex] = NULL; -<a name="l00735"></a>00735 } <span class="keywordflow">else</span> { -<a name="l00736"></a>00736 <span class="comment">/* This row needs more lines */</span> -<a name="l00737"></a>00737 bNotReady = TRUE; -<a name="l00738"></a>00738 } -<a name="l00739"></a>00739 } -<a name="l00740"></a>00740 <span class="comment">/* Fill up the rest */</span> -<a name="l00741"></a>00741 <span class="keywordflow">for</span> (iTmp = 0; -<a name="l00742"></a>00742 iTmp < (int)tColumnWidthMax - (<span class="keywordtype">int</span>)tWidth; -<a name="l00743"></a>00743 iTmp++) { -<a name="l00744"></a>00744 *pcTxt++ = (char)FILLER_CHAR; -<a name="l00745"></a>00745 } -<a name="l00746"></a>00746 <span class="comment">/* End of column */</span> -<a name="l00747"></a>00747 *pcTxt++ = TABLE_SEPARATOR_CHAR; -<a name="l00748"></a>00748 *pcTxt = <span class="charliteral">'\0'</span>; -<a name="l00749"></a>00749 } -<a name="l00750"></a>00750 <span class="comment">/* Output the table row line */</span> -<a name="l00751"></a>00751 *pcTxt = <span class="charliteral">'\0'</span>; -<a name="l00752"></a>00752 tRow = *pOutput; -<a name="l00753"></a>00753 tRow.szStorage = szLine; -<a name="l00754"></a>00754 fail(pcTxt < szLine); -<a name="l00755"></a>00755 tRow.tNextFree = (size_t)(pcTxt - szLine); -<a name="l00756"></a>00756 tRow.lStringWidth = lComputeStringWidth( -<a name="l00757"></a>00757 tRow.szStorage, -<a name="l00758"></a>00758 tRow.tNextFree, -<a name="l00759"></a>00759 tRow.tFontRef, -<a name="l00760"></a>00760 tRow.usFontSize); -<a name="l00761"></a>00761 vString2Diagram(pDiag, &tRow); -<a name="l00762"></a>00762 TRACE_MSG(<span class="stringliteral">"after vString2Diagram in vTableRow2Window"</span>); -<a name="l00763"></a>00763 } <span class="keywordflow">while</span> (bNotReady); -<a name="l00764"></a>00764 <span class="comment">/* Clean up before you leave */</span> -<a name="l00765"></a>00765 szLine = xfree(szLine); -<a name="l00766"></a>00766 TRACE_MSG(<span class="stringliteral">"leaving vTableRow2Window"</span>); -<a name="l00767"></a>00767 <span class="preprocessor">#endif </span><span class="comment">/* __FULL_TEXT_SEARCH */</span> -<a name="l00768"></a>00768 } <span class="comment">/* end of vTableRow2Window */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/output_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/output.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/output.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * output.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Generic output generating functions</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 <span class="keyword">static</span> conversion_type eConversionType = conversion_unknown; -<a name="l00012"></a>00012 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="comment">/*</span> -<a name="l00016"></a>00016 <span class="comment"> * vPrologue1 - get options and call a specific initialization</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00019"></a>00019 vPrologue1(diagram_type *pDiag, <span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00020"></a>00020 { -<a name="l00021"></a>00021 options_type tOptions; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 fail(pDiag == NULL); -<a name="l00024"></a>00024 fail(szTask == NULL || szTask[0] == <span class="charliteral">'\0'</span>); -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 vGetOptions(&tOptions); -<a name="l00027"></a>00027 eConversionType = tOptions.eConversionType; -<a name="l00028"></a>00028 eEncoding = tOptions.eEncoding; -<a name="l00029"></a>00029 -<a name="l00030"></a>00030 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00031"></a>00031 <span class="keywordflow">case</span> conversion_text: -<a name="l00032"></a>00032 vPrologueTXT(pDiag, &tOptions); -<a name="l00033"></a>00033 <span class="keywordflow">break</span>; -<a name="l00034"></a>00034 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00035"></a>00035 vPrologueFMT(pDiag, &tOptions); -<a name="l00036"></a>00036 <span class="keywordflow">break</span>; -<a name="l00037"></a>00037 <span class="keywordflow">case</span> conversion_ps: -<a name="l00038"></a>00038 vProloguePS(pDiag, szTask, szFilename, &tOptions); -<a name="l00039"></a>00039 <span class="keywordflow">break</span>; -<a name="l00040"></a>00040 <span class="keywordflow">case</span> conversion_xml: -<a name="l00041"></a>00041 vPrologueXML(pDiag, &tOptions); -<a name="l00042"></a>00042 <span class="keywordflow">break</span>; -<a name="l00043"></a>00043 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00044"></a>00044 vProloguePDF(pDiag, szTask, &tOptions); -<a name="l00045"></a>00045 <span class="keywordflow">break</span>; -<a name="l00046"></a>00046 <span class="keywordflow">default</span>: -<a name="l00047"></a>00047 DBG_DEC(eConversionType); -<a name="l00048"></a>00048 <span class="keywordflow">break</span>; -<a name="l00049"></a>00049 } -<a name="l00050"></a>00050 } <span class="comment">/* end of vPrologue1 */</span> -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="comment">/*</span> -<a name="l00053"></a>00053 <span class="comment"> * vEpilogue - clean up after everything is done</span> -<a name="l00054"></a>00054 <span class="comment"> */</span> -<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00056"></a>00056 vEpilogue(diagram_type *pDiag) -<a name="l00057"></a>00057 { -<a name="l00058"></a>00058 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00059"></a>00059 <span class="keywordflow">case</span> conversion_text: -<a name="l00060"></a>00060 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00061"></a>00061 vEpilogueTXT(pDiag->pOutFile); -<a name="l00062"></a>00062 <span class="keywordflow">break</span>; -<a name="l00063"></a>00063 <span class="keywordflow">case</span> conversion_ps: -<a name="l00064"></a>00064 vEpiloguePS(pDiag); -<a name="l00065"></a>00065 <span class="keywordflow">break</span>; -<a name="l00066"></a>00066 <span class="keywordflow">case</span> conversion_xml: -<a name="l00067"></a>00067 vEpilogueXML(pDiag); -<a name="l00068"></a>00068 <span class="keywordflow">break</span>; -<a name="l00069"></a>00069 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00070"></a>00070 vEpiloguePDF(pDiag); -<a name="l00071"></a>00071 <span class="keywordflow">break</span>; -<a name="l00072"></a>00072 <span class="keywordflow">default</span>: -<a name="l00073"></a>00073 DBG_DEC(eConversionType); -<a name="l00074"></a>00074 <span class="keywordflow">break</span>; -<a name="l00075"></a>00075 } -<a name="l00076"></a>00076 } <span class="comment">/* end of vEpilogue */</span> -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 <span class="comment">/*</span> -<a name="l00079"></a>00079 <span class="comment"> * vImagePrologue - perform image initialization</span> -<a name="l00080"></a>00080 <span class="comment"> */</span> -<a name="l00081"></a>00081 <span class="keywordtype">void</span> -<a name="l00082"></a>00082 vImagePrologue(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00083"></a>00083 { -<a name="l00084"></a>00084 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00085"></a>00085 <span class="keywordflow">case</span> conversion_text: -<a name="l00086"></a>00086 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00087"></a>00087 <span class="keywordflow">break</span>; -<a name="l00088"></a>00088 <span class="keywordflow">case</span> conversion_ps: -<a name="l00089"></a>00089 vImageProloguePS(pDiag, pImg); -<a name="l00090"></a>00090 <span class="keywordflow">break</span>; -<a name="l00091"></a>00091 <span class="keywordflow">case</span> conversion_xml: -<a name="l00092"></a>00092 <span class="keywordflow">break</span>; -<a name="l00093"></a>00093 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00094"></a>00094 vImageProloguePDF(pDiag, pImg); -<a name="l00095"></a>00095 <span class="keywordflow">break</span>; -<a name="l00096"></a>00096 <span class="keywordflow">default</span>: -<a name="l00097"></a>00097 DBG_DEC(eConversionType); -<a name="l00098"></a>00098 <span class="keywordflow">break</span>; -<a name="l00099"></a>00099 } -<a name="l00100"></a>00100 } <span class="comment">/* end of vImagePrologue */</span> -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 <span class="comment">/*</span> -<a name="l00103"></a>00103 <span class="comment"> * vImageEpilogue - clean up an image</span> -<a name="l00104"></a>00104 <span class="comment"> */</span> -<a name="l00105"></a>00105 <span class="keywordtype">void</span> -<a name="l00106"></a>00106 vImageEpilogue(diagram_type *pDiag) -<a name="l00107"></a>00107 { -<a name="l00108"></a>00108 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00109"></a>00109 <span class="keywordflow">case</span> conversion_text: -<a name="l00110"></a>00110 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00111"></a>00111 <span class="keywordflow">break</span>; -<a name="l00112"></a>00112 <span class="keywordflow">case</span> conversion_ps: -<a name="l00113"></a>00113 vImageEpiloguePS(pDiag); -<a name="l00114"></a>00114 <span class="keywordflow">break</span>; -<a name="l00115"></a>00115 <span class="keywordflow">case</span> conversion_xml: -<a name="l00116"></a>00116 <span class="keywordflow">break</span>; -<a name="l00117"></a>00117 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00118"></a>00118 vImageEpiloguePDF(pDiag); -<a name="l00119"></a>00119 <span class="keywordflow">break</span>; -<a name="l00120"></a>00120 <span class="keywordflow">default</span>: -<a name="l00121"></a>00121 DBG_DEC(eConversionType); -<a name="l00122"></a>00122 <span class="keywordflow">break</span>; -<a name="l00123"></a>00123 } -<a name="l00124"></a>00124 } <span class="comment">/* end of vImageEpilogue */</span> -<a name="l00125"></a>00125 -<a name="l00126"></a>00126 <span class="comment">/*</span> -<a name="l00127"></a>00127 <span class="comment"> * bAddDummyImage - add a dummy image</span> -<a name="l00128"></a>00128 <span class="comment"> *</span> -<a name="l00129"></a>00129 <span class="comment"> * return TRUE when successful, otherwise FALSE</span> -<a name="l00130"></a>00130 <span class="comment"> */</span> -<a name="l00131"></a>00131 BOOL -<a name="l00132"></a>00132 bAddDummyImage(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00133"></a>00133 { -<a name="l00134"></a>00134 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00135"></a>00135 <span class="keywordflow">case</span> conversion_text: -<a name="l00136"></a>00136 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00137"></a>00137 <span class="keywordflow">return</span> FALSE; -<a name="l00138"></a>00138 <span class="keywordflow">case</span> conversion_ps: -<a name="l00139"></a>00139 <span class="keywordflow">return</span> bAddDummyImagePS(pDiag, pImg); -<a name="l00140"></a>00140 <span class="keywordflow">case</span> conversion_xml: -<a name="l00141"></a>00141 <span class="keywordflow">return</span> FALSE; -<a name="l00142"></a>00142 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00143"></a>00143 <span class="keywordflow">return</span> bAddDummyImagePDF(pDiag, pImg); -<a name="l00144"></a>00144 <span class="keywordflow">default</span>: -<a name="l00145"></a>00145 DBG_DEC(eConversionType); -<a name="l00146"></a>00146 <span class="keywordflow">return</span> FALSE; -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 } <span class="comment">/* end of bAddDummyImage */</span> -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 <span class="comment">/*</span> -<a name="l00151"></a>00151 <span class="comment"> * pCreateDiagram - create and initialize a diagram</span> -<a name="l00152"></a>00152 <span class="comment"> *</span> -<a name="l00153"></a>00153 <span class="comment"> * remark: does not return if the diagram can't be created</span> -<a name="l00154"></a>00154 <span class="comment"> */</span> -<a name="l00155"></a>00155 FILE *fp; -<a name="l00156"></a>00156 diagram_type * -<a name="l00157"></a>00157 pCreateDiagram(<span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename, FILE *ofp) -<a name="l00158"></a>00158 { -<a name="l00159"></a>00159 diagram_type *pDiag; -<a name="l00160"></a>00160 -<a name="l00161"></a>00161 fail(szTask == NULL || szTask[0] == <span class="charliteral">'\0'</span>); -<a name="l00162"></a>00162 DBG_MSG(<span class="stringliteral">"pCreateDiagram"</span>); -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 <span class="comment">/* Get the necessary memory */</span> -<a name="l00165"></a>00165 pDiag = xmalloc(<span class="keyword">sizeof</span>(diagram_type)); -<a name="l00166"></a>00166 <span class="comment">/* Initialization */</span> -<a name="l00167"></a>00167 <span class="preprocessor"> #ifndef SYMBIAN</span> -<a name="l00168"></a>00168 <span class="preprocessor"></span> pDiag->pOutFile = stdout; -<a name="l00169"></a>00169 <span class="preprocessor"> #else</span> -<a name="l00170"></a>00170 <span class="preprocessor"></span> pDiag->pOutFile = <span class="comment">/*stdout*/</span>ofp; -<a name="l00171"></a>00171 <span class="preprocessor"> #endif </span><span class="comment">/*SYMBIAN*/</span> -<a name="l00172"></a>00172 vPrologue1(pDiag, szTask, szFilename); -<a name="l00173"></a>00173 <span class="comment">/* Return success */</span> -<a name="l00174"></a>00174 <span class="keywordflow">return</span> pDiag; -<a name="l00175"></a>00175 } <span class="comment">/* end of pCreateDiagram */</span> -<a name="l00176"></a>00176 -<a name="l00177"></a>00177 <span class="comment">/*</span> -<a name="l00178"></a>00178 <span class="comment"> * vDestroyDiagram - remove a diagram by freeing the memory it uses</span> -<a name="l00179"></a>00179 <span class="comment"> */</span> -<a name="l00180"></a>00180 <span class="keywordtype">void</span> -<a name="l00181"></a>00181 vDestroyDiagram(diagram_type *pDiag) -<a name="l00182"></a>00182 { -<a name="l00183"></a>00183 DBG_MSG(<span class="stringliteral">"vDestroyDiagram"</span>); -<a name="l00184"></a>00184 -<a name="l00185"></a>00185 fail(pDiag == NULL); -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 <span class="keywordflow">if</span> (pDiag == NULL) { -<a name="l00188"></a>00188 <span class="keywordflow">return</span>; -<a name="l00189"></a>00189 } -<a name="l00190"></a>00190 vEpilogue(pDiag); -<a name="l00191"></a>00191 pDiag = xfree(pDiag); -<a name="l00192"></a>00192 } <span class="comment">/* end of vDestroyDiagram */</span> -<a name="l00193"></a>00193 -<a name="l00194"></a>00194 <span class="comment">/*</span> -<a name="l00195"></a>00195 <span class="comment"> * vPrologue2 - call a specific initialization</span> -<a name="l00196"></a>00196 <span class="comment"> */</span> -<a name="l00197"></a>00197 <span class="keywordtype">void</span> -<a name="l00198"></a>00198 vPrologue2(diagram_type *pDiag, <span class="keywordtype">int</span> iWordVersion) -<a name="l00199"></a>00199 { -<a name="l00200"></a>00200 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00201"></a>00201 <span class="keywordflow">case</span> conversion_text: -<a name="l00202"></a>00202 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00203"></a>00203 <span class="keywordflow">break</span>; -<a name="l00204"></a>00204 <span class="keywordflow">case</span> conversion_ps: -<a name="l00205"></a>00205 vAddFontsPS(pDiag); -<a name="l00206"></a>00206 <span class="keywordflow">break</span>; -<a name="l00207"></a>00207 <span class="keywordflow">case</span> conversion_xml: -<a name="l00208"></a>00208 vCreateBookIntro(pDiag, iWordVersion); -<a name="l00209"></a>00209 <span class="keywordflow">break</span>; -<a name="l00210"></a>00210 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00211"></a>00211 vCreateInfoDictionary(pDiag, iWordVersion); -<a name="l00212"></a>00212 vAddFontsPDF(pDiag); -<a name="l00213"></a>00213 <span class="keywordflow">break</span>; -<a name="l00214"></a>00214 <span class="keywordflow">default</span>: -<a name="l00215"></a>00215 DBG_DEC(eConversionType); -<a name="l00216"></a>00216 <span class="keywordflow">break</span>; -<a name="l00217"></a>00217 } -<a name="l00218"></a>00218 } <span class="comment">/* end of vPrologue2 */</span> -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 <span class="comment">/*</span> -<a name="l00221"></a>00221 <span class="comment"> * vMove2NextLine - move to the next line</span> -<a name="l00222"></a>00222 <span class="comment"> */</span> -<a name="l00223"></a>00223 <span class="keywordtype">void</span> -<a name="l00224"></a>00224 vMove2NextLine(diagram_type *pDiag, drawfile_fontref tFontRef, -<a name="l00225"></a>00225 USHORT usFontSize) -<a name="l00226"></a>00226 { -<a name="l00227"></a>00227 fail(pDiag == NULL); -<a name="l00228"></a>00228 fail(pDiag->pOutFile == NULL); -<a name="l00229"></a>00229 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00230"></a>00230 -<a name="l00231"></a>00231 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00232"></a>00232 <span class="keywordflow">case</span> conversion_text: -<a name="l00233"></a>00233 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00234"></a>00234 vMove2NextLineTXT(pDiag); -<a name="l00235"></a>00235 <span class="keywordflow">break</span>; -<a name="l00236"></a>00236 <span class="keywordflow">case</span> conversion_ps: -<a name="l00237"></a>00237 vMove2NextLinePS(pDiag, usFontSize); -<a name="l00238"></a>00238 <span class="keywordflow">break</span>; -<a name="l00239"></a>00239 <span class="keywordflow">case</span> conversion_xml: -<a name="l00240"></a>00240 vMove2NextLineXML(pDiag); -<a name="l00241"></a>00241 <span class="keywordflow">break</span>; -<a name="l00242"></a>00242 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00243"></a>00243 vMove2NextLinePDF(pDiag, usFontSize); -<a name="l00244"></a>00244 <span class="keywordflow">break</span>; -<a name="l00245"></a>00245 <span class="keywordflow">default</span>: -<a name="l00246"></a>00246 DBG_DEC(eConversionType); -<a name="l00247"></a>00247 <span class="keywordflow">break</span>; -<a name="l00248"></a>00248 } -<a name="l00249"></a>00249 } <span class="comment">/* end of vMove2NextLine */</span> -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 <span class="comment">/*</span> -<a name="l00252"></a>00252 <span class="comment"> * vSubstring2Diagram - put a sub string into a diagram</span> -<a name="l00253"></a>00253 <span class="comment"> */</span> -<a name="l00254"></a>00254 <span class="keywordtype">void</span> -<a name="l00255"></a>00255 vSubstring2Diagram(diagram_type *pDiag, -<a name="l00256"></a>00256 <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l00257"></a>00257 UCHAR ucFontColor, USHORT usFontstyle, drawfile_fontref tFontRef, -<a name="l00258"></a>00258 USHORT usFontSize, USHORT usMaxFontSize) -<a name="l00259"></a>00259 { -<a name="l00260"></a>00260 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00261"></a>00261 <span class="keywordflow">case</span> conversion_text: -<a name="l00262"></a>00262 vSubstringTXT(pDiag, szString, tStringLength, lStringWidth); -<a name="l00263"></a>00263 <span class="keywordflow">break</span>; -<a name="l00264"></a>00264 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00265"></a>00265 vSubstringFMT(pDiag, szString, tStringLength, lStringWidth, -<a name="l00266"></a>00266 usFontstyle); -<a name="l00267"></a>00267 <span class="keywordflow">break</span>; -<a name="l00268"></a>00268 <span class="keywordflow">case</span> conversion_ps: -<a name="l00269"></a>00269 vSubstringPS(pDiag, szString, tStringLength, lStringWidth, -<a name="l00270"></a>00270 ucFontColor, usFontstyle, tFontRef, -<a name="l00271"></a>00271 usFontSize, usMaxFontSize); -<a name="l00272"></a>00272 <span class="keywordflow">break</span>; -<a name="l00273"></a>00273 <span class="keywordflow">case</span> conversion_xml: -<a name="l00274"></a>00274 vSubstringXML(pDiag, szString, tStringLength, lStringWidth, -<a name="l00275"></a>00275 usFontstyle); -<a name="l00276"></a>00276 <span class="keywordflow">break</span>; -<a name="l00277"></a>00277 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00278"></a>00278 vSubstringPDF(pDiag, szString, tStringLength, lStringWidth, -<a name="l00279"></a>00279 ucFontColor, usFontstyle, tFontRef, -<a name="l00280"></a>00280 usFontSize, usMaxFontSize); -<a name="l00281"></a>00281 <span class="keywordflow">break</span>; -<a name="l00282"></a>00282 <span class="keywordflow">default</span>: -<a name="l00283"></a>00283 DBG_DEC(eConversionType); -<a name="l00284"></a>00284 <span class="keywordflow">break</span>; -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 pDiag->lXleft += lStringWidth; -<a name="l00287"></a>00287 } <span class="comment">/* end of vSubstring2Diagram */</span> -<a name="l00288"></a>00288 -<a name="l00289"></a>00289 <span class="comment">/*</span> -<a name="l00290"></a>00290 <span class="comment"> * Create a start of paragraph (phase 1)</span> -<a name="l00291"></a>00291 <span class="comment"> * Before indentation, list numbering, bullets etc.</span> -<a name="l00292"></a>00292 <span class="comment"> */</span> -<a name="l00293"></a>00293 <span class="keywordtype">void</span> -<a name="l00294"></a>00294 vStartOfParagraph1(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) -<a name="l00295"></a>00295 { -<a name="l00296"></a>00296 fail(pDiag == NULL); -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00299"></a>00299 <span class="keywordflow">case</span> conversion_text: -<a name="l00300"></a>00300 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00301"></a>00301 vStartOfParagraphTXT(pDiag, lBeforeIndentation); -<a name="l00302"></a>00302 <span class="keywordflow">break</span>; -<a name="l00303"></a>00303 <span class="keywordflow">case</span> conversion_ps: -<a name="l00304"></a>00304 vStartOfParagraphPS(pDiag, lBeforeIndentation); -<a name="l00305"></a>00305 <span class="keywordflow">break</span>; -<a name="l00306"></a>00306 <span class="keywordflow">case</span> conversion_xml: -<a name="l00307"></a>00307 <span class="keywordflow">break</span>; -<a name="l00308"></a>00308 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00309"></a>00309 vStartOfParagraphPDF(pDiag, lBeforeIndentation); -<a name="l00310"></a>00310 <span class="keywordflow">break</span>; -<a name="l00311"></a>00311 <span class="keywordflow">default</span>: -<a name="l00312"></a>00312 DBG_DEC(eConversionType); -<a name="l00313"></a>00313 <span class="keywordflow">break</span>; -<a name="l00314"></a>00314 } -<a name="l00315"></a>00315 } <span class="comment">/* end of vStartOfParagraph1 */</span> -<a name="l00316"></a>00316 -<a name="l00317"></a>00317 <span class="comment">/*</span> -<a name="l00318"></a>00318 <span class="comment"> * Create a start of paragraph (phase 2)</span> -<a name="l00319"></a>00319 <span class="comment"> * After indentation, list numbering, bullets etc.</span> -<a name="l00320"></a>00320 <span class="comment"> */</span> -<a name="l00321"></a>00321 <span class="keywordtype">void</span> -<a name="l00322"></a>00322 vStartOfParagraph2(diagram_type *pDiag) -<a name="l00323"></a>00323 { -<a name="l00324"></a>00324 fail(pDiag == NULL); -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00327"></a>00327 <span class="keywordflow">case</span> conversion_text: -<a name="l00328"></a>00328 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00329"></a>00329 <span class="keywordflow">break</span>; -<a name="l00330"></a>00330 <span class="keywordflow">case</span> conversion_ps: -<a name="l00331"></a>00331 <span class="keywordflow">break</span>; -<a name="l00332"></a>00332 <span class="keywordflow">case</span> conversion_xml: -<a name="l00333"></a>00333 vStartOfParagraphXML(pDiag, 1); -<a name="l00334"></a>00334 <span class="keywordflow">break</span>; -<a name="l00335"></a>00335 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00336"></a>00336 <span class="keywordflow">break</span>; -<a name="l00337"></a>00337 <span class="keywordflow">default</span>: -<a name="l00338"></a>00338 DBG_DEC(eConversionType); -<a name="l00339"></a>00339 <span class="keywordflow">break</span>; -<a name="l00340"></a>00340 } -<a name="l00341"></a>00341 } <span class="comment">/* end of vStartOfParagraph2 */</span> -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 <span class="comment">/*</span> -<a name="l00344"></a>00344 <span class="comment"> * Create an end of paragraph</span> -<a name="l00345"></a>00345 <span class="comment"> */</span> -<a name="l00346"></a>00346 <span class="keywordtype">void</span> -<a name="l00347"></a>00347 vEndOfParagraph(diagram_type *pDiag, -<a name="l00348"></a>00348 drawfile_fontref tFontRef, USHORT usFontSize, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l00349"></a>00349 { -<a name="l00350"></a>00350 fail(pDiag == NULL); -<a name="l00351"></a>00351 fail(pDiag->pOutFile == NULL); -<a name="l00352"></a>00352 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l00353"></a>00353 fail(lAfterIndentation < 0); -<a name="l00354"></a>00354 -<a name="l00355"></a>00355 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00356"></a>00356 <span class="keywordflow">case</span> conversion_text: -<a name="l00357"></a>00357 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00358"></a>00358 vEndOfParagraphTXT(pDiag, lAfterIndentation); -<a name="l00359"></a>00359 <span class="keywordflow">break</span>; -<a name="l00360"></a>00360 <span class="keywordflow">case</span> conversion_ps: -<a name="l00361"></a>00361 vEndOfParagraphPS(pDiag, usFontSize, lAfterIndentation); -<a name="l00362"></a>00362 <span class="keywordflow">break</span>; -<a name="l00363"></a>00363 <span class="keywordflow">case</span> conversion_xml: -<a name="l00364"></a>00364 vEndOfParagraphXML(pDiag, 1); -<a name="l00365"></a>00365 <span class="keywordflow">break</span>; -<a name="l00366"></a>00366 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00367"></a>00367 vEndOfParagraphPDF(pDiag, usFontSize, lAfterIndentation); -<a name="l00368"></a>00368 <span class="keywordflow">break</span>; -<a name="l00369"></a>00369 <span class="keywordflow">default</span>: -<a name="l00370"></a>00370 DBG_DEC(eConversionType); -<a name="l00371"></a>00371 <span class="keywordflow">break</span>; -<a name="l00372"></a>00372 } -<a name="l00373"></a>00373 } <span class="comment">/* end of vEndOfParagraph */</span> -<a name="l00374"></a>00374 -<a name="l00375"></a>00375 <span class="comment">/*</span> -<a name="l00376"></a>00376 <span class="comment"> * Create an end of page</span> -<a name="l00377"></a>00377 <span class="comment"> */</span> -<a name="l00378"></a>00378 <span class="keywordtype">void</span> -<a name="l00379"></a>00379 vEndOfPage(diagram_type *pDiag, <span class="keywordtype">long</span> lAfterIndentation, BOOL bNewSection) -<a name="l00380"></a>00380 { -<a name="l00381"></a>00381 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00382"></a>00382 <span class="keywordflow">case</span> conversion_text: -<a name="l00383"></a>00383 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00384"></a>00384 vEndOfPageTXT(pDiag, lAfterIndentation); -<a name="l00385"></a>00385 <span class="keywordflow">break</span>; -<a name="l00386"></a>00386 <span class="keywordflow">case</span> conversion_ps: -<a name="l00387"></a>00387 vEndOfPagePS(pDiag, bNewSection); -<a name="l00388"></a>00388 <span class="keywordflow">break</span>; -<a name="l00389"></a>00389 <span class="keywordflow">case</span> conversion_xml: -<a name="l00390"></a>00390 vEndOfPageXML(pDiag); -<a name="l00391"></a>00391 <span class="keywordflow">break</span>; -<a name="l00392"></a>00392 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00393"></a>00393 vEndOfPagePDF(pDiag, bNewSection); -<a name="l00394"></a>00394 <span class="keywordflow">break</span>; -<a name="l00395"></a>00395 <span class="keywordflow">default</span>: -<a name="l00396"></a>00396 DBG_DEC(eConversionType); -<a name="l00397"></a>00397 <span class="keywordflow">break</span>; -<a name="l00398"></a>00398 } -<a name="l00399"></a>00399 } <span class="comment">/* end of vEndOfPage */</span> -<a name="l00400"></a>00400 -<a name="l00401"></a>00401 <span class="comment">/*</span> -<a name="l00402"></a>00402 <span class="comment"> * vSetHeaders - set the headers</span> -<a name="l00403"></a>00403 <span class="comment"> */</span> -<a name="l00404"></a>00404 <span class="keywordtype">void</span> -<a name="l00405"></a>00405 vSetHeaders(diagram_type *pDiag, USHORT usIstd) -<a name="l00406"></a>00406 { -<a name="l00407"></a>00407 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00408"></a>00408 <span class="keywordflow">case</span> conversion_text: -<a name="l00409"></a>00409 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00410"></a>00410 <span class="keywordflow">break</span>; -<a name="l00411"></a>00411 <span class="keywordflow">case</span> conversion_ps: -<a name="l00412"></a>00412 <span class="keywordflow">break</span>; -<a name="l00413"></a>00413 <span class="keywordflow">case</span> conversion_xml: -<a name="l00414"></a>00414 vSetHeadersXML(pDiag, usIstd); -<a name="l00415"></a>00415 <span class="keywordflow">break</span>; -<a name="l00416"></a>00416 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00417"></a>00417 <span class="keywordflow">break</span>; -<a name="l00418"></a>00418 <span class="keywordflow">default</span>: -<a name="l00419"></a>00419 DBG_DEC(eConversionType); -<a name="l00420"></a>00420 <span class="keywordflow">break</span>; -<a name="l00421"></a>00421 } -<a name="l00422"></a>00422 } <span class="comment">/* end of vSetHeaders */</span> -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 <span class="comment">/*</span> -<a name="l00425"></a>00425 <span class="comment"> * Create a start of list</span> -<a name="l00426"></a>00426 <span class="comment"> */</span> -<a name="l00427"></a>00427 <span class="keywordtype">void</span> -<a name="l00428"></a>00428 vStartOfList(diagram_type *pDiag, UCHAR ucNFC, BOOL bIsEndOfTable) -<a name="l00429"></a>00429 { -<a name="l00430"></a>00430 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00431"></a>00431 <span class="keywordflow">case</span> conversion_text: -<a name="l00432"></a>00432 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00433"></a>00433 <span class="keywordflow">break</span>; -<a name="l00434"></a>00434 <span class="keywordflow">case</span> conversion_ps: -<a name="l00435"></a>00435 <span class="keywordflow">break</span>; -<a name="l00436"></a>00436 <span class="keywordflow">case</span> conversion_xml: -<a name="l00437"></a>00437 vStartOfListXML(pDiag, ucNFC, bIsEndOfTable); -<a name="l00438"></a>00438 <span class="keywordflow">break</span>; -<a name="l00439"></a>00439 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00440"></a>00440 <span class="keywordflow">break</span>; -<a name="l00441"></a>00441 <span class="keywordflow">default</span>: -<a name="l00442"></a>00442 DBG_DEC(eConversionType); -<a name="l00443"></a>00443 <span class="keywordflow">break</span>; -<a name="l00444"></a>00444 } -<a name="l00445"></a>00445 } <span class="comment">/* end of vStartOfList */</span> -<a name="l00446"></a>00446 -<a name="l00447"></a>00447 <span class="comment">/*</span> -<a name="l00448"></a>00448 <span class="comment"> * Create an end of list</span> -<a name="l00449"></a>00449 <span class="comment"> */</span> -<a name="l00450"></a>00450 <span class="keywordtype">void</span> -<a name="l00451"></a>00451 vEndOfList(diagram_type *pDiag) -<a name="l00452"></a>00452 { -<a name="l00453"></a>00453 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00454"></a>00454 <span class="keywordflow">case</span> conversion_text: -<a name="l00455"></a>00455 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00456"></a>00456 <span class="keywordflow">break</span>; -<a name="l00457"></a>00457 <span class="keywordflow">case</span> conversion_ps: -<a name="l00458"></a>00458 <span class="keywordflow">break</span>; -<a name="l00459"></a>00459 <span class="keywordflow">case</span> conversion_xml: -<a name="l00460"></a>00460 vEndOfListXML(pDiag); -<a name="l00461"></a>00461 <span class="keywordflow">break</span>; -<a name="l00462"></a>00462 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00463"></a>00463 <span class="keywordflow">break</span>; -<a name="l00464"></a>00464 <span class="keywordflow">default</span>: -<a name="l00465"></a>00465 DBG_DEC(eConversionType); -<a name="l00466"></a>00466 <span class="keywordflow">break</span>; -<a name="l00467"></a>00467 } -<a name="l00468"></a>00468 } <span class="comment">/* end of vEndOfList */</span> -<a name="l00469"></a>00469 -<a name="l00470"></a>00470 <span class="comment">/*</span> -<a name="l00471"></a>00471 <span class="comment"> * Create a start of a list item</span> -<a name="l00472"></a>00472 <span class="comment"> */</span> -<a name="l00473"></a>00473 <span class="keywordtype">void</span> -<a name="l00474"></a>00474 vStartOfListItem(diagram_type *pDiag, BOOL bNoMarks) -<a name="l00475"></a>00475 { -<a name="l00476"></a>00476 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00477"></a>00477 <span class="keywordflow">case</span> conversion_text: -<a name="l00478"></a>00478 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00479"></a>00479 <span class="keywordflow">break</span>; -<a name="l00480"></a>00480 <span class="keywordflow">case</span> conversion_ps: -<a name="l00481"></a>00481 <span class="keywordflow">break</span>; -<a name="l00482"></a>00482 <span class="keywordflow">case</span> conversion_xml: -<a name="l00483"></a>00483 vStartOfListItemXML(pDiag, bNoMarks); -<a name="l00484"></a>00484 <span class="keywordflow">break</span>; -<a name="l00485"></a>00485 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00486"></a>00486 <span class="keywordflow">break</span>; -<a name="l00487"></a>00487 <span class="keywordflow">default</span>: -<a name="l00488"></a>00488 DBG_DEC(eConversionType); -<a name="l00489"></a>00489 <span class="keywordflow">break</span>; -<a name="l00490"></a>00490 } -<a name="l00491"></a>00491 } <span class="comment">/* end of vStartOfListItem */</span> -<a name="l00492"></a>00492 -<a name="l00493"></a>00493 <span class="comment">/*</span> -<a name="l00494"></a>00494 <span class="comment"> * Create an end of a table</span> -<a name="l00495"></a>00495 <span class="comment"> */</span> -<a name="l00496"></a>00496 <span class="keywordtype">void</span> -<a name="l00497"></a>00497 vEndOfTable(diagram_type *pDiag) -<a name="l00498"></a>00498 { -<a name="l00499"></a>00499 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00500"></a>00500 <span class="keywordflow">case</span> conversion_text: -<a name="l00501"></a>00501 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00502"></a>00502 <span class="keywordflow">break</span>; -<a name="l00503"></a>00503 <span class="keywordflow">case</span> conversion_ps: -<a name="l00504"></a>00504 <span class="keywordflow">break</span>; -<a name="l00505"></a>00505 <span class="keywordflow">case</span> conversion_xml: -<a name="l00506"></a>00506 vEndOfTableXML(pDiag); -<a name="l00507"></a>00507 <span class="keywordflow">break</span>; -<a name="l00508"></a>00508 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00509"></a>00509 <span class="keywordflow">break</span>; -<a name="l00510"></a>00510 <span class="keywordflow">default</span>: -<a name="l00511"></a>00511 DBG_DEC(eConversionType); -<a name="l00512"></a>00512 <span class="keywordflow">break</span>; -<a name="l00513"></a>00513 } -<a name="l00514"></a>00514 } <span class="comment">/* end of vEndOfTable */</span> -<a name="l00515"></a>00515 -<a name="l00516"></a>00516 <span class="comment">/*</span> -<a name="l00517"></a>00517 <span class="comment"> * Add a table row</span> -<a name="l00518"></a>00518 <span class="comment"> *</span> -<a name="l00519"></a>00519 <span class="comment"> * Returns TRUE when conversion type is XML</span> -<a name="l00520"></a>00520 <span class="comment"> */</span> -<a name="l00521"></a>00521 BOOL -<a name="l00522"></a>00522 bAddTableRow(diagram_type *pDiag, <span class="keywordtype">char</span> **aszColTxt, -<a name="l00523"></a>00523 <span class="keywordtype">int</span> iNbrOfColumns, <span class="keyword">const</span> <span class="keywordtype">short</span> *asColumnWidth, UCHAR ucBorderInfo) -<a name="l00524"></a>00524 { -<a name="l00525"></a>00525 <span class="keywordflow">switch</span> (eConversionType) { -<a name="l00526"></a>00526 <span class="keywordflow">case</span> conversion_text: -<a name="l00527"></a>00527 <span class="keywordflow">case</span> conversion_fmt_text: -<a name="l00528"></a>00528 <span class="keywordflow">break</span>; -<a name="l00529"></a>00529 <span class="keywordflow">case</span> conversion_ps: -<a name="l00530"></a>00530 <span class="keywordflow">break</span>; -<a name="l00531"></a>00531 <span class="keywordflow">case</span> conversion_xml: -<a name="l00532"></a>00532 vAddTableRowXML(pDiag, aszColTxt, -<a name="l00533"></a>00533 iNbrOfColumns, asColumnWidth, -<a name="l00534"></a>00534 ucBorderInfo); -<a name="l00535"></a>00535 <span class="keywordflow">return</span> TRUE; -<a name="l00536"></a>00536 <span class="keywordflow">case</span> conversion_pdf: -<a name="l00537"></a>00537 <span class="keywordflow">break</span>; -<a name="l00538"></a>00538 <span class="keywordflow">default</span>: -<a name="l00539"></a>00539 DBG_DEC(eConversionType); -<a name="l00540"></a>00540 <span class="keywordflow">break</span>; -<a name="l00541"></a>00541 } -<a name="l00542"></a>00542 <span class="keywordflow">return</span> FALSE; -<a name="l00543"></a>00543 } <span class="comment">/* end of bAddTableRow */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/pdf_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1164 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/pdf.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/pdf.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * pdf.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2003-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the Adobe Portable Document Format (pdf)</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdarg.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "version.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="comment">/* Constants for the file positions */</span> -<a name="l00017"></a>00017 <span class="preprocessor">#define INITIAL_LOCATION_SIZE 20</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define INITIAL_PAGEOBJECT_SIZE 5</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define EXTENSION_ARRAY_SIZE 10</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define EXTENSION_ARRAY_SIZE 30</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="comment">/* The character set */</span> -<a name="l00026"></a>00026 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00027"></a>00027 <span class="comment">/* Current creator for a PDF header */</span> -<a name="l00028"></a>00028 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szProducer = NULL; -<a name="l00029"></a>00029 <span class="comment">/* The height and width of a PDF page (in DrawUnits) */</span> -<a name="l00030"></a>00030 <span class="keyword">static</span> <span class="keywordtype">long</span> lPageHeight = LONG_MAX; -<a name="l00031"></a>00031 <span class="keyword">static</span> <span class="keywordtype">long</span> lPageWidth = LONG_MAX; -<a name="l00032"></a>00032 <span class="comment">/* The height of the footer on the current page (in DrawUnits) */</span> -<a name="l00033"></a>00033 <span class="keyword">static</span> <span class="keywordtype">long</span> lFooterHeight = 0; -<a name="l00034"></a>00034 <span class="comment">/* Inside a footer (to prevent an infinite loop when the footer is too big) */</span> -<a name="l00035"></a>00035 <span class="keyword">static</span> BOOL bInFtrSpace = FALSE; -<a name="l00036"></a>00036 <span class="comment">/* Current font information */</span> -<a name="l00037"></a>00037 <span class="keyword">static</span> drawfile_fontref tFontRefCurr = (drawfile_fontref)-1; -<a name="l00038"></a>00038 <span class="keyword">static</span> USHORT usFontSizeCurr = 0; -<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keywordtype">int</span> iFontColorCurr = -1; -<a name="l00040"></a>00040 <span class="comment">/* Current vertical position information */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">long</span> lYtopCurr = -1; -<a name="l00042"></a>00042 <span class="comment">/* Image counter */</span> -<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> iImageCount = 0; -<a name="l00044"></a>00044 <span class="comment">/* Section index */</span> -<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">int</span> iSectionIndex = 0; -<a name="l00046"></a>00046 <span class="comment">/* Are we on the first page of the section? */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> BOOL bFirstInSection = TRUE; -<a name="l00048"></a>00048 <span class="comment">/* File positions */</span> -<a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">long</span> lFilePosition = 0; -<a name="l00050"></a>00050 <span class="keyword">static</span> <span class="keywordtype">long</span> *alLocation = NULL; -<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tLocations = 0; -<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keywordtype">int</span> iMaxLocationNumber = 0; -<a name="l00053"></a>00053 <span class="comment">/* File position at the start of a page */</span> -<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">long</span> lStreamStart = -1; -<a name="l00055"></a>00055 <span class="comment">/* Page objects */</span> -<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keywordtype">int</span> *aiPageObject = NULL; -<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keywordtype">int</span> iPageCount = 0; -<a name="l00058"></a>00058 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tMaxPageObjects = 0; -<a name="l00059"></a>00059 <span class="comment">/* Current object number */</span> -<a name="l00060"></a>00060 <span class="comment">/* 1 = root; 2 = info; 3 = pages; 4 = encoding; 5-16 = fonts; 17 = resources */</span> -<a name="l00061"></a>00061 <span class="keyword">static</span> <span class="keywordtype">int</span> iObjectNumberCurr = 17; -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 <span class="keyword">static</span> <span class="keywordtype">void</span> vMoveTo(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span>{ -<a name="l00066"></a>00066 <span class="keyword">const</span> <span class="keywordtype">char</span> *szPDFname; -<a name="l00067"></a>00067 <span class="keyword">const</span> <span class="keywordtype">char</span> *szPSname; -<a name="l00068"></a>00068 } atFontname[] = { -<a name="l00069"></a>00069 { <span class="stringliteral">"Courier"</span>, FONT_MONOSPACED_PLAIN }, -<a name="l00070"></a>00070 { <span class="stringliteral">"Courier-Bold"</span>, FONT_MONOSPACED_BOLD }, -<a name="l00071"></a>00071 { <span class="stringliteral">"Courier-Oblique"</span>, FONT_MONOSPACED_ITALIC }, -<a name="l00072"></a>00072 { <span class="stringliteral">"Courier-BoldOblique"</span>, FONT_MONOSPACED_BOLDITALIC }, -<a name="l00073"></a>00073 { <span class="stringliteral">"Helvetica"</span>, FONT_SANS_SERIF_PLAIN }, -<a name="l00074"></a>00074 { <span class="stringliteral">"Helvetica-Bold"</span>, FONT_SANS_SERIF_BOLD }, -<a name="l00075"></a>00075 { <span class="stringliteral">"Helvetica-Oblique"</span>, FONT_SANS_SERIF_ITALIC }, -<a name="l00076"></a>00076 { <span class="stringliteral">"Helvetica-BoldOblique"</span>, FONT_SANS_SERIF_BOLDITALIC }, -<a name="l00077"></a>00077 { <span class="stringliteral">"Times-Roman"</span>, FONT_SERIF_PLAIN }, -<a name="l00078"></a>00078 { <span class="stringliteral">"Times-Bold"</span>, FONT_SERIF_BOLD }, -<a name="l00079"></a>00079 { <span class="stringliteral">"Times-Italic"</span>, FONT_SERIF_ITALIC }, -<a name="l00080"></a>00080 { <span class="stringliteral">"Times-BoldItalic"</span>, FONT_SERIF_BOLDITALIC }, -<a name="l00081"></a>00081 }; -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_1[] = { -<a name="l00084"></a>00084 <span class="stringliteral">"128 /Euro"</span>, -<a name="l00085"></a>00085 <span class="stringliteral">"140 /ellipsis /trademark /perthousand /bullet"</span>, -<a name="l00086"></a>00086 <span class="stringliteral">" /quoteleft /quoteright /guilsinglleft /guilsinglright"</span>, -<a name="l00087"></a>00087 <span class="stringliteral">" /quotedblleft /quotedblright /quotedblbase /endash /emdash"</span>, -<a name="l00088"></a>00088 <span class="stringliteral">" /minus /OE /oe /dagger /daggerdbl /fi /fl"</span>, -<a name="l00089"></a>00089 <span class="stringliteral">"160 /space /exclamdown /cent /sterling /currency"</span>, -<a name="l00090"></a>00090 <span class="stringliteral">" /yen /brokenbar /section /dieresis /copyright"</span>, -<a name="l00091"></a>00091 <span class="stringliteral">" /ordfeminine /guillemotleft /logicalnot /hyphen /registered"</span>, -<a name="l00092"></a>00092 <span class="stringliteral">" /macron /degree /plusminus /twosuperior /threesuperior"</span>, -<a name="l00093"></a>00093 <span class="stringliteral">" /acute /mu /paragraph /periodcentered /cedilla"</span>, -<a name="l00094"></a>00094 <span class="stringliteral">" /onesuperior /ordmasculine /guillemotright /onequarter"</span>, -<a name="l00095"></a>00095 <span class="stringliteral">" /onehalf /threequarters /questiondown /Agrave /Aacute"</span>, -<a name="l00096"></a>00096 <span class="stringliteral">" /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla"</span>, -<a name="l00097"></a>00097 <span class="stringliteral">" /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute"</span>, -<a name="l00098"></a>00098 <span class="stringliteral">" /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute"</span>, -<a name="l00099"></a>00099 <span class="stringliteral">" /Ocircumflex /Otilde /Odieresis /multiply /Oslash"</span>, -<a name="l00100"></a>00100 <span class="stringliteral">" /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn"</span>, -<a name="l00101"></a>00101 <span class="stringliteral">" /germandbls /agrave /aacute /acircumflex /atilde"</span>, -<a name="l00102"></a>00102 <span class="stringliteral">" /adieresis /aring /ae /ccedilla /egrave /eacute"</span>, -<a name="l00103"></a>00103 <span class="stringliteral">" /ecircumflex /edieresis /igrave /iacute /icircumflex"</span>, -<a name="l00104"></a>00104 <span class="stringliteral">" /idieresis /eth /ntilde /ograve /oacute /ocircumflex"</span>, -<a name="l00105"></a>00105 <span class="stringliteral">" /otilde /odieresis /divide /oslash /ugrave /uacute"</span>, -<a name="l00106"></a>00106 <span class="stringliteral">" /ucircumflex /udieresis /yacute /thorn /ydieresis"</span>, -<a name="l00107"></a>00107 }; -<a name="l00108"></a>00108 -<a name="l00109"></a>00109 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_2[] = { -<a name="l00110"></a>00110 <span class="stringliteral">"160 /space /Aogonek /breve /Lslash /currency /Lcaron"</span>, -<a name="l00111"></a>00111 <span class="stringliteral">" /Sacute /section /dieresis /Scaron /Scommaaccent"</span>, -<a name="l00112"></a>00112 <span class="stringliteral">" /Tcaron /Zacute /hyphen /Zcaron /Zdotaccent /degree"</span>, -<a name="l00113"></a>00113 <span class="stringliteral">" /aogonek /ogonek /lslash /acute /lcaron /sacute"</span>, -<a name="l00114"></a>00114 <span class="stringliteral">" /caron /cedilla /scaron /scommaaccent /tcaron"</span>, -<a name="l00115"></a>00115 <span class="stringliteral">" /zacute /hungarumlaut /zcaron /zdotaccent /Racute"</span>, -<a name="l00116"></a>00116 <span class="stringliteral">" /Aacute /Acircumflex /Abreve /Adieresis /Lacute"</span>, -<a name="l00117"></a>00117 <span class="stringliteral">" /Cacute /Ccedilla /Ccaron /Eacute /Eogonek"</span>, -<a name="l00118"></a>00118 <span class="stringliteral">" /Edieresis /Ecaron /Iacute /Icircumflex /Dcaron"</span>, -<a name="l00119"></a>00119 <span class="stringliteral">" /.notdef /Nacute /Ncaron /Oacute /Ocircumflex"</span>, -<a name="l00120"></a>00120 <span class="stringliteral">" /Ohungarumlaut /Odieresis /multiply /Rcaron /Uring"</span>, -<a name="l00121"></a>00121 <span class="stringliteral">" /Uacute /Uhungarumlaut /Udieresis /Yacute /Tcommaaccent"</span>, -<a name="l00122"></a>00122 <span class="stringliteral">" /germandbls /racute /aacute /acircumflex /abreve"</span>, -<a name="l00123"></a>00123 <span class="stringliteral">" /adieresis /lacute /cacute /ccedilla /ccaron /eacute"</span>, -<a name="l00124"></a>00124 <span class="stringliteral">" /eogonek /edieresis /ecaron /iacute /icircumflex"</span>, -<a name="l00125"></a>00125 <span class="stringliteral">" /dcaron /.notdef /nacute /ncaron /oacute /ocircumflex"</span>, -<a name="l00126"></a>00126 <span class="stringliteral">" /ohungarumlaut /odieresis /divide /rcaron /uring"</span>, -<a name="l00127"></a>00127 <span class="stringliteral">" /uacute /uhungarumlaut /udieresis /yacute /tcommaaccent"</span>, -<a name="l00128"></a>00128 <span class="stringliteral">" /dotaccent"</span>, -<a name="l00129"></a>00129 }; -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 -<a name="l00132"></a>00132 <span class="comment">/*</span> -<a name="l00133"></a>00133 <span class="comment"> * tGetFontIndex - get the font index</span> -<a name="l00134"></a>00134 <span class="comment"> */</span> -<a name="l00135"></a>00135 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00136"></a>00136 tGetFontIndex(drawfile_fontref tFontRef) -<a name="l00137"></a>00137 { -<a name="l00138"></a>00138 <span class="keyword">const</span> <span class="keywordtype">char</span> *szFontname; -<a name="l00139"></a>00139 <span class="keywordtype">size_t</span> tIndex; -<a name="l00140"></a>00140 -<a name="l00141"></a>00141 <span class="comment">/* Get the font name */</span> -<a name="l00142"></a>00142 szFontname = szGetFontname(tFontRef); -<a name="l00143"></a>00143 fail(szFontname == NULL); -<a name="l00144"></a>00144 <span class="keywordflow">if</span> (szFontname == NULL) { -<a name="l00145"></a>00145 <span class="keywordflow">return</span> 0; -<a name="l00146"></a>00146 } -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="comment">/* Find the name in the table */</span> -<a name="l00149"></a>00149 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(atFontname); tIndex++) { -<a name="l00150"></a>00150 <span class="keywordflow">if</span> (STRCEQ(atFontname[tIndex].szPSname, szFontname)) { -<a name="l00151"></a>00151 <span class="keywordflow">return</span> tIndex; -<a name="l00152"></a>00152 } -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 <span class="comment">/* Not found */</span> -<a name="l00155"></a>00155 DBG_DEC(tFontRef); -<a name="l00156"></a>00156 DBG_MSG(szFontname); -<a name="l00157"></a>00157 <span class="keywordflow">return</span> 0; -<a name="l00158"></a>00158 } <span class="comment">/* end of tGetFontIndex */</span> -<a name="l00159"></a>00159 -<a name="l00160"></a>00160 <span class="comment">/*</span> -<a name="l00161"></a>00161 <span class="comment"> * vSetLocation - store the location of objects</span> -<a name="l00162"></a>00162 <span class="comment"> */</span> -<a name="l00163"></a>00163 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00164"></a>00164 vSetLocation(<span class="keywordtype">int</span> iLocationNumber) -<a name="l00165"></a>00165 { -<a name="l00166"></a>00166 fail(iLocationNumber <= 0); -<a name="l00167"></a>00167 -<a name="l00168"></a>00168 <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)iLocationNumber >= tLocations) { -<a name="l00169"></a>00169 <span class="comment">/* Extend and set to zero */</span> -<a name="l00170"></a>00170 tLocations += EXTENSION_ARRAY_SIZE; -<a name="l00171"></a>00171 alLocation = xrealloc(alLocation, tLocations * <span class="keyword">sizeof</span>(<span class="keywordtype">long</span>)); -<a name="l00172"></a>00172 memset(alLocation + tLocations - EXTENSION_ARRAY_SIZE, -<a name="l00173"></a>00173 0, -<a name="l00174"></a>00174 EXTENSION_ARRAY_SIZE * <span class="keyword">sizeof</span>(<span class="keywordtype">long</span>)); -<a name="l00175"></a>00175 DBG_DEC(tLocations); -<a name="l00176"></a>00176 } -<a name="l00177"></a>00177 <span class="keywordflow">if</span> (iLocationNumber > iMaxLocationNumber) { -<a name="l00178"></a>00178 iMaxLocationNumber = iLocationNumber; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 -<a name="l00181"></a>00181 DBG_DEC_C((<span class="keywordtype">size_t</span>)iLocationNumber >= tLocations, iLocationNumber); -<a name="l00182"></a>00182 DBG_DEC_C((<span class="keywordtype">size_t</span>)iLocationNumber >= tLocations, tLocations); -<a name="l00183"></a>00183 fail((<span class="keywordtype">size_t</span>)iLocationNumber >= tLocations); -<a name="l00184"></a>00184 -<a name="l00185"></a>00185 alLocation[iLocationNumber] = lFilePosition; -<a name="l00186"></a>00186 } <span class="comment">/* end of vSetLocation */</span> -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="comment">/*</span> -<a name="l00189"></a>00189 <span class="comment"> * vFillNextPageObject - fil the next page object with the current object number</span> -<a name="l00190"></a>00190 <span class="comment"> */</span> -<a name="l00191"></a>00191 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00192"></a>00192 vFillNextPageObject(<span class="keywordtype">void</span>) -<a name="l00193"></a>00193 { -<a name="l00194"></a>00194 iPageCount++; -<a name="l00195"></a>00195 <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)iPageCount >= tMaxPageObjects) { -<a name="l00196"></a>00196 <span class="comment">/* Extend the array */</span> -<a name="l00197"></a>00197 tMaxPageObjects += EXTENSION_ARRAY_SIZE; -<a name="l00198"></a>00198 aiPageObject = xrealloc(aiPageObject, -<a name="l00199"></a>00199 tMaxPageObjects * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)); -<a name="l00200"></a>00200 DBG_DEC(tMaxPageObjects); -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 aiPageObject[iPageCount] = iObjectNumberCurr; -<a name="l00203"></a>00203 } <span class="comment">/* end of vFillNextPageObject */</span> -<a name="l00204"></a>00204 -<a name="l00205"></a>00205 <span class="comment">/*</span> -<a name="l00206"></a>00206 <span class="comment"> * vFPprintf - printf and update the fileposition</span> -<a name="l00207"></a>00207 <span class="comment"> *</span> -<a name="l00208"></a>00208 <span class="comment"> * called with arguments like fprintf(3)</span> -<a name="l00209"></a>00209 <span class="comment"> */</span> -<a name="l00210"></a>00210 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00211"></a>00211 vFPprintf(FILE *pOutFile, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFormat, ...) -<a name="l00212"></a>00212 { -<a name="l00213"></a>00213 va_list tArg; -<a name="l00214"></a>00214 -<a name="l00215"></a>00215 va_start(tArg, szFormat); -<a name="l00216"></a>00216 lFilePosition += vfprintf(pOutFile, szFormat, tArg); -<a name="l00217"></a>00217 va_end(tArg); -<a name="l00218"></a>00218 } <span class="comment">/* end of vFPprintf */</span> -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 <span class="comment">/*</span> -<a name="l00221"></a>00221 <span class="comment"> * vCreateInfoDictionary - create the document information dictionary</span> -<a name="l00222"></a>00222 <span class="comment"> */</span> -<a name="l00223"></a>00223 <span class="keywordtype">void</span> -<a name="l00224"></a>00224 vCreateInfoDictionary(diagram_type *pDiag, <span class="keywordtype">int</span> iWordVersion) -<a name="l00225"></a>00225 { -<a name="l00226"></a>00226 FILE *pOutFile; -<a name="l00227"></a>00227 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTitle, *szAuthor, *szSubject, *szCreator; -<a name="l00228"></a>00228 <span class="keyword">const</span> <span class="keywordtype">char</span> *szCreationDate, *szModDate; -<a name="l00229"></a>00229 -<a name="l00230"></a>00230 fail(pDiag == NULL); -<a name="l00231"></a>00231 fail(pDiag->pOutFile == NULL); -<a name="l00232"></a>00232 fail(iWordVersion < 0); -<a name="l00233"></a>00233 fail(szProducer == NULL || szProducer[0] == <span class="charliteral">'\0'</span>); -<a name="l00234"></a>00234 -<a name="l00235"></a>00235 szTitle = szGetTitle(); -<a name="l00236"></a>00236 szAuthor = szGetAuthor(); -<a name="l00237"></a>00237 szSubject = szGetSubject(); -<a name="l00238"></a>00238 szCreationDate = szGetCreationDate(); -<a name="l00239"></a>00239 szModDate = szGetModDate(); -<a name="l00240"></a>00240 -<a name="l00241"></a>00241 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00242"></a>00242 <span class="keywordflow">case</span> 0: szCreator = <span class="stringliteral">"Word for DOS"</span>; <span class="keywordflow">break</span>; -<a name="l00243"></a>00243 <span class="keywordflow">case</span> 1: szCreator = <span class="stringliteral">"WinWord 1.x"</span>; <span class="keywordflow">break</span>; -<a name="l00244"></a>00244 <span class="keywordflow">case</span> 2: szCreator = <span class="stringliteral">"WinWord 2.0"</span>; <span class="keywordflow">break</span>; -<a name="l00245"></a>00245 <span class="keywordflow">case</span> 4: szCreator = <span class="stringliteral">"MacWord 4"</span>; <span class="keywordflow">break</span>; -<a name="l00246"></a>00246 <span class="keywordflow">case</span> 5: szCreator = <span class="stringliteral">"MacWord 5"</span>; <span class="keywordflow">break</span>; -<a name="l00247"></a>00247 <span class="keywordflow">case</span> 6: szCreator = <span class="stringliteral">"Word 6"</span>; <span class="keywordflow">break</span>; -<a name="l00248"></a>00248 <span class="keywordflow">case</span> 7: szCreator = <span class="stringliteral">"Word 7/95"</span>; <span class="keywordflow">break</span>; -<a name="l00249"></a>00249 <span class="keywordflow">case</span> 8: szCreator = <span class="stringliteral">"Word 97 or later"</span>; <span class="keywordflow">break</span>; -<a name="l00250"></a>00250 <span class="keywordflow">default</span>: szCreator = NULL; <span class="keywordflow">break</span>; -<a name="l00251"></a>00251 } -<a name="l00252"></a>00252 -<a name="l00253"></a>00253 pOutFile = pDiag->pOutFile; -<a name="l00254"></a>00254 -<a name="l00255"></a>00255 vSetLocation(2); -<a name="l00256"></a>00256 vFPprintf(pOutFile, <span class="stringliteral">"2 0 obj\n"</span>); -<a name="l00257"></a>00257 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00258"></a>00258 <span class="keywordflow">if</span> (szTitle != NULL && szTitle[0] != <span class="charliteral">'\0'</span>) { -<a name="l00259"></a>00259 vFPprintf(pOutFile, <span class="stringliteral">"/Title (%s)\n"</span>, szTitle); -<a name="l00260"></a>00260 } -<a name="l00261"></a>00261 <span class="keywordflow">if</span> (szAuthor != NULL && szAuthor[0] != <span class="charliteral">'\0'</span>) { -<a name="l00262"></a>00262 vFPprintf(pOutFile, <span class="stringliteral">"/Author (%s)\n"</span>, szAuthor); -<a name="l00263"></a>00263 } -<a name="l00264"></a>00264 <span class="keywordflow">if</span> (szSubject != NULL && szSubject[0] != <span class="charliteral">'\0'</span>) { -<a name="l00265"></a>00265 vFPprintf(pOutFile, <span class="stringliteral">"/Subject (%s)\n"</span>, szSubject); -<a name="l00266"></a>00266 } -<a name="l00267"></a>00267 <span class="keywordflow">if</span> (szCreator != NULL && szCreator[0] != <span class="charliteral">'\0'</span>) { -<a name="l00268"></a>00268 vFPprintf(pOutFile, <span class="stringliteral">"/Creator (%s)\n"</span>, szCreator); -<a name="l00269"></a>00269 } -<a name="l00270"></a>00270 vFPprintf(pOutFile, <span class="stringliteral">"/Producer (%s %s)\n"</span>, szProducer, VERSIONSTRING); -<a name="l00271"></a>00271 <span class="keywordflow">if</span> (szCreationDate != NULL && szCreationDate[0] != <span class="charliteral">'\0'</span>) { -<a name="l00272"></a>00272 vFPprintf(pOutFile, <span class="stringliteral">"/CreationDate (%s)\n"</span>, szCreationDate); -<a name="l00273"></a>00273 } -<a name="l00274"></a>00274 <span class="keywordflow">if</span> (szModDate != NULL && szModDate[0] != <span class="charliteral">'\0'</span>) { -<a name="l00275"></a>00275 vFPprintf(pOutFile, <span class="stringliteral">"/ModDate (%s)\n"</span>, szModDate); -<a name="l00276"></a>00276 } -<a name="l00277"></a>00277 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00278"></a>00278 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00279"></a>00279 } <span class="comment">/* end of vCreateInfoDictionary */</span> -<a name="l00280"></a>00280 -<a name="l00281"></a>00281 <span class="comment">/*</span> -<a name="l00282"></a>00282 <span class="comment"> * vAddHdrFtr - add a header or footer</span> -<a name="l00283"></a>00283 <span class="comment"> */</span> -<a name="l00284"></a>00284 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00285"></a>00285 vAddHdrFtr(diagram_type *pDiag, <span class="keyword">const</span> hdrftr_block_type *pHdrFtrInfo) -<a name="l00286"></a>00286 { -<a name="l00287"></a>00287 output_type *pStart, *pPrev, *pNext; -<a name="l00288"></a>00288 -<a name="l00289"></a>00289 fail(pDiag == NULL); -<a name="l00290"></a>00290 fail(pHdrFtrInfo == NULL); -<a name="l00291"></a>00291 -<a name="l00292"></a>00292 vStartOfParagraphPDF(pDiag, 0); -<a name="l00293"></a>00293 pStart = pHdrFtrInfo->pText; -<a name="l00294"></a>00294 <span class="keywordflow">while</span> (pStart != NULL) { -<a name="l00295"></a>00295 pNext = pStart; -<a name="l00296"></a>00296 <span class="keywordflow">while</span> (pNext != NULL && -<a name="l00297"></a>00297 (pNext->tNextFree != 1 || -<a name="l00298"></a>00298 (pNext->szStorage[0] != PAR_END && -<a name="l00299"></a>00299 pNext->szStorage[0] != HARD_RETURN))) { -<a name="l00300"></a>00300 pNext = pNext->pNext; -<a name="l00301"></a>00301 } -<a name="l00302"></a>00302 <span class="keywordflow">if</span> (pNext == NULL) { -<a name="l00303"></a>00303 <span class="keywordflow">if</span> (bOutputContainsText(pStart)) { -<a name="l00304"></a>00304 vAlign2Window(pDiag, pStart, -<a name="l00305"></a>00305 lChar2MilliPoints(DEFAULT_SCREEN_WIDTH), -<a name="l00306"></a>00306 ALIGNMENT_LEFT); -<a name="l00307"></a>00307 } <span class="keywordflow">else</span> { -<a name="l00308"></a>00308 vMove2NextLinePDF(pDiag, pStart->usFontSize); -<a name="l00309"></a>00309 } -<a name="l00310"></a>00310 <span class="keywordflow">break</span>; -<a name="l00311"></a>00311 } -<a name="l00312"></a>00312 fail(pNext->tNextFree != 1); -<a name="l00313"></a>00313 fail(pNext->szStorage[0] != PAR_END && -<a name="l00314"></a>00314 pNext->szStorage[0] != HARD_RETURN); -<a name="l00315"></a>00315 -<a name="l00316"></a>00316 <span class="keywordflow">if</span> (pStart != pNext) { -<a name="l00317"></a>00317 <span class="comment">/* There is something to print */</span> -<a name="l00318"></a>00318 pPrev = pNext->pPrev; -<a name="l00319"></a>00319 fail(pPrev->pNext != pNext); -<a name="l00320"></a>00320 <span class="comment">/* Cut the chain */</span> -<a name="l00321"></a>00321 pPrev->pNext = NULL; -<a name="l00322"></a>00322 <span class="keywordflow">if</span> (bOutputContainsText(pStart)) { -<a name="l00323"></a>00323 <span class="comment">/* Print it */</span> -<a name="l00324"></a>00324 vAlign2Window(pDiag, pStart, -<a name="l00325"></a>00325 lChar2MilliPoints(DEFAULT_SCREEN_WIDTH), -<a name="l00326"></a>00326 ALIGNMENT_LEFT); -<a name="l00327"></a>00327 } <span class="keywordflow">else</span> { -<a name="l00328"></a>00328 <span class="comment">/* Just an empty line */</span> -<a name="l00329"></a>00329 vMove2NextLinePDF(pDiag, pStart->usFontSize); -<a name="l00330"></a>00330 } -<a name="l00331"></a>00331 <span class="comment">/* Repair the chain */</span> -<a name="l00332"></a>00332 pPrev->pNext = pNext; -<a name="l00333"></a>00333 } -<a name="l00334"></a>00334 <span class="keywordflow">if</span> (pNext->szStorage[0] == PAR_END) { -<a name="l00335"></a>00335 vEndOfParagraphPDF(pDiag, pNext->usFontSize, -<a name="l00336"></a>00336 (<span class="keywordtype">long</span>)pNext->usFontSize * 200); -<a name="l00337"></a>00337 } -<a name="l00338"></a>00338 pStart = pNext->pNext; -<a name="l00339"></a>00339 } -<a name="l00340"></a>00340 } <span class="comment">/* end of vAddHdrFtr */</span> -<a name="l00341"></a>00341 -<a name="l00342"></a>00342 <span class="comment">/*</span> -<a name="l00343"></a>00343 <span class="comment"> * vAddHeader - add a page header</span> -<a name="l00344"></a>00344 <span class="comment"> */</span> -<a name="l00345"></a>00345 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00346"></a>00346 vAddHeader(diagram_type *pDiag) -<a name="l00347"></a>00347 { -<a name="l00348"></a>00348 <span class="keyword">const</span> hdrftr_block_type *pHdrInfo; -<a name="l00349"></a>00349 <span class="keyword">const</span> hdrftr_block_type *pFtrInfo; -<a name="l00350"></a>00350 -<a name="l00351"></a>00351 fail(pDiag == NULL); -<a name="l00352"></a>00352 -<a name="l00353"></a>00353 NO_DBG_MSG(<span class="stringliteral">"vAddHeader"</span>); -<a name="l00354"></a>00354 -<a name="l00355"></a>00355 pHdrInfo = pGetHdrFtrInfo(iSectionIndex, TRUE, -<a name="l00356"></a>00356 odd(iPageCount), bFirstInSection); -<a name="l00357"></a>00357 pFtrInfo = pGetHdrFtrInfo(iSectionIndex, FALSE, -<a name="l00358"></a>00358 odd(iPageCount), bFirstInSection); -<a name="l00359"></a>00359 <span class="comment">/* Set the height of the footer of this page */</span> -<a name="l00360"></a>00360 lFooterHeight = pFtrInfo == NULL ? 0 : pFtrInfo->lHeight; -<a name="l00361"></a>00361 fail(lFooterHeight < 0); -<a name="l00362"></a>00362 -<a name="l00363"></a>00363 <span class="keywordflow">if</span> (pHdrInfo == NULL || -<a name="l00364"></a>00364 pHdrInfo->pText == NULL || -<a name="l00365"></a>00365 pHdrInfo->lHeight <= 0) { -<a name="l00366"></a>00366 fail(pHdrInfo != NULL && pHdrInfo->lHeight < 0); -<a name="l00367"></a>00367 fail(pHdrInfo != NULL && -<a name="l00368"></a>00368 pHdrInfo->pText != NULL && -<a name="l00369"></a>00369 pHdrInfo->lHeight == 0); -<a name="l00370"></a>00370 <span class="keywordflow">return</span>; -<a name="l00371"></a>00371 } -<a name="l00372"></a>00372 -<a name="l00373"></a>00373 vAddHdrFtr(pDiag, pHdrInfo); -<a name="l00374"></a>00374 -<a name="l00375"></a>00375 DBG_DEC_C(pHdrInfo->lHeight != -<a name="l00376"></a>00376 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop, -<a name="l00377"></a>00377 pHdrInfo->lHeight); -<a name="l00378"></a>00378 DBG_DEC_C(pHdrInfo->lHeight != -<a name="l00379"></a>00379 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop, -<a name="l00380"></a>00380 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop); -<a name="l00381"></a>00381 } <span class="comment">/* end of vAddHeader */</span> -<a name="l00382"></a>00382 -<a name="l00383"></a>00383 <span class="comment">/*</span> -<a name="l00384"></a>00384 <span class="comment"> * vAddFooter - add a page footer</span> -<a name="l00385"></a>00385 <span class="comment"> */</span> -<a name="l00386"></a>00386 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00387"></a>00387 vAddFooter(diagram_type *pDiag) -<a name="l00388"></a>00388 { -<a name="l00389"></a>00389 <span class="keyword">const</span> hdrftr_block_type *pFtrInfo; -<a name="l00390"></a>00390 -<a name="l00391"></a>00391 fail(pDiag == NULL); -<a name="l00392"></a>00392 -<a name="l00393"></a>00393 NO_DBG_MSG(<span class="stringliteral">"vAddFooter"</span>); -<a name="l00394"></a>00394 -<a name="l00395"></a>00395 pFtrInfo = pGetHdrFtrInfo(iSectionIndex, FALSE, -<a name="l00396"></a>00396 odd(iPageCount), bFirstInSection); -<a name="l00397"></a>00397 bFirstInSection = FALSE; -<a name="l00398"></a>00398 <span class="keywordflow">if</span> (pFtrInfo == NULL || -<a name="l00399"></a>00399 pFtrInfo->pText == NULL || -<a name="l00400"></a>00400 pFtrInfo->lHeight <= 0) { -<a name="l00401"></a>00401 fail(pFtrInfo != NULL && pFtrInfo->lHeight < 0); -<a name="l00402"></a>00402 fail(pFtrInfo != NULL && -<a name="l00403"></a>00403 pFtrInfo->pText != NULL && -<a name="l00404"></a>00404 pFtrInfo->lHeight == 0); -<a name="l00405"></a>00405 <span class="keywordflow">return</span>; -<a name="l00406"></a>00406 } -<a name="l00407"></a>00407 -<a name="l00408"></a>00408 bInFtrSpace = TRUE; -<a name="l00409"></a>00409 -<a name="l00410"></a>00410 DBG_DEC_C(pFtrInfo->lHeight != lFooterHeight, pFtrInfo->lHeight); -<a name="l00411"></a>00411 DBG_DEC_C(pFtrInfo->lHeight != lFooterHeight, lFooterHeight); -<a name="l00412"></a>00412 DBG_DEC_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00413"></a>00413 pDiag->lYtop); -<a name="l00414"></a>00414 DBG_DEC_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00415"></a>00415 lFooterHeight + PS_BOTTOM_MARGIN); -<a name="l00416"></a>00416 -<a name="l00417"></a>00417 <span class="keywordflow">if</span> (pDiag->lYtop > lFooterHeight + PS_BOTTOM_MARGIN) { -<a name="l00418"></a>00418 <span class="comment">/* Move down to the start of the footer */</span> -<a name="l00419"></a>00419 pDiag->lYtop = lFooterHeight + PS_BOTTOM_MARGIN; -<a name="l00420"></a>00420 vMoveTo(pDiag, 0); -<a name="l00421"></a>00421 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN / 2) { -<a name="l00422"></a>00422 DBG_FIXME(); -<a name="l00423"></a>00423 <span class="comment">/*</span> -<a name="l00424"></a>00424 <span class="comment"> * Move up to the start of the footer, to prevent moving</span> -<a name="l00425"></a>00425 <span class="comment"> * of the bottom edge of the paper</span> -<a name="l00426"></a>00426 <span class="comment"> */</span> -<a name="l00427"></a>00427 pDiag->lYtop = lFooterHeight + PS_BOTTOM_MARGIN; -<a name="l00428"></a>00428 vMoveTo(pDiag, 0); -<a name="l00429"></a>00429 } -<a name="l00430"></a>00430 -<a name="l00431"></a>00431 DBG_FLT_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00432"></a>00432 dDrawUnits2Points(lFooterHeight + PS_BOTTOM_MARGIN - pDiag->lYtop)); -<a name="l00433"></a>00433 -<a name="l00434"></a>00434 vAddHdrFtr(pDiag, pFtrInfo); -<a name="l00435"></a>00435 bInFtrSpace = FALSE; -<a name="l00436"></a>00436 } <span class="comment">/* end of vAddFooter */</span> -<a name="l00437"></a>00437 -<a name="l00438"></a>00438 <span class="comment">/*</span> -<a name="l00439"></a>00439 <span class="comment"> * vEndPageObject - end the current page object</span> -<a name="l00440"></a>00440 <span class="comment"> */</span> -<a name="l00441"></a>00441 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00442"></a>00442 vEndPageObject(FILE *pOutFile) -<a name="l00443"></a>00443 { -<a name="l00444"></a>00444 <span class="keywordtype">long</span> lStreamEnd; -<a name="l00445"></a>00445 -<a name="l00446"></a>00446 <span class="keywordflow">if</span> (lStreamStart < 0) { -<a name="l00447"></a>00447 <span class="comment">/* There is no current page object */</span> -<a name="l00448"></a>00448 <span class="keywordflow">return</span>; -<a name="l00449"></a>00449 } -<a name="l00450"></a>00450 -<a name="l00451"></a>00451 vFPprintf(pOutFile, <span class="stringliteral">"ET\n"</span>); -<a name="l00452"></a>00452 lStreamEnd = lFilePosition; -<a name="l00453"></a>00453 vFPprintf(pOutFile, <span class="stringliteral">"endstream\n"</span>); -<a name="l00454"></a>00454 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00455"></a>00455 -<a name="l00456"></a>00456 iObjectNumberCurr++; -<a name="l00457"></a>00457 vSetLocation(iObjectNumberCurr); -<a name="l00458"></a>00458 vFPprintf(pOutFile, <span class="stringliteral">"%d 0 obj\n"</span>, iObjectNumberCurr); -<a name="l00459"></a>00459 vFPprintf(pOutFile, <span class="stringliteral">"%lu\n"</span>, lStreamEnd - lStreamStart); -<a name="l00460"></a>00460 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00461"></a>00461 } <span class="comment">/* end of vEndPageObject */</span> -<a name="l00462"></a>00462 -<a name="l00463"></a>00463 <span class="comment">/*</span> -<a name="l00464"></a>00464 <span class="comment"> * vMove2NextPage - move to the start of the next page</span> -<a name="l00465"></a>00465 <span class="comment"> */</span> -<a name="l00466"></a>00466 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00467"></a>00467 vMove2NextPage(diagram_type *pDiag, BOOL bNewSection) -<a name="l00468"></a>00468 { -<a name="l00469"></a>00469 FILE *pOutFile; -<a name="l00470"></a>00470 -<a name="l00471"></a>00471 fail(pDiag == NULL); -<a name="l00472"></a>00472 fail(pDiag->pOutFile == NULL); -<a name="l00473"></a>00473 -<a name="l00474"></a>00474 pOutFile = pDiag->pOutFile; -<a name="l00475"></a>00475 -<a name="l00476"></a>00476 vAddFooter(pDiag); -<a name="l00477"></a>00477 <span class="comment">/* End the old page object */</span> -<a name="l00478"></a>00478 vEndPageObject(pOutFile); -<a name="l00479"></a>00479 <span class="keywordflow">if</span> (bNewSection) { -<a name="l00480"></a>00480 iSectionIndex++; -<a name="l00481"></a>00481 bFirstInSection = TRUE; -<a name="l00482"></a>00482 } -<a name="l00483"></a>00483 -<a name="l00484"></a>00484 <span class="comment">/* Start the new page object */</span> -<a name="l00485"></a>00485 iObjectNumberCurr++; -<a name="l00486"></a>00486 vSetLocation(iObjectNumberCurr); -<a name="l00487"></a>00487 vFillNextPageObject(); -<a name="l00488"></a>00488 vFPprintf(pOutFile, <span class="stringliteral">"%d 0 obj\n"</span>, iObjectNumberCurr); -<a name="l00489"></a>00489 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00490"></a>00490 vFPprintf(pOutFile, <span class="stringliteral">"/Type /Page\n"</span>); -<a name="l00491"></a>00491 vFPprintf(pOutFile, <span class="stringliteral">"/Parent 3 0 R\n"</span>); -<a name="l00492"></a>00492 vFPprintf(pOutFile, <span class="stringliteral">"/Resources 17 0 R\n"</span>); -<a name="l00493"></a>00493 vFPprintf(pOutFile, <span class="stringliteral">"/Contents %d 0 R\n"</span>, iObjectNumberCurr + 1); -<a name="l00494"></a>00494 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00495"></a>00495 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00496"></a>00496 -<a name="l00497"></a>00497 <span class="comment">/* Start the new text object */</span> -<a name="l00498"></a>00498 iObjectNumberCurr++; -<a name="l00499"></a>00499 vSetLocation(iObjectNumberCurr); -<a name="l00500"></a>00500 vFPprintf(pOutFile, <span class="stringliteral">"%d 0 obj\n"</span>, iObjectNumberCurr); -<a name="l00501"></a>00501 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00502"></a>00502 vFPprintf(pOutFile, <span class="stringliteral">"/Length %d 0 R\n"</span>, iObjectNumberCurr + 1); -<a name="l00503"></a>00503 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00504"></a>00504 vFPprintf(pOutFile, <span class="stringliteral">"stream\n"</span>); -<a name="l00505"></a>00505 lStreamStart = lFilePosition; -<a name="l00506"></a>00506 vFPprintf(pOutFile, <span class="stringliteral">"BT\n"</span>); -<a name="l00507"></a>00507 -<a name="l00508"></a>00508 <span class="comment">/* Set variables to their start of page values */</span> -<a name="l00509"></a>00509 pDiag->lYtop = lPageHeight - PS_TOP_MARGIN; -<a name="l00510"></a>00510 tFontRefCurr = (drawfile_fontref)-1; -<a name="l00511"></a>00511 usFontSizeCurr = 0; -<a name="l00512"></a>00512 iFontColorCurr = -1; -<a name="l00513"></a>00513 lYtopCurr = -1; -<a name="l00514"></a>00514 vAddHeader(pDiag); -<a name="l00515"></a>00515 } <span class="comment">/* end of vMove2NextPage */</span> -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 <span class="comment">/*</span> -<a name="l00518"></a>00518 <span class="comment"> * vMoveTo - move to the specified X,Y coordinates</span> -<a name="l00519"></a>00519 <span class="comment"> *</span> -<a name="l00520"></a>00520 <span class="comment"> * Move the current position of the specified diagram to its X,Y coordinates,</span> -<a name="l00521"></a>00521 <span class="comment"> * start on a new page if needed</span> -<a name="l00522"></a>00522 <span class="comment"> */</span> -<a name="l00523"></a>00523 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00524"></a>00524 vMoveTo(diagram_type *pDiag, <span class="keywordtype">long</span> lLastVerticalMovement) -<a name="l00525"></a>00525 { -<a name="l00526"></a>00526 fail(pDiag == NULL); -<a name="l00527"></a>00527 fail(pDiag->pOutFile == NULL); -<a name="l00528"></a>00528 -<a name="l00529"></a>00529 <span class="keywordflow">if</span> (pDiag->lYtop <= lFooterHeight + PS_BOTTOM_MARGIN && !bInFtrSpace) { -<a name="l00530"></a>00530 vMove2NextPage(pDiag, FALSE); -<a name="l00531"></a>00531 <span class="comment">/* Repeat the last vertical movement on the new page */</span> -<a name="l00532"></a>00532 pDiag->lYtop -= lLastVerticalMovement; -<a name="l00533"></a>00533 } -<a name="l00534"></a>00534 -<a name="l00535"></a>00535 fail(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN && !bInFtrSpace); -<a name="l00536"></a>00536 DBG_DEC_C(pDiag->lYtop < PS_BOTTOM_MARGIN, pDiag->lYtop); -<a name="l00537"></a>00537 fail(pDiag->lYtop < PS_BOTTOM_MARGIN / 3); -<a name="l00538"></a>00538 -<a name="l00539"></a>00539 <span class="keywordflow">if</span> (pDiag->lYtop != lYtopCurr) { -<a name="l00540"></a>00540 vFPprintf(pDiag->pOutFile, <span class="stringliteral">"1 0 0 1 %.2f %.2f Tm\n"</span>, -<a name="l00541"></a>00541 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00542"></a>00542 dDrawUnits2Points(pDiag->lYtop)); -<a name="l00543"></a>00543 lYtopCurr = pDiag->lYtop; -<a name="l00544"></a>00544 } -<a name="l00545"></a>00545 } <span class="comment">/* end of vMoveTo */</span> -<a name="l00546"></a>00546 -<a name="l00547"></a>00547 <span class="comment">/*</span> -<a name="l00548"></a>00548 <span class="comment"> * vProloguePDF - set options and perform the PDF initialization</span> -<a name="l00549"></a>00549 <span class="comment"> */</span> -<a name="l00550"></a>00550 <span class="keywordtype">void</span> -<a name="l00551"></a>00551 vProloguePDF(diagram_type *pDiag, -<a name="l00552"></a>00552 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> options_type *pOptions) -<a name="l00553"></a>00553 { -<a name="l00554"></a>00554 FILE *pOutFile; -<a name="l00555"></a>00555 -<a name="l00556"></a>00556 fail(pDiag == NULL); -<a name="l00557"></a>00557 fail(pDiag->pOutFile == NULL); -<a name="l00558"></a>00558 fail(pOptions == NULL); -<a name="l00559"></a>00559 -<a name="l00560"></a>00560 pOutFile = pDiag->pOutFile; -<a name="l00561"></a>00561 -<a name="l00562"></a>00562 eEncoding = pOptions->eEncoding; -<a name="l00563"></a>00563 -<a name="l00564"></a>00564 <span class="comment">/* Create an empty location array */</span> -<a name="l00565"></a>00565 tLocations = INITIAL_LOCATION_SIZE; -<a name="l00566"></a>00566 alLocation = xcalloc(tLocations, <span class="keyword">sizeof</span>(<span class="keywordtype">long</span>)); -<a name="l00567"></a>00567 -<a name="l00568"></a>00568 <span class="comment">/* Create an empty pageobject array */</span> -<a name="l00569"></a>00569 tMaxPageObjects = INITIAL_PAGEOBJECT_SIZE; -<a name="l00570"></a>00570 aiPageObject = xcalloc(tMaxPageObjects, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)); -<a name="l00571"></a>00571 -<a name="l00572"></a>00572 <span class="keywordflow">if</span> (pOptions->iPageHeight == INT_MAX) { -<a name="l00573"></a>00573 lPageHeight = LONG_MAX; -<a name="l00574"></a>00574 } <span class="keywordflow">else</span> { -<a name="l00575"></a>00575 lPageHeight = lPoints2DrawUnits(pOptions->iPageHeight); -<a name="l00576"></a>00576 } -<a name="l00577"></a>00577 DBG_DEC(lPageHeight); -<a name="l00578"></a>00578 <span class="keywordflow">if</span> (pOptions->iPageWidth == INT_MAX) { -<a name="l00579"></a>00579 lPageWidth = LONG_MAX; -<a name="l00580"></a>00580 } <span class="keywordflow">else</span> { -<a name="l00581"></a>00581 lPageWidth = lPoints2DrawUnits(pOptions->iPageWidth); -<a name="l00582"></a>00582 } -<a name="l00583"></a>00583 DBG_DEC(lPageWidth); -<a name="l00584"></a>00584 lFooterHeight = 0; -<a name="l00585"></a>00585 bInFtrSpace = FALSE; -<a name="l00586"></a>00586 -<a name="l00587"></a>00587 tFontRefCurr = (drawfile_fontref)-1; -<a name="l00588"></a>00588 usFontSizeCurr = 0; -<a name="l00589"></a>00589 iFontColorCurr = -1; -<a name="l00590"></a>00590 lYtopCurr = -1; -<a name="l00591"></a>00591 iPageCount = 0; -<a name="l00592"></a>00592 iImageCount = 0; -<a name="l00593"></a>00593 iSectionIndex = 0; -<a name="l00594"></a>00594 bFirstInSection = TRUE; -<a name="l00595"></a>00595 lFilePosition = 0; -<a name="l00596"></a>00596 iMaxLocationNumber = 0; -<a name="l00597"></a>00597 lStreamStart = -1; -<a name="l00598"></a>00598 iObjectNumberCurr = 17; -<a name="l00599"></a>00599 pDiag->lXleft = 0; -<a name="l00600"></a>00600 pDiag->lYtop = 0; -<a name="l00601"></a>00601 -<a name="l00602"></a>00602 szProducer = szTask; -<a name="l00603"></a>00603 -<a name="l00604"></a>00604 vFPprintf(pOutFile, <span class="stringliteral">"%%PDF-1.3\n"</span>); -<a name="l00605"></a>00605 vFPprintf(pOutFile, <span class="stringliteral">"%%%c%c%c%c\n"</span>, 0xe2, 0xe3, 0xcf, 0xd3); -<a name="l00606"></a>00606 -<a name="l00607"></a>00607 <span class="comment">/* Root catalog */</span> -<a name="l00608"></a>00608 vSetLocation(1); -<a name="l00609"></a>00609 vFPprintf(pOutFile, <span class="stringliteral">"1 0 obj\n"</span>); -<a name="l00610"></a>00610 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00611"></a>00611 vFPprintf(pOutFile, <span class="stringliteral">"/Type /Catalog\n"</span>); -<a name="l00612"></a>00612 vFPprintf(pOutFile, <span class="stringliteral">"/Pages 3 0 R\n"</span>); -<a name="l00613"></a>00613 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00614"></a>00614 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00615"></a>00615 } <span class="comment">/* end of vProloguePDF */</span> -<a name="l00616"></a>00616 -<a name="l00617"></a>00617 <span class="comment">/*</span> -<a name="l00618"></a>00618 <span class="comment"> * vEpiloguePDF - clean up after everything is done</span> -<a name="l00619"></a>00619 <span class="comment"> */</span> -<a name="l00620"></a>00620 <span class="keywordtype">void</span> -<a name="l00621"></a>00621 vEpiloguePDF(diagram_type *pDiag) -<a name="l00622"></a>00622 { -<a name="l00623"></a>00623 FILE *pOutFile; -<a name="l00624"></a>00624 <span class="keywordtype">long</span> lXref; -<a name="l00625"></a>00625 <span class="keywordtype">int</span> iIndex; -<a name="l00626"></a>00626 -<a name="l00627"></a>00627 fail(pDiag == NULL); -<a name="l00628"></a>00628 fail(pDiag->pOutFile == NULL); -<a name="l00629"></a>00629 -<a name="l00630"></a>00630 pOutFile = pDiag->pOutFile; -<a name="l00631"></a>00631 -<a name="l00632"></a>00632 vAddFooter(pDiag); -<a name="l00633"></a>00633 <span class="comment">/* End the old page object */</span> -<a name="l00634"></a>00634 vEndPageObject(pOutFile); -<a name="l00635"></a>00635 -<a name="l00636"></a>00636 vSetLocation(3); -<a name="l00637"></a>00637 vFPprintf(pOutFile, <span class="stringliteral">"3 0 obj\n"</span>); -<a name="l00638"></a>00638 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00639"></a>00639 vFPprintf(pOutFile, <span class="stringliteral">"/Type /Pages\n"</span>); -<a name="l00640"></a>00640 vFPprintf(pOutFile, <span class="stringliteral">"/Count %d\n"</span>, iPageCount); -<a name="l00641"></a>00641 vFPprintf(pOutFile, <span class="stringliteral">"/MediaBox [ 0 0 %.0f %.0f ]\n"</span>, -<a name="l00642"></a>00642 dDrawUnits2Points(lPageWidth), -<a name="l00643"></a>00643 dDrawUnits2Points(lPageHeight)); -<a name="l00644"></a>00644 vFPprintf(pOutFile, <span class="stringliteral">"/Kids [ "</span>); -<a name="l00645"></a>00645 <span class="keywordflow">for</span> (iIndex = 1; iIndex <= iPageCount; iIndex++) { -<a name="l00646"></a>00646 vFPprintf(pOutFile, <span class="stringliteral">"\t%d 0 R\n"</span>, aiPageObject[iIndex]); -<a name="l00647"></a>00647 } -<a name="l00648"></a>00648 vFPprintf(pOutFile, <span class="stringliteral">"]\n"</span>); -<a name="l00649"></a>00649 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00650"></a>00650 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00651"></a>00651 -<a name="l00652"></a>00652 lXref = lFilePosition; -<a name="l00653"></a>00653 -<a name="l00654"></a>00654 vFPprintf(pOutFile, <span class="stringliteral">"xref\n"</span>); -<a name="l00655"></a>00655 vFPprintf(pOutFile, <span class="stringliteral">"0 %d\n"</span>, iMaxLocationNumber + 1); -<a name="l00656"></a>00656 vFPprintf(pOutFile, <span class="stringliteral">"0000000000 65535 f \n"</span>); -<a name="l00657"></a>00657 <span class="keywordflow">for</span> (iIndex = 1; iIndex <= iMaxLocationNumber; iIndex++) { -<a name="l00658"></a>00658 vFPprintf(pOutFile, <span class="stringliteral">"%.10ld 00000 n \n"</span>, alLocation[iIndex]); -<a name="l00659"></a>00659 } -<a name="l00660"></a>00660 -<a name="l00661"></a>00661 vFPprintf(pOutFile, <span class="stringliteral">"trailer\n"</span>); -<a name="l00662"></a>00662 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00663"></a>00663 vFPprintf(pOutFile, <span class="stringliteral">"/Size %d\n"</span>, iMaxLocationNumber + 1); -<a name="l00664"></a>00664 vFPprintf(pOutFile, <span class="stringliteral">"/Root 1 0 R\n"</span>); -<a name="l00665"></a>00665 vFPprintf(pOutFile, <span class="stringliteral">"/Info 2 0 R\n"</span>); -<a name="l00666"></a>00666 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00667"></a>00667 -<a name="l00668"></a>00668 vFPprintf(pOutFile, <span class="stringliteral">"startxref\n"</span>); -<a name="l00669"></a>00669 vFPprintf(pOutFile, <span class="stringliteral">"%ld\n"</span>, lXref); -<a name="l00670"></a>00670 vFPprintf(pOutFile, <span class="stringliteral">"%%%%EOF\n"</span>); -<a name="l00671"></a>00671 -<a name="l00672"></a>00672 szProducer = NULL; -<a name="l00673"></a>00673 aiPageObject = xfree(aiPageObject); -<a name="l00674"></a>00674 alLocation = xfree(alLocation); -<a name="l00675"></a>00675 } <span class="comment">/* end of vEpiloguePDF */</span> -<a name="l00676"></a>00676 -<a name="l00677"></a>00677 <span class="comment">/*</span> -<a name="l00678"></a>00678 <span class="comment"> * vPrintPalette - print a pdf color space (palette)</span> -<a name="l00679"></a>00679 <span class="comment"> */</span> -<a name="l00680"></a>00680 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00681"></a>00681 vPrintPalette(FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00682"></a>00682 { -<a name="l00683"></a>00683 <span class="keywordtype">int</span> iIndex; -<a name="l00684"></a>00684 -<a name="l00685"></a>00685 fail(pOutFile == NULL); -<a name="l00686"></a>00686 fail(pImg == NULL); -<a name="l00687"></a>00687 fail(pImg->iColorsUsed < 2); -<a name="l00688"></a>00688 fail(pImg->iColorsUsed > 256); -<a name="l00689"></a>00689 -<a name="l00690"></a>00690 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace [ /Indexed\n"</span>); -<a name="l00691"></a>00691 vFPprintf(pOutFile, <span class="stringliteral">"\t/Device%s %d\n"</span>, -<a name="l00692"></a>00692 pImg->bColorImage ? <span class="stringliteral">"RGB"</span> : <span class="stringliteral">"Gray"</span>, pImg->iColorsUsed - 1); -<a name="l00693"></a>00693 vFPprintf(pOutFile, <span class="stringliteral">"<"</span>); -<a name="l00694"></a>00694 <span class="keywordflow">for</span> (iIndex = 0; iIndex < pImg->iColorsUsed; iIndex++) { -<a name="l00695"></a>00695 vFPprintf(pOutFile, <span class="stringliteral">"%02x"</span>, -<a name="l00696"></a>00696 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][0]); -<a name="l00697"></a>00697 <span class="keywordflow">if</span> (pImg->bColorImage) { -<a name="l00698"></a>00698 vFPprintf(pOutFile, <span class="stringliteral">"%02x%02x"</span>, -<a name="l00699"></a>00699 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][1], -<a name="l00700"></a>00700 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][2]); -<a name="l00701"></a>00701 } -<a name="l00702"></a>00702 <span class="keywordflow">if</span> (iIndex % 8 == 7) { -<a name="l00703"></a>00703 vFPprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00704"></a>00704 } <span class="keywordflow">else</span> { -<a name="l00705"></a>00705 vFPprintf(pOutFile, <span class="stringliteral">" "</span>); -<a name="l00706"></a>00706 } -<a name="l00707"></a>00707 } -<a name="l00708"></a>00708 vFPprintf(pOutFile, <span class="stringliteral">"> ]\n"</span>); -<a name="l00709"></a>00709 } <span class="comment">/* end of vPrintPalette */</span> -<a name="l00710"></a>00710 -<a name="l00711"></a>00711 <span class="comment">/*</span> -<a name="l00712"></a>00712 <span class="comment"> * vImageProloguePDF - perform the image initialization</span> -<a name="l00713"></a>00713 <span class="comment"> */</span> -<a name="l00714"></a>00714 <span class="keywordtype">void</span> -<a name="l00715"></a>00715 vImageProloguePDF(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00716"></a>00716 { -<a name="l00717"></a>00717 FILE *pOutFile; -<a name="l00718"></a>00718 -<a name="l00719"></a>00719 fail(pDiag == NULL); -<a name="l00720"></a>00720 fail(pDiag->pOutFile == NULL); -<a name="l00721"></a>00721 fail(pImg == NULL); -<a name="l00722"></a>00722 -<a name="l00723"></a>00723 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { -<a name="l00724"></a>00724 <span class="keywordflow">return</span>; -<a name="l00725"></a>00725 } -<a name="l00726"></a>00726 -<a name="l00727"></a>00727 iImageCount++; -<a name="l00728"></a>00728 -<a name="l00729"></a>00729 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00730"></a>00730 -<a name="l00731"></a>00731 pDiag->lYtop -= lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00732"></a>00732 vMoveTo(pDiag, lPoints2DrawUnits(pImg->iVerSizeScaled)); -<a name="l00733"></a>00733 -<a name="l00734"></a>00734 pOutFile = pDiag->pOutFile; -<a name="l00735"></a>00735 -<a name="l00736"></a>00736 vFPprintf(pOutFile, <span class="stringliteral">"ET\n"</span>); -<a name="l00737"></a>00737 vFPprintf(pOutFile, <span class="stringliteral">"q %% Image %03d\n"</span>, iImageCount); -<a name="l00738"></a>00738 <span class="keywordflow">if</span> (pImg->eImageType == imagetype_is_dib) { -<a name="l00739"></a>00739 <span class="comment">/* Scanning from left to right and bottom to top */</span> -<a name="l00740"></a>00740 vFPprintf(pOutFile, <span class="stringliteral">"%d 0 0 %d %.2f %.2f cm\n"</span>, -<a name="l00741"></a>00741 pImg->iHorSizeScaled, -pImg->iVerSizeScaled, -<a name="l00742"></a>00742 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00743"></a>00743 dDrawUnits2Points(pDiag->lYtop) + pImg->iVerSizeScaled); -<a name="l00744"></a>00744 } <span class="keywordflow">else</span> { -<a name="l00745"></a>00745 <span class="comment">/* Scanning from left to right and top to bottom */</span> -<a name="l00746"></a>00746 vFPprintf(pOutFile, <span class="stringliteral">"%d 0 0 %d %.2f %.2f cm\n"</span>, -<a name="l00747"></a>00747 pImg->iHorSizeScaled, pImg->iVerSizeScaled, -<a name="l00748"></a>00748 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00749"></a>00749 dDrawUnits2Points(pDiag->lYtop)); -<a name="l00750"></a>00750 } -<a name="l00751"></a>00751 vFPprintf(pOutFile, <span class="stringliteral">"BI\n"</span>); -<a name="l00752"></a>00752 vFPprintf(pOutFile, <span class="stringliteral">"\t/Width %d\n"</span>, pImg->iWidth); -<a name="l00753"></a>00753 vFPprintf(pOutFile, <span class="stringliteral">"\t/Height %d\n"</span>, pImg->iHeight); -<a name="l00754"></a>00754 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l00755"></a>00755 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l00756"></a>00756 <span class="keywordflow">switch</span> (pImg->iComponents) { -<a name="l00757"></a>00757 <span class="keywordflow">case</span> 1: -<a name="l00758"></a>00758 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceGray\n"</span>); -<a name="l00759"></a>00759 <span class="keywordflow">break</span>; -<a name="l00760"></a>00760 <span class="keywordflow">case</span> 3: -<a name="l00761"></a>00761 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceRGB\n"</span>); -<a name="l00762"></a>00762 <span class="keywordflow">break</span>; -<a name="l00763"></a>00763 <span class="keywordflow">case</span> 4: -<a name="l00764"></a>00764 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceCMYK\n"</span>); -<a name="l00765"></a>00765 <span class="keywordflow">if</span> (pImg->bAdobe) { -<a name="l00766"></a>00766 <span class="comment">/*</span> -<a name="l00767"></a>00767 <span class="comment"> * Adobe-conforming CMYK file</span> -<a name="l00768"></a>00768 <span class="comment"> * applying workaround for color inversion</span> -<a name="l00769"></a>00769 <span class="comment"> */</span> -<a name="l00770"></a>00770 vFPprintf(pOutFile, -<a name="l00771"></a>00771 <span class="stringliteral">"\t/Decode [1 0 1 0 1 0 1 0]\n"</span>); -<a name="l00772"></a>00772 } -<a name="l00773"></a>00773 <span class="keywordflow">break</span>; -<a name="l00774"></a>00774 <span class="keywordflow">default</span>: -<a name="l00775"></a>00775 DBG_DEC(pImg->iComponents); -<a name="l00776"></a>00776 <span class="keywordflow">break</span>; -<a name="l00777"></a>00777 } -<a name="l00778"></a>00778 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00779"></a>00779 vFPprintf(pOutFile, -<a name="l00780"></a>00780 <span class="stringliteral">"\t/Filter [ /ASCII85Decode /DCTDecode ]\n"</span>); -<a name="l00781"></a>00781 <span class="keywordflow">break</span>; -<a name="l00782"></a>00782 <span class="keywordflow">case</span> imagetype_is_png: -<a name="l00783"></a>00783 <span class="keywordflow">if</span> (pImg->iComponents == 3 || pImg->iComponents == 4) { -<a name="l00784"></a>00784 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceRGB\n"</span>); -<a name="l00785"></a>00785 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00786"></a>00786 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pImg->iColorsUsed > 0) { -<a name="l00787"></a>00787 vPrintPalette(pOutFile, pImg); -<a name="l00788"></a>00788 fail(pImg->uiBitsPerComponent > 8); -<a name="l00789"></a>00789 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent %u\n"</span>, -<a name="l00790"></a>00790 pImg->uiBitsPerComponent); -<a name="l00791"></a>00791 } <span class="keywordflow">else</span> { -<a name="l00792"></a>00792 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceGray\n"</span>); -<a name="l00793"></a>00793 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00794"></a>00794 } -<a name="l00795"></a>00795 vFPprintf(pOutFile, -<a name="l00796"></a>00796 <span class="stringliteral">"\t/Filter [ /ASCII85Decode /FlateDecode ]\n"</span>); -<a name="l00797"></a>00797 vFPprintf(pOutFile, <span class="stringliteral">"\t/DecodeParms [ null <<\n"</span>); -<a name="l00798"></a>00798 vFPprintf(pOutFile, <span class="stringliteral">"\t\t/Predictor 10\n"</span>); -<a name="l00799"></a>00799 vFPprintf(pOutFile, <span class="stringliteral">"\t\t/Colors %d\n"</span>, pImg->iComponents); -<a name="l00800"></a>00800 vFPprintf(pOutFile, <span class="stringliteral">"\t\t/BitsPerComponent %u\n"</span>, -<a name="l00801"></a>00801 pImg->uiBitsPerComponent); -<a name="l00802"></a>00802 vFPprintf(pOutFile, <span class="stringliteral">"\t\t/Columns %d\n"</span>, pImg->iWidth); -<a name="l00803"></a>00803 vFPprintf(pOutFile, <span class="stringliteral">"\t\t>> ]\n"</span>); -<a name="l00804"></a>00804 <span class="keywordflow">break</span>; -<a name="l00805"></a>00805 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l00806"></a>00806 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00807"></a>00807 vPrintPalette(pOutFile, pImg); -<a name="l00808"></a>00808 } <span class="keywordflow">else</span> { -<a name="l00809"></a>00809 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /DeviceRGB\n"</span>); -<a name="l00810"></a>00810 } -<a name="l00811"></a>00811 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00812"></a>00812 vFPprintf(pOutFile, <span class="stringliteral">"\t/Filter /ASCII85Decode\n"</span>); -<a name="l00813"></a>00813 <span class="keywordflow">break</span>; -<a name="l00814"></a>00814 <span class="keywordflow">default</span>: -<a name="l00815"></a>00815 vFPprintf(pOutFile, <span class="stringliteral">"\t/ColorSpace /Device%s\n"</span>, -<a name="l00816"></a>00816 pImg->bColorImage ? <span class="stringliteral">"RGB"</span> : <span class="stringliteral">"Gray"</span>); -<a name="l00817"></a>00817 vFPprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00818"></a>00818 vFPprintf(pOutFile, <span class="stringliteral">"\t/Filter /ASCIIHexDecode\n"</span>); -<a name="l00819"></a>00819 <span class="keywordflow">break</span>; -<a name="l00820"></a>00820 } -<a name="l00821"></a>00821 vFPprintf(pOutFile, <span class="stringliteral">"ID\n"</span>); -<a name="l00822"></a>00822 } <span class="comment">/* end of vImageProloguePDF */</span> -<a name="l00823"></a>00823 -<a name="l00824"></a>00824 <span class="comment">/*</span> -<a name="l00825"></a>00825 <span class="comment"> * vImageEpiloguePDF - clean up after the image</span> -<a name="l00826"></a>00826 <span class="comment"> */</span> -<a name="l00827"></a>00827 <span class="keywordtype">void</span> -<a name="l00828"></a>00828 vImageEpiloguePDF(diagram_type *pDiag) -<a name="l00829"></a>00829 { -<a name="l00830"></a>00830 FILE *pOutFile; -<a name="l00831"></a>00831 -<a name="l00832"></a>00832 fail(pDiag == NULL); -<a name="l00833"></a>00833 fail(pDiag->pOutFile == NULL); -<a name="l00834"></a>00834 -<a name="l00835"></a>00835 pOutFile = pDiag->pOutFile; -<a name="l00836"></a>00836 -<a name="l00837"></a>00837 <span class="comment">/* Correction for the image bytes */</span> -<a name="l00838"></a>00838 lFilePosition = ftell(pOutFile); -<a name="l00839"></a>00839 -<a name="l00840"></a>00840 vFPprintf(pOutFile, <span class="stringliteral">"EI\n"</span>); -<a name="l00841"></a>00841 vFPprintf(pOutFile, <span class="stringliteral">"Q\n"</span>); -<a name="l00842"></a>00842 vFPprintf(pOutFile, <span class="stringliteral">"BT\n"</span>); -<a name="l00843"></a>00843 -<a name="l00844"></a>00844 pDiag->lXleft = 0; -<a name="l00845"></a>00845 } <span class="comment">/* end of vImageEpiloguePDF */</span> -<a name="l00846"></a>00846 -<a name="l00847"></a>00847 <span class="comment">/*</span> -<a name="l00848"></a>00848 <span class="comment"> * bAddDummyImagePDF - add a dummy image</span> -<a name="l00849"></a>00849 <span class="comment"> *</span> -<a name="l00850"></a>00850 <span class="comment"> * return TRUE when successful, otherwise FALSE</span> -<a name="l00851"></a>00851 <span class="comment"> */</span> -<a name="l00852"></a>00852 BOOL -<a name="l00853"></a>00853 bAddDummyImagePDF(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00854"></a>00854 { -<a name="l00855"></a>00855 FILE *pOutFile; -<a name="l00856"></a>00856 -<a name="l00857"></a>00857 fail(pDiag == NULL); -<a name="l00858"></a>00858 fail(pDiag->pOutFile == NULL); -<a name="l00859"></a>00859 fail(pImg == NULL); -<a name="l00860"></a>00860 -<a name="l00861"></a>00861 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { -<a name="l00862"></a>00862 <span class="keywordflow">return</span> FALSE; -<a name="l00863"></a>00863 } -<a name="l00864"></a>00864 -<a name="l00865"></a>00865 iImageCount++; -<a name="l00866"></a>00866 -<a name="l00867"></a>00867 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00868"></a>00868 -<a name="l00869"></a>00869 pDiag->lYtop -= lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00870"></a>00870 vMoveTo(pDiag, lPoints2DrawUnits(pImg->iVerSizeScaled)); -<a name="l00871"></a>00871 -<a name="l00872"></a>00872 pOutFile = pDiag->pOutFile; -<a name="l00873"></a>00873 -<a name="l00874"></a>00874 vFPprintf(pOutFile, <span class="stringliteral">"ET\n"</span>); -<a name="l00875"></a>00875 vFPprintf(pOutFile, <span class="stringliteral">"q %% Image %03d\n"</span>, iImageCount); -<a name="l00876"></a>00876 vFPprintf(pOutFile, <span class="stringliteral">"\t1.0 w\n"</span>); -<a name="l00877"></a>00877 vFPprintf(pOutFile, <span class="stringliteral">"\t0.3 G\n"</span>); -<a name="l00878"></a>00878 vFPprintf(pOutFile, <span class="stringliteral">"\t%.2f %.2f %d %d re\n"</span>, -<a name="l00879"></a>00879 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00880"></a>00880 dDrawUnits2Points(pDiag->lYtop), -<a name="l00881"></a>00881 pImg->iHorSizeScaled, -<a name="l00882"></a>00882 pImg->iVerSizeScaled); -<a name="l00883"></a>00883 vFPprintf(pOutFile, <span class="stringliteral">"\tS\n"</span>); -<a name="l00884"></a>00884 vFPprintf(pOutFile, <span class="stringliteral">"Q\n"</span>); -<a name="l00885"></a>00885 vFPprintf(pOutFile, <span class="stringliteral">"BT\n"</span>); -<a name="l00886"></a>00886 -<a name="l00887"></a>00887 pDiag->lXleft = 0; -<a name="l00888"></a>00888 -<a name="l00889"></a>00889 <span class="keywordflow">return</span> TRUE; -<a name="l00890"></a>00890 } <span class="comment">/* end of bAddDummyImagePDF */</span> -<a name="l00891"></a>00891 -<a name="l00892"></a>00892 <span class="comment">/*</span> -<a name="l00893"></a>00893 <span class="comment"> * vAddFontsPDF - add the font information</span> -<a name="l00894"></a>00894 <span class="comment"> */</span> -<a name="l00895"></a>00895 <span class="keywordtype">void</span> -<a name="l00896"></a>00896 vAddFontsPDF(diagram_type *pDiag) -<a name="l00897"></a>00897 { -<a name="l00898"></a>00898 FILE *pOutFile; -<a name="l00899"></a>00899 <span class="keywordtype">size_t</span> tIndex; -<a name="l00900"></a>00900 -<a name="l00901"></a>00901 fail(pDiag == NULL); -<a name="l00902"></a>00902 fail(pDiag->pOutFile == NULL); -<a name="l00903"></a>00903 -<a name="l00904"></a>00904 pOutFile = pDiag->pOutFile; -<a name="l00905"></a>00905 -<a name="l00906"></a>00906 <span class="comment">/* The font encoding */</span> -<a name="l00907"></a>00907 vSetLocation(4); -<a name="l00908"></a>00908 vFPprintf(pOutFile, <span class="stringliteral">"4 0 obj\n"</span>); -<a name="l00909"></a>00909 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00910"></a>00910 vFPprintf(pOutFile, <span class="stringliteral">"/Type /Encoding\n"</span>); -<a name="l00911"></a>00911 vFPprintf(pOutFile, <span class="stringliteral">"/BaseEncoding /StandardEncoding\n"</span>); -<a name="l00912"></a>00912 vFPprintf(pOutFile, <span class="stringliteral">"/Differences [\n"</span>); -<a name="l00913"></a>00913 <span class="keywordflow">switch</span> (eEncoding) { -<a name="l00914"></a>00914 <span class="keywordflow">case</span> encoding_latin_1: -<a name="l00915"></a>00915 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00916"></a>00916 tIndex < elementsof(iso_8859_1); -<a name="l00917"></a>00917 tIndex++) { -<a name="l00918"></a>00918 vFPprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_1[tIndex]); -<a name="l00919"></a>00919 } -<a name="l00920"></a>00920 <span class="keywordflow">break</span>; -<a name="l00921"></a>00921 <span class="keywordflow">case</span> encoding_latin_2: -<a name="l00922"></a>00922 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00923"></a>00923 tIndex < elementsof(iso_8859_2); -<a name="l00924"></a>00924 tIndex++) { -<a name="l00925"></a>00925 vFPprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_2[tIndex]); -<a name="l00926"></a>00926 } -<a name="l00927"></a>00927 <span class="keywordflow">break</span>; -<a name="l00928"></a>00928 <span class="keywordflow">case</span> encoding_cyrillic: -<a name="l00929"></a>00929 werr(1, -<a name="l00930"></a>00930 <span class="stringliteral">"The combination PDF and Cyrillic is not supported"</span>); -<a name="l00931"></a>00931 <span class="keywordflow">break</span>; -<a name="l00932"></a>00932 <span class="keywordflow">case</span> encoding_utf_8: -<a name="l00933"></a>00933 werr(1, -<a name="l00934"></a>00934 <span class="stringliteral">"The combination PDF and UTF-8 is not supported"</span>); -<a name="l00935"></a>00935 <span class="keywordflow">break</span>; -<a name="l00936"></a>00936 <span class="keywordflow">default</span>: -<a name="l00937"></a>00937 DBG_DEC(eEncoding); -<a name="l00938"></a>00938 <span class="keywordflow">break</span>; -<a name="l00939"></a>00939 } -<a name="l00940"></a>00940 vFPprintf(pOutFile, <span class="stringliteral">"]\n"</span>); -<a name="l00941"></a>00941 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00942"></a>00942 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00943"></a>00943 -<a name="l00944"></a>00944 <span class="comment">/* Twelve of the standard type 1 fonts */</span> -<a name="l00945"></a>00945 <span class="keywordflow">for</span> (tIndex = 0; tIndex < 12; tIndex++) { -<a name="l00946"></a>00946 vSetLocation(5 + tIndex); -<a name="l00947"></a>00947 vFPprintf(pOutFile, <span class="stringliteral">"%u 0 obj\n"</span>, 5 + tIndex); -<a name="l00948"></a>00948 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00949"></a>00949 vFPprintf(pOutFile, <span class="stringliteral">"/Type /Font\n"</span>); -<a name="l00950"></a>00950 vFPprintf(pOutFile, <span class="stringliteral">"/Subtype /Type1\n"</span>); -<a name="l00951"></a>00951 vFPprintf(pOutFile, <span class="stringliteral">"/Name /F%u\n"</span>, 1 + tIndex); -<a name="l00952"></a>00952 vFPprintf(pOutFile, <span class="stringliteral">"/BaseFont /%s\n"</span>, -<a name="l00953"></a>00953 atFontname[tIndex].szPDFname); -<a name="l00954"></a>00954 vFPprintf(pOutFile, <span class="stringliteral">"/Encoding 4 0 R\n"</span>); -<a name="l00955"></a>00955 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00956"></a>00956 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00957"></a>00957 } -<a name="l00958"></a>00958 -<a name="l00959"></a>00959 <span class="comment">/* The Resources */</span> -<a name="l00960"></a>00960 vSetLocation(17); -<a name="l00961"></a>00961 vFPprintf(pOutFile, <span class="stringliteral">"17 0 obj\n"</span>); -<a name="l00962"></a>00962 vFPprintf(pOutFile, <span class="stringliteral">"<<\n"</span>); -<a name="l00963"></a>00963 vFPprintf(pOutFile, <span class="stringliteral">"/ProcSet [ /PDF /Text ]\n"</span>); -<a name="l00964"></a>00964 vFPprintf(pOutFile, <span class="stringliteral">"/Font <<\n"</span>); -<a name="l00965"></a>00965 <span class="keywordflow">for</span> (tIndex = 0; tIndex < 12; tIndex++) { -<a name="l00966"></a>00966 vFPprintf(pOutFile, <span class="stringliteral">"\t/F%u %u 0 R\n"</span>, 1 + tIndex, 5 + tIndex); -<a name="l00967"></a>00967 } -<a name="l00968"></a>00968 vFPprintf(pOutFile, <span class="stringliteral">"\t>>\n"</span>); -<a name="l00969"></a>00969 vFPprintf(pOutFile, <span class="stringliteral">">>\n"</span>); -<a name="l00970"></a>00970 vFPprintf(pOutFile, <span class="stringliteral">"endobj\n"</span>); -<a name="l00971"></a>00971 vAddHeader(pDiag); -<a name="l00972"></a>00972 } <span class="comment">/* end of vAddFontsPDF */</span> -<a name="l00973"></a>00973 -<a name="l00974"></a>00974 <span class="comment">/*</span> -<a name="l00975"></a>00975 <span class="comment"> * vPrintPDF - print a PDF string</span> -<a name="l00976"></a>00976 <span class="comment"> */</span> -<a name="l00977"></a>00977 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00978"></a>00978 vPrintPDF(FILE *pFile, <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, -<a name="l00979"></a>00979 USHORT usFontstyle) -<a name="l00980"></a>00980 { -<a name="l00981"></a>00981 <span class="keyword">const</span> UCHAR *aucBytes; -<a name="l00982"></a>00982 <span class="keywordtype">double</span> dMove; -<a name="l00983"></a>00983 <span class="keywordtype">size_t</span> tCount; -<a name="l00984"></a>00984 -<a name="l00985"></a>00985 fail(szString == NULL); -<a name="l00986"></a>00986 -<a name="l00987"></a>00987 <span class="keywordflow">if</span> (szString == NULL || szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00988"></a>00988 <span class="keywordflow">return</span>; -<a name="l00989"></a>00989 } -<a name="l00990"></a>00990 DBG_DEC_C(usFontSizeCurr < MIN_FONT_SIZE, usFontSizeCurr); -<a name="l00991"></a>00991 -<a name="l00992"></a>00992 dMove = 0.0; -<a name="l00993"></a>00993 -<a name="l00994"></a>00994 <span class="comment">/* Up for superscript */</span> -<a name="l00995"></a>00995 <span class="keywordflow">if</span> (bIsSuperscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l00996"></a>00996 dMove = (double)((usFontSizeCurr + 1) / 2) * 0.375; -<a name="l00997"></a>00997 vFPprintf(pFile, <span class="stringliteral">"%.2f Ts\n"</span>, dMove); -<a name="l00998"></a>00998 } -<a name="l00999"></a>00999 -<a name="l01000"></a>01000 <span class="comment">/* Down for subscript */</span> -<a name="l01001"></a>01001 <span class="keywordflow">if</span> (bIsSubscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01002"></a>01002 dMove = (double)usFontSizeCurr * 0.125; -<a name="l01003"></a>01003 vFPprintf(pFile, <span class="stringliteral">"%.2f Ts\n"</span>, -dMove); -<a name="l01004"></a>01004 } -<a name="l01005"></a>01005 -<a name="l01006"></a>01006 <span class="comment">/* Generate and print the PDF output */</span> -<a name="l01007"></a>01007 aucBytes = (UCHAR *)szString; -<a name="l01008"></a>01008 vFPprintf(pFile, <span class="stringliteral">"("</span>); -<a name="l01009"></a>01009 <span class="keywordflow">for</span> (tCount = 0; tCount < tStringLength ; tCount++) { -<a name="l01010"></a>01010 <span class="keywordflow">switch</span> (aucBytes[tCount]) { -<a name="l01011"></a>01011 <span class="keywordflow">case</span> <span class="charliteral">'('</span>: -<a name="l01012"></a>01012 <span class="keywordflow">case</span> <span class="charliteral">')'</span>: -<a name="l01013"></a>01013 <span class="keywordflow">case</span> <span class="charliteral">'\\'</span>: -<a name="l01014"></a>01014 vFPprintf(pFile, <span class="stringliteral">"\\%c"</span>, szString[tCount]); -<a name="l01015"></a>01015 <span class="keywordflow">break</span>; -<a name="l01016"></a>01016 <span class="keywordflow">default</span>: -<a name="l01017"></a>01017 <span class="keywordflow">if</span> (aucBytes[tCount] < 0x20 || -<a name="l01018"></a>01018 aucBytes[tCount] == 0x7f || -<a name="l01019"></a>01019 (aucBytes[tCount] >= 0x81 && -<a name="l01020"></a>01020 aucBytes[tCount] < 0x8c)) { -<a name="l01021"></a>01021 DBG_HEX(aucBytes[tCount]); -<a name="l01022"></a>01022 vFPprintf(pFile, <span class="stringliteral">" "</span>); -<a name="l01023"></a>01023 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aucBytes[tCount] >= 0x80) { -<a name="l01024"></a>01024 vFPprintf(pFile, <span class="stringliteral">"\\%03o"</span>, -<a name="l01025"></a>01025 (UINT)aucBytes[tCount]); -<a name="l01026"></a>01026 } <span class="keywordflow">else</span> { -<a name="l01027"></a>01027 vFPprintf(pFile, <span class="stringliteral">"%c"</span>, szString[tCount]); -<a name="l01028"></a>01028 } -<a name="l01029"></a>01029 <span class="keywordflow">break</span>; -<a name="l01030"></a>01030 } -<a name="l01031"></a>01031 } -<a name="l01032"></a>01032 vFPprintf(pFile, <span class="stringliteral">") Tj\n"</span>); -<a name="l01033"></a>01033 -<a name="l01034"></a>01034 <span class="comment">/* Undo the superscript/subscript move */</span> -<a name="l01035"></a>01035 <span class="keywordflow">if</span> (dMove != 0.0) { -<a name="l01036"></a>01036 vFPprintf(pFile, <span class="stringliteral">"0 Ts\n"</span>); -<a name="l01037"></a>01037 } -<a name="l01038"></a>01038 } <span class="comment">/* end of vPrintPDF */</span> -<a name="l01039"></a>01039 -<a name="l01040"></a>01040 <span class="comment">/*</span> -<a name="l01041"></a>01041 <span class="comment"> * vSetColor - move to the specified color</span> -<a name="l01042"></a>01042 <span class="comment"> */</span> -<a name="l01043"></a>01043 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l01044"></a>01044 vSetColor(FILE *pFile, UCHAR ucFontColor) -<a name="l01045"></a>01045 { -<a name="l01046"></a>01046 ULONG ulTmp, ulRed, ulGreen, ulBlue; -<a name="l01047"></a>01047 -<a name="l01048"></a>01048 ulTmp = ulColor2Color(ucFontColor); -<a name="l01049"></a>01049 ulRed = (ulTmp & 0x0000ff00) >> 8; -<a name="l01050"></a>01050 ulGreen = (ulTmp & 0x00ff0000) >> 16; -<a name="l01051"></a>01051 ulBlue = (ulTmp & 0xff000000) >> 24; -<a name="l01052"></a>01052 vFPprintf(pFile, <span class="stringliteral">"%.3f %.3f %.3f rg\n"</span>, -<a name="l01053"></a>01053 ulRed / 255.0, ulGreen / 255.0, ulBlue / 255.0); -<a name="l01054"></a>01054 } <span class="comment">/* end of vSetColor */</span> -<a name="l01055"></a>01055 -<a name="l01056"></a>01056 <span class="comment">/*</span> -<a name="l01057"></a>01057 <span class="comment"> * vMove2NextLinePDF - move to the next line</span> -<a name="l01058"></a>01058 <span class="comment"> */</span> -<a name="l01059"></a>01059 <span class="keywordtype">void</span> -<a name="l01060"></a>01060 vMove2NextLinePDF(diagram_type *pDiag, USHORT usFontSize) -<a name="l01061"></a>01061 { -<a name="l01062"></a>01062 fail(pDiag == NULL); -<a name="l01063"></a>01063 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01064"></a>01064 -<a name="l01065"></a>01065 pDiag->lYtop -= lComputeLeading(usFontSize); -<a name="l01066"></a>01066 } <span class="comment">/* end of vMove2NextLinePDF */</span> -<a name="l01067"></a>01067 -<a name="l01068"></a>01068 <span class="comment">/*</span> -<a name="l01069"></a>01069 <span class="comment"> * vSubstringPDF - print a sub string</span> -<a name="l01070"></a>01070 <span class="comment"> */</span> -<a name="l01071"></a>01071 <span class="keywordtype">void</span> -<a name="l01072"></a>01072 vSubstringPDF(diagram_type *pDiag, -<a name="l01073"></a>01073 <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l01074"></a>01074 UCHAR ucFontColor, USHORT usFontstyle, drawfile_fontref tFontRef, -<a name="l01075"></a>01075 USHORT usFontSize, USHORT usMaxFontSize) -<a name="l01076"></a>01076 { -<a name="l01077"></a>01077 <span class="keywordtype">size_t</span> tFontIndex; -<a name="l01078"></a>01078 -<a name="l01079"></a>01079 fail(pDiag == NULL || szString == NULL); -<a name="l01080"></a>01080 fail(pDiag->pOutFile == NULL); -<a name="l01081"></a>01081 fail(pDiag->lXleft < 0); -<a name="l01082"></a>01082 fail(tStringLength != strlen(szString)); -<a name="l01083"></a>01083 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01084"></a>01084 fail(usMaxFontSize < MIN_FONT_SIZE || usMaxFontSize > MAX_FONT_SIZE); -<a name="l01085"></a>01085 fail(usFontSize > usMaxFontSize); -<a name="l01086"></a>01086 -<a name="l01087"></a>01087 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l01088"></a>01088 <span class="keywordflow">return</span>; -<a name="l01089"></a>01089 } -<a name="l01090"></a>01090 -<a name="l01091"></a>01091 vMoveTo(pDiag, lComputeLeading(usMaxFontSize)); -<a name="l01092"></a>01092 <span class="keywordflow">if</span> (tFontRef != tFontRefCurr || usFontSize != usFontSizeCurr) { -<a name="l01093"></a>01093 tFontIndex = tGetFontIndex(tFontRef); -<a name="l01094"></a>01094 vFPprintf(pDiag->pOutFile, <span class="stringliteral">"/F%u %.1f Tf\n"</span>, -<a name="l01095"></a>01095 1 + tFontIndex, (<span class="keywordtype">double</span>)usFontSize / 2.0); -<a name="l01096"></a>01096 tFontRefCurr = tFontRef; -<a name="l01097"></a>01097 usFontSizeCurr = usFontSize; -<a name="l01098"></a>01098 } -<a name="l01099"></a>01099 <span class="keywordflow">if</span> ((<span class="keywordtype">int</span>)ucFontColor != iFontColorCurr) { -<a name="l01100"></a>01100 vSetColor(pDiag->pOutFile, ucFontColor); -<a name="l01101"></a>01101 iFontColorCurr = (int)ucFontColor; -<a name="l01102"></a>01102 } -<a name="l01103"></a>01103 vPrintPDF(pDiag->pOutFile, szString, tStringLength, usFontstyle); -<a name="l01104"></a>01104 pDiag->lXleft += lStringWidth; -<a name="l01105"></a>01105 } <span class="comment">/* end of vSubstringPDF */</span> -<a name="l01106"></a>01106 -<a name="l01107"></a>01107 <span class="comment">/*</span> -<a name="l01108"></a>01108 <span class="comment"> * Create an start of paragraph by moving the y-top mark</span> -<a name="l01109"></a>01109 <span class="comment"> */</span> -<a name="l01110"></a>01110 <span class="keywordtype">void</span> -<a name="l01111"></a>01111 vStartOfParagraphPDF(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) -<a name="l01112"></a>01112 { -<a name="l01113"></a>01113 fail(pDiag == NULL); -<a name="l01114"></a>01114 fail(lBeforeIndentation < 0); -<a name="l01115"></a>01115 -<a name="l01116"></a>01116 pDiag->lXleft = 0; -<a name="l01117"></a>01117 pDiag->lYtop -= lMilliPoints2DrawUnits(lBeforeIndentation); -<a name="l01118"></a>01118 } <span class="comment">/* end of vStartOfParagraphPDF */</span> -<a name="l01119"></a>01119 -<a name="l01120"></a>01120 <span class="comment">/*</span> -<a name="l01121"></a>01121 <span class="comment"> * Create an end of paragraph by moving the y-top mark</span> -<a name="l01122"></a>01122 <span class="comment"> */</span> -<a name="l01123"></a>01123 <span class="keywordtype">void</span> -<a name="l01124"></a>01124 vEndOfParagraphPDF(diagram_type *pDiag, -<a name="l01125"></a>01125 USHORT usFontSize, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l01126"></a>01126 { -<a name="l01127"></a>01127 fail(pDiag == NULL); -<a name="l01128"></a>01128 fail(pDiag->pOutFile == NULL); -<a name="l01129"></a>01129 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01130"></a>01130 fail(lAfterIndentation < 0); -<a name="l01131"></a>01131 -<a name="l01132"></a>01132 <span class="keywordflow">if</span> (pDiag->lXleft > 0) { -<a name="l01133"></a>01133 <span class="comment">/* To the start of the line */</span> -<a name="l01134"></a>01134 vMove2NextLinePDF(pDiag, usFontSize); -<a name="l01135"></a>01135 } -<a name="l01136"></a>01136 -<a name="l01137"></a>01137 pDiag->lXleft = 0; -<a name="l01138"></a>01138 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); -<a name="l01139"></a>01139 } <span class="comment">/* end of vEndOfParagraphPDF */</span> -<a name="l01140"></a>01140 -<a name="l01141"></a>01141 <span class="comment">/*</span> -<a name="l01142"></a>01142 <span class="comment"> * Create an end of page</span> -<a name="l01143"></a>01143 <span class="comment"> */</span> -<a name="l01144"></a>01144 <span class="keywordtype">void</span> -<a name="l01145"></a>01145 vEndOfPagePDF(diagram_type *pDiag, BOOL bNewSection) -<a name="l01146"></a>01146 { -<a name="l01147"></a>01147 vMove2NextPage(pDiag, bNewSection); -<a name="l01148"></a>01148 } <span class="comment">/* end of vEndOfPagePDF */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/pictlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/pictlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/pictlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * pictlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word picture information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/*</span> -<a name="l00014"></a>00014 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00015"></a>00015 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">typedef</span> <span class="keyword">struct </span>picture_mem_tag { -<a name="l00018"></a>00018 picture_block_type tInfo; -<a name="l00019"></a>00019 <span class="keyword">struct </span>picture_mem_tag *pNext; -<a name="l00020"></a>00020 } picture_mem_type; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* Variables needed to write the Picture Information List */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> picture_mem_type *pAnchor = NULL; -<a name="l00024"></a>00024 <span class="keyword">static</span> picture_mem_type *pPictureLast = NULL; -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 -<a name="l00027"></a>00027 <span class="comment">/*</span> -<a name="l00028"></a>00028 <span class="comment"> * vDestroyPictInfoList - destroy the Picture Information List</span> -<a name="l00029"></a>00029 <span class="comment"> */</span> -<a name="l00030"></a>00030 <span class="keywordtype">void</span> -<a name="l00031"></a>00031 vDestroyPictInfoList(<span class="keywordtype">void</span>) -<a name="l00032"></a>00032 { -<a name="l00033"></a>00033 picture_mem_type *pCurr, *pNext; -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 DBG_MSG(<span class="stringliteral">"vDestroyPictInfoList"</span>); -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="comment">/* Free the Picture Information List */</span> -<a name="l00038"></a>00038 pCurr = pAnchor; -<a name="l00039"></a>00039 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00040"></a>00040 pNext = pCurr->pNext; -<a name="l00041"></a>00041 pCurr = xfree(pCurr); -<a name="l00042"></a>00042 pCurr = pNext; -<a name="l00043"></a>00043 } -<a name="l00044"></a>00044 pAnchor = NULL; -<a name="l00045"></a>00045 <span class="comment">/* Reset all control variables */</span> -<a name="l00046"></a>00046 pPictureLast = NULL; -<a name="l00047"></a>00047 } <span class="comment">/* end of vDestroyPictInfoList */</span> -<a name="l00048"></a>00048 -<a name="l00049"></a>00049 <span class="comment">/*</span> -<a name="l00050"></a>00050 <span class="comment"> * vAdd2PictInfoList - Add an element to the Picture Information List</span> -<a name="l00051"></a>00051 <span class="comment"> */</span> -<a name="l00052"></a>00052 <span class="keywordtype">void</span> -<a name="l00053"></a>00053 vAdd2PictInfoList(<span class="keyword">const</span> picture_block_type *pPictureBlock) -<a name="l00054"></a>00054 { -<a name="l00055"></a>00055 picture_mem_type *pListMember; -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 fail(pPictureBlock == NULL); -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 NO_DBG_MSG(<span class="stringliteral">"bAdd2PictInfoList"</span>); -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 <span class="keywordflow">if</span> (pPictureBlock->ulFileOffset == FC_INVALID) { -<a name="l00062"></a>00062 <span class="comment">/*</span> -<a name="l00063"></a>00063 <span class="comment"> * This offset is really past the end of the file,</span> -<a name="l00064"></a>00064 <span class="comment"> * so don't waste any memory by storing it.</span> -<a name="l00065"></a>00065 <span class="comment"> */</span> -<a name="l00066"></a>00066 <span class="keywordflow">return</span>; -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 <span class="keywordflow">if</span> (pPictureBlock->ulFileOffsetPicture == FC_INVALID) { -<a name="l00069"></a>00069 <span class="comment">/*</span> -<a name="l00070"></a>00070 <span class="comment"> * The place where this picture is supposed to be stored</span> -<a name="l00071"></a>00071 <span class="comment"> * doesn't exist.</span> -<a name="l00072"></a>00072 <span class="comment"> */</span> -<a name="l00073"></a>00073 <span class="keywordflow">return</span>; -<a name="l00074"></a>00074 } -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 NO_DBG_HEX(pPictureBlock->ulFileOffset); -<a name="l00077"></a>00077 NO_DBG_HEX(pPictureBlock->ulFileOffsetPicture); -<a name="l00078"></a>00078 NO_DBG_HEX(pPictureBlock->ulPictureOffset); -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 <span class="comment">/* Create list member */</span> -<a name="l00081"></a>00081 pListMember = xmalloc(<span class="keyword">sizeof</span>(picture_mem_type)); -<a name="l00082"></a>00082 <span class="comment">/* Fill the list member */</span> -<a name="l00083"></a>00083 pListMember->tInfo = *pPictureBlock; -<a name="l00084"></a>00084 pListMember->pNext = NULL; -<a name="l00085"></a>00085 <span class="comment">/* Add the new member to the list */</span> -<a name="l00086"></a>00086 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00087"></a>00087 pAnchor = pListMember; -<a name="l00088"></a>00088 } <span class="keywordflow">else</span> { -<a name="l00089"></a>00089 fail(pPictureLast == NULL); -<a name="l00090"></a>00090 pPictureLast->pNext = pListMember; -<a name="l00091"></a>00091 } -<a name="l00092"></a>00092 pPictureLast = pListMember; -<a name="l00093"></a>00093 } <span class="comment">/* end of vAdd2PictInfoList */</span> -<a name="l00094"></a>00094 -<a name="l00095"></a>00095 <span class="comment">/*</span> -<a name="l00096"></a>00096 <span class="comment"> * Get the info with the given file offset from the Picture Information List</span> -<a name="l00097"></a>00097 <span class="comment"> */</span> -<a name="l00098"></a>00098 ULONG -<a name="l00099"></a>00099 ulGetPictInfoListItem(ULONG ulFileOffset) -<a name="l00100"></a>00100 { -<a name="l00101"></a>00101 picture_mem_type *pCurr; -<a name="l00102"></a>00102 -<a name="l00103"></a>00103 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00104"></a>00104 <span class="keywordflow">if</span> (pCurr->tInfo.ulFileOffset == ulFileOffset) { -<a name="l00105"></a>00105 <span class="keywordflow">return</span> pCurr->tInfo.ulFileOffsetPicture; -<a name="l00106"></a>00106 } -<a name="l00107"></a>00107 } -<a name="l00108"></a>00108 <span class="keywordflow">return</span> FC_INVALID; -<a name="l00109"></a>00109 } <span class="comment">/* end of ulGetPictInfoListItem */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/png2eps_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/png2eps.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/png2eps.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * png2eps.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000-2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate png images into eps</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdio.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <ctype.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">int</span> iPicCounter = 0; -<a name="l00016"></a>00016 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 <span class="comment">/*</span> -<a name="l00020"></a>00020 <span class="comment"> * tSkipToData - skip until a IDAT chunk is found</span> -<a name="l00021"></a>00021 <span class="comment"> *</span> -<a name="l00022"></a>00022 <span class="comment"> * returns the length of the pixeldata or -1 in case of error</span> -<a name="l00023"></a>00023 <span class="comment"> */</span> -<a name="l00024"></a>00024 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00025"></a>00025 tSkipToData(FILE *pFile, <span class="keywordtype">size_t</span> tMaxBytes, <span class="keywordtype">size_t</span> *ptSkipped) -<a name="l00026"></a>00026 { -<a name="l00027"></a>00027 ULONG ulName, ulTmp; -<a name="l00028"></a>00028 <span class="keywordtype">size_t</span> tDataLength, tToSkip; -<a name="l00029"></a>00029 <span class="keywordtype">int</span> iCounter; -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 fail(pFile == NULL); -<a name="l00032"></a>00032 fail(ptSkipped == NULL); -<a name="l00033"></a>00033 -<a name="l00034"></a>00034 <span class="comment">/* Examine chunks */</span> -<a name="l00035"></a>00035 <span class="keywordflow">while</span> (*ptSkipped + 8 < tMaxBytes) { -<a name="l00036"></a>00036 tDataLength = (size_t)ulNextLongBE(pFile); -<a name="l00037"></a>00037 DBG_DEC(tDataLength); -<a name="l00038"></a>00038 *ptSkipped += 4; -<a name="l00039"></a>00039 -<a name="l00040"></a>00040 ulName = 0x00; -<a name="l00041"></a>00041 <span class="keywordflow">for</span> (iCounter = 0; iCounter < 4; iCounter++) { -<a name="l00042"></a>00042 ulTmp = (ULONG)iNextByte(pFile); -<a name="l00043"></a>00043 <span class="keywordflow">if</span> (!isalpha((<span class="keywordtype">int</span>)ulTmp)) { -<a name="l00044"></a>00044 DBG_HEX(ulTmp); -<a name="l00045"></a>00045 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00046"></a>00046 } -<a name="l00047"></a>00047 ulName <<= 8; -<a name="l00048"></a>00048 ulName |= ulTmp; -<a name="l00049"></a>00049 } -<a name="l00050"></a>00050 DBG_HEX(ulName); -<a name="l00051"></a>00051 *ptSkipped += 4; -<a name="l00052"></a>00052 -<a name="l00053"></a>00053 <span class="keywordflow">if</span> (ulName == PNG_CN_IEND) { -<a name="l00054"></a>00054 <span class="keywordflow">break</span>; -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 <span class="keywordflow">if</span> (ulName == PNG_CN_IDAT) { -<a name="l00057"></a>00057 <span class="keywordflow">return</span> tDataLength; -<a name="l00058"></a>00058 } -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 tToSkip = tDataLength + 4; -<a name="l00061"></a>00061 <span class="keywordflow">if</span> (tToSkip >= tMaxBytes - *ptSkipped) { -<a name="l00062"></a>00062 DBG_DEC(tToSkip); -<a name="l00063"></a>00063 DBG_DEC(tMaxBytes - *ptSkipped); -<a name="l00064"></a>00064 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 (void)tSkipBytes(pFile, tToSkip); -<a name="l00067"></a>00067 *ptSkipped += tToSkip; -<a name="l00068"></a>00068 } -<a name="l00069"></a>00069 -<a name="l00070"></a>00070 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00071"></a>00071 } <span class="comment">/* end of iSkipToData */</span> -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="comment">/*</span> -<a name="l00074"></a>00074 <span class="comment"> * iFindFirstPixelData - find the first pixeldata if a PNG image</span> -<a name="l00075"></a>00075 <span class="comment"> *</span> -<a name="l00076"></a>00076 <span class="comment"> * returns the length of the pixeldata or -1 in case of error</span> -<a name="l00077"></a>00077 <span class="comment"> */</span> -<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00079"></a>00079 tFindFirstPixelData(FILE *pFile, <span class="keywordtype">size_t</span> tMaxBytes, <span class="keywordtype">size_t</span> *ptSkipped) -<a name="l00080"></a>00080 { -<a name="l00081"></a>00081 fail(pFile == NULL); -<a name="l00082"></a>00082 fail(tMaxBytes == 0); -<a name="l00083"></a>00083 fail(ptSkipped == NULL); -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 <span class="keywordflow">if</span> (tMaxBytes < 8) { -<a name="l00086"></a>00086 DBG_DEC(tMaxBytes); -<a name="l00087"></a>00087 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 -<a name="l00090"></a>00090 <span class="comment">/* Skip over the PNG signature */</span> -<a name="l00091"></a>00091 (void)tSkipBytes(pFile, 8); -<a name="l00092"></a>00092 *ptSkipped = 8; -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 <span class="keywordflow">return</span> tSkipToData(pFile, tMaxBytes, ptSkipped); -<a name="l00095"></a>00095 } <span class="comment">/* end of iFindFirstPixelData */</span> -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 <span class="comment">/*</span> -<a name="l00098"></a>00098 <span class="comment"> * tFindNextPixelData - find the next pixeldata if a PNG image</span> -<a name="l00099"></a>00099 <span class="comment"> *</span> -<a name="l00100"></a>00100 <span class="comment"> * returns the length of the pixeldata or -1 in case of error</span> -<a name="l00101"></a>00101 <span class="comment"> */</span> -<a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00103"></a>00103 tFindNextPixelData(FILE *pFile, <span class="keywordtype">size_t</span> tMaxBytes, <span class="keywordtype">size_t</span> *ptSkipped) -<a name="l00104"></a>00104 { -<a name="l00105"></a>00105 fail(pFile == NULL); -<a name="l00106"></a>00106 fail(tMaxBytes == 0); -<a name="l00107"></a>00107 fail(ptSkipped == NULL); -<a name="l00108"></a>00108 -<a name="l00109"></a>00109 <span class="keywordflow">if</span> (tMaxBytes < 4) { -<a name="l00110"></a>00110 DBG_DEC(tMaxBytes); -<a name="l00111"></a>00111 <span class="keywordflow">return</span> (<span class="keywordtype">size_t</span>)-1; -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 <span class="comment">/* Skip over the crc */</span> -<a name="l00115"></a>00115 (void)tSkipBytes(pFile, 4); -<a name="l00116"></a>00116 *ptSkipped = 4; -<a name="l00117"></a>00117 -<a name="l00118"></a>00118 <span class="keywordflow">return</span> tSkipToData(pFile, tMaxBytes, ptSkipped); -<a name="l00119"></a>00119 } <span class="comment">/* end of tFindNextPixelData */</span> -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00123"></a>00123 <span class="comment"> * vCopy2File</span> -<a name="l00124"></a>00124 <span class="comment"> */</span> -<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00126"></a>00126 vCopy2File(FILE *pFile, ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen) -<a name="l00127"></a>00127 { -<a name="l00128"></a>00128 FILE *pOutFile; -<a name="l00129"></a>00129 <span class="keywordtype">size_t</span> tIndex; -<a name="l00130"></a>00130 <span class="keywordtype">int</span> iTmp; -<a name="l00131"></a>00131 <span class="keywordtype">char</span> szFilename[30]; -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00134"></a>00134 <span class="keywordflow">return</span>; -<a name="l00135"></a>00135 } -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 sprintf(szFilename, <span class="stringliteral">"/tmp/pic/pic%04d.png"</span>, ++iPicCounter); -<a name="l00138"></a>00138 pOutFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00139"></a>00139 <span class="keywordflow">if</span> (pOutFile == NULL) { -<a name="l00140"></a>00140 <span class="keywordflow">return</span>; -<a name="l00141"></a>00141 } -<a name="l00142"></a>00142 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tPictureLen; tIndex++) { -<a name="l00143"></a>00143 iTmp = iNextByte(pFile); -<a name="l00144"></a>00144 <span class="keywordflow">if</span> (putc(iTmp, pOutFile) == EOF) { -<a name="l00145"></a>00145 <span class="keywordflow">break</span>; -<a name="l00146"></a>00146 } -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 (void)fclose(pOutFile); -<a name="l00149"></a>00149 } <span class="comment">/* end of vCopy2File */</span> -<a name="l00150"></a>00150 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 <span class="comment">/*</span> -<a name="l00153"></a>00153 <span class="comment"> * bTranslatePNG - translate a PNG image</span> -<a name="l00154"></a>00154 <span class="comment"> *</span> -<a name="l00155"></a>00155 <span class="comment"> * This function translates an image from png to eps</span> -<a name="l00156"></a>00156 <span class="comment"> *</span> -<a name="l00157"></a>00157 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00158"></a>00158 <span class="comment"> */</span> -<a name="l00159"></a>00159 BOOL -<a name="l00160"></a>00160 bTranslatePNG(diagram_type *pDiag, FILE *pFile, -<a name="l00161"></a>00161 ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00162"></a>00162 { -<a name="l00163"></a>00163 <span class="keywordtype">size_t</span> tMaxBytes, tDataLength, tSkipped; -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00166"></a>00166 <span class="preprocessor"></span> vCopy2File(pFile, ulFileOffset, tPictureLen); -<a name="l00167"></a>00167 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="comment">/* Seek to start position of PNG data */</span> -<a name="l00170"></a>00170 <span class="keywordflow">if</span> (!bSetDataOffset(pFile, ulFileOffset)) { -<a name="l00171"></a>00171 <span class="keywordflow">return</span> FALSE; -<a name="l00172"></a>00172 } -<a name="l00173"></a>00173 -<a name="l00174"></a>00174 tMaxBytes = tPictureLen; -<a name="l00175"></a>00175 tDataLength = tFindFirstPixelData(pFile, tMaxBytes, &tSkipped); -<a name="l00176"></a>00176 <span class="keywordflow">if</span> (tDataLength == (<span class="keywordtype">size_t</span>)-1) { -<a name="l00177"></a>00177 <span class="keywordflow">return</span> FALSE; -<a name="l00178"></a>00178 } -<a name="l00179"></a>00179 -<a name="l00180"></a>00180 vImagePrologue(pDiag, pImg); -<a name="l00181"></a>00181 <span class="keywordflow">do</span> { -<a name="l00182"></a>00182 tMaxBytes -= tSkipped; -<a name="l00183"></a>00183 vASCII85EncodeArray(pFile, pDiag->pOutFile, tDataLength); -<a name="l00184"></a>00184 tMaxBytes -= tDataLength; -<a name="l00185"></a>00185 tDataLength = tFindNextPixelData(pFile, tMaxBytes, &tSkipped); -<a name="l00186"></a>00186 } <span class="keywordflow">while</span> (tDataLength != (<span class="keywordtype">size_t</span>)-1); -<a name="l00187"></a>00187 vASCII85EncodeByte(pDiag->pOutFile, EOF); -<a name="l00188"></a>00188 vImageEpilogue(pDiag); -<a name="l00189"></a>00189 -<a name="l00190"></a>00190 <span class="keywordflow">return</span> TRUE; -<a name="l00191"></a>00191 } <span class="comment">/* end of bTranslatePNG */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/png2sprt_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/png2sprt.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/png2sprt.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * png2sprt.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2000 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to translate png pictures into sprites</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/*</span> -<a name="l00014"></a>00014 <span class="comment"> * bTranslatePNG - translate a PNG picture</span> -<a name="l00015"></a>00015 <span class="comment"> *</span> -<a name="l00016"></a>00016 <span class="comment"> * This function translates a picture from png to sprite</span> -<a name="l00017"></a>00017 <span class="comment"> *</span> -<a name="l00018"></a>00018 <span class="comment"> * return TRUE when sucessful, otherwise FALSE</span> -<a name="l00019"></a>00019 <span class="comment"> */</span> -<a name="l00020"></a>00020 <span class="preprocessor">#ifndef SYMBIAN</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span>BOOL -<a name="l00022"></a>00022 bTranslatePNG(diagram_type *pDiag, FILE *pFile, -<a name="l00023"></a>00023 ULONG ulFileOffset, <span class="keywordtype">size_t</span> tPictureLen, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00024"></a>00024 { -<a name="l00025"></a>00025 <span class="comment">/* PNG is not supported yet */</span> -<a name="l00026"></a>00026 <span class="keywordflow">return</span> bAddDummyImage(pDiag, pImg); -<a name="l00027"></a>00027 } <span class="comment">/* end of bTranslatePNG */</span> -<a name="l00028"></a>00028 <span class="preprocessor">#endif</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/postscript_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1187 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/postscript.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/postscript.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * postscript.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the PostScript format</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> *================================================================</span> -<a name="l00009"></a>00009 <span class="comment"> * The function vImagePrologue is based on:</span> -<a name="l00010"></a>00010 <span class="comment"> * jpeg2ps - convert JPEG compressed images to PostScript Level 2</span> -<a name="l00011"></a>00011 <span class="comment"> * Copyright (C) 1994-99 Thomas Merz (tm@muc.de)</span> -<a name="l00012"></a>00012 <span class="comment"> *================================================================</span> -<a name="l00013"></a>00013 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00014"></a>00014 <span class="comment"> */</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include <errno.h></span> -<a name="l00018"></a>00018 <span class="preprocessor">#include <time.h></span> -<a name="l00019"></a>00019 <span class="preprocessor">#include <string.h></span> -<a name="l00020"></a>00020 <span class="preprocessor">#include "version.h"</span> -<a name="l00021"></a>00021 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 <span class="comment">/* The character set */</span> -<a name="l00024"></a>00024 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00025"></a>00025 <span class="comment">/* The image level */</span> -<a name="l00026"></a>00026 <span class="keyword">static</span> image_level_enum eImageLevel = level_default; -<a name="l00027"></a>00027 <span class="comment">/* The output must use landscape orientation */</span> -<a name="l00028"></a>00028 <span class="keyword">static</span> BOOL bUseLandscape = FALSE; -<a name="l00029"></a>00029 <span class="comment">/* The height and width of a PostScript page (in DrawUnits) */</span> -<a name="l00030"></a>00030 <span class="keyword">static</span> <span class="keywordtype">long</span> lPageHeight = LONG_MAX; -<a name="l00031"></a>00031 <span class="keyword">static</span> <span class="keywordtype">long</span> lPageWidth = LONG_MAX; -<a name="l00032"></a>00032 <span class="comment">/* The height of the footer on the current page (in DrawUnits) */</span> -<a name="l00033"></a>00033 <span class="keyword">static</span> <span class="keywordtype">long</span> lFooterHeight = 0; -<a name="l00034"></a>00034 <span class="comment">/* Inside a footer (to prevent an infinite loop when the footer is too big) */</span> -<a name="l00035"></a>00035 <span class="keyword">static</span> BOOL bInFtrSpace = FALSE; -<a name="l00036"></a>00036 <span class="comment">/* Current time for a PS header */</span> -<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szCreationDate = NULL; -<a name="l00038"></a>00038 <span class="comment">/* Current creator for a PS header */</span> -<a name="l00039"></a>00039 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *szCreator = NULL; -<a name="l00040"></a>00040 <span class="comment">/* Current font information */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> drawfile_fontref tFontRefCurr = (drawfile_fontref)-1; -<a name="l00042"></a>00042 <span class="keyword">static</span> USHORT usFontSizeCurr = 0; -<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keywordtype">int</span> iFontColorCurr = -1; -<a name="l00044"></a>00044 <span class="comment">/* Current vertical position information */</span> -<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">long</span> lYtopCurr = -1; -<a name="l00046"></a>00046 <span class="comment">/* PostScript page counter */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">int</span> iPageCount = 0; -<a name="l00048"></a>00048 <span class="comment">/* Image counter */</span> -<a name="l00049"></a>00049 <span class="keyword">static</span> <span class="keywordtype">int</span> iImageCount = 0; -<a name="l00050"></a>00050 <span class="comment">/* Section index */</span> -<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">int</span> iSectionIndex = 0; -<a name="l00052"></a>00052 <span class="comment">/* Are we on the first page of the section? */</span> -<a name="l00053"></a>00053 <span class="keyword">static</span> BOOL bFirstInSection = TRUE; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 <span class="keyword">static</span> <span class="keywordtype">void</span> vMoveTo(diagram_type *, <span class="keywordtype">long</span>); -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_1_data[] = { -<a name="l00058"></a>00058 <span class="stringliteral">"/newcodes % ISO-8859-1 character encodings"</span>, -<a name="l00059"></a>00059 <span class="stringliteral">"["</span>, -<a name="l00060"></a>00060 <span class="stringliteral">"140/ellipsis 141/trademark 142/perthousand 143/bullet"</span>, -<a name="l00061"></a>00061 <span class="stringliteral">"144/quoteleft 145/quoteright 146/guilsinglleft 147/guilsinglright"</span>, -<a name="l00062"></a>00062 <span class="stringliteral">"148/quotedblleft 149/quotedblright 150/quotedblbase 151/endash 152/emdash"</span>, -<a name="l00063"></a>00063 <span class="stringliteral">"153/minus 154/OE 155/oe 156/dagger 157/daggerdbl 158/fi 159/fl"</span>, -<a name="l00064"></a>00064 <span class="stringliteral">"160/space 161/exclamdown 162/cent 163/sterling 164/currency"</span>, -<a name="l00065"></a>00065 <span class="stringliteral">"165/yen 166/brokenbar 167/section 168/dieresis 169/copyright"</span>, -<a name="l00066"></a>00066 <span class="stringliteral">"170/ordfeminine 171/guillemotleft 172/logicalnot 173/hyphen 174/registered"</span>, -<a name="l00067"></a>00067 <span class="stringliteral">"175/macron 176/degree 177/plusminus 178/twosuperior 179/threesuperior"</span>, -<a name="l00068"></a>00068 <span class="stringliteral">"180/acute 181/mu 182/paragraph 183/periodcentered 184/cedilla"</span>, -<a name="l00069"></a>00069 <span class="stringliteral">"185/onesuperior 186/ordmasculine 187/guillemotright 188/onequarter"</span>, -<a name="l00070"></a>00070 <span class="stringliteral">"189/onehalf 190/threequarters 191/questiondown 192/Agrave 193/Aacute"</span>, -<a name="l00071"></a>00071 <span class="stringliteral">"194/Acircumflex 195/Atilde 196/Adieresis 197/Aring 198/AE 199/Ccedilla"</span>, -<a name="l00072"></a>00072 <span class="stringliteral">"200/Egrave 201/Eacute 202/Ecircumflex 203/Edieresis 204/Igrave 205/Iacute"</span>, -<a name="l00073"></a>00073 <span class="stringliteral">"206/Icircumflex 207/Idieresis 208/Eth 209/Ntilde 210/Ograve 211/Oacute"</span>, -<a name="l00074"></a>00074 <span class="stringliteral">"212/Ocircumflex 213/Otilde 214/Odieresis 215/multiply 216/Oslash"</span>, -<a name="l00075"></a>00075 <span class="stringliteral">"217/Ugrave 218/Uacute 219/Ucircumflex 220/Udieresis 221/Yacute 222/Thorn"</span>, -<a name="l00076"></a>00076 <span class="stringliteral">"223/germandbls 224/agrave 225/aacute 226/acircumflex 227/atilde"</span>, -<a name="l00077"></a>00077 <span class="stringliteral">"228/adieresis 229/aring 230/ae 231/ccedilla 232/egrave 233/eacute"</span>, -<a name="l00078"></a>00078 <span class="stringliteral">"234/ecircumflex 235/edieresis 236/igrave 237/iacute 238/icircumflex"</span>, -<a name="l00079"></a>00079 <span class="stringliteral">"239/idieresis 240/eth 241/ntilde 242/ograve 243/oacute 244/ocircumflex"</span>, -<a name="l00080"></a>00080 <span class="stringliteral">"245/otilde 246/odieresis 247/divide 248/oslash 249/ugrave 250/uacute"</span>, -<a name="l00081"></a>00081 <span class="stringliteral">"251/ucircumflex 252/udieresis 253/yacute 254/thorn 255/ydieresis"</span>, -<a name="l00082"></a>00082 <span class="stringliteral">"] bind def"</span>, -<a name="l00083"></a>00083 <span class="stringliteral">""</span>, -<a name="l00084"></a>00084 <span class="stringliteral">"/reencdict 12 dict def"</span>, -<a name="l00085"></a>00085 <span class="stringliteral">""</span>, -<a name="l00086"></a>00086 }; -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_2_data[] = { -<a name="l00089"></a>00089 <span class="stringliteral">"/newcodes % ISO-8859-2 character encodings"</span>, -<a name="l00090"></a>00090 <span class="stringliteral">"["</span>, -<a name="l00091"></a>00091 <span class="stringliteral">"160/space 161/Aogonek 162/breve 163/Lslash 164/currency 165/Lcaron"</span>, -<a name="l00092"></a>00092 <span class="stringliteral">"166/Sacute 167/section 168/dieresis 169/Scaron 170/Scommaaccent"</span>, -<a name="l00093"></a>00093 <span class="stringliteral">"171/Tcaron 172/Zacute 173/hyphen 174/Zcaron 175/Zdotaccent 176/degree"</span>, -<a name="l00094"></a>00094 <span class="stringliteral">"177/aogonek 178/ogonek 179/lslash 180/acute 181/lcaron 182/sacute"</span>, -<a name="l00095"></a>00095 <span class="stringliteral">"183/caron 184/cedilla 185/scaron 186/scommaaccent 187/tcaron"</span>, -<a name="l00096"></a>00096 <span class="stringliteral">"188/zacute 189/hungarumlaut 190/zcaron 191/zdotaccent 192/Racute"</span>, -<a name="l00097"></a>00097 <span class="stringliteral">"193/Aacute 194/Acircumflex 195/Abreve 196/Adieresis 197/Lacute"</span>, -<a name="l00098"></a>00098 <span class="stringliteral">"198/Cacute 199/Ccedilla 200/Ccaron 201/Eacute 202/Eogonek"</span>, -<a name="l00099"></a>00099 <span class="stringliteral">"203/Edieresis 204/Ecaron 205/Iacute 206/Icircumflex 207/Dcaron"</span>, -<a name="l00100"></a>00100 <span class="stringliteral">"208/Dcroat 209/Nacute 210/Ncaron 211/Oacute 212/Ocircumflex"</span>, -<a name="l00101"></a>00101 <span class="stringliteral">"213/Ohungarumlaut 214/Odieresis 215/multiply 216/Rcaron 217/Uring"</span>, -<a name="l00102"></a>00102 <span class="stringliteral">"218/Uacute 219/Uhungarumlaut 220/Udieresis 221/Yacute 222/Tcommaaccent"</span>, -<a name="l00103"></a>00103 <span class="stringliteral">"223/germandbls 224/racute 225/aacute 226/acircumflex 227/abreve"</span>, -<a name="l00104"></a>00104 <span class="stringliteral">"228/adieresis 229/lacute 230/cacute 231/ccedilla 232/ccaron 233/eacute"</span>, -<a name="l00105"></a>00105 <span class="stringliteral">"234/eogonek 235/edieresis 236/ecaron 237/iacute 238/icircumflex"</span>, -<a name="l00106"></a>00106 <span class="stringliteral">"239/dcaron 240/dcroat 241/nacute 242/ncaron 243/oacute 244/ocircumflex"</span>, -<a name="l00107"></a>00107 <span class="stringliteral">"245/ohungarumlaut 246/odieresis 247/divide 248/rcaron 249/uring"</span>, -<a name="l00108"></a>00108 <span class="stringliteral">"250/uacute 251/uhungarumlaut 252/udieresis 253/yacute 254/tcommaaccent"</span>, -<a name="l00109"></a>00109 <span class="stringliteral">"255/dotaccent"</span>, -<a name="l00110"></a>00110 <span class="stringliteral">"] bind def"</span>, -<a name="l00111"></a>00111 <span class="stringliteral">""</span>, -<a name="l00112"></a>00112 <span class="stringliteral">"/reencdict 12 dict def"</span>, -<a name="l00113"></a>00113 <span class="stringliteral">""</span>, -<a name="l00114"></a>00114 }; -<a name="l00115"></a>00115 -<a name="l00116"></a>00116 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_5_data[] = { -<a name="l00117"></a>00117 <span class="stringliteral">"/newcodes % ISO-8859-5 character encodings"</span>, -<a name="l00118"></a>00118 <span class="stringliteral">"["</span>, -<a name="l00119"></a>00119 <span class="stringliteral">"160/space 161/afii10023 162/afii10051 163/afii10052 164/afii10053"</span>, -<a name="l00120"></a>00120 <span class="stringliteral">"165/afii10054 166/afii10055 167/afii10056 168/afii10057 169/afii10058"</span>, -<a name="l00121"></a>00121 <span class="stringliteral">"170/afii10059 171/afii10060 172/afii10061 173/hyphen 174/afii10062"</span>, -<a name="l00122"></a>00122 <span class="stringliteral">"175/afii10145 176/afii10017 177/afii10018 178/afii10019 179/afii10020"</span>, -<a name="l00123"></a>00123 <span class="stringliteral">"180/afii10021 181/afii10022 182/afii10024 183/afii10025 184/afii10026"</span>, -<a name="l00124"></a>00124 <span class="stringliteral">"185/afii10027 186/afii10028 187/afii10029 188/afii10030 189/afii10031"</span>, -<a name="l00125"></a>00125 <span class="stringliteral">"190/afii10032 191/afii10033 192/afii10034 193/afii10035 194/afii10036"</span>, -<a name="l00126"></a>00126 <span class="stringliteral">"195/afii10037 196/afii10038 197/afii10039 198/afii10040 199/afii10041"</span>, -<a name="l00127"></a>00127 <span class="stringliteral">"200/afii10042 201/afii10043 202/afii10044 203/afii10045 204/afii10046"</span>, -<a name="l00128"></a>00128 <span class="stringliteral">"205/afii10047 206/afii10048 207/afii10049 208/afii10065 209/afii10066"</span>, -<a name="l00129"></a>00129 <span class="stringliteral">"210/afii10067 211/afii10068 212/afii10069 213/afii10070 214/afii10072"</span>, -<a name="l00130"></a>00130 <span class="stringliteral">"215/afii10073 216/afii10074 217/afii10075 218/afii10076 219/afii10077"</span>, -<a name="l00131"></a>00131 <span class="stringliteral">"220/afii10078 221/afii10079 222/afii10080 223/afii10081 224/afii10082"</span>, -<a name="l00132"></a>00132 <span class="stringliteral">"225/afii10083 226/afii10084 227/afii10085 228/afii10086 229/afii10087"</span>, -<a name="l00133"></a>00133 <span class="stringliteral">"230/afii10088 231/afii10089 232/afii10090 233/afii10091 234/afii10092"</span>, -<a name="l00134"></a>00134 <span class="stringliteral">"235/afii10093 236/afii10094 237/afii10095 238/afii10096 239/afii10097"</span>, -<a name="l00135"></a>00135 <span class="stringliteral">"240/afii61352 241/afii10071 242/afii10099 243/afii10100 244/afii10101"</span>, -<a name="l00136"></a>00136 <span class="stringliteral">"245/afii10102 246/afii10103 247/afii10104 248/afii10105 249/afii10106"</span>, -<a name="l00137"></a>00137 <span class="stringliteral">"250/afii10107 251/afii10108 252/afii10109 253/section 254/afii10110"</span>, -<a name="l00138"></a>00138 <span class="stringliteral">"255/afii10193"</span>, -<a name="l00139"></a>00139 <span class="stringliteral">"] bind def"</span>, -<a name="l00140"></a>00140 <span class="stringliteral">""</span>, -<a name="l00141"></a>00141 <span class="stringliteral">"/reencdict 12 dict def"</span>, -<a name="l00142"></a>00142 <span class="stringliteral">""</span>, -<a name="l00143"></a>00143 }; -<a name="l00144"></a>00144 -<a name="l00145"></a>00145 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *iso_8859_x_func[] = { -<a name="l00146"></a>00146 <span class="stringliteral">"% change fonts using ISO-8859-x characters"</span>, -<a name="l00147"></a>00147 <span class="stringliteral">"/ChgFnt % size psname natname => font"</span>, -<a name="l00148"></a>00148 <span class="stringliteral">"{"</span>, -<a name="l00149"></a>00149 <span class="stringliteral">" dup FontDirectory exch known % is re-encoded name known?"</span>, -<a name="l00150"></a>00150 <span class="stringliteral">" { exch pop } % yes, get rid of long name"</span>, -<a name="l00151"></a>00151 <span class="stringliteral">" { dup 3 1 roll ReEncode } ifelse % no, re-encode it"</span>, -<a name="l00152"></a>00152 <span class="stringliteral">" findfont exch scalefont setfont"</span>, -<a name="l00153"></a>00153 <span class="stringliteral">"} bind def"</span>, -<a name="l00154"></a>00154 <span class="stringliteral">""</span>, -<a name="l00155"></a>00155 <span class="stringliteral">"/ReEncode"</span>, -<a name="l00156"></a>00156 <span class="stringliteral">"{"</span>, -<a name="l00157"></a>00157 <span class="stringliteral">"reencdict begin"</span>, -<a name="l00158"></a>00158 <span class="stringliteral">" /newname exch def"</span>, -<a name="l00159"></a>00159 <span class="stringliteral">" /basename exch def"</span>, -<a name="l00160"></a>00160 <span class="stringliteral">" /basedict basename findfont def"</span>, -<a name="l00161"></a>00161 <span class="stringliteral">" /newfont basedict maxlength dict def"</span>, -<a name="l00162"></a>00162 <span class="stringliteral">" basedict"</span>, -<a name="l00163"></a>00163 <span class="stringliteral">" { exch dup /FID ne"</span>, -<a name="l00164"></a>00164 <span class="stringliteral">" { dup /Encoding eq"</span>, -<a name="l00165"></a>00165 <span class="stringliteral">" { exch dup length array copy newfont 3 1 roll put }"</span>, -<a name="l00166"></a>00166 <span class="stringliteral">" { exch newfont 3 1 roll put } ifelse"</span>, -<a name="l00167"></a>00167 <span class="stringliteral">" }"</span>, -<a name="l00168"></a>00168 <span class="stringliteral">" { pop pop } ifelse"</span>, -<a name="l00169"></a>00169 <span class="stringliteral">" } forall"</span>, -<a name="l00170"></a>00170 <span class="stringliteral">" newfont /FontName newname put"</span>, -<a name="l00171"></a>00171 <span class="stringliteral">" newcodes aload pop newcodes length 2 idiv"</span>, -<a name="l00172"></a>00172 <span class="stringliteral">" { newfont /Encoding get 3 1 roll put } repeat"</span>, -<a name="l00173"></a>00173 <span class="stringliteral">" newname newfont definefont pop"</span>, -<a name="l00174"></a>00174 <span class="stringliteral">"end"</span>, -<a name="l00175"></a>00175 <span class="stringliteral">"} bind def"</span>, -<a name="l00176"></a>00176 <span class="stringliteral">""</span>, -<a name="l00177"></a>00177 }; -<a name="l00178"></a>00178 -<a name="l00179"></a>00179 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *misc_func[] = { -<a name="l00180"></a>00180 <span class="stringliteral">"% draw a line and show the string"</span>, -<a name="l00181"></a>00181 <span class="stringliteral">"/LineShow % string linewidth movement"</span>, -<a name="l00182"></a>00182 <span class="stringliteral">"{"</span>, -<a name="l00183"></a>00183 <span class="stringliteral">" gsave"</span>, -<a name="l00184"></a>00184 <span class="stringliteral">" 0 exch rmoveto"</span>, -<a name="l00185"></a>00185 <span class="stringliteral">" setlinewidth"</span>, -<a name="l00186"></a>00186 <span class="stringliteral">" dup"</span>, -<a name="l00187"></a>00187 <span class="stringliteral">" stringwidth pop"</span>, -<a name="l00188"></a>00188 <span class="stringliteral">" 0 rlineto stroke"</span>, -<a name="l00189"></a>00189 <span class="stringliteral">" grestore"</span>, -<a name="l00190"></a>00190 <span class="stringliteral">" show"</span>, -<a name="l00191"></a>00191 <span class="stringliteral">"} bind def"</span>, -<a name="l00192"></a>00192 <span class="stringliteral">""</span>, -<a name="l00193"></a>00193 <span class="stringliteral">"% begin an EPS file (level 2 and up)"</span>, -<a name="l00194"></a>00194 <span class="stringliteral">"/BeginEPSF"</span>, -<a name="l00195"></a>00195 <span class="stringliteral">"{"</span>, -<a name="l00196"></a>00196 <span class="stringliteral">" /b4_Inc_state save def"</span>, -<a name="l00197"></a>00197 <span class="stringliteral">" /dict_count countdictstack def"</span>, -<a name="l00198"></a>00198 <span class="stringliteral">" /op_count count 1 sub def"</span>, -<a name="l00199"></a>00199 <span class="stringliteral">" userdict begin"</span>, -<a name="l00200"></a>00200 <span class="stringliteral">" /showpage { } def"</span>, -<a name="l00201"></a>00201 <span class="stringliteral">" 0 setgray 0 setlinecap"</span>, -<a name="l00202"></a>00202 <span class="stringliteral">" 1 setlinewidth 0 setlinejoin"</span>, -<a name="l00203"></a>00203 <span class="stringliteral">" 10 setmiterlimit [ ] 0 setdash newpath"</span>, -<a name="l00204"></a>00204 <span class="stringliteral">" false setstrokeadjust false setoverprint"</span>, -<a name="l00205"></a>00205 <span class="stringliteral">"} bind def"</span>, -<a name="l00206"></a>00206 <span class="stringliteral">""</span>, -<a name="l00207"></a>00207 <span class="stringliteral">"% end an EPS file"</span>, -<a name="l00208"></a>00208 <span class="stringliteral">"/EndEPSF {"</span>, -<a name="l00209"></a>00209 <span class="stringliteral">" count op_count sub { pop } repeat"</span>, -<a name="l00210"></a>00210 <span class="stringliteral">" countdictstack dict_count sub { end } repeat"</span>, -<a name="l00211"></a>00211 <span class="stringliteral">" b4_Inc_state restore"</span>, -<a name="l00212"></a>00212 <span class="stringliteral">"} bind def"</span>, -<a name="l00213"></a>00213 <span class="stringliteral">""</span>, -<a name="l00214"></a>00214 }; -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 -<a name="l00217"></a>00217 <span class="comment">/*</span> -<a name="l00218"></a>00218 <span class="comment"> * vAddPageSetup - add the page setup</span> -<a name="l00219"></a>00219 <span class="comment"> */</span> -<a name="l00220"></a>00220 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00221"></a>00221 vAddPageSetup(FILE *pOutFile) -<a name="l00222"></a>00222 { -<a name="l00223"></a>00223 <span class="keywordflow">if</span> (bUseLandscape) { -<a name="l00224"></a>00224 fprintf(pOutFile, <span class="stringliteral">"%%%%BeginPageSetup\n"</span>); -<a name="l00225"></a>00225 fprintf(pOutFile, <span class="stringliteral">"90 rotate\n"</span>); -<a name="l00226"></a>00226 fprintf(pOutFile, <span class="stringliteral">"0.00 %.2f translate\n"</span>, -<a name="l00227"></a>00227 -dDrawUnits2Points(lPageHeight)); -<a name="l00228"></a>00228 fprintf(pOutFile, <span class="stringliteral">"%%%%EndPageSetup\n"</span>); -<a name="l00229"></a>00229 } -<a name="l00230"></a>00230 } <span class="comment">/* end of vAddPageSetup */</span> -<a name="l00231"></a>00231 -<a name="l00232"></a>00232 <span class="comment">/*</span> -<a name="l00233"></a>00233 <span class="comment"> * vAddHdrFtr - add a header or footer</span> -<a name="l00234"></a>00234 <span class="comment"> */</span> -<a name="l00235"></a>00235 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00236"></a>00236 vAddHdrFtr(diagram_type *pDiag, <span class="keyword">const</span> hdrftr_block_type *pHdrFtrInfo) -<a name="l00237"></a>00237 { -<a name="l00238"></a>00238 output_type *pStart, *pPrev, *pNext; -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 fail(pDiag == NULL); -<a name="l00241"></a>00241 fail(pHdrFtrInfo == NULL); -<a name="l00242"></a>00242 -<a name="l00243"></a>00243 vStartOfParagraphPS(pDiag, 0); -<a name="l00244"></a>00244 pStart = pHdrFtrInfo->pText; -<a name="l00245"></a>00245 <span class="keywordflow">while</span> (pStart != NULL) { -<a name="l00246"></a>00246 pNext = pStart; -<a name="l00247"></a>00247 <span class="keywordflow">while</span> (pNext != NULL && -<a name="l00248"></a>00248 (pNext->tNextFree != 1 || -<a name="l00249"></a>00249 (pNext->szStorage[0] != PAR_END && -<a name="l00250"></a>00250 pNext->szStorage[0] != HARD_RETURN))) { -<a name="l00251"></a>00251 pNext = pNext->pNext; -<a name="l00252"></a>00252 } -<a name="l00253"></a>00253 <span class="keywordflow">if</span> (pNext == NULL) { -<a name="l00254"></a>00254 <span class="keywordflow">if</span> (bOutputContainsText(pStart)) { -<a name="l00255"></a>00255 vAlign2Window(pDiag, pStart, -<a name="l00256"></a>00256 lChar2MilliPoints(DEFAULT_SCREEN_WIDTH), -<a name="l00257"></a>00257 ALIGNMENT_LEFT); -<a name="l00258"></a>00258 } <span class="keywordflow">else</span> { -<a name="l00259"></a>00259 vMove2NextLinePS(pDiag, pStart->usFontSize); -<a name="l00260"></a>00260 } -<a name="l00261"></a>00261 <span class="keywordflow">break</span>; -<a name="l00262"></a>00262 } -<a name="l00263"></a>00263 fail(pNext->tNextFree != 1); -<a name="l00264"></a>00264 fail(pNext->szStorage[0] != PAR_END && -<a name="l00265"></a>00265 pNext->szStorage[0] != HARD_RETURN); -<a name="l00266"></a>00266 -<a name="l00267"></a>00267 <span class="keywordflow">if</span> (pStart != pNext) { -<a name="l00268"></a>00268 <span class="comment">/* There is something to print */</span> -<a name="l00269"></a>00269 pPrev = pNext->pPrev; -<a name="l00270"></a>00270 fail(pPrev->pNext != pNext); -<a name="l00271"></a>00271 <span class="comment">/* Cut the chain */</span> -<a name="l00272"></a>00272 pPrev->pNext = NULL; -<a name="l00273"></a>00273 <span class="keywordflow">if</span> (bOutputContainsText(pStart)) { -<a name="l00274"></a>00274 <span class="comment">/* Print it */</span> -<a name="l00275"></a>00275 vAlign2Window(pDiag, pStart, -<a name="l00276"></a>00276 lChar2MilliPoints(DEFAULT_SCREEN_WIDTH), -<a name="l00277"></a>00277 ALIGNMENT_LEFT); -<a name="l00278"></a>00278 } <span class="keywordflow">else</span> { -<a name="l00279"></a>00279 <span class="comment">/* Just an empty line */</span> -<a name="l00280"></a>00280 vMove2NextLinePS(pDiag, pStart->usFontSize); -<a name="l00281"></a>00281 } -<a name="l00282"></a>00282 <span class="comment">/* Repair the chain */</span> -<a name="l00283"></a>00283 pPrev->pNext = pNext; -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 <span class="keywordflow">if</span> (pNext->szStorage[0] == PAR_END) { -<a name="l00286"></a>00286 vEndOfParagraphPS(pDiag, pNext->usFontSize, -<a name="l00287"></a>00287 (<span class="keywordtype">long</span>)pNext->usFontSize * 200); -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 pStart = pNext->pNext; -<a name="l00290"></a>00290 } -<a name="l00291"></a>00291 } <span class="comment">/* end of vAddHdrFtr */</span> -<a name="l00292"></a>00292 -<a name="l00293"></a>00293 <span class="comment">/*</span> -<a name="l00294"></a>00294 <span class="comment"> * vAddHeader - add a page header</span> -<a name="l00295"></a>00295 <span class="comment"> */</span> -<a name="l00296"></a>00296 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00297"></a>00297 vAddHeader(diagram_type *pDiag) -<a name="l00298"></a>00298 { -<a name="l00299"></a>00299 <span class="keyword">const</span> hdrftr_block_type *pHdrInfo; -<a name="l00300"></a>00300 <span class="keyword">const</span> hdrftr_block_type *pFtrInfo; -<a name="l00301"></a>00301 -<a name="l00302"></a>00302 fail(pDiag == NULL); -<a name="l00303"></a>00303 -<a name="l00304"></a>00304 NO_DBG_MSG(<span class="stringliteral">"vAddHeader"</span>); -<a name="l00305"></a>00305 -<a name="l00306"></a>00306 pHdrInfo = pGetHdrFtrInfo(iSectionIndex, TRUE, -<a name="l00307"></a>00307 odd(iPageCount), bFirstInSection); -<a name="l00308"></a>00308 pFtrInfo = pGetHdrFtrInfo(iSectionIndex, FALSE, -<a name="l00309"></a>00309 odd(iPageCount), bFirstInSection); -<a name="l00310"></a>00310 <span class="comment">/* Set the height of the footer of this page */</span> -<a name="l00311"></a>00311 lFooterHeight = pFtrInfo == NULL ? 0 : pFtrInfo->lHeight; -<a name="l00312"></a>00312 fail(lFooterHeight < 0); -<a name="l00313"></a>00313 -<a name="l00314"></a>00314 <span class="keywordflow">if</span> (pHdrInfo == NULL || -<a name="l00315"></a>00315 pHdrInfo->pText == NULL || -<a name="l00316"></a>00316 pHdrInfo->lHeight <= 0) { -<a name="l00317"></a>00317 fail(pHdrInfo != NULL && pHdrInfo->lHeight < 0); -<a name="l00318"></a>00318 fail(pHdrInfo != NULL && -<a name="l00319"></a>00319 pHdrInfo->pText != NULL && -<a name="l00320"></a>00320 pHdrInfo->lHeight == 0); -<a name="l00321"></a>00321 <span class="keywordflow">return</span>; -<a name="l00322"></a>00322 } -<a name="l00323"></a>00323 -<a name="l00324"></a>00324 vAddHdrFtr(pDiag, pHdrInfo); -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 DBG_DEC_C(pHdrInfo->lHeight != -<a name="l00327"></a>00327 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop, -<a name="l00328"></a>00328 pHdrInfo->lHeight); -<a name="l00329"></a>00329 DBG_DEC_C(pHdrInfo->lHeight != -<a name="l00330"></a>00330 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop, -<a name="l00331"></a>00331 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop); -<a name="l00332"></a>00332 -<a name="l00333"></a>00333 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00334"></a>00334 fprintf(pDiag->pOutFile, -<a name="l00335"></a>00335 <span class="stringliteral">"(HEADER: FileOffset 0x%04lx-0x%04lx; Height %ld-%ld) show\n"</span>, -<a name="l00336"></a>00336 ulCharPos2FileOffset(pHdrInfo->ulCharPosStart), -<a name="l00337"></a>00337 ulCharPos2FileOffset(pHdrInfo->ulCharPosNext), -<a name="l00338"></a>00338 pHdrInfo->lHeight, -<a name="l00339"></a>00339 lPageHeight - PS_TOP_MARGIN - pDiag->lYtop); -<a name="l00340"></a>00340 <span class="preprocessor">#endif</span> -<a name="l00341"></a>00341 <span class="preprocessor"></span>} <span class="comment">/* end of vAddHeader */</span> -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 <span class="comment">/*</span> -<a name="l00344"></a>00344 <span class="comment"> * vAddFooter - add a page footer</span> -<a name="l00345"></a>00345 <span class="comment"> */</span> -<a name="l00346"></a>00346 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00347"></a>00347 vAddFooter(diagram_type *pDiag) -<a name="l00348"></a>00348 { -<a name="l00349"></a>00349 <span class="keyword">const</span> hdrftr_block_type *pFtrInfo; -<a name="l00350"></a>00350 -<a name="l00351"></a>00351 fail(pDiag == NULL); -<a name="l00352"></a>00352 -<a name="l00353"></a>00353 NO_DBG_MSG(<span class="stringliteral">"vAddFooter"</span>); -<a name="l00354"></a>00354 pFtrInfo = pGetHdrFtrInfo(iSectionIndex, FALSE, -<a name="l00355"></a>00355 odd(iPageCount), bFirstInSection); -<a name="l00356"></a>00356 bFirstInSection = FALSE; -<a name="l00357"></a>00357 <span class="keywordflow">if</span> (pFtrInfo == NULL || -<a name="l00358"></a>00358 pFtrInfo->pText == NULL || -<a name="l00359"></a>00359 pFtrInfo->lHeight <= 0) { -<a name="l00360"></a>00360 fail(pFtrInfo != NULL && pFtrInfo->lHeight < 0); -<a name="l00361"></a>00361 fail(pFtrInfo != NULL && -<a name="l00362"></a>00362 pFtrInfo->pText != NULL && -<a name="l00363"></a>00363 pFtrInfo->lHeight == 0); -<a name="l00364"></a>00364 <span class="keywordflow">return</span>; -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 -<a name="l00367"></a>00367 bInFtrSpace = TRUE; -<a name="l00368"></a>00368 -<a name="l00369"></a>00369 DBG_DEC_C(pFtrInfo->lHeight != lFooterHeight, pFtrInfo->lHeight); -<a name="l00370"></a>00370 DBG_DEC_C(pFtrInfo->lHeight != lFooterHeight, lFooterHeight); -<a name="l00371"></a>00371 DBG_DEC_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00372"></a>00372 pDiag->lYtop); -<a name="l00373"></a>00373 DBG_DEC_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00374"></a>00374 lFooterHeight + PS_BOTTOM_MARGIN); -<a name="l00375"></a>00375 -<a name="l00376"></a>00376 <span class="keywordflow">if</span> (pDiag->lYtop > lFooterHeight + PS_BOTTOM_MARGIN) { -<a name="l00377"></a>00377 <span class="comment">/* Move down to the start of the footer */</span> -<a name="l00378"></a>00378 pDiag->lYtop = lFooterHeight + PS_BOTTOM_MARGIN; -<a name="l00379"></a>00379 vMoveTo(pDiag, 0); -<a name="l00380"></a>00380 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN / 2) { -<a name="l00381"></a>00381 DBG_FIXME(); -<a name="l00382"></a>00382 <span class="comment">/*</span> -<a name="l00383"></a>00383 <span class="comment"> * Move up to the start of the footer, to prevent moving</span> -<a name="l00384"></a>00384 <span class="comment"> * of the bottom edge of the paper</span> -<a name="l00385"></a>00385 <span class="comment"> */</span> -<a name="l00386"></a>00386 pDiag->lYtop = lFooterHeight + PS_BOTTOM_MARGIN; -<a name="l00387"></a>00387 vMoveTo(pDiag, 0); -<a name="l00388"></a>00388 } -<a name="l00389"></a>00389 -<a name="l00390"></a>00390 DBG_FLT_C(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN, -<a name="l00391"></a>00391 dDrawUnits2Points(lFooterHeight + PS_BOTTOM_MARGIN - pDiag->lYtop)); -<a name="l00392"></a>00392 -<a name="l00393"></a>00393 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00394"></a>00394 fprintf(pDiag->pOutFile, -<a name="l00395"></a>00395 <span class="stringliteral">"(FOOTER: FileOffset 0x%04lx-0x%04lx; Bottom %ld-%ld) show\n"</span>, -<a name="l00396"></a>00396 ulCharPos2FileOffset(pFtrInfo->ulCharPosStart), -<a name="l00397"></a>00397 ulCharPos2FileOffset(pFtrInfo->ulCharPosNext), -<a name="l00398"></a>00398 pDiag->lYtop, -<a name="l00399"></a>00399 pFtrInfo->lHeight + PS_BOTTOM_MARGIN); -<a name="l00400"></a>00400 <span class="preprocessor">#endif</span> -<a name="l00401"></a>00401 <span class="preprocessor"></span> vAddHdrFtr(pDiag, pFtrInfo); -<a name="l00402"></a>00402 bInFtrSpace = FALSE; -<a name="l00403"></a>00403 } <span class="comment">/* end of vAddFooter */</span> -<a name="l00404"></a>00404 -<a name="l00405"></a>00405 <span class="comment">/*</span> -<a name="l00406"></a>00406 <span class="comment"> * vMove2NextPage - move to the start of the next page</span> -<a name="l00407"></a>00407 <span class="comment"> */</span> -<a name="l00408"></a>00408 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00409"></a>00409 vMove2NextPage(diagram_type *pDiag, BOOL bNewSection) -<a name="l00410"></a>00410 { -<a name="l00411"></a>00411 fail(pDiag == NULL); -<a name="l00412"></a>00412 -<a name="l00413"></a>00413 vAddFooter(pDiag); -<a name="l00414"></a>00414 fprintf(pDiag->pOutFile, <span class="stringliteral">"showpage\n"</span>); -<a name="l00415"></a>00415 iPageCount++; -<a name="l00416"></a>00416 fprintf(pDiag->pOutFile, <span class="stringliteral">"%%%%Page: %d %d\n"</span>, iPageCount, iPageCount); -<a name="l00417"></a>00417 <span class="keywordflow">if</span> (bNewSection) { -<a name="l00418"></a>00418 iSectionIndex++; -<a name="l00419"></a>00419 bFirstInSection = TRUE; -<a name="l00420"></a>00420 } -<a name="l00421"></a>00421 vAddPageSetup(pDiag->pOutFile); -<a name="l00422"></a>00422 pDiag->lYtop = lPageHeight - PS_TOP_MARGIN; -<a name="l00423"></a>00423 lYtopCurr = -1; -<a name="l00424"></a>00424 vAddHeader(pDiag); -<a name="l00425"></a>00425 } <span class="comment">/* end of vMove2NextPage */</span> -<a name="l00426"></a>00426 -<a name="l00427"></a>00427 <span class="comment">/*</span> -<a name="l00428"></a>00428 <span class="comment"> * vMoveTo - move to the specified X,Y coordinates</span> -<a name="l00429"></a>00429 <span class="comment"> *</span> -<a name="l00430"></a>00430 <span class="comment"> * Move the current position of the specified diagram to its X,Y coordinates,</span> -<a name="l00431"></a>00431 <span class="comment"> * start on a new page if needed</span> -<a name="l00432"></a>00432 <span class="comment"> */</span> -<a name="l00433"></a>00433 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00434"></a>00434 vMoveTo(diagram_type *pDiag, <span class="keywordtype">long</span> lLastVerticalMovement) -<a name="l00435"></a>00435 { -<a name="l00436"></a>00436 fail(pDiag == NULL); -<a name="l00437"></a>00437 fail(pDiag->pOutFile == NULL); -<a name="l00438"></a>00438 -<a name="l00439"></a>00439 <span class="keywordflow">if</span> (pDiag->lYtop <= lFooterHeight + PS_BOTTOM_MARGIN && !bInFtrSpace) { -<a name="l00440"></a>00440 vMove2NextPage(pDiag, FALSE); -<a name="l00441"></a>00441 <span class="comment">/* Repeat the last vertical movement on the new page */</span> -<a name="l00442"></a>00442 pDiag->lYtop -= lLastVerticalMovement; -<a name="l00443"></a>00443 } -<a name="l00444"></a>00444 -<a name="l00445"></a>00445 fail(pDiag->lYtop < lFooterHeight + PS_BOTTOM_MARGIN && !bInFtrSpace); -<a name="l00446"></a>00446 DBG_DEC_C(pDiag->lYtop < PS_BOTTOM_MARGIN, pDiag->lYtop); -<a name="l00447"></a>00447 fail(pDiag->lYtop < PS_BOTTOM_MARGIN / 3); -<a name="l00448"></a>00448 -<a name="l00449"></a>00449 <span class="keywordflow">if</span> (pDiag->lYtop != lYtopCurr) { -<a name="l00450"></a>00450 fprintf(pDiag->pOutFile, <span class="stringliteral">"%.2f %.2f moveto\n"</span>, -<a name="l00451"></a>00451 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00452"></a>00452 dDrawUnits2Points(pDiag->lYtop)); -<a name="l00453"></a>00453 lYtopCurr = pDiag->lYtop; -<a name="l00454"></a>00454 } -<a name="l00455"></a>00455 } <span class="comment">/* end of vMoveTo */</span> -<a name="l00456"></a>00456 -<a name="l00457"></a>00457 <span class="comment">/*</span> -<a name="l00458"></a>00458 <span class="comment"> * vProloguePS - set options and perform the PostScript initialization</span> -<a name="l00459"></a>00459 <span class="comment"> */</span> -<a name="l00460"></a>00460 <span class="keywordtype">void</span> -<a name="l00461"></a>00461 vProloguePS(diagram_type *pDiag, -<a name="l00462"></a>00462 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTask, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename, -<a name="l00463"></a>00463 <span class="keyword">const</span> options_type *pOptions) -<a name="l00464"></a>00464 { -<a name="l00465"></a>00465 FILE *pOutFile; -<a name="l00466"></a>00466 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTmp; -<a name="l00467"></a>00467 time_t tTime; -<a name="l00468"></a>00468 -<a name="l00469"></a>00469 fail(pDiag == NULL); -<a name="l00470"></a>00470 fail(pDiag->pOutFile == NULL); -<a name="l00471"></a>00471 fail(szTask == NULL || szTask[0] == <span class="charliteral">'\0'</span>); -<a name="l00472"></a>00472 fail(pOptions == NULL); -<a name="l00473"></a>00473 -<a name="l00474"></a>00474 pOutFile = pDiag->pOutFile; -<a name="l00475"></a>00475 -<a name="l00476"></a>00476 bUseLandscape = pOptions->bUseLandscape; -<a name="l00477"></a>00477 eEncoding = pOptions->eEncoding; -<a name="l00478"></a>00478 eImageLevel = pOptions->eImageLevel; -<a name="l00479"></a>00479 -<a name="l00480"></a>00480 <span class="keywordflow">if</span> (pOptions->iPageHeight == INT_MAX) { -<a name="l00481"></a>00481 lPageHeight = LONG_MAX; -<a name="l00482"></a>00482 } <span class="keywordflow">else</span> { -<a name="l00483"></a>00483 lPageHeight = lPoints2DrawUnits(pOptions->iPageHeight); -<a name="l00484"></a>00484 } -<a name="l00485"></a>00485 DBG_DEC(lPageHeight); -<a name="l00486"></a>00486 <span class="keywordflow">if</span> (pOptions->iPageWidth == INT_MAX) { -<a name="l00487"></a>00487 lPageWidth = LONG_MAX; -<a name="l00488"></a>00488 } <span class="keywordflow">else</span> { -<a name="l00489"></a>00489 lPageWidth = lPoints2DrawUnits(pOptions->iPageWidth); -<a name="l00490"></a>00490 } -<a name="l00491"></a>00491 DBG_DEC(lPageWidth); -<a name="l00492"></a>00492 lFooterHeight = 0; -<a name="l00493"></a>00493 bInFtrSpace = FALSE; -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 tFontRefCurr = (drawfile_fontref)-1; -<a name="l00496"></a>00496 usFontSizeCurr = 0; -<a name="l00497"></a>00497 iFontColorCurr = -1; -<a name="l00498"></a>00498 lYtopCurr = -1; -<a name="l00499"></a>00499 iPageCount = 0; -<a name="l00500"></a>00500 iImageCount = 0; -<a name="l00501"></a>00501 iSectionIndex = 0; -<a name="l00502"></a>00502 bFirstInSection = TRUE; -<a name="l00503"></a>00503 pDiag->lXleft = 0; -<a name="l00504"></a>00504 pDiag->lYtop = lPageHeight - PS_TOP_MARGIN; -<a name="l00505"></a>00505 -<a name="l00506"></a>00506 szCreator = szTask; -<a name="l00507"></a>00507 -<a name="l00508"></a>00508 fprintf(pOutFile, <span class="stringliteral">"%%!PS-Adobe-2.0\n"</span>); -<a name="l00509"></a>00509 fprintf(pOutFile, <span class="stringliteral">"%%%%Title: %s\n"</span>, szBasename(szFilename)); -<a name="l00510"></a>00510 fprintf(pOutFile, <span class="stringliteral">"%%%%Creator: %s %s\n"</span>, szCreator, VERSIONSTRING); -<a name="l00511"></a>00511 szTmp = getenv(<span class="stringliteral">"LOGNAME"</span>); -<a name="l00512"></a>00512 <span class="keywordflow">if</span> (szTmp == NULL || szTmp[0] == <span class="charliteral">'\0'</span>) { -<a name="l00513"></a>00513 szTmp = getenv(<span class="stringliteral">"USER"</span>); -<a name="l00514"></a>00514 <span class="keywordflow">if</span> (szTmp == NULL || szTmp[0] == <span class="charliteral">'\0'</span>) { -<a name="l00515"></a>00515 szTmp = <span class="stringliteral">"unknown"</span>; -<a name="l00516"></a>00516 } -<a name="l00517"></a>00517 } -<a name="l00518"></a>00518 fprintf(pOutFile, <span class="stringliteral">"%%%%For: %.50s\n"</span>, szTmp); -<a name="l00519"></a>00519 errno = 0; -<a name="l00520"></a>00520 tTime = time(NULL); -<a name="l00521"></a>00521 <span class="keywordflow">if</span> (tTime == (time_t)-1 && errno != 0) { -<a name="l00522"></a>00522 szCreationDate = NULL; -<a name="l00523"></a>00523 } <span class="keywordflow">else</span> { -<a name="l00524"></a>00524 szCreationDate = ctime(&tTime); -<a name="l00525"></a>00525 } -<a name="l00526"></a>00526 <span class="keywordflow">if</span> (szCreationDate == NULL || szCreationDate[0] == <span class="charliteral">'\0'</span>) { -<a name="l00527"></a>00527 szCreationDate = <span class="stringliteral">"unknown\n"</span>; -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 fprintf(pOutFile, <span class="stringliteral">"%%%%CreationDate: %s"</span>, szCreationDate); -<a name="l00530"></a>00530 <span class="keywordflow">if</span> (bUseLandscape) { -<a name="l00531"></a>00531 fprintf(pOutFile, <span class="stringliteral">"%%%%Orientation: Landscape\n"</span>); -<a name="l00532"></a>00532 fprintf(pOutFile, <span class="stringliteral">"%%%%BoundingBox: 0 0 %.0f %.0f\n"</span>, -<a name="l00533"></a>00533 dDrawUnits2Points(lPageHeight), -<a name="l00534"></a>00534 dDrawUnits2Points(lPageWidth)); -<a name="l00535"></a>00535 } <span class="keywordflow">else</span> { -<a name="l00536"></a>00536 fprintf(pOutFile, <span class="stringliteral">"%%%%Orientation: Portrait\n"</span>); -<a name="l00537"></a>00537 fprintf(pOutFile, <span class="stringliteral">"%%%%BoundingBox: 0 0 %.0f %.0f\n"</span>, -<a name="l00538"></a>00538 dDrawUnits2Points(lPageWidth), -<a name="l00539"></a>00539 dDrawUnits2Points(lPageHeight)); -<a name="l00540"></a>00540 } -<a name="l00541"></a>00541 } <span class="comment">/* end of vProloguePS */</span> -<a name="l00542"></a>00542 -<a name="l00543"></a>00543 <span class="comment">/*</span> -<a name="l00544"></a>00544 <span class="comment"> * vEpiloguePS - clean up after everything is done</span> -<a name="l00545"></a>00545 <span class="comment"> */</span> -<a name="l00546"></a>00546 <span class="keywordtype">void</span> -<a name="l00547"></a>00547 vEpiloguePS(diagram_type *pDiag) -<a name="l00548"></a>00548 { -<a name="l00549"></a>00549 fail(pDiag == NULL); -<a name="l00550"></a>00550 fail(pDiag->pOutFile == NULL); -<a name="l00551"></a>00551 -<a name="l00552"></a>00552 <span class="keywordflow">if</span> (pDiag->lYtop < lPageHeight - PS_TOP_MARGIN) { -<a name="l00553"></a>00553 vAddFooter(pDiag); -<a name="l00554"></a>00554 fprintf(pDiag->pOutFile, <span class="stringliteral">"showpage\n"</span>); -<a name="l00555"></a>00555 } -<a name="l00556"></a>00556 fprintf(pDiag->pOutFile, <span class="stringliteral">"%%%%Trailer\n"</span>); -<a name="l00557"></a>00557 fprintf(pDiag->pOutFile, <span class="stringliteral">"%%%%Pages: %d\n"</span>, iPageCount); -<a name="l00558"></a>00558 fprintf(pDiag->pOutFile, <span class="stringliteral">"%%%%EOF\n"</span>); -<a name="l00559"></a>00559 szCreationDate = NULL; -<a name="l00560"></a>00560 szCreator = NULL; -<a name="l00561"></a>00561 } <span class="comment">/* end of vEpiloguePS */</span> -<a name="l00562"></a>00562 -<a name="l00563"></a>00563 <span class="comment">/*</span> -<a name="l00564"></a>00564 <span class="comment"> * vPrintPalette - print a postscript palette</span> -<a name="l00565"></a>00565 <span class="comment"> */</span> -<a name="l00566"></a>00566 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00567"></a>00567 vPrintPalette(FILE *pOutFile, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00568"></a>00568 { -<a name="l00569"></a>00569 <span class="keywordtype">int</span> iIndex; -<a name="l00570"></a>00570 -<a name="l00571"></a>00571 fail(pOutFile == NULL); -<a name="l00572"></a>00572 fail(pImg == NULL); -<a name="l00573"></a>00573 fail(pImg->iColorsUsed < 2); -<a name="l00574"></a>00574 fail(pImg->iColorsUsed > 256); -<a name="l00575"></a>00575 -<a name="l00576"></a>00576 fprintf(pOutFile, <span class="stringliteral">"[ /Indexed\n"</span>); -<a name="l00577"></a>00577 fprintf(pOutFile, <span class="stringliteral">"\t/Device%s %d\n"</span>, -<a name="l00578"></a>00578 pImg->bColorImage ? <span class="stringliteral">"RGB"</span> : <span class="stringliteral">"Gray"</span>, pImg->iColorsUsed - 1); -<a name="l00579"></a>00579 fprintf(pOutFile, <span class="stringliteral">"<"</span>); -<a name="l00580"></a>00580 <span class="keywordflow">for</span> (iIndex = 0; iIndex < pImg->iColorsUsed; iIndex++) { -<a name="l00581"></a>00581 fprintf(pOutFile, <span class="stringliteral">"%02x"</span>, -<a name="l00582"></a>00582 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][0]); -<a name="l00583"></a>00583 <span class="keywordflow">if</span> (pImg->bColorImage) { -<a name="l00584"></a>00584 fprintf(pOutFile, <span class="stringliteral">"%02x%02x"</span>, -<a name="l00585"></a>00585 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][1], -<a name="l00586"></a>00586 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)pImg->aucPalette[iIndex][2]); -<a name="l00587"></a>00587 } -<a name="l00588"></a>00588 <span class="keywordflow">if</span> (iIndex % 8 == 7) { -<a name="l00589"></a>00589 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00590"></a>00590 } <span class="keywordflow">else</span> { -<a name="l00591"></a>00591 fprintf(pOutFile, <span class="stringliteral">" "</span>); -<a name="l00592"></a>00592 } -<a name="l00593"></a>00593 } -<a name="l00594"></a>00594 fprintf(pOutFile, <span class="stringliteral">">\n"</span>); -<a name="l00595"></a>00595 fprintf(pOutFile, <span class="stringliteral">"] setcolorspace\n"</span>); -<a name="l00596"></a>00596 } <span class="comment">/* end of vPrintPalette */</span> -<a name="l00597"></a>00597 -<a name="l00598"></a>00598 <span class="comment">/*</span> -<a name="l00599"></a>00599 <span class="comment"> * vImageProloguePS - perform the Encapsulated PostScript initialization</span> -<a name="l00600"></a>00600 <span class="comment"> */</span> -<a name="l00601"></a>00601 <span class="keywordtype">void</span> -<a name="l00602"></a>00602 vImageProloguePS(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00603"></a>00603 { -<a name="l00604"></a>00604 FILE *pOutFile; -<a name="l00605"></a>00605 -<a name="l00606"></a>00606 fail(pDiag == NULL); -<a name="l00607"></a>00607 fail(pDiag->pOutFile == NULL); -<a name="l00608"></a>00608 fail(pImg == NULL); -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { -<a name="l00611"></a>00611 <span class="keywordflow">return</span>; -<a name="l00612"></a>00612 } -<a name="l00613"></a>00613 -<a name="l00614"></a>00614 fail(szCreationDate == NULL); -<a name="l00615"></a>00615 fail(szCreator == NULL); -<a name="l00616"></a>00616 fail(eImageLevel == level_no_images); -<a name="l00617"></a>00617 -<a name="l00618"></a>00618 iImageCount++; -<a name="l00619"></a>00619 -<a name="l00620"></a>00620 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00621"></a>00621 -<a name="l00622"></a>00622 pDiag->lYtop -= lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00623"></a>00623 vMoveTo(pDiag, lPoints2DrawUnits(pImg->iVerSizeScaled)); -<a name="l00624"></a>00624 -<a name="l00625"></a>00625 pOutFile = pDiag->pOutFile; -<a name="l00626"></a>00626 -<a name="l00627"></a>00627 fprintf(pOutFile, <span class="stringliteral">"BeginEPSF\n"</span>); -<a name="l00628"></a>00628 fprintf(pOutFile, <span class="stringliteral">"%%%%BeginDocument: image%03d.eps\n"</span>, iImageCount); -<a name="l00629"></a>00629 fprintf(pOutFile, <span class="stringliteral">"%%!PS-Adobe-2.0 EPSF-2.0\n"</span>); -<a name="l00630"></a>00630 fprintf(pOutFile, <span class="stringliteral">"%%%%Creator: %s %s\n"</span>, szCreator, VERSIONSTRING); -<a name="l00631"></a>00631 fprintf(pOutFile, <span class="stringliteral">"%%%%Title: Image %03d\n"</span>, iImageCount); -<a name="l00632"></a>00632 fprintf(pOutFile, <span class="stringliteral">"%%%%CreationDate: %s"</span>, szCreationDate); -<a name="l00633"></a>00633 fprintf(pOutFile, <span class="stringliteral">"%%%%BoundingBox: 0 0 %d %d\n"</span>, -<a name="l00634"></a>00634 pImg->iHorSizeScaled, pImg->iVerSizeScaled); -<a name="l00635"></a>00635 fprintf(pOutFile, <span class="stringliteral">"%%%%DocumentData: Clean7Bit\n"</span>); -<a name="l00636"></a>00636 fprintf(pOutFile, <span class="stringliteral">"%%%%LanguageLevel: 2\n"</span>); -<a name="l00637"></a>00637 fprintf(pOutFile, <span class="stringliteral">"%%%%EndComments\n"</span>); -<a name="l00638"></a>00638 fprintf(pOutFile, <span class="stringliteral">"%%%%BeginProlog\n"</span>); -<a name="l00639"></a>00639 fprintf(pOutFile, <span class="stringliteral">"%%%%EndProlog\n"</span>); -<a name="l00640"></a>00640 fprintf(pOutFile, <span class="stringliteral">"%%%%Page: 1 1\n"</span>); -<a name="l00641"></a>00641 -<a name="l00642"></a>00642 fprintf(pOutFile, <span class="stringliteral">"save\n"</span>); -<a name="l00643"></a>00643 -<a name="l00644"></a>00644 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l00645"></a>00645 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l00646"></a>00646 fprintf(pOutFile, <span class="stringliteral">"/Data1 currentfile "</span>); -<a name="l00647"></a>00647 fprintf(pOutFile, <span class="stringliteral">"/ASCII85Decode filter def\n"</span>); -<a name="l00648"></a>00648 fprintf(pOutFile, <span class="stringliteral">"/Data Data1 << "</span>); -<a name="l00649"></a>00649 fprintf(pOutFile, <span class="stringliteral">">> /DCTDecode filter def\n"</span>); -<a name="l00650"></a>00650 <span class="keywordflow">switch</span> (pImg->iComponents) { -<a name="l00651"></a>00651 <span class="keywordflow">case</span> 1: -<a name="l00652"></a>00652 fprintf(pOutFile, <span class="stringliteral">"/DeviceGray setcolorspace\n"</span>); -<a name="l00653"></a>00653 <span class="keywordflow">break</span>; -<a name="l00654"></a>00654 <span class="keywordflow">case</span> 3: -<a name="l00655"></a>00655 fprintf(pOutFile, <span class="stringliteral">"/DeviceRGB setcolorspace\n"</span>); -<a name="l00656"></a>00656 <span class="keywordflow">break</span>; -<a name="l00657"></a>00657 <span class="keywordflow">case</span> 4: -<a name="l00658"></a>00658 fprintf(pOutFile, <span class="stringliteral">"/DeviceCMYK setcolorspace\n"</span>); -<a name="l00659"></a>00659 <span class="keywordflow">break</span>; -<a name="l00660"></a>00660 <span class="keywordflow">default</span>: -<a name="l00661"></a>00661 DBG_DEC(pImg->iComponents); -<a name="l00662"></a>00662 <span class="keywordflow">break</span>; -<a name="l00663"></a>00663 } -<a name="l00664"></a>00664 <span class="keywordflow">break</span>; -<a name="l00665"></a>00665 <span class="keywordflow">case</span> imagetype_is_png: -<a name="l00666"></a>00666 <span class="keywordflow">if</span> (eImageLevel == level_gs_special) { -<a name="l00667"></a>00667 fprintf(pOutFile, -<a name="l00668"></a>00668 <span class="stringliteral">"/Data2 currentfile /ASCII85Decode filter def\n"</span>); -<a name="l00669"></a>00669 fprintf(pOutFile, -<a name="l00670"></a>00670 <span class="stringliteral">"/Data1 Data2 << >> /FlateDecode filter def\n"</span>); -<a name="l00671"></a>00671 fprintf(pOutFile, <span class="stringliteral">"/Data Data1 <<\n"</span>); -<a name="l00672"></a>00672 fprintf(pOutFile, <span class="stringliteral">"\t/Colors %d\n"</span>, pImg->iComponents); -<a name="l00673"></a>00673 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent %u\n"</span>, -<a name="l00674"></a>00674 pImg->uiBitsPerComponent); -<a name="l00675"></a>00675 fprintf(pOutFile, <span class="stringliteral">"\t/Columns %d\n"</span>, pImg->iWidth); -<a name="l00676"></a>00676 fprintf(pOutFile, -<a name="l00677"></a>00677 <span class="stringliteral">">> /PNGPredictorDecode filter def\n"</span>); -<a name="l00678"></a>00678 } <span class="keywordflow">else</span> { -<a name="l00679"></a>00679 fprintf(pOutFile, -<a name="l00680"></a>00680 <span class="stringliteral">"/Data1 currentfile /ASCII85Decode filter def\n"</span>); -<a name="l00681"></a>00681 fprintf(pOutFile, -<a name="l00682"></a>00682 <span class="stringliteral">"/Data Data1 << >> /FlateDecode filter def\n"</span>); -<a name="l00683"></a>00683 } -<a name="l00684"></a>00684 <span class="keywordflow">if</span> (pImg->iComponents == 3 || pImg->iComponents == 4) { -<a name="l00685"></a>00685 fprintf(pOutFile, <span class="stringliteral">"/DeviceRGB setcolorspace\n"</span>); -<a name="l00686"></a>00686 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pImg->iColorsUsed > 0) { -<a name="l00687"></a>00687 vPrintPalette(pOutFile, pImg); -<a name="l00688"></a>00688 } <span class="keywordflow">else</span> { -<a name="l00689"></a>00689 fprintf(pOutFile, <span class="stringliteral">"/DeviceGray setcolorspace\n"</span>); -<a name="l00690"></a>00690 } -<a name="l00691"></a>00691 <span class="keywordflow">break</span>; -<a name="l00692"></a>00692 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l00693"></a>00693 fprintf(pOutFile, <span class="stringliteral">"/Data currentfile "</span>); -<a name="l00694"></a>00694 fprintf(pOutFile, <span class="stringliteral">"/ASCII85Decode filter def\n"</span>); -<a name="l00695"></a>00695 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00696"></a>00696 vPrintPalette(pOutFile, pImg); -<a name="l00697"></a>00697 } <span class="keywordflow">else</span> { -<a name="l00698"></a>00698 fprintf(pOutFile, <span class="stringliteral">"/DeviceRGB setcolorspace\n"</span>); -<a name="l00699"></a>00699 } -<a name="l00700"></a>00700 <span class="keywordflow">break</span>; -<a name="l00701"></a>00701 <span class="keywordflow">default</span>: -<a name="l00702"></a>00702 fprintf(pOutFile, <span class="stringliteral">"/Data currentfile "</span>); -<a name="l00703"></a>00703 fprintf(pOutFile, <span class="stringliteral">"/ASCIIHexDecode filter def\n"</span>); -<a name="l00704"></a>00704 fprintf(pOutFile, <span class="stringliteral">"/Device%s setcolorspace\n"</span>, -<a name="l00705"></a>00705 pImg->bColorImage ? <span class="stringliteral">"RGB"</span> : <span class="stringliteral">"Gray"</span>); -<a name="l00706"></a>00706 <span class="keywordflow">break</span>; -<a name="l00707"></a>00707 } -<a name="l00708"></a>00708 -<a name="l00709"></a>00709 <span class="comment">/* Translate to lower left corner of image */</span> -<a name="l00710"></a>00710 fprintf(pOutFile, <span class="stringliteral">"%.2f %.2f translate\n"</span>, -<a name="l00711"></a>00711 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00712"></a>00712 dDrawUnits2Points(pDiag->lYtop)); -<a name="l00713"></a>00713 -<a name="l00714"></a>00714 fprintf(pOutFile, <span class="stringliteral">"%d %d scale\n"</span>, -<a name="l00715"></a>00715 pImg->iHorSizeScaled, pImg->iVerSizeScaled); -<a name="l00716"></a>00716 -<a name="l00717"></a>00717 fprintf(pOutFile, <span class="stringliteral">"{ <<\n"</span>); -<a name="l00718"></a>00718 fprintf(pOutFile, <span class="stringliteral">"\t/ImageType 1\n"</span>); -<a name="l00719"></a>00719 fprintf(pOutFile, <span class="stringliteral">"\t/Width %d\n"</span>, pImg->iWidth); -<a name="l00720"></a>00720 fprintf(pOutFile, <span class="stringliteral">"\t/Height %d\n"</span>, pImg->iHeight); -<a name="l00721"></a>00721 <span class="keywordflow">if</span> (pImg->eImageType == imagetype_is_dib) { -<a name="l00722"></a>00722 <span class="comment">/* Scanning from left to right and bottom to top */</span> -<a name="l00723"></a>00723 fprintf(pOutFile, <span class="stringliteral">"\t/ImageMatrix [ %d 0 0 %d 0 0 ]\n"</span>, -<a name="l00724"></a>00724 pImg->iWidth, pImg->iHeight); -<a name="l00725"></a>00725 } <span class="keywordflow">else</span> { -<a name="l00726"></a>00726 <span class="comment">/* Scanning from left to right and top to bottom */</span> -<a name="l00727"></a>00727 fprintf(pOutFile, <span class="stringliteral">"\t/ImageMatrix [ %d 0 0 %d 0 %d ]\n"</span>, -<a name="l00728"></a>00728 pImg->iWidth, -pImg->iHeight, pImg->iHeight); -<a name="l00729"></a>00729 } -<a name="l00730"></a>00730 fprintf(pOutFile, <span class="stringliteral">"\t/DataSource Data\n"</span>); -<a name="l00731"></a>00731 -<a name="l00732"></a>00732 <span class="keywordflow">switch</span> (pImg->eImageType) { -<a name="l00733"></a>00733 <span class="keywordflow">case</span> imagetype_is_jpeg: -<a name="l00734"></a>00734 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00735"></a>00735 <span class="keywordflow">switch</span> (pImg->iComponents) { -<a name="l00736"></a>00736 <span class="keywordflow">case</span> 1: -<a name="l00737"></a>00737 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1]\n"</span>); -<a name="l00738"></a>00738 <span class="keywordflow">break</span>; -<a name="l00739"></a>00739 <span class="keywordflow">case</span> 3: -<a name="l00740"></a>00740 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1 0 1 0 1]\n"</span>); -<a name="l00741"></a>00741 <span class="keywordflow">break</span>; -<a name="l00742"></a>00742 <span class="keywordflow">case</span> 4: -<a name="l00743"></a>00743 <span class="keywordflow">if</span> (pImg->bAdobe) { -<a name="l00744"></a>00744 <span class="comment">/*</span> -<a name="l00745"></a>00745 <span class="comment"> * Adobe-conforming CMYK file</span> -<a name="l00746"></a>00746 <span class="comment"> * applying workaround for color inversion</span> -<a name="l00747"></a>00747 <span class="comment"> */</span> -<a name="l00748"></a>00748 fprintf(pOutFile, -<a name="l00749"></a>00749 <span class="stringliteral">"\t/Decode [1 0 1 0 1 0 1 0]\n"</span>); -<a name="l00750"></a>00750 } <span class="keywordflow">else</span> { -<a name="l00751"></a>00751 fprintf(pOutFile, -<a name="l00752"></a>00752 <span class="stringliteral">"\t/Decode [0 1 0 1 0 1 0 1]\n"</span>); -<a name="l00753"></a>00753 } -<a name="l00754"></a>00754 <span class="keywordflow">break</span>; -<a name="l00755"></a>00755 <span class="keywordflow">default</span>: -<a name="l00756"></a>00756 DBG_DEC(pImg->iComponents); -<a name="l00757"></a>00757 <span class="keywordflow">break</span>; -<a name="l00758"></a>00758 } -<a name="l00759"></a>00759 <span class="keywordflow">break</span>; -<a name="l00760"></a>00760 <span class="keywordflow">case</span> imagetype_is_png: -<a name="l00761"></a>00761 <span class="keywordflow">if</span> (pImg->iComponents == 3) { -<a name="l00762"></a>00762 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00763"></a>00763 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1 0 1 0 1]\n"</span>); -<a name="l00764"></a>00764 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pImg->iColorsUsed > 0) { -<a name="l00765"></a>00765 fail(pImg->uiBitsPerComponent > 8); -<a name="l00766"></a>00766 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent %u\n"</span>, -<a name="l00767"></a>00767 pImg->uiBitsPerComponent); -<a name="l00768"></a>00768 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 %d]\n"</span>, -<a name="l00769"></a>00769 (1 << pImg->uiBitsPerComponent) - 1); -<a name="l00770"></a>00770 } <span class="keywordflow">else</span> { -<a name="l00771"></a>00771 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00772"></a>00772 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1]\n"</span>); -<a name="l00773"></a>00773 } -<a name="l00774"></a>00774 <span class="keywordflow">break</span>; -<a name="l00775"></a>00775 <span class="keywordflow">case</span> imagetype_is_dib: -<a name="l00776"></a>00776 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00777"></a>00777 <span class="keywordflow">if</span> (pImg->uiBitsPerComponent <= 8) { -<a name="l00778"></a>00778 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 255]\n"</span>); -<a name="l00779"></a>00779 } <span class="keywordflow">else</span> { -<a name="l00780"></a>00780 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1 0 1 0 1]\n"</span>); -<a name="l00781"></a>00781 } -<a name="l00782"></a>00782 <span class="keywordflow">break</span>; -<a name="l00783"></a>00783 <span class="keywordflow">default</span>: -<a name="l00784"></a>00784 fprintf(pOutFile, <span class="stringliteral">"\t/BitsPerComponent 8\n"</span>); -<a name="l00785"></a>00785 <span class="keywordflow">if</span> (pImg->bColorImage) { -<a name="l00786"></a>00786 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1 0 1 0 1]\n"</span>); -<a name="l00787"></a>00787 } <span class="keywordflow">else</span> { -<a name="l00788"></a>00788 fprintf(pOutFile, <span class="stringliteral">"\t/Decode [0 1]\n"</span>); -<a name="l00789"></a>00789 } -<a name="l00790"></a>00790 <span class="keywordflow">break</span>; -<a name="l00791"></a>00791 } -<a name="l00792"></a>00792 -<a name="l00793"></a>00793 fprintf(pOutFile, <span class="stringliteral">" >> image\n"</span>); -<a name="l00794"></a>00794 fprintf(pOutFile, <span class="stringliteral">" Data closefile\n"</span>); -<a name="l00795"></a>00795 fprintf(pOutFile, <span class="stringliteral">" showpage\n"</span>); -<a name="l00796"></a>00796 fprintf(pOutFile, <span class="stringliteral">" restore\n"</span>); -<a name="l00797"></a>00797 fprintf(pOutFile, <span class="stringliteral">"} exec\n"</span>); -<a name="l00798"></a>00798 } <span class="comment">/* end of vImageProloguePS */</span> -<a name="l00799"></a>00799 -<a name="l00800"></a>00800 <span class="comment">/*</span> -<a name="l00801"></a>00801 <span class="comment"> * vImageEpiloguePS - clean up after Encapsulated PostScript</span> -<a name="l00802"></a>00802 <span class="comment"> */</span> -<a name="l00803"></a>00803 <span class="keywordtype">void</span> -<a name="l00804"></a>00804 vImageEpiloguePS(diagram_type *pDiag) -<a name="l00805"></a>00805 { -<a name="l00806"></a>00806 FILE *pOutFile; -<a name="l00807"></a>00807 -<a name="l00808"></a>00808 fail(pDiag == NULL); -<a name="l00809"></a>00809 fail(pDiag->pOutFile == NULL); -<a name="l00810"></a>00810 -<a name="l00811"></a>00811 pOutFile = pDiag->pOutFile; -<a name="l00812"></a>00812 -<a name="l00813"></a>00813 fprintf(pOutFile, <span class="stringliteral">"%%%%EOF\n"</span>); -<a name="l00814"></a>00814 fprintf(pOutFile, <span class="stringliteral">"%%%%EndDocument\n"</span>); -<a name="l00815"></a>00815 fprintf(pOutFile, <span class="stringliteral">"EndEPSF\n"</span>); -<a name="l00816"></a>00816 -<a name="l00817"></a>00817 pDiag->lXleft = 0; -<a name="l00818"></a>00818 } <span class="comment">/* end of vImageEpiloguePS */</span> -<a name="l00819"></a>00819 -<a name="l00820"></a>00820 <span class="comment">/*</span> -<a name="l00821"></a>00821 <span class="comment"> * bAddDummyImagePS - add a dummy image</span> -<a name="l00822"></a>00822 <span class="comment"> *</span> -<a name="l00823"></a>00823 <span class="comment"> * return TRUE when successful, otherwise FALSE</span> -<a name="l00824"></a>00824 <span class="comment"> */</span> -<a name="l00825"></a>00825 BOOL -<a name="l00826"></a>00826 bAddDummyImagePS(diagram_type *pDiag, <span class="keyword">const</span> imagedata_type *pImg) -<a name="l00827"></a>00827 { -<a name="l00828"></a>00828 FILE *pOutFile; -<a name="l00829"></a>00829 -<a name="l00830"></a>00830 fail(pDiag == NULL); -<a name="l00831"></a>00831 fail(pDiag->pOutFile == NULL); -<a name="l00832"></a>00832 fail(pImg == NULL); -<a name="l00833"></a>00833 -<a name="l00834"></a>00834 <span class="keywordflow">if</span> (pImg->iVerSizeScaled <= 0 || pImg->iHorSizeScaled <= 0) { -<a name="l00835"></a>00835 <span class="keywordflow">return</span> FALSE; -<a name="l00836"></a>00836 } -<a name="l00837"></a>00837 -<a name="l00838"></a>00838 iImageCount++; -<a name="l00839"></a>00839 -<a name="l00840"></a>00840 DBG_DEC_C(pDiag->lXleft != 0, pDiag->lXleft); -<a name="l00841"></a>00841 -<a name="l00842"></a>00842 pDiag->lYtop -= lPoints2DrawUnits(pImg->iVerSizeScaled); -<a name="l00843"></a>00843 vMoveTo(pDiag, lPoints2DrawUnits(pImg->iVerSizeScaled)); -<a name="l00844"></a>00844 -<a name="l00845"></a>00845 pOutFile = pDiag->pOutFile; -<a name="l00846"></a>00846 -<a name="l00847"></a>00847 fprintf(pOutFile, <span class="stringliteral">"gsave %% Image %03d\n"</span>, iImageCount); -<a name="l00848"></a>00848 fprintf(pOutFile, <span class="stringliteral">"\tnewpath\n"</span>); -<a name="l00849"></a>00849 fprintf(pOutFile, <span class="stringliteral">"\t%.2f %.2f moveto\n"</span>, -<a name="l00850"></a>00850 dDrawUnits2Points(pDiag->lXleft + PS_LEFT_MARGIN), -<a name="l00851"></a>00851 dDrawUnits2Points(pDiag->lYtop)); -<a name="l00852"></a>00852 fprintf(pOutFile, <span class="stringliteral">"\t1.0 setlinewidth\n"</span>); -<a name="l00853"></a>00853 fprintf(pOutFile, <span class="stringliteral">"\t0.3 setgray\n"</span>); -<a name="l00854"></a>00854 fprintf(pOutFile, <span class="stringliteral">"\t0 %d rlineto\n"</span>, pImg->iVerSizeScaled); -<a name="l00855"></a>00855 fprintf(pOutFile, <span class="stringliteral">"\t%d 0 rlineto\n"</span>, pImg->iHorSizeScaled); -<a name="l00856"></a>00856 fprintf(pOutFile, <span class="stringliteral">"\t0 %d rlineto\n"</span>, -pImg->iVerSizeScaled); -<a name="l00857"></a>00857 fprintf(pOutFile, <span class="stringliteral">"\tclosepath\n"</span>); -<a name="l00858"></a>00858 fprintf(pOutFile, <span class="stringliteral">"\tstroke\n"</span>); -<a name="l00859"></a>00859 fprintf(pOutFile, <span class="stringliteral">"grestore\n"</span>); -<a name="l00860"></a>00860 -<a name="l00861"></a>00861 pDiag->lXleft = 0; -<a name="l00862"></a>00862 -<a name="l00863"></a>00863 <span class="keywordflow">return</span> TRUE; -<a name="l00864"></a>00864 } <span class="comment">/* end of bAddDummyImagePS */</span> -<a name="l00865"></a>00865 -<a name="l00866"></a>00866 <span class="comment">/*</span> -<a name="l00867"></a>00867 <span class="comment"> * vAddFontsPS - add the list of fonts and complete the prologue</span> -<a name="l00868"></a>00868 <span class="comment"> */</span> -<a name="l00869"></a>00869 <span class="keywordtype">void</span> -<a name="l00870"></a>00870 vAddFontsPS(diagram_type *pDiag) -<a name="l00871"></a>00871 { -<a name="l00872"></a>00872 FILE *pOutFile; -<a name="l00873"></a>00873 <span class="keyword">const</span> font_table_type *pTmp, *pTmp2; -<a name="l00874"></a>00874 <span class="keywordtype">size_t</span> tIndex; -<a name="l00875"></a>00875 <span class="keywordtype">int</span> iLineLen, iOurFontnameLen; -<a name="l00876"></a>00876 BOOL bFound; -<a name="l00877"></a>00877 -<a name="l00878"></a>00878 fail(pDiag == NULL); -<a name="l00879"></a>00879 fail(pDiag->pOutFile == NULL); -<a name="l00880"></a>00880 -<a name="l00881"></a>00881 pOutFile = pDiag->pOutFile; -<a name="l00882"></a>00882 iLineLen = fprintf(pOutFile, <span class="stringliteral">"%%%%DocumentFonts:"</span>); -<a name="l00883"></a>00883 -<a name="l00884"></a>00884 <span class="keywordflow">if</span> (tGetFontTableLength() == 0) { -<a name="l00885"></a>00885 iLineLen += fprintf(pOutFile, <span class="stringliteral">" Courier"</span>); -<a name="l00886"></a>00886 } <span class="keywordflow">else</span> { -<a name="l00887"></a>00887 pTmp = NULL; -<a name="l00888"></a>00888 <span class="keywordflow">while</span> ((pTmp = pGetNextFontTableRecord(pTmp)) != NULL) { -<a name="l00889"></a>00889 <span class="comment">/* Print the document fonts */</span> -<a name="l00890"></a>00890 bFound = FALSE; -<a name="l00891"></a>00891 pTmp2 = NULL; -<a name="l00892"></a>00892 <span class="keywordflow">while</span> ((pTmp2 = pGetNextFontTableRecord(pTmp2)) -<a name="l00893"></a>00893 != NULL && pTmp2 < pTmp) { -<a name="l00894"></a>00894 bFound = STREQ(pTmp2->szOurFontname, -<a name="l00895"></a>00895 pTmp->szOurFontname); -<a name="l00896"></a>00896 <span class="keywordflow">if</span> (bFound) { -<a name="l00897"></a>00897 <span class="keywordflow">break</span>; -<a name="l00898"></a>00898 } -<a name="l00899"></a>00899 } -<a name="l00900"></a>00900 iOurFontnameLen = (int)strlen(pTmp->szOurFontname); -<a name="l00901"></a>00901 <span class="keywordflow">if</span> (bFound || iOurFontnameLen <= 0) { -<a name="l00902"></a>00902 <span class="keywordflow">continue</span>; -<a name="l00903"></a>00903 } -<a name="l00904"></a>00904 <span class="keywordflow">if</span> (iLineLen + iOurFontnameLen > 76) { -<a name="l00905"></a>00905 fprintf(pOutFile, <span class="stringliteral">"\n%%%%+"</span>); -<a name="l00906"></a>00906 iLineLen = 3; -<a name="l00907"></a>00907 } -<a name="l00908"></a>00908 iLineLen += fprintf(pOutFile, -<a name="l00909"></a>00909 <span class="stringliteral">" %s"</span>, pTmp->szOurFontname); -<a name="l00910"></a>00910 } -<a name="l00911"></a>00911 } -<a name="l00912"></a>00912 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00913"></a>00913 fprintf(pOutFile, <span class="stringliteral">"%%%%Pages: (atend)\n"</span>); -<a name="l00914"></a>00914 fprintf(pOutFile, <span class="stringliteral">"%%%%EndComments\n"</span>); -<a name="l00915"></a>00915 fprintf(pOutFile, <span class="stringliteral">"%%%%BeginProlog\n"</span>); -<a name="l00916"></a>00916 -<a name="l00917"></a>00917 <span class="keywordflow">switch</span> (eEncoding) { -<a name="l00918"></a>00918 <span class="keywordflow">case</span> encoding_latin_1: -<a name="l00919"></a>00919 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00920"></a>00920 tIndex < elementsof(iso_8859_1_data); -<a name="l00921"></a>00921 tIndex++) { -<a name="l00922"></a>00922 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_1_data[tIndex]); -<a name="l00923"></a>00923 } -<a name="l00924"></a>00924 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00925"></a>00925 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00926"></a>00926 tIndex < elementsof(iso_8859_x_func); -<a name="l00927"></a>00927 tIndex++) { -<a name="l00928"></a>00928 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_x_func[tIndex]); -<a name="l00929"></a>00929 } -<a name="l00930"></a>00930 <span class="keywordflow">break</span>; -<a name="l00931"></a>00931 <span class="keywordflow">case</span> encoding_latin_2: -<a name="l00932"></a>00932 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00933"></a>00933 tIndex < elementsof(iso_8859_2_data); -<a name="l00934"></a>00934 tIndex++) { -<a name="l00935"></a>00935 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_2_data[tIndex]); -<a name="l00936"></a>00936 } -<a name="l00937"></a>00937 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00938"></a>00938 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00939"></a>00939 tIndex < elementsof(iso_8859_x_func); -<a name="l00940"></a>00940 tIndex++) { -<a name="l00941"></a>00941 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_x_func[tIndex]); -<a name="l00942"></a>00942 } -<a name="l00943"></a>00943 <span class="keywordflow">break</span>; -<a name="l00944"></a>00944 <span class="keywordflow">case</span> encoding_cyrillic: -<a name="l00945"></a>00945 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00946"></a>00946 tIndex < elementsof(iso_8859_5_data); -<a name="l00947"></a>00947 tIndex++) { -<a name="l00948"></a>00948 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_5_data[tIndex]); -<a name="l00949"></a>00949 } -<a name="l00950"></a>00950 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00951"></a>00951 <span class="keywordflow">for</span> (tIndex = 0; -<a name="l00952"></a>00952 tIndex < elementsof(iso_8859_x_func); -<a name="l00953"></a>00953 tIndex++) { -<a name="l00954"></a>00954 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, iso_8859_x_func[tIndex]); -<a name="l00955"></a>00955 } -<a name="l00956"></a>00956 <span class="keywordflow">break</span>; -<a name="l00957"></a>00957 <span class="keywordflow">case</span> encoding_utf_8: -<a name="l00958"></a>00958 werr(1, -<a name="l00959"></a>00959 <span class="stringliteral">"The combination PostScript and UTF-8 is not supported"</span>); -<a name="l00960"></a>00960 <span class="keywordflow">break</span>; -<a name="l00961"></a>00961 <span class="keywordflow">default</span>: -<a name="l00962"></a>00962 DBG_DEC(eEncoding); -<a name="l00963"></a>00963 <span class="keywordflow">break</span>; -<a name="l00964"></a>00964 } -<a name="l00965"></a>00965 -<a name="l00966"></a>00966 <span class="comment">/* The rest of the functions */</span> -<a name="l00967"></a>00967 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(misc_func); tIndex++) { -<a name="l00968"></a>00968 fprintf(pOutFile, <span class="stringliteral">"%s\n"</span>, misc_func[tIndex]); -<a name="l00969"></a>00969 } -<a name="l00970"></a>00970 fprintf(pOutFile, <span class="stringliteral">"%%%%EndProlog\n"</span>); -<a name="l00971"></a>00971 iPageCount = 1; -<a name="l00972"></a>00972 fprintf(pDiag->pOutFile, <span class="stringliteral">"%%%%Page: %d %d\n"</span>, iPageCount, iPageCount); -<a name="l00973"></a>00973 vAddPageSetup(pDiag->pOutFile); -<a name="l00974"></a>00974 vAddHeader(pDiag); -<a name="l00975"></a>00975 } <span class="comment">/* end of vAddFontsPS */</span> -<a name="l00976"></a>00976 -<a name="l00977"></a>00977 <span class="comment">/*</span> -<a name="l00978"></a>00978 <span class="comment"> * vPrintPS - print a PostScript string</span> -<a name="l00979"></a>00979 <span class="comment"> */</span> -<a name="l00980"></a>00980 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00981"></a>00981 vPrintPS(FILE *pFile, <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, -<a name="l00982"></a>00982 USHORT usFontstyle) -<a name="l00983"></a>00983 { -<a name="l00984"></a>00984 <span class="keywordtype">double</span> dSuperscriptMove, dSubscriptMove; -<a name="l00985"></a>00985 <span class="keyword">const</span> UCHAR *ucBytes; -<a name="l00986"></a>00986 <span class="keywordtype">size_t</span> tCount; -<a name="l00987"></a>00987 -<a name="l00988"></a>00988 fail(szString == NULL); -<a name="l00989"></a>00989 -<a name="l00990"></a>00990 <span class="keywordflow">if</span> (szString == NULL || szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00991"></a>00991 <span class="keywordflow">return</span>; -<a name="l00992"></a>00992 } -<a name="l00993"></a>00993 DBG_DEC_C(usFontSizeCurr < MIN_FONT_SIZE, usFontSizeCurr); -<a name="l00994"></a>00994 -<a name="l00995"></a>00995 dSuperscriptMove = 0.0; -<a name="l00996"></a>00996 dSubscriptMove = 0.0; -<a name="l00997"></a>00997 -<a name="l00998"></a>00998 <span class="comment">/* Up for superscript */</span> -<a name="l00999"></a>00999 <span class="keywordflow">if</span> (bIsSuperscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01000"></a>01000 dSuperscriptMove = (double)((usFontSizeCurr + 1) / 2) * 0.375; -<a name="l01001"></a>01001 fprintf(pFile, <span class="stringliteral">"0 %.2f rmoveto\n"</span>, dSuperscriptMove); -<a name="l01002"></a>01002 } -<a name="l01003"></a>01003 -<a name="l01004"></a>01004 <span class="comment">/* Down for subscript */</span> -<a name="l01005"></a>01005 <span class="keywordflow">if</span> (bIsSubscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01006"></a>01006 dSubscriptMove = (double)usFontSizeCurr * 0.125; -<a name="l01007"></a>01007 fprintf(pFile, <span class="stringliteral">"0 %.2f rmoveto\n"</span>, -dSubscriptMove); -<a name="l01008"></a>01008 } -<a name="l01009"></a>01009 -<a name="l01010"></a>01010 <span class="comment">/* Generate and print the PostScript output */</span> -<a name="l01011"></a>01011 ucBytes = (UCHAR *)szString; -<a name="l01012"></a>01012 (void)putc(<span class="charliteral">'('</span>, pFile); -<a name="l01013"></a>01013 <span class="keywordflow">for</span> (tCount = 0; tCount < tStringLength ; tCount++) { -<a name="l01014"></a>01014 <span class="keywordflow">switch</span> (ucBytes[tCount]) { -<a name="l01015"></a>01015 <span class="keywordflow">case</span> <span class="charliteral">'('</span>: -<a name="l01016"></a>01016 <span class="keywordflow">case</span> <span class="charliteral">')'</span>: -<a name="l01017"></a>01017 <span class="keywordflow">case</span> <span class="charliteral">'\\'</span>: -<a name="l01018"></a>01018 (void)putc(<span class="charliteral">'\\'</span>, pFile); -<a name="l01019"></a>01019 (void)putc(szString[tCount], pFile); -<a name="l01020"></a>01020 <span class="keywordflow">break</span>; -<a name="l01021"></a>01021 <span class="keywordflow">default</span>: -<a name="l01022"></a>01022 <span class="keywordflow">if</span> (ucBytes[tCount] < 0x20 || -<a name="l01023"></a>01023 (ucBytes[tCount] >= 0x7f && -<a name="l01024"></a>01024 ucBytes[tCount] < 0x8c)) { -<a name="l01025"></a>01025 DBG_HEX(ucBytes[tCount]); -<a name="l01026"></a>01026 (void)putc(<span class="charliteral">' '</span>, pFile); -<a name="l01027"></a>01027 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucBytes[tCount] >= 0x80) { -<a name="l01028"></a>01028 fprintf(pFile, <span class="stringliteral">"\\%03o"</span>, (UINT)ucBytes[tCount]); -<a name="l01029"></a>01029 } <span class="keywordflow">else</span> { -<a name="l01030"></a>01030 (void)putc(szString[tCount], pFile); -<a name="l01031"></a>01031 } -<a name="l01032"></a>01032 <span class="keywordflow">break</span>; -<a name="l01033"></a>01033 } -<a name="l01034"></a>01034 } -<a name="l01035"></a>01035 fprintf(pFile, <span class="stringliteral">") "</span>); -<a name="l01036"></a>01036 <span class="keywordflow">if</span> ((bIsStrike(usFontstyle) || bIsMarkDel(usFontstyle)) && -<a name="l01037"></a>01037 usFontSizeCurr != 0) { -<a name="l01038"></a>01038 fprintf(pFile, <span class="stringliteral">"%.2f %.2f LineShow\n"</span>, -<a name="l01039"></a>01039 (<span class="keywordtype">double</span>)usFontSizeCurr * 0.02, -<a name="l01040"></a>01040 (<span class="keywordtype">double</span>)usFontSizeCurr * 0.12); -<a name="l01041"></a>01041 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bIsUnderline(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01042"></a>01042 fprintf(pFile, <span class="stringliteral">"%.2f %.2f LineShow\n"</span>, -<a name="l01043"></a>01043 (<span class="keywordtype">double</span>)usFontSizeCurr * 0.02, -<a name="l01044"></a>01044 (<span class="keywordtype">double</span>)usFontSizeCurr * -0.06); -<a name="l01045"></a>01045 } <span class="keywordflow">else</span> { -<a name="l01046"></a>01046 fprintf(pFile, <span class="stringliteral">"show\n"</span>); -<a name="l01047"></a>01047 } -<a name="l01048"></a>01048 -<a name="l01049"></a>01049 <span class="comment">/* Undo the superscript move */</span> -<a name="l01050"></a>01050 <span class="keywordflow">if</span> (bIsSuperscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01051"></a>01051 fprintf(pFile, <span class="stringliteral">"0 %.2f rmoveto\n"</span>, -dSuperscriptMove); -<a name="l01052"></a>01052 } -<a name="l01053"></a>01053 -<a name="l01054"></a>01054 <span class="comment">/* Undo the subscript move */</span> -<a name="l01055"></a>01055 <span class="keywordflow">if</span> (bIsSubscript(usFontstyle) && usFontSizeCurr != 0) { -<a name="l01056"></a>01056 fprintf(pFile, <span class="stringliteral">"0 %.2f rmoveto\n"</span>, dSubscriptMove); -<a name="l01057"></a>01057 } -<a name="l01058"></a>01058 } <span class="comment">/* end of vPrintPS */</span> -<a name="l01059"></a>01059 -<a name="l01060"></a>01060 <span class="comment">/*</span> -<a name="l01061"></a>01061 <span class="comment"> * vSetColor - move to the specified color</span> -<a name="l01062"></a>01062 <span class="comment"> */</span> -<a name="l01063"></a>01063 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l01064"></a>01064 vSetColor(FILE *pFile, UCHAR ucFontColor) -<a name="l01065"></a>01065 { -<a name="l01066"></a>01066 ULONG ulTmp, ulRed, ulGreen, ulBlue; -<a name="l01067"></a>01067 -<a name="l01068"></a>01068 ulTmp = ulColor2Color(ucFontColor); -<a name="l01069"></a>01069 ulRed = (ulTmp & 0x0000ff00) >> 8; -<a name="l01070"></a>01070 ulGreen = (ulTmp & 0x00ff0000) >> 16; -<a name="l01071"></a>01071 ulBlue = (ulTmp & 0xff000000) >> 24; -<a name="l01072"></a>01072 fprintf(pFile, <span class="stringliteral">"%.3f %.3f %.3f setrgbcolor\n"</span>, -<a name="l01073"></a>01073 ulRed / 255.0, ulGreen / 255.0, ulBlue / 255.0); -<a name="l01074"></a>01074 } <span class="comment">/* end of vSetColor */</span> -<a name="l01075"></a>01075 -<a name="l01076"></a>01076 <span class="comment">/*</span> -<a name="l01077"></a>01077 <span class="comment"> * vMove2NextLinePS - move to the next line</span> -<a name="l01078"></a>01078 <span class="comment"> */</span> -<a name="l01079"></a>01079 <span class="keywordtype">void</span> -<a name="l01080"></a>01080 vMove2NextLinePS(diagram_type *pDiag, USHORT usFontSize) -<a name="l01081"></a>01081 { -<a name="l01082"></a>01082 fail(pDiag == NULL); -<a name="l01083"></a>01083 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01084"></a>01084 -<a name="l01085"></a>01085 pDiag->lYtop -= lComputeLeading(usFontSize); -<a name="l01086"></a>01086 } <span class="comment">/* end of vMove2NextLinePS */</span> -<a name="l01087"></a>01087 -<a name="l01088"></a>01088 <span class="comment">/*</span> -<a name="l01089"></a>01089 <span class="comment"> * vSubstringPS - print a sub string</span> -<a name="l01090"></a>01090 <span class="comment"> */</span> -<a name="l01091"></a>01091 <span class="keywordtype">void</span> -<a name="l01092"></a>01092 vSubstringPS(diagram_type *pDiag, -<a name="l01093"></a>01093 <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l01094"></a>01094 UCHAR ucFontColor, USHORT usFontstyle, drawfile_fontref tFontRef, -<a name="l01095"></a>01095 USHORT usFontSize, USHORT usMaxFontSize) -<a name="l01096"></a>01096 { -<a name="l01097"></a>01097 <span class="keyword">const</span> <span class="keywordtype">char</span> *szOurFontname; -<a name="l01098"></a>01098 -<a name="l01099"></a>01099 fail(pDiag == NULL || szString == NULL); -<a name="l01100"></a>01100 fail(pDiag->pOutFile == NULL); -<a name="l01101"></a>01101 fail(pDiag->lXleft < 0); -<a name="l01102"></a>01102 fail(tStringLength != strlen(szString)); -<a name="l01103"></a>01103 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01104"></a>01104 fail(usMaxFontSize < MIN_FONT_SIZE || usMaxFontSize > MAX_FONT_SIZE); -<a name="l01105"></a>01105 fail(usFontSize > usMaxFontSize); -<a name="l01106"></a>01106 -<a name="l01107"></a>01107 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l01108"></a>01108 <span class="keywordflow">return</span>; -<a name="l01109"></a>01109 } -<a name="l01110"></a>01110 -<a name="l01111"></a>01111 <span class="keywordflow">if</span> (tFontRef != tFontRefCurr || usFontSize != usFontSizeCurr) { -<a name="l01112"></a>01112 szOurFontname = szGetFontname(tFontRef); -<a name="l01113"></a>01113 fail(szOurFontname == NULL); -<a name="l01114"></a>01114 fprintf(pDiag->pOutFile, -<a name="l01115"></a>01115 <span class="stringliteral">"%.1f /%s /%s-ISO-8859-x ChgFnt\n"</span>, -<a name="l01116"></a>01116 (<span class="keywordtype">double</span>)usFontSize / 2.0, -<a name="l01117"></a>01117 szOurFontname, szOurFontname); -<a name="l01118"></a>01118 tFontRefCurr = tFontRef; -<a name="l01119"></a>01119 usFontSizeCurr = usFontSize; -<a name="l01120"></a>01120 } -<a name="l01121"></a>01121 <span class="keywordflow">if</span> ((<span class="keywordtype">int</span>)ucFontColor != iFontColorCurr) { -<a name="l01122"></a>01122 vSetColor(pDiag->pOutFile, ucFontColor); -<a name="l01123"></a>01123 iFontColorCurr = (int)ucFontColor; -<a name="l01124"></a>01124 } -<a name="l01125"></a>01125 vMoveTo(pDiag, lComputeLeading(usMaxFontSize)); -<a name="l01126"></a>01126 vPrintPS(pDiag->pOutFile, szString, tStringLength, usFontstyle); -<a name="l01127"></a>01127 pDiag->lXleft += lStringWidth; -<a name="l01128"></a>01128 } <span class="comment">/* end of vSubstringPS */</span> -<a name="l01129"></a>01129 -<a name="l01130"></a>01130 <span class="comment">/*</span> -<a name="l01131"></a>01131 <span class="comment"> * Create an start of paragraph by moving the y-top mark</span> -<a name="l01132"></a>01132 <span class="comment"> */</span> -<a name="l01133"></a>01133 <span class="keywordtype">void</span> -<a name="l01134"></a>01134 vStartOfParagraphPS(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) -<a name="l01135"></a>01135 { -<a name="l01136"></a>01136 fail(pDiag == NULL); -<a name="l01137"></a>01137 fail(lBeforeIndentation < 0); -<a name="l01138"></a>01138 -<a name="l01139"></a>01139 pDiag->lXleft = 0; -<a name="l01140"></a>01140 pDiag->lYtop -= lMilliPoints2DrawUnits(lBeforeIndentation); -<a name="l01141"></a>01141 } <span class="comment">/* end of vStartOfParagraphPS */</span> -<a name="l01142"></a>01142 -<a name="l01143"></a>01143 <span class="comment">/*</span> -<a name="l01144"></a>01144 <span class="comment"> * Create an end of paragraph by moving the y-top mark</span> -<a name="l01145"></a>01145 <span class="comment"> */</span> -<a name="l01146"></a>01146 <span class="keywordtype">void</span> -<a name="l01147"></a>01147 vEndOfParagraphPS(diagram_type *pDiag, -<a name="l01148"></a>01148 USHORT usFontSize, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l01149"></a>01149 { -<a name="l01150"></a>01150 fail(pDiag == NULL); -<a name="l01151"></a>01151 fail(pDiag->pOutFile == NULL); -<a name="l01152"></a>01152 fail(usFontSize < MIN_FONT_SIZE || usFontSize > MAX_FONT_SIZE); -<a name="l01153"></a>01153 fail(lAfterIndentation < 0); -<a name="l01154"></a>01154 -<a name="l01155"></a>01155 <span class="keywordflow">if</span> (pDiag->lXleft > 0) { -<a name="l01156"></a>01156 <span class="comment">/* To the start of the line */</span> -<a name="l01157"></a>01157 vMove2NextLinePS(pDiag, usFontSize); -<a name="l01158"></a>01158 } -<a name="l01159"></a>01159 -<a name="l01160"></a>01160 pDiag->lXleft = 0; -<a name="l01161"></a>01161 pDiag->lYtop -= lMilliPoints2DrawUnits(lAfterIndentation); -<a name="l01162"></a>01162 } <span class="comment">/* end of vEndOfParagraphPS */</span> -<a name="l01163"></a>01163 -<a name="l01164"></a>01164 <span class="comment">/*</span> -<a name="l01165"></a>01165 <span class="comment"> * Create an end of page</span> -<a name="l01166"></a>01166 <span class="comment"> */</span> -<a name="l01167"></a>01167 <span class="keywordtype">void</span> -<a name="l01168"></a>01168 vEndOfPagePS(diagram_type *pDiag, BOOL bNewSection) -<a name="l01169"></a>01169 { -<a name="l01170"></a>01170 vMove2NextPage(pDiag, bNewSection); -<a name="l01171"></a>01171 } <span class="comment">/* end of vEndOfPagePS */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/prop0_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,505 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/prop0.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/prop0.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * prop0.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the property information from a Word for DOS file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <time.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * tConvertDosDate - convert DOS date format</span> -<a name="l00016"></a>00016 <span class="comment"> *</span> -<a name="l00017"></a>00017 <span class="comment"> * returns Unix time_t or -1</span> -<a name="l00018"></a>00018 <span class="comment"> */</span> -<a name="l00019"></a>00019 <span class="keyword">static</span> time_t -<a name="l00020"></a>00020 tConvertDosDate(<span class="keyword">const</span> <span class="keywordtype">char</span> *szDosDate) -<a name="l00021"></a>00021 { -<a name="l00022"></a>00022 <span class="keyword">struct </span>tm tTime; -<a name="l00023"></a>00023 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00024"></a>00024 time_t tResult; -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 memset(&tTime, 0, <span class="keyword">sizeof</span>(tTime)); -<a name="l00027"></a>00027 pcTmp = szDosDate; -<a name="l00028"></a>00028 <span class="comment">/* Get the month */</span> -<a name="l00029"></a>00029 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00030"></a>00030 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00031"></a>00031 } -<a name="l00032"></a>00032 tTime.tm_mon = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00033"></a>00033 pcTmp++; -<a name="l00034"></a>00034 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00035"></a>00035 tTime.tm_mon *= 10; -<a name="l00036"></a>00036 tTime.tm_mon += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00037"></a>00037 pcTmp++; -<a name="l00038"></a>00038 } -<a name="l00039"></a>00039 <span class="comment">/* Get the first separater */</span> -<a name="l00040"></a>00040 <span class="keywordflow">if</span> (isalnum(*pcTmp)) { -<a name="l00041"></a>00041 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00042"></a>00042 } -<a name="l00043"></a>00043 pcTmp++; -<a name="l00044"></a>00044 <span class="comment">/* Get the day */</span> -<a name="l00045"></a>00045 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00046"></a>00046 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00047"></a>00047 } -<a name="l00048"></a>00048 tTime.tm_mday = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00049"></a>00049 pcTmp++; -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00051"></a>00051 tTime.tm_mday *= 10; -<a name="l00052"></a>00052 tTime.tm_mday += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00053"></a>00053 pcTmp++; -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 <span class="comment">/* Get the second separater */</span> -<a name="l00056"></a>00056 <span class="keywordflow">if</span> (isalnum(*pcTmp)) { -<a name="l00057"></a>00057 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00058"></a>00058 } -<a name="l00059"></a>00059 pcTmp++; -<a name="l00060"></a>00060 <span class="comment">/* Get the year */</span> -<a name="l00061"></a>00061 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00062"></a>00062 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00063"></a>00063 } -<a name="l00064"></a>00064 tTime.tm_year = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00065"></a>00065 pcTmp++; -<a name="l00066"></a>00066 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00067"></a>00067 tTime.tm_year *= 10; -<a name="l00068"></a>00068 tTime.tm_year += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00069"></a>00069 pcTmp++; -<a name="l00070"></a>00070 } -<a name="l00071"></a>00071 <span class="comment">/* Check the values */</span> -<a name="l00072"></a>00072 <span class="keywordflow">if</span> (tTime.tm_mon == 0 || tTime.tm_mday == 0 || tTime.tm_mday > 31) { -<a name="l00073"></a>00073 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00074"></a>00074 } -<a name="l00075"></a>00075 <span class="comment">/* Correct the values */</span> -<a name="l00076"></a>00076 tTime.tm_mon--; <span class="comment">/* From 01-12 to 00-11 */</span> -<a name="l00077"></a>00077 <span class="keywordflow">if</span> (tTime.tm_year < 80) { -<a name="l00078"></a>00078 tTime.tm_year += 100; <span class="comment">/* 00 means 2000 is 100 */</span> -<a name="l00079"></a>00079 } -<a name="l00080"></a>00080 tTime.tm_isdst = -1; -<a name="l00081"></a>00081 tResult = mktime(&tTime); -<a name="l00082"></a>00082 NO_DBG_MSG(ctime(&tResult)); -<a name="l00083"></a>00083 <span class="keywordflow">return</span> tResult; -<a name="l00084"></a>00084 } <span class="comment">/* end of tConvertDosDate */</span> -<a name="l00085"></a>00085 -<a name="l00086"></a>00086 <span class="comment">/*</span> -<a name="l00087"></a>00087 <span class="comment"> * Build the lists with Document Property Information for Word for DOS files</span> -<a name="l00088"></a>00088 <span class="comment"> */</span> -<a name="l00089"></a>00089 <span class="keywordtype">void</span> -<a name="l00090"></a>00090 vGet0DopInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00091"></a>00091 { -<a name="l00092"></a>00092 document_block_type tDocument; -<a name="l00093"></a>00093 UCHAR *aucBuffer; -<a name="l00094"></a>00094 ULONG ulBeginSumdInfo, ulBeginNextBlock; -<a name="l00095"></a>00095 <span class="keywordtype">size_t</span> tLen; -<a name="l00096"></a>00096 USHORT usOffset; -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 tDocument.ucHdrFtrSpecification = 0; -<a name="l00099"></a>00099 tDocument.usDefaultTabWidth = usGetWord(0x70, aucHeader); <span class="comment">/* dxaTab */</span> -<a name="l00100"></a>00100 tDocument.tCreateDate = (time_t)-1; -<a name="l00101"></a>00101 tDocument.tRevisedDate = (time_t)-1; -<a name="l00102"></a>00102 -<a name="l00103"></a>00103 ulBeginSumdInfo = 128 * (ULONG)usGetWord(0x1c, aucHeader); -<a name="l00104"></a>00104 DBG_HEX(ulBeginSumdInfo); -<a name="l00105"></a>00105 ulBeginNextBlock = 128 * (ULONG)usGetWord(0x6a, aucHeader); -<a name="l00106"></a>00106 DBG_HEX(ulBeginNextBlock); -<a name="l00107"></a>00107 -<a name="l00108"></a>00108 <span class="keywordflow">if</span> (ulBeginSumdInfo < ulBeginNextBlock && ulBeginNextBlock != 0) { -<a name="l00109"></a>00109 <span class="comment">/* There is a summary information block */</span> -<a name="l00110"></a>00110 tLen = (size_t)(ulBeginNextBlock - ulBeginSumdInfo); -<a name="l00111"></a>00111 aucBuffer = xmalloc(tLen); -<a name="l00112"></a>00112 <span class="comment">/* Read the summary information block */</span> -<a name="l00113"></a>00113 <span class="keywordflow">if</span> (bReadBytes(aucBuffer, tLen, ulBeginSumdInfo, pFile)) { -<a name="l00114"></a>00114 usOffset = usGetWord(12, aucBuffer); -<a name="l00115"></a>00115 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00116"></a>00116 NO_DBG_STRN(aucBuffer + usOffset, 8); -<a name="l00117"></a>00117 tDocument.tRevisedDate = -<a name="l00118"></a>00118 tConvertDosDate((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00119"></a>00119 } -<a name="l00120"></a>00120 usOffset = usGetWord(14, aucBuffer); -<a name="l00121"></a>00121 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00122"></a>00122 NO_DBG_STRN(aucBuffer + usOffset, 8); -<a name="l00123"></a>00123 tDocument.tCreateDate = -<a name="l00124"></a>00124 tConvertDosDate((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00125"></a>00125 } -<a name="l00126"></a>00126 } -<a name="l00127"></a>00127 aucBuffer = xfree(aucBuffer); -<a name="l00128"></a>00128 } -<a name="l00129"></a>00129 vCreateDocumentInfoList(&tDocument); -<a name="l00130"></a>00130 } <span class="comment">/* end of vGet0DopInfo */</span> -<a name="l00131"></a>00131 -<a name="l00132"></a>00132 <span class="comment">/*</span> -<a name="l00133"></a>00133 <span class="comment"> * Fill the section information block with information</span> -<a name="l00134"></a>00134 <span class="comment"> * from a Word for DOS file.</span> -<a name="l00135"></a>00135 <span class="comment"> */</span> -<a name="l00136"></a>00136 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00137"></a>00137 vGet0SectionInfo(<span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, -<a name="l00138"></a>00138 section_block_type *pSection) -<a name="l00139"></a>00139 { -<a name="l00140"></a>00140 USHORT usCcol; -<a name="l00141"></a>00141 UCHAR ucTmp; -<a name="l00142"></a>00142 -<a name="l00143"></a>00143 fail(aucGrpprl == NULL || pSection == NULL); -<a name="l00144"></a>00144 -<a name="l00145"></a>00145 <span class="keywordflow">if</span> (tBytes < 2) { -<a name="l00146"></a>00146 <span class="keywordflow">return</span>; -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 <span class="comment">/* bkc */</span> -<a name="l00149"></a>00149 ucTmp = ucGetByte(1, aucGrpprl); -<a name="l00150"></a>00150 DBG_HEX(ucTmp); -<a name="l00151"></a>00151 ucTmp &= 0x07; -<a name="l00152"></a>00152 DBG_HEX(ucTmp); -<a name="l00153"></a>00153 pSection->bNewPage = ucTmp != 0 && ucTmp != 1; -<a name="l00154"></a>00154 <span class="keywordflow">if</span> (tBytes < 18) { -<a name="l00155"></a>00155 <span class="keywordflow">return</span>; -<a name="l00156"></a>00156 } -<a name="l00157"></a>00157 <span class="comment">/* ccolM1 */</span> -<a name="l00158"></a>00158 usCcol = (USHORT)ucGetByte(17, aucGrpprl); -<a name="l00159"></a>00159 DBG_DEC(usCcol); -<a name="l00160"></a>00160 } <span class="comment">/* end of vGet0SectionInfo */</span> -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="comment">/*</span> -<a name="l00163"></a>00163 <span class="comment"> * Build the lists with Section Property Information for Word for DOS files</span> -<a name="l00164"></a>00164 <span class="comment"> */</span> -<a name="l00165"></a>00165 <span class="keywordtype">void</span> -<a name="l00166"></a>00166 vGet0SepInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00167"></a>00167 { -<a name="l00168"></a>00168 section_block_type tSection; -<a name="l00169"></a>00169 UCHAR *aucBuffer; -<a name="l00170"></a>00170 ULONG ulBeginOfText, ulTextOffset, ulBeginSectInfo; -<a name="l00171"></a>00171 ULONG ulCharPos, ulSectPage, ulBeginNextBlock; -<a name="l00172"></a>00172 <span class="keywordtype">size_t</span> tSectInfoLen, tIndex, tSections, tBytes; -<a name="l00173"></a>00173 UCHAR aucTmp[2], aucFpage[35]; -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 fail(pFile == NULL || aucHeader == NULL); -<a name="l00176"></a>00176 -<a name="l00177"></a>00177 ulBeginOfText = 128; -<a name="l00178"></a>00178 NO_DBG_HEX(ulBeginOfText); -<a name="l00179"></a>00179 ulBeginSectInfo = 128 * (ULONG)usGetWord(0x18, aucHeader); -<a name="l00180"></a>00180 DBG_HEX(ulBeginSectInfo); -<a name="l00181"></a>00181 ulBeginNextBlock = 128 * (ULONG)usGetWord(0x1a, aucHeader); -<a name="l00182"></a>00182 DBG_HEX(ulBeginNextBlock); -<a name="l00183"></a>00183 <span class="keywordflow">if</span> (ulBeginSectInfo == ulBeginNextBlock) { -<a name="l00184"></a>00184 <span class="comment">/* There is no section information block */</span> -<a name="l00185"></a>00185 <span class="keywordflow">return</span>; -<a name="l00186"></a>00186 } -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="comment">/* Get the the number of sections */</span> -<a name="l00189"></a>00189 <span class="keywordflow">if</span> (!bReadBytes(aucTmp, 2, ulBeginSectInfo, pFile)) { -<a name="l00190"></a>00190 <span class="keywordflow">return</span>; -<a name="l00191"></a>00191 } -<a name="l00192"></a>00192 tSections = (size_t)usGetWord(0, aucTmp); -<a name="l00193"></a>00193 NO_DBG_DEC(tSections); -<a name="l00194"></a>00194 -<a name="l00195"></a>00195 <span class="comment">/* Read the Section Descriptors */</span> -<a name="l00196"></a>00196 tSectInfoLen = 10 * tSections; -<a name="l00197"></a>00197 NO_DBG_DEC(tSectInfoLen); -<a name="l00198"></a>00198 aucBuffer = xmalloc(tSectInfoLen); -<a name="l00199"></a>00199 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tSectInfoLen, ulBeginSectInfo + 4, pFile)) { -<a name="l00200"></a>00200 aucBuffer = xfree(aucBuffer); -<a name="l00201"></a>00201 <span class="keywordflow">return</span>; -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 NO_DBG_PRINT_BLOCK(aucBuffer, tSectInfoLen); -<a name="l00204"></a>00204 -<a name="l00205"></a>00205 <span class="comment">/* Read the Section Properties */</span> -<a name="l00206"></a>00206 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tSections; tIndex++) { -<a name="l00207"></a>00207 ulTextOffset = ulGetLong(10 * tIndex, aucBuffer); -<a name="l00208"></a>00208 NO_DBG_HEX(ulTextOffset); -<a name="l00209"></a>00209 ulCharPos = ulBeginOfText + ulTextOffset; -<a name="l00210"></a>00210 NO_DBG_HEX(ulTextOffset); -<a name="l00211"></a>00211 ulSectPage = ulGetLong(10 * tIndex + 6, aucBuffer); -<a name="l00212"></a>00212 NO_DBG_HEX(ulSectPage); -<a name="l00213"></a>00213 <span class="keywordflow">if</span> (ulSectPage == FC_INVALID || <span class="comment">/* Must use defaults */</span> -<a name="l00214"></a>00214 ulSectPage < 128 || <span class="comment">/* Should not happen */</span> -<a name="l00215"></a>00215 ulSectPage >= ulBeginSectInfo) { <span class="comment">/* Should not happen */</span> -<a name="l00216"></a>00216 DBG_HEX_C(ulSectPage != FC_INVALID, ulSectPage); -<a name="l00217"></a>00217 vDefault2SectionInfoList(ulCharPos); -<a name="l00218"></a>00218 <span class="keywordflow">continue</span>; -<a name="l00219"></a>00219 } -<a name="l00220"></a>00220 <span class="comment">/* Get the number of bytes to read */</span> -<a name="l00221"></a>00221 <span class="keywordflow">if</span> (!bReadBytes(aucTmp, 1, ulSectPage, pFile)) { -<a name="l00222"></a>00222 <span class="keywordflow">continue</span>; -<a name="l00223"></a>00223 } -<a name="l00224"></a>00224 tBytes = 1 + (size_t)ucGetByte(0, aucTmp); -<a name="l00225"></a>00225 NO_DBG_DEC(tBytes); -<a name="l00226"></a>00226 <span class="keywordflow">if</span> (tBytes > <span class="keyword">sizeof</span>(aucFpage)) { -<a name="l00227"></a>00227 DBG_DEC(tBytes); -<a name="l00228"></a>00228 tBytes = <span class="keyword">sizeof</span>(aucFpage); -<a name="l00229"></a>00229 } -<a name="l00230"></a>00230 <span class="comment">/* Read the bytes */</span> -<a name="l00231"></a>00231 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, tBytes, ulSectPage, pFile)) { -<a name="l00232"></a>00232 <span class="keywordflow">continue</span>; -<a name="l00233"></a>00233 } -<a name="l00234"></a>00234 NO_DBG_PRINT_BLOCK(aucFpage, tBytes); -<a name="l00235"></a>00235 <span class="comment">/* Process the bytes */</span> -<a name="l00236"></a>00236 vGetDefaultSection(&tSection); -<a name="l00237"></a>00237 vGet0SectionInfo(aucFpage + 1, tBytes - 1, &tSection); -<a name="l00238"></a>00238 vAdd2SectionInfoList(&tSection, ulCharPos); -<a name="l00239"></a>00239 } -<a name="l00240"></a>00240 <span class="comment">/* Clean up before you leave */</span> -<a name="l00241"></a>00241 aucBuffer = xfree(aucBuffer); -<a name="l00242"></a>00242 } <span class="comment">/* end of vGet0SepInfo */</span> -<a name="l00243"></a>00243 -<a name="l00244"></a>00244 <span class="comment">/*</span> -<a name="l00245"></a>00245 <span class="comment"> * Fill the style information block with information</span> -<a name="l00246"></a>00246 <span class="comment"> * from a Word for DOS file.</span> -<a name="l00247"></a>00247 <span class="comment"> */</span> -<a name="l00248"></a>00248 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00249"></a>00249 vGet0StyleInfo(<span class="keywordtype">int</span> iFodo, <span class="keyword">const</span> UCHAR *aucGrpprl, style_block_type *pStyle) -<a name="l00250"></a>00250 { -<a name="l00251"></a>00251 <span class="keywordtype">int</span> iBytes; -<a name="l00252"></a>00252 UCHAR ucTmp; -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 fail(iFodo <= 0 || aucGrpprl == NULL || pStyle == NULL); -<a name="l00255"></a>00255 -<a name="l00256"></a>00256 pStyle->usIstdNext = ISTD_NORMAL; -<a name="l00257"></a>00257 -<a name="l00258"></a>00258 iBytes = (int)ucGetByte(iFodo, aucGrpprl); -<a name="l00259"></a>00259 <span class="keywordflow">if</span> (iBytes < 1) { -<a name="l00260"></a>00260 <span class="keywordflow">return</span>; -<a name="l00261"></a>00261 } -<a name="l00262"></a>00262 <span class="comment">/* stc if styled */</span> -<a name="l00263"></a>00263 ucTmp = ucGetByte(iFodo + 1, aucGrpprl); -<a name="l00264"></a>00264 <span class="keywordflow">if</span> ((ucTmp & BIT(0)) != 0) { -<a name="l00265"></a>00265 ucTmp >>= 1; -<a name="l00266"></a>00266 <span class="keywordflow">if</span> (ucTmp >= 88 && ucTmp <= 94) { -<a name="l00267"></a>00267 <span class="comment">/* Header levels 1 through 7 */</span> -<a name="l00268"></a>00268 pStyle->usIstd = ucTmp - 87; -<a name="l00269"></a>00269 pStyle->ucNumLevel = 1; -<a name="l00270"></a>00270 } -<a name="l00271"></a>00271 } -<a name="l00272"></a>00272 <span class="keywordflow">if</span> (iBytes < 2) { -<a name="l00273"></a>00273 <span class="keywordflow">return</span>; -<a name="l00274"></a>00274 } -<a name="l00275"></a>00275 <span class="comment">/* jc */</span> -<a name="l00276"></a>00276 ucTmp = ucGetByte(iFodo + 2, aucGrpprl); -<a name="l00277"></a>00277 pStyle->ucAlignment = ucTmp & 0x02; -<a name="l00278"></a>00278 <span class="keywordflow">if</span> (iBytes < 3) { -<a name="l00279"></a>00279 <span class="keywordflow">return</span>; -<a name="l00280"></a>00280 } -<a name="l00281"></a>00281 <span class="comment">/* stc */</span> -<a name="l00282"></a>00282 ucTmp = ucGetByte(iFodo + 3, aucGrpprl); -<a name="l00283"></a>00283 ucTmp &= 0x7f; -<a name="l00284"></a>00284 <span class="keywordflow">if</span> (ucTmp >= 88 && ucTmp <= 94) { -<a name="l00285"></a>00285 <span class="comment">/* Header levels 1 through 7 */</span> -<a name="l00286"></a>00286 pStyle->usIstd = ucTmp - 87; -<a name="l00287"></a>00287 pStyle->ucNumLevel = 1; -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 <span class="keywordflow">if</span> (iBytes < 6) { -<a name="l00290"></a>00290 <span class="keywordflow">return</span>; -<a name="l00291"></a>00291 } -<a name="l00292"></a>00292 <span class="comment">/* dxaRight */</span> -<a name="l00293"></a>00293 pStyle->sRightIndent = (short)usGetWord(iFodo + 5, aucGrpprl); -<a name="l00294"></a>00294 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00295"></a>00295 <span class="keywordflow">if</span> (iBytes < 8) { -<a name="l00296"></a>00296 <span class="keywordflow">return</span>; -<a name="l00297"></a>00297 } -<a name="l00298"></a>00298 <span class="comment">/* dxaLeft */</span> -<a name="l00299"></a>00299 pStyle->sLeftIndent = (short)usGetWord(iFodo + 7, aucGrpprl); -<a name="l00300"></a>00300 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00301"></a>00301 <span class="keywordflow">if</span> (iBytes < 10) { -<a name="l00302"></a>00302 <span class="keywordflow">return</span>; -<a name="l00303"></a>00303 } -<a name="l00304"></a>00304 <span class="comment">/* dxaLeft1 */</span> -<a name="l00305"></a>00305 pStyle->sLeftIndent1 = (short)usGetWord(iFodo + 9, aucGrpprl); -<a name="l00306"></a>00306 NO_DBG_DEC(pStyle->sLeftIndent1); -<a name="l00307"></a>00307 <span class="keywordflow">if</span> (iBytes < 14) { -<a name="l00308"></a>00308 <span class="keywordflow">return</span>; -<a name="l00309"></a>00309 } -<a name="l00310"></a>00310 <span class="comment">/* dyaBefore */</span> -<a name="l00311"></a>00311 pStyle->usBeforeIndent = usGetWord(iFodo + 13, aucGrpprl); -<a name="l00312"></a>00312 NO_DBG_DEC(pStyle->usBeforeIndent); -<a name="l00313"></a>00313 <span class="keywordflow">if</span> (iBytes < 16) { -<a name="l00314"></a>00314 <span class="keywordflow">return</span>; -<a name="l00315"></a>00315 } -<a name="l00316"></a>00316 <span class="comment">/* dyaAfter */</span> -<a name="l00317"></a>00317 pStyle->usAfterIndent = usGetWord(iFodo + 15, aucGrpprl); -<a name="l00318"></a>00318 NO_DBG_DEC(pStyle->usAfterIndent); -<a name="l00319"></a>00319 } <span class="comment">/* end of vGet0StyleInfo */</span> -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 <span class="comment">/*</span> -<a name="l00322"></a>00322 <span class="comment"> * Build the lists with Paragraph Information for Word for DOS files</span> -<a name="l00323"></a>00323 <span class="comment"> */</span> -<a name="l00324"></a>00324 <span class="keywordtype">void</span> -<a name="l00325"></a>00325 vGet0PapInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00326"></a>00326 { -<a name="l00327"></a>00327 style_block_type tStyle; -<a name="l00328"></a>00328 ULONG ulBeginParfInfo, ulCharPos, ulCharPosNext; -<a name="l00329"></a>00329 <span class="keywordtype">int</span> iIndex, iRun, iFodo; -<a name="l00330"></a>00330 UCHAR aucFpage[128]; -<a name="l00331"></a>00331 -<a name="l00332"></a>00332 fail(pFile == NULL || aucHeader == NULL); -<a name="l00333"></a>00333 -<a name="l00334"></a>00334 ulBeginParfInfo = 128 * (ULONG)usGetWord(0x12, aucHeader); -<a name="l00335"></a>00335 NO_DBG_HEX(ulBeginParfInfo); -<a name="l00336"></a>00336 -<a name="l00337"></a>00337 <span class="keywordflow">do</span> { -<a name="l00338"></a>00338 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, 128, ulBeginParfInfo, pFile)) { -<a name="l00339"></a>00339 <span class="keywordflow">return</span>; -<a name="l00340"></a>00340 } -<a name="l00341"></a>00341 NO_DBG_PRINT_BLOCK(aucFpage, 128); -<a name="l00342"></a>00342 ulCharPosNext = ulGetLong(0, aucFpage); -<a name="l00343"></a>00343 iRun = (int)ucGetByte(0x7f, aucFpage); -<a name="l00344"></a>00344 NO_DBG_DEC(iRun); -<a name="l00345"></a>00345 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iRun; iIndex++) { -<a name="l00346"></a>00346 iFodo = (int)usGetWord(6 * iIndex + 8, aucFpage); -<a name="l00347"></a>00347 <span class="keywordflow">if</span> (iFodo <= 0 || iFodo > 0x79) { -<a name="l00348"></a>00348 DBG_DEC_C(iFodo != (<span class="keywordtype">int</span>)0xffff, iFodo); -<a name="l00349"></a>00349 <span class="keywordflow">continue</span>; -<a name="l00350"></a>00350 } -<a name="l00351"></a>00351 vFillStyleFromStylesheet(0, &tStyle); -<a name="l00352"></a>00352 vGet0StyleInfo(iFodo, aucFpage + 4, &tStyle); -<a name="l00353"></a>00353 ulCharPos = ulCharPosNext; -<a name="l00354"></a>00354 ulCharPosNext = ulGetLong(6 * iIndex + 4, aucFpage); -<a name="l00355"></a>00355 tStyle.ulFileOffset = ulCharPos; -<a name="l00356"></a>00356 vAdd2StyleInfoList(&tStyle); -<a name="l00357"></a>00357 } -<a name="l00358"></a>00358 ulBeginParfInfo += 128; -<a name="l00359"></a>00359 } <span class="keywordflow">while</span> (ulCharPosNext == ulBeginParfInfo); -<a name="l00360"></a>00360 } <span class="comment">/* end of vGet0PapInfo */</span> -<a name="l00361"></a>00361 -<a name="l00362"></a>00362 <span class="comment">/*</span> -<a name="l00363"></a>00363 <span class="comment"> * Fill the font information block with information</span> -<a name="l00364"></a>00364 <span class="comment"> * from a Word for DOS file.</span> -<a name="l00365"></a>00365 <span class="comment"> */</span> -<a name="l00366"></a>00366 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00367"></a>00367 vGet0FontInfo(<span class="keywordtype">int</span> iFodo, <span class="keyword">const</span> UCHAR *aucGrpprl, font_block_type *pFont) -<a name="l00368"></a>00368 { -<a name="l00369"></a>00369 <span class="keywordtype">int</span> iBytes; -<a name="l00370"></a>00370 UCHAR ucTmp; -<a name="l00371"></a>00371 -<a name="l00372"></a>00372 fail(iFodo <= 0 || aucGrpprl == NULL || pFont == NULL); -<a name="l00373"></a>00373 -<a name="l00374"></a>00374 iBytes = (int)ucGetByte(iFodo, aucGrpprl); -<a name="l00375"></a>00375 <span class="keywordflow">if</span> (iBytes < 2) { -<a name="l00376"></a>00376 <span class="keywordflow">return</span>; -<a name="l00377"></a>00377 } -<a name="l00378"></a>00378 <span class="comment">/* fBold, fItalic, cFtc */</span> -<a name="l00379"></a>00379 ucTmp = ucGetByte(iFodo + 2, aucGrpprl); -<a name="l00380"></a>00380 <span class="keywordflow">if</span> ((ucTmp & BIT(0)) != 0) { -<a name="l00381"></a>00381 pFont->usFontStyle |= FONT_BOLD; -<a name="l00382"></a>00382 } -<a name="l00383"></a>00383 <span class="keywordflow">if</span> ((ucTmp & BIT(1)) != 0) { -<a name="l00384"></a>00384 pFont->usFontStyle |= FONT_ITALIC; -<a name="l00385"></a>00385 } -<a name="l00386"></a>00386 pFont->ucFontNumber = ucTmp >> 2; -<a name="l00387"></a>00387 NO_DBG_DEC(pFont->ucFontNumber); -<a name="l00388"></a>00388 <span class="keywordflow">if</span> (iBytes < 3) { -<a name="l00389"></a>00389 <span class="keywordflow">return</span>; -<a name="l00390"></a>00390 } -<a name="l00391"></a>00391 <span class="comment">/* cHps */</span> -<a name="l00392"></a>00392 pFont->usFontSize = (USHORT)ucGetByte(iFodo + 3, aucGrpprl); -<a name="l00393"></a>00393 NO_DBG_DEC(pFont->usFontSize); -<a name="l00394"></a>00394 <span class="keywordflow">if</span> (iBytes < 4) { -<a name="l00395"></a>00395 <span class="keywordflow">return</span>; -<a name="l00396"></a>00396 } -<a name="l00397"></a>00397 <span class="comment">/* cKul, fStrike, fCaps, fSmallCaps, fVanish */</span> -<a name="l00398"></a>00398 ucTmp = ucGetByte(iFodo + 4, aucGrpprl); -<a name="l00399"></a>00399 <span class="keywordflow">if</span> ((ucTmp & BIT(0)) != 0 || (ucTmp & BIT(2)) != 0) { -<a name="l00400"></a>00400 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00401"></a>00401 } -<a name="l00402"></a>00402 <span class="keywordflow">if</span> ((ucTmp & BIT(1)) != 0) { -<a name="l00403"></a>00403 pFont->usFontStyle |= FONT_STRIKE; -<a name="l00404"></a>00404 } -<a name="l00405"></a>00405 <span class="keywordflow">if</span> ((ucTmp & BIT(4)) != 0) { -<a name="l00406"></a>00406 pFont->usFontStyle |= FONT_CAPITALS; -<a name="l00407"></a>00407 } -<a name="l00408"></a>00408 <span class="keywordflow">if</span> ((ucTmp & BIT(5)) != 0) { -<a name="l00409"></a>00409 pFont->usFontStyle |= FONT_SMALL_CAPITALS; -<a name="l00410"></a>00410 } -<a name="l00411"></a>00411 <span class="keywordflow">if</span> ((ucTmp & BIT(7)) != 0) { -<a name="l00412"></a>00412 pFont->usFontStyle |= FONT_HIDDEN; -<a name="l00413"></a>00413 } -<a name="l00414"></a>00414 DBG_HEX(pFont->usFontStyle); -<a name="l00415"></a>00415 <span class="keywordflow">if</span> (iBytes < 6) { -<a name="l00416"></a>00416 <span class="keywordflow">return</span>; -<a name="l00417"></a>00417 } -<a name="l00418"></a>00418 <span class="comment">/* cIss */</span> -<a name="l00419"></a>00419 ucTmp = ucGetByte(iFodo + 6, aucGrpprl); -<a name="l00420"></a>00420 <span class="keywordflow">if</span> (ucTmp != 0) { -<a name="l00421"></a>00421 <span class="keywordflow">if</span> (ucTmp < 128) { -<a name="l00422"></a>00422 pFont->usFontStyle |= FONT_SUPERSCRIPT; -<a name="l00423"></a>00423 DBG_MSG(<span class="stringliteral">"Superscript"</span>); -<a name="l00424"></a>00424 } <span class="keywordflow">else</span> { -<a name="l00425"></a>00425 pFont->usFontStyle |= FONT_SUBSCRIPT; -<a name="l00426"></a>00426 DBG_MSG(<span class="stringliteral">"Subscript"</span>); -<a name="l00427"></a>00427 } -<a name="l00428"></a>00428 } -<a name="l00429"></a>00429 <span class="keywordflow">if</span> (iBytes < 7) { -<a name="l00430"></a>00430 <span class="keywordflow">return</span>; -<a name="l00431"></a>00431 } -<a name="l00432"></a>00432 <span class="comment">/* cIco */</span> -<a name="l00433"></a>00433 ucTmp = ucGetByte(iFodo + 7, aucGrpprl); -<a name="l00434"></a>00434 <span class="keywordflow">switch</span> (ucTmp & 0x07) { -<a name="l00435"></a>00435 <span class="keywordflow">case</span> 0: pFont->ucFontColor = FONT_COLOR_BLACK; <span class="keywordflow">break</span>; -<a name="l00436"></a>00436 <span class="keywordflow">case</span> 1: pFont->ucFontColor = FONT_COLOR_RED; <span class="keywordflow">break</span>; -<a name="l00437"></a>00437 <span class="keywordflow">case</span> 2: pFont->ucFontColor = FONT_COLOR_GREEN; <span class="keywordflow">break</span>; -<a name="l00438"></a>00438 <span class="keywordflow">case</span> 3: pFont->ucFontColor = FONT_COLOR_BLUE; <span class="keywordflow">break</span>; -<a name="l00439"></a>00439 <span class="keywordflow">case</span> 4: pFont->ucFontColor = FONT_COLOR_CYAN; <span class="keywordflow">break</span>; -<a name="l00440"></a>00440 <span class="keywordflow">case</span> 5: pFont->ucFontColor = FONT_COLOR_MAGENTA; <span class="keywordflow">break</span>; -<a name="l00441"></a>00441 <span class="keywordflow">case</span> 6: pFont->ucFontColor = FONT_COLOR_YELLOW; <span class="keywordflow">break</span>; -<a name="l00442"></a>00442 <span class="keywordflow">case</span> 7: pFont->ucFontColor = FONT_COLOR_WHITE; <span class="keywordflow">break</span>; -<a name="l00443"></a>00443 <span class="keywordflow">default</span>:pFont->ucFontColor = FONT_COLOR_BLACK; <span class="keywordflow">break</span>; -<a name="l00444"></a>00444 } -<a name="l00445"></a>00445 NO_DBG_DEC(pFont->ucFontColor); -<a name="l00446"></a>00446 } <span class="comment">/* end of vGet0FontInfo */</span> -<a name="l00447"></a>00447 -<a name="l00448"></a>00448 <span class="comment">/*</span> -<a name="l00449"></a>00449 <span class="comment"> * Build the lists with Character Information for Word for DOS files</span> -<a name="l00450"></a>00450 <span class="comment"> */</span> -<a name="l00451"></a>00451 <span class="keywordtype">void</span> -<a name="l00452"></a>00452 vGet0ChrInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00453"></a>00453 { -<a name="l00454"></a>00454 font_block_type tFont; -<a name="l00455"></a>00455 ULONG ulBeginCharInfo, ulCharPos, ulCharPosNext; -<a name="l00456"></a>00456 <span class="keywordtype">int</span> iIndex, iRun, iFodo; -<a name="l00457"></a>00457 UCHAR aucFpage[128]; -<a name="l00458"></a>00458 -<a name="l00459"></a>00459 fail(pFile == NULL || aucHeader == NULL); -<a name="l00460"></a>00460 -<a name="l00461"></a>00461 ulBeginCharInfo = ulGetLong(0x0e, aucHeader); -<a name="l00462"></a>00462 NO_DBG_HEX(ulBeginCharInfo); -<a name="l00463"></a>00463 ulBeginCharInfo = ROUND128(ulBeginCharInfo); -<a name="l00464"></a>00464 NO_DBG_HEX(ulBeginCharInfo); -<a name="l00465"></a>00465 -<a name="l00466"></a>00466 <span class="keywordflow">do</span> { -<a name="l00467"></a>00467 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, 128, ulBeginCharInfo, pFile)) { -<a name="l00468"></a>00468 <span class="keywordflow">return</span>; -<a name="l00469"></a>00469 } -<a name="l00470"></a>00470 NO_DBG_PRINT_BLOCK(aucFpage, 128); -<a name="l00471"></a>00471 ulCharPosNext = ulGetLong(0, aucFpage); -<a name="l00472"></a>00472 iRun = (int)ucGetByte(0x7f, aucFpage); -<a name="l00473"></a>00473 NO_DBG_DEC(iRun); -<a name="l00474"></a>00474 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iRun; iIndex++) { -<a name="l00475"></a>00475 iFodo = (int)usGetWord(6 * iIndex + 8, aucFpage); -<a name="l00476"></a>00476 <span class="keywordflow">if</span> (iFodo <= 0 || iFodo > 0x79) { -<a name="l00477"></a>00477 DBG_DEC_C(iFodo != (<span class="keywordtype">int</span>)0xffff, iFodo); -<a name="l00478"></a>00478 <span class="keywordflow">continue</span>; -<a name="l00479"></a>00479 } -<a name="l00480"></a>00480 vFillFontFromStylesheet(0, &tFont); -<a name="l00481"></a>00481 vGet0FontInfo(iFodo, aucFpage + 4, &tFont); -<a name="l00482"></a>00482 ulCharPos = ulCharPosNext; -<a name="l00483"></a>00483 ulCharPosNext = ulGetLong(6 * iIndex + 4, aucFpage); -<a name="l00484"></a>00484 tFont.ulFileOffset = ulCharPos; -<a name="l00485"></a>00485 vAdd2FontInfoList(&tFont); -<a name="l00486"></a>00486 } -<a name="l00487"></a>00487 ulBeginCharInfo += 128; -<a name="l00488"></a>00488 } <span class="keywordflow">while</span> (ulCharPosNext == ulBeginCharInfo); -<a name="l00489"></a>00489 } <span class="comment">/* end of vGet0ChrInfo */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/prop2_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1083 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/prop2.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/prop2.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * prop2.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the property information from a WinWord 1 or 2 file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#define MAX_FILESIZE 0x2000000UL </span><span class="comment">/* 32 Mb */</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="comment">/*</span> -<a name="l00016"></a>00016 <span class="comment"> * iGet2InfoLength - the length of the information for WinWord 1/2 files</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00019"></a>00019 iGet2InfoLength(<span class="keywordtype">int</span> iByteNbr, <span class="keyword">const</span> UCHAR *aucGrpprl) -<a name="l00020"></a>00020 { -<a name="l00021"></a>00021 <span class="keywordtype">int</span> iTmp, iDel, iAdd; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 <span class="keywordflow">switch</span> (ucGetByte(iByteNbr, aucGrpprl)) { -<a name="l00024"></a>00024 <span class="keywordflow">case</span> 3: <span class="keywordflow">case</span> 15: <span class="keywordflow">case</span> 78: <span class="keywordflow">case</span> 152: <span class="keywordflow">case</span> 154: <span class="keywordflow">case</span> 155: -<a name="l00025"></a>00025 <span class="keywordflow">return</span> 2 + (int)ucGetByte(iByteNbr + 1, aucGrpprl); -<a name="l00026"></a>00026 <span class="keywordflow">case</span> 16: <span class="keywordflow">case</span> 17: <span class="keywordflow">case</span> 18: <span class="keywordflow">case</span> 19: <span class="keywordflow">case</span> 21: <span class="keywordflow">case</span> 22: <span class="keywordflow">case</span> 26: -<a name="l00027"></a>00027 <span class="keywordflow">case</span> 27: <span class="keywordflow">case</span> 28: <span class="keywordflow">case</span> 30: <span class="keywordflow">case</span> 31: <span class="keywordflow">case</span> 32: <span class="keywordflow">case</span> 33: <span class="keywordflow">case</span> 34: -<a name="l00028"></a>00028 <span class="keywordflow">case</span> 35: <span class="keywordflow">case</span> 36: <span class="keywordflow">case</span> 38: <span class="keywordflow">case</span> 39: <span class="keywordflow">case</span> 40: <span class="keywordflow">case</span> 41: <span class="keywordflow">case</span> 42: -<a name="l00029"></a>00029 <span class="keywordflow">case</span> 43: <span class="keywordflow">case</span> 45: <span class="keywordflow">case</span> 46: <span class="keywordflow">case</span> 47: <span class="keywordflow">case</span> 48: <span class="keywordflow">case</span> 49: <span class="keywordflow">case</span> 68: -<a name="l00030"></a>00030 <span class="keywordflow">case</span> 71: <span class="keywordflow">case</span> 72: <span class="keywordflow">case</span> 82: <span class="keywordflow">case</span> 83: <span class="keywordflow">case</span> 96: <span class="keywordflow">case</span> 97: <span class="keywordflow">case</span> 98: -<a name="l00031"></a>00031 <span class="keywordflow">case</span> 99: <span class="keywordflow">case</span> 115: <span class="keywordflow">case</span> 116: <span class="keywordflow">case</span> 119: <span class="keywordflow">case</span> 120: <span class="keywordflow">case</span> 123: <span class="keywordflow">case</span> 124: -<a name="l00032"></a>00032 <span class="keywordflow">case</span> 129: <span class="keywordflow">case</span> 130: <span class="keywordflow">case</span> 131: <span class="keywordflow">case</span> 132: <span class="keywordflow">case</span> 135: <span class="keywordflow">case</span> 136: <span class="keywordflow">case</span> 139: -<a name="l00033"></a>00033 <span class="keywordflow">case</span> 140: <span class="keywordflow">case</span> 141: <span class="keywordflow">case</span> 142: <span class="keywordflow">case</span> 143: <span class="keywordflow">case</span> 144: <span class="keywordflow">case</span> 145: <span class="keywordflow">case</span> 146: -<a name="l00034"></a>00034 <span class="keywordflow">case</span> 147: <span class="keywordflow">case</span> 148: <span class="keywordflow">case</span> 153: <span class="keywordflow">case</span> 159: <span class="keywordflow">case</span> 161: <span class="keywordflow">case</span> 162: -<a name="l00035"></a>00035 <span class="keywordflow">return</span> 1 + 2; -<a name="l00036"></a>00036 <span class="keywordflow">case</span> 23: -<a name="l00037"></a>00037 iTmp = (int)ucGetByte(iByteNbr + 1, aucGrpprl); -<a name="l00038"></a>00038 <span class="keywordflow">if</span> (iTmp == 255) { -<a name="l00039"></a>00039 iDel = (int)ucGetByte(iByteNbr + 2, aucGrpprl); -<a name="l00040"></a>00040 iAdd = (int)ucGetByte( -<a name="l00041"></a>00041 iByteNbr + 3 + iDel * 4, aucGrpprl); -<a name="l00042"></a>00042 iTmp = 2 + iDel * 4 + iAdd * 3; -<a name="l00043"></a>00043 } -<a name="l00044"></a>00044 <span class="keywordflow">return</span> 2 + iTmp; -<a name="l00045"></a>00045 <span class="keywordflow">case</span> 70: -<a name="l00046"></a>00046 <span class="keywordflow">return</span> 1 + 3; -<a name="l00047"></a>00047 <span class="keywordflow">case</span> 95: -<a name="l00048"></a>00048 <span class="keywordflow">return</span> 1 + 13; -<a name="l00049"></a>00049 <span class="keywordflow">case</span> 157: <span class="keywordflow">case</span> 163: -<a name="l00050"></a>00050 <span class="keywordflow">return</span> 1 + 5; -<a name="l00051"></a>00051 <span class="keywordflow">case</span> 158: <span class="keywordflow">case</span> 160: <span class="keywordflow">case</span> 164: -<a name="l00052"></a>00052 <span class="keywordflow">return</span> 1 + 4; -<a name="l00053"></a>00053 <span class="keywordflow">default</span>: -<a name="l00054"></a>00054 <span class="keywordflow">return</span> 1 + 1; -<a name="l00055"></a>00055 } -<a name="l00056"></a>00056 } <span class="comment">/* end of iGet2InfoLength */</span> -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/*</span> -<a name="l00059"></a>00059 <span class="comment"> * Build the lists with Document Property Information for WinWord 1/2 files</span> -<a name="l00060"></a>00060 <span class="comment"> */</span> -<a name="l00061"></a>00061 <span class="keywordtype">void</span> -<a name="l00062"></a>00062 vGet2DopInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00063"></a>00063 { -<a name="l00064"></a>00064 document_block_type tDocument; -<a name="l00065"></a>00065 UCHAR *aucBuffer; -<a name="l00066"></a>00066 ULONG ulBeginDocpInfo, ulTmp; -<a name="l00067"></a>00067 <span class="keywordtype">size_t</span> tDocpInfoLen; -<a name="l00068"></a>00068 USHORT usTmp; -<a name="l00069"></a>00069 -<a name="l00070"></a>00070 ulBeginDocpInfo = ulGetLong(0x112, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00071"></a>00071 DBG_HEX(ulBeginDocpInfo); -<a name="l00072"></a>00072 tDocpInfoLen = (size_t)usGetWord(0x116, aucHeader); <span class="comment">/* cbDop */</span> -<a name="l00073"></a>00073 DBG_DEC(tDocpInfoLen); -<a name="l00074"></a>00074 <span class="keywordflow">if</span> (tDocpInfoLen < 28) { -<a name="l00075"></a>00075 DBG_MSG(<span class="stringliteral">"No Document information"</span>); -<a name="l00076"></a>00076 <span class="keywordflow">return</span>; -<a name="l00077"></a>00077 } -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tDocpInfoLen, ulBeginDocpInfo, pFile)) { -<a name="l00081"></a>00081 aucBuffer = xfree(aucBuffer); -<a name="l00082"></a>00082 <span class="keywordflow">return</span>; -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 usTmp = usGetWord(0x00, aucBuffer); -<a name="l00086"></a>00086 tDocument.ucHdrFtrSpecification = (UCHAR)(usTmp >> 8); <span class="comment">/* grpfIhdt */</span> -<a name="l00087"></a>00087 tDocument.usDefaultTabWidth = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00088"></a>00088 ulTmp = ulGetLong(0x14, aucBuffer); <span class="comment">/* dttmCreated */</span> -<a name="l00089"></a>00089 tDocument.tCreateDate = tConvertDTTM(ulTmp); -<a name="l00090"></a>00090 ulTmp = ulGetLong(0x18, aucBuffer); <span class="comment">/* dttmRevised */</span> -<a name="l00091"></a>00091 tDocument.tRevisedDate = tConvertDTTM(ulTmp); -<a name="l00092"></a>00092 vCreateDocumentInfoList(&tDocument); -<a name="l00093"></a>00093 -<a name="l00094"></a>00094 aucBuffer = xfree(aucBuffer); -<a name="l00095"></a>00095 } <span class="comment">/* end of vGet2DopInfo */</span> -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 <span class="comment">/*</span> -<a name="l00098"></a>00098 <span class="comment"> * Fill the section information block with information</span> -<a name="l00099"></a>00099 <span class="comment"> * from a WinWord 1/2 file.</span> -<a name="l00100"></a>00100 <span class="comment"> */</span> -<a name="l00101"></a>00101 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00102"></a>00102 vGet2SectionInfo(<span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, -<a name="l00103"></a>00103 section_block_type *pSection) -<a name="l00104"></a>00104 { -<a name="l00105"></a>00105 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00106"></a>00106 USHORT usCcol; -<a name="l00107"></a>00107 UCHAR ucTmp; -<a name="l00108"></a>00108 -<a name="l00109"></a>00109 fail(aucGrpprl == NULL || pSection == NULL); -<a name="l00110"></a>00110 -<a name="l00111"></a>00111 iFodoOff = 0; -<a name="l00112"></a>00112 <span class="keywordflow">while</span> (tBytes >= (<span class="keywordtype">size_t</span>)iFodoOff + 1) { -<a name="l00113"></a>00113 <span class="keywordflow">switch</span> (ucGetByte(iFodoOff, aucGrpprl)) { -<a name="l00114"></a>00114 <span class="keywordflow">case</span> 117: <span class="comment">/* bkc */</span> -<a name="l00115"></a>00115 ucTmp = ucGetByte(iFodoOff + 1, aucGrpprl); -<a name="l00116"></a>00116 DBG_DEC(ucTmp); -<a name="l00117"></a>00117 pSection->bNewPage = ucTmp != 0 && ucTmp != 1; -<a name="l00118"></a>00118 <span class="keywordflow">break</span>; -<a name="l00119"></a>00119 <span class="keywordflow">case</span> 119: <span class="comment">/* ccolM1 */</span> -<a name="l00120"></a>00120 usCcol = 1 + usGetWord(iFodoOff + 1, aucGrpprl); -<a name="l00121"></a>00121 DBG_DEC(usCcol); -<a name="l00122"></a>00122 <span class="keywordflow">break</span>; -<a name="l00123"></a>00123 <span class="keywordflow">case</span> 128: <span class="comment">/* grpfIhdt */</span> -<a name="l00124"></a>00124 pSection->ucHdrFtrSpecification = -<a name="l00125"></a>00125 ucGetByte(iFodoOff + 1, aucGrpprl); -<a name="l00126"></a>00126 <span class="keywordflow">break</span>; -<a name="l00127"></a>00127 <span class="keywordflow">default</span>: -<a name="l00128"></a>00128 <span class="keywordflow">break</span>; -<a name="l00129"></a>00129 } -<a name="l00130"></a>00130 iInfoLen = iGet2InfoLength(iFodoOff, aucGrpprl); -<a name="l00131"></a>00131 fail(iInfoLen <= 0); -<a name="l00132"></a>00132 iFodoOff += iInfoLen; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 } <span class="comment">/* end of vGet2SectionInfo */</span> -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 <span class="comment">/*</span> -<a name="l00137"></a>00137 <span class="comment"> * Build the lists with Section Property Information for WinWord 1/2 files</span> -<a name="l00138"></a>00138 <span class="comment"> */</span> -<a name="l00139"></a>00139 <span class="keywordtype">void</span> -<a name="l00140"></a>00140 vGet2SepInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00141"></a>00141 { -<a name="l00142"></a>00142 section_block_type tSection; -<a name="l00143"></a>00143 ULONG *aulSectPage, *aulCharPos; -<a name="l00144"></a>00144 UCHAR *aucBuffer, *aucFpage; -<a name="l00145"></a>00145 ULONG ulBeginOfText, ulTextOffset, ulBeginSectInfo; -<a name="l00146"></a>00146 <span class="keywordtype">size_t</span> tSectInfoLen, tIndex, tOffset, tLen, tBytes; -<a name="l00147"></a>00147 UCHAR aucTmp[1]; -<a name="l00148"></a>00148 -<a name="l00149"></a>00149 fail(pFile == NULL || aucHeader == NULL); -<a name="l00150"></a>00150 -<a name="l00151"></a>00151 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00152"></a>00152 NO_DBG_HEX(ulBeginOfText); -<a name="l00153"></a>00153 ulBeginSectInfo = ulGetLong(0x7c, aucHeader); <span class="comment">/* fcPlcfsed */</span> -<a name="l00154"></a>00154 DBG_HEX(ulBeginSectInfo); -<a name="l00155"></a>00155 tSectInfoLen = (size_t)usGetWord(0x80, aucHeader); <span class="comment">/* cbPlcfsed */</span> -<a name="l00156"></a>00156 DBG_DEC(tSectInfoLen); -<a name="l00157"></a>00157 <span class="keywordflow">if</span> (tSectInfoLen < 4) { -<a name="l00158"></a>00158 DBG_DEC(tSectInfoLen); -<a name="l00159"></a>00159 <span class="keywordflow">return</span>; -<a name="l00160"></a>00160 } -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 aucBuffer = xmalloc(tSectInfoLen); -<a name="l00163"></a>00163 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tSectInfoLen, ulBeginSectInfo, pFile)) { -<a name="l00164"></a>00164 aucBuffer = xfree(aucBuffer); -<a name="l00165"></a>00165 <span class="keywordflow">return</span>; -<a name="l00166"></a>00166 } -<a name="l00167"></a>00167 NO_DBG_PRINT_BLOCK(aucBuffer, tSectInfoLen); -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="comment">/* Read the Section Descriptors */</span> -<a name="l00170"></a>00170 tLen = (tSectInfoLen - 4) / 10; -<a name="l00171"></a>00171 <span class="comment">/* Save the section offsets */</span> -<a name="l00172"></a>00172 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00173"></a>00173 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; -<a name="l00174"></a>00174 tIndex < tLen; -<a name="l00175"></a>00175 tIndex++, tOffset += 4) { -<a name="l00176"></a>00176 ulTextOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00177"></a>00177 NO_DBG_HEX(ulTextOffset); -<a name="l00178"></a>00178 aulCharPos[tIndex] = ulBeginOfText + ulTextOffset; -<a name="l00179"></a>00179 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00180"></a>00180 } -<a name="l00181"></a>00181 <span class="comment">/* Save the Sepx offsets */</span> -<a name="l00182"></a>00182 aulSectPage = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00183"></a>00183 <span class="keywordflow">for</span> (tIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00184"></a>00184 tIndex < tLen; -<a name="l00185"></a>00185 tIndex++, tOffset += 6) { -<a name="l00186"></a>00186 aulSectPage[tIndex] = ulGetLong(tOffset + 2, aucBuffer); -<a name="l00187"></a>00187 NO_DBG_HEX(aulSectPage[tIndex]); <span class="comment">/* fcSepx */</span> -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 aucBuffer = xfree(aucBuffer); -<a name="l00190"></a>00190 -<a name="l00191"></a>00191 <span class="comment">/* Read the Section Properties */</span> -<a name="l00192"></a>00192 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00193"></a>00193 <span class="keywordflow">if</span> (aulSectPage[tIndex] == FC_INVALID) { -<a name="l00194"></a>00194 vDefault2SectionInfoList(aulCharPos[tIndex]); -<a name="l00195"></a>00195 <span class="keywordflow">continue</span>; -<a name="l00196"></a>00196 } -<a name="l00197"></a>00197 <span class="comment">/* Get the number of bytes to read */</span> -<a name="l00198"></a>00198 <span class="keywordflow">if</span> (!bReadBytes(aucTmp, 1, aulSectPage[tIndex], pFile)) { -<a name="l00199"></a>00199 <span class="keywordflow">continue</span>; -<a name="l00200"></a>00200 } -<a name="l00201"></a>00201 tBytes = 1 + (size_t)ucGetByte(0, aucTmp); -<a name="l00202"></a>00202 NO_DBG_DEC(tBytes); -<a name="l00203"></a>00203 <span class="comment">/* Read the bytes */</span> -<a name="l00204"></a>00204 aucFpage = xmalloc(tBytes); -<a name="l00205"></a>00205 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, tBytes, aulSectPage[tIndex], pFile)) { -<a name="l00206"></a>00206 aucFpage = xfree(aucFpage); -<a name="l00207"></a>00207 <span class="keywordflow">continue</span>; -<a name="l00208"></a>00208 } -<a name="l00209"></a>00209 NO_DBG_PRINT_BLOCK(aucFpage, tBytes); -<a name="l00210"></a>00210 <span class="comment">/* Process the bytes */</span> -<a name="l00211"></a>00211 vGetDefaultSection(&tSection); -<a name="l00212"></a>00212 vGet2SectionInfo(aucFpage + 1, tBytes - 1, &tSection); -<a name="l00213"></a>00213 vAdd2SectionInfoList(&tSection, aulCharPos[tIndex]); -<a name="l00214"></a>00214 aucFpage = xfree(aucFpage); -<a name="l00215"></a>00215 } -<a name="l00216"></a>00216 aulCharPos = xfree(aulCharPos); -<a name="l00217"></a>00217 aulSectPage = xfree(aulSectPage); -<a name="l00218"></a>00218 } <span class="comment">/* end of vGet2SepInfo */</span> -<a name="l00219"></a>00219 -<a name="l00220"></a>00220 <span class="comment">/*</span> -<a name="l00221"></a>00221 <span class="comment"> * Build the list with Header/Footer Information for WinWord 1/2 files</span> -<a name="l00222"></a>00222 <span class="comment"> */</span> -<a name="l00223"></a>00223 <span class="keywordtype">void</span> -<a name="l00224"></a>00224 vGet2HdrFtrInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00225"></a>00225 { -<a name="l00226"></a>00226 ULONG *aulCharPos; -<a name="l00227"></a>00227 UCHAR *aucBuffer; -<a name="l00228"></a>00228 ULONG ulHdrFtrOffset, ulBeginHdrFtrInfo; -<a name="l00229"></a>00229 <span class="keywordtype">size_t</span> tHdrFtrInfoLen, tIndex, tOffset, tLen; -<a name="l00230"></a>00230 -<a name="l00231"></a>00231 fail(pFile == NULL || aucHeader == NULL); -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 ulBeginHdrFtrInfo = ulGetLong(0x9a, aucHeader); <span class="comment">/* fcPlcfhdd */</span> -<a name="l00234"></a>00234 NO_DBG_HEX(ulBeginHdrFtrInfo); -<a name="l00235"></a>00235 tHdrFtrInfoLen = (size_t)usGetWord(0x9e, aucHeader); <span class="comment">/* cbPlcfhdd */</span> -<a name="l00236"></a>00236 NO_DBG_DEC(tHdrFtrInfoLen); -<a name="l00237"></a>00237 <span class="keywordflow">if</span> (tHdrFtrInfoLen < 8) { -<a name="l00238"></a>00238 DBG_DEC_C(tHdrFtrInfoLen != 0, tHdrFtrInfoLen); -<a name="l00239"></a>00239 <span class="keywordflow">return</span>; -<a name="l00240"></a>00240 } -<a name="l00241"></a>00241 -<a name="l00242"></a>00242 aucBuffer = xmalloc(tHdrFtrInfoLen); -<a name="l00243"></a>00243 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tHdrFtrInfoLen, ulBeginHdrFtrInfo, pFile)) { -<a name="l00244"></a>00244 aucBuffer = xfree(aucBuffer); -<a name="l00245"></a>00245 <span class="keywordflow">return</span>; -<a name="l00246"></a>00246 } -<a name="l00247"></a>00247 NO_DBG_PRINT_BLOCK(aucBuffer, tHdrFtrInfoLen); -<a name="l00248"></a>00248 -<a name="l00249"></a>00249 tLen = tHdrFtrInfoLen / 4 - 1; -<a name="l00250"></a>00250 <span class="comment">/* Save the header/footer offsets */</span> -<a name="l00251"></a>00251 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00252"></a>00252 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; -<a name="l00253"></a>00253 tIndex < tLen; -<a name="l00254"></a>00254 tIndex++, tOffset += 4) { -<a name="l00255"></a>00255 ulHdrFtrOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00256"></a>00256 NO_DBG_HEX(ulHdrFtrOffset); -<a name="l00257"></a>00257 aulCharPos[tIndex] = ulHdrFtrOffset2CharPos(ulHdrFtrOffset); -<a name="l00258"></a>00258 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00259"></a>00259 } -<a name="l00260"></a>00260 vCreat2HdrFtrInfoList(aulCharPos, tLen); -<a name="l00261"></a>00261 aulCharPos = xfree(aulCharPos); -<a name="l00262"></a>00262 aucBuffer = xfree(aucBuffer); -<a name="l00263"></a>00263 } <span class="comment">/* end of vGet2HdrFtrInfo */</span> -<a name="l00264"></a>00264 -<a name="l00265"></a>00265 <span class="comment">/*</span> -<a name="l00266"></a>00266 <span class="comment"> * Translate the rowinfo to a member of the row_info enumeration</span> -<a name="l00267"></a>00267 <span class="comment"> */</span> -<a name="l00268"></a>00268 row_info_enum -<a name="l00269"></a>00269 eGet2RowInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00270"></a>00270 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, row_block_type *pRow) -<a name="l00271"></a>00271 { -<a name="l00272"></a>00272 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00273"></a>00273 <span class="keywordtype">int</span> iIndex, iSize, iCol; -<a name="l00274"></a>00274 <span class="keywordtype">int</span> iPosCurr, iPosPrev; -<a name="l00275"></a>00275 USHORT usTmp; -<a name="l00276"></a>00276 BOOL bFound24_0, bFound24_1, bFound25_0, bFound25_1, bFound154; -<a name="l00277"></a>00277 -<a name="l00278"></a>00278 fail(iFodo < 0 || aucGrpprl == NULL || pRow == NULL); -<a name="l00279"></a>00279 -<a name="l00280"></a>00280 iFodoOff = 0; -<a name="l00281"></a>00281 bFound24_0 = FALSE; -<a name="l00282"></a>00282 bFound24_1 = FALSE; -<a name="l00283"></a>00283 bFound25_0 = FALSE; -<a name="l00284"></a>00284 bFound25_1 = FALSE; -<a name="l00285"></a>00285 bFound154 = FALSE; -<a name="l00286"></a>00286 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00287"></a>00287 iInfoLen = 0; -<a name="l00288"></a>00288 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00289"></a>00289 <span class="keywordflow">case</span> 24: <span class="comment">/* fIntable */</span> -<a name="l00290"></a>00290 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 1, aucGrpprl))) { -<a name="l00291"></a>00291 bFound24_1 = TRUE; -<a name="l00292"></a>00292 } <span class="keywordflow">else</span> { -<a name="l00293"></a>00293 bFound24_0 = TRUE; -<a name="l00294"></a>00294 } -<a name="l00295"></a>00295 <span class="keywordflow">break</span>; -<a name="l00296"></a>00296 <span class="keywordflow">case</span> 25: <span class="comment">/* fTtp */</span> -<a name="l00297"></a>00297 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 1, aucGrpprl))) { -<a name="l00298"></a>00298 bFound25_1 = TRUE; -<a name="l00299"></a>00299 } <span class="keywordflow">else</span> { -<a name="l00300"></a>00300 bFound25_0 = TRUE; -<a name="l00301"></a>00301 } -<a name="l00302"></a>00302 <span class="keywordflow">break</span>; -<a name="l00303"></a>00303 <span class="keywordflow">case</span> 30: <span class="comment">/* brcTop10 */</span> -<a name="l00304"></a>00304 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00305"></a>00305 usTmp &= 0x01ff; -<a name="l00306"></a>00306 NO_DBG_DEC(usTmp >> 6); -<a name="l00307"></a>00307 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00308"></a>00308 pRow->ucBorderInfo &= ~TABLE_BORDER_TOP; -<a name="l00309"></a>00309 } <span class="keywordflow">else</span> { -<a name="l00310"></a>00310 pRow->ucBorderInfo |= TABLE_BORDER_TOP; -<a name="l00311"></a>00311 } -<a name="l00312"></a>00312 <span class="keywordflow">break</span>; -<a name="l00313"></a>00313 <span class="keywordflow">case</span> 31: <span class="comment">/* brcLeft10 */</span> -<a name="l00314"></a>00314 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00315"></a>00315 usTmp &= 0x01ff; -<a name="l00316"></a>00316 NO_DBG_DEC(usTmp >> 6); -<a name="l00317"></a>00317 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00318"></a>00318 pRow->ucBorderInfo &= ~TABLE_BORDER_LEFT; -<a name="l00319"></a>00319 } <span class="keywordflow">else</span> { -<a name="l00320"></a>00320 pRow->ucBorderInfo |= TABLE_BORDER_LEFT; -<a name="l00321"></a>00321 } -<a name="l00322"></a>00322 <span class="keywordflow">break</span>; -<a name="l00323"></a>00323 <span class="keywordflow">case</span> 32: <span class="comment">/* brcBottom10 */</span> -<a name="l00324"></a>00324 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00325"></a>00325 usTmp &= 0x01ff; -<a name="l00326"></a>00326 NO_DBG_DEC(usTmp >> 6); -<a name="l00327"></a>00327 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00328"></a>00328 pRow->ucBorderInfo &= ~TABLE_BORDER_BOTTOM; -<a name="l00329"></a>00329 } <span class="keywordflow">else</span> { -<a name="l00330"></a>00330 pRow->ucBorderInfo |= TABLE_BORDER_BOTTOM; -<a name="l00331"></a>00331 } -<a name="l00332"></a>00332 <span class="keywordflow">break</span>; -<a name="l00333"></a>00333 <span class="keywordflow">case</span> 33: <span class="comment">/* brcRight10 */</span> -<a name="l00334"></a>00334 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00335"></a>00335 usTmp &= 0x01ff; -<a name="l00336"></a>00336 NO_DBG_DEC(usTmp >> 6); -<a name="l00337"></a>00337 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00338"></a>00338 pRow->ucBorderInfo &= ~TABLE_BORDER_RIGHT; -<a name="l00339"></a>00339 } <span class="keywordflow">else</span> { -<a name="l00340"></a>00340 pRow->ucBorderInfo |= TABLE_BORDER_RIGHT; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 <span class="keywordflow">break</span>; -<a name="l00343"></a>00343 <span class="keywordflow">case</span> 38: <span class="comment">/* brcTop */</span> -<a name="l00344"></a>00344 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00345"></a>00345 usTmp &= 0x0018; -<a name="l00346"></a>00346 NO_DBG_DEC(usTmp >> 3); -<a name="l00347"></a>00347 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00348"></a>00348 pRow->ucBorderInfo &= ~TABLE_BORDER_TOP; -<a name="l00349"></a>00349 } <span class="keywordflow">else</span> { -<a name="l00350"></a>00350 pRow->ucBorderInfo |= TABLE_BORDER_TOP; -<a name="l00351"></a>00351 } -<a name="l00352"></a>00352 <span class="keywordflow">break</span>; -<a name="l00353"></a>00353 <span class="keywordflow">case</span> 39: <span class="comment">/* brcLeft */</span> -<a name="l00354"></a>00354 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00355"></a>00355 usTmp &= 0x0018; -<a name="l00356"></a>00356 NO_DBG_DEC(usTmp >> 3); -<a name="l00357"></a>00357 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00358"></a>00358 pRow->ucBorderInfo &= ~TABLE_BORDER_LEFT; -<a name="l00359"></a>00359 } <span class="keywordflow">else</span> { -<a name="l00360"></a>00360 pRow->ucBorderInfo |= TABLE_BORDER_LEFT; -<a name="l00361"></a>00361 } -<a name="l00362"></a>00362 <span class="keywordflow">break</span>; -<a name="l00363"></a>00363 <span class="keywordflow">case</span> 40: <span class="comment">/* brcBottom */</span> -<a name="l00364"></a>00364 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00365"></a>00365 usTmp &= 0x0018; -<a name="l00366"></a>00366 NO_DBG_DEC(usTmp >> 3); -<a name="l00367"></a>00367 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00368"></a>00368 pRow->ucBorderInfo &= ~TABLE_BORDER_BOTTOM; -<a name="l00369"></a>00369 } <span class="keywordflow">else</span> { -<a name="l00370"></a>00370 pRow->ucBorderInfo |= TABLE_BORDER_BOTTOM; -<a name="l00371"></a>00371 } -<a name="l00372"></a>00372 <span class="keywordflow">break</span>; -<a name="l00373"></a>00373 <span class="keywordflow">case</span> 41: <span class="comment">/* brcRight */</span> -<a name="l00374"></a>00374 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00375"></a>00375 usTmp &= 0x0018; -<a name="l00376"></a>00376 NO_DBG_DEC(usTmp >> 3); -<a name="l00377"></a>00377 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00378"></a>00378 pRow->ucBorderInfo &= ~TABLE_BORDER_RIGHT; -<a name="l00379"></a>00379 } <span class="keywordflow">else</span> { -<a name="l00380"></a>00380 pRow->ucBorderInfo |= TABLE_BORDER_RIGHT; -<a name="l00381"></a>00381 } -<a name="l00382"></a>00382 <span class="keywordflow">break</span>; -<a name="l00383"></a>00383 <span class="keywordflow">case</span> 152: <span class="comment">/* cDefTable10 */</span> -<a name="l00384"></a>00384 <span class="keywordflow">case</span> 154: <span class="comment">/* cDefTable */</span> -<a name="l00385"></a>00385 iSize = (int)usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00386"></a>00386 <span class="keywordflow">if</span> (iSize < 6 || iBytes < iFodoOff + 7) { -<a name="l00387"></a>00387 DBG_DEC(iSize); -<a name="l00388"></a>00388 DBG_DEC(iBytes); -<a name="l00389"></a>00389 DBG_DEC(iFodoOff); -<a name="l00390"></a>00390 iInfoLen = 1; -<a name="l00391"></a>00391 <span class="keywordflow">break</span>; -<a name="l00392"></a>00392 } -<a name="l00393"></a>00393 iCol = (int)ucGetByte(iFodo + iFodoOff + 3, aucGrpprl); -<a name="l00394"></a>00394 <span class="keywordflow">if</span> (iCol < 1 || -<a name="l00395"></a>00395 iBytes < iFodoOff + 3 + (iCol + 1) * 2) { -<a name="l00396"></a>00396 DBG_DEC(iCol); -<a name="l00397"></a>00397 DBG_DEC(iBytes); -<a name="l00398"></a>00398 DBG_DEC(iFodoOff); -<a name="l00399"></a>00399 DBG_DEC(ucGetByte(iFodo + iFodoOff, aucGrpprl)); -<a name="l00400"></a>00400 iInfoLen = 1; -<a name="l00401"></a>00401 <span class="keywordflow">break</span>; -<a name="l00402"></a>00402 } -<a name="l00403"></a>00403 <span class="keywordflow">if</span> (iCol >= (<span class="keywordtype">int</span>)elementsof(pRow->asColumnWidth)) { -<a name="l00404"></a>00404 DBG_DEC(iCol); -<a name="l00405"></a>00405 werr(1, <span class="stringliteral">"The number of columns is corrupt"</span>); -<a name="l00406"></a>00406 } -<a name="l00407"></a>00407 pRow->ucNumberOfColumns = (UCHAR)iCol; -<a name="l00408"></a>00408 iPosPrev = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00409"></a>00409 iFodo + iFodoOff + 4, -<a name="l00410"></a>00410 aucGrpprl); -<a name="l00411"></a>00411 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iCol; iIndex++) { -<a name="l00412"></a>00412 iPosCurr = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00413"></a>00413 iFodo + iFodoOff + 6 + iIndex * 2, -<a name="l00414"></a>00414 aucGrpprl); -<a name="l00415"></a>00415 pRow->asColumnWidth[iIndex] = -<a name="l00416"></a>00416 (short)(iPosCurr - iPosPrev); -<a name="l00417"></a>00417 iPosPrev = iPosCurr; -<a name="l00418"></a>00418 } -<a name="l00419"></a>00419 bFound154 = TRUE; -<a name="l00420"></a>00420 <span class="keywordflow">break</span>; -<a name="l00421"></a>00421 <span class="keywordflow">default</span>: -<a name="l00422"></a>00422 <span class="keywordflow">break</span>; -<a name="l00423"></a>00423 } -<a name="l00424"></a>00424 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00425"></a>00425 iInfoLen = -<a name="l00426"></a>00426 iGet2InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00427"></a>00427 fail(iInfoLen <= 0); -<a name="l00428"></a>00428 } -<a name="l00429"></a>00429 iFodoOff += iInfoLen; -<a name="l00430"></a>00430 } -<a name="l00431"></a>00431 <span class="keywordflow">if</span> (bFound24_1 && bFound25_1 && bFound154) { -<a name="l00432"></a>00432 <span class="keywordflow">return</span> found_end_of_row; -<a name="l00433"></a>00433 } -<a name="l00434"></a>00434 <span class="keywordflow">if</span> (bFound24_0 && bFound25_0 && !bFound154) { -<a name="l00435"></a>00435 <span class="keywordflow">return</span> found_not_end_of_row; -<a name="l00436"></a>00436 } -<a name="l00437"></a>00437 <span class="keywordflow">if</span> (bFound24_1) { -<a name="l00438"></a>00438 <span class="keywordflow">return</span> found_a_cell; -<a name="l00439"></a>00439 } -<a name="l00440"></a>00440 <span class="keywordflow">if</span> (bFound24_0) { -<a name="l00441"></a>00441 <span class="keywordflow">return</span> found_not_a_cell; -<a name="l00442"></a>00442 } -<a name="l00443"></a>00443 <span class="keywordflow">return</span> found_nothing; -<a name="l00444"></a>00444 } <span class="comment">/* end of eGet2RowInfo */</span> -<a name="l00445"></a>00445 -<a name="l00446"></a>00446 <span class="comment">/*</span> -<a name="l00447"></a>00447 <span class="comment"> * Fill the style information block with information</span> -<a name="l00448"></a>00448 <span class="comment"> * from a WinWord 1/2 file.</span> -<a name="l00449"></a>00449 <span class="comment"> */</span> -<a name="l00450"></a>00450 <span class="keywordtype">void</span> -<a name="l00451"></a>00451 vGet2StyleInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00452"></a>00452 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, style_block_type *pStyle) -<a name="l00453"></a>00453 { -<a name="l00454"></a>00454 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00455"></a>00455 <span class="keywordtype">int</span> iTmp, iDel, iAdd; -<a name="l00456"></a>00456 <span class="keywordtype">short</span> sTmp; -<a name="l00457"></a>00457 UCHAR ucTmp; -<a name="l00458"></a>00458 -<a name="l00459"></a>00459 fail(iFodo < 0 || aucGrpprl == NULL || pStyle == NULL); -<a name="l00460"></a>00460 -<a name="l00461"></a>00461 NO_DBG_DEC(pStyle->usIstd); -<a name="l00462"></a>00462 -<a name="l00463"></a>00463 iFodoOff = 0; -<a name="l00464"></a>00464 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00465"></a>00465 iInfoLen = 0; -<a name="l00466"></a>00466 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00467"></a>00467 <span class="keywordflow">case</span> 2: <span class="comment">/* istd */</span> -<a name="l00468"></a>00468 sTmp = (short)ucGetByte( -<a name="l00469"></a>00469 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00470"></a>00470 NO_DBG_DEC(sTmp); -<a name="l00471"></a>00471 <span class="keywordflow">break</span>; -<a name="l00472"></a>00472 <span class="keywordflow">case</span> 5: <span class="comment">/* jc */</span> -<a name="l00473"></a>00473 pStyle->ucAlignment = ucGetByte( -<a name="l00474"></a>00474 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00475"></a>00475 <span class="keywordflow">break</span>; -<a name="l00476"></a>00476 <span class="keywordflow">case</span> 12: <span class="comment">/* nfcSeqNumb */</span> -<a name="l00477"></a>00477 pStyle->ucNFC = ucGetByte( -<a name="l00478"></a>00478 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00479"></a>00479 <span class="keywordflow">break</span>; -<a name="l00480"></a>00480 <span class="keywordflow">case</span> 13: <span class="comment">/* nLvlAnm */</span> -<a name="l00481"></a>00481 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00482"></a>00482 pStyle->ucNumLevel = ucTmp; -<a name="l00483"></a>00483 pStyle->bNumPause = -<a name="l00484"></a>00484 eGetNumType(ucTmp) == level_type_pause; -<a name="l00485"></a>00485 <span class="keywordflow">break</span>; -<a name="l00486"></a>00486 <span class="keywordflow">case</span> 15: <span class="comment">/* ChgTabsPapx */</span> -<a name="l00487"></a>00487 <span class="keywordflow">case</span> 23: <span class="comment">/* ChgTabs */</span> -<a name="l00488"></a>00488 iTmp = (int)ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00489"></a>00489 <span class="keywordflow">if</span> (iTmp < 2) { -<a name="l00490"></a>00490 iInfoLen = 1; -<a name="l00491"></a>00491 <span class="keywordflow">break</span>; -<a name="l00492"></a>00492 } -<a name="l00493"></a>00493 NO_DBG_DEC(iTmp); -<a name="l00494"></a>00494 iDel = (int)ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00495"></a>00495 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel) { -<a name="l00496"></a>00496 iInfoLen = 1; -<a name="l00497"></a>00497 <span class="keywordflow">break</span>; -<a name="l00498"></a>00498 } -<a name="l00499"></a>00499 NO_DBG_DEC(iDel); -<a name="l00500"></a>00500 iAdd = (int)ucGetByte( -<a name="l00501"></a>00501 iFodo + iFodoOff + 3 + 2 * iDel, aucGrpprl); -<a name="l00502"></a>00502 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel + 2 * iAdd) { -<a name="l00503"></a>00503 iInfoLen = 1; -<a name="l00504"></a>00504 <span class="keywordflow">break</span>; -<a name="l00505"></a>00505 } -<a name="l00506"></a>00506 NO_DBG_DEC(iAdd); -<a name="l00507"></a>00507 <span class="keywordflow">break</span>; -<a name="l00508"></a>00508 <span class="keywordflow">case</span> 16: <span class="comment">/* dxaRight */</span> -<a name="l00509"></a>00509 pStyle->sRightIndent = (short)usGetWord( -<a name="l00510"></a>00510 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00511"></a>00511 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00512"></a>00512 <span class="keywordflow">break</span>; -<a name="l00513"></a>00513 <span class="keywordflow">case</span> 17: <span class="comment">/* dxaLeft */</span> -<a name="l00514"></a>00514 pStyle->sLeftIndent = (short)usGetWord( -<a name="l00515"></a>00515 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00516"></a>00516 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00517"></a>00517 <span class="keywordflow">break</span>; -<a name="l00518"></a>00518 <span class="keywordflow">case</span> 18: <span class="comment">/* Nest dxaLeft */</span> -<a name="l00519"></a>00519 sTmp = (short)usGetWord( -<a name="l00520"></a>00520 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00521"></a>00521 pStyle->sLeftIndent += sTmp; -<a name="l00522"></a>00522 <span class="keywordflow">if</span> (pStyle->sLeftIndent < 0) { -<a name="l00523"></a>00523 pStyle->sLeftIndent = 0; -<a name="l00524"></a>00524 } -<a name="l00525"></a>00525 NO_DBG_DEC(sTmp); -<a name="l00526"></a>00526 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00527"></a>00527 <span class="keywordflow">break</span>; -<a name="l00528"></a>00528 <span class="keywordflow">case</span> 19: <span class="comment">/* dxaLeft1 */</span> -<a name="l00529"></a>00529 pStyle->sLeftIndent1 = (short)usGetWord( -<a name="l00530"></a>00530 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00531"></a>00531 NO_DBG_DEC(pStyle->sLeftIndent1); -<a name="l00532"></a>00532 <span class="keywordflow">break</span>; -<a name="l00533"></a>00533 <span class="keywordflow">case</span> 21: <span class="comment">/* dyaBefore */</span> -<a name="l00534"></a>00534 pStyle->usBeforeIndent = usGetWord( -<a name="l00535"></a>00535 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00536"></a>00536 NO_DBG_DEC(pStyle->usBeforeIndent); -<a name="l00537"></a>00537 <span class="keywordflow">break</span>; -<a name="l00538"></a>00538 <span class="keywordflow">case</span> 22: <span class="comment">/* dyaAfter */</span> -<a name="l00539"></a>00539 pStyle->usAfterIndent = usGetWord( -<a name="l00540"></a>00540 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00541"></a>00541 NO_DBG_DEC(pStyle->usAfterIndent); -<a name="l00542"></a>00542 <span class="keywordflow">break</span>; -<a name="l00543"></a>00543 <span class="keywordflow">default</span>: -<a name="l00544"></a>00544 <span class="keywordflow">break</span>; -<a name="l00545"></a>00545 } -<a name="l00546"></a>00546 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00547"></a>00547 iInfoLen = -<a name="l00548"></a>00548 iGet2InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00549"></a>00549 fail(iInfoLen <= 0); -<a name="l00550"></a>00550 } -<a name="l00551"></a>00551 iFodoOff += iInfoLen; -<a name="l00552"></a>00552 } -<a name="l00553"></a>00553 } <span class="comment">/* end of vGet2StyleInfo */</span> -<a name="l00554"></a>00554 -<a name="l00555"></a>00555 <span class="comment">/*</span> -<a name="l00556"></a>00556 <span class="comment"> * Build the lists with Paragraph Information for WinWord 1/2 files</span> -<a name="l00557"></a>00557 <span class="comment"> */</span> -<a name="l00558"></a>00558 <span class="keywordtype">void</span> -<a name="l00559"></a>00559 vGet2PapInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00560"></a>00560 { -<a name="l00561"></a>00561 row_block_type tRow; -<a name="l00562"></a>00562 style_block_type tStyle; -<a name="l00563"></a>00563 USHORT *ausParfPage; -<a name="l00564"></a>00564 UCHAR *aucBuffer; -<a name="l00565"></a>00565 ULONG ulCharPos, ulCharPosFirst, ulCharPosLast; -<a name="l00566"></a>00566 ULONG ulBeginParfInfo; -<a name="l00567"></a>00567 <span class="keywordtype">size_t</span> tParfInfoLen, tParfPageNum, tOffset, tSize, tLenOld, tLen; -<a name="l00568"></a>00568 <span class="keywordtype">int</span> iIndex, iIndex2, iRun, iFodo, iLen; -<a name="l00569"></a>00569 row_info_enum eRowInfo; -<a name="l00570"></a>00570 USHORT usParfFirstPage, usCount, usIstd; -<a name="l00571"></a>00571 UCHAR ucStc; -<a name="l00572"></a>00572 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l00573"></a>00573 -<a name="l00574"></a>00574 fail(pFile == NULL || aucHeader == NULL); -<a name="l00575"></a>00575 -<a name="l00576"></a>00576 ulBeginParfInfo = ulGetLong(0xa6, aucHeader); <span class="comment">/* fcPlcfbtePapx */</span> -<a name="l00577"></a>00577 NO_DBG_HEX(ulBeginParfInfo); -<a name="l00578"></a>00578 tParfInfoLen = (size_t)usGetWord(0xaa, aucHeader); <span class="comment">/* cbPlcfbtePapx */</span> -<a name="l00579"></a>00579 NO_DBG_DEC(tParfInfoLen); -<a name="l00580"></a>00580 <span class="keywordflow">if</span> (tParfInfoLen < 4) { -<a name="l00581"></a>00581 DBG_DEC(tParfInfoLen); -<a name="l00582"></a>00582 <span class="keywordflow">return</span>; -<a name="l00583"></a>00583 } -<a name="l00584"></a>00584 -<a name="l00585"></a>00585 aucBuffer = xmalloc(tParfInfoLen); -<a name="l00586"></a>00586 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tParfInfoLen, ulBeginParfInfo, pFile)) { -<a name="l00587"></a>00587 aucBuffer = xfree(aucBuffer); -<a name="l00588"></a>00588 <span class="keywordflow">return</span>; -<a name="l00589"></a>00589 } -<a name="l00590"></a>00590 NO_DBG_PRINT_BLOCK(aucBuffer, tParfInfoLen); -<a name="l00591"></a>00591 -<a name="l00592"></a>00592 tLen = (tParfInfoLen - 4) / 6; -<a name="l00593"></a>00593 ausParfPage = xcalloc(tLen, <span class="keyword">sizeof</span>(USHORT)); -<a name="l00594"></a>00594 <span class="keywordflow">for</span> (iIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00595"></a>00595 iIndex < (int)tLen; -<a name="l00596"></a>00596 iIndex++, tOffset += 2) { -<a name="l00597"></a>00597 ausParfPage[iIndex] = usGetWord(tOffset, aucBuffer); -<a name="l00598"></a>00598 NO_DBG_DEC(ausParfPage[iIndex]); -<a name="l00599"></a>00599 } -<a name="l00600"></a>00600 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l00601"></a>00601 aucBuffer = xfree(aucBuffer); -<a name="l00602"></a>00602 tParfPageNum = (size_t)usGetWord(0x144, aucHeader); <span class="comment">/* cpnBtePap */</span> -<a name="l00603"></a>00603 DBG_DEC(tParfPageNum); -<a name="l00604"></a>00604 <span class="keywordflow">if</span> (tLen < tParfPageNum) { -<a name="l00605"></a>00605 <span class="comment">/* Replace ParfPage by a longer version */</span> -<a name="l00606"></a>00606 tLenOld = tLen; -<a name="l00607"></a>00607 usParfFirstPage = usGetWord(0x140, aucHeader); <span class="comment">/* pnPapFirst */</span> -<a name="l00608"></a>00608 DBG_DEC(usParfFirstPage); -<a name="l00609"></a>00609 tLen += tParfPageNum - 1; -<a name="l00610"></a>00610 tSize = tLen * <span class="keyword">sizeof</span>(USHORT); -<a name="l00611"></a>00611 ausParfPage = xrealloc(ausParfPage, tSize); -<a name="l00612"></a>00612 <span class="comment">/* Add new values */</span> -<a name="l00613"></a>00613 usCount = usParfFirstPage + 1; -<a name="l00614"></a>00614 <span class="keywordflow">for</span> (iIndex = (<span class="keywordtype">int</span>)tLenOld; iIndex < (int)tLen; iIndex++) { -<a name="l00615"></a>00615 ausParfPage[iIndex] = usCount; -<a name="l00616"></a>00616 NO_DBG_DEC(ausParfPage[iIndex]); -<a name="l00617"></a>00617 usCount++; -<a name="l00618"></a>00618 } -<a name="l00619"></a>00619 } -<a name="l00620"></a>00620 -<a name="l00621"></a>00621 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l00622"></a>00622 ulCharPosFirst = CP_INVALID; -<a name="l00623"></a>00623 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tLen; iIndex++) { -<a name="l00624"></a>00624 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, BIG_BLOCK_SIZE, -<a name="l00625"></a>00625 (ULONG)ausParfPage[iIndex] * BIG_BLOCK_SIZE, -<a name="l00626"></a>00626 pFile)) { -<a name="l00627"></a>00627 <span class="keywordflow">break</span>; -<a name="l00628"></a>00628 } -<a name="l00629"></a>00629 NO_DBG_PRINT_BLOCK(aucFpage, BIG_BLOCK_SIZE); -<a name="l00630"></a>00630 iRun = (int)ucGetByte(0x1ff, aucFpage); -<a name="l00631"></a>00631 NO_DBG_DEC(iRun); -<a name="l00632"></a>00632 <span class="keywordflow">for</span> (iIndex2 = 0; iIndex2 < iRun; iIndex2++) { -<a name="l00633"></a>00633 <span class="keywordflow">if</span> ((iRun + 1) * 4 + iIndex2 * 1 >= BIG_BLOCK_SIZE) { -<a name="l00634"></a>00634 <span class="keywordflow">break</span>; -<a name="l00635"></a>00635 } -<a name="l00636"></a>00636 NO_DBG_HEX(ulGetLong(iIndex2 * 4, aucFpage)); -<a name="l00637"></a>00637 iFodo = 2 * (int)ucGetByte( -<a name="l00638"></a>00638 (iRun + 1) * 4 + iIndex2 * 1, aucFpage); -<a name="l00639"></a>00639 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l00640"></a>00640 <span class="keywordflow">continue</span>; -<a name="l00641"></a>00641 } -<a name="l00642"></a>00642 -<a name="l00643"></a>00643 iLen = 2 * (int)ucGetByte(iFodo, aucFpage); -<a name="l00644"></a>00644 -<a name="l00645"></a>00645 ucStc = ucGetByte(iFodo + 1, aucFpage); -<a name="l00646"></a>00646 usIstd = usStc2istd(ucStc); -<a name="l00647"></a>00647 -<a name="l00648"></a>00648 vFillStyleFromStylesheet(usIstd, &tStyle); -<a name="l00649"></a>00649 vGet2StyleInfo(iFodo, aucFpage + 8, iLen - 8, &tStyle); -<a name="l00650"></a>00650 ulCharPos = ulGetLong(iIndex2 * 4, aucFpage); -<a name="l00651"></a>00651 NO_DBG_HEX(ulCharPos); -<a name="l00652"></a>00652 tStyle.ulFileOffset = ulCharPos; -<a name="l00653"></a>00653 vAdd2StyleInfoList(&tStyle); -<a name="l00654"></a>00654 -<a name="l00655"></a>00655 eRowInfo = eGet2RowInfo(iFodo, -<a name="l00656"></a>00656 aucFpage + 8, iLen - 8, &tRow); -<a name="l00657"></a>00657 -<a name="l00658"></a>00658 <span class="keywordflow">switch</span>(eRowInfo) { -<a name="l00659"></a>00659 <span class="keywordflow">case</span> found_a_cell: -<a name="l00660"></a>00660 <span class="keywordflow">if</span> (ulCharPosFirst != CP_INVALID) { -<a name="l00661"></a>00661 <span class="keywordflow">break</span>; -<a name="l00662"></a>00662 } -<a name="l00663"></a>00663 ulCharPosFirst = ulGetLong( -<a name="l00664"></a>00664 iIndex2 * 4, aucFpage); -<a name="l00665"></a>00665 NO_DBG_HEX(ulCharPosFirst); -<a name="l00666"></a>00666 tRow.ulCharPosStart = ulCharPosFirst; -<a name="l00667"></a>00667 tRow.ulFileOffsetStart = ulCharPosFirst; -<a name="l00668"></a>00668 <span class="keywordflow">break</span>; -<a name="l00669"></a>00669 <span class="keywordflow">case</span> found_end_of_row: -<a name="l00670"></a>00670 ulCharPosLast = ulGetLong( -<a name="l00671"></a>00671 iIndex2 * 4, aucFpage); -<a name="l00672"></a>00672 NO_DBG_HEX(ulCharPosLast); -<a name="l00673"></a>00673 tRow.ulCharPosEnd = ulCharPosLast; -<a name="l00674"></a>00674 <span class="comment">/* Add 1 for compatiblity with Word 6 and up */</span> -<a name="l00675"></a>00675 tRow.ulFileOffsetEnd = ulCharPosLast + 1; -<a name="l00676"></a>00676 vAdd2RowInfoList(&tRow); -<a name="l00677"></a>00677 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l00678"></a>00678 ulCharPosFirst = CP_INVALID; -<a name="l00679"></a>00679 <span class="keywordflow">break</span>; -<a name="l00680"></a>00680 <span class="keywordflow">case</span> found_nothing: -<a name="l00681"></a>00681 <span class="keywordflow">break</span>; -<a name="l00682"></a>00682 <span class="keywordflow">default</span>: -<a name="l00683"></a>00683 DBG_DEC(eRowInfo); -<a name="l00684"></a>00684 <span class="keywordflow">break</span>; -<a name="l00685"></a>00685 } -<a name="l00686"></a>00686 } -<a name="l00687"></a>00687 } -<a name="l00688"></a>00688 ausParfPage = xfree(ausParfPage); -<a name="l00689"></a>00689 } <span class="comment">/* end of vGet2PapInfo */</span> -<a name="l00690"></a>00690 -<a name="l00691"></a>00691 <span class="comment">/*</span> -<a name="l00692"></a>00692 <span class="comment"> * Fill the font information block with information</span> -<a name="l00693"></a>00693 <span class="comment"> * from a WinWord 1 file.</span> -<a name="l00694"></a>00694 <span class="comment"> */</span> -<a name="l00695"></a>00695 <span class="keywordtype">void</span> -<a name="l00696"></a>00696 vGet1FontInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00697"></a>00697 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, font_block_type *pFont) -<a name="l00698"></a>00698 { -<a name="l00699"></a>00699 BOOL bIcoChange, bFtcChange, bHpsChange, bKulChange; -<a name="l00700"></a>00700 USHORT usTmp; -<a name="l00701"></a>00701 UCHAR ucTmp; -<a name="l00702"></a>00702 UCHAR aucChpx[12]; -<a name="l00703"></a>00703 -<a name="l00704"></a>00704 fail(iFodo < 0 || aucGrpprl == NULL || pFont == NULL); -<a name="l00705"></a>00705 -<a name="l00706"></a>00706 <span class="keywordflow">if</span> (tBytes > <span class="keyword">sizeof</span>(aucChpx)) { -<a name="l00707"></a>00707 NO_DBG_PRINT_BLOCK(aucGrpprl + iFodo, tBytes); -<a name="l00708"></a>00708 <span class="keywordflow">return</span>; -<a name="l00709"></a>00709 } -<a name="l00710"></a>00710 -<a name="l00711"></a>00711 <span class="comment">/* Build the CHPX structure */</span> -<a name="l00712"></a>00712 (void)memset(aucChpx, 0, <span class="keyword">sizeof</span>(aucChpx)); -<a name="l00713"></a>00713 (void)memcpy(aucChpx, aucGrpprl + iFodo, min(tBytes, <span class="keyword">sizeof</span>(aucChpx))); -<a name="l00714"></a>00714 -<a name="l00715"></a>00715 usTmp = usGetWord(0, aucChpx); -<a name="l00716"></a>00716 <span class="keywordflow">if</span> ((usTmp & BIT(0)) != 0) { -<a name="l00717"></a>00717 pFont->usFontStyle ^= FONT_BOLD; -<a name="l00718"></a>00718 } -<a name="l00719"></a>00719 <span class="keywordflow">if</span> ((usTmp & BIT(1)) != 0) { -<a name="l00720"></a>00720 pFont->usFontStyle ^= FONT_ITALIC; -<a name="l00721"></a>00721 } -<a name="l00722"></a>00722 <span class="keywordflow">if</span> ((usTmp & BIT(2)) != 0) { -<a name="l00723"></a>00723 pFont->usFontStyle ^= FONT_STRIKE; -<a name="l00724"></a>00724 } -<a name="l00725"></a>00725 <span class="keywordflow">if</span> ((usTmp & BIT(5)) != 0) { -<a name="l00726"></a>00726 pFont->usFontStyle ^= FONT_SMALL_CAPITALS; -<a name="l00727"></a>00727 } -<a name="l00728"></a>00728 <span class="keywordflow">if</span> ((usTmp & BIT(6)) != 0) { -<a name="l00729"></a>00729 pFont->usFontStyle ^= FONT_CAPITALS; -<a name="l00730"></a>00730 } -<a name="l00731"></a>00731 <span class="keywordflow">if</span> ((usTmp & BIT(7)) != 0) { -<a name="l00732"></a>00732 pFont->usFontStyle ^= FONT_HIDDEN; -<a name="l00733"></a>00733 } -<a name="l00734"></a>00734 -<a name="l00735"></a>00735 ucTmp = ucGetByte(5, aucChpx); -<a name="l00736"></a>00736 <span class="keywordflow">if</span> (ucTmp != 0) { -<a name="l00737"></a>00737 <span class="keywordflow">if</span> (ucTmp < 128) { -<a name="l00738"></a>00738 pFont->usFontStyle |= FONT_SUPERSCRIPT; -<a name="l00739"></a>00739 DBG_MSG(<span class="stringliteral">"Superscript"</span>); -<a name="l00740"></a>00740 } <span class="keywordflow">else</span> { -<a name="l00741"></a>00741 pFont->usFontStyle |= FONT_SUBSCRIPT; -<a name="l00742"></a>00742 DBG_MSG(<span class="stringliteral">"Subscript"</span>); -<a name="l00743"></a>00743 } -<a name="l00744"></a>00744 } -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 bIcoChange = (usTmp & BIT(10)) != 0; -<a name="l00747"></a>00747 bFtcChange = (usTmp & BIT(11)) != 0; -<a name="l00748"></a>00748 bHpsChange = (usTmp & BIT(12)) != 0; -<a name="l00749"></a>00749 bKulChange = (usTmp & BIT(13)) != 0; -<a name="l00750"></a>00750 -<a name="l00751"></a>00751 <span class="keywordflow">if</span> (bFtcChange) { -<a name="l00752"></a>00752 usTmp = usGetWord(2, aucChpx); -<a name="l00753"></a>00753 <span class="keywordflow">if</span> (usTmp <= (USHORT)UCHAR_MAX) { -<a name="l00754"></a>00754 pFont->ucFontNumber = (UCHAR)usTmp; -<a name="l00755"></a>00755 } <span class="keywordflow">else</span> { -<a name="l00756"></a>00756 pFont->ucFontNumber = 0; -<a name="l00757"></a>00757 } -<a name="l00758"></a>00758 } -<a name="l00759"></a>00759 -<a name="l00760"></a>00760 <span class="keywordflow">if</span> (bHpsChange) { -<a name="l00761"></a>00761 pFont->usFontSize = (USHORT)ucGetByte(4, aucChpx); -<a name="l00762"></a>00762 } -<a name="l00763"></a>00763 -<a name="l00764"></a>00764 <span class="keywordflow">if</span> (bIcoChange || bKulChange) { -<a name="l00765"></a>00765 usTmp = usGetWord(6, aucChpx); -<a name="l00766"></a>00766 <span class="keywordflow">if</span> (bIcoChange) { -<a name="l00767"></a>00767 pFont->ucFontColor = (UCHAR)((usTmp & 0x0f00) >> 8); -<a name="l00768"></a>00768 <span class="keywordflow">if</span> (pFont->ucFontColor <= 7) { -<a name="l00769"></a>00769 <span class="comment">/* Add 1 for compatibility with Word 2 and up */</span> -<a name="l00770"></a>00770 pFont->ucFontColor++; -<a name="l00771"></a>00771 } <span class="keywordflow">else</span> { -<a name="l00772"></a>00772 DBG_DEC(pFont->ucFontColor); -<a name="l00773"></a>00773 pFont->ucFontColor = 0; -<a name="l00774"></a>00774 } -<a name="l00775"></a>00775 } -<a name="l00776"></a>00776 <span class="keywordflow">if</span> (bKulChange) { -<a name="l00777"></a>00777 usTmp = (usTmp & 0x7000) >> 12; -<a name="l00778"></a>00778 DBG_DEC_C(usTmp > 4, usTmp); -<a name="l00779"></a>00779 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00780"></a>00780 pFont->usFontStyle &= ~FONT_UNDERLINE; -<a name="l00781"></a>00781 } <span class="keywordflow">else</span> { -<a name="l00782"></a>00782 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00783"></a>00783 } -<a name="l00784"></a>00784 } -<a name="l00785"></a>00785 } -<a name="l00786"></a>00786 } <span class="comment">/* end of vGet1FontInfo */</span> -<a name="l00787"></a>00787 -<a name="l00788"></a>00788 <span class="comment">/*</span> -<a name="l00789"></a>00789 <span class="comment"> * Fill the font information block with information</span> -<a name="l00790"></a>00790 <span class="comment"> * from a WinWord 1/2 file.</span> -<a name="l00791"></a>00791 <span class="comment"> */</span> -<a name="l00792"></a>00792 <span class="keywordtype">void</span> -<a name="l00793"></a>00793 vGet2FontInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00794"></a>00794 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, font_block_type *pFont) -<a name="l00795"></a>00795 { -<a name="l00796"></a>00796 BOOL bIcoChange, bFtcChange, bHpsChange, bKulChange; -<a name="l00797"></a>00797 USHORT usTmp; -<a name="l00798"></a>00798 UCHAR ucTmp; -<a name="l00799"></a>00799 UCHAR aucChpx[18]; -<a name="l00800"></a>00800 -<a name="l00801"></a>00801 fail(iFodo < 0 || aucGrpprl == NULL || pFont == NULL); -<a name="l00802"></a>00802 -<a name="l00803"></a>00803 <span class="keywordflow">if</span> (tBytes > <span class="keyword">sizeof</span>(aucChpx)) { -<a name="l00804"></a>00804 NO_DBG_PRINT_BLOCK(aucGrpprl + iFodo, tBytes); -<a name="l00805"></a>00805 <span class="keywordflow">return</span>; -<a name="l00806"></a>00806 } -<a name="l00807"></a>00807 -<a name="l00808"></a>00808 <span class="comment">/* Build the CHPX structure */</span> -<a name="l00809"></a>00809 (void)memset(aucChpx, 0, <span class="keyword">sizeof</span>(aucChpx)); -<a name="l00810"></a>00810 (void)memcpy(aucChpx, aucGrpprl + iFodo, min(tBytes, <span class="keyword">sizeof</span>(aucChpx))); -<a name="l00811"></a>00811 -<a name="l00812"></a>00812 usTmp = usGetWord(0, aucChpx); -<a name="l00813"></a>00813 <span class="keywordflow">if</span> ((usTmp & BIT(0)) != 0) { -<a name="l00814"></a>00814 pFont->usFontStyle ^= FONT_BOLD; -<a name="l00815"></a>00815 } -<a name="l00816"></a>00816 <span class="keywordflow">if</span> ((usTmp & BIT(1)) != 0) { -<a name="l00817"></a>00817 pFont->usFontStyle ^= FONT_ITALIC; -<a name="l00818"></a>00818 } -<a name="l00819"></a>00819 <span class="keywordflow">if</span> (usTmp & BIT(3)) { -<a name="l00820"></a>00820 pFont->usFontStyle ^= FONT_MARKDEL; -<a name="l00821"></a>00821 } -<a name="l00822"></a>00822 <span class="keywordflow">if</span> ((usTmp & BIT(5)) != 0) { -<a name="l00823"></a>00823 pFont->usFontStyle ^= FONT_SMALL_CAPITALS; -<a name="l00824"></a>00824 } -<a name="l00825"></a>00825 <span class="keywordflow">if</span> ((usTmp & BIT(6)) != 0) { -<a name="l00826"></a>00826 pFont->usFontStyle ^= FONT_CAPITALS; -<a name="l00827"></a>00827 } -<a name="l00828"></a>00828 <span class="keywordflow">if</span> ((usTmp & BIT(7)) != 0) { -<a name="l00829"></a>00829 pFont->usFontStyle ^= FONT_HIDDEN; -<a name="l00830"></a>00830 } -<a name="l00831"></a>00831 <span class="keywordflow">if</span> (usTmp & BIT(10)) { -<a name="l00832"></a>00832 pFont->usFontStyle ^= FONT_STRIKE; -<a name="l00833"></a>00833 } -<a name="l00834"></a>00834 -<a name="l00835"></a>00835 ucTmp = ucGetByte(10, aucChpx); -<a name="l00836"></a>00836 DBG_MSG_C(ucTmp != 0 && ucTmp < 128, <span class="stringliteral">"Superscript"</span>); -<a name="l00837"></a>00837 DBG_MSG_C(ucTmp >= 128, <span class="stringliteral">"Subscript"</span>); -<a name="l00838"></a>00838 -<a name="l00839"></a>00839 usTmp = usGetWord(2, aucChpx); -<a name="l00840"></a>00840 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00841"></a>00841 <span class="comment">/* No changes, nothing to do */</span> -<a name="l00842"></a>00842 <span class="keywordflow">return</span>; -<a name="l00843"></a>00843 } -<a name="l00844"></a>00844 -<a name="l00845"></a>00845 bIcoChange = (usTmp & BIT(0)) != 0; -<a name="l00846"></a>00846 bFtcChange = (usTmp & BIT(1)) != 0; -<a name="l00847"></a>00847 bHpsChange = (usTmp & BIT(2)) != 0; -<a name="l00848"></a>00848 bKulChange = (usTmp & BIT(3)) != 0; -<a name="l00849"></a>00849 -<a name="l00850"></a>00850 <span class="keywordflow">if</span> (bFtcChange) { -<a name="l00851"></a>00851 usTmp = usGetWord(4, aucChpx); -<a name="l00852"></a>00852 <span class="keywordflow">if</span> (usTmp <= (USHORT)UCHAR_MAX) { -<a name="l00853"></a>00853 pFont->ucFontNumber = (UCHAR)usTmp; -<a name="l00854"></a>00854 } <span class="keywordflow">else</span> { -<a name="l00855"></a>00855 pFont->ucFontNumber = 0; -<a name="l00856"></a>00856 } -<a name="l00857"></a>00857 } -<a name="l00858"></a>00858 -<a name="l00859"></a>00859 <span class="keywordflow">if</span> (bHpsChange) { -<a name="l00860"></a>00860 pFont->usFontSize = usGetWord(6, aucChpx); -<a name="l00861"></a>00861 } -<a name="l00862"></a>00862 -<a name="l00863"></a>00863 <span class="keywordflow">if</span> (bIcoChange || bKulChange) { -<a name="l00864"></a>00864 ucTmp = ucGetByte(9, aucChpx); -<a name="l00865"></a>00865 <span class="keywordflow">if</span> (bIcoChange) { -<a name="l00866"></a>00866 pFont->ucFontColor = ucTmp & 0x1f; -<a name="l00867"></a>00867 <span class="keywordflow">if</span> (pFont->ucFontColor > 16) { -<a name="l00868"></a>00868 DBG_DEC(pFont->ucFontColor); -<a name="l00869"></a>00869 pFont->ucFontColor = 0; -<a name="l00870"></a>00870 } -<a name="l00871"></a>00871 } -<a name="l00872"></a>00872 <span class="keywordflow">if</span> (bKulChange) { -<a name="l00873"></a>00873 ucTmp = (ucTmp & 0xe0) >> 5; -<a name="l00874"></a>00874 DBG_DEC_C(ucTmp > 4, ucTmp); -<a name="l00875"></a>00875 <span class="keywordflow">if</span> (ucTmp == 0) { -<a name="l00876"></a>00876 pFont->usFontStyle &= ~FONT_UNDERLINE; -<a name="l00877"></a>00877 } <span class="keywordflow">else</span> { -<a name="l00878"></a>00878 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00879"></a>00879 } -<a name="l00880"></a>00880 } -<a name="l00881"></a>00881 } -<a name="l00882"></a>00882 } <span class="comment">/* end of vGet2FontInfo */</span> -<a name="l00883"></a>00883 -<a name="l00884"></a>00884 <span class="comment">/*</span> -<a name="l00885"></a>00885 <span class="comment"> * Fill the picture information block with information from a WinWord 1 file.</span> -<a name="l00886"></a>00886 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00887"></a>00887 <span class="comment"> */</span> -<a name="l00888"></a>00888 <span class="keyword">static</span> BOOL -<a name="l00889"></a>00889 bGet1PicInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00890"></a>00890 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, picture_block_type *pPicture) -<a name="l00891"></a>00891 { -<a name="l00892"></a>00892 ULONG ulTmp; -<a name="l00893"></a>00893 UCHAR aucChpx[12]; -<a name="l00894"></a>00894 -<a name="l00895"></a>00895 fail(iFodo < 0 || aucGrpprl == NULL || pPicture == NULL); -<a name="l00896"></a>00896 -<a name="l00897"></a>00897 <span class="keywordflow">if</span> (tBytes > <span class="keyword">sizeof</span>(aucChpx)) { -<a name="l00898"></a>00898 NO_DBG_PRINT_BLOCK(aucGrpprl + iFodo, tBytes); -<a name="l00899"></a>00899 tBytes = <span class="keyword">sizeof</span>(aucChpx); -<a name="l00900"></a>00900 } -<a name="l00901"></a>00901 -<a name="l00902"></a>00902 <span class="comment">/* Build the CHPX structure */</span> -<a name="l00903"></a>00903 (void)memset(aucChpx, 0, <span class="keyword">sizeof</span>(aucChpx)); -<a name="l00904"></a>00904 (void)memcpy(aucChpx, aucGrpprl + iFodo, min(tBytes, <span class="keyword">sizeof</span>(aucChpx))); -<a name="l00905"></a>00905 -<a name="l00906"></a>00906 ulTmp = ulGetLong(8, aucChpx); -<a name="l00907"></a>00907 <span class="keywordflow">if</span> (ulTmp != 0 && ulTmp < MAX_FILESIZE) { -<a name="l00908"></a>00908 pPicture->ulPictureOffset = ulTmp; -<a name="l00909"></a>00909 DBG_HEX(pPicture->ulPictureOffset); -<a name="l00910"></a>00910 <span class="keywordflow">return</span> TRUE; -<a name="l00911"></a>00911 } -<a name="l00912"></a>00912 <span class="keywordflow">return</span> FALSE; -<a name="l00913"></a>00913 } <span class="comment">/* end of bGet1PicInfo */</span> -<a name="l00914"></a>00914 -<a name="l00915"></a>00915 <span class="comment">/*</span> -<a name="l00916"></a>00916 <span class="comment"> * Fill the picture information block with information from a WinWord 2 file.</span> -<a name="l00917"></a>00917 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00918"></a>00918 <span class="comment"> */</span> -<a name="l00919"></a>00919 <span class="keyword">static</span> BOOL -<a name="l00920"></a>00920 bGet2PicInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00921"></a>00921 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, picture_block_type *pPicture) -<a name="l00922"></a>00922 { -<a name="l00923"></a>00923 ULONG ulTmp; -<a name="l00924"></a>00924 UCHAR aucChpx[18]; -<a name="l00925"></a>00925 -<a name="l00926"></a>00926 fail(iFodo < 0 || aucGrpprl == NULL || pPicture == NULL); -<a name="l00927"></a>00927 -<a name="l00928"></a>00928 <span class="keywordflow">if</span> (tBytes > <span class="keyword">sizeof</span>(aucChpx)) { -<a name="l00929"></a>00929 NO_DBG_PRINT_BLOCK(aucGrpprl + iFodo, tBytes); -<a name="l00930"></a>00930 tBytes = <span class="keyword">sizeof</span>(aucChpx); -<a name="l00931"></a>00931 } -<a name="l00932"></a>00932 -<a name="l00933"></a>00933 <span class="comment">/* Build the CHPX structure */</span> -<a name="l00934"></a>00934 (void)memset(aucChpx, 0, <span class="keyword">sizeof</span>(aucChpx)); -<a name="l00935"></a>00935 (void)memcpy(aucChpx, aucGrpprl + iFodo, min(tBytes, <span class="keyword">sizeof</span>(aucChpx))); -<a name="l00936"></a>00936 -<a name="l00937"></a>00937 ulTmp = ulGetLong(14, aucChpx); -<a name="l00938"></a>00938 <span class="keywordflow">if</span> (ulTmp != 0 && ulTmp < MAX_FILESIZE) { -<a name="l00939"></a>00939 pPicture->ulPictureOffset = ulTmp; -<a name="l00940"></a>00940 DBG_HEX(pPicture->ulPictureOffset); -<a name="l00941"></a>00941 DBG_DEC(tBytes); -<a name="l00942"></a>00942 <span class="keywordflow">return</span> TRUE; -<a name="l00943"></a>00943 } -<a name="l00944"></a>00944 <span class="keywordflow">return</span> FALSE; -<a name="l00945"></a>00945 } <span class="comment">/* end of bGet2PicInfo */</span> -<a name="l00946"></a>00946 -<a name="l00947"></a>00947 <span class="comment">/*</span> -<a name="l00948"></a>00948 <span class="comment"> * Build the lists with Character Information for WinWord 1/2 files</span> -<a name="l00949"></a>00949 <span class="comment"> */</span> -<a name="l00950"></a>00950 <span class="keywordtype">void</span> -<a name="l00951"></a>00951 vGet2ChrInfo(FILE *pFile, <span class="keywordtype">int</span> iWordVersion, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00952"></a>00952 { -<a name="l00953"></a>00953 font_block_type tFont; -<a name="l00954"></a>00954 picture_block_type tPicture; -<a name="l00955"></a>00955 USHORT *ausCharPage; -<a name="l00956"></a>00956 UCHAR *aucBuffer; -<a name="l00957"></a>00957 ULONG ulFileOffset, ulCharPos, ulBeginCharInfo; -<a name="l00958"></a>00958 <span class="keywordtype">size_t</span> tCharInfoLen, tOffset, tSize, tChrLen, tCharPageNum; -<a name="l00959"></a>00959 <span class="keywordtype">size_t</span> tLenOld, tLen; -<a name="l00960"></a>00960 <span class="keywordtype">int</span> iIndex, iIndex2, iRun, iFodo; -<a name="l00961"></a>00961 BOOL bSuccess1, bSuccess2; -<a name="l00962"></a>00962 USHORT usCharFirstPage, usCount, usIstd; -<a name="l00963"></a>00963 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l00964"></a>00964 -<a name="l00965"></a>00965 fail(pFile == NULL || aucHeader == NULL); -<a name="l00966"></a>00966 fail(iWordVersion != 1 && iWordVersion != 2); -<a name="l00967"></a>00967 -<a name="l00968"></a>00968 ulBeginCharInfo = ulGetLong(0xa0, aucHeader); <span class="comment">/* fcPlcfbteChpx */</span> -<a name="l00969"></a>00969 DBG_HEX(ulBeginCharInfo); -<a name="l00970"></a>00970 tCharInfoLen = (size_t)usGetWord(0xa4, aucHeader); <span class="comment">/* cbPlcfbteChpx */</span> -<a name="l00971"></a>00971 DBG_DEC(tCharInfoLen); -<a name="l00972"></a>00972 <span class="keywordflow">if</span> (tCharInfoLen < 4) { -<a name="l00973"></a>00973 DBG_DEC(tCharInfoLen); -<a name="l00974"></a>00974 <span class="keywordflow">return</span>; -<a name="l00975"></a>00975 } -<a name="l00976"></a>00976 -<a name="l00977"></a>00977 aucBuffer = xmalloc(tCharInfoLen); -<a name="l00978"></a>00978 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tCharInfoLen, ulBeginCharInfo, pFile)) { -<a name="l00979"></a>00979 aucBuffer = xfree(aucBuffer); -<a name="l00980"></a>00980 <span class="keywordflow">return</span>; -<a name="l00981"></a>00981 } -<a name="l00982"></a>00982 NO_DBG_PRINT_BLOCK(aucBuffer, tCharInfoLen); -<a name="l00983"></a>00983 -<a name="l00984"></a>00984 tLen = (tCharInfoLen - 4) / 6; -<a name="l00985"></a>00985 ausCharPage = xcalloc(tLen, <span class="keyword">sizeof</span>(USHORT)); -<a name="l00986"></a>00986 <span class="keywordflow">for</span> (iIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00987"></a>00987 iIndex < (int)tLen; -<a name="l00988"></a>00988 iIndex++, tOffset += 2) { -<a name="l00989"></a>00989 ausCharPage[iIndex] = usGetWord(tOffset, aucBuffer); -<a name="l00990"></a>00990 NO_DBG_DEC(ausCharPage[iIndex]); -<a name="l00991"></a>00991 } -<a name="l00992"></a>00992 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l00993"></a>00993 aucBuffer = xfree(aucBuffer); -<a name="l00994"></a>00994 tCharPageNum = (size_t)usGetWord(0x142, aucHeader); <span class="comment">/* cpnBteChp */</span> -<a name="l00995"></a>00995 DBG_DEC(tCharPageNum); -<a name="l00996"></a>00996 <span class="keywordflow">if</span> (tLen < tCharPageNum) { -<a name="l00997"></a>00997 <span class="comment">/* Replace CharPage by a longer version */</span> -<a name="l00998"></a>00998 tLenOld = tLen; -<a name="l00999"></a>00999 usCharFirstPage = usGetWord(0x13e, aucHeader); <span class="comment">/* pnChrFirst */</span> -<a name="l01000"></a>01000 NO_DBG_DEC(usCharFirstPage); -<a name="l01001"></a>01001 tLen += tCharPageNum - 1; -<a name="l01002"></a>01002 tSize = tLen * <span class="keyword">sizeof</span>(USHORT); -<a name="l01003"></a>01003 ausCharPage = xrealloc(ausCharPage, tSize); -<a name="l01004"></a>01004 <span class="comment">/* Add new values */</span> -<a name="l01005"></a>01005 usCount = usCharFirstPage + 1; -<a name="l01006"></a>01006 <span class="keywordflow">for</span> (iIndex = (<span class="keywordtype">int</span>)tLenOld; iIndex < (int)tLen; iIndex++) { -<a name="l01007"></a>01007 ausCharPage[iIndex] = usCount; -<a name="l01008"></a>01008 NO_DBG_DEC(ausCharPage[iIndex]); -<a name="l01009"></a>01009 usCount++; -<a name="l01010"></a>01010 } -<a name="l01011"></a>01011 } -<a name="l01012"></a>01012 -<a name="l01013"></a>01013 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tLen; iIndex++) { -<a name="l01014"></a>01014 <span class="keywordflow">if</span> (!bReadBytes(aucFpage, BIG_BLOCK_SIZE, -<a name="l01015"></a>01015 (ULONG)ausCharPage[iIndex] * BIG_BLOCK_SIZE, -<a name="l01016"></a>01016 pFile)) { -<a name="l01017"></a>01017 <span class="keywordflow">break</span>; -<a name="l01018"></a>01018 } -<a name="l01019"></a>01019 NO_DBG_PRINT_BLOCK(aucFpage, BIG_BLOCK_SIZE); -<a name="l01020"></a>01020 iRun = (int)ucGetByte(0x1ff, aucFpage); -<a name="l01021"></a>01021 NO_DBG_DEC(iRun); -<a name="l01022"></a>01022 <span class="keywordflow">for</span> (iIndex2 = 0; iIndex2 < iRun; iIndex2++) { -<a name="l01023"></a>01023 <span class="keywordflow">if</span> ((iRun + 1) * 4 + iIndex2 >= BIG_BLOCK_SIZE) { -<a name="l01024"></a>01024 <span class="keywordflow">break</span>; -<a name="l01025"></a>01025 } -<a name="l01026"></a>01026 ulCharPos = ulGetLong(iIndex2 * 4, aucFpage); -<a name="l01027"></a>01027 ulFileOffset = ulCharPos; -<a name="l01028"></a>01028 iFodo = 2 * (int)ucGetByte( -<a name="l01029"></a>01029 (iRun + 1) * 4 + iIndex2, aucFpage); -<a name="l01030"></a>01030 -<a name="l01031"></a>01031 tChrLen = (size_t)ucGetByte(iFodo, aucFpage); -<a name="l01032"></a>01032 -<a name="l01033"></a>01033 usIstd = usGetIstd(ulFileOffset); -<a name="l01034"></a>01034 vFillFontFromStylesheet(usIstd, &tFont); -<a name="l01035"></a>01035 <span class="keywordflow">if</span> (iFodo != 0) { -<a name="l01036"></a>01036 <span class="keywordflow">if</span> (iWordVersion == 1) { -<a name="l01037"></a>01037 vGet1FontInfo(iFodo, -<a name="l01038"></a>01038 aucFpage + 1, tChrLen, &tFont); -<a name="l01039"></a>01039 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (iWordVersion == 2) { -<a name="l01040"></a>01040 vGet2FontInfo(iFodo, -<a name="l01041"></a>01041 aucFpage + 1, tChrLen, &tFont); -<a name="l01042"></a>01042 } -<a name="l01043"></a>01043 } -<a name="l01044"></a>01044 tFont.ulFileOffset = ulFileOffset; -<a name="l01045"></a>01045 vAdd2FontInfoList(&tFont); -<a name="l01046"></a>01046 -<a name="l01047"></a>01047 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l01048"></a>01048 <span class="keywordflow">continue</span>; -<a name="l01049"></a>01049 } -<a name="l01050"></a>01050 -<a name="l01051"></a>01051 (void)memset(&tPicture, 0, <span class="keyword">sizeof</span>(tPicture)); -<a name="l01052"></a>01052 bSuccess1 = iWordVersion == 1 && -<a name="l01053"></a>01053 bGet1PicInfo(iFodo, aucFpage + 1, -<a name="l01054"></a>01054 tChrLen, &tPicture); -<a name="l01055"></a>01055 bSuccess2 = iWordVersion == 2 && -<a name="l01056"></a>01056 bGet2PicInfo(iFodo, aucFpage + 1, -<a name="l01057"></a>01057 tChrLen, &tPicture); -<a name="l01058"></a>01058 <span class="keywordflow">if</span> (bSuccess1 || bSuccess2) { -<a name="l01059"></a>01059 tPicture.ulFileOffset = ulFileOffset; -<a name="l01060"></a>01060 tPicture.ulFileOffsetPicture = -<a name="l01061"></a>01061 tPicture.ulPictureOffset; -<a name="l01062"></a>01062 vAdd2PictInfoList(&tPicture); -<a name="l01063"></a>01063 } -<a name="l01064"></a>01064 } -<a name="l01065"></a>01065 } -<a name="l01066"></a>01066 ausCharPage = xfree(ausCharPage); -<a name="l01067"></a>01067 } <span class="comment">/* end of vGet2ChrInfo */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/prop6_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1157 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/prop6.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/prop6.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * prop6.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the property information from a MS Word 6 or 7 file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * iGet6InfoLength - the length of the information for Word 6/7 files</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00018"></a>00018 iGet6InfoLength(<span class="keywordtype">int</span> iByteNbr, <span class="keyword">const</span> UCHAR *aucGrpprl) -<a name="l00019"></a>00019 { -<a name="l00020"></a>00020 <span class="keywordtype">int</span> iTmp, iDel, iAdd; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="keywordflow">switch</span> (ucGetByte(iByteNbr, aucGrpprl)) { -<a name="l00023"></a>00023 <span class="keywordflow">case</span> 2: <span class="keywordflow">case</span> 16: <span class="keywordflow">case</span> 17: <span class="keywordflow">case</span> 18: <span class="keywordflow">case</span> 19: <span class="keywordflow">case</span> 21: <span class="keywordflow">case</span> 22: -<a name="l00024"></a>00024 <span class="keywordflow">case</span> 26: <span class="keywordflow">case</span> 27: <span class="keywordflow">case</span> 28: <span class="keywordflow">case</span> 30: <span class="keywordflow">case</span> 31: <span class="keywordflow">case</span> 32: <span class="keywordflow">case</span> 33: -<a name="l00025"></a>00025 <span class="keywordflow">case</span> 34: <span class="keywordflow">case</span> 35: <span class="keywordflow">case</span> 36: <span class="keywordflow">case</span> 38: <span class="keywordflow">case</span> 39: <span class="keywordflow">case</span> 40: <span class="keywordflow">case</span> 41: -<a name="l00026"></a>00026 <span class="keywordflow">case</span> 42: <span class="keywordflow">case</span> 43: <span class="keywordflow">case</span> 45: <span class="keywordflow">case</span> 46: <span class="keywordflow">case</span> 47: <span class="keywordflow">case</span> 48: <span class="keywordflow">case</span> 49: -<a name="l00027"></a>00027 <span class="keywordflow">case</span> 69: <span class="keywordflow">case</span> 72: <span class="keywordflow">case</span> 80: <span class="keywordflow">case</span> 93: <span class="keywordflow">case</span> 96: <span class="keywordflow">case</span> 97: <span class="keywordflow">case</span> 99: -<a name="l00028"></a>00028 <span class="keywordflow">case</span> 101: <span class="keywordflow">case</span> 105: <span class="keywordflow">case</span> 106: <span class="keywordflow">case</span> 107: <span class="keywordflow">case</span> 109: <span class="keywordflow">case</span> 110: <span class="keywordflow">case</span> 121: -<a name="l00029"></a>00029 <span class="keywordflow">case</span> 122: <span class="keywordflow">case</span> 123: <span class="keywordflow">case</span> 124: <span class="keywordflow">case</span> 140: <span class="keywordflow">case</span> 141: <span class="keywordflow">case</span> 144: <span class="keywordflow">case</span> 145: -<a name="l00030"></a>00030 <span class="keywordflow">case</span> 148: <span class="keywordflow">case</span> 149: <span class="keywordflow">case</span> 154: <span class="keywordflow">case</span> 155: <span class="keywordflow">case</span> 156: <span class="keywordflow">case</span> 157: <span class="keywordflow">case</span> 160: -<a name="l00031"></a>00031 <span class="keywordflow">case</span> 161: <span class="keywordflow">case</span> 164: <span class="keywordflow">case</span> 165: <span class="keywordflow">case</span> 166: <span class="keywordflow">case</span> 167: <span class="keywordflow">case</span> 168: <span class="keywordflow">case</span> 169: -<a name="l00032"></a>00032 <span class="keywordflow">case</span> 170: <span class="keywordflow">case</span> 171: <span class="keywordflow">case</span> 182: <span class="keywordflow">case</span> 183: <span class="keywordflow">case</span> 184: <span class="keywordflow">case</span> 189: <span class="keywordflow">case</span> 195: -<a name="l00033"></a>00033 <span class="keywordflow">case</span> 197: <span class="keywordflow">case</span> 198: -<a name="l00034"></a>00034 <span class="keywordflow">return</span> 1 + 2; -<a name="l00035"></a>00035 <span class="keywordflow">case</span> 3: <span class="keywordflow">case</span> 12: <span class="keywordflow">case</span> 15: <span class="keywordflow">case</span> 81: <span class="keywordflow">case</span> 103: <span class="keywordflow">case</span> 108: <span class="keywordflow">case</span> 188: -<a name="l00036"></a>00036 <span class="keywordflow">case</span> 190: <span class="keywordflow">case</span> 191: -<a name="l00037"></a>00037 <span class="keywordflow">return</span> 2 + (int)ucGetByte(iByteNbr + 1, aucGrpprl); -<a name="l00038"></a>00038 <span class="keywordflow">case</span> 20: <span class="keywordflow">case</span> 70: <span class="keywordflow">case</span> 74: <span class="keywordflow">case</span> 192: <span class="keywordflow">case</span> 194: <span class="keywordflow">case</span> 196: <span class="keywordflow">case</span> 200: -<a name="l00039"></a>00039 <span class="keywordflow">return</span> 1 + 4; -<a name="l00040"></a>00040 <span class="keywordflow">case</span> 23: -<a name="l00041"></a>00041 iTmp = (int)ucGetByte(iByteNbr + 1, aucGrpprl); -<a name="l00042"></a>00042 <span class="keywordflow">if</span> (iTmp == 255) { -<a name="l00043"></a>00043 iDel = (int)ucGetByte(iByteNbr + 2, aucGrpprl); -<a name="l00044"></a>00044 iAdd = (int)ucGetByte( -<a name="l00045"></a>00045 iByteNbr + 3 + iDel * 4, aucGrpprl); -<a name="l00046"></a>00046 iTmp = 2 + iDel * 4 + iAdd * 3; -<a name="l00047"></a>00047 } -<a name="l00048"></a>00048 <span class="keywordflow">return</span> 2 + iTmp; -<a name="l00049"></a>00049 <span class="keywordflow">case</span> 68: <span class="keywordflow">case</span> 193: <span class="keywordflow">case</span> 199: -<a name="l00050"></a>00050 <span class="keywordflow">return</span> 1 + 5; -<a name="l00051"></a>00051 <span class="keywordflow">case</span> 73: <span class="keywordflow">case</span> 95: <span class="keywordflow">case</span> 136: <span class="keywordflow">case</span> 137: -<a name="l00052"></a>00052 <span class="keywordflow">return</span> 1 + 3; -<a name="l00053"></a>00053 <span class="keywordflow">case</span> 120: <span class="keywordflow">case</span> 187: -<a name="l00054"></a>00054 <span class="keywordflow">return</span> 1 + 12; -<a name="l00055"></a>00055 <span class="keywordflow">default</span>: -<a name="l00056"></a>00056 <span class="keywordflow">return</span> 1 + 1; -<a name="l00057"></a>00057 } -<a name="l00058"></a>00058 } <span class="comment">/* end of iGet6InfoLength */</span> -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 <span class="comment">/*</span> -<a name="l00061"></a>00061 <span class="comment"> * Build the lists with Document Property Information for Word 6/7 files</span> -<a name="l00062"></a>00062 <span class="comment"> */</span> -<a name="l00063"></a>00063 <span class="keywordtype">void</span> -<a name="l00064"></a>00064 vGet6DopInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00065"></a>00065 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00066"></a>00066 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00067"></a>00067 { -<a name="l00068"></a>00068 document_block_type tDocument; -<a name="l00069"></a>00069 UCHAR *aucBuffer; -<a name="l00070"></a>00070 ULONG ulBeginDocpInfo, ulTmp; -<a name="l00071"></a>00071 <span class="keywordtype">size_t</span> tDocpInfoLen; -<a name="l00072"></a>00072 USHORT usTmp; -<a name="l00073"></a>00073 -<a name="l00074"></a>00074 ulBeginDocpInfo = ulGetLong(0x150, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00075"></a>00075 DBG_HEX(ulBeginDocpInfo); -<a name="l00076"></a>00076 tDocpInfoLen = (size_t)ulGetLong(0x154, aucHeader); <span class="comment">/* lcbDop */</span> -<a name="l00077"></a>00077 DBG_DEC(tDocpInfoLen); -<a name="l00078"></a>00078 <span class="keywordflow">if</span> (tDocpInfoLen < 28) { -<a name="l00079"></a>00079 DBG_MSG(<span class="stringliteral">"No Document information"</span>); -<a name="l00080"></a>00080 <span class="keywordflow">return</span>; -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00084"></a>00084 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00085"></a>00085 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00086"></a>00086 aucBuffer, ulBeginDocpInfo, tDocpInfoLen)) { -<a name="l00087"></a>00087 aucBuffer = xfree(aucBuffer); -<a name="l00088"></a>00088 <span class="keywordflow">return</span>; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 -<a name="l00091"></a>00091 usTmp = usGetWord(0x00, aucBuffer); -<a name="l00092"></a>00092 tDocument.ucHdrFtrSpecification = (UCHAR)(usTmp >> 8); <span class="comment">/* grpfIhdt */</span> -<a name="l00093"></a>00093 tDocument.usDefaultTabWidth = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00094"></a>00094 ulTmp = ulGetLong(0x14, aucBuffer); <span class="comment">/* dttmCreated */</span> -<a name="l00095"></a>00095 tDocument.tCreateDate = tConvertDTTM(ulTmp); -<a name="l00096"></a>00096 ulTmp = ulGetLong(0x18, aucBuffer); <span class="comment">/* dttmRevised */</span> -<a name="l00097"></a>00097 tDocument.tRevisedDate = tConvertDTTM(ulTmp); -<a name="l00098"></a>00098 vCreateDocumentInfoList(&tDocument); -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 aucBuffer = xfree(aucBuffer); -<a name="l00101"></a>00101 } <span class="comment">/* end of vGet6DopInfo */</span> -<a name="l00102"></a>00102 -<a name="l00103"></a>00103 <span class="comment">/*</span> -<a name="l00104"></a>00104 <span class="comment"> * Fill the section information block with information</span> -<a name="l00105"></a>00105 <span class="comment"> * from a Word 6/7 file.</span> -<a name="l00106"></a>00106 <span class="comment"> */</span> -<a name="l00107"></a>00107 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00108"></a>00108 vGet6SectionInfo(<span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, -<a name="l00109"></a>00109 section_block_type *pSection) -<a name="l00110"></a>00110 { -<a name="l00111"></a>00111 UINT uiIndex; -<a name="l00112"></a>00112 <span class="keywordtype">int</span> iFodoOff, iInfoLen, iSize, iTmp; -<a name="l00113"></a>00113 USHORT usCcol; -<a name="l00114"></a>00114 UCHAR ucTmp; -<a name="l00115"></a>00115 -<a name="l00116"></a>00116 fail(aucGrpprl == NULL || pSection == NULL); -<a name="l00117"></a>00117 -<a name="l00118"></a>00118 iFodoOff = 0; -<a name="l00119"></a>00119 <span class="keywordflow">while</span> (tBytes >= (<span class="keywordtype">size_t</span>)iFodoOff + 1) { -<a name="l00120"></a>00120 iInfoLen = 0; -<a name="l00121"></a>00121 <span class="keywordflow">switch</span> (ucGetByte(iFodoOff, aucGrpprl)) { -<a name="l00122"></a>00122 <span class="keywordflow">case</span> 133: <span class="comment">/* olstAnm */</span> -<a name="l00123"></a>00123 iSize = (int)ucGetByte(iFodoOff + 1, aucGrpprl); -<a name="l00124"></a>00124 DBG_DEC_C(iSize != 212, iSize); -<a name="l00125"></a>00125 <span class="keywordflow">for</span> (uiIndex = 0, iTmp = iFodoOff + 2; -<a name="l00126"></a>00126 uiIndex < 9 && iTmp < iFodoOff + 2 + iSize - 15; -<a name="l00127"></a>00127 uiIndex++, iTmp += 16) { -<a name="l00128"></a>00128 pSection->aucNFC[uiIndex] = -<a name="l00129"></a>00129 ucGetByte(iTmp, aucGrpprl); -<a name="l00130"></a>00130 NO_DBG_DEC(pSection->aucNFC[uiIndex]); -<a name="l00131"></a>00131 ucTmp = ucGetByte(iTmp + 3, aucGrpprl); -<a name="l00132"></a>00132 NO_DBG_HEX(ucTmp); -<a name="l00133"></a>00133 <span class="keywordflow">if</span> ((ucTmp & BIT(2)) != 0) { -<a name="l00134"></a>00134 pSection->usNeedPrevLvl |= -<a name="l00135"></a>00135 (USHORT)BIT(uiIndex); -<a name="l00136"></a>00136 } -<a name="l00137"></a>00137 <span class="keywordflow">if</span> ((ucTmp & BIT(3)) != 0) { -<a name="l00138"></a>00138 pSection->usHangingIndent |= -<a name="l00139"></a>00139 (USHORT)BIT(uiIndex); -<a name="l00140"></a>00140 } -<a name="l00141"></a>00141 } -<a name="l00142"></a>00142 DBG_HEX(pSection->usNeedPrevLvl); -<a name="l00143"></a>00143 DBG_HEX(pSection->usHangingIndent); -<a name="l00144"></a>00144 <span class="keywordflow">break</span>; -<a name="l00145"></a>00145 <span class="keywordflow">case</span> 142: <span class="comment">/* bkc */</span> -<a name="l00146"></a>00146 ucTmp = ucGetByte(iFodoOff + 1, aucGrpprl); -<a name="l00147"></a>00147 DBG_DEC(ucTmp); -<a name="l00148"></a>00148 pSection->bNewPage = ucTmp != 0 && ucTmp != 1; -<a name="l00149"></a>00149 <span class="keywordflow">break</span>; -<a name="l00150"></a>00150 <span class="keywordflow">case</span> 144: <span class="comment">/* ccolM1 */</span> -<a name="l00151"></a>00151 usCcol = 1 + usGetWord(iFodoOff + 1, aucGrpprl); -<a name="l00152"></a>00152 DBG_DEC(usCcol); -<a name="l00153"></a>00153 <span class="keywordflow">break</span>; -<a name="l00154"></a>00154 <span class="keywordflow">case</span> 153: <span class="comment">/* grpfIhdt */</span> -<a name="l00155"></a>00155 pSection->ucHdrFtrSpecification = -<a name="l00156"></a>00156 ucGetByte(iFodoOff + 1, aucGrpprl); -<a name="l00157"></a>00157 <span class="keywordflow">break</span>; -<a name="l00158"></a>00158 <span class="keywordflow">default</span>: -<a name="l00159"></a>00159 <span class="keywordflow">break</span>; -<a name="l00160"></a>00160 } -<a name="l00161"></a>00161 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00162"></a>00162 iInfoLen = iGet6InfoLength(iFodoOff, aucGrpprl); -<a name="l00163"></a>00163 fail(iInfoLen <= 0); -<a name="l00164"></a>00164 } -<a name="l00165"></a>00165 iFodoOff += iInfoLen; -<a name="l00166"></a>00166 } -<a name="l00167"></a>00167 } <span class="comment">/* end of vGet6SectionInfo */</span> -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="comment">/*</span> -<a name="l00170"></a>00170 <span class="comment"> * Build the lists with Section Property Information for Word 6/7 files</span> -<a name="l00171"></a>00171 <span class="comment"> */</span> -<a name="l00172"></a>00172 <span class="keywordtype">void</span> -<a name="l00173"></a>00173 vGet6SepInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00174"></a>00174 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00175"></a>00175 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00176"></a>00176 { -<a name="l00177"></a>00177 section_block_type tSection; -<a name="l00178"></a>00178 ULONG *aulSectPage, *aulCharPos; -<a name="l00179"></a>00179 UCHAR *aucBuffer, *aucFpage; -<a name="l00180"></a>00180 ULONG ulBeginOfText, ulTextOffset, ulBeginSectInfo; -<a name="l00181"></a>00181 <span class="keywordtype">size_t</span> tSectInfoLen, tIndex, tOffset, tLen, tBytes; -<a name="l00182"></a>00182 UCHAR aucTmp[2]; -<a name="l00183"></a>00183 -<a name="l00184"></a>00184 fail(pFile == NULL || aucHeader == NULL); -<a name="l00185"></a>00185 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00186"></a>00186 fail(aulBBD == NULL); -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00189"></a>00189 NO_DBG_HEX(ulBeginOfText); -<a name="l00190"></a>00190 ulBeginSectInfo = ulGetLong(0x88, aucHeader); <span class="comment">/* fcPlcfsed */</span> -<a name="l00191"></a>00191 DBG_HEX(ulBeginSectInfo); -<a name="l00192"></a>00192 tSectInfoLen = (size_t)ulGetLong(0x8c, aucHeader); <span class="comment">/* lcbPlcfsed */</span> -<a name="l00193"></a>00193 DBG_DEC(tSectInfoLen); -<a name="l00194"></a>00194 <span class="keywordflow">if</span> (tSectInfoLen < 4) { -<a name="l00195"></a>00195 DBG_DEC(tSectInfoLen); -<a name="l00196"></a>00196 <span class="keywordflow">return</span>; -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 aucBuffer = xmalloc(tSectInfoLen); -<a name="l00200"></a>00200 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00201"></a>00201 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00202"></a>00202 aucBuffer, ulBeginSectInfo, tSectInfoLen)) { -<a name="l00203"></a>00203 aucBuffer = xfree(aucBuffer); -<a name="l00204"></a>00204 <span class="keywordflow">return</span>; -<a name="l00205"></a>00205 } -<a name="l00206"></a>00206 NO_DBG_PRINT_BLOCK(aucBuffer, tSectInfoLen); -<a name="l00207"></a>00207 -<a name="l00208"></a>00208 <span class="comment">/* Read the Section Descriptors */</span> -<a name="l00209"></a>00209 tLen = (tSectInfoLen - 4) / 16; -<a name="l00210"></a>00210 <span class="comment">/* Save the section offsets */</span> -<a name="l00211"></a>00211 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00212"></a>00212 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; tIndex < tLen; tIndex++, tOffset += 4) { -<a name="l00213"></a>00213 ulTextOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00214"></a>00214 NO_DBG_HEX(ulTextOffset); -<a name="l00215"></a>00215 aulCharPos[tIndex] = ulBeginOfText + ulTextOffset; -<a name="l00216"></a>00216 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00217"></a>00217 } -<a name="l00218"></a>00218 <span class="comment">/* Save the Sepx offsets */</span> -<a name="l00219"></a>00219 aulSectPage = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00220"></a>00220 <span class="keywordflow">for</span> (tIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00221"></a>00221 tIndex < tLen; -<a name="l00222"></a>00222 tIndex++, tOffset += 12) { -<a name="l00223"></a>00223 aulSectPage[tIndex] = ulGetLong(tOffset + 2, aucBuffer); -<a name="l00224"></a>00224 NO_DBG_HEX(aulSectPage[tIndex]); <span class="comment">/* fcSepx */</span> -<a name="l00225"></a>00225 } -<a name="l00226"></a>00226 aucBuffer = xfree(aucBuffer); -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 <span class="comment">/* Read the Section Properties */</span> -<a name="l00229"></a>00229 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00230"></a>00230 <span class="keywordflow">if</span> (aulSectPage[tIndex] == FC_INVALID) { -<a name="l00231"></a>00231 vDefault2SectionInfoList(aulCharPos[tIndex]); -<a name="l00232"></a>00232 <span class="keywordflow">continue</span>; -<a name="l00233"></a>00233 } -<a name="l00234"></a>00234 <span class="comment">/* Get the number of bytes to read */</span> -<a name="l00235"></a>00235 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00236"></a>00236 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00237"></a>00237 aucTmp, aulSectPage[tIndex], 2)) { -<a name="l00238"></a>00238 <span class="keywordflow">continue</span>; -<a name="l00239"></a>00239 } -<a name="l00240"></a>00240 tBytes = 2 + (size_t)usGetWord(0, aucTmp); -<a name="l00241"></a>00241 NO_DBG_DEC(tBytes); -<a name="l00242"></a>00242 <span class="comment">/* Read the bytes */</span> -<a name="l00243"></a>00243 aucFpage = xmalloc(tBytes); -<a name="l00244"></a>00244 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00245"></a>00245 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00246"></a>00246 aucFpage, aulSectPage[tIndex], tBytes)) { -<a name="l00247"></a>00247 aucFpage = xfree(aucFpage); -<a name="l00248"></a>00248 <span class="keywordflow">continue</span>; -<a name="l00249"></a>00249 } -<a name="l00250"></a>00250 NO_DBG_PRINT_BLOCK(aucFpage, tBytes); -<a name="l00251"></a>00251 <span class="comment">/* Process the bytes */</span> -<a name="l00252"></a>00252 vGetDefaultSection(&tSection); -<a name="l00253"></a>00253 vGet6SectionInfo(aucFpage + 2, tBytes - 2, &tSection); -<a name="l00254"></a>00254 vAdd2SectionInfoList(&tSection, aulCharPos[tIndex]); -<a name="l00255"></a>00255 aucFpage = xfree(aucFpage); -<a name="l00256"></a>00256 } -<a name="l00257"></a>00257 aulCharPos = xfree(aulCharPos); -<a name="l00258"></a>00258 aulSectPage = xfree(aulSectPage); -<a name="l00259"></a>00259 } <span class="comment">/* end of vGet6SepInfo */</span> -<a name="l00260"></a>00260 -<a name="l00261"></a>00261 <span class="comment">/*</span> -<a name="l00262"></a>00262 <span class="comment"> * Build the list with Header/Footer Information for Word 6/7 files</span> -<a name="l00263"></a>00263 <span class="comment"> */</span> -<a name="l00264"></a>00264 <span class="keywordtype">void</span> -<a name="l00265"></a>00265 vGet6HdrFtrInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00266"></a>00266 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00267"></a>00267 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00268"></a>00268 { -<a name="l00269"></a>00269 ULONG *aulCharPos; -<a name="l00270"></a>00270 UCHAR *aucBuffer; -<a name="l00271"></a>00271 ULONG ulHdrFtrOffset, ulBeginHdrFtrInfo; -<a name="l00272"></a>00272 <span class="keywordtype">size_t</span> tHdrFtrInfoLen, tIndex, tOffset, tLen; -<a name="l00273"></a>00273 -<a name="l00274"></a>00274 fail(pFile == NULL || aucHeader == NULL); -<a name="l00275"></a>00275 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00276"></a>00276 fail(aulBBD == NULL); -<a name="l00277"></a>00277 -<a name="l00278"></a>00278 ulBeginHdrFtrInfo = ulGetLong(0xb0, aucHeader); <span class="comment">/* fcPlcfhdd */</span> -<a name="l00279"></a>00279 NO_DBG_HEX(ulBeginHdrFtrInfo); -<a name="l00280"></a>00280 tHdrFtrInfoLen = (size_t)ulGetLong(0xb4, aucHeader); <span class="comment">/* lcbPlcfhdd */</span> -<a name="l00281"></a>00281 NO_DBG_DEC(tHdrFtrInfoLen); -<a name="l00282"></a>00282 <span class="keywordflow">if</span> (tHdrFtrInfoLen < 8) { -<a name="l00283"></a>00283 DBG_DEC_C(tHdrFtrInfoLen != 0, tHdrFtrInfoLen); -<a name="l00284"></a>00284 <span class="keywordflow">return</span>; -<a name="l00285"></a>00285 } -<a name="l00286"></a>00286 -<a name="l00287"></a>00287 aucBuffer = xmalloc(tHdrFtrInfoLen); -<a name="l00288"></a>00288 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00289"></a>00289 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00290"></a>00290 aucBuffer, ulBeginHdrFtrInfo, tHdrFtrInfoLen)) { -<a name="l00291"></a>00291 aucBuffer = xfree(aucBuffer); -<a name="l00292"></a>00292 <span class="keywordflow">return</span>; -<a name="l00293"></a>00293 } -<a name="l00294"></a>00294 NO_DBG_PRINT_BLOCK(aucBuffer, tHdrFtrInfoLen); -<a name="l00295"></a>00295 -<a name="l00296"></a>00296 tLen = tHdrFtrInfoLen / 4 - 1; -<a name="l00297"></a>00297 <span class="comment">/* Save the header/footer offsets */</span> -<a name="l00298"></a>00298 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00299"></a>00299 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; -<a name="l00300"></a>00300 tIndex < tLen; -<a name="l00301"></a>00301 tIndex++, tOffset += 4) { -<a name="l00302"></a>00302 ulHdrFtrOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00303"></a>00303 NO_DBG_HEX(ulHdrFtrOffset); -<a name="l00304"></a>00304 aulCharPos[tIndex] = ulHdrFtrOffset2CharPos(ulHdrFtrOffset); -<a name="l00305"></a>00305 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00306"></a>00306 } -<a name="l00307"></a>00307 vCreat6HdrFtrInfoList(aulCharPos, tLen); -<a name="l00308"></a>00308 aulCharPos = xfree(aulCharPos); -<a name="l00309"></a>00309 aucBuffer = xfree(aucBuffer); -<a name="l00310"></a>00310 } <span class="comment">/* end of vGet6HdrFtrInfo */</span> -<a name="l00311"></a>00311 -<a name="l00312"></a>00312 <span class="comment">/*</span> -<a name="l00313"></a>00313 <span class="comment"> * Translate the rowinfo to a member of the row_info enumeration</span> -<a name="l00314"></a>00314 <span class="comment"> */</span> -<a name="l00315"></a>00315 row_info_enum -<a name="l00316"></a>00316 eGet6RowInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00317"></a>00317 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, row_block_type *pRow) -<a name="l00318"></a>00318 { -<a name="l00319"></a>00319 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00320"></a>00320 <span class="keywordtype">int</span> iIndex, iSize, iCol; -<a name="l00321"></a>00321 <span class="keywordtype">int</span> iPosCurr, iPosPrev; -<a name="l00322"></a>00322 USHORT usTmp; -<a name="l00323"></a>00323 BOOL bFound24_0, bFound24_1, bFound25_0, bFound25_1, bFound190; -<a name="l00324"></a>00324 -<a name="l00325"></a>00325 fail(iFodo < 0 || aucGrpprl == NULL || pRow == NULL); -<a name="l00326"></a>00326 -<a name="l00327"></a>00327 iFodoOff = 0; -<a name="l00328"></a>00328 bFound24_0 = FALSE; -<a name="l00329"></a>00329 bFound24_1 = FALSE; -<a name="l00330"></a>00330 bFound25_0 = FALSE; -<a name="l00331"></a>00331 bFound25_1 = FALSE; -<a name="l00332"></a>00332 bFound190 = FALSE; -<a name="l00333"></a>00333 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00334"></a>00334 iInfoLen = 0; -<a name="l00335"></a>00335 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00336"></a>00336 <span class="keywordflow">case</span> 24: <span class="comment">/* fInTable */</span> -<a name="l00337"></a>00337 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 1, aucGrpprl))) { -<a name="l00338"></a>00338 bFound24_1 = TRUE; -<a name="l00339"></a>00339 } <span class="keywordflow">else</span> { -<a name="l00340"></a>00340 bFound24_0 = TRUE; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 <span class="keywordflow">break</span>; -<a name="l00343"></a>00343 <span class="keywordflow">case</span> 25: <span class="comment">/* fTtp */</span> -<a name="l00344"></a>00344 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 1, aucGrpprl))) { -<a name="l00345"></a>00345 bFound25_1 = TRUE; -<a name="l00346"></a>00346 } <span class="keywordflow">else</span> { -<a name="l00347"></a>00347 bFound25_0 = TRUE; -<a name="l00348"></a>00348 } -<a name="l00349"></a>00349 <span class="keywordflow">break</span>; -<a name="l00350"></a>00350 <span class="keywordflow">case</span> 38: <span class="comment">/* brcTop */</span> -<a name="l00351"></a>00351 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00352"></a>00352 usTmp &= 0x0018; -<a name="l00353"></a>00353 NO_DBG_DEC(usTmp >> 3); -<a name="l00354"></a>00354 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00355"></a>00355 pRow->ucBorderInfo &= ~TABLE_BORDER_TOP; -<a name="l00356"></a>00356 } <span class="keywordflow">else</span> { -<a name="l00357"></a>00357 pRow->ucBorderInfo |= TABLE_BORDER_TOP; -<a name="l00358"></a>00358 } -<a name="l00359"></a>00359 <span class="keywordflow">break</span>; -<a name="l00360"></a>00360 <span class="keywordflow">case</span> 39: <span class="comment">/* brcLeft */</span> -<a name="l00361"></a>00361 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00362"></a>00362 usTmp &= 0x0018; -<a name="l00363"></a>00363 NO_DBG_DEC(usTmp >> 3); -<a name="l00364"></a>00364 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00365"></a>00365 pRow->ucBorderInfo &= ~TABLE_BORDER_LEFT; -<a name="l00366"></a>00366 } <span class="keywordflow">else</span> { -<a name="l00367"></a>00367 pRow->ucBorderInfo |= TABLE_BORDER_LEFT; -<a name="l00368"></a>00368 } -<a name="l00369"></a>00369 <span class="keywordflow">break</span>; -<a name="l00370"></a>00370 <span class="keywordflow">case</span> 40: <span class="comment">/* brcBottom */</span> -<a name="l00371"></a>00371 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00372"></a>00372 usTmp &= 0x0018; -<a name="l00373"></a>00373 NO_DBG_DEC(usTmp >> 3); -<a name="l00374"></a>00374 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00375"></a>00375 pRow->ucBorderInfo &= ~TABLE_BORDER_BOTTOM; -<a name="l00376"></a>00376 } <span class="keywordflow">else</span> { -<a name="l00377"></a>00377 pRow->ucBorderInfo |= TABLE_BORDER_BOTTOM; -<a name="l00378"></a>00378 } -<a name="l00379"></a>00379 <span class="keywordflow">break</span>; -<a name="l00380"></a>00380 <span class="keywordflow">case</span> 41: <span class="comment">/* brcRight */</span> -<a name="l00381"></a>00381 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00382"></a>00382 usTmp &= 0x0018; -<a name="l00383"></a>00383 NO_DBG_DEC(usTmp >> 3); -<a name="l00384"></a>00384 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00385"></a>00385 pRow->ucBorderInfo &= ~TABLE_BORDER_RIGHT; -<a name="l00386"></a>00386 } <span class="keywordflow">else</span> { -<a name="l00387"></a>00387 pRow->ucBorderInfo |= TABLE_BORDER_RIGHT; -<a name="l00388"></a>00388 } -<a name="l00389"></a>00389 <span class="keywordflow">break</span>; -<a name="l00390"></a>00390 <span class="keywordflow">case</span> 188: <span class="comment">/* cDefTable10 */</span> -<a name="l00391"></a>00391 DBG_MSG(<span class="stringliteral">"188: sprmTDefTable10"</span>); -<a name="l00392"></a>00392 iSize = (int)usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00393"></a>00393 DBG_DEC(iSize); -<a name="l00394"></a>00394 <span class="keywordflow">break</span>; -<a name="l00395"></a>00395 <span class="keywordflow">case</span> 190: <span class="comment">/* cDefTable */</span> -<a name="l00396"></a>00396 iSize = (int)usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00397"></a>00397 <span class="keywordflow">if</span> (iSize < 6 || iBytes < iFodoOff + 7) { -<a name="l00398"></a>00398 DBG_DEC(iSize); -<a name="l00399"></a>00399 DBG_DEC(iFodoOff); -<a name="l00400"></a>00400 iInfoLen = 1; -<a name="l00401"></a>00401 <span class="keywordflow">break</span>; -<a name="l00402"></a>00402 } -<a name="l00403"></a>00403 iCol = (int)ucGetByte(iFodo + iFodoOff + 3, aucGrpprl); -<a name="l00404"></a>00404 <span class="keywordflow">if</span> (iCol < 1 || -<a name="l00405"></a>00405 iBytes < iFodoOff + 3 + (iCol + 1) * 2) { -<a name="l00406"></a>00406 DBG_DEC(iCol); -<a name="l00407"></a>00407 DBG_DEC(iFodoOff); -<a name="l00408"></a>00408 iInfoLen = 1; -<a name="l00409"></a>00409 <span class="keywordflow">break</span>; -<a name="l00410"></a>00410 } -<a name="l00411"></a>00411 <span class="keywordflow">if</span> (iCol >= (<span class="keywordtype">int</span>)elementsof(pRow->asColumnWidth)) { -<a name="l00412"></a>00412 DBG_DEC(iCol); -<a name="l00413"></a>00413 werr(1, <span class="stringliteral">"The number of columns is corrupt"</span>); -<a name="l00414"></a>00414 } -<a name="l00415"></a>00415 pRow->ucNumberOfColumns = (UCHAR)iCol; -<a name="l00416"></a>00416 iPosPrev = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00417"></a>00417 iFodo + iFodoOff + 4, -<a name="l00418"></a>00418 aucGrpprl); -<a name="l00419"></a>00419 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iCol; iIndex++) { -<a name="l00420"></a>00420 iPosCurr = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00421"></a>00421 iFodo + iFodoOff + 6 + iIndex * 2, -<a name="l00422"></a>00422 aucGrpprl); -<a name="l00423"></a>00423 pRow->asColumnWidth[iIndex] = -<a name="l00424"></a>00424 (short)(iPosCurr - iPosPrev); -<a name="l00425"></a>00425 iPosPrev = iPosCurr; -<a name="l00426"></a>00426 } -<a name="l00427"></a>00427 bFound190 = TRUE; -<a name="l00428"></a>00428 <span class="keywordflow">break</span>; -<a name="l00429"></a>00429 <span class="keywordflow">default</span>: -<a name="l00430"></a>00430 <span class="keywordflow">break</span>; -<a name="l00431"></a>00431 } -<a name="l00432"></a>00432 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00433"></a>00433 iInfoLen = -<a name="l00434"></a>00434 iGet6InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00435"></a>00435 fail(iInfoLen <= 0); -<a name="l00436"></a>00436 } -<a name="l00437"></a>00437 iFodoOff += iInfoLen; -<a name="l00438"></a>00438 } -<a name="l00439"></a>00439 -<a name="l00440"></a>00440 <span class="keywordflow">if</span> (bFound25_1 && bFound190) { -<a name="l00441"></a>00441 <span class="keywordflow">return</span> found_end_of_row; -<a name="l00442"></a>00442 } -<a name="l00443"></a>00443 <span class="keywordflow">if</span> (bFound25_0 && !bFound190) { -<a name="l00444"></a>00444 <span class="keywordflow">return</span> found_not_end_of_row; -<a name="l00445"></a>00445 } -<a name="l00446"></a>00446 <span class="keywordflow">if</span> (bFound24_1) { -<a name="l00447"></a>00447 <span class="keywordflow">return</span> found_a_cell; -<a name="l00448"></a>00448 } -<a name="l00449"></a>00449 <span class="keywordflow">if</span> (bFound24_0) { -<a name="l00450"></a>00450 <span class="keywordflow">return</span> found_not_a_cell; -<a name="l00451"></a>00451 } -<a name="l00452"></a>00452 <span class="keywordflow">return</span> found_nothing; -<a name="l00453"></a>00453 } <span class="comment">/* end of eGet6RowInfo */</span> -<a name="l00454"></a>00454 -<a name="l00455"></a>00455 <span class="comment">/*</span> -<a name="l00456"></a>00456 <span class="comment"> * Fill the style information block with information</span> -<a name="l00457"></a>00457 <span class="comment"> * from a Word 6/7 file.</span> -<a name="l00458"></a>00458 <span class="comment"> */</span> -<a name="l00459"></a>00459 <span class="keywordtype">void</span> -<a name="l00460"></a>00460 vGet6StyleInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00461"></a>00461 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, style_block_type *pStyle) -<a name="l00462"></a>00462 { -<a name="l00463"></a>00463 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00464"></a>00464 <span class="keywordtype">int</span> iTmp, iDel, iAdd, iBefore; -<a name="l00465"></a>00465 <span class="keywordtype">short</span> sTmp; -<a name="l00466"></a>00466 UCHAR ucTmp; -<a name="l00467"></a>00467 -<a name="l00468"></a>00468 fail(iFodo < 0 || aucGrpprl == NULL || pStyle == NULL); -<a name="l00469"></a>00469 -<a name="l00470"></a>00470 NO_DBG_DEC(pStyle->usIstd); -<a name="l00471"></a>00471 -<a name="l00472"></a>00472 iFodoOff = 0; -<a name="l00473"></a>00473 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00474"></a>00474 iInfoLen = 0; -<a name="l00475"></a>00475 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00476"></a>00476 <span class="keywordflow">case</span> 2: <span class="comment">/* istd */</span> -<a name="l00477"></a>00477 sTmp = (short)ucGetByte( -<a name="l00478"></a>00478 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00479"></a>00479 NO_DBG_DEC(sTmp); -<a name="l00480"></a>00480 <span class="keywordflow">break</span>; -<a name="l00481"></a>00481 <span class="keywordflow">case</span> 5: <span class="comment">/* jc */</span> -<a name="l00482"></a>00482 pStyle->ucAlignment = ucGetByte( -<a name="l00483"></a>00483 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00484"></a>00484 <span class="keywordflow">break</span>; -<a name="l00485"></a>00485 <span class="keywordflow">case</span> 12: <span class="comment">/* anld */</span> -<a name="l00486"></a>00486 iTmp = (int)ucGetByte( -<a name="l00487"></a>00487 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00488"></a>00488 DBG_DEC_C(iTmp < 52, iTmp); -<a name="l00489"></a>00489 <span class="keywordflow">if</span> (iTmp >= 1) { -<a name="l00490"></a>00490 pStyle->ucNFC = ucGetByte( -<a name="l00491"></a>00491 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00492"></a>00492 } -<a name="l00493"></a>00493 <span class="keywordflow">if</span> (pStyle->ucNFC != LIST_BULLETS && iTmp >= 2) { -<a name="l00494"></a>00494 iBefore = (int)ucGetByte( -<a name="l00495"></a>00495 iFodo + iFodoOff + 3, aucGrpprl); -<a name="l00496"></a>00496 } <span class="keywordflow">else</span> { -<a name="l00497"></a>00497 iBefore = 0; -<a name="l00498"></a>00498 } -<a name="l00499"></a>00499 <span class="keywordflow">if</span> (iTmp >= 12) { -<a name="l00500"></a>00500 pStyle->usStartAt = usGetWord( -<a name="l00501"></a>00501 iFodo + iFodoOff + 12, aucGrpprl); -<a name="l00502"></a>00502 } -<a name="l00503"></a>00503 <span class="keywordflow">if</span> (iTmp >= iBefore + 21) { -<a name="l00504"></a>00504 pStyle->usListChar = (USHORT)ucGetByte( -<a name="l00505"></a>00505 iFodo + iFodoOff + iBefore + 22, -<a name="l00506"></a>00506 aucGrpprl); -<a name="l00507"></a>00507 NO_DBG_HEX(pStyle->usListChar); -<a name="l00508"></a>00508 } -<a name="l00509"></a>00509 <span class="keywordflow">break</span>; -<a name="l00510"></a>00510 <span class="keywordflow">case</span> 13: <span class="comment">/* nLvlAnm */</span> -<a name="l00511"></a>00511 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00512"></a>00512 pStyle->ucNumLevel = ucTmp; -<a name="l00513"></a>00513 pStyle->bNumPause = -<a name="l00514"></a>00514 eGetNumType(ucTmp) == level_type_pause; -<a name="l00515"></a>00515 <span class="keywordflow">break</span>; -<a name="l00516"></a>00516 <span class="keywordflow">case</span> 15: <span class="comment">/* ChgTabsPapx */</span> -<a name="l00517"></a>00517 <span class="keywordflow">case</span> 23: <span class="comment">/* ChgTabs */</span> -<a name="l00518"></a>00518 iTmp = (int)ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00519"></a>00519 <span class="keywordflow">if</span> (iTmp < 2) { -<a name="l00520"></a>00520 iInfoLen = 1; -<a name="l00521"></a>00521 <span class="keywordflow">break</span>; -<a name="l00522"></a>00522 } -<a name="l00523"></a>00523 NO_DBG_DEC(iTmp); -<a name="l00524"></a>00524 iDel = (int)ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00525"></a>00525 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel) { -<a name="l00526"></a>00526 iInfoLen = 1; -<a name="l00527"></a>00527 <span class="keywordflow">break</span>; -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 NO_DBG_DEC(iDel); -<a name="l00530"></a>00530 iAdd = (int)ucGetByte( -<a name="l00531"></a>00531 iFodo + iFodoOff + 3 + 2 * iDel, aucGrpprl); -<a name="l00532"></a>00532 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel + 2 * iAdd) { -<a name="l00533"></a>00533 iInfoLen = 1; -<a name="l00534"></a>00534 <span class="keywordflow">break</span>; -<a name="l00535"></a>00535 } -<a name="l00536"></a>00536 NO_DBG_DEC(iAdd); -<a name="l00537"></a>00537 <span class="keywordflow">break</span>; -<a name="l00538"></a>00538 <span class="keywordflow">case</span> 16: <span class="comment">/* dxaRight */</span> -<a name="l00539"></a>00539 pStyle->sRightIndent = (short)usGetWord( -<a name="l00540"></a>00540 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00541"></a>00541 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00542"></a>00542 <span class="keywordflow">break</span>; -<a name="l00543"></a>00543 <span class="keywordflow">case</span> 17: <span class="comment">/* dxaLeft */</span> -<a name="l00544"></a>00544 pStyle->sLeftIndent = (short)usGetWord( -<a name="l00545"></a>00545 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00546"></a>00546 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00547"></a>00547 <span class="keywordflow">break</span>; -<a name="l00548"></a>00548 <span class="keywordflow">case</span> 18: <span class="comment">/* Nest dxaLeft */</span> -<a name="l00549"></a>00549 sTmp = (short)usGetWord( -<a name="l00550"></a>00550 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00551"></a>00551 pStyle->sLeftIndent += sTmp; -<a name="l00552"></a>00552 <span class="keywordflow">if</span> (pStyle->sLeftIndent < 0) { -<a name="l00553"></a>00553 pStyle->sLeftIndent = 0; -<a name="l00554"></a>00554 } -<a name="l00555"></a>00555 NO_DBG_DEC(sTmp); -<a name="l00556"></a>00556 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00557"></a>00557 <span class="keywordflow">break</span>; -<a name="l00558"></a>00558 <span class="keywordflow">case</span> 19: <span class="comment">/* dxaLeft1 */</span> -<a name="l00559"></a>00559 pStyle->sLeftIndent1 = (short)usGetWord( -<a name="l00560"></a>00560 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00561"></a>00561 NO_DBG_DEC(pStyle->sLeftIndent1); -<a name="l00562"></a>00562 <span class="keywordflow">break</span>; -<a name="l00563"></a>00563 <span class="keywordflow">case</span> 21: <span class="comment">/* dyaBefore */</span> -<a name="l00564"></a>00564 pStyle->usBeforeIndent = usGetWord( -<a name="l00565"></a>00565 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00566"></a>00566 NO_DBG_DEC(pStyle->usBeforeIndent); -<a name="l00567"></a>00567 <span class="keywordflow">break</span>; -<a name="l00568"></a>00568 <span class="keywordflow">case</span> 22: <span class="comment">/* dyaAfter */</span> -<a name="l00569"></a>00569 pStyle->usAfterIndent = usGetWord( -<a name="l00570"></a>00570 iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00571"></a>00571 NO_DBG_DEC(pStyle->usAfterIndent); -<a name="l00572"></a>00572 <span class="keywordflow">break</span>; -<a name="l00573"></a>00573 <span class="keywordflow">default</span>: -<a name="l00574"></a>00574 <span class="keywordflow">break</span>; -<a name="l00575"></a>00575 } -<a name="l00576"></a>00576 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00577"></a>00577 iInfoLen = -<a name="l00578"></a>00578 iGet6InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00579"></a>00579 fail(iInfoLen <= 0); -<a name="l00580"></a>00580 } -<a name="l00581"></a>00581 iFodoOff += iInfoLen; -<a name="l00582"></a>00582 } -<a name="l00583"></a>00583 } <span class="comment">/* end of vGet6StyleInfo */</span> -<a name="l00584"></a>00584 -<a name="l00585"></a>00585 <span class="comment">/*</span> -<a name="l00586"></a>00586 <span class="comment"> * Build the lists with Paragraph Information for Word 6/7 files</span> -<a name="l00587"></a>00587 <span class="comment"> */</span> -<a name="l00588"></a>00588 <span class="keywordtype">void</span> -<a name="l00589"></a>00589 vGet6PapInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l00590"></a>00590 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00591"></a>00591 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00592"></a>00592 { -<a name="l00593"></a>00593 row_block_type tRow; -<a name="l00594"></a>00594 style_block_type tStyle; -<a name="l00595"></a>00595 USHORT *ausParfPage; -<a name="l00596"></a>00596 UCHAR *aucBuffer; -<a name="l00597"></a>00597 ULONG ulCharPos, ulCharPosFirst, ulCharPosLast; -<a name="l00598"></a>00598 ULONG ulBeginParfInfo; -<a name="l00599"></a>00599 <span class="keywordtype">size_t</span> tParfInfoLen, tParfPageNum, tOffset, tSize, tLenOld, tLen; -<a name="l00600"></a>00600 <span class="keywordtype">size_t</span> tIndex, tIndex2, tRun; -<a name="l00601"></a>00601 <span class="keywordtype">int</span> iFodo, iLen; -<a name="l00602"></a>00602 row_info_enum eRowInfo; -<a name="l00603"></a>00603 USHORT usParfFirstPage, usCount, usIstd; -<a name="l00604"></a>00604 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l00605"></a>00605 -<a name="l00606"></a>00606 fail(pFile == NULL || aucHeader == NULL); -<a name="l00607"></a>00607 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00608"></a>00608 fail(aulBBD == NULL); -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 ulBeginParfInfo = ulGetLong(0xc0, aucHeader); <span class="comment">/* fcPlcfbtePapx */</span> -<a name="l00611"></a>00611 NO_DBG_HEX(ulBeginParfInfo); -<a name="l00612"></a>00612 tParfInfoLen = (size_t)ulGetLong(0xc4, aucHeader); <span class="comment">/* lcbPlcfbtePapx */</span> -<a name="l00613"></a>00613 NO_DBG_DEC(tParfInfoLen); -<a name="l00614"></a>00614 <span class="keywordflow">if</span> (tParfInfoLen < 4) { -<a name="l00615"></a>00615 DBG_DEC(tParfInfoLen); -<a name="l00616"></a>00616 <span class="keywordflow">return</span>; -<a name="l00617"></a>00617 } -<a name="l00618"></a>00618 -<a name="l00619"></a>00619 aucBuffer = xmalloc(tParfInfoLen); -<a name="l00620"></a>00620 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00621"></a>00621 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00622"></a>00622 aucBuffer, ulBeginParfInfo, tParfInfoLen)) { -<a name="l00623"></a>00623 aucBuffer = xfree(aucBuffer); -<a name="l00624"></a>00624 <span class="keywordflow">return</span>; -<a name="l00625"></a>00625 } -<a name="l00626"></a>00626 NO_DBG_PRINT_BLOCK(aucBuffer, tParfInfoLen); -<a name="l00627"></a>00627 -<a name="l00628"></a>00628 tLen = (tParfInfoLen - 4) / 6; -<a name="l00629"></a>00629 ausParfPage = xcalloc(tLen, <span class="keyword">sizeof</span>(USHORT)); -<a name="l00630"></a>00630 <span class="keywordflow">for</span> (tIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00631"></a>00631 tIndex < tLen; -<a name="l00632"></a>00632 tIndex++, tOffset += 2) { -<a name="l00633"></a>00633 ausParfPage[tIndex] = usGetWord(tOffset, aucBuffer); -<a name="l00634"></a>00634 NO_DBG_DEC(ausParfPage[tIndex]); -<a name="l00635"></a>00635 } -<a name="l00636"></a>00636 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l00637"></a>00637 aucBuffer = xfree(aucBuffer); -<a name="l00638"></a>00638 tParfPageNum = (size_t)usGetWord(0x190, aucHeader); <span class="comment">/* cpnBtePap */</span> -<a name="l00639"></a>00639 DBG_DEC(tParfPageNum); -<a name="l00640"></a>00640 <span class="keywordflow">if</span> (tLen < tParfPageNum) { -<a name="l00641"></a>00641 <span class="comment">/* Replace ParfPage by a longer version */</span> -<a name="l00642"></a>00642 tLenOld = tLen; -<a name="l00643"></a>00643 usParfFirstPage = usGetWord(0x18c, aucHeader); <span class="comment">/* pnPapFirst */</span> -<a name="l00644"></a>00644 DBG_DEC(usParfFirstPage); -<a name="l00645"></a>00645 tLen += tParfPageNum - 1; -<a name="l00646"></a>00646 tSize = tLen * <span class="keyword">sizeof</span>(USHORT); -<a name="l00647"></a>00647 ausParfPage = xrealloc(ausParfPage, tSize); -<a name="l00648"></a>00648 <span class="comment">/* Add new values */</span> -<a name="l00649"></a>00649 usCount = usParfFirstPage + 1; -<a name="l00650"></a>00650 <span class="keywordflow">for</span> (tIndex = tLenOld; tIndex < tLen; tIndex++) { -<a name="l00651"></a>00651 ausParfPage[tIndex] = usCount; -<a name="l00652"></a>00652 NO_DBG_DEC(ausParfPage[tIndex]); -<a name="l00653"></a>00653 usCount++; -<a name="l00654"></a>00654 } -<a name="l00655"></a>00655 } -<a name="l00656"></a>00656 -<a name="l00657"></a>00657 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l00658"></a>00658 ulCharPosFirst = CP_INVALID; -<a name="l00659"></a>00659 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00660"></a>00660 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00661"></a>00661 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00662"></a>00662 aucFpage, -<a name="l00663"></a>00663 (ULONG)ausParfPage[tIndex] * BIG_BLOCK_SIZE, -<a name="l00664"></a>00664 BIG_BLOCK_SIZE)) { -<a name="l00665"></a>00665 <span class="keywordflow">break</span>; -<a name="l00666"></a>00666 } -<a name="l00667"></a>00667 tRun = (size_t)ucGetByte(0x1ff, aucFpage); -<a name="l00668"></a>00668 NO_DBG_DEC(tRun); -<a name="l00669"></a>00669 <span class="keywordflow">for</span> (tIndex2 = 0; tIndex2 < tRun; tIndex2++) { -<a name="l00670"></a>00670 NO_DBG_HEX(ulGetLong(tIndex2 * 4, aucFpage)); -<a name="l00671"></a>00671 iFodo = 2 * (int)ucGetByte( -<a name="l00672"></a>00672 (tRun + 1) * 4 + tIndex2 * 7, aucFpage); -<a name="l00673"></a>00673 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l00674"></a>00674 <span class="keywordflow">continue</span>; -<a name="l00675"></a>00675 } -<a name="l00676"></a>00676 -<a name="l00677"></a>00677 iLen = 2 * (int)ucGetByte(iFodo, aucFpage); -<a name="l00678"></a>00678 -<a name="l00679"></a>00679 usIstd = (USHORT)ucGetByte(iFodo + 1, aucFpage); -<a name="l00680"></a>00680 vFillStyleFromStylesheet(usIstd, &tStyle); -<a name="l00681"></a>00681 vGet6StyleInfo(iFodo, aucFpage + 3, iLen - 3, &tStyle); -<a name="l00682"></a>00682 ulCharPos = ulGetLong(tIndex2 * 4, aucFpage); -<a name="l00683"></a>00683 NO_DBG_HEX(ulCharPos); -<a name="l00684"></a>00684 tStyle.ulFileOffset = ulCharPos2FileOffsetX( -<a name="l00685"></a>00685 ulCharPos, &tStyle.eListID); -<a name="l00686"></a>00686 vAdd2StyleInfoList(&tStyle); -<a name="l00687"></a>00687 -<a name="l00688"></a>00688 eRowInfo = eGet6RowInfo(iFodo, -<a name="l00689"></a>00689 aucFpage + 3, iLen - 3, &tRow); -<a name="l00690"></a>00690 <span class="keywordflow">switch</span>(eRowInfo) { -<a name="l00691"></a>00691 <span class="keywordflow">case</span> found_a_cell: -<a name="l00692"></a>00692 <span class="keywordflow">if</span> (ulCharPosFirst != CP_INVALID) { -<a name="l00693"></a>00693 <span class="keywordflow">break</span>; -<a name="l00694"></a>00694 } -<a name="l00695"></a>00695 ulCharPosFirst = ulGetLong( -<a name="l00696"></a>00696 tIndex2 * 4, aucFpage); -<a name="l00697"></a>00697 NO_DBG_HEX(ulCharPosFirst); -<a name="l00698"></a>00698 tRow.ulCharPosStart = ulCharPosFirst; -<a name="l00699"></a>00699 tRow.ulFileOffsetStart = -<a name="l00700"></a>00700 ulCharPos2FileOffset(ulCharPosFirst); -<a name="l00701"></a>00701 DBG_HEX_C(tRow.ulFileOffsetStart == FC_INVALID, -<a name="l00702"></a>00702 ulCharPosFirst); -<a name="l00703"></a>00703 <span class="keywordflow">break</span>; -<a name="l00704"></a>00704 <span class="keywordflow">case</span> found_end_of_row: -<a name="l00705"></a>00705 ulCharPosLast = ulGetLong( -<a name="l00706"></a>00706 tIndex2 * 4, aucFpage); -<a name="l00707"></a>00707 NO_DBG_HEX(ulCharPosLast); -<a name="l00708"></a>00708 tRow.ulCharPosEnd = ulCharPosLast; -<a name="l00709"></a>00709 tRow.ulFileOffsetEnd = -<a name="l00710"></a>00710 ulCharPos2FileOffset(ulCharPosLast); -<a name="l00711"></a>00711 DBG_HEX_C(tRow.ulFileOffsetEnd == FC_INVALID, -<a name="l00712"></a>00712 ulCharPosLast); -<a name="l00713"></a>00713 vAdd2RowInfoList(&tRow); -<a name="l00714"></a>00714 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l00715"></a>00715 ulCharPosFirst = CP_INVALID; -<a name="l00716"></a>00716 <span class="keywordflow">break</span>; -<a name="l00717"></a>00717 <span class="keywordflow">case</span> found_nothing: -<a name="l00718"></a>00718 <span class="keywordflow">break</span>; -<a name="l00719"></a>00719 <span class="keywordflow">default</span>: -<a name="l00720"></a>00720 DBG_DEC(eRowInfo); -<a name="l00721"></a>00721 <span class="keywordflow">break</span>; -<a name="l00722"></a>00722 } -<a name="l00723"></a>00723 } -<a name="l00724"></a>00724 } -<a name="l00725"></a>00725 ausParfPage = xfree(ausParfPage); -<a name="l00726"></a>00726 } <span class="comment">/* end of vGet6PapInfo */</span> -<a name="l00727"></a>00727 -<a name="l00728"></a>00728 <span class="comment">/*</span> -<a name="l00729"></a>00729 <span class="comment"> * Fill the font information block with information</span> -<a name="l00730"></a>00730 <span class="comment"> * from a Word 6/7 file.</span> -<a name="l00731"></a>00731 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00732"></a>00732 <span class="comment"> */</span> -<a name="l00733"></a>00733 <span class="keywordtype">void</span> -<a name="l00734"></a>00734 vGet6FontInfo(<span class="keywordtype">int</span> iFodo, USHORT usIstd, -<a name="l00735"></a>00735 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, font_block_type *pFont) -<a name="l00736"></a>00736 { -<a name="l00737"></a>00737 <span class="keywordtype">long</span> lTmp; -<a name="l00738"></a>00738 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00739"></a>00739 USHORT usTmp; -<a name="l00740"></a>00740 UCHAR ucTmp; -<a name="l00741"></a>00741 -<a name="l00742"></a>00742 TRACE_MSG(<span class="stringliteral">"vGet6FontInfo"</span>); -<a name="l00743"></a>00743 -<a name="l00744"></a>00744 fail(iFodo < 0 || aucGrpprl == NULL || pFont == NULL); -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 iFodoOff = 0; -<a name="l00747"></a>00747 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00748"></a>00748 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00749"></a>00749 <span class="keywordflow">case</span> 65: <span class="comment">/* fRMarkDel */</span> -<a name="l00750"></a>00750 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00751"></a>00751 <span class="keywordflow">if</span> (ucTmp == 0) { -<a name="l00752"></a>00752 pFont->usFontStyle &= ~FONT_MARKDEL; -<a name="l00753"></a>00753 } <span class="keywordflow">else</span> { -<a name="l00754"></a>00754 pFont->usFontStyle |= FONT_MARKDEL; -<a name="l00755"></a>00755 } -<a name="l00756"></a>00756 <span class="keywordflow">break</span>; -<a name="l00757"></a>00757 <span class="keywordflow">case</span> 80: <span class="comment">/* cIstd */</span> -<a name="l00758"></a>00758 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00759"></a>00759 NO_DBG_DEC(usTmp); -<a name="l00760"></a>00760 <span class="keywordflow">break</span>; -<a name="l00761"></a>00761 <span class="keywordflow">case</span> 82: <span class="comment">/* cDefault */</span> -<a name="l00762"></a>00762 pFont->usFontStyle &= FONT_HIDDEN; -<a name="l00763"></a>00763 pFont->ucFontColor = FONT_COLOR_DEFAULT; -<a name="l00764"></a>00764 <span class="keywordflow">break</span>; -<a name="l00765"></a>00765 <span class="keywordflow">case</span> 83: <span class="comment">/* cPlain */</span> -<a name="l00766"></a>00766 DBG_MSG(<span class="stringliteral">"83: cPlain"</span>); -<a name="l00767"></a>00767 vFillFontFromStylesheet(usIstd, pFont); -<a name="l00768"></a>00768 <span class="keywordflow">break</span>; -<a name="l00769"></a>00769 <span class="keywordflow">case</span> 85: <span class="comment">/* fBold */</span> -<a name="l00770"></a>00770 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00771"></a>00771 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00772"></a>00772 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00773"></a>00773 pFont->usFontStyle &= ~FONT_BOLD; -<a name="l00774"></a>00774 <span class="keywordflow">break</span>; -<a name="l00775"></a>00775 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00776"></a>00776 pFont->usFontStyle |= FONT_BOLD; -<a name="l00777"></a>00777 <span class="keywordflow">break</span>; -<a name="l00778"></a>00778 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00779"></a>00779 <span class="keywordflow">break</span>; -<a name="l00780"></a>00780 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00781"></a>00781 pFont->usFontStyle ^= FONT_BOLD; -<a name="l00782"></a>00782 <span class="keywordflow">break</span>; -<a name="l00783"></a>00783 <span class="keywordflow">default</span>: -<a name="l00784"></a>00784 DBG_DEC(ucTmp); -<a name="l00785"></a>00785 DBG_FIXME(); -<a name="l00786"></a>00786 <span class="keywordflow">break</span>; -<a name="l00787"></a>00787 } -<a name="l00788"></a>00788 <span class="keywordflow">break</span>; -<a name="l00789"></a>00789 <span class="keywordflow">case</span> 86: <span class="comment">/* fItalic */</span> -<a name="l00790"></a>00790 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00791"></a>00791 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00792"></a>00792 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00793"></a>00793 pFont->usFontStyle &= ~FONT_ITALIC; -<a name="l00794"></a>00794 <span class="keywordflow">break</span>; -<a name="l00795"></a>00795 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00796"></a>00796 pFont->usFontStyle |= FONT_ITALIC; -<a name="l00797"></a>00797 <span class="keywordflow">break</span>; -<a name="l00798"></a>00798 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00799"></a>00799 <span class="keywordflow">break</span>; -<a name="l00800"></a>00800 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00801"></a>00801 pFont->usFontStyle ^= FONT_ITALIC; -<a name="l00802"></a>00802 <span class="keywordflow">break</span>; -<a name="l00803"></a>00803 <span class="keywordflow">default</span>: -<a name="l00804"></a>00804 DBG_DEC(ucTmp); -<a name="l00805"></a>00805 DBG_FIXME(); -<a name="l00806"></a>00806 <span class="keywordflow">break</span>; -<a name="l00807"></a>00807 } -<a name="l00808"></a>00808 <span class="keywordflow">break</span>; -<a name="l00809"></a>00809 <span class="keywordflow">case</span> 87: <span class="comment">/* fStrike */</span> -<a name="l00810"></a>00810 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00811"></a>00811 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00812"></a>00812 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00813"></a>00813 pFont->usFontStyle &= ~FONT_STRIKE; -<a name="l00814"></a>00814 <span class="keywordflow">break</span>; -<a name="l00815"></a>00815 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00816"></a>00816 pFont->usFontStyle |= FONT_STRIKE; -<a name="l00817"></a>00817 <span class="keywordflow">break</span>; -<a name="l00818"></a>00818 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00819"></a>00819 <span class="keywordflow">break</span>; -<a name="l00820"></a>00820 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00821"></a>00821 pFont->usFontStyle ^= FONT_STRIKE; -<a name="l00822"></a>00822 <span class="keywordflow">break</span>; -<a name="l00823"></a>00823 <span class="keywordflow">default</span>: -<a name="l00824"></a>00824 DBG_DEC(ucTmp); -<a name="l00825"></a>00825 DBG_FIXME(); -<a name="l00826"></a>00826 <span class="keywordflow">break</span>; -<a name="l00827"></a>00827 } -<a name="l00828"></a>00828 <span class="keywordflow">break</span>; -<a name="l00829"></a>00829 <span class="keywordflow">case</span> 90: <span class="comment">/* fSmallCaps */</span> -<a name="l00830"></a>00830 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00831"></a>00831 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00832"></a>00832 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00833"></a>00833 pFont->usFontStyle &= ~FONT_SMALL_CAPITALS; -<a name="l00834"></a>00834 <span class="keywordflow">break</span>; -<a name="l00835"></a>00835 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00836"></a>00836 pFont->usFontStyle |= FONT_SMALL_CAPITALS; -<a name="l00837"></a>00837 <span class="keywordflow">break</span>; -<a name="l00838"></a>00838 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00839"></a>00839 <span class="keywordflow">break</span>; -<a name="l00840"></a>00840 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00841"></a>00841 pFont->usFontStyle ^= FONT_SMALL_CAPITALS; -<a name="l00842"></a>00842 <span class="keywordflow">break</span>; -<a name="l00843"></a>00843 <span class="keywordflow">default</span>: -<a name="l00844"></a>00844 DBG_DEC(ucTmp); -<a name="l00845"></a>00845 DBG_FIXME(); -<a name="l00846"></a>00846 <span class="keywordflow">break</span>; -<a name="l00847"></a>00847 } -<a name="l00848"></a>00848 <span class="keywordflow">break</span>; -<a name="l00849"></a>00849 <span class="keywordflow">case</span> 91: <span class="comment">/* fCaps */</span> -<a name="l00850"></a>00850 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00851"></a>00851 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00852"></a>00852 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00853"></a>00853 pFont->usFontStyle &= ~FONT_CAPITALS; -<a name="l00854"></a>00854 <span class="keywordflow">break</span>; -<a name="l00855"></a>00855 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00856"></a>00856 pFont->usFontStyle |= FONT_CAPITALS; -<a name="l00857"></a>00857 <span class="keywordflow">break</span>; -<a name="l00858"></a>00858 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00859"></a>00859 <span class="keywordflow">break</span>; -<a name="l00860"></a>00860 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00861"></a>00861 pFont->usFontStyle ^= FONT_CAPITALS; -<a name="l00862"></a>00862 <span class="keywordflow">break</span>; -<a name="l00863"></a>00863 <span class="keywordflow">default</span>: -<a name="l00864"></a>00864 DBG_DEC(ucTmp); -<a name="l00865"></a>00865 DBG_FIXME(); -<a name="l00866"></a>00866 <span class="keywordflow">break</span>; -<a name="l00867"></a>00867 } -<a name="l00868"></a>00868 <span class="keywordflow">break</span>; -<a name="l00869"></a>00869 <span class="keywordflow">case</span> 92: <span class="comment">/* fVanish */</span> -<a name="l00870"></a>00870 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00871"></a>00871 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l00872"></a>00872 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l00873"></a>00873 pFont->usFontStyle &= ~FONT_HIDDEN; -<a name="l00874"></a>00874 <span class="keywordflow">break</span>; -<a name="l00875"></a>00875 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l00876"></a>00876 pFont->usFontStyle |= FONT_HIDDEN; -<a name="l00877"></a>00877 <span class="keywordflow">break</span>; -<a name="l00878"></a>00878 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l00879"></a>00879 <span class="keywordflow">break</span>; -<a name="l00880"></a>00880 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l00881"></a>00881 pFont->usFontStyle ^= FONT_HIDDEN; -<a name="l00882"></a>00882 <span class="keywordflow">break</span>; -<a name="l00883"></a>00883 <span class="keywordflow">default</span>: -<a name="l00884"></a>00884 DBG_DEC(ucTmp); -<a name="l00885"></a>00885 DBG_FIXME(); -<a name="l00886"></a>00886 <span class="keywordflow">break</span>; -<a name="l00887"></a>00887 } -<a name="l00888"></a>00888 <span class="keywordflow">break</span>; -<a name="l00889"></a>00889 <span class="keywordflow">case</span> 93: <span class="comment">/* cFtc */</span> -<a name="l00890"></a>00890 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00891"></a>00891 <span class="keywordflow">if</span> (usTmp <= (USHORT)UCHAR_MAX) { -<a name="l00892"></a>00892 pFont->ucFontNumber = (UCHAR)usTmp; -<a name="l00893"></a>00893 } <span class="keywordflow">else</span> { -<a name="l00894"></a>00894 DBG_DEC(usTmp); -<a name="l00895"></a>00895 DBG_FIXME(); -<a name="l00896"></a>00896 pFont->ucFontNumber = 0; -<a name="l00897"></a>00897 } -<a name="l00898"></a>00898 <span class="keywordflow">break</span>; -<a name="l00899"></a>00899 <span class="keywordflow">case</span> 94: <span class="comment">/* cKul */</span> -<a name="l00900"></a>00900 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00901"></a>00901 <span class="keywordflow">if</span> (ucTmp == 0 || ucTmp == 5) { -<a name="l00902"></a>00902 pFont->usFontStyle &= ~FONT_UNDERLINE; -<a name="l00903"></a>00903 } <span class="keywordflow">else</span> { -<a name="l00904"></a>00904 NO_DBG_MSG(<span class="stringliteral">"Underline text"</span>); -<a name="l00905"></a>00905 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00906"></a>00906 <span class="keywordflow">if</span> (ucTmp == 6) { -<a name="l00907"></a>00907 DBG_MSG(<span class="stringliteral">"Bold text"</span>); -<a name="l00908"></a>00908 pFont->usFontStyle |= FONT_BOLD; -<a name="l00909"></a>00909 } -<a name="l00910"></a>00910 } -<a name="l00911"></a>00911 <span class="keywordflow">break</span>; -<a name="l00912"></a>00912 <span class="keywordflow">case</span> 95: <span class="comment">/* cHps, cHpsPos */</span> -<a name="l00913"></a>00913 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00914"></a>00914 DBG_DEC(ucTmp); -<a name="l00915"></a>00915 <span class="keywordflow">if</span> (ucTmp != 0) { -<a name="l00916"></a>00916 pFont->usFontSize = (USHORT)ucTmp; -<a name="l00917"></a>00917 } -<a name="l00918"></a>00918 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00919"></a>00919 DBG_DEC(ucTmp); -<a name="l00920"></a>00920 <span class="keywordflow">break</span>; -<a name="l00921"></a>00921 <span class="keywordflow">case</span> 98: <span class="comment">/* cIco */</span> -<a name="l00922"></a>00922 pFont->ucFontColor = -<a name="l00923"></a>00923 ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00924"></a>00924 <span class="keywordflow">break</span>; -<a name="l00925"></a>00925 <span class="keywordflow">case</span> 99: <span class="comment">/* cHps */</span> -<a name="l00926"></a>00926 pFont->usFontSize = -<a name="l00927"></a>00927 usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00928"></a>00928 <span class="keywordflow">break</span>; -<a name="l00929"></a>00929 <span class="keywordflow">case</span> 100: <span class="comment">/* cHpsInc */</span> -<a name="l00930"></a>00930 DBG_MSG(<span class="stringliteral">"100: sprmCHpsInc"</span>); -<a name="l00931"></a>00931 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00932"></a>00932 DBG_DEC(ucTmp); -<a name="l00933"></a>00933 <span class="keywordflow">break</span>; -<a name="l00934"></a>00934 <span class="keywordflow">case</span> 103: <span class="comment">/* cMajority */</span> -<a name="l00935"></a>00935 DBG_MSG(<span class="stringliteral">"103: sprmCMajority"</span>); -<a name="l00936"></a>00936 <span class="keywordflow">break</span>; -<a name="l00937"></a>00937 <span class="keywordflow">case</span> 104: <span class="comment">/* cIss */</span> -<a name="l00938"></a>00938 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00939"></a>00939 ucTmp &= 0x07; -<a name="l00940"></a>00940 <span class="keywordflow">if</span> (ucTmp == 1) { -<a name="l00941"></a>00941 pFont->usFontStyle |= FONT_SUPERSCRIPT; -<a name="l00942"></a>00942 NO_DBG_MSG(<span class="stringliteral">"Superscript"</span>); -<a name="l00943"></a>00943 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucTmp == 2) { -<a name="l00944"></a>00944 pFont->usFontStyle |= FONT_SUBSCRIPT; -<a name="l00945"></a>00945 NO_DBG_MSG(<span class="stringliteral">"Subscript"</span>); -<a name="l00946"></a>00946 } -<a name="l00947"></a>00947 <span class="keywordflow">break</span>; -<a name="l00948"></a>00948 <span class="keywordflow">case</span> 106: <span class="comment">/* cHpsInc1 */</span> -<a name="l00949"></a>00949 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00950"></a>00950 lTmp = (long)pFont->usFontSize + (<span class="keywordtype">long</span>)usTmp; -<a name="l00951"></a>00951 <span class="keywordflow">if</span> (lTmp < 8) { -<a name="l00952"></a>00952 pFont->usFontSize = 8; -<a name="l00953"></a>00953 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lTmp > 32766) { -<a name="l00954"></a>00954 pFont->usFontSize = 32766; -<a name="l00955"></a>00955 } <span class="keywordflow">else</span> { -<a name="l00956"></a>00956 pFont->usFontSize = (USHORT)lTmp; -<a name="l00957"></a>00957 } -<a name="l00958"></a>00958 <span class="keywordflow">break</span>; -<a name="l00959"></a>00959 <span class="keywordflow">case</span> 108: <span class="comment">/* cMajority50 */</span> -<a name="l00960"></a>00960 DBG_MSG(<span class="stringliteral">"108: sprmCMajority50"</span>); -<a name="l00961"></a>00961 <span class="keywordflow">break</span>; -<a name="l00962"></a>00962 <span class="keywordflow">case</span> 109: <span class="comment">/* cHpsMul */</span> -<a name="l00963"></a>00963 DBG_MSG(<span class="stringliteral">"109: sprmCHpsMul"</span>); -<a name="l00964"></a>00964 usTmp = usGetWord(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l00965"></a>00965 DBG_DEC(usTmp); -<a name="l00966"></a>00966 <span class="keywordflow">break</span>; -<a name="l00967"></a>00967 <span class="keywordflow">default</span>: -<a name="l00968"></a>00968 <span class="keywordflow">break</span>; -<a name="l00969"></a>00969 } -<a name="l00970"></a>00970 iInfoLen = iGet6InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00971"></a>00971 fail(iInfoLen <= 0); -<a name="l00972"></a>00972 iFodoOff += iInfoLen; -<a name="l00973"></a>00973 } -<a name="l00974"></a>00974 } <span class="comment">/* end of vGet6FontInfo */</span> -<a name="l00975"></a>00975 -<a name="l00976"></a>00976 <span class="comment">/*</span> -<a name="l00977"></a>00977 <span class="comment"> * Fill the picture information block with information</span> -<a name="l00978"></a>00978 <span class="comment"> * from a Word 6/7 file.</span> -<a name="l00979"></a>00979 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l00980"></a>00980 <span class="comment"> */</span> -<a name="l00981"></a>00981 <span class="keyword">static</span> BOOL -<a name="l00982"></a>00982 bGet6PicInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00983"></a>00983 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, picture_block_type *pPicture) -<a name="l00984"></a>00984 { -<a name="l00985"></a>00985 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00986"></a>00986 BOOL bFound; -<a name="l00987"></a>00987 UCHAR ucTmp; -<a name="l00988"></a>00988 -<a name="l00989"></a>00989 TRACE_MSG(<span class="stringliteral">"vGet6PicInfo"</span>); -<a name="l00990"></a>00990 -<a name="l00991"></a>00991 fail(iFodo < 0 || aucGrpprl == NULL || pPicture == NULL); -<a name="l00992"></a>00992 -<a name="l00993"></a>00993 iFodoOff = 0; -<a name="l00994"></a>00994 bFound = FALSE; -<a name="l00995"></a>00995 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 1) { -<a name="l00996"></a>00996 <span class="keywordflow">switch</span> (ucGetByte(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00997"></a>00997 <span class="keywordflow">case</span> 68: <span class="comment">/* fcPic */</span> -<a name="l00998"></a>00998 pPicture->ulPictureOffset = ulGetLong( -<a name="l00999"></a>00999 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01000"></a>01000 bFound = TRUE; -<a name="l01001"></a>01001 <span class="keywordflow">break</span>; -<a name="l01002"></a>01002 <span class="preprocessor">#if 0</span> -<a name="l01003"></a>01003 <span class="preprocessor"></span> <span class="keywordflow">case</span> 71: <span class="comment">/* fData */</span> -<a name="l01004"></a>01004 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l01005"></a>01005 <span class="keywordflow">if</span> (ucTmp == 0x01) { -<a name="l01006"></a>01006 <span class="comment">/* Not a picture, but a form field */</span> -<a name="l01007"></a>01007 <span class="keywordflow">return</span> FALSE; -<a name="l01008"></a>01008 } -<a name="l01009"></a>01009 DBG_DEC_C(ucTmp != 0, ucTmp); -<a name="l01010"></a>01010 <span class="keywordflow">break</span>; -<a name="l01011"></a>01011 <span class="preprocessor">#endif</span> -<a name="l01012"></a>01012 <span class="preprocessor"></span> <span class="keywordflow">case</span> 75: <span class="comment">/* fOle2 */</span> -<a name="l01013"></a>01013 ucTmp = ucGetByte(iFodo + iFodoOff + 1, aucGrpprl); -<a name="l01014"></a>01014 <span class="keywordflow">if</span> (ucTmp == 0x01) { -<a name="l01015"></a>01015 <span class="comment">/* Not a picture, but an OLE object */</span> -<a name="l01016"></a>01016 <span class="keywordflow">return</span> FALSE; -<a name="l01017"></a>01017 } -<a name="l01018"></a>01018 DBG_DEC_C(ucTmp != 0, ucTmp); -<a name="l01019"></a>01019 <span class="keywordflow">break</span>; -<a name="l01020"></a>01020 <span class="keywordflow">default</span>: -<a name="l01021"></a>01021 <span class="keywordflow">break</span>; -<a name="l01022"></a>01022 } -<a name="l01023"></a>01023 iInfoLen = iGet6InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l01024"></a>01024 fail(iInfoLen <= 0); -<a name="l01025"></a>01025 iFodoOff += iInfoLen; -<a name="l01026"></a>01026 } -<a name="l01027"></a>01027 <span class="keywordflow">return</span> bFound; -<a name="l01028"></a>01028 } <span class="comment">/* end of bGet6PicInfo */</span> -<a name="l01029"></a>01029 -<a name="l01030"></a>01030 <span class="comment">/*</span> -<a name="l01031"></a>01031 <span class="comment"> * Build the lists with Character Information for Word 6/7 files</span> -<a name="l01032"></a>01032 <span class="comment"> */</span> -<a name="l01033"></a>01033 <span class="keywordtype">void</span> -<a name="l01034"></a>01034 vGet6ChrInfo(FILE *pFile, ULONG ulStartBlock, -<a name="l01035"></a>01035 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l01036"></a>01036 { -<a name="l01037"></a>01037 font_block_type tFont; -<a name="l01038"></a>01038 picture_block_type tPicture; -<a name="l01039"></a>01039 USHORT *ausCharPage; -<a name="l01040"></a>01040 UCHAR *aucBuffer; -<a name="l01041"></a>01041 ULONG ulFileOffset, ulCharPos, ulBeginCharInfo; -<a name="l01042"></a>01042 <span class="keywordtype">size_t</span> tCharInfoLen, tOffset, tSize, tLenOld, tLen, tCharPageNum; -<a name="l01043"></a>01043 <span class="keywordtype">size_t</span> tIndex, tIndex2, tRun; -<a name="l01044"></a>01044 <span class="keywordtype">int</span> iFodo, iLen; -<a name="l01045"></a>01045 USHORT usCharFirstPage, usCount, usIstd; -<a name="l01046"></a>01046 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l01047"></a>01047 -<a name="l01048"></a>01048 fail(pFile == NULL || aucHeader == NULL); -<a name="l01049"></a>01049 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l01050"></a>01050 fail(aulBBD == NULL); -<a name="l01051"></a>01051 -<a name="l01052"></a>01052 ulBeginCharInfo = ulGetLong(0xb8, aucHeader); <span class="comment">/* fcPlcfbteChpx */</span> -<a name="l01053"></a>01053 NO_DBG_HEX(lBeginCharInfo); -<a name="l01054"></a>01054 tCharInfoLen = (size_t)ulGetLong(0xbc, aucHeader); <span class="comment">/* lcbPlcfbteChpx */</span> -<a name="l01055"></a>01055 NO_DBG_DEC(tCharInfoLen); -<a name="l01056"></a>01056 <span class="keywordflow">if</span> (tCharInfoLen < 4) { -<a name="l01057"></a>01057 DBG_DEC(tCharInfoLen); -<a name="l01058"></a>01058 <span class="keywordflow">return</span>; -<a name="l01059"></a>01059 } -<a name="l01060"></a>01060 -<a name="l01061"></a>01061 aucBuffer = xmalloc(tCharInfoLen); -<a name="l01062"></a>01062 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l01063"></a>01063 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l01064"></a>01064 aucBuffer, ulBeginCharInfo, tCharInfoLen)) { -<a name="l01065"></a>01065 aucBuffer = xfree(aucBuffer); -<a name="l01066"></a>01066 <span class="keywordflow">return</span>; -<a name="l01067"></a>01067 } -<a name="l01068"></a>01068 -<a name="l01069"></a>01069 tLen = (tCharInfoLen - 4) / 6; -<a name="l01070"></a>01070 ausCharPage = xcalloc(tLen, <span class="keyword">sizeof</span>(USHORT)); -<a name="l01071"></a>01071 <span class="keywordflow">for</span> (tIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l01072"></a>01072 tIndex < tLen; -<a name="l01073"></a>01073 tIndex++, tOffset += 2) { -<a name="l01074"></a>01074 ausCharPage[tIndex] = usGetWord(tOffset, aucBuffer); -<a name="l01075"></a>01075 NO_DBG_DEC(ausCharPage[tIndex]); -<a name="l01076"></a>01076 } -<a name="l01077"></a>01077 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l01078"></a>01078 aucBuffer = xfree(aucBuffer); -<a name="l01079"></a>01079 tCharPageNum = (size_t)usGetWord(0x18e, aucHeader); <span class="comment">/* cpnBteChp */</span> -<a name="l01080"></a>01080 DBG_DEC(tCharPageNum); -<a name="l01081"></a>01081 <span class="keywordflow">if</span> (tLen < tCharPageNum) { -<a name="l01082"></a>01082 <span class="comment">/* Replace CharPage by a longer version */</span> -<a name="l01083"></a>01083 tLenOld = tLen; -<a name="l01084"></a>01084 usCharFirstPage = usGetWord(0x18a, aucHeader); <span class="comment">/* pnChrFirst */</span> -<a name="l01085"></a>01085 DBG_DEC(usCharFirstPage); -<a name="l01086"></a>01086 tLen += tCharPageNum - 1; -<a name="l01087"></a>01087 tSize = tLen * <span class="keyword">sizeof</span>(USHORT); -<a name="l01088"></a>01088 ausCharPage = xrealloc(ausCharPage, tSize); -<a name="l01089"></a>01089 <span class="comment">/* Add new values */</span> -<a name="l01090"></a>01090 usCount = usCharFirstPage + 1; -<a name="l01091"></a>01091 <span class="keywordflow">for</span> (tIndex = tLenOld; tIndex < tLen; tIndex++) { -<a name="l01092"></a>01092 ausCharPage[tIndex] = usCount; -<a name="l01093"></a>01093 NO_DBG_DEC(ausCharPage[tIndex]); -<a name="l01094"></a>01094 usCount++; -<a name="l01095"></a>01095 } -<a name="l01096"></a>01096 } -<a name="l01097"></a>01097 -<a name="l01098"></a>01098 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l01099"></a>01099 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l01100"></a>01100 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l01101"></a>01101 aucFpage, -<a name="l01102"></a>01102 (ULONG)ausCharPage[tIndex] * BIG_BLOCK_SIZE, -<a name="l01103"></a>01103 BIG_BLOCK_SIZE)) { -<a name="l01104"></a>01104 <span class="keywordflow">break</span>; -<a name="l01105"></a>01105 } -<a name="l01106"></a>01106 tRun = (size_t)ucGetByte(0x1ff, aucFpage); -<a name="l01107"></a>01107 NO_DBG_DEC(tRun); -<a name="l01108"></a>01108 <span class="keywordflow">for</span> (tIndex2 = 0; tIndex2 < tRun; tIndex2++) { -<a name="l01109"></a>01109 ulCharPos = ulGetLong(tIndex2 * 4, aucFpage); -<a name="l01110"></a>01110 ulFileOffset = ulCharPos2FileOffset(ulCharPos); -<a name="l01111"></a>01111 iFodo = 2 * (int)ucGetByte( -<a name="l01112"></a>01112 (tRun + 1) * 4 + tIndex2, aucFpage); -<a name="l01113"></a>01113 -<a name="l01114"></a>01114 iLen = (int)ucGetByte(iFodo, aucFpage); -<a name="l01115"></a>01115 -<a name="l01116"></a>01116 usIstd = usGetIstd(ulFileOffset); -<a name="l01117"></a>01117 vFillFontFromStylesheet(usIstd, &tFont); -<a name="l01118"></a>01118 <span class="keywordflow">if</span> (iFodo != 0) { -<a name="l01119"></a>01119 vGet6FontInfo(iFodo, usIstd, -<a name="l01120"></a>01120 aucFpage + 1, iLen - 1, &tFont); -<a name="l01121"></a>01121 } -<a name="l01122"></a>01122 tFont.ulFileOffset = ulFileOffset; -<a name="l01123"></a>01123 vAdd2FontInfoList(&tFont); -<a name="l01124"></a>01124 -<a name="l01125"></a>01125 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l01126"></a>01126 <span class="keywordflow">continue</span>; -<a name="l01127"></a>01127 } -<a name="l01128"></a>01128 -<a name="l01129"></a>01129 (void)memset(&tPicture, 0, <span class="keyword">sizeof</span>(tPicture)); -<a name="l01130"></a>01130 <span class="keywordflow">if</span> (bGet6PicInfo(iFodo, aucFpage + 1, -<a name="l01131"></a>01131 iLen - 1, &tPicture)) { -<a name="l01132"></a>01132 tPicture.ulFileOffset = ulFileOffset; -<a name="l01133"></a>01133 tPicture.ulFileOffsetPicture = -<a name="l01134"></a>01134 ulDataPos2FileOffset( -<a name="l01135"></a>01135 tPicture.ulPictureOffset); -<a name="l01136"></a>01136 vAdd2PictInfoList(&tPicture); -<a name="l01137"></a>01137 } -<a name="l01138"></a>01138 } -<a name="l01139"></a>01139 } -<a name="l01140"></a>01140 ausCharPage = xfree(ausCharPage); -<a name="l01141"></a>01141 } <span class="comment">/* end of vGet6ChrInfo */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/prop8_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1512 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/prop8.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/prop8.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * prop8.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the property information from a MS Word 8, 9,10 or 11 file</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> * Word 8 is better known as Word 97 or as Word 98 for Mac</span> -<a name="l00009"></a>00009 <span class="comment"> * Word 9 is better known as Word 2000 or as Word 2001 for Mac</span> -<a name="l00010"></a>00010 <span class="comment"> * Word 10 is better known as Word 2002 or as Word XP</span> -<a name="l00011"></a>00011 <span class="comment"> * Word 11 is better known as Word 2003</span> -<a name="l00012"></a>00012 <span class="comment"> */</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00015"></a>00015 <span class="preprocessor">#include <string.h></span> -<a name="l00016"></a>00016 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="preprocessor">#define DEFAULT_LISTCHAR 0x002e </span><span class="comment">/* A full stop */</span> -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/*</span> -<a name="l00022"></a>00022 <span class="comment"> * iGet8InfoLength - the length of the information for Word 8/9/10/11 files</span> -<a name="l00023"></a>00023 <span class="comment"> */</span> -<a name="l00024"></a>00024 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00025"></a>00025 iGet8InfoLength(<span class="keywordtype">int</span> iByteNbr, <span class="keyword">const</span> UCHAR *aucGrpprl) -<a name="l00026"></a>00026 { -<a name="l00027"></a>00027 <span class="keywordtype">int</span> iTmp, iDel, iAdd; -<a name="l00028"></a>00028 USHORT usOpCode; -<a name="l00029"></a>00029 -<a name="l00030"></a>00030 usOpCode = usGetWord(iByteNbr, aucGrpprl); -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 <span class="keywordflow">switch</span> (usOpCode & 0xe000) { -<a name="l00033"></a>00033 <span class="keywordflow">case</span> 0x0000: <span class="keywordflow">case</span> 0x2000: -<a name="l00034"></a>00034 <span class="keywordflow">return</span> 3; -<a name="l00035"></a>00035 <span class="keywordflow">case</span> 0x4000: <span class="keywordflow">case</span> 0x8000: <span class="keywordflow">case</span> 0xa000: -<a name="l00036"></a>00036 <span class="keywordflow">return</span> 4; -<a name="l00037"></a>00037 <span class="keywordflow">case</span> 0xe000: -<a name="l00038"></a>00038 <span class="keywordflow">return</span> 5; -<a name="l00039"></a>00039 <span class="keywordflow">case</span> 0x6000: -<a name="l00040"></a>00040 <span class="keywordflow">return</span> 6; -<a name="l00041"></a>00041 <span class="keywordflow">case</span> 0xc000: -<a name="l00042"></a>00042 iTmp = (int)ucGetByte(iByteNbr + 2, aucGrpprl); -<a name="l00043"></a>00043 <span class="keywordflow">if</span> (usOpCode == 0xc615 && iTmp == 255) { -<a name="l00044"></a>00044 iDel = (int)ucGetByte(iByteNbr + 3, aucGrpprl); -<a name="l00045"></a>00045 iAdd = (int)ucGetByte( -<a name="l00046"></a>00046 iByteNbr + 4 + iDel * 4, aucGrpprl); -<a name="l00047"></a>00047 iTmp = 2 + iDel * 4 + iAdd * 3; -<a name="l00048"></a>00048 } -<a name="l00049"></a>00049 <span class="keywordflow">return</span> 3 + iTmp; -<a name="l00050"></a>00050 <span class="keywordflow">default</span>: -<a name="l00051"></a>00051 DBG_HEX(usOpCode); -<a name="l00052"></a>00052 DBG_FIXME(); -<a name="l00053"></a>00053 <span class="keywordflow">return</span> 1; -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 } <span class="comment">/* end of iGet8InfoLength */</span> -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 <span class="comment">/*</span> -<a name="l00058"></a>00058 <span class="comment"> * aucFillInfoBuffer - fill the information buffer</span> -<a name="l00059"></a>00059 <span class="comment"> *</span> -<a name="l00060"></a>00060 <span class="comment"> * Returns the information buffer when successful, otherwise NULL</span> -<a name="l00061"></a>00061 <span class="comment"> */</span> -<a name="l00062"></a>00062 <span class="keyword">static</span> UCHAR * -<a name="l00063"></a>00063 aucFillInfoBuffer(FILE *pFile, <span class="keyword">const</span> pps_type *pTable, -<a name="l00064"></a>00064 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00065"></a>00065 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00066"></a>00066 ULONG ulBeginInfo, <span class="keywordtype">size_t</span> tInfoLen) -<a name="l00067"></a>00067 { -<a name="l00068"></a>00068 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00069"></a>00069 UCHAR *aucBuffer; -<a name="l00070"></a>00070 <span class="keywordtype">size_t</span> tBlockDepotLen, tBlockSize; -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 fail(pFile == NULL || pTable == NULL); -<a name="l00073"></a>00073 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00074"></a>00074 fail(tInfoLen == 0); -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 NO_DBG_DEC(pTable->ulSB); -<a name="l00077"></a>00077 NO_DBG_HEX(pTable->ulSize); -<a name="l00078"></a>00078 <span class="keywordflow">if</span> (pTable->ulSize == 0) { -<a name="l00079"></a>00079 DBG_MSG(<span class="stringliteral">"No information"</span>); -<a name="l00080"></a>00080 <span class="keywordflow">return</span> NULL; -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="keywordflow">if</span> (pTable->ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00084"></a>00084 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00085"></a>00085 aulBlockDepot = aulSBD; -<a name="l00086"></a>00086 tBlockDepotLen = tSBDLen; -<a name="l00087"></a>00087 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00088"></a>00088 } <span class="keywordflow">else</span> { -<a name="l00089"></a>00089 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00090"></a>00090 aulBlockDepot = aulBBD; -<a name="l00091"></a>00091 tBlockDepotLen = tBBDLen; -<a name="l00092"></a>00092 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00093"></a>00093 } -<a name="l00094"></a>00094 aucBuffer = xmalloc(tInfoLen); -<a name="l00095"></a>00095 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pTable->ulSB, -<a name="l00096"></a>00096 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00097"></a>00097 aucBuffer, ulBeginInfo, tInfoLen)) { -<a name="l00098"></a>00098 aucBuffer = xfree(aucBuffer); -<a name="l00099"></a>00099 <span class="keywordflow">return</span> NULL; -<a name="l00100"></a>00100 } -<a name="l00101"></a>00101 <span class="keywordflow">return</span> aucBuffer; -<a name="l00102"></a>00102 } <span class="comment">/* end of aucFillInfoBuffer */</span> -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 <span class="comment">/*</span> -<a name="l00105"></a>00105 <span class="comment"> * Build the lists with Document Property Information for Word 8/9/10/11 files</span> -<a name="l00106"></a>00106 <span class="comment"> */</span> -<a name="l00107"></a>00107 <span class="keywordtype">void</span> -<a name="l00108"></a>00108 vGet8DopInfo(FILE *pFile, <span class="keyword">const</span> pps_type *pTable, -<a name="l00109"></a>00109 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00110"></a>00110 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00111"></a>00111 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00112"></a>00112 { -<a name="l00113"></a>00113 document_block_type tDocument; -<a name="l00114"></a>00114 UCHAR *aucBuffer; -<a name="l00115"></a>00115 ULONG ulBeginDocpInfo, ulTmp; -<a name="l00116"></a>00116 <span class="keywordtype">size_t</span> tDocpInfoLen; -<a name="l00117"></a>00117 USHORT usTmp; -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 fail(pFile == NULL || pTable == NULL || aucHeader == NULL); -<a name="l00120"></a>00120 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00121"></a>00121 -<a name="l00122"></a>00122 ulBeginDocpInfo = ulGetLong(0x192, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00123"></a>00123 NO_DBG_HEX(ulBeginSectInfo); -<a name="l00124"></a>00124 tDocpInfoLen = (size_t)ulGetLong(0x196, aucHeader); <span class="comment">/* lcbDop */</span> -<a name="l00125"></a>00125 NO_DBG_DEC(tSectInfoLen); -<a name="l00126"></a>00126 <span class="keywordflow">if</span> (tDocpInfoLen < 28) { -<a name="l00127"></a>00127 DBG_MSG(<span class="stringliteral">"No Document information"</span>); -<a name="l00128"></a>00128 <span class="keywordflow">return</span>; -<a name="l00129"></a>00129 } -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 aucBuffer = aucFillInfoBuffer(pFile, pTable, -<a name="l00132"></a>00132 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00133"></a>00133 ulBeginDocpInfo, tDocpInfoLen); -<a name="l00134"></a>00134 <span class="keywordflow">if</span> (aucBuffer == NULL) { -<a name="l00135"></a>00135 <span class="keywordflow">return</span>; -<a name="l00136"></a>00136 } -<a name="l00137"></a>00137 -<a name="l00138"></a>00138 usTmp = usGetWord(0x00, aucBuffer); -<a name="l00139"></a>00139 tDocument.ucHdrFtrSpecification = (UCHAR)(usTmp >> 8); <span class="comment">/* grpfIhdt */</span> -<a name="l00140"></a>00140 tDocument.usDefaultTabWidth = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00141"></a>00141 ulTmp = ulGetLong(0x14, aucBuffer); <span class="comment">/* dttmCreated */</span> -<a name="l00142"></a>00142 tDocument.tCreateDate = tConvertDTTM(ulTmp); -<a name="l00143"></a>00143 ulTmp = ulGetLong(0x18, aucBuffer); <span class="comment">/* dttmRevised */</span> -<a name="l00144"></a>00144 tDocument.tRevisedDate = tConvertDTTM(ulTmp); -<a name="l00145"></a>00145 vCreateDocumentInfoList(&tDocument); -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 aucBuffer = xfree(aucBuffer); -<a name="l00148"></a>00148 } <span class="comment">/* end of vGet8DopInfo */</span> -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 <span class="comment">/*</span> -<a name="l00151"></a>00151 <span class="comment"> * Fill the section information block with information</span> -<a name="l00152"></a>00152 <span class="comment"> * from a Word 8/9/10/11 file.</span> -<a name="l00153"></a>00153 <span class="comment"> */</span> -<a name="l00154"></a>00154 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00155"></a>00155 vGet8SectionInfo(<span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes, -<a name="l00156"></a>00156 section_block_type *pSection) -<a name="l00157"></a>00157 { -<a name="l00158"></a>00158 UINT uiIndex; -<a name="l00159"></a>00159 <span class="keywordtype">int</span> iFodoOff, iInfoLen, iSize, iTmp; -<a name="l00160"></a>00160 USHORT usCcol; -<a name="l00161"></a>00161 UCHAR ucTmp; -<a name="l00162"></a>00162 -<a name="l00163"></a>00163 fail(aucGrpprl == NULL || pSection == NULL); -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 iFodoOff = 0; -<a name="l00166"></a>00166 <span class="keywordflow">while</span> (tBytes >= (<span class="keywordtype">size_t</span>)iFodoOff + 2) { -<a name="l00167"></a>00167 iInfoLen = 0; -<a name="l00168"></a>00168 <span class="keywordflow">switch</span> (usGetWord(iFodoOff, aucGrpprl)) { -<a name="l00169"></a>00169 <span class="keywordflow">case</span> 0x3009: <span class="comment">/* bkc */</span> -<a name="l00170"></a>00170 ucTmp = ucGetByte(iFodoOff + 2, aucGrpprl); -<a name="l00171"></a>00171 DBG_DEC(ucTmp); -<a name="l00172"></a>00172 pSection->bNewPage = ucTmp != 0 && ucTmp != 1; -<a name="l00173"></a>00173 <span class="keywordflow">break</span>; -<a name="l00174"></a>00174 <span class="keywordflow">case</span> 0x3014: <span class="comment">/* grpfIhdt */</span> -<a name="l00175"></a>00175 pSection->ucHdrFtrSpecification = -<a name="l00176"></a>00176 ucGetByte(iFodoOff + 2, aucGrpprl); -<a name="l00177"></a>00177 <span class="keywordflow">break</span>; -<a name="l00178"></a>00178 <span class="keywordflow">case</span> 0x500b: <span class="comment">/* ccolM1 */</span> -<a name="l00179"></a>00179 usCcol = 1 + usGetWord(iFodoOff + 2, aucGrpprl); -<a name="l00180"></a>00180 DBG_DEC(usCcol); -<a name="l00181"></a>00181 <span class="keywordflow">break</span>; -<a name="l00182"></a>00182 <span class="keywordflow">case</span> 0xd202: <span class="comment">/* olstAnm */</span> -<a name="l00183"></a>00183 iSize = (int)ucGetByte(iFodoOff + 2, aucGrpprl); -<a name="l00184"></a>00184 DBG_DEC_C(iSize != 212, iSize); -<a name="l00185"></a>00185 <span class="keywordflow">for</span> (uiIndex = 0, iTmp = iFodoOff + 3; -<a name="l00186"></a>00186 uiIndex < 9 && iTmp < iFodoOff + 3 + iSize - 15; -<a name="l00187"></a>00187 uiIndex++, iTmp += 16) { -<a name="l00188"></a>00188 pSection->aucNFC[uiIndex] = -<a name="l00189"></a>00189 ucGetByte(iTmp, aucGrpprl); -<a name="l00190"></a>00190 DBG_DEC(pSection->aucNFC[uiIndex]); -<a name="l00191"></a>00191 ucTmp = ucGetByte(iTmp + 3, aucGrpprl); -<a name="l00192"></a>00192 DBG_HEX(ucTmp); -<a name="l00193"></a>00193 <span class="keywordflow">if</span> ((ucTmp & BIT(2)) != 0) { -<a name="l00194"></a>00194 pSection->usNeedPrevLvl |= -<a name="l00195"></a>00195 (USHORT)BIT(uiIndex); -<a name="l00196"></a>00196 } -<a name="l00197"></a>00197 <span class="keywordflow">if</span> ((ucTmp & BIT(3)) != 0) { -<a name="l00198"></a>00198 pSection->usHangingIndent |= -<a name="l00199"></a>00199 (USHORT)BIT(uiIndex); -<a name="l00200"></a>00200 } -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 DBG_HEX(pSection->usNeedPrevLvl); -<a name="l00203"></a>00203 DBG_HEX(pSection->usHangingIndent); -<a name="l00204"></a>00204 <span class="keywordflow">break</span>; -<a name="l00205"></a>00205 <span class="keywordflow">default</span>: -<a name="l00206"></a>00206 <span class="keywordflow">break</span>; -<a name="l00207"></a>00207 } -<a name="l00208"></a>00208 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00209"></a>00209 iInfoLen = iGet8InfoLength(iFodoOff, aucGrpprl); -<a name="l00210"></a>00210 fail(iInfoLen <= 0); -<a name="l00211"></a>00211 } -<a name="l00212"></a>00212 iFodoOff += iInfoLen; -<a name="l00213"></a>00213 } -<a name="l00214"></a>00214 } <span class="comment">/* end of vGet8SectionInfo */</span> -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 <span class="comment">/*</span> -<a name="l00217"></a>00217 <span class="comment"> * Build the lists with Section Property Information for Word 8/9/10/11 files</span> -<a name="l00218"></a>00218 <span class="comment"> */</span> -<a name="l00219"></a>00219 <span class="keywordtype">void</span> -<a name="l00220"></a>00220 vGet8SepInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00221"></a>00221 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00222"></a>00222 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00223"></a>00223 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00224"></a>00224 { -<a name="l00225"></a>00225 section_block_type tSection; -<a name="l00226"></a>00226 ULONG *aulSectPage, *aulCharPos; -<a name="l00227"></a>00227 UCHAR *aucBuffer, *aucFpage; -<a name="l00228"></a>00228 ULONG ulBeginOfText, ulTextOffset, ulBeginSectInfo; -<a name="l00229"></a>00229 <span class="keywordtype">size_t</span> tSectInfoLen, tIndex, tOffset, tLen, tBytes; -<a name="l00230"></a>00230 UCHAR aucTmp[2]; -<a name="l00231"></a>00231 -<a name="l00232"></a>00232 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l00233"></a>00233 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00234"></a>00234 -<a name="l00235"></a>00235 ulBeginOfText = ulGetLong(0x18, aucHeader); <span class="comment">/* fcMin */</span> -<a name="l00236"></a>00236 NO_DBG_HEX(ulBeginOfText); -<a name="l00237"></a>00237 ulBeginSectInfo = ulGetLong(0xca, aucHeader); <span class="comment">/* fcPlcfsed */</span> -<a name="l00238"></a>00238 NO_DBG_HEX(ulBeginSectInfo); -<a name="l00239"></a>00239 tSectInfoLen = (size_t)ulGetLong(0xce, aucHeader); <span class="comment">/* lcbPlcfsed */</span> -<a name="l00240"></a>00240 NO_DBG_DEC(tSectInfoLen); -<a name="l00241"></a>00241 <span class="keywordflow">if</span> (tSectInfoLen < 4) { -<a name="l00242"></a>00242 DBG_DEC(tSectInfoLen); -<a name="l00243"></a>00243 <span class="keywordflow">return</span>; -<a name="l00244"></a>00244 } -<a name="l00245"></a>00245 -<a name="l00246"></a>00246 aucBuffer = aucFillInfoBuffer(pFile, &pPPS->tTable, -<a name="l00247"></a>00247 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00248"></a>00248 ulBeginSectInfo, tSectInfoLen); -<a name="l00249"></a>00249 <span class="keywordflow">if</span> (aucBuffer == NULL) { -<a name="l00250"></a>00250 <span class="keywordflow">return</span>; -<a name="l00251"></a>00251 } -<a name="l00252"></a>00252 NO_DBG_PRINT_BLOCK(aucBuffer, tSectInfoLen); -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 <span class="comment">/* Read the Section Descriptors */</span> -<a name="l00255"></a>00255 tLen = (tSectInfoLen - 4) / 16; -<a name="l00256"></a>00256 <span class="comment">/* Save the section offsets */</span> -<a name="l00257"></a>00257 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00258"></a>00258 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; -<a name="l00259"></a>00259 tIndex < tLen; -<a name="l00260"></a>00260 tIndex++, tOffset += 4) { -<a name="l00261"></a>00261 ulTextOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00262"></a>00262 NO_DBG_HEX(ulTextOffset); -<a name="l00263"></a>00263 aulCharPos[tIndex] = ulBeginOfText + ulTextOffset; -<a name="l00264"></a>00264 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00265"></a>00265 } -<a name="l00266"></a>00266 <span class="comment">/* Save the Sepx offsets */</span> -<a name="l00267"></a>00267 aulSectPage = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00268"></a>00268 <span class="keywordflow">for</span> (tIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00269"></a>00269 tIndex < tLen; -<a name="l00270"></a>00270 tIndex++, tOffset += 12) { -<a name="l00271"></a>00271 aulSectPage[tIndex] = ulGetLong(tOffset + 2, aucBuffer); -<a name="l00272"></a>00272 NO_DBG_HEX(aulSectPage[tIndex]); <span class="comment">/* fcSepx */</span> -<a name="l00273"></a>00273 } -<a name="l00274"></a>00274 aucBuffer = xfree(aucBuffer); -<a name="l00275"></a>00275 -<a name="l00276"></a>00276 <span class="comment">/* Read the Section Properties */</span> -<a name="l00277"></a>00277 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00278"></a>00278 <span class="keywordflow">if</span> (aulSectPage[tIndex] == FC_INVALID) { -<a name="l00279"></a>00279 vDefault2SectionInfoList(aulCharPos[tIndex]); -<a name="l00280"></a>00280 <span class="keywordflow">continue</span>; -<a name="l00281"></a>00281 } -<a name="l00282"></a>00282 <span class="comment">/* Get the number of bytes to read */</span> -<a name="l00283"></a>00283 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tWordDocument.ulSB, -<a name="l00284"></a>00284 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00285"></a>00285 aucTmp, aulSectPage[tIndex], 2)) { -<a name="l00286"></a>00286 <span class="keywordflow">continue</span>; -<a name="l00287"></a>00287 } -<a name="l00288"></a>00288 tBytes = 2 + (size_t)usGetWord(0, aucTmp); -<a name="l00289"></a>00289 NO_DBG_DEC(tBytes); -<a name="l00290"></a>00290 <span class="comment">/* Read the bytes */</span> -<a name="l00291"></a>00291 aucFpage = xmalloc(tBytes); -<a name="l00292"></a>00292 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tWordDocument.ulSB, -<a name="l00293"></a>00293 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00294"></a>00294 aucFpage, aulSectPage[tIndex], tBytes)) { -<a name="l00295"></a>00295 aucFpage = xfree(aucFpage); -<a name="l00296"></a>00296 <span class="keywordflow">continue</span>; -<a name="l00297"></a>00297 } -<a name="l00298"></a>00298 NO_DBG_PRINT_BLOCK(aucFpage, tBytes); -<a name="l00299"></a>00299 <span class="comment">/* Process the bytes */</span> -<a name="l00300"></a>00300 vGetDefaultSection(&tSection); -<a name="l00301"></a>00301 vGet8SectionInfo(aucFpage + 2, tBytes - 2, &tSection); -<a name="l00302"></a>00302 vAdd2SectionInfoList(&tSection, aulCharPos[tIndex]); -<a name="l00303"></a>00303 aucFpage = xfree(aucFpage); -<a name="l00304"></a>00304 } -<a name="l00305"></a>00305 aulCharPos = xfree(aulCharPos); -<a name="l00306"></a>00306 aulSectPage = xfree(aulSectPage); -<a name="l00307"></a>00307 } <span class="comment">/* end of vGet8SepInfo */</span> -<a name="l00308"></a>00308 -<a name="l00309"></a>00309 <span class="comment">/*</span> -<a name="l00310"></a>00310 <span class="comment"> * Build the list with Header/Footer Information for Word 8/9/10/11 files</span> -<a name="l00311"></a>00311 <span class="comment"> */</span> -<a name="l00312"></a>00312 <span class="keywordtype">void</span> -<a name="l00313"></a>00313 vGet8HdrFtrInfo(FILE *pFile, <span class="keyword">const</span> pps_type *pTable, -<a name="l00314"></a>00314 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00315"></a>00315 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00316"></a>00316 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00317"></a>00317 { -<a name="l00318"></a>00318 ULONG *aulCharPos; -<a name="l00319"></a>00319 UCHAR *aucBuffer; -<a name="l00320"></a>00320 ULONG ulHdrFtrOffset, ulBeginHdrFtrInfo; -<a name="l00321"></a>00321 <span class="keywordtype">size_t</span> tHdrFtrInfoLen, tIndex, tOffset, tLen; -<a name="l00322"></a>00322 -<a name="l00323"></a>00323 fail(pFile == NULL || pTable == NULL || aucHeader == NULL); -<a name="l00324"></a>00324 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 ulBeginHdrFtrInfo = ulGetLong(0xf2, aucHeader); <span class="comment">/* fcPlcfhdd */</span> -<a name="l00327"></a>00327 NO_DBG_HEX(ulBeginHdrFtrInfo); -<a name="l00328"></a>00328 tHdrFtrInfoLen = (size_t)ulGetLong(0xf6, aucHeader); <span class="comment">/* lcbPlcfhdd */</span> -<a name="l00329"></a>00329 NO_DBG_DEC(tHdrFtrInfoLen); -<a name="l00330"></a>00330 <span class="keywordflow">if</span> (tHdrFtrInfoLen < 8) { -<a name="l00331"></a>00331 DBG_DEC_C(tHdrFtrInfoLen != 0, tHdrFtrInfoLen); -<a name="l00332"></a>00332 <span class="keywordflow">return</span>; -<a name="l00333"></a>00333 } -<a name="l00334"></a>00334 -<a name="l00335"></a>00335 aucBuffer = aucFillInfoBuffer(pFile, pTable, -<a name="l00336"></a>00336 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00337"></a>00337 ulBeginHdrFtrInfo, tHdrFtrInfoLen); -<a name="l00338"></a>00338 <span class="keywordflow">if</span> (aucBuffer == NULL) { -<a name="l00339"></a>00339 <span class="keywordflow">return</span>; -<a name="l00340"></a>00340 } -<a name="l00341"></a>00341 NO_DBG_PRINT_BLOCK(aucBuffer, tHdrFtrInfoLen); -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 tLen = tHdrFtrInfoLen / 4 - 1; -<a name="l00344"></a>00344 DBG_DEC_C(tLen % 12 != 1 && tLen % 12 != 7, tLen); -<a name="l00345"></a>00345 <span class="comment">/* Save the header/footer offsets */</span> -<a name="l00346"></a>00346 aulCharPos = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00347"></a>00347 <span class="keywordflow">for</span> (tIndex = 0, tOffset = 0; -<a name="l00348"></a>00348 tIndex < tLen; -<a name="l00349"></a>00349 tIndex++, tOffset += 4) { -<a name="l00350"></a>00350 ulHdrFtrOffset = ulGetLong(tOffset, aucBuffer); -<a name="l00351"></a>00351 NO_DBG_HEX(ulHdrFtrOffset); -<a name="l00352"></a>00352 aulCharPos[tIndex] = ulHdrFtrOffset2CharPos(ulHdrFtrOffset); -<a name="l00353"></a>00353 NO_DBG_HEX(aulCharPos[tIndex]); -<a name="l00354"></a>00354 } -<a name="l00355"></a>00355 vCreat8HdrFtrInfoList(aulCharPos, tLen); -<a name="l00356"></a>00356 <span class="comment">/* Clean up and leave */</span> -<a name="l00357"></a>00357 aulCharPos = xfree(aulCharPos); -<a name="l00358"></a>00358 aucBuffer = xfree(aucBuffer); -<a name="l00359"></a>00359 } <span class="comment">/* end of vGet8HdrFtrInfo */</span> -<a name="l00360"></a>00360 -<a name="l00361"></a>00361 <span class="comment">/*</span> -<a name="l00362"></a>00362 <span class="comment"> * Translate the rowinfo to a member of the row_info enumeration</span> -<a name="l00363"></a>00363 <span class="comment"> */</span> -<a name="l00364"></a>00364 row_info_enum -<a name="l00365"></a>00365 eGet8RowInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00366"></a>00366 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, row_block_type *pRow) -<a name="l00367"></a>00367 { -<a name="l00368"></a>00368 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00369"></a>00369 <span class="keywordtype">int</span> iIndex, iSize, iCol; -<a name="l00370"></a>00370 <span class="keywordtype">int</span> iPosCurr, iPosPrev; -<a name="l00371"></a>00371 USHORT usTmp; -<a name="l00372"></a>00372 BOOL bFound2416_0, bFound2416_1, bFound2417_0, bFound2417_1; -<a name="l00373"></a>00373 BOOL bFound244b_0, bFound244b_1, bFound244c_0, bFound244c_1; -<a name="l00374"></a>00374 BOOL bFoundd608; -<a name="l00375"></a>00375 -<a name="l00376"></a>00376 fail(iFodo < 0 || aucGrpprl == NULL || pRow == NULL); -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 iFodoOff = 0; -<a name="l00379"></a>00379 bFound2416_0 = FALSE; -<a name="l00380"></a>00380 bFound2416_1 = FALSE; -<a name="l00381"></a>00381 bFound2417_0 = FALSE; -<a name="l00382"></a>00382 bFound2417_1 = FALSE; -<a name="l00383"></a>00383 bFound244b_0 = FALSE; -<a name="l00384"></a>00384 bFound244b_1 = FALSE; -<a name="l00385"></a>00385 bFound244c_0 = FALSE; -<a name="l00386"></a>00386 bFound244c_1 = FALSE; -<a name="l00387"></a>00387 bFoundd608 = FALSE; -<a name="l00388"></a>00388 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 2) { -<a name="l00389"></a>00389 iInfoLen = 0; -<a name="l00390"></a>00390 <span class="keywordflow">switch</span> (usGetWord(iFodo + iFodoOff, aucGrpprl)) { -<a name="l00391"></a>00391 <span class="keywordflow">case</span> 0x2416: <span class="comment">/* fInTable */</span> -<a name="l00392"></a>00392 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 2, aucGrpprl))) { -<a name="l00393"></a>00393 bFound2416_1 = TRUE; -<a name="l00394"></a>00394 } <span class="keywordflow">else</span> { -<a name="l00395"></a>00395 bFound2416_0 = TRUE; -<a name="l00396"></a>00396 } -<a name="l00397"></a>00397 <span class="keywordflow">break</span>; -<a name="l00398"></a>00398 <span class="keywordflow">case</span> 0x2417: <span class="comment">/* fTtp */</span> -<a name="l00399"></a>00399 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 2, aucGrpprl))) { -<a name="l00400"></a>00400 bFound2417_1 = TRUE; -<a name="l00401"></a>00401 } <span class="keywordflow">else</span> { -<a name="l00402"></a>00402 bFound2417_0 = TRUE; -<a name="l00403"></a>00403 } -<a name="l00404"></a>00404 <span class="keywordflow">break</span>; -<a name="l00405"></a>00405 <span class="keywordflow">case</span> 0x244b: <span class="comment">/* sub-table fInTable */</span> -<a name="l00406"></a>00406 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 2, aucGrpprl))) { -<a name="l00407"></a>00407 bFound244b_1 = TRUE; -<a name="l00408"></a>00408 } <span class="keywordflow">else</span> { -<a name="l00409"></a>00409 bFound244b_0 = TRUE; -<a name="l00410"></a>00410 } -<a name="l00411"></a>00411 <span class="keywordflow">break</span>; -<a name="l00412"></a>00412 <span class="keywordflow">case</span> 0x244c: <span class="comment">/* sub-table fTtp */</span> -<a name="l00413"></a>00413 <span class="keywordflow">if</span> (odd(ucGetByte(iFodo + iFodoOff + 2, aucGrpprl))) { -<a name="l00414"></a>00414 bFound244c_1 = TRUE; -<a name="l00415"></a>00415 } <span class="keywordflow">else</span> { -<a name="l00416"></a>00416 bFound244c_0 = TRUE; -<a name="l00417"></a>00417 } -<a name="l00418"></a>00418 <span class="keywordflow">break</span>; -<a name="l00419"></a>00419 <span class="keywordflow">case</span> 0x6424: <span class="comment">/* brcTop */</span> -<a name="l00420"></a>00420 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00421"></a>00421 usTmp &= 0xff00; -<a name="l00422"></a>00422 NO_DBG_DEC(usTmp >> 8); -<a name="l00423"></a>00423 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00424"></a>00424 pRow->ucBorderInfo &= ~TABLE_BORDER_TOP; -<a name="l00425"></a>00425 } <span class="keywordflow">else</span> { -<a name="l00426"></a>00426 pRow->ucBorderInfo |= TABLE_BORDER_TOP; -<a name="l00427"></a>00427 } -<a name="l00428"></a>00428 <span class="keywordflow">break</span>; -<a name="l00429"></a>00429 <span class="keywordflow">case</span> 0x6425: <span class="comment">/* brcLeft */</span> -<a name="l00430"></a>00430 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00431"></a>00431 usTmp &= 0xff00; -<a name="l00432"></a>00432 NO_DBG_DEC(usTmp >> 8); -<a name="l00433"></a>00433 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00434"></a>00434 pRow->ucBorderInfo &= ~TABLE_BORDER_LEFT; -<a name="l00435"></a>00435 } <span class="keywordflow">else</span> { -<a name="l00436"></a>00436 pRow->ucBorderInfo |= TABLE_BORDER_LEFT; -<a name="l00437"></a>00437 } -<a name="l00438"></a>00438 <span class="keywordflow">break</span>; -<a name="l00439"></a>00439 <span class="keywordflow">case</span> 0x6426: <span class="comment">/* brcBottom */</span> -<a name="l00440"></a>00440 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00441"></a>00441 usTmp &= 0xff00; -<a name="l00442"></a>00442 NO_DBG_DEC(usTmp >> 8); -<a name="l00443"></a>00443 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00444"></a>00444 pRow->ucBorderInfo &= ~TABLE_BORDER_BOTTOM; -<a name="l00445"></a>00445 } <span class="keywordflow">else</span> { -<a name="l00446"></a>00446 pRow->ucBorderInfo |= TABLE_BORDER_BOTTOM; -<a name="l00447"></a>00447 } -<a name="l00448"></a>00448 <span class="keywordflow">break</span>; -<a name="l00449"></a>00449 <span class="keywordflow">case</span> 0x6427: <span class="comment">/* brcRight */</span> -<a name="l00450"></a>00450 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00451"></a>00451 usTmp &= 0xff00; -<a name="l00452"></a>00452 NO_DBG_DEC(usTmp >> 8); -<a name="l00453"></a>00453 <span class="keywordflow">if</span> (usTmp == 0) { -<a name="l00454"></a>00454 pRow->ucBorderInfo &= ~TABLE_BORDER_RIGHT; -<a name="l00455"></a>00455 } <span class="keywordflow">else</span> { -<a name="l00456"></a>00456 pRow->ucBorderInfo |= TABLE_BORDER_RIGHT; -<a name="l00457"></a>00457 } -<a name="l00458"></a>00458 <span class="keywordflow">break</span>; -<a name="l00459"></a>00459 <span class="keywordflow">case</span> 0xd606: <span class="comment">/* cDefTable10 */</span> -<a name="l00460"></a>00460 DBG_MSG(<span class="stringliteral">"0xd606: sprmTDefTable10"</span>); -<a name="l00461"></a>00461 iSize = (int)usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00462"></a>00462 DBG_DEC(iSize); -<a name="l00463"></a>00463 <span class="keywordflow">break</span>; -<a name="l00464"></a>00464 <span class="keywordflow">case</span> 0xd608: <span class="comment">/* cDefTable */</span> -<a name="l00465"></a>00465 iSize = (int)usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00466"></a>00466 <span class="keywordflow">if</span> (iSize < 6 || iBytes < iFodoOff + 8) { -<a name="l00467"></a>00467 DBG_DEC(iSize); -<a name="l00468"></a>00468 DBG_DEC(iFodoOff); -<a name="l00469"></a>00469 iInfoLen = 2; -<a name="l00470"></a>00470 <span class="keywordflow">break</span>; -<a name="l00471"></a>00471 } -<a name="l00472"></a>00472 iCol = (int)ucGetByte(iFodo + iFodoOff + 4, aucGrpprl); -<a name="l00473"></a>00473 <span class="keywordflow">if</span> (iCol < 1 || -<a name="l00474"></a>00474 iBytes < iFodoOff + 4 + (iCol + 1) * 2) { -<a name="l00475"></a>00475 DBG_DEC(iCol); -<a name="l00476"></a>00476 DBG_DEC(iFodoOff); -<a name="l00477"></a>00477 iInfoLen = 2; -<a name="l00478"></a>00478 <span class="keywordflow">break</span>; -<a name="l00479"></a>00479 } -<a name="l00480"></a>00480 <span class="keywordflow">if</span> (iCol >= (<span class="keywordtype">int</span>)elementsof(pRow->asColumnWidth)) { -<a name="l00481"></a>00481 DBG_DEC(iCol); -<a name="l00482"></a>00482 werr(1, <span class="stringliteral">"The number of columns is corrupt"</span>); -<a name="l00483"></a>00483 } -<a name="l00484"></a>00484 pRow->ucNumberOfColumns = (UCHAR)iCol; -<a name="l00485"></a>00485 iPosPrev = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00486"></a>00486 iFodo + iFodoOff + 5, -<a name="l00487"></a>00487 aucGrpprl); -<a name="l00488"></a>00488 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iCol; iIndex++) { -<a name="l00489"></a>00489 iPosCurr = (int)(<span class="keywordtype">short</span>)usGetWord( -<a name="l00490"></a>00490 iFodo + iFodoOff + 7 + iIndex * 2, -<a name="l00491"></a>00491 aucGrpprl); -<a name="l00492"></a>00492 pRow->asColumnWidth[iIndex] = -<a name="l00493"></a>00493 (short)(iPosCurr - iPosPrev); -<a name="l00494"></a>00494 iPosPrev = iPosCurr; -<a name="l00495"></a>00495 } -<a name="l00496"></a>00496 bFoundd608 = TRUE; -<a name="l00497"></a>00497 <span class="keywordflow">break</span>; -<a name="l00498"></a>00498 <span class="keywordflow">default</span>: -<a name="l00499"></a>00499 <span class="keywordflow">break</span>; -<a name="l00500"></a>00500 } -<a name="l00501"></a>00501 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00502"></a>00502 iInfoLen = -<a name="l00503"></a>00503 iGet8InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00504"></a>00504 fail(iInfoLen <= 0); -<a name="l00505"></a>00505 } -<a name="l00506"></a>00506 iFodoOff += iInfoLen; -<a name="l00507"></a>00507 } -<a name="l00508"></a>00508 -<a name="l00509"></a>00509 <span class="keywordflow">if</span> (bFound2417_1 && bFoundd608) { -<a name="l00510"></a>00510 <span class="keywordflow">return</span> found_end_of_row; -<a name="l00511"></a>00511 } -<a name="l00512"></a>00512 <span class="keywordflow">if</span> (bFound2417_0 && !bFoundd608) { -<a name="l00513"></a>00513 <span class="keywordflow">return</span> found_not_end_of_row; -<a name="l00514"></a>00514 } -<a name="l00515"></a>00515 <span class="keywordflow">if</span> (bFound2416_1 || bFound244b_1) { -<a name="l00516"></a>00516 <span class="keywordflow">return</span> found_a_cell; -<a name="l00517"></a>00517 } -<a name="l00518"></a>00518 <span class="keywordflow">if</span> (bFound2416_0 || bFound244b_0) { -<a name="l00519"></a>00519 <span class="keywordflow">return</span> found_not_a_cell; -<a name="l00520"></a>00520 } -<a name="l00521"></a>00521 <span class="keywordflow">return</span> found_nothing; -<a name="l00522"></a>00522 } <span class="comment">/* end of eGet8RowInfo */</span> -<a name="l00523"></a>00523 -<a name="l00524"></a>00524 <span class="comment">/*</span> -<a name="l00525"></a>00525 <span class="comment"> * Fill the style information block with information</span> -<a name="l00526"></a>00526 <span class="comment"> * from a Word 8/9/10/11 file.</span> -<a name="l00527"></a>00527 <span class="comment"> */</span> -<a name="l00528"></a>00528 <span class="keywordtype">void</span> -<a name="l00529"></a>00529 vGet8StyleInfo(<span class="keywordtype">int</span> iFodo, -<a name="l00530"></a>00530 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, style_block_type *pStyle) -<a name="l00531"></a>00531 { -<a name="l00532"></a>00532 list_block_type tList6; -<a name="l00533"></a>00533 <span class="keyword">const</span> list_block_type *pList; -<a name="l00534"></a>00534 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l00535"></a>00535 <span class="keywordtype">int</span> iTmp, iDel, iAdd, iBefore; -<a name="l00536"></a>00536 USHORT usOpCode, usTmp; -<a name="l00537"></a>00537 <span class="keywordtype">short</span> sTmp; -<a name="l00538"></a>00538 -<a name="l00539"></a>00539 fail(iFodo < 0 || aucGrpprl == NULL || pStyle == NULL); -<a name="l00540"></a>00540 -<a name="l00541"></a>00541 NO_DBG_DEC_C(pStyle->usListIndex != 0, pStyle->usIstd); -<a name="l00542"></a>00542 NO_DBG_DEC_C(pStyle->usListIndex != 0, pStyle->usListIndex); -<a name="l00543"></a>00543 -<a name="l00544"></a>00544 (void)memset(&tList6, 0, <span class="keyword">sizeof</span>(tList6)); -<a name="l00545"></a>00545 -<a name="l00546"></a>00546 iFodoOff = 0; -<a name="l00547"></a>00547 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 2) { -<a name="l00548"></a>00548 iInfoLen = 0; -<a name="l00549"></a>00549 usOpCode = usGetWord(iFodo + iFodoOff, aucGrpprl); -<a name="l00550"></a>00550 <span class="keywordflow">switch</span> (usOpCode) { -<a name="l00551"></a>00551 <span class="keywordflow">case</span> 0x2403: <span class="comment">/* jc */</span> -<a name="l00552"></a>00552 pStyle->ucAlignment = ucGetByte( -<a name="l00553"></a>00553 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00554"></a>00554 <span class="keywordflow">break</span>; -<a name="l00555"></a>00555 <span class="keywordflow">case</span> 0x260a: <span class="comment">/* ilvl */</span> -<a name="l00556"></a>00556 pStyle->ucListLevel = -<a name="l00557"></a>00557 ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00558"></a>00558 NO_DBG_DEC(pStyle->ucListLevel); -<a name="l00559"></a>00559 pStyle->ucNumLevel = pStyle->ucListLevel; -<a name="l00560"></a>00560 <span class="keywordflow">break</span>; -<a name="l00561"></a>00561 <span class="keywordflow">case</span> 0x4600: <span class="comment">/* istd */</span> -<a name="l00562"></a>00562 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00563"></a>00563 NO_DBG_DEC(usTmp); -<a name="l00564"></a>00564 <span class="keywordflow">break</span>; -<a name="l00565"></a>00565 <span class="keywordflow">case</span> 0x460b: <span class="comment">/* ilfo */</span> -<a name="l00566"></a>00566 pStyle->usListIndex = -<a name="l00567"></a>00567 usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00568"></a>00568 NO_DBG_DEC(pStyle->usListIndex); -<a name="l00569"></a>00569 <span class="keywordflow">break</span>; -<a name="l00570"></a>00570 <span class="keywordflow">case</span> 0x4610: <span class="comment">/* Nest dxaLeft */</span> -<a name="l00571"></a>00571 sTmp = (short)usGetWord( -<a name="l00572"></a>00572 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00573"></a>00573 pStyle->sLeftIndent += sTmp; -<a name="l00574"></a>00574 <span class="keywordflow">if</span> (pStyle->sLeftIndent < 0) { -<a name="l00575"></a>00575 pStyle->sLeftIndent = 0; -<a name="l00576"></a>00576 } -<a name="l00577"></a>00577 DBG_DEC(sTmp); -<a name="l00578"></a>00578 DBG_DEC(pStyle->sLeftIndent); -<a name="l00579"></a>00579 <span class="keywordflow">break</span>; -<a name="l00580"></a>00580 <span class="keywordflow">case</span> 0xc60d: <span class="comment">/* ChgTabsPapx */</span> -<a name="l00581"></a>00581 <span class="keywordflow">case</span> 0xc615: <span class="comment">/* ChgTabs */</span> -<a name="l00582"></a>00582 iTmp = (int)ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00583"></a>00583 <span class="keywordflow">if</span> (iTmp < 2) { -<a name="l00584"></a>00584 iInfoLen = 1; -<a name="l00585"></a>00585 <span class="keywordflow">break</span>; -<a name="l00586"></a>00586 } -<a name="l00587"></a>00587 NO_DBG_DEC(iTmp); -<a name="l00588"></a>00588 iDel = (int)ucGetByte(iFodo + iFodoOff + 3, aucGrpprl); -<a name="l00589"></a>00589 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel) { -<a name="l00590"></a>00590 iInfoLen = 1; -<a name="l00591"></a>00591 <span class="keywordflow">break</span>; -<a name="l00592"></a>00592 } -<a name="l00593"></a>00593 NO_DBG_DEC(iDel); -<a name="l00594"></a>00594 iAdd = (int)ucGetByte( -<a name="l00595"></a>00595 iFodo + iFodoOff + 4 + 2 * iDel, aucGrpprl); -<a name="l00596"></a>00596 <span class="keywordflow">if</span> (iTmp < 2 + 2 * iDel + 2 * iAdd) { -<a name="l00597"></a>00597 iInfoLen = 1; -<a name="l00598"></a>00598 <span class="keywordflow">break</span>; -<a name="l00599"></a>00599 } -<a name="l00600"></a>00600 NO_DBG_DEC(iAdd); -<a name="l00601"></a>00601 <span class="keywordflow">break</span>; -<a name="l00602"></a>00602 <span class="keywordflow">case</span> 0x840e: <span class="comment">/* dxaRight */</span> -<a name="l00603"></a>00603 pStyle->sRightIndent = (short)usGetWord( -<a name="l00604"></a>00604 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00605"></a>00605 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00606"></a>00606 <span class="keywordflow">break</span>; -<a name="l00607"></a>00607 <span class="keywordflow">case</span> 0x840f: <span class="comment">/* dxaLeft */</span> -<a name="l00608"></a>00608 pStyle->sLeftIndent = (short)usGetWord( -<a name="l00609"></a>00609 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00610"></a>00610 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00611"></a>00611 <span class="keywordflow">break</span>; -<a name="l00612"></a>00612 <span class="keywordflow">case</span> 0x8411: <span class="comment">/* dxaLeft1 */</span> -<a name="l00613"></a>00613 pStyle->sLeftIndent1 = (short)usGetWord( -<a name="l00614"></a>00614 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00615"></a>00615 NO_DBG_DEC(pStyle->sLeftIndent1); -<a name="l00616"></a>00616 <span class="keywordflow">break</span>; -<a name="l00617"></a>00617 <span class="keywordflow">case</span> 0xa413: <span class="comment">/* dyaBefore */</span> -<a name="l00618"></a>00618 pStyle->usBeforeIndent = usGetWord( -<a name="l00619"></a>00619 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00620"></a>00620 NO_DBG_DEC(pStyle->usBeforeIndent); -<a name="l00621"></a>00621 <span class="keywordflow">break</span>; -<a name="l00622"></a>00622 <span class="keywordflow">case</span> 0xa414: <span class="comment">/* dyaAfter */</span> -<a name="l00623"></a>00623 pStyle->usAfterIndent = usGetWord( -<a name="l00624"></a>00624 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00625"></a>00625 NO_DBG_DEC(pStyle->usAfterIndent); -<a name="l00626"></a>00626 <span class="keywordflow">break</span>; -<a name="l00627"></a>00627 <span class="keywordflow">case</span> 0xc63e: <span class="comment">/* anld */</span> -<a name="l00628"></a>00628 iTmp = (int)ucGetByte( -<a name="l00629"></a>00629 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l00630"></a>00630 DBG_DEC_C(iTmp < 84, iTmp); -<a name="l00631"></a>00631 <span class="keywordflow">if</span> (iTmp >= 1) { -<a name="l00632"></a>00632 tList6.ucNFC = ucGetByte( -<a name="l00633"></a>00633 iFodo + iFodoOff + 3, aucGrpprl); -<a name="l00634"></a>00634 } -<a name="l00635"></a>00635 <span class="keywordflow">if</span> (tList6.ucNFC != LIST_BULLETS && iTmp >= 2) { -<a name="l00636"></a>00636 iBefore = (int)ucGetByte( -<a name="l00637"></a>00637 iFodo + iFodoOff + 4, aucGrpprl); -<a name="l00638"></a>00638 } <span class="keywordflow">else</span> { -<a name="l00639"></a>00639 iBefore = 0; -<a name="l00640"></a>00640 } -<a name="l00641"></a>00641 <span class="keywordflow">if</span> (iTmp >= 12) { -<a name="l00642"></a>00642 tList6.ulStartAt = (ULONG)usGetWord( -<a name="l00643"></a>00643 iFodo + iFodoOff + 13, aucGrpprl); -<a name="l00644"></a>00644 } -<a name="l00645"></a>00645 <span class="keywordflow">if</span> (iTmp >= iBefore + 22) { -<a name="l00646"></a>00646 tList6.usListChar = usGetWord( -<a name="l00647"></a>00647 iFodo + iFodoOff + iBefore + 23, -<a name="l00648"></a>00648 aucGrpprl); -<a name="l00649"></a>00649 DBG_HEX(tList6.usListChar); -<a name="l00650"></a>00650 } -<a name="l00651"></a>00651 <span class="keywordflow">break</span>; -<a name="l00652"></a>00652 <span class="keywordflow">default</span>: -<a name="l00653"></a>00653 NO_DBG_HEX(usOpCode); -<a name="l00654"></a>00654 <span class="keywordflow">break</span>; -<a name="l00655"></a>00655 } -<a name="l00656"></a>00656 <span class="keywordflow">if</span> (iInfoLen <= 0) { -<a name="l00657"></a>00657 iInfoLen = -<a name="l00658"></a>00658 iGet8InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l00659"></a>00659 fail(iInfoLen <= 0); -<a name="l00660"></a>00660 } -<a name="l00661"></a>00661 iFodoOff += iInfoLen; -<a name="l00662"></a>00662 } -<a name="l00663"></a>00663 -<a name="l00664"></a>00664 <span class="keywordflow">if</span> (pStyle->usListIndex == 2047) { -<a name="l00665"></a>00665 <span class="comment">/* Old style list */</span> -<a name="l00666"></a>00666 pStyle->usStartAt = (USHORT)tList6.ulStartAt; -<a name="l00667"></a>00667 pStyle->usListChar = tList6.usListChar; -<a name="l00668"></a>00668 pStyle->ucNFC = tList6.ucNFC; -<a name="l00669"></a>00669 } <span class="keywordflow">else</span> { -<a name="l00670"></a>00670 <span class="comment">/* New style list */</span> -<a name="l00671"></a>00671 pList = pGetListInfo(pStyle->usListIndex, pStyle->ucListLevel); -<a name="l00672"></a>00672 <span class="keywordflow">if</span> (pList != NULL) { -<a name="l00673"></a>00673 pStyle->bNoRestart = pList->bNoRestart; -<a name="l00674"></a>00674 fail(pList->ulStartAt > (ULONG)USHRT_MAX); -<a name="l00675"></a>00675 pStyle->usStartAt = (USHORT)pList->ulStartAt; -<a name="l00676"></a>00676 pStyle->usListChar = pList->usListChar; -<a name="l00677"></a>00677 pStyle->ucNFC = pList->ucNFC; -<a name="l00678"></a>00678 if (pStyle->sLeftIndent <= 0) { -<a name="l00679"></a>00679 pStyle->sLeftIndent = pList->sLeftIndent; -<a name="l00680"></a>00680 } -<a name="l00681"></a>00681 } -<a name="l00682"></a>00682 } -<a name="l00683"></a>00683 } <span class="comment">/* end of vGet8StyleInfo */</span> -<a name="l00684"></a>00684 -<a name="l00685"></a>00685 <span class="comment">/*</span> -<a name="l00686"></a>00686 <span class="comment"> * Get the left indentation value from the style information block</span> -<a name="l00687"></a>00687 <span class="comment"> *</span> -<a name="l00688"></a>00688 <span class="comment"> * Returns the value when found, otherwise 0</span> -<a name="l00689"></a>00689 <span class="comment"> */</span> -<a name="l00690"></a>00690 <span class="keyword">static</span> <span class="keywordtype">short</span> -<a name="l00691"></a>00691 sGetLeftIndent(<span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">size_t</span> tBytes) -<a name="l00692"></a>00692 { -<a name="l00693"></a>00693 <span class="keywordtype">int</span> iOffset, iInfoLen; -<a name="l00694"></a>00694 USHORT usOpCode, usTmp; -<a name="l00695"></a>00695 -<a name="l00696"></a>00696 fail(aucGrpprl == NULL); -<a name="l00697"></a>00697 -<a name="l00698"></a>00698 iOffset = 0; -<a name="l00699"></a>00699 <span class="keywordflow">while</span> (tBytes >= (<span class="keywordtype">size_t</span>)iOffset + 4) { -<a name="l00700"></a>00700 usOpCode = usGetWord(iOffset, aucGrpprl); -<a name="l00701"></a>00701 <span class="keywordflow">if</span> (usOpCode == 0x840f) { <span class="comment">/* dxaLeft */</span> -<a name="l00702"></a>00702 usTmp = usGetWord(iOffset + 2, aucGrpprl); -<a name="l00703"></a>00703 <span class="keywordflow">if</span> (usTmp <= 0x7fff) { -<a name="l00704"></a>00704 NO_DBG_DEC(usTmp); -<a name="l00705"></a>00705 <span class="keywordflow">return</span> (<span class="keywordtype">short</span>)usTmp; -<a name="l00706"></a>00706 } -<a name="l00707"></a>00707 } -<a name="l00708"></a>00708 iInfoLen = iGet8InfoLength(iOffset, aucGrpprl); -<a name="l00709"></a>00709 fail(iInfoLen <= 0); -<a name="l00710"></a>00710 iOffset += iInfoLen; -<a name="l00711"></a>00711 } -<a name="l00712"></a>00712 <span class="keywordflow">return</span> 0; -<a name="l00713"></a>00713 } <span class="comment">/* end of sGetLeftIndent */</span> -<a name="l00714"></a>00714 -<a name="l00715"></a>00715 <span class="comment">/*</span> -<a name="l00716"></a>00716 <span class="comment"> * Build the list with List Information for Word 8/9/10/11 files</span> -<a name="l00717"></a>00717 <span class="comment"> */</span> -<a name="l00718"></a>00718 <span class="keywordtype">void</span> -<a name="l00719"></a>00719 vGet8LstInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00720"></a>00720 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00721"></a>00721 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00722"></a>00722 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00723"></a>00723 { -<a name="l00724"></a>00724 list_block_type tList; -<a name="l00725"></a>00725 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00726"></a>00726 UCHAR *aucLfoInfo, *aucLstfInfo, *aucPapx, *aucXString; -<a name="l00727"></a>00727 ULONG ulBeginLfoInfo, ulBeginLstfInfo, ulBeginLvlfInfo; -<a name="l00728"></a>00728 ULONG ulListID, ulStart; -<a name="l00729"></a>00729 <span class="keywordtype">size_t</span> tBlockDepotLen, tBlockSize; -<a name="l00730"></a>00730 <span class="keywordtype">size_t</span> tLfoInfoLen, tLstfInfoLen, tPapxLen, tXstLen, tOff; -<a name="l00731"></a>00731 <span class="keywordtype">size_t</span> tLstfRecords, tStart, tIndex; -<a name="l00732"></a>00732 <span class="keywordtype">int</span> iNums; -<a name="l00733"></a>00733 USHORT usIstd; -<a name="l00734"></a>00734 UCHAR ucTmp, ucListLevel, ucMaxLevel, ucChpxLen; -<a name="l00735"></a>00735 UCHAR aucLvlfInfo[28], aucXst[2]; -<a name="l00736"></a>00736 -<a name="l00737"></a>00737 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l00738"></a>00738 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00739"></a>00739 -<a name="l00740"></a>00740 NO_DBG_DEC(pPPS->tTable.ulSB); -<a name="l00741"></a>00741 NO_DBG_HEX(pPPS->tTable.ulSize); -<a name="l00742"></a>00742 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00743"></a>00743 DBG_MSG(<span class="stringliteral">"No list information"</span>); -<a name="l00744"></a>00744 <span class="keywordflow">return</span>; -<a name="l00745"></a>00745 } -<a name="l00746"></a>00746 -<a name="l00747"></a>00747 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00748"></a>00748 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00749"></a>00749 aulBlockDepot = aulSBD; -<a name="l00750"></a>00750 tBlockDepotLen = tSBDLen; -<a name="l00751"></a>00751 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00752"></a>00752 } <span class="keywordflow">else</span> { -<a name="l00753"></a>00753 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00754"></a>00754 aulBlockDepot = aulBBD; -<a name="l00755"></a>00755 tBlockDepotLen = tBBDLen; -<a name="l00756"></a>00756 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00757"></a>00757 } -<a name="l00758"></a>00758 -<a name="l00759"></a>00759 <span class="comment">/* LFO (List Format Override) */</span> -<a name="l00760"></a>00760 ulBeginLfoInfo = ulGetLong(0x2ea, aucHeader); <span class="comment">/* fcPlfLfo */</span> -<a name="l00761"></a>00761 DBG_HEX(ulBeginLfoInfo); -<a name="l00762"></a>00762 tLfoInfoLen = (size_t)ulGetLong(0x2ee, aucHeader); <span class="comment">/* lcbPlfLfo */</span> -<a name="l00763"></a>00763 DBG_DEC(tLfoInfoLen); -<a name="l00764"></a>00764 <span class="keywordflow">if</span> (tLfoInfoLen == 0) { -<a name="l00765"></a>00765 DBG_MSG(<span class="stringliteral">"No lists in this document"</span>); -<a name="l00766"></a>00766 <span class="keywordflow">return</span>; -<a name="l00767"></a>00767 } -<a name="l00768"></a>00768 -<a name="l00769"></a>00769 aucLfoInfo = xmalloc(tLfoInfoLen); -<a name="l00770"></a>00770 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00771"></a>00771 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00772"></a>00772 aucLfoInfo, ulBeginLfoInfo, tLfoInfoLen)) { -<a name="l00773"></a>00773 aucLfoInfo = xfree(aucLfoInfo); -<a name="l00774"></a>00774 <span class="keywordflow">return</span>; -<a name="l00775"></a>00775 } -<a name="l00776"></a>00776 NO_DBG_PRINT_BLOCK(aucLfoInfo, tLfoInfoLen); -<a name="l00777"></a>00777 vBuildLfoList(aucLfoInfo, tLfoInfoLen); -<a name="l00778"></a>00778 aucLfoInfo = xfree(aucLfoInfo); -<a name="l00779"></a>00779 -<a name="l00780"></a>00780 <span class="comment">/* LSTF (LiST data on File) */</span> -<a name="l00781"></a>00781 ulBeginLstfInfo = ulGetLong(0x2e2, aucHeader); <span class="comment">/* fcPlcfLst */</span> -<a name="l00782"></a>00782 DBG_HEX(ulBeginLstfInfo); -<a name="l00783"></a>00783 tLstfInfoLen = (size_t)ulGetLong(0x2e6, aucHeader); <span class="comment">/* lcbPlcfLst */</span> -<a name="l00784"></a>00784 DBG_DEC(tLstfInfoLen); -<a name="l00785"></a>00785 <span class="keywordflow">if</span> (tLstfInfoLen == 0) { -<a name="l00786"></a>00786 DBG_MSG(<span class="stringliteral">"No list data on file"</span>); -<a name="l00787"></a>00787 <span class="keywordflow">return</span>; -<a name="l00788"></a>00788 } -<a name="l00789"></a>00789 -<a name="l00790"></a>00790 aucLstfInfo = xmalloc(tLstfInfoLen); -<a name="l00791"></a>00791 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00792"></a>00792 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00793"></a>00793 aucLstfInfo, ulBeginLstfInfo, tLstfInfoLen)) { -<a name="l00794"></a>00794 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00795"></a>00795 <span class="keywordflow">return</span>; -<a name="l00796"></a>00796 } -<a name="l00797"></a>00797 NO_DBG_PRINT_BLOCK(aucLstfInfo, tLstfInfoLen); -<a name="l00798"></a>00798 -<a name="l00799"></a>00799 tLstfRecords = (size_t)usGetWord(0, aucLstfInfo); -<a name="l00800"></a>00800 <span class="keywordflow">if</span> (2 + tLstfRecords * 28 < tLstfInfoLen) { -<a name="l00801"></a>00801 DBG_DEC(2 + tLstfRecords * 28); -<a name="l00802"></a>00802 DBG_DEC(tLstfInfoLen); -<a name="l00803"></a>00803 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00804"></a>00804 <span class="keywordflow">return</span>; -<a name="l00805"></a>00805 } -<a name="l00806"></a>00806 -<a name="l00807"></a>00807 <span class="comment">/* LVLF (List leVeL on File) */</span> -<a name="l00808"></a>00808 ulBeginLvlfInfo = ulBeginLstfInfo + tLstfInfoLen; -<a name="l00809"></a>00809 DBG_HEX(ulBeginLvlfInfo); -<a name="l00810"></a>00810 -<a name="l00811"></a>00811 aucXString = NULL; -<a name="l00812"></a>00812 ulStart = ulBeginLvlfInfo; -<a name="l00813"></a>00813 -<a name="l00814"></a>00814 <span class="keywordflow">for</span> (tIndex = 0, tStart = 2; -<a name="l00815"></a>00815 tIndex < tLstfRecords; -<a name="l00816"></a>00816 tIndex++, tStart += 28) { -<a name="l00817"></a>00817 ulListID = ulGetLong(tStart, aucLstfInfo); -<a name="l00818"></a>00818 NO_DBG_HEX(ulListID); -<a name="l00819"></a>00819 ucTmp = ucGetByte(tStart + 26, aucLstfInfo); -<a name="l00820"></a>00820 ucMaxLevel = odd(ucTmp) ? 1 : 9; -<a name="l00821"></a>00821 <span class="keywordflow">for</span> (ucListLevel = 0; ucListLevel < ucMaxLevel; ucListLevel++) { -<a name="l00822"></a>00822 fail(aucXString != NULL); -<a name="l00823"></a>00823 usIstd = usGetWord( -<a name="l00824"></a>00824 tStart + 8 + 2 * (<span class="keywordtype">size_t</span>)ucListLevel, -<a name="l00825"></a>00825 aucLstfInfo); -<a name="l00826"></a>00826 DBG_DEC_C(usIstd != STI_NIL, usIstd); -<a name="l00827"></a>00827 NO_DBG_HEX(ulStart); -<a name="l00828"></a>00828 (void)memset(&tList, 0, <span class="keyword">sizeof</span>(tList)); -<a name="l00829"></a>00829 <span class="comment">/* Read the lvlf (List leVeL on File) */</span> -<a name="l00830"></a>00830 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00831"></a>00831 aulBlockDepot, tBlockDepotLen, -<a name="l00832"></a>00832 tBlockSize, aucLvlfInfo, -<a name="l00833"></a>00833 ulStart, <span class="keyword">sizeof</span>(aucLvlfInfo))) { -<a name="l00834"></a>00834 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00835"></a>00835 <span class="keywordflow">return</span>; -<a name="l00836"></a>00836 } -<a name="l00837"></a>00837 NO_DBG_PRINT_BLOCK(aucLvlfInfo, <span class="keyword">sizeof</span>(aucLvlfInfo)); -<a name="l00838"></a>00838 <span class="keywordflow">if</span> (bAllZero(aucLvlfInfo, <span class="keyword">sizeof</span>(aucLvlfInfo))) { -<a name="l00839"></a>00839 tList.ulStartAt = 1; -<a name="l00840"></a>00840 tList.ucNFC = 0x00; -<a name="l00841"></a>00841 tList.bNoRestart = FALSE; -<a name="l00842"></a>00842 } <span class="keywordflow">else</span> { -<a name="l00843"></a>00843 tList.ulStartAt = ulGetLong(0, aucLvlfInfo); -<a name="l00844"></a>00844 tList.ucNFC = ucGetByte(4, aucLvlfInfo); -<a name="l00845"></a>00845 ucTmp = ucGetByte(5, aucLvlfInfo); -<a name="l00846"></a>00846 tList.bNoRestart = (ucTmp & BIT(3)) != 0; -<a name="l00847"></a>00847 DBG_MSG_C((ucTmp & BIT(4)) != 0 && -<a name="l00848"></a>00848 (ucTmp & BIT(6)) != 0, <span class="stringliteral">"Found one"</span>); -<a name="l00849"></a>00849 } -<a name="l00850"></a>00850 ulStart += <span class="keyword">sizeof</span>(aucLvlfInfo); -<a name="l00851"></a>00851 tPapxLen = (size_t)ucGetByte(25, aucLvlfInfo); -<a name="l00852"></a>00852 <span class="keywordflow">if</span> (tPapxLen != 0) { -<a name="l00853"></a>00853 aucPapx = xmalloc(tPapxLen); -<a name="l00854"></a>00854 <span class="comment">/* Read the Papx */</span> -<a name="l00855"></a>00855 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00856"></a>00856 aulBlockDepot, tBlockDepotLen, -<a name="l00857"></a>00857 tBlockSize, aucPapx, -<a name="l00858"></a>00858 ulStart, tPapxLen)) { -<a name="l00859"></a>00859 aucPapx = xfree(aucPapx); -<a name="l00860"></a>00860 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00861"></a>00861 <span class="keywordflow">return</span>; -<a name="l00862"></a>00862 } -<a name="l00863"></a>00863 NO_DBG_PRINT_BLOCK(aucPapx, tPapxLen); -<a name="l00864"></a>00864 tList.sLeftIndent = -<a name="l00865"></a>00865 sGetLeftIndent(aucPapx, tPapxLen); -<a name="l00866"></a>00866 aucPapx = xfree(aucPapx); -<a name="l00867"></a>00867 } -<a name="l00868"></a>00868 ulStart += tPapxLen; -<a name="l00869"></a>00869 ucChpxLen = ucGetByte(24, aucLvlfInfo); -<a name="l00870"></a>00870 ulStart += (ULONG)ucChpxLen; -<a name="l00871"></a>00871 <span class="comment">/* Read the length of the XString */</span> -<a name="l00872"></a>00872 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00873"></a>00873 aulBlockDepot, tBlockDepotLen, -<a name="l00874"></a>00874 tBlockSize, aucXst, -<a name="l00875"></a>00875 ulStart, <span class="keyword">sizeof</span>(aucXst))) { -<a name="l00876"></a>00876 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00877"></a>00877 <span class="keywordflow">return</span>; -<a name="l00878"></a>00878 } -<a name="l00879"></a>00879 NO_DBG_PRINT_BLOCK(aucXst, <span class="keyword">sizeof</span>(aucXst)); -<a name="l00880"></a>00880 tXstLen = (size_t)usGetWord(0, aucXst); -<a name="l00881"></a>00881 ulStart += <span class="keyword">sizeof</span>(aucXst); -<a name="l00882"></a>00882 <span class="keywordflow">if</span> (tXstLen == 0) { -<a name="l00883"></a>00883 tList.usListChar = DEFAULT_LISTCHAR; -<a name="l00884"></a>00884 vAdd2ListInfoList(ulListID, -<a name="l00885"></a>00885 usIstd, -<a name="l00886"></a>00886 ucListLevel, -<a name="l00887"></a>00887 &tList); -<a name="l00888"></a>00888 <span class="keywordflow">continue</span>; -<a name="l00889"></a>00889 } -<a name="l00890"></a>00890 tXstLen *= 2; <span class="comment">/* Length in chars to length in bytes */</span> -<a name="l00891"></a>00891 aucXString = xmalloc(tXstLen); -<a name="l00892"></a>00892 <span class="comment">/* Read the XString */</span> -<a name="l00893"></a>00893 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00894"></a>00894 aulBlockDepot, tBlockDepotLen, -<a name="l00895"></a>00895 tBlockSize, aucXString, -<a name="l00896"></a>00896 ulStart, tXstLen)) { -<a name="l00897"></a>00897 aucXString = xfree(aucXString); -<a name="l00898"></a>00898 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00899"></a>00899 <span class="keywordflow">return</span>; -<a name="l00900"></a>00900 } -<a name="l00901"></a>00901 NO_DBG_PRINT_BLOCK(aucXString, tXstLen); -<a name="l00902"></a>00902 tOff = 0; -<a name="l00903"></a>00903 <span class="keywordflow">for</span> (iNums = 6; iNums < 15; iNums++) { -<a name="l00904"></a>00904 ucTmp = ucGetByte(iNums, aucLvlfInfo); -<a name="l00905"></a>00905 <span class="keywordflow">if</span> (ucTmp == 0) { -<a name="l00906"></a>00906 <span class="keywordflow">break</span>; -<a name="l00907"></a>00907 } -<a name="l00908"></a>00908 tOff = (size_t)ucTmp; -<a name="l00909"></a>00909 } -<a name="l00910"></a>00910 tOff *= 2; <span class="comment">/* Offset in chars to offset in bytes */</span> -<a name="l00911"></a>00911 NO_DBG_DEC(tOff); -<a name="l00912"></a>00912 <span class="keywordflow">if</span> (tList.ucNFC == LIST_SPECIAL || -<a name="l00913"></a>00913 tList.ucNFC == LIST_SPECIAL2 || -<a name="l00914"></a>00914 tList.ucNFC == LIST_BULLETS) { -<a name="l00915"></a>00915 tList.usListChar = usGetWord(0, aucXString); -<a name="l00916"></a>00916 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (tOff != 0 && tOff < tXstLen) { -<a name="l00917"></a>00917 tList.usListChar = usGetWord(tOff, aucXString); -<a name="l00918"></a>00918 } <span class="keywordflow">else</span> { -<a name="l00919"></a>00919 tList.usListChar = DEFAULT_LISTCHAR; -<a name="l00920"></a>00920 } -<a name="l00921"></a>00921 vAdd2ListInfoList(ulListID, -<a name="l00922"></a>00922 usIstd, -<a name="l00923"></a>00923 ucListLevel, -<a name="l00924"></a>00924 &tList); -<a name="l00925"></a>00925 ulStart += tXstLen; -<a name="l00926"></a>00926 aucXString = xfree(aucXString); -<a name="l00927"></a>00927 } -<a name="l00928"></a>00928 } -<a name="l00929"></a>00929 aucLstfInfo = xfree(aucLstfInfo); -<a name="l00930"></a>00930 } <span class="comment">/* end of vGet8LstInfo */</span> -<a name="l00931"></a>00931 -<a name="l00932"></a>00932 <span class="comment">/*</span> -<a name="l00933"></a>00933 <span class="comment"> * Build the lists with Paragraph Information for Word 8/9/10/11 files</span> -<a name="l00934"></a>00934 <span class="comment"> */</span> -<a name="l00935"></a>00935 <span class="keywordtype">void</span> -<a name="l00936"></a>00936 vGet8PapInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00937"></a>00937 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00938"></a>00938 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00939"></a>00939 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00940"></a>00940 { -<a name="l00941"></a>00941 row_block_type tRow; -<a name="l00942"></a>00942 style_block_type tStyle; -<a name="l00943"></a>00943 ULONG *aulParfPage; -<a name="l00944"></a>00944 UCHAR *aucBuffer; -<a name="l00945"></a>00945 ULONG ulCharPos, ulCharPosFirst, ulCharPosLast; -<a name="l00946"></a>00946 ULONG ulBeginParfInfo; -<a name="l00947"></a>00947 <span class="keywordtype">size_t</span> tParfInfoLen, tOffset, tLen; -<a name="l00948"></a>00948 <span class="keywordtype">int</span> iIndex, iIndex2, iRun, iFodo, iLen; -<a name="l00949"></a>00949 row_info_enum eRowInfo; -<a name="l00950"></a>00950 USHORT usIstd; -<a name="l00951"></a>00951 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l00952"></a>00952 -<a name="l00953"></a>00953 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l00954"></a>00954 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00955"></a>00955 -<a name="l00956"></a>00956 ulBeginParfInfo = ulGetLong(0x102, aucHeader); <span class="comment">/* fcPlcfbtePapx */</span> -<a name="l00957"></a>00957 NO_DBG_HEX(ulBeginParfInfo); -<a name="l00958"></a>00958 tParfInfoLen = (size_t)ulGetLong(0x106, aucHeader); <span class="comment">/* lcbPlcfbtePapx */</span> -<a name="l00959"></a>00959 NO_DBG_DEC(tParfInfoLen); -<a name="l00960"></a>00960 <span class="keywordflow">if</span> (tParfInfoLen < 4) { -<a name="l00961"></a>00961 DBG_DEC(tParfInfoLen); -<a name="l00962"></a>00962 <span class="keywordflow">return</span>; -<a name="l00963"></a>00963 } -<a name="l00964"></a>00964 -<a name="l00965"></a>00965 aucBuffer = aucFillInfoBuffer(pFile, &pPPS->tTable, -<a name="l00966"></a>00966 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00967"></a>00967 ulBeginParfInfo, tParfInfoLen); -<a name="l00968"></a>00968 <span class="keywordflow">if</span> (aucBuffer == NULL) { -<a name="l00969"></a>00969 <span class="keywordflow">return</span>; -<a name="l00970"></a>00970 } -<a name="l00971"></a>00971 NO_DBG_PRINT_BLOCK(aucBuffer, tParfInfoLen); -<a name="l00972"></a>00972 -<a name="l00973"></a>00973 tLen = (tParfInfoLen / 4 - 1) / 2; -<a name="l00974"></a>00974 aulParfPage = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00975"></a>00975 <span class="keywordflow">for</span> (iIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l00976"></a>00976 iIndex < (int)tLen; -<a name="l00977"></a>00977 iIndex++, tOffset += 4) { -<a name="l00978"></a>00978 aulParfPage[iIndex] = ulGetLong(tOffset, aucBuffer); -<a name="l00979"></a>00979 NO_DBG_DEC(aulParfPage[iIndex]); -<a name="l00980"></a>00980 } -<a name="l00981"></a>00981 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l00982"></a>00982 aucBuffer = xfree(aucBuffer); -<a name="l00983"></a>00983 NO_DBG_PRINT_BLOCK(aucHeader, HEADER_SIZE); -<a name="l00984"></a>00984 -<a name="l00985"></a>00985 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l00986"></a>00986 ulCharPosFirst = CP_INVALID; -<a name="l00987"></a>00987 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tLen; iIndex++) { -<a name="l00988"></a>00988 fail(aulParfPage[iIndex] > ULONG_MAX / BIG_BLOCK_SIZE); -<a name="l00989"></a>00989 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tWordDocument.ulSB, -<a name="l00990"></a>00990 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00991"></a>00991 aucFpage, -<a name="l00992"></a>00992 aulParfPage[iIndex] * BIG_BLOCK_SIZE, -<a name="l00993"></a>00993 BIG_BLOCK_SIZE)) { -<a name="l00994"></a>00994 <span class="keywordflow">break</span>; -<a name="l00995"></a>00995 } -<a name="l00996"></a>00996 NO_DBG_PRINT_BLOCK(aucFpage, BIG_BLOCK_SIZE); -<a name="l00997"></a>00997 iRun = (int)ucGetByte(0x1ff, aucFpage); -<a name="l00998"></a>00998 NO_DBG_DEC(iRun); -<a name="l00999"></a>00999 <span class="keywordflow">for</span> (iIndex2 = 0; iIndex2 < iRun; iIndex2++) { -<a name="l01000"></a>01000 NO_DBG_HEX(ulGetLong(iIndex2 * 4, aucFpage)); -<a name="l01001"></a>01001 iFodo = 2 * (int)ucGetByte( -<a name="l01002"></a>01002 (iRun + 1) * 4 + iIndex2 * 13, aucFpage); -<a name="l01003"></a>01003 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l01004"></a>01004 <span class="keywordflow">continue</span>; -<a name="l01005"></a>01005 } -<a name="l01006"></a>01006 -<a name="l01007"></a>01007 iLen = 2 * (int)ucGetByte(iFodo, aucFpage); -<a name="l01008"></a>01008 <span class="keywordflow">if</span> (iLen == 0) { -<a name="l01009"></a>01009 iFodo++; -<a name="l01010"></a>01010 iLen = 2 * (int)ucGetByte(iFodo, aucFpage); -<a name="l01011"></a>01011 } -<a name="l01012"></a>01012 -<a name="l01013"></a>01013 usIstd = usGetWord(iFodo + 1, aucFpage); -<a name="l01014"></a>01014 vFillStyleFromStylesheet(usIstd, &tStyle); -<a name="l01015"></a>01015 vGet8StyleInfo(iFodo, aucFpage + 3, iLen - 3, &tStyle); -<a name="l01016"></a>01016 ulCharPos = ulGetLong(iIndex2 * 4, aucFpage); -<a name="l01017"></a>01017 NO_DBG_HEX(ulCharPos); -<a name="l01018"></a>01018 tStyle.ulFileOffset = ulCharPos2FileOffsetX( -<a name="l01019"></a>01019 ulCharPos, &tStyle.eListID); -<a name="l01020"></a>01020 vAdd2StyleInfoList(&tStyle); -<a name="l01021"></a>01021 -<a name="l01022"></a>01022 eRowInfo = eGet8RowInfo(iFodo, -<a name="l01023"></a>01023 aucFpage + 3, iLen - 3, &tRow); -<a name="l01024"></a>01024 <span class="keywordflow">switch</span> (eRowInfo) { -<a name="l01025"></a>01025 <span class="keywordflow">case</span> found_a_cell: -<a name="l01026"></a>01026 <span class="keywordflow">if</span> (ulCharPosFirst != CP_INVALID) { -<a name="l01027"></a>01027 <span class="keywordflow">break</span>; -<a name="l01028"></a>01028 } -<a name="l01029"></a>01029 ulCharPosFirst = ulGetLong( -<a name="l01030"></a>01030 iIndex2 * 4, aucFpage); -<a name="l01031"></a>01031 NO_DBG_HEX(ulCharPosFirst); -<a name="l01032"></a>01032 tRow.ulCharPosStart = ulCharPosFirst; -<a name="l01033"></a>01033 tRow.ulFileOffsetStart = -<a name="l01034"></a>01034 ulCharPos2FileOffset(ulCharPosFirst); -<a name="l01035"></a>01035 NO_DBG_HEX_C( -<a name="l01036"></a>01036 tRow.ulFileOffsetStart == FC_INVALID, -<a name="l01037"></a>01037 ulCharPosFirst); -<a name="l01038"></a>01038 <span class="keywordflow">break</span>; -<a name="l01039"></a>01039 <span class="keywordflow">case</span> found_end_of_row: -<a name="l01040"></a>01040 ulCharPosLast = ulGetLong( -<a name="l01041"></a>01041 iIndex2 * 4, aucFpage); -<a name="l01042"></a>01042 NO_DBG_HEX(ulCharPosLast); -<a name="l01043"></a>01043 tRow.ulCharPosEnd = ulCharPosLast; -<a name="l01044"></a>01044 tRow.ulFileOffsetEnd = -<a name="l01045"></a>01045 ulCharPos2FileOffset(ulCharPosLast); -<a name="l01046"></a>01046 NO_DBG_HEX_C(tRow.ulFileOffsetEnd == FC_INVALID, -<a name="l01047"></a>01047 ulCharPosLast); -<a name="l01048"></a>01048 vAdd2RowInfoList(&tRow); -<a name="l01049"></a>01049 (void)memset(&tRow, 0, <span class="keyword">sizeof</span>(tRow)); -<a name="l01050"></a>01050 ulCharPosFirst = CP_INVALID; -<a name="l01051"></a>01051 <span class="keywordflow">break</span>; -<a name="l01052"></a>01052 <span class="keywordflow">case</span> found_nothing: -<a name="l01053"></a>01053 <span class="keywordflow">break</span>; -<a name="l01054"></a>01054 <span class="keywordflow">default</span>: -<a name="l01055"></a>01055 DBG_DEC(eRowInfo); -<a name="l01056"></a>01056 <span class="keywordflow">break</span>; -<a name="l01057"></a>01057 } -<a name="l01058"></a>01058 } -<a name="l01059"></a>01059 } -<a name="l01060"></a>01060 aulParfPage = xfree(aulParfPage); -<a name="l01061"></a>01061 } <span class="comment">/* end of vGet8PapInfo */</span> -<a name="l01062"></a>01062 -<a name="l01063"></a>01063 <span class="comment">/*</span> -<a name="l01064"></a>01064 <span class="comment"> * Fill the font information block with information</span> -<a name="l01065"></a>01065 <span class="comment"> * from a Word 8/9/10/11 file.</span> -<a name="l01066"></a>01066 <span class="comment"> */</span> -<a name="l01067"></a>01067 <span class="keywordtype">void</span> -<a name="l01068"></a>01068 vGet8FontInfo(<span class="keywordtype">int</span> iFodo, USHORT usIstd, -<a name="l01069"></a>01069 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, font_block_type *pFont) -<a name="l01070"></a>01070 { -<a name="l01071"></a>01071 <span class="keywordtype">long</span> lTmp; -<a name="l01072"></a>01072 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l01073"></a>01073 USHORT usFtc0, usFtc1, usFtc2, usTmp; -<a name="l01074"></a>01074 UCHAR ucTmp; -<a name="l01075"></a>01075 -<a name="l01076"></a>01076 fail(iFodo < 0 || aucGrpprl == NULL || pFont == NULL); -<a name="l01077"></a>01077 -<a name="l01078"></a>01078 usFtc0 = USHRT_MAX; -<a name="l01079"></a>01079 usFtc1 = USHRT_MAX; -<a name="l01080"></a>01080 usFtc2 = USHRT_MAX; -<a name="l01081"></a>01081 -<a name="l01082"></a>01082 iFodoOff = 0; -<a name="l01083"></a>01083 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 2) { -<a name="l01084"></a>01084 <span class="keywordflow">switch</span> (usGetWord(iFodo + iFodoOff, aucGrpprl)) { -<a name="l01085"></a>01085 <span class="keywordflow">case</span> 0x0800: <span class="comment">/* fRMarkDel */</span> -<a name="l01086"></a>01086 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01087"></a>01087 <span class="keywordflow">if</span> (ucTmp == 0) { -<a name="l01088"></a>01088 pFont->usFontStyle &= ~FONT_MARKDEL; -<a name="l01089"></a>01089 } <span class="keywordflow">else</span> { -<a name="l01090"></a>01090 pFont->usFontStyle |= FONT_MARKDEL; -<a name="l01091"></a>01091 } -<a name="l01092"></a>01092 <span class="keywordflow">break</span>; -<a name="l01093"></a>01093 <span class="keywordflow">case</span> 0x0835: <span class="comment">/* fBold */</span> -<a name="l01094"></a>01094 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01095"></a>01095 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01096"></a>01096 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01097"></a>01097 pFont->usFontStyle &= ~FONT_BOLD; -<a name="l01098"></a>01098 <span class="keywordflow">break</span>; -<a name="l01099"></a>01099 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01100"></a>01100 pFont->usFontStyle |= FONT_BOLD; -<a name="l01101"></a>01101 <span class="keywordflow">break</span>; -<a name="l01102"></a>01102 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01103"></a>01103 <span class="keywordflow">break</span>; -<a name="l01104"></a>01104 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01105"></a>01105 pFont->usFontStyle ^= FONT_BOLD; -<a name="l01106"></a>01106 <span class="keywordflow">break</span>; -<a name="l01107"></a>01107 <span class="keywordflow">default</span>: -<a name="l01108"></a>01108 DBG_DEC(ucTmp); -<a name="l01109"></a>01109 DBG_FIXME(); -<a name="l01110"></a>01110 <span class="keywordflow">break</span>; -<a name="l01111"></a>01111 } -<a name="l01112"></a>01112 <span class="keywordflow">break</span>; -<a name="l01113"></a>01113 <span class="keywordflow">case</span> 0x0836: <span class="comment">/* fItalic */</span> -<a name="l01114"></a>01114 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01115"></a>01115 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01116"></a>01116 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01117"></a>01117 pFont->usFontStyle &= ~FONT_ITALIC; -<a name="l01118"></a>01118 <span class="keywordflow">break</span>; -<a name="l01119"></a>01119 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01120"></a>01120 pFont->usFontStyle |= FONT_ITALIC; -<a name="l01121"></a>01121 <span class="keywordflow">break</span>; -<a name="l01122"></a>01122 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01123"></a>01123 <span class="keywordflow">break</span>; -<a name="l01124"></a>01124 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01125"></a>01125 pFont->usFontStyle ^= FONT_ITALIC; -<a name="l01126"></a>01126 <span class="keywordflow">break</span>; -<a name="l01127"></a>01127 <span class="keywordflow">default</span>: -<a name="l01128"></a>01128 DBG_DEC(ucTmp); -<a name="l01129"></a>01129 DBG_FIXME(); -<a name="l01130"></a>01130 <span class="keywordflow">break</span>; -<a name="l01131"></a>01131 } -<a name="l01132"></a>01132 <span class="keywordflow">break</span>; -<a name="l01133"></a>01133 <span class="keywordflow">case</span> 0x0837: <span class="comment">/* fStrike */</span> -<a name="l01134"></a>01134 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01135"></a>01135 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01136"></a>01136 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01137"></a>01137 pFont->usFontStyle &= ~FONT_STRIKE; -<a name="l01138"></a>01138 <span class="keywordflow">break</span>; -<a name="l01139"></a>01139 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01140"></a>01140 pFont->usFontStyle |= FONT_STRIKE; -<a name="l01141"></a>01141 <span class="keywordflow">break</span>; -<a name="l01142"></a>01142 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01143"></a>01143 <span class="keywordflow">break</span>; -<a name="l01144"></a>01144 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01145"></a>01145 pFont->usFontStyle ^= FONT_STRIKE; -<a name="l01146"></a>01146 <span class="keywordflow">break</span>; -<a name="l01147"></a>01147 <span class="keywordflow">default</span>: -<a name="l01148"></a>01148 DBG_DEC(ucTmp); -<a name="l01149"></a>01149 DBG_FIXME(); -<a name="l01150"></a>01150 <span class="keywordflow">break</span>; -<a name="l01151"></a>01151 } -<a name="l01152"></a>01152 <span class="keywordflow">break</span>; -<a name="l01153"></a>01153 <span class="keywordflow">case</span> 0x083a: <span class="comment">/* fSmallCaps */</span> -<a name="l01154"></a>01154 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01155"></a>01155 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01156"></a>01156 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01157"></a>01157 pFont->usFontStyle &= ~FONT_SMALL_CAPITALS; -<a name="l01158"></a>01158 <span class="keywordflow">break</span>; -<a name="l01159"></a>01159 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01160"></a>01160 pFont->usFontStyle |= FONT_SMALL_CAPITALS; -<a name="l01161"></a>01161 <span class="keywordflow">break</span>; -<a name="l01162"></a>01162 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01163"></a>01163 <span class="keywordflow">break</span>; -<a name="l01164"></a>01164 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01165"></a>01165 pFont->usFontStyle ^= FONT_SMALL_CAPITALS; -<a name="l01166"></a>01166 <span class="keywordflow">break</span>; -<a name="l01167"></a>01167 <span class="keywordflow">default</span>: -<a name="l01168"></a>01168 DBG_DEC(ucTmp); -<a name="l01169"></a>01169 DBG_FIXME(); -<a name="l01170"></a>01170 <span class="keywordflow">break</span>; -<a name="l01171"></a>01171 } -<a name="l01172"></a>01172 <span class="keywordflow">break</span>; -<a name="l01173"></a>01173 <span class="keywordflow">case</span> 0x083b: <span class="comment">/* fCaps */</span> -<a name="l01174"></a>01174 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01175"></a>01175 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01176"></a>01176 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01177"></a>01177 pFont->usFontStyle &= ~FONT_CAPITALS; -<a name="l01178"></a>01178 <span class="keywordflow">break</span>; -<a name="l01179"></a>01179 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01180"></a>01180 pFont->usFontStyle |= FONT_CAPITALS; -<a name="l01181"></a>01181 <span class="keywordflow">break</span>; -<a name="l01182"></a>01182 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01183"></a>01183 <span class="keywordflow">break</span>; -<a name="l01184"></a>01184 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01185"></a>01185 pFont->usFontStyle ^= FONT_CAPITALS; -<a name="l01186"></a>01186 <span class="keywordflow">break</span>; -<a name="l01187"></a>01187 <span class="keywordflow">default</span>: -<a name="l01188"></a>01188 DBG_DEC(ucTmp); -<a name="l01189"></a>01189 DBG_FIXME(); -<a name="l01190"></a>01190 <span class="keywordflow">break</span>; -<a name="l01191"></a>01191 } -<a name="l01192"></a>01192 <span class="keywordflow">break</span>; -<a name="l01193"></a>01193 <span class="keywordflow">case</span> 0x083c: <span class="comment">/* fVanish */</span> -<a name="l01194"></a>01194 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01195"></a>01195 <span class="keywordflow">switch</span> (ucTmp) { -<a name="l01196"></a>01196 <span class="keywordflow">case</span> 0: <span class="comment">/* Unset */</span> -<a name="l01197"></a>01197 pFont->usFontStyle &= ~FONT_HIDDEN; -<a name="l01198"></a>01198 <span class="keywordflow">break</span>; -<a name="l01199"></a>01199 <span class="keywordflow">case</span> 1: <span class="comment">/* Set */</span> -<a name="l01200"></a>01200 pFont->usFontStyle |= FONT_HIDDEN; -<a name="l01201"></a>01201 <span class="keywordflow">break</span>; -<a name="l01202"></a>01202 <span class="keywordflow">case</span> 128: <span class="comment">/* Unchanged */</span> -<a name="l01203"></a>01203 <span class="keywordflow">break</span>; -<a name="l01204"></a>01204 <span class="keywordflow">case</span> 129: <span class="comment">/* Negation */</span> -<a name="l01205"></a>01205 pFont->usFontStyle ^= FONT_HIDDEN; -<a name="l01206"></a>01206 <span class="keywordflow">break</span>; -<a name="l01207"></a>01207 <span class="keywordflow">default</span>: -<a name="l01208"></a>01208 DBG_DEC(ucTmp); -<a name="l01209"></a>01209 DBG_FIXME(); -<a name="l01210"></a>01210 <span class="keywordflow">break</span>; -<a name="l01211"></a>01211 } -<a name="l01212"></a>01212 <span class="keywordflow">break</span>; -<a name="l01213"></a>01213 <span class="keywordflow">case</span> 0x2a32: <span class="comment">/* cDefault */</span> -<a name="l01214"></a>01214 pFont->usFontStyle &= FONT_HIDDEN; -<a name="l01215"></a>01215 pFont->ucFontColor = FONT_COLOR_DEFAULT; -<a name="l01216"></a>01216 <span class="keywordflow">break</span>; -<a name="l01217"></a>01217 <span class="keywordflow">case</span> 0x2a33: <span class="comment">/* cPlain */</span> -<a name="l01218"></a>01218 DBG_MSG(<span class="stringliteral">"2a33: cPlain"</span>); -<a name="l01219"></a>01219 vFillFontFromStylesheet(usIstd, pFont); -<a name="l01220"></a>01220 <span class="keywordflow">break</span>; -<a name="l01221"></a>01221 <span class="keywordflow">case</span> 0x2a3e: <span class="comment">/* cKul */</span> -<a name="l01222"></a>01222 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01223"></a>01223 <span class="keywordflow">if</span> (ucTmp == 0 || ucTmp == 5) { -<a name="l01224"></a>01224 pFont->usFontStyle &= ~FONT_UNDERLINE; -<a name="l01225"></a>01225 } <span class="keywordflow">else</span> { -<a name="l01226"></a>01226 NO_DBG_MSG(<span class="stringliteral">"Underline text"</span>); -<a name="l01227"></a>01227 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l01228"></a>01228 <span class="keywordflow">if</span> (ucTmp == 6) { -<a name="l01229"></a>01229 DBG_MSG(<span class="stringliteral">"Bold text"</span>); -<a name="l01230"></a>01230 pFont->usFontStyle |= FONT_BOLD; -<a name="l01231"></a>01231 } -<a name="l01232"></a>01232 } -<a name="l01233"></a>01233 <span class="keywordflow">break</span>; -<a name="l01234"></a>01234 <span class="keywordflow">case</span> 0x2a42: <span class="comment">/* cIco */</span> -<a name="l01235"></a>01235 pFont->ucFontColor = -<a name="l01236"></a>01236 ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01237"></a>01237 NO_DBG_DEC(pFont->ucFontColor); -<a name="l01238"></a>01238 <span class="keywordflow">break</span>; -<a name="l01239"></a>01239 <span class="keywordflow">case</span> 0x2a44: <span class="comment">/* cHpsInc */</span> -<a name="l01240"></a>01240 DBG_MSG(<span class="stringliteral">"0x2a44: sprmCHpsInc"</span>); -<a name="l01241"></a>01241 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01242"></a>01242 DBG_DEC(ucTmp); -<a name="l01243"></a>01243 <span class="keywordflow">break</span>; -<a name="l01244"></a>01244 <span class="keywordflow">case</span> 0x2a48: <span class="comment">/* cIss */</span> -<a name="l01245"></a>01245 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01246"></a>01246 ucTmp &= 0x07; -<a name="l01247"></a>01247 <span class="keywordflow">if</span> (ucTmp == 1) { -<a name="l01248"></a>01248 pFont->usFontStyle |= FONT_SUPERSCRIPT; -<a name="l01249"></a>01249 NO_DBG_MSG(<span class="stringliteral">"Superscript"</span>); -<a name="l01250"></a>01250 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucTmp == 2) { -<a name="l01251"></a>01251 pFont->usFontStyle |= FONT_SUBSCRIPT; -<a name="l01252"></a>01252 NO_DBG_MSG(<span class="stringliteral">"Subscript"</span>); -<a name="l01253"></a>01253 } -<a name="l01254"></a>01254 <span class="keywordflow">break</span>; -<a name="l01255"></a>01255 <span class="keywordflow">case</span> 0x4a30: <span class="comment">/* cIstd */</span> -<a name="l01256"></a>01256 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01257"></a>01257 NO_DBG_DEC(usTmp); -<a name="l01258"></a>01258 <span class="keywordflow">break</span>; -<a name="l01259"></a>01259 <span class="keywordflow">case</span> 0x4a43: <span class="comment">/* cHps */</span> -<a name="l01260"></a>01260 pFont->usFontSize = -<a name="l01261"></a>01261 usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01262"></a>01262 NO_DBG_DEC(pFont->usFontSize); -<a name="l01263"></a>01263 <span class="keywordflow">break</span>; -<a name="l01264"></a>01264 <span class="keywordflow">case</span> 0x4a4d: <span class="comment">/* cHpsMul */</span> -<a name="l01265"></a>01265 DBG_MSG(<span class="stringliteral">"0x4a4d: sprmCHpsMul"</span>); -<a name="l01266"></a>01266 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01267"></a>01267 DBG_DEC(usTmp); -<a name="l01268"></a>01268 <span class="keywordflow">break</span>; -<a name="l01269"></a>01269 <span class="keywordflow">case</span> 0x4a4f: <span class="comment">/* cFtc0 */</span> -<a name="l01270"></a>01270 usFtc0 = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01271"></a>01271 <span class="keywordflow">break</span>; -<a name="l01272"></a>01272 <span class="keywordflow">case</span> 0x4a50: <span class="comment">/* cFtc1 */</span> -<a name="l01273"></a>01273 usFtc1 = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01274"></a>01274 <span class="keywordflow">break</span>; -<a name="l01275"></a>01275 <span class="keywordflow">case</span> 0x4a51: <span class="comment">/* cFtc2 */</span> -<a name="l01276"></a>01276 usFtc2 = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01277"></a>01277 <span class="keywordflow">break</span>; -<a name="l01278"></a>01278 <span class="keywordflow">case</span> 0xca47: <span class="comment">/* cMajority */</span> -<a name="l01279"></a>01279 DBG_MSG(<span class="stringliteral">"0xca47: sprmCMajority"</span>); -<a name="l01280"></a>01280 <span class="keywordflow">break</span>; -<a name="l01281"></a>01281 <span class="keywordflow">case</span> 0xca4a: <span class="comment">/* cHpsInc1 */</span> -<a name="l01282"></a>01282 usTmp = usGetWord(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01283"></a>01283 lTmp = (long)pFont->usFontSize + (<span class="keywordtype">long</span>)usTmp; -<a name="l01284"></a>01284 <span class="keywordflow">if</span> (lTmp < 8) { -<a name="l01285"></a>01285 pFont->usFontSize = 8; -<a name="l01286"></a>01286 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (lTmp > 32766) { -<a name="l01287"></a>01287 pFont->usFontSize = 32766; -<a name="l01288"></a>01288 } <span class="keywordflow">else</span> { -<a name="l01289"></a>01289 pFont->usFontSize = (USHORT)lTmp; -<a name="l01290"></a>01290 } -<a name="l01291"></a>01291 <span class="keywordflow">break</span>; -<a name="l01292"></a>01292 <span class="keywordflow">case</span> 0xca4c: <span class="comment">/* cMajority50 */</span> -<a name="l01293"></a>01293 DBG_MSG(<span class="stringliteral">"0xca4c: sprmCMajority50"</span>); -<a name="l01294"></a>01294 <span class="keywordflow">break</span>; -<a name="l01295"></a>01295 <span class="keywordflow">case</span> 0xea3f: <span class="comment">/* cHps, cHpsPos */</span> -<a name="l01296"></a>01296 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01297"></a>01297 DBG_DEC(ucTmp); -<a name="l01298"></a>01298 <span class="keywordflow">if</span> (ucTmp != 0) { -<a name="l01299"></a>01299 pFont->usFontSize = (USHORT)ucTmp; -<a name="l01300"></a>01300 } -<a name="l01301"></a>01301 ucTmp = ucGetByte(iFodo + iFodoOff + 3, aucGrpprl); -<a name="l01302"></a>01302 DBG_DEC(ucTmp); -<a name="l01303"></a>01303 <span class="keywordflow">break</span>; -<a name="l01304"></a>01304 <span class="keywordflow">default</span>: -<a name="l01305"></a>01305 <span class="keywordflow">break</span>; -<a name="l01306"></a>01306 } -<a name="l01307"></a>01307 iInfoLen = iGet8InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l01308"></a>01308 fail(iInfoLen <= 0); -<a name="l01309"></a>01309 iFodoOff += iInfoLen; -<a name="l01310"></a>01310 } -<a name="l01311"></a>01311 -<a name="l01312"></a>01312 <span class="comment">/* Combine the Ftc's to a FontNumber */</span> -<a name="l01313"></a>01313 NO_DBG_DEC_C(usFtc0 != USHRT_MAX, usFtc0); -<a name="l01314"></a>01314 NO_DBG_DEC_C(usFtc2 != USHRT_MAX, usFtc2); -<a name="l01315"></a>01315 NO_DBG_DEC_C(usFtc1 != USHRT_MAX, usFtc1); -<a name="l01316"></a>01316 <span class="keywordflow">if</span> (usFtc0 <= 0x7fff) { -<a name="l01317"></a>01317 <span class="keywordflow">if</span> (usFtc0 <= (USHORT)UCHAR_MAX) { -<a name="l01318"></a>01318 pFont->ucFontNumber = (UCHAR)usFtc0; -<a name="l01319"></a>01319 } <span class="keywordflow">else</span> { -<a name="l01320"></a>01320 DBG_DEC(usFtc0); -<a name="l01321"></a>01321 DBG_FIXME(); -<a name="l01322"></a>01322 pFont->ucFontNumber = 0; -<a name="l01323"></a>01323 } -<a name="l01324"></a>01324 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usFtc2 <= 0x7fff) { -<a name="l01325"></a>01325 <span class="keywordflow">if</span> (usFtc2 <= (USHORT)UCHAR_MAX) { -<a name="l01326"></a>01326 pFont->ucFontNumber = (UCHAR)usFtc2; -<a name="l01327"></a>01327 } <span class="keywordflow">else</span> { -<a name="l01328"></a>01328 DBG_DEC(usFtc2); -<a name="l01329"></a>01329 DBG_FIXME(); -<a name="l01330"></a>01330 pFont->ucFontNumber = 0; -<a name="l01331"></a>01331 } -<a name="l01332"></a>01332 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usFtc1 <= 0x7fff) { -<a name="l01333"></a>01333 <span class="keywordflow">if</span> (usFtc1 <= (USHORT)UCHAR_MAX) { -<a name="l01334"></a>01334 pFont->ucFontNumber = (UCHAR)usFtc1; -<a name="l01335"></a>01335 } <span class="keywordflow">else</span> { -<a name="l01336"></a>01336 DBG_DEC(usFtc1); -<a name="l01337"></a>01337 DBG_FIXME(); -<a name="l01338"></a>01338 pFont->ucFontNumber = 0; -<a name="l01339"></a>01339 } -<a name="l01340"></a>01340 } -<a name="l01341"></a>01341 } <span class="comment">/* end of vGet8FontInfo */</span> -<a name="l01342"></a>01342 -<a name="l01343"></a>01343 <span class="comment">/*</span> -<a name="l01344"></a>01344 <span class="comment"> * Fill the picture information block with information</span> -<a name="l01345"></a>01345 <span class="comment"> * from a Word 8/9/10/11 file.</span> -<a name="l01346"></a>01346 <span class="comment"> * Returns TRUE when successful, otherwise FALSE</span> -<a name="l01347"></a>01347 <span class="comment"> */</span> -<a name="l01348"></a>01348 <span class="keyword">static</span> BOOL -<a name="l01349"></a>01349 bGet8PicInfo(<span class="keywordtype">int</span> iFodo, -<a name="l01350"></a>01350 <span class="keyword">const</span> UCHAR *aucGrpprl, <span class="keywordtype">int</span> iBytes, picture_block_type *pPicture) -<a name="l01351"></a>01351 { -<a name="l01352"></a>01352 ULONG ulTmp; -<a name="l01353"></a>01353 <span class="keywordtype">int</span> iFodoOff, iInfoLen; -<a name="l01354"></a>01354 BOOL bFound; -<a name="l01355"></a>01355 UCHAR ucTmp; -<a name="l01356"></a>01356 -<a name="l01357"></a>01357 fail(iFodo <= 0 || aucGrpprl == NULL || pPicture == NULL); -<a name="l01358"></a>01358 -<a name="l01359"></a>01359 iFodoOff = 0; -<a name="l01360"></a>01360 bFound = FALSE; -<a name="l01361"></a>01361 <span class="keywordflow">while</span> (iBytes >= iFodoOff + 2) { -<a name="l01362"></a>01362 <span class="keywordflow">switch</span> (usGetWord(iFodo + iFodoOff, aucGrpprl)) { -<a name="l01363"></a>01363 <span class="preprocessor">#if 0</span> -<a name="l01364"></a>01364 <span class="preprocessor"></span> <span class="keywordflow">case</span> 0x0806: <span class="comment">/* fData */</span> -<a name="l01365"></a>01365 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01366"></a>01366 <span class="keywordflow">if</span> (ucTmp == 0x01) { -<a name="l01367"></a>01367 <span class="comment">/* Not a picture, but a form field */</span> -<a name="l01368"></a>01368 <span class="keywordflow">return</span> FALSE; -<a name="l01369"></a>01369 } -<a name="l01370"></a>01370 DBG_DEC_C(ucTmp != 0, ucTmp); -<a name="l01371"></a>01371 <span class="keywordflow">break</span>; -<a name="l01372"></a>01372 <span class="preprocessor">#endif</span> -<a name="l01373"></a>01373 <span class="preprocessor"></span> <span class="keywordflow">case</span> 0x080a: <span class="comment">/* fOle2 */</span> -<a name="l01374"></a>01374 ucTmp = ucGetByte(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01375"></a>01375 <span class="keywordflow">if</span> (ucTmp == 0x01) { -<a name="l01376"></a>01376 <span class="comment">/* Not a picture, but an OLE object */</span> -<a name="l01377"></a>01377 <span class="keywordflow">return</span> FALSE; -<a name="l01378"></a>01378 } -<a name="l01379"></a>01379 DBG_DEC_C(ucTmp != 0, ucTmp); -<a name="l01380"></a>01380 <span class="keywordflow">break</span>; -<a name="l01381"></a>01381 <span class="keywordflow">case</span> 0x680e: <span class="comment">/* fcObj */</span> -<a name="l01382"></a>01382 ulTmp = ulGetLong(iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01383"></a>01383 DBG_HEX(ulTmp); -<a name="l01384"></a>01384 <span class="keywordflow">break</span>; -<a name="l01385"></a>01385 <span class="keywordflow">case</span> 0x6a03: <span class="comment">/* fcPic */</span> -<a name="l01386"></a>01386 pPicture->ulPictureOffset = ulGetLong( -<a name="l01387"></a>01387 iFodo + iFodoOff + 2, aucGrpprl); -<a name="l01388"></a>01388 bFound = TRUE; -<a name="l01389"></a>01389 <span class="keywordflow">break</span>; -<a name="l01390"></a>01390 <span class="keywordflow">default</span>: -<a name="l01391"></a>01391 <span class="keywordflow">break</span>; -<a name="l01392"></a>01392 } -<a name="l01393"></a>01393 iInfoLen = iGet8InfoLength(iFodo + iFodoOff, aucGrpprl); -<a name="l01394"></a>01394 fail(iInfoLen <= 0); -<a name="l01395"></a>01395 iFodoOff += iInfoLen; -<a name="l01396"></a>01396 } -<a name="l01397"></a>01397 <span class="keywordflow">return</span> bFound; -<a name="l01398"></a>01398 } <span class="comment">/* end of bGet8PicInfo */</span> -<a name="l01399"></a>01399 -<a name="l01400"></a>01400 <span class="comment">/*</span> -<a name="l01401"></a>01401 <span class="comment"> * Build the lists with Character Information for Word 8/9/10/11 files</span> -<a name="l01402"></a>01402 <span class="comment"> */</span> -<a name="l01403"></a>01403 <span class="keywordtype">void</span> -<a name="l01404"></a>01404 vGet8ChrInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l01405"></a>01405 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l01406"></a>01406 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l01407"></a>01407 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l01408"></a>01408 { -<a name="l01409"></a>01409 font_block_type tFont; -<a name="l01410"></a>01410 picture_block_type tPicture; -<a name="l01411"></a>01411 ULONG *aulCharPage; -<a name="l01412"></a>01412 UCHAR *aucBuffer; -<a name="l01413"></a>01413 ULONG ulFileOffset, ulCharPos, ulBeginCharInfo; -<a name="l01414"></a>01414 <span class="keywordtype">size_t</span> tCharInfoLen, tOffset, tLen; -<a name="l01415"></a>01415 <span class="keywordtype">int</span> iIndex, iIndex2, iRun, iFodo, iLen; -<a name="l01416"></a>01416 USHORT usIstd; -<a name="l01417"></a>01417 UCHAR aucFpage[BIG_BLOCK_SIZE]; -<a name="l01418"></a>01418 -<a name="l01419"></a>01419 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l01420"></a>01420 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l01421"></a>01421 -<a name="l01422"></a>01422 ulBeginCharInfo = ulGetLong(0xfa, aucHeader); <span class="comment">/* fcPlcfbteChpx */</span> -<a name="l01423"></a>01423 NO_DBG_HEX(ulBeginCharInfo); -<a name="l01424"></a>01424 tCharInfoLen = (size_t)ulGetLong(0xfe, aucHeader); <span class="comment">/* lcbPlcfbteChpx */</span> -<a name="l01425"></a>01425 NO_DBG_DEC(tCharInfoLen); -<a name="l01426"></a>01426 <span class="keywordflow">if</span> (tCharInfoLen < 4) { -<a name="l01427"></a>01427 DBG_DEC(tCharInfoLen); -<a name="l01428"></a>01428 <span class="keywordflow">return</span>; -<a name="l01429"></a>01429 } -<a name="l01430"></a>01430 -<a name="l01431"></a>01431 aucBuffer = aucFillInfoBuffer(pFile, &pPPS->tTable, -<a name="l01432"></a>01432 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l01433"></a>01433 ulBeginCharInfo, tCharInfoLen); -<a name="l01434"></a>01434 <span class="keywordflow">if</span> (aucBuffer == NULL) { -<a name="l01435"></a>01435 <span class="keywordflow">return</span>; -<a name="l01436"></a>01436 } -<a name="l01437"></a>01437 NO_DBG_PRINT_BLOCK(aucBuffer, tCharInfoLen); -<a name="l01438"></a>01438 -<a name="l01439"></a>01439 tLen = (tCharInfoLen / 4 - 1) / 2; -<a name="l01440"></a>01440 aulCharPage = xcalloc(tLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l01441"></a>01441 <span class="keywordflow">for</span> (iIndex = 0, tOffset = (tLen + 1) * 4; -<a name="l01442"></a>01442 iIndex < (int)tLen; -<a name="l01443"></a>01443 iIndex++, tOffset += 4) { -<a name="l01444"></a>01444 aulCharPage[iIndex] = ulGetLong(tOffset, aucBuffer); -<a name="l01445"></a>01445 NO_DBG_DEC(aulCharPage[iIndex]); -<a name="l01446"></a>01446 } -<a name="l01447"></a>01447 DBG_HEX(ulGetLong(0, aucBuffer)); -<a name="l01448"></a>01448 aucBuffer = xfree(aucBuffer); -<a name="l01449"></a>01449 NO_DBG_PRINT_BLOCK(aucHeader, HEADER_SIZE); -<a name="l01450"></a>01450 -<a name="l01451"></a>01451 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tLen; iIndex++) { -<a name="l01452"></a>01452 fail(aulCharPage[iIndex] > ULONG_MAX / BIG_BLOCK_SIZE); -<a name="l01453"></a>01453 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tWordDocument.ulSB, -<a name="l01454"></a>01454 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l01455"></a>01455 aucFpage, -<a name="l01456"></a>01456 aulCharPage[iIndex] * BIG_BLOCK_SIZE, -<a name="l01457"></a>01457 BIG_BLOCK_SIZE)) { -<a name="l01458"></a>01458 <span class="keywordflow">break</span>; -<a name="l01459"></a>01459 } -<a name="l01460"></a>01460 NO_DBG_PRINT_BLOCK(aucFpage, BIG_BLOCK_SIZE); -<a name="l01461"></a>01461 iRun = (int)ucGetByte(0x1ff, aucFpage); -<a name="l01462"></a>01462 NO_DBG_DEC(iRun); -<a name="l01463"></a>01463 <span class="keywordflow">for</span> (iIndex2 = 0; iIndex2 < iRun; iIndex2++) { -<a name="l01464"></a>01464 ulCharPos = ulGetLong(iIndex2 * 4, aucFpage); -<a name="l01465"></a>01465 ulFileOffset = ulCharPos2FileOffset(ulCharPos); -<a name="l01466"></a>01466 iFodo = 2 * (int)ucGetByte( -<a name="l01467"></a>01467 (iRun + 1) * 4 + iIndex2, aucFpage); -<a name="l01468"></a>01468 -<a name="l01469"></a>01469 iLen = (int)ucGetByte(iFodo, aucFpage); -<a name="l01470"></a>01470 -<a name="l01471"></a>01471 usIstd = usGetIstd(ulFileOffset); -<a name="l01472"></a>01472 vFillFontFromStylesheet(usIstd, &tFont); -<a name="l01473"></a>01473 <span class="keywordflow">if</span> (iFodo != 0) { -<a name="l01474"></a>01474 vGet8FontInfo(iFodo, usIstd, -<a name="l01475"></a>01475 aucFpage + 1, iLen - 1, &tFont); -<a name="l01476"></a>01476 } -<a name="l01477"></a>01477 tFont.ulFileOffset = ulFileOffset; -<a name="l01478"></a>01478 vAdd2FontInfoList(&tFont); -<a name="l01479"></a>01479 -<a name="l01480"></a>01480 <span class="keywordflow">if</span> (iFodo <= 0) { -<a name="l01481"></a>01481 <span class="keywordflow">continue</span>; -<a name="l01482"></a>01482 } -<a name="l01483"></a>01483 -<a name="l01484"></a>01484 (void)memset(&tPicture, 0, <span class="keyword">sizeof</span>(tPicture)); -<a name="l01485"></a>01485 <span class="keywordflow">if</span> (bGet8PicInfo(iFodo, aucFpage + 1, -<a name="l01486"></a>01486 iLen - 1, &tPicture)) { -<a name="l01487"></a>01487 tPicture.ulFileOffset = ulFileOffset; -<a name="l01488"></a>01488 tPicture.ulFileOffsetPicture = -<a name="l01489"></a>01489 ulDataPos2FileOffset( -<a name="l01490"></a>01490 tPicture.ulPictureOffset); -<a name="l01491"></a>01491 vAdd2PictInfoList(&tPicture); -<a name="l01492"></a>01492 } -<a name="l01493"></a>01493 } -<a name="l01494"></a>01494 } -<a name="l01495"></a>01495 aulCharPage = xfree(aulCharPage); -<a name="l01496"></a>01496 } <span class="comment">/* end of vGet8ChrInfo */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/properties_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/properties.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/properties.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * properties.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the properties information from a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * Build the lists with Property Information</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keywordtype">void</span> -<a name="l00018"></a>00018 vGetPropertyInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00019"></a>00019 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00020"></a>00020 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00021"></a>00021 <span class="keyword">const</span> UCHAR *aucHeader, <span class="keywordtype">int</span> iWordVersion) -<a name="l00022"></a>00022 { -<a name="l00023"></a>00023 options_type tOptions; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 TRACE_MSG(<span class="stringliteral">"vGetPropertyInfo"</span>); -<a name="l00026"></a>00026 -<a name="l00027"></a>00027 fail(pFile == NULL); -<a name="l00028"></a>00028 fail(pPPS == NULL && iWordVersion >= 6); -<a name="l00029"></a>00029 fail(aulBBD == NULL && tBBDLen != 0); -<a name="l00030"></a>00030 fail(aulSBD == NULL && tSBDLen != 0); -<a name="l00031"></a>00031 fail(aucHeader == NULL); -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Get the options */</span> -<a name="l00034"></a>00034 vGetOptions(&tOptions); -<a name="l00035"></a>00035 -<a name="l00036"></a>00036 <span class="comment">/* Get the property information per Word version */</span> -<a name="l00037"></a>00037 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00038"></a>00038 <span class="keywordflow">case</span> 0: -<a name="l00039"></a>00039 vGet0DopInfo(pFile, aucHeader); -<a name="l00040"></a>00040 vGet0SepInfo(pFile, aucHeader); -<a name="l00041"></a>00041 vGet0PapInfo(pFile, aucHeader); -<a name="l00042"></a>00042 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00043"></a>00043 tOptions.eConversionType == conversion_ps || -<a name="l00044"></a>00044 tOptions.eConversionType == conversion_xml || -<a name="l00045"></a>00045 tOptions.eConversionType == conversion_fmt_text || -<a name="l00046"></a>00046 tOptions.eConversionType == conversion_pdf) { -<a name="l00047"></a>00047 vGet0ChrInfo(pFile, aucHeader); -<a name="l00048"></a>00048 } -<a name="l00049"></a>00049 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00050"></a>00050 tOptions.eConversionType == conversion_ps || -<a name="l00051"></a>00051 tOptions.eConversionType == conversion_pdf) { -<a name="l00052"></a>00052 vCreate0FontTable(); -<a name="l00053"></a>00053 } -<a name="l00054"></a>00054 vSet0SummaryInfo(pFile, aucHeader); -<a name="l00055"></a>00055 <span class="keywordflow">break</span>; -<a name="l00056"></a>00056 <span class="keywordflow">case</span> 1: -<a name="l00057"></a>00057 <span class="keywordflow">case</span> 2: -<a name="l00058"></a>00058 vGet2Stylesheet(pFile, iWordVersion, aucHeader); -<a name="l00059"></a>00059 vGet2DopInfo(pFile, aucHeader); -<a name="l00060"></a>00060 vGet2SepInfo(pFile, aucHeader); -<a name="l00061"></a>00061 vGet2PapInfo(pFile, aucHeader); -<a name="l00062"></a>00062 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_ps || -<a name="l00063"></a>00063 tOptions.eConversionType == conversion_pdf) { -<a name="l00064"></a>00064 vGet2HdrFtrInfo(pFile, aucHeader); -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00067"></a>00067 tOptions.eConversionType == conversion_ps || -<a name="l00068"></a>00068 tOptions.eConversionType == conversion_xml || -<a name="l00069"></a>00069 tOptions.eConversionType == conversion_fmt_text || -<a name="l00070"></a>00070 tOptions.eConversionType == conversion_pdf) { -<a name="l00071"></a>00071 vGet2ChrInfo(pFile, iWordVersion, aucHeader); -<a name="l00072"></a>00072 } -<a name="l00073"></a>00073 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00074"></a>00074 tOptions.eConversionType == conversion_ps || -<a name="l00075"></a>00075 tOptions.eConversionType == conversion_pdf) { -<a name="l00076"></a>00076 vCreate2FontTable(pFile, iWordVersion, aucHeader); -<a name="l00077"></a>00077 } -<a name="l00078"></a>00078 vSet2SummaryInfo(pFile, iWordVersion, aucHeader); -<a name="l00079"></a>00079 <span class="keywordflow">break</span>; -<a name="l00080"></a>00080 <span class="keywordflow">case</span> 4: -<a name="l00081"></a>00081 <span class="keywordflow">case</span> 5: -<a name="l00082"></a>00082 <span class="keywordflow">break</span>; -<a name="l00083"></a>00083 <span class="keywordflow">case</span> 6: -<a name="l00084"></a>00084 <span class="keywordflow">case</span> 7: -<a name="l00085"></a>00085 vGet6Stylesheet(pFile, pPPS->tWordDocument.ulSB, -<a name="l00086"></a>00086 aulBBD, tBBDLen, aucHeader); -<a name="l00087"></a>00087 vGet6DopInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00088"></a>00088 aulBBD, tBBDLen, aucHeader); -<a name="l00089"></a>00089 vGet6SepInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00090"></a>00090 aulBBD, tBBDLen, aucHeader); -<a name="l00091"></a>00091 vGet6PapInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00092"></a>00092 aulBBD, tBBDLen, aucHeader); -<a name="l00093"></a>00093 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_ps || -<a name="l00094"></a>00094 tOptions.eConversionType == conversion_pdf) { -<a name="l00095"></a>00095 vGet6HdrFtrInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00096"></a>00096 aulBBD, tBBDLen, aucHeader); -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00099"></a>00099 tOptions.eConversionType == conversion_ps || -<a name="l00100"></a>00100 tOptions.eConversionType == conversion_xml || -<a name="l00101"></a>00101 tOptions.eConversionType == conversion_fmt_text || -<a name="l00102"></a>00102 tOptions.eConversionType == conversion_pdf) { -<a name="l00103"></a>00103 vGet6ChrInfo(pFile, pPPS->tWordDocument.ulSB, -<a name="l00104"></a>00104 aulBBD, tBBDLen, aucHeader); -<a name="l00105"></a>00105 } -<a name="l00106"></a>00106 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00107"></a>00107 tOptions.eConversionType == conversion_ps || -<a name="l00108"></a>00108 tOptions.eConversionType == conversion_pdf) { -<a name="l00109"></a>00109 vCreate6FontTable(pFile, pPPS->tWordDocument.ulSB, -<a name="l00110"></a>00110 aulBBD, tBBDLen, aucHeader); -<a name="l00111"></a>00111 } -<a name="l00112"></a>00112 vSet6SummaryInfo(pFile, pPPS, -<a name="l00113"></a>00113 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00114"></a>00114 <span class="keywordflow">break</span>; -<a name="l00115"></a>00115 <span class="keywordflow">case</span> 8: -<a name="l00116"></a>00116 vGet8LstInfo(pFile, pPPS, -<a name="l00117"></a>00117 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00118"></a>00118 vGet8Stylesheet(pFile, pPPS, -<a name="l00119"></a>00119 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00120"></a>00120 vGet8DopInfo(pFile, &pPPS->tTable, -<a name="l00121"></a>00121 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00122"></a>00122 vGet8SepInfo(pFile, pPPS, -<a name="l00123"></a>00123 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00124"></a>00124 vGet8PapInfo(pFile, pPPS, -<a name="l00125"></a>00125 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00126"></a>00126 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_ps || -<a name="l00127"></a>00127 tOptions.eConversionType == conversion_pdf) { -<a name="l00128"></a>00128 vGet8HdrFtrInfo(pFile, &pPPS->tTable, -<a name="l00129"></a>00129 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00130"></a>00130 } -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00132"></a>00132 tOptions.eConversionType == conversion_ps || -<a name="l00133"></a>00133 tOptions.eConversionType == conversion_xml || -<a name="l00134"></a>00134 tOptions.eConversionType == conversion_fmt_text || -<a name="l00135"></a>00135 tOptions.eConversionType == conversion_pdf) { -<a name="l00136"></a>00136 vGet8ChrInfo(pFile, pPPS, -<a name="l00137"></a>00137 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00138"></a>00138 } -<a name="l00139"></a>00139 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_draw || -<a name="l00140"></a>00140 tOptions.eConversionType == conversion_ps || -<a name="l00141"></a>00141 tOptions.eConversionType == conversion_pdf) { -<a name="l00142"></a>00142 vCreate8FontTable(pFile, pPPS, -<a name="l00143"></a>00143 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 vSet8SummaryInfo(pFile, pPPS, -<a name="l00146"></a>00146 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00147"></a>00147 <span class="keywordflow">break</span>; -<a name="l00148"></a>00148 <span class="keywordflow">default</span>: -<a name="l00149"></a>00149 DBG_DEC(iWordVersion); -<a name="l00150"></a>00150 DBG_FIXME(); -<a name="l00151"></a>00151 werr(0, <span class="stringliteral">"Sorry, no property information"</span>); -<a name="l00152"></a>00152 <span class="keywordflow">break</span>; -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 -<a name="l00155"></a>00155 <span class="comment">/* Temporarily: Correct the font table */</span> -<a name="l00156"></a>00156 vCorrectFontTable(tOptions.eConversionType, tOptions.eEncoding); -<a name="l00157"></a>00157 } <span class="comment">/* end of vGetPropertyInfo */</span> -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 <span class="comment">/*</span> -<a name="l00160"></a>00160 <span class="comment"> * ePropMod2RowInfo - Turn the Property Modifier into row information</span> -<a name="l00161"></a>00161 <span class="comment"> *</span> -<a name="l00162"></a>00162 <span class="comment"> * Returns: the row information</span> -<a name="l00163"></a>00163 <span class="comment"> */</span> -<a name="l00164"></a>00164 row_info_enum -<a name="l00165"></a>00165 ePropMod2RowInfo(USHORT usPropMod, <span class="keywordtype">int</span> iWordVersion) -<a name="l00166"></a>00166 { -<a name="l00167"></a>00167 row_block_type tRow; -<a name="l00168"></a>00168 <span class="keyword">const</span> UCHAR *aucPropMod; -<a name="l00169"></a>00169 <span class="keywordtype">int</span> iLen; -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 TRACE_MSG(<span class="stringliteral">"ePropMod2RowInfo"</span>); -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 aucPropMod = aucReadPropModListItem(usPropMod); -<a name="l00174"></a>00174 <span class="keywordflow">if</span> (aucPropMod == NULL) { -<a name="l00175"></a>00175 <span class="keywordflow">return</span> found_nothing; -<a name="l00176"></a>00176 } -<a name="l00177"></a>00177 iLen = (int)usGetWord(0, aucPropMod); -<a name="l00178"></a>00178 -<a name="l00179"></a>00179 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00180"></a>00180 <span class="keywordflow">case</span> 0: -<a name="l00181"></a>00181 <span class="keywordflow">return</span> found_nothing; -<a name="l00182"></a>00182 <span class="keywordflow">case</span> 1: -<a name="l00183"></a>00183 <span class="keywordflow">case</span> 2: -<a name="l00184"></a>00184 <span class="keywordflow">return</span> eGet2RowInfo(0, aucPropMod + 2, iLen, &tRow); -<a name="l00185"></a>00185 <span class="keywordflow">case</span> 4: -<a name="l00186"></a>00186 <span class="keywordflow">case</span> 5: -<a name="l00187"></a>00187 <span class="keywordflow">return</span> found_nothing; -<a name="l00188"></a>00188 <span class="keywordflow">case</span> 6: -<a name="l00189"></a>00189 <span class="keywordflow">case</span> 7: -<a name="l00190"></a>00190 <span class="keywordflow">return</span> eGet6RowInfo(0, aucPropMod + 2, iLen, &tRow); -<a name="l00191"></a>00191 <span class="keywordflow">case</span> 8: -<a name="l00192"></a>00192 <span class="keywordflow">return</span> eGet8RowInfo(0, aucPropMod + 2, iLen, &tRow); -<a name="l00193"></a>00193 <span class="keywordflow">default</span>: -<a name="l00194"></a>00194 DBG_DEC(iWordVersion); -<a name="l00195"></a>00195 DBG_FIXME(); -<a name="l00196"></a>00196 <span class="keywordflow">return</span> found_nothing; -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 } <span class="comment">/* end of ePropMod2RowInfo */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/propmod_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/propmod.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/propmod.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * propmod.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001-2003 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list (array) of Word property modifiers</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define ELEMENTS_TO_ADD 3</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define ELEMENTS_TO_ADD 30</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 <span class="comment">/* Variables needed to write the property modifier list */</span> -<a name="l00020"></a>00020 <span class="keyword">static</span> UCHAR **ppAnchor = NULL; -<a name="l00021"></a>00021 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tNextFree = 0; -<a name="l00022"></a>00022 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tMaxElements = 0; -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="comment">/*</span> -<a name="l00026"></a>00026 <span class="comment"> * vDestroyPropModList - destroy the property modifier list</span> -<a name="l00027"></a>00027 <span class="comment"> */</span> -<a name="l00028"></a>00028 <span class="keywordtype">void</span> -<a name="l00029"></a>00029 vDestroyPropModList(<span class="keywordtype">void</span>) -<a name="l00030"></a>00030 { -<a name="l00031"></a>00031 <span class="keywordtype">size_t</span> tIndex; -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 DBG_MSG(<span class="stringliteral">"vDestroyPropModList"</span>); -<a name="l00034"></a>00034 -<a name="l00035"></a>00035 <span class="comment">/* Free all the elements of the list */</span> -<a name="l00036"></a>00036 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tNextFree; tIndex++) { -<a name="l00037"></a>00037 ppAnchor[tIndex] = xfree(ppAnchor[tIndex]); -<a name="l00038"></a>00038 } -<a name="l00039"></a>00039 <span class="comment">/* Free the list itself */</span> -<a name="l00040"></a>00040 ppAnchor = xfree(ppAnchor); -<a name="l00041"></a>00041 <span class="comment">/* Reset all control variables */</span> -<a name="l00042"></a>00042 tNextFree = 0; -<a name="l00043"></a>00043 tMaxElements = 0; -<a name="l00044"></a>00044 } <span class="comment">/* end of vDestroyPropModList */</span> -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/*</span> -<a name="l00047"></a>00047 <span class="comment"> * vAdd2PropModList - add an element to the property modifier list</span> -<a name="l00048"></a>00048 <span class="comment"> */</span> -<a name="l00049"></a>00049 <span class="keywordtype">void</span> -<a name="l00050"></a>00050 vAdd2PropModList(<span class="keyword">const</span> UCHAR *aucPropMod) -<a name="l00051"></a>00051 { -<a name="l00052"></a>00052 <span class="keywordtype">size_t</span> tSize, tLen; -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 fail(aucPropMod == NULL); -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 NO_DBG_MSG(<span class="stringliteral">"vAdd2PropModList"</span>); -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="keywordflow">if</span> (tNextFree >= tMaxElements) { -<a name="l00059"></a>00059 tMaxElements += ELEMENTS_TO_ADD; -<a name="l00060"></a>00060 tSize = tMaxElements * <span class="keyword">sizeof</span>(UCHAR **); -<a name="l00061"></a>00061 ppAnchor = xrealloc(ppAnchor, tSize); -<a name="l00062"></a>00062 } -<a name="l00063"></a>00063 NO_DBG_DEC(tNextFree); -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 tLen = 2 + (size_t)usGetWord(0, aucPropMod); -<a name="l00066"></a>00066 NO_DBG_HEX(tLen); -<a name="l00067"></a>00067 NO_DBG_PRINT_BLOCK(pucPropMod, tLen); -<a name="l00068"></a>00068 ppAnchor[tNextFree] = xmalloc(tLen); -<a name="l00069"></a>00069 memcpy(ppAnchor[tNextFree], aucPropMod, tLen); -<a name="l00070"></a>00070 tNextFree++; -<a name="l00071"></a>00071 } <span class="comment">/* end of vAdd2PropModList */</span> -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 <span class="comment">/*</span> -<a name="l00074"></a>00074 <span class="comment"> * aucReadPropModListItem - get an item of the property modifier list</span> -<a name="l00075"></a>00075 <span class="comment"> */</span> -<a name="l00076"></a>00076 <span class="keyword">const</span> UCHAR * -<a name="l00077"></a>00077 aucReadPropModListItem(USHORT usPropMod) -<a name="l00078"></a>00078 { -<a name="l00079"></a>00079 <span class="keyword">static</span> UCHAR aucBuffer[4]; -<a name="l00080"></a>00080 <span class="keywordtype">size_t</span> tIndex; -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="keywordflow">if</span> (usPropMod == IGNORE_PROPMOD) { -<a name="l00083"></a>00083 <span class="comment">/* This Properties Modifier must be ignored */</span> -<a name="l00084"></a>00084 <span class="keywordflow">return</span> NULL; -<a name="l00085"></a>00085 } -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (!odd(usPropMod)) { -<a name="l00088"></a>00088 <span class="comment">/* Variant 1: The information is in the input ifself */</span> -<a name="l00089"></a>00089 aucBuffer[0] = 2; -<a name="l00090"></a>00090 aucBuffer[1] = 0; -<a name="l00091"></a>00091 aucBuffer[2] = (UCHAR)((usPropMod & 0x00fe) >> 1); -<a name="l00092"></a>00092 aucBuffer[3] = (UCHAR)((usPropMod & 0xff00) >> 8); -<a name="l00093"></a>00093 <span class="keywordflow">return</span> aucBuffer; -<a name="l00094"></a>00094 } -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="keywordflow">if</span> (ppAnchor == NULL) { -<a name="l00097"></a>00097 <span class="comment">/* No information available */</span> -<a name="l00098"></a>00098 <span class="keywordflow">return</span> NULL; -<a name="l00099"></a>00099 } -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 <span class="comment">/* Variant 2: The input contains an index */</span> -<a name="l00102"></a>00102 tIndex = (size_t)(usPropMod >> 1); -<a name="l00103"></a>00103 <span class="keywordflow">if</span> (tIndex >= tNextFree) { -<a name="l00104"></a>00104 DBG_HEX(usPropMod); -<a name="l00105"></a>00105 DBG_DEC(tIndex); -<a name="l00106"></a>00106 DBG_DEC(tNextFree); -<a name="l00107"></a>00107 <span class="keywordflow">return</span> NULL; -<a name="l00108"></a>00108 } -<a name="l00109"></a>00109 <span class="keywordflow">return</span> ppAnchor[tIndex]; -<a name="l00110"></a>00110 } <span class="comment">/* end of aucGetPropModListItem */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/riscos_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,267 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/riscos.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/riscos.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * riscos.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001,2002 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * RISC OS only functions</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <stdarg.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "DeskLib:SWI.h"</span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 <span class="preprocessor">#if !defined(DrawFile_Render)</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define DrawFile_Render 0x045540</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !DrawFile_Render */</span> -<a name="l00019"></a>00019 <span class="preprocessor">#if !defined(JPEG_Info)</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define JPEG_Info 0x049980</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !JPEG_Info */</span> -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 <span class="comment">/*</span> -<a name="l00024"></a>00024 <span class="comment"> * werr - write an error message and exit if needed</span> -<a name="l00025"></a>00025 <span class="comment"> */</span> -<a name="l00026"></a>00026 <span class="keywordtype">void</span> -<a name="l00027"></a>00027 werr(<span class="keywordtype">int</span> iFatal, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFormat, ...) -<a name="l00028"></a>00028 { -<a name="l00029"></a>00029 va_list tArg; -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 va_start(tArg, szFormat); -<a name="l00032"></a>00032 Error_Report(iFatal, (<span class="keywordtype">char</span> *)szFormat, tArg); -<a name="l00033"></a>00033 va_end(tArg); -<a name="l00034"></a>00034 <span class="keywordflow">switch</span> (iFatal) { -<a name="l00035"></a>00035 <span class="keywordflow">case</span> 0: <span class="comment">/* The message is just a warning, so no exit */</span> -<a name="l00036"></a>00036 <span class="keywordflow">return</span>; -<a name="l00037"></a>00037 <span class="keywordflow">case</span> 1: <span class="comment">/* Fatal error with a standard exit */</span> -<a name="l00038"></a>00038 exit(EXIT_FAILURE); -<a name="l00039"></a>00039 <span class="keywordflow">default</span>: <span class="comment">/* Fatal error with a non-standard exit */</span> -<a name="l00040"></a>00040 exit(iFatal); -<a name="l00041"></a>00041 } -<a name="l00042"></a>00042 } <span class="comment">/* end of werr */</span> -<a name="l00043"></a>00043 -<a name="l00044"></a>00044 <span class="comment">/*</span> -<a name="l00045"></a>00045 <span class="comment"> * iGetFiletype</span> -<a name="l00046"></a>00046 <span class="comment"> * This function will get the filetype of the given file.</span> -<a name="l00047"></a>00047 <span class="comment"> * returns the filetype.</span> -<a name="l00048"></a>00048 <span class="comment"> */</span> -<a name="l00049"></a>00049 <span class="keywordtype">int</span> -<a name="l00050"></a>00050 iGetFiletype(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00051"></a>00051 { -<a name="l00052"></a>00052 os_error *e; -<a name="l00053"></a>00053 <span class="keywordtype">int</span> iType; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 e = SWI(2, 7, SWI_OS_File | XOS_Bit, -<a name="l00058"></a>00058 23, szFilename, -<a name="l00059"></a>00059 NULL, NULL, NULL, NULL, NULL, NULL, &iType); -<a name="l00060"></a>00060 <span class="keywordflow">if</span> (e == NULL) { -<a name="l00061"></a>00061 <span class="keywordflow">return</span> iType; -<a name="l00062"></a>00062 } -<a name="l00063"></a>00063 werr(0, <span class="stringliteral">"Get Filetype error %d: %s"</span>, e->errnum, e->errmess); -<a name="l00064"></a>00064 <span class="keywordflow">return</span> -1; -<a name="l00065"></a>00065 } <span class="comment">/* end of iGetFiletype */</span> -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 <span class="comment">/*</span> -<a name="l00068"></a>00068 <span class="comment"> * vSetFiletype</span> -<a name="l00069"></a>00069 <span class="comment"> * This procedure will set the filetype of the given file to the given</span> -<a name="l00070"></a>00070 <span class="comment"> * type.</span> -<a name="l00071"></a>00071 <span class="comment"> */</span> -<a name="l00072"></a>00072 <span class="keywordtype">void</span> -<a name="l00073"></a>00073 vSetFiletype(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename, <span class="keywordtype">int</span> iFiletype) -<a name="l00074"></a>00074 { -<a name="l00075"></a>00075 os_error *e; -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 <span class="keywordflow">if</span> (iFiletype < 0x000 || iFiletype > 0xfff) { -<a name="l00080"></a>00080 <span class="keywordflow">return</span>; -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 e = SWI(3, 0, SWI_OS_File | XOS_Bit, -<a name="l00083"></a>00083 18, szFilename, iFiletype); -<a name="l00084"></a>00084 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00085"></a>00085 <span class="keywordflow">switch</span> (e->errnum) { -<a name="l00086"></a>00086 <span class="keywordflow">case</span> 0x000113: <span class="comment">/* ROM */</span> -<a name="l00087"></a>00087 <span class="keywordflow">case</span> 0x0104e1: <span class="comment">/* Read-only floppy DOSFS */</span> -<a name="l00088"></a>00088 <span class="keywordflow">case</span> 0x0108c9: <span class="comment">/* Read-only floppy ADFS */</span> -<a name="l00089"></a>00089 <span class="keywordflow">case</span> 0x013803: <span class="comment">/* Read-only ArcFS */</span> -<a name="l00090"></a>00090 <span class="keywordflow">case</span> 0x80344a: <span class="comment">/* CD-ROM */</span> -<a name="l00091"></a>00091 <span class="keywordflow">break</span>; -<a name="l00092"></a>00092 <span class="keywordflow">default</span>: -<a name="l00093"></a>00093 werr(0, <span class="stringliteral">"Set Filetype error %d: %s"</span>, -<a name="l00094"></a>00094 e->errnum, e->errmess); -<a name="l00095"></a>00095 <span class="keywordflow">break</span>; -<a name="l00096"></a>00096 } -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 } <span class="comment">/* end of vSetFileType */</span> -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 <span class="comment">/*</span> -<a name="l00101"></a>00101 <span class="comment"> * Check if the directory part of the given file exists, make the directory</span> -<a name="l00102"></a>00102 <span class="comment"> * if it does not exist yet.</span> -<a name="l00103"></a>00103 <span class="comment"> * Returns TRUE in case of success, otherwise FALSE.</span> -<a name="l00104"></a>00104 <span class="comment"> */</span> -<a name="l00105"></a>00105 BOOL -<a name="l00106"></a>00106 bMakeDirectory(<span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00107"></a>00107 { -<a name="l00108"></a>00108 os_error *e; -<a name="l00109"></a>00109 <span class="keywordtype">char</span> *pcLastDot; -<a name="l00110"></a>00110 <span class="keywordtype">int</span> iObjectType; -<a name="l00111"></a>00111 <span class="keywordtype">char</span> szDirectory[PATH_MAX+1]; -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 DBG_MSG(<span class="stringliteral">"bMakeDirectory"</span>); -<a name="l00114"></a>00114 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00115"></a>00115 DBG_MSG(szFilename); -<a name="l00116"></a>00116 -<a name="l00117"></a>00117 <span class="keywordflow">if</span> (strlen(szFilename) >= <span class="keyword">sizeof</span>(szDirectory)) { -<a name="l00118"></a>00118 DBG_DEC(strlen(szFilename)); -<a name="l00119"></a>00119 <span class="keywordflow">return</span> FALSE; -<a name="l00120"></a>00120 } -<a name="l00121"></a>00121 strcpy(szDirectory, szFilename); -<a name="l00122"></a>00122 pcLastDot = strrchr(szDirectory, <span class="charliteral">'.'</span>); -<a name="l00123"></a>00123 <span class="keywordflow">if</span> (pcLastDot == NULL) { -<a name="l00124"></a>00124 <span class="comment">/* No directory equals current directory */</span> -<a name="l00125"></a>00125 DBG_MSG(<span class="stringliteral">"No directory part given"</span>); -<a name="l00126"></a>00126 <span class="keywordflow">return</span> TRUE; -<a name="l00127"></a>00127 } -<a name="l00128"></a>00128 *pcLastDot = <span class="charliteral">'\0'</span>; -<a name="l00129"></a>00129 DBG_MSG(szDirectory); -<a name="l00130"></a>00130 <span class="comment">/* Check if the name exists */</span> -<a name="l00131"></a>00131 e = SWI(2, 1, SWI_OS_File | XOS_Bit, -<a name="l00132"></a>00132 17, szDirectory, -<a name="l00133"></a>00133 &iObjectType); -<a name="l00134"></a>00134 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00135"></a>00135 werr(0, <span class="stringliteral">"Directory check %d: %s"</span>, e->errnum, e->errmess); -<a name="l00136"></a>00136 <span class="keywordflow">return</span> FALSE; -<a name="l00137"></a>00137 } -<a name="l00138"></a>00138 <span class="keywordflow">if</span> (iObjectType == 2) { -<a name="l00139"></a>00139 <span class="comment">/* The name exists and it is a directory */</span> -<a name="l00140"></a>00140 DBG_MSG(<span class="stringliteral">"The directory already exists"</span>); -<a name="l00141"></a>00141 <span class="keywordflow">return</span> TRUE; -<a name="l00142"></a>00142 } -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (iObjectType != 0) { -<a name="l00144"></a>00144 <span class="comment">/* The name exists and it is not a directory */</span> -<a name="l00145"></a>00145 DBG_DEC(iObjectType); -<a name="l00146"></a>00146 <span class="keywordflow">return</span> FALSE; -<a name="l00147"></a>00147 } -<a name="l00148"></a>00148 <span class="comment">/* The name does not exist, make the directory */</span> -<a name="l00149"></a>00149 e = SWI(5, 0, SWI_OS_File | XOS_Bit, -<a name="l00150"></a>00150 8, szDirectory, 0, 0, 0); -<a name="l00151"></a>00151 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00152"></a>00152 werr(0, <span class="stringliteral">"I can't make a directory %d: %s"</span>, -<a name="l00153"></a>00153 e->errnum, e->errmess); -<a name="l00154"></a>00154 <span class="keywordflow">return</span> FALSE; -<a name="l00155"></a>00155 } -<a name="l00156"></a>00156 <span class="keywordflow">return</span> TRUE; -<a name="l00157"></a>00157 } <span class="comment">/* end of bMakeDirectory */</span> -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 <span class="comment">/*</span> -<a name="l00160"></a>00160 <span class="comment"> * iReadCurrentAlphabetNumber</span> -<a name="l00161"></a>00161 <span class="comment"> * This function reads the current Alphabet number.</span> -<a name="l00162"></a>00162 <span class="comment"> * Returns the current Alphabet number when successful, otherwise -1</span> -<a name="l00163"></a>00163 <span class="comment"> */</span> -<a name="l00164"></a>00164 <span class="keywordtype">int</span> -<a name="l00165"></a>00165 iReadCurrentAlphabetNumber(<span class="keywordtype">void</span>) -<a name="l00166"></a>00166 { -<a name="l00167"></a>00167 os_error *e; -<a name="l00168"></a>00168 <span class="keywordtype">int</span> iAlphabetNumber; -<a name="l00169"></a>00169 -<a name="l00170"></a>00170 e = SWI(2, 2, SWI_OS_Byte | XOS_Bit, -<a name="l00171"></a>00171 71, 127, -<a name="l00172"></a>00172 NULL, &iAlphabetNumber); -<a name="l00173"></a>00173 <span class="keywordflow">if</span> (e == NULL) { -<a name="l00174"></a>00174 <span class="keywordflow">return</span> iAlphabetNumber; -<a name="l00175"></a>00175 } -<a name="l00176"></a>00176 werr(0, <span class="stringliteral">"Read alphabet error %d: %s"</span>, e->errnum, e->errmess); -<a name="l00177"></a>00177 <span class="keywordflow">return</span> -1; -<a name="l00178"></a>00178 } <span class="comment">/* end of iReadCurrentAlphabetNumber */</span> -<a name="l00179"></a>00179 -<a name="l00180"></a>00180 <span class="comment">/*</span> -<a name="l00181"></a>00181 <span class="comment"> * iGetRiscOsVersion - get the RISC OS version number</span> -<a name="l00182"></a>00182 <span class="comment"> *</span> -<a name="l00183"></a>00183 <span class="comment"> * returns the RISC OS version * 100</span> -<a name="l00184"></a>00184 <span class="comment"> */</span> -<a name="l00185"></a>00185 <span class="keywordtype">int</span> -<a name="l00186"></a>00186 iGetRiscOsVersion(<span class="keywordtype">void</span>) -<a name="l00187"></a>00187 { -<a name="l00188"></a>00188 os_error *e; -<a name="l00189"></a>00189 <span class="keywordtype">int</span> iVersion; -<a name="l00190"></a>00190 -<a name="l00191"></a>00191 e = SWI(3, 2, SWI_OS_Byte | XOS_Bit, -<a name="l00192"></a>00192 129, 0, 0xff, -<a name="l00193"></a>00193 NULL, &iVersion); -<a name="l00194"></a>00194 <span class="keywordflow">if</span> (e != NULL) { -<a name="l00195"></a>00195 werr(0, <span class="stringliteral">"Read RISC OS version error %d: %s"</span>, -<a name="l00196"></a>00196 e->errnum, e->errmess); -<a name="l00197"></a>00197 <span class="keywordflow">return</span> 0; -<a name="l00198"></a>00198 } -<a name="l00199"></a>00199 <span class="keywordflow">switch</span> (iVersion) { -<a name="l00200"></a>00200 <span class="keywordflow">case</span> 0xa0: <span class="comment">/* Arthur 1.20 */</span> -<a name="l00201"></a>00201 <span class="keywordflow">return</span> 120; -<a name="l00202"></a>00202 <span class="keywordflow">case</span> 0xa1: <span class="comment">/* RISC OS 2.00 */</span> -<a name="l00203"></a>00203 <span class="keywordflow">return</span> 200; -<a name="l00204"></a>00204 <span class="keywordflow">case</span> 0xa2: <span class="comment">/* RISC OS 2.01 */</span> -<a name="l00205"></a>00205 <span class="keywordflow">return</span> 201; -<a name="l00206"></a>00206 <span class="keywordflow">case</span> 0xa3: <span class="comment">/* RISC OS 3.00 */</span> -<a name="l00207"></a>00207 <span class="keywordflow">return</span> 300; -<a name="l00208"></a>00208 <span class="keywordflow">case</span> 0xa4: <span class="comment">/* RISC OS 3.1x */</span> -<a name="l00209"></a>00209 <span class="keywordflow">return</span> 310; -<a name="l00210"></a>00210 <span class="keywordflow">case</span> 0xa5: <span class="comment">/* RISC OS 3.50 */</span> -<a name="l00211"></a>00211 <span class="keywordflow">return</span> 350; -<a name="l00212"></a>00212 <span class="keywordflow">case</span> 0xa6: <span class="comment">/* RISC OS 3.60 */</span> -<a name="l00213"></a>00213 <span class="keywordflow">return</span> 360; -<a name="l00214"></a>00214 <span class="keywordflow">case</span> 0xa7: <span class="comment">/* RISC OS 3.7x */</span> -<a name="l00215"></a>00215 <span class="keywordflow">return</span> 370; -<a name="l00216"></a>00216 <span class="keywordflow">case</span> 0xa8: <span class="comment">/* RISC OS 4.0x */</span> -<a name="l00217"></a>00217 <span class="keywordflow">return</span> 400; -<a name="l00218"></a>00218 <span class="keywordflow">default</span>: -<a name="l00219"></a>00219 <span class="keywordflow">if</span> (iVersion >= 0xa9 && iVersion <= 0xaf) { -<a name="l00220"></a>00220 <span class="comment">/* RISC OS 4.10 and up */</span> -<a name="l00221"></a>00221 <span class="keywordflow">return</span> 410; -<a name="l00222"></a>00222 } -<a name="l00223"></a>00223 <span class="comment">/* Unknown version */</span> -<a name="l00224"></a>00224 <span class="keywordflow">return</span> 0; -<a name="l00225"></a>00225 } -<a name="l00226"></a>00226 } <span class="comment">/* end of iGetRiscOsVersion */</span> -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00229"></a>00229 <span class="preprocessor"></span>BOOL -<a name="l00230"></a>00230 bGetJpegInfo(UCHAR *pucJpeg, <span class="keywordtype">size_t</span> tJpegSize) -<a name="l00231"></a>00231 { -<a name="l00232"></a>00232 os_error *e; -<a name="l00233"></a>00233 <span class="keywordtype">int</span> iReg0, iReg4, iReg5; -<a name="l00234"></a>00234 -<a name="l00235"></a>00235 e = SWI(3, 6, JPEG_Info | XOS_Bit, -<a name="l00236"></a>00236 0x00, pucJpeg, tJpegSize, -<a name="l00237"></a>00237 &iReg0, NULL, NULL, NULL, &iReg4, &iReg5); -<a name="l00238"></a>00238 <span class="keywordflow">if</span> (e == NULL) { -<a name="l00239"></a>00239 <span class="keywordflow">if</span> (iReg0 & BIT(2)) { -<a name="l00240"></a>00240 DBG_MSG(<span class="stringliteral">"Pixel density is a simple ratio"</span>); -<a name="l00241"></a>00241 } <span class="keywordflow">else</span> { -<a name="l00242"></a>00242 DBG_MSG(<span class="stringliteral">"Pixel density is in dpi"</span>); -<a name="l00243"></a>00243 } -<a name="l00244"></a>00244 DBG_DEC(iReg4); -<a name="l00245"></a>00245 DBG_DEC(iReg5); -<a name="l00246"></a>00246 <span class="keywordflow">return</span> TRUE; -<a name="l00247"></a>00247 } -<a name="l00248"></a>00248 werr(0, <span class="stringliteral">"JPEG Info error %d: %s"</span>, e->errnum, e->errmess); -<a name="l00249"></a>00249 <span class="keywordflow">return</span> FALSE; -<a name="l00250"></a>00250 } <span class="comment">/* end of bGetJpegInfo */</span> -<a name="l00251"></a>00251 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/rowlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/rowlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/rowlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * rowlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word table-row information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/*</span> -<a name="l00014"></a>00014 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00015"></a>00015 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">typedef</span> <span class="keyword">struct </span>row_desc_tag { -<a name="l00018"></a>00018 row_block_type tInfo; -<a name="l00019"></a>00019 <span class="keyword">struct </span>row_desc_tag *pNext; -<a name="l00020"></a>00020 } row_desc_type; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* Variables needed to write the Row Information List */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> row_desc_type *pAnchor = NULL; -<a name="l00024"></a>00024 <span class="keyword">static</span> row_desc_type *pRowLast = NULL; -<a name="l00025"></a>00025 <span class="comment">/* Variable needed to read the Row Information List */</span> -<a name="l00026"></a>00026 <span class="keyword">static</span> row_desc_type *pRowCurrent = NULL; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="comment">/*</span> -<a name="l00030"></a>00030 <span class="comment"> * vDestroyRowInfoList - destroy the Row Information List</span> -<a name="l00031"></a>00031 <span class="comment"> */</span> -<a name="l00032"></a>00032 <span class="keywordtype">void</span> -<a name="l00033"></a>00033 vDestroyRowInfoList(<span class="keywordtype">void</span>) -<a name="l00034"></a>00034 { -<a name="l00035"></a>00035 row_desc_type *pCurr, *pNext; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 DBG_MSG(<span class="stringliteral">"vDestroyRowInfoList"</span>); -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 <span class="comment">/* Free the Row Information List */</span> -<a name="l00040"></a>00040 pCurr = pAnchor; -<a name="l00041"></a>00041 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00042"></a>00042 pNext = pCurr->pNext; -<a name="l00043"></a>00043 pCurr = xfree(pCurr); -<a name="l00044"></a>00044 pCurr = pNext; -<a name="l00045"></a>00045 } -<a name="l00046"></a>00046 pAnchor = NULL; -<a name="l00047"></a>00047 <span class="comment">/* Reset all control variables */</span> -<a name="l00048"></a>00048 pRowLast = NULL; -<a name="l00049"></a>00049 pRowCurrent = NULL; -<a name="l00050"></a>00050 } <span class="comment">/* end of vDestroyRowInfoList */</span> -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="comment">/*</span> -<a name="l00053"></a>00053 <span class="comment"> * vAdd2RowInfoList - Add an element to the Row Information List</span> -<a name="l00054"></a>00054 <span class="comment"> */</span> -<a name="l00055"></a>00055 <span class="keywordtype">void</span> -<a name="l00056"></a>00056 vAdd2RowInfoList(<span class="keyword">const</span> row_block_type *pRowBlock) -<a name="l00057"></a>00057 { -<a name="l00058"></a>00058 row_desc_type *pListMember; -<a name="l00059"></a>00059 <span class="keywordtype">short</span> *psTmp; -<a name="l00060"></a>00060 <span class="keywordtype">int</span> iIndex; -<a name="l00061"></a>00061 -<a name="l00062"></a>00062 fail(pRowBlock == NULL); -<a name="l00063"></a>00063 -<a name="l00064"></a>00064 <span class="keywordflow">if</span> (pRowBlock->ulFileOffsetStart == FC_INVALID || -<a name="l00065"></a>00065 pRowBlock->ulFileOffsetEnd == FC_INVALID || -<a name="l00066"></a>00066 pRowBlock->ulFileOffsetStart == pRowBlock->ulFileOffsetEnd) { -<a name="l00067"></a>00067 DBG_HEX_C(pRowBlock->ulFileOffsetStart != FC_INVALID, -<a name="l00068"></a>00068 pRowBlock->ulFileOffsetStart); -<a name="l00069"></a>00069 DBG_HEX_C(pRowBlock->ulFileOffsetEnd != FC_INVALID, -<a name="l00070"></a>00070 pRowBlock->ulFileOffsetEnd); -<a name="l00071"></a>00071 <span class="keywordflow">return</span>; -<a name="l00072"></a>00072 } -<a name="l00073"></a>00073 -<a name="l00074"></a>00074 NO_DBG_HEX(pRowBlock->ulFileOffsetStart); -<a name="l00075"></a>00075 NO_DBG_HEX(pRowBlock->ulFileOffsetEnd); -<a name="l00076"></a>00076 NO_DBG_DEC(pRowBlock->ucNumberOfColumns); -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 <span class="comment">/* Create the new list member */</span> -<a name="l00079"></a>00079 pListMember = xmalloc(<span class="keyword">sizeof</span>(row_desc_type)); -<a name="l00080"></a>00080 <span class="comment">/* Fill the new list member */</span> -<a name="l00081"></a>00081 pListMember->tInfo = *pRowBlock; -<a name="l00082"></a>00082 pListMember->pNext = NULL; -<a name="l00083"></a>00083 <span class="comment">/* Correct the values where needed */</span> -<a name="l00084"></a>00084 <span class="keywordflow">for</span> (iIndex = 0, psTmp = pListMember->tInfo.asColumnWidth; -<a name="l00085"></a>00085 iIndex < (<span class="keywordtype">int</span>)pListMember->tInfo.ucNumberOfColumns; -<a name="l00086"></a>00086 iIndex++, psTmp++) { -<a name="l00087"></a>00087 <span class="keywordflow">if</span> (*psTmp < 0) { -<a name="l00088"></a>00088 *psTmp = 0; -<a name="l00089"></a>00089 DBG_MSG(<span class="stringliteral">"The column width was negative"</span>); -<a name="l00090"></a>00090 } -<a name="l00091"></a>00091 } -<a name="l00092"></a>00092 <span class="comment">/* Add the new member to the list */</span> -<a name="l00093"></a>00093 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00094"></a>00094 pAnchor = pListMember; -<a name="l00095"></a>00095 pRowCurrent = pListMember; -<a name="l00096"></a>00096 } <span class="keywordflow">else</span> { -<a name="l00097"></a>00097 fail(pRowLast == NULL); -<a name="l00098"></a>00098 pRowLast->pNext = pListMember; -<a name="l00099"></a>00099 } -<a name="l00100"></a>00100 pRowLast = pListMember; -<a name="l00101"></a>00101 } <span class="comment">/* end of vAdd2RowInfoList */</span> -<a name="l00102"></a>00102 -<a name="l00103"></a>00103 <span class="comment">/*</span> -<a name="l00104"></a>00104 <span class="comment"> * Get the next item in the Row Information List</span> -<a name="l00105"></a>00105 <span class="comment"> */</span> -<a name="l00106"></a>00106 <span class="keyword">const</span> row_block_type * -<a name="l00107"></a>00107 pGetNextRowInfoListItem(<span class="keywordtype">void</span>) -<a name="l00108"></a>00108 { -<a name="l00109"></a>00109 <span class="keyword">const</span> row_block_type *pItem; -<a name="l00110"></a>00110 -<a name="l00111"></a>00111 <span class="keywordflow">if</span> (pRowCurrent == NULL) { -<a name="l00112"></a>00112 <span class="keywordflow">return</span> NULL; -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 pItem = &pRowCurrent->tInfo; -<a name="l00115"></a>00115 pRowCurrent = pRowCurrent->pNext; -<a name="l00116"></a>00116 <span class="keywordflow">return</span> pItem; -<a name="l00117"></a>00117 } <span class="comment">/* end of pGetNextRowInfoListItem */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/saveas_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,403 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/saveas.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/saveas.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * saveas.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2001 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to save the results as a textfile or a drawfile</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "DeskLib:Menu.h"</span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:Save.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "DeskLib:Template.h"</span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "DeskLib:Window.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00016"></a>00016 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="comment">/* The window handle of the save window */</span> -<a name="l00019"></a>00019 <span class="keyword">static</span> window_handle tSaveWindow = 0; -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/* Xfer_send box fields */</span> -<a name="l00022"></a>00022 <span class="preprocessor">#define DRAG_SPRITE 3</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define OK_BUTTON 0</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define CANCEL_BUTTON (-1)</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define FILENAME_ICON 2</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span> -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 <span class="comment">/*</span> -<a name="l00029"></a>00029 <span class="comment"> * saveas - a wrapper around Save_InitSaveWindowhandler</span> -<a name="l00030"></a>00030 <span class="comment"> */</span> -<a name="l00031"></a>00031 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00032"></a>00032 saveas(<span class="keywordtype">int</span> iFileType, <span class="keywordtype">char</span> *szOutfile, <span class="keywordtype">size_t</span> tEstSize, -<a name="l00033"></a>00033 save_filesaver save_function, <span class="keywordtype">void</span> *pvReference) -<a name="l00034"></a>00034 { -<a name="l00035"></a>00035 TRACE_MSG(<span class="stringliteral">"saveas"</span>); -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="keywordflow">if</span> (tSaveWindow == 0) { -<a name="l00038"></a>00038 tSaveWindow = Window_Create(<span class="stringliteral">"xfer_send"</span>, template_TITLEMIN); -<a name="l00039"></a>00039 } -<a name="l00040"></a>00040 Icon_SetText(tSaveWindow, FILENAME_ICON, szOutfile); -<a name="l00041"></a>00041 Window_Show(tSaveWindow, open_UNDERPOINTER); -<a name="l00042"></a>00042 (void)Save_InitSaveWindowHandler(tSaveWindow, FALSE, TRUE, TRUE, -<a name="l00043"></a>00043 DRAG_SPRITE, OK_BUTTON, CANCEL_BUTTON, FILENAME_ICON, -<a name="l00044"></a>00044 save_function, NULL, NULL, tEstSize, iFileType, pvReference); -<a name="l00045"></a>00045 } <span class="comment">/* end of saveas */</span> -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 <span class="keyword">static</span> BOOL -<a name="l00048"></a>00048 bWrite2File(<span class="keywordtype">void</span> *pvBytes, <span class="keywordtype">size_t</span> tSize, FILE *pFile, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFilename) -<a name="l00049"></a>00049 { -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (fwrite(pvBytes, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>), tSize, pFile) != tSize) { -<a name="l00051"></a>00051 werr(0, <span class="stringliteral">"I can't write to '%s'"</span>, szFilename); -<a name="l00052"></a>00052 <span class="keywordflow">return</span> FALSE; -<a name="l00053"></a>00053 } -<a name="l00054"></a>00054 <span class="keywordflow">return</span> TRUE; -<a name="l00055"></a>00055 } <span class="comment">/* end of bWrite2File */</span> -<a name="l00056"></a>00056 -<a name="l00057"></a>00057 <span class="comment">/*</span> -<a name="l00058"></a>00058 <span class="comment"> * bText2File - Save the generated draw file to a Text file</span> -<a name="l00059"></a>00059 <span class="comment"> */</span> -<a name="l00060"></a>00060 <span class="keyword">static</span> BOOL -<a name="l00061"></a>00061 bText2File(<span class="keywordtype">char</span> *szFilename, <span class="keywordtype">void</span> *pvHandle) -<a name="l00062"></a>00062 { -<a name="l00063"></a>00063 FILE *pFile; -<a name="l00064"></a>00064 diagram_type *pDiag; -<a name="l00065"></a>00065 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pObj; -<a name="l00066"></a>00066 <a class="code" href="structdrawfile__text.html">drawfile_text</a> *pText; -<a name="l00067"></a>00067 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00068"></a>00068 <span class="keywordtype">int</span> iToGo, iX, iYtopPrev, iHeight, iLines; -<a name="l00069"></a>00069 BOOL bFirst, bIndent, bSuccess; -<a name="l00070"></a>00070 -<a name="l00071"></a>00071 TRACE_MSG(<span class="stringliteral">"bText2File"</span>); -<a name="l00072"></a>00072 -<a name="l00073"></a>00073 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00074"></a>00074 fail(pvHandle == NULL); -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 DBG_MSG(szFilename); -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 pDiag = (diagram_type *)pvHandle; -<a name="l00079"></a>00079 pFile = fopen(szFilename, <span class="stringliteral">"w"</span>); -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00081"></a>00081 werr(0, <span class="stringliteral">"I can't open '%s' for writing"</span>, szFilename); -<a name="l00082"></a>00082 <span class="keywordflow">return</span> FALSE; -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 bFirst = TRUE; -<a name="l00085"></a>00085 iYtopPrev = 0; -<a name="l00086"></a>00086 iHeight = (int)lWord2DrawUnits20(DEFAULT_FONT_SIZE); -<a name="l00087"></a>00087 bSuccess = TRUE; -<a name="l00088"></a>00088 fail(pDiag->tInfo.length < offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects)); -<a name="l00089"></a>00089 iToGo = pDiag->tInfo.length - offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects); -<a name="l00090"></a>00090 DBG_DEC(iToGo); -<a name="l00091"></a>00091 pcTmp = (<span class="keyword">const</span> <span class="keywordtype">char</span> *)pDiag->tInfo.data + -<a name="l00092"></a>00092 offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, objects); -<a name="l00093"></a>00093 <span class="keywordflow">while</span> (iToGo > 0 && bSuccess) { -<a name="l00094"></a>00094 pObj = (<a class="code" href="structdrawfile__object.html">drawfile_object</a> *)pcTmp; -<a name="l00095"></a>00095 <span class="keywordflow">switch</span> (pObj->type) { -<a name="l00096"></a>00096 <span class="keywordflow">case</span> drawfile_TYPE_TEXT: -<a name="l00097"></a>00097 pText = &pObj->data.text; -<a name="l00098"></a>00098 <span class="comment">/* Compute the number of lines */</span> -<a name="l00099"></a>00099 iLines = (iYtopPrev - pText->bbox.max.y + -<a name="l00100"></a>00100 iHeight / 2) / iHeight; -<a name="l00101"></a>00101 DBG_DEC_C(iLines < 0, iYtopPrev); -<a name="l00102"></a>00102 DBG_DEC_C(iLines < 0, pText->bbox.max.y); -<a name="l00103"></a>00103 fail(iLines < 0); -<a name="l00104"></a>00104 bIndent = iLines > 0 || bFirst; -<a name="l00105"></a>00105 bFirst = FALSE; -<a name="l00106"></a>00106 <span class="comment">/* Print the newlines */</span> -<a name="l00107"></a>00107 <span class="keywordflow">while</span> (iLines > 0 && bSuccess) { -<a name="l00108"></a>00108 bSuccess = bWrite2File(<span class="stringliteral">"\n"</span>, -<a name="l00109"></a>00109 1, pFile, szFilename); -<a name="l00110"></a>00110 iLines--; -<a name="l00111"></a>00111 } -<a name="l00112"></a>00112 <span class="comment">/* Print the indentation */</span> -<a name="l00113"></a>00113 <span class="keywordflow">if</span> (bIndent && bSuccess) { -<a name="l00114"></a>00114 <span class="keywordflow">for</span> (iX = Drawfile_ScreenToDraw(8); -<a name="l00115"></a>00115 iX <= pText->bbox.min.x && bSuccess; -<a name="l00116"></a>00116 iX += Drawfile_ScreenToDraw(16)) { -<a name="l00117"></a>00117 bSuccess = bWrite2File(<span class="stringliteral">" "</span>, -<a name="l00118"></a>00118 1, pFile, szFilename); -<a name="l00119"></a>00119 } -<a name="l00120"></a>00120 } -<a name="l00121"></a>00121 <span class="keywordflow">if</span> (!bSuccess) { -<a name="l00122"></a>00122 <span class="keywordflow">break</span>; -<a name="l00123"></a>00123 } -<a name="l00124"></a>00124 <span class="comment">/* Print the text object */</span> -<a name="l00125"></a>00125 bSuccess = bWrite2File(pText->text, -<a name="l00126"></a>00126 strlen(pText->text), pFile, szFilename); -<a name="l00127"></a>00127 <span class="comment">/* Setup for the next object */</span> -<a name="l00128"></a>00128 iYtopPrev = pText->bbox.max.y; -<a name="l00129"></a>00129 iHeight = pText->bbox.max.y - pText->bbox.min.y; -<a name="l00130"></a>00130 <span class="keywordflow">break</span>; -<a name="l00131"></a>00131 <span class="keywordflow">case</span> drawfile_TYPE_FONT_TABLE: -<a name="l00132"></a>00132 <span class="keywordflow">case</span> drawfile_TYPE_PATH: -<a name="l00133"></a>00133 <span class="keywordflow">case</span> drawfile_TYPE_SPRITE: -<a name="l00134"></a>00134 <span class="keywordflow">case</span> drawfile_TYPE_JPEG: -<a name="l00135"></a>00135 <span class="comment">/* These are not relevant in a textfile */</span> -<a name="l00136"></a>00136 <span class="keywordflow">break</span>; -<a name="l00137"></a>00137 <span class="keywordflow">default</span>: -<a name="l00138"></a>00138 DBG_DEC(pObj->type); -<a name="l00139"></a>00139 bSuccess = FALSE; -<a name="l00140"></a>00140 <span class="keywordflow">break</span>; -<a name="l00141"></a>00141 } -<a name="l00142"></a>00142 pcTmp += pObj->size; -<a name="l00143"></a>00143 iToGo -= pObj->size; -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 DBG_DEC_C(iToGo != 0, iToGo); -<a name="l00146"></a>00146 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00147"></a>00147 bSuccess = bWrite2File(<span class="stringliteral">"\n"</span>, 1, pFile, szFilename); -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 (void)fclose(pFile); -<a name="l00150"></a>00150 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00151"></a>00151 vSetFiletype(szFilename, FILETYPE_TEXT); -<a name="l00152"></a>00152 } <span class="keywordflow">else</span> { -<a name="l00153"></a>00153 (void)<span class="keyword">remove</span>(szFilename); -<a name="l00154"></a>00154 werr(0, <span class="stringliteral">"Unable to save textfile '%s'"</span>, szFilename); -<a name="l00155"></a>00155 } -<a name="l00156"></a>00156 <span class="keywordflow">return</span> bSuccess; -<a name="l00157"></a>00157 } <span class="comment">/* end of bText2File */</span> -<a name="l00158"></a>00158 -<a name="l00159"></a>00159 <span class="comment">/*</span> -<a name="l00160"></a>00160 <span class="comment"> * bSaveTextfile - save the diagram as a text file</span> -<a name="l00161"></a>00161 <span class="comment"> */</span> -<a name="l00162"></a>00162 BOOL -<a name="l00163"></a>00163 bSaveTextfile(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00164"></a>00164 { -<a name="l00165"></a>00165 diagram_type *pDiag; -<a name="l00166"></a>00166 <span class="keywordtype">size_t</span> tRecLen, tNbrRecs, tEstSize; -<a name="l00167"></a>00167 -<a name="l00168"></a>00168 TRACE_MSG(<span class="stringliteral">"bSaveTextfile"</span>); -<a name="l00169"></a>00169 -<a name="l00170"></a>00170 fail(pEvent == NULL); -<a name="l00171"></a>00171 fail(pvReference == NULL); -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 pDiag = (diagram_type *)pvReference; -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 <span class="keywordflow">switch</span> (pEvent->type) { -<a name="l00176"></a>00176 <span class="keywordflow">case</span> event_SEND: <span class="comment">/* From a menu */</span> -<a name="l00177"></a>00177 fail(pEvent->data.message.header.action != message_MENUWARN); -<a name="l00178"></a>00178 <span class="keywordflow">if</span> (menu_currentopen != pDiag->pSaveMenu || -<a name="l00179"></a>00179 pEvent->data.message.data.menuwarn.selection[0] != -<a name="l00180"></a>00180 SAVEMENU_SAVETEXT) { -<a name="l00181"></a>00181 <span class="keywordflow">return</span> FALSE; -<a name="l00182"></a>00182 } -<a name="l00183"></a>00183 <span class="keywordflow">break</span>; -<a name="l00184"></a>00184 <span class="keywordflow">case</span> event_KEY: <span class="comment">/* From a key short cut */</span> -<a name="l00185"></a>00185 <span class="keywordflow">if</span> (pEvent->data.key.caret.window != pDiag->tMainWindow) { -<a name="l00186"></a>00186 <span class="keywordflow">return</span> FALSE; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 <span class="keywordflow">break</span>; -<a name="l00189"></a>00189 <span class="keywordflow">default</span>: -<a name="l00190"></a>00190 DBG_DEC(pEvent->type); -<a name="l00191"></a>00191 <span class="keywordflow">return</span> FALSE; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 -<a name="l00194"></a>00194 tRecLen = <span class="keyword">sizeof</span>(<a class="code" href="structdrawfile__text.html">drawfile_text</a>) + DEFAULT_SCREEN_WIDTH * 2 / 3; -<a name="l00195"></a>00195 tNbrRecs = pDiag->tInfo.length / tRecLen + 1; -<a name="l00196"></a>00196 tEstSize = tNbrRecs * DEFAULT_SCREEN_WIDTH * 2 / 3; -<a name="l00197"></a>00197 DBG_DEC(tEstSize); -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 saveas(FILETYPE_TEXT, <span class="stringliteral">"WordText"</span>, tEstSize, bText2File, pDiag); -<a name="l00200"></a>00200 <span class="keywordflow">return</span> TRUE; -<a name="l00201"></a>00201 } <span class="comment">/* end of bSaveTextfile */</span> -<a name="l00202"></a>00202 -<a name="l00203"></a>00203 <span class="comment">/*</span> -<a name="l00204"></a>00204 <span class="comment"> * bDraw2File - Save the generated draw file to a Draw file</span> -<a name="l00205"></a>00205 <span class="comment"> *</span> -<a name="l00206"></a>00206 <span class="comment"> * Remark: This is not a simple copy action. The origin of the</span> -<a name="l00207"></a>00207 <span class="comment"> * coordinates (0,0) must move from the top-left corner to the</span> -<a name="l00208"></a>00208 <span class="comment"> * bottom-left corner.</span> -<a name="l00209"></a>00209 <span class="comment"> */</span> -<a name="l00210"></a>00210 <span class="keyword">static</span> BOOL -<a name="l00211"></a>00211 bDraw2File(<span class="keywordtype">char</span> *szFilename, <span class="keywordtype">void</span> *pvHandle) -<a name="l00212"></a>00212 { -<a name="l00213"></a>00213 FILE *pFile; -<a name="l00214"></a>00214 diagram_type *pDiagram; -<a name="l00215"></a>00215 wimp_box *pBbox; -<a name="l00216"></a>00216 <a class="code" href="structdrawfile__object.html">drawfile_object</a> *pObj; -<a name="l00217"></a>00217 <a class="code" href="structdrawfile__text.html">drawfile_text</a> *pText; -<a name="l00218"></a>00218 <a class="code" href="structdrawfile__path.html">drawfile_path</a> *pPath; -<a name="l00219"></a>00219 <a class="code" href="structdrawfile__sprite.html">drawfile_sprite</a> *pSprite; -<a name="l00220"></a>00220 <a class="code" href="structdrawfile__jpeg.html">drawfile_jpeg</a> *pJpeg; -<a name="l00221"></a>00221 <span class="keywordtype">int</span> *piPath; -<a name="l00222"></a>00222 <span class="keywordtype">char</span> *pcTmp; -<a name="l00223"></a>00223 <span class="keywordtype">int</span> iYadd, iToGo, iSize; -<a name="l00224"></a>00224 BOOL bSuccess; -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 TRACE_MSG(<span class="stringliteral">"bDraw2File"</span>); -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 fail(szFilename == NULL || szFilename[0] == <span class="charliteral">'\0'</span>); -<a name="l00229"></a>00229 fail(pvHandle == NULL); -<a name="l00230"></a>00230 -<a name="l00231"></a>00231 NO_DBG_MSG(szFilename); -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 pDiagram = (diagram_type *)pvHandle; -<a name="l00234"></a>00234 pFile = fopen(szFilename, <span class="stringliteral">"wb"</span>); -<a name="l00235"></a>00235 <span class="keywordflow">if</span> (pFile == NULL) { -<a name="l00236"></a>00236 werr(0, <span class="stringliteral">"I can't open '%s' for writing"</span>, szFilename); -<a name="l00237"></a>00237 <span class="keywordflow">return</span> FALSE; -<a name="l00238"></a>00238 } -<a name="l00239"></a>00239 iToGo = pDiagram->tInfo.length; -<a name="l00240"></a>00240 DBG_DEC(iToGo); -<a name="l00241"></a>00241 pcTmp = pDiagram->tInfo.data; -<a name="l00242"></a>00242 bSuccess = bWrite2File(pcTmp, -<a name="l00243"></a>00243 offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, bbox), pFile, szFilename); -<a name="l00244"></a>00244 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00245"></a>00245 pcTmp += offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, bbox); -<a name="l00246"></a>00246 iToGo -= offsetof(<a class="code" href="structdrawfile__diagram.html">drawfile_diagram</a>, bbox); -<a name="l00247"></a>00247 pBbox = (wimp_box *)pcTmp; -<a name="l00248"></a>00248 iYadd = -pBbox->min.y; -<a name="l00249"></a>00249 pBbox->min.y += iYadd; -<a name="l00250"></a>00250 pBbox->max.y += iYadd; -<a name="l00251"></a>00251 bSuccess = bWrite2File(pcTmp, -<a name="l00252"></a>00252 <span class="keyword">sizeof</span>(*pBbox), pFile, szFilename); -<a name="l00253"></a>00253 iToGo -= <span class="keyword">sizeof</span>(*pBbox); -<a name="l00254"></a>00254 DBG_DEC(iToGo); -<a name="l00255"></a>00255 pcTmp += <span class="keyword">sizeof</span>(*pBbox); -<a name="l00256"></a>00256 } <span class="keywordflow">else</span> { -<a name="l00257"></a>00257 iYadd = 0; -<a name="l00258"></a>00258 } -<a name="l00259"></a>00259 <span class="keywordflow">while</span> (iToGo > 0 && bSuccess) { -<a name="l00260"></a>00260 pObj = (<a class="code" href="structdrawfile__object.html">drawfile_object</a> *)pcTmp; -<a name="l00261"></a>00261 iSize = pObj->size; -<a name="l00262"></a>00262 <span class="keywordflow">switch</span> (pObj->type) { -<a name="l00263"></a>00263 <span class="keywordflow">case</span> drawfile_TYPE_FONT_TABLE: -<a name="l00264"></a>00264 bSuccess = bWrite2File(pcTmp, -<a name="l00265"></a>00265 iSize, pFile, szFilename); -<a name="l00266"></a>00266 pcTmp += iSize; -<a name="l00267"></a>00267 iToGo -= iSize; -<a name="l00268"></a>00268 <span class="keywordflow">break</span>; -<a name="l00269"></a>00269 <span class="keywordflow">case</span> drawfile_TYPE_TEXT: -<a name="l00270"></a>00270 pText = &pObj->data.text; -<a name="l00271"></a>00271 <span class="comment">/* First correct the coordinates */</span> -<a name="l00272"></a>00272 pText->bbox.min.y += iYadd; -<a name="l00273"></a>00273 pText->bbox.max.y += iYadd; -<a name="l00274"></a>00274 pText->base.y += iYadd; -<a name="l00275"></a>00275 <span class="comment">/* Now write the information to file */</span> -<a name="l00276"></a>00276 bSuccess = bWrite2File(pcTmp, -<a name="l00277"></a>00277 iSize, pFile, szFilename); -<a name="l00278"></a>00278 pcTmp += pObj->size; -<a name="l00279"></a>00279 iToGo -= pObj->size; -<a name="l00280"></a>00280 <span class="keywordflow">break</span>; -<a name="l00281"></a>00281 <span class="keywordflow">case</span> drawfile_TYPE_PATH: -<a name="l00282"></a>00282 pPath = &pObj->data.path; -<a name="l00283"></a>00283 <span class="comment">/* First correct the coordinates */</span> -<a name="l00284"></a>00284 pPath->bbox.min.y += iYadd; -<a name="l00285"></a>00285 pPath->bbox.max.y += iYadd; -<a name="l00286"></a>00286 <span class="comment">/* Now write the information to file */</span> -<a name="l00287"></a>00287 bSuccess = bWrite2File(pPath, -<a name="l00288"></a>00288 <span class="keyword">sizeof</span>(*pPath), pFile, szFilename); -<a name="l00289"></a>00289 pcTmp += <span class="keyword">sizeof</span>(*pPath); -<a name="l00290"></a>00290 iSize = pObj->size - <span class="keyword">sizeof</span>(*pPath); -<a name="l00291"></a>00291 fail(iSize < 14 * <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>)); -<a name="l00292"></a>00292 <span class="comment">/* Second correct the path coordinates */</span> -<a name="l00293"></a>00293 piPath = xmalloc(iSize); -<a name="l00294"></a>00294 memcpy(piPath, pcTmp, iSize); -<a name="l00295"></a>00295 piPath[ 2] += iYadd; -<a name="l00296"></a>00296 piPath[ 5] += iYadd; -<a name="l00297"></a>00297 piPath[ 8] += iYadd; -<a name="l00298"></a>00298 piPath[11] += iYadd; -<a name="l00299"></a>00299 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00300"></a>00300 bSuccess = bWrite2File(piPath, -<a name="l00301"></a>00301 iSize, pFile, szFilename); -<a name="l00302"></a>00302 pcTmp += iSize; -<a name="l00303"></a>00303 } -<a name="l00304"></a>00304 piPath = xfree(piPath); -<a name="l00305"></a>00305 iToGo -= pObj->size; -<a name="l00306"></a>00306 <span class="keywordflow">break</span>; -<a name="l00307"></a>00307 <span class="keywordflow">case</span> drawfile_TYPE_SPRITE: -<a name="l00308"></a>00308 pSprite = &pObj->data.sprite; -<a name="l00309"></a>00309 <span class="comment">/* First correct the coordinates */</span> -<a name="l00310"></a>00310 pSprite->bbox.min.y += iYadd; -<a name="l00311"></a>00311 pSprite->bbox.max.y += iYadd; -<a name="l00312"></a>00312 <span class="comment">/* Now write the information to file */</span> -<a name="l00313"></a>00313 bSuccess = bWrite2File(pcTmp, -<a name="l00314"></a>00314 iSize, pFile, szFilename); -<a name="l00315"></a>00315 pcTmp += pObj->size; -<a name="l00316"></a>00316 iToGo -= pObj->size; -<a name="l00317"></a>00317 <span class="keywordflow">break</span>; -<a name="l00318"></a>00318 <span class="keywordflow">case</span> drawfile_TYPE_JPEG: -<a name="l00319"></a>00319 pJpeg = &pObj->data.jpeg; -<a name="l00320"></a>00320 <span class="comment">/* First correct the coordinates */</span> -<a name="l00321"></a>00321 pJpeg->bbox.min.y += iYadd; -<a name="l00322"></a>00322 pJpeg->bbox.max.y += iYadd; -<a name="l00323"></a>00323 pJpeg->trfm.entries[2][1] += iYadd; -<a name="l00324"></a>00324 <span class="comment">/* Now write the information to file */</span> -<a name="l00325"></a>00325 bSuccess = bWrite2File(pcTmp, -<a name="l00326"></a>00326 iSize, pFile, szFilename); -<a name="l00327"></a>00327 pcTmp += pObj->size; -<a name="l00328"></a>00328 iToGo -= pObj->size; -<a name="l00329"></a>00329 <span class="keywordflow">break</span>; -<a name="l00330"></a>00330 <span class="keywordflow">default</span>: -<a name="l00331"></a>00331 DBG_DEC(pObj->type); -<a name="l00332"></a>00332 bSuccess = FALSE; -<a name="l00333"></a>00333 <span class="keywordflow">break</span>; -<a name="l00334"></a>00334 } -<a name="l00335"></a>00335 } -<a name="l00336"></a>00336 DBG_DEC_C(iToGo != 0, iToGo); -<a name="l00337"></a>00337 (void)fclose(pFile); -<a name="l00338"></a>00338 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00339"></a>00339 vSetFiletype(szFilename, FILETYPE_DRAW); -<a name="l00340"></a>00340 } <span class="keywordflow">else</span> { -<a name="l00341"></a>00341 (void)<span class="keyword">remove</span>(szFilename); -<a name="l00342"></a>00342 werr(0, <span class="stringliteral">"Unable to save drawfile '%s'"</span>, szFilename); -<a name="l00343"></a>00343 } -<a name="l00344"></a>00344 <span class="keywordflow">return</span> bSuccess; -<a name="l00345"></a>00345 } <span class="comment">/* end of bDraw2File */</span> -<a name="l00346"></a>00346 -<a name="l00347"></a>00347 <span class="comment">/*</span> -<a name="l00348"></a>00348 <span class="comment"> * bSaveDrawfile - save the diagram as a draw file</span> -<a name="l00349"></a>00349 <span class="comment"> */</span> -<a name="l00350"></a>00350 BOOL -<a name="l00351"></a>00351 bSaveDrawfile(event_pollblock *pEvent, <span class="keywordtype">void</span> *pvReference) -<a name="l00352"></a>00352 { -<a name="l00353"></a>00353 diagram_type *pDiag; -<a name="l00354"></a>00354 <span class="keywordtype">size_t</span> tEstSize; -<a name="l00355"></a>00355 -<a name="l00356"></a>00356 TRACE_MSG(<span class="stringliteral">"bSaveDrawfile"</span>); -<a name="l00357"></a>00357 -<a name="l00358"></a>00358 fail(pEvent == NULL); -<a name="l00359"></a>00359 fail(pvReference == NULL); -<a name="l00360"></a>00360 -<a name="l00361"></a>00361 pDiag = (diagram_type *)pvReference; -<a name="l00362"></a>00362 -<a name="l00363"></a>00363 <span class="keywordflow">switch</span> (pEvent->type) { -<a name="l00364"></a>00364 <span class="keywordflow">case</span> event_SEND: <span class="comment">/* From a menu */</span> -<a name="l00365"></a>00365 fail(pEvent->data.message.header.action != message_MENUWARN); -<a name="l00366"></a>00366 <span class="keywordflow">if</span> (menu_currentopen != pDiag->pSaveMenu || -<a name="l00367"></a>00367 pEvent->data.message.data.menuwarn.selection[0] != -<a name="l00368"></a>00368 SAVEMENU_SAVEDRAW) { -<a name="l00369"></a>00369 <span class="keywordflow">return</span> FALSE; -<a name="l00370"></a>00370 } -<a name="l00371"></a>00371 <span class="keywordflow">break</span>; -<a name="l00372"></a>00372 <span class="keywordflow">case</span> event_KEY: <span class="comment">/* From a key short cut */</span> -<a name="l00373"></a>00373 <span class="keywordflow">if</span> (pEvent->data.key.caret.window != pDiag->tMainWindow) { -<a name="l00374"></a>00374 <span class="keywordflow">return</span> FALSE; -<a name="l00375"></a>00375 } -<a name="l00376"></a>00376 <span class="keywordflow">break</span>; -<a name="l00377"></a>00377 <span class="keywordflow">default</span>: -<a name="l00378"></a>00378 DBG_DEC(pEvent->type); -<a name="l00379"></a>00379 <span class="keywordflow">return</span> FALSE; -<a name="l00380"></a>00380 } -<a name="l00381"></a>00381 -<a name="l00382"></a>00382 tEstSize = pDiag->tInfo.length; -<a name="l00383"></a>00383 DBG_DEC(tEstSize); -<a name="l00384"></a>00384 -<a name="l00385"></a>00385 saveas(FILETYPE_DRAW, <span class="stringliteral">"WordDraw"</span>, tEstSize, bDraw2File, pDiag); -<a name="l00386"></a>00386 <span class="keywordflow">return</span> TRUE; -<a name="l00387"></a>00387 } <span class="comment">/* end of bSaveDrawfile */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/sectlist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/sectlist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/sectlist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * sectlist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy list(s) of Word section information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stddef.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00016"></a>00016 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keyword">typedef</span> <span class="keyword">struct </span>section_mem_tag { -<a name="l00019"></a>00019 section_block_type tInfo; -<a name="l00020"></a>00020 ULONG ulCharPos; -<a name="l00021"></a>00021 <span class="keyword">struct </span>section_mem_tag *pNext; -<a name="l00022"></a>00022 } section_mem_type; -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 <span class="comment">/* Variables needed to write the Section Information List */</span> -<a name="l00025"></a>00025 <span class="keyword">static</span> section_mem_type *pAnchor = NULL; -<a name="l00026"></a>00026 <span class="keyword">static</span> section_mem_type *pSectionLast = NULL; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="comment">/*</span> -<a name="l00030"></a>00030 <span class="comment"> * vDestroySectionInfoList - destroy the Section Information List</span> -<a name="l00031"></a>00031 <span class="comment"> */</span> -<a name="l00032"></a>00032 <span class="keywordtype">void</span> -<a name="l00033"></a>00033 vDestroySectionInfoList(<span class="keywordtype">void</span>) -<a name="l00034"></a>00034 { -<a name="l00035"></a>00035 section_mem_type *pCurr, *pNext; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 DBG_MSG(<span class="stringliteral">"vDestroySectionInfoList"</span>); -<a name="l00038"></a>00038 -<a name="l00039"></a>00039 <span class="comment">/* Free the Section Information List */</span> -<a name="l00040"></a>00040 pCurr = pAnchor; -<a name="l00041"></a>00041 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00042"></a>00042 pNext = pCurr->pNext; -<a name="l00043"></a>00043 pCurr = xfree(pCurr); -<a name="l00044"></a>00044 pCurr = pNext; -<a name="l00045"></a>00045 } -<a name="l00046"></a>00046 pAnchor = NULL; -<a name="l00047"></a>00047 <span class="comment">/* Reset all control variables */</span> -<a name="l00048"></a>00048 pSectionLast = NULL; -<a name="l00049"></a>00049 } <span class="comment">/* end of vDestroySectionInfoList */</span> -<a name="l00050"></a>00050 -<a name="l00051"></a>00051 <span class="comment">/*</span> -<a name="l00052"></a>00052 <span class="comment"> * vAdd2SectionInfoList - Add an element to the Section Information List</span> -<a name="l00053"></a>00053 <span class="comment"> */</span> -<a name="l00054"></a>00054 <span class="keywordtype">void</span> -<a name="l00055"></a>00055 vAdd2SectionInfoList(<span class="keyword">const</span> section_block_type *pSection, ULONG ulCharPos) -<a name="l00056"></a>00056 { -<a name="l00057"></a>00057 section_mem_type *pListMember; -<a name="l00058"></a>00058 -<a name="l00059"></a>00059 fail(pSection == NULL); -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 <span class="comment">/* Create list member */</span> -<a name="l00062"></a>00062 pListMember = xmalloc(<span class="keyword">sizeof</span>(section_mem_type)); -<a name="l00063"></a>00063 <span class="comment">/* Fill the list member */</span> -<a name="l00064"></a>00064 pListMember->tInfo = *pSection; -<a name="l00065"></a>00065 pListMember->ulCharPos = ulCharPos; -<a name="l00066"></a>00066 pListMember->pNext = NULL; -<a name="l00067"></a>00067 <span class="comment">/* Add the new member to the list */</span> -<a name="l00068"></a>00068 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00069"></a>00069 pAnchor = pListMember; -<a name="l00070"></a>00070 } <span class="keywordflow">else</span> { -<a name="l00071"></a>00071 fail(pSectionLast == NULL); -<a name="l00072"></a>00072 pSectionLast->pNext = pListMember; -<a name="l00073"></a>00073 } -<a name="l00074"></a>00074 pSectionLast = pListMember; -<a name="l00075"></a>00075 } <span class="comment">/* vAdd2SectionInfoList */</span> -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 <span class="comment">/*</span> -<a name="l00078"></a>00078 <span class="comment"> * vGetDefaultSection - fill the section struct with default values</span> -<a name="l00079"></a>00079 <span class="comment"> */</span> -<a name="l00080"></a>00080 <span class="keywordtype">void</span> -<a name="l00081"></a>00081 vGetDefaultSection(section_block_type *pSection) -<a name="l00082"></a>00082 { -<a name="l00083"></a>00083 (void)memset(pSection, 0, <span class="keyword">sizeof</span>(*pSection)); -<a name="l00084"></a>00084 pSection->bNewPage = TRUE; -<a name="l00085"></a>00085 } <span class="comment">/* end of vGetDefaultSection */</span> -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 <span class="comment">/*</span> -<a name="l00088"></a>00088 <span class="comment"> * vDefault2SectionInfoList - Add a default to the Section Information List</span> -<a name="l00089"></a>00089 <span class="comment"> */</span> -<a name="l00090"></a>00090 <span class="keywordtype">void</span> -<a name="l00091"></a>00091 vDefault2SectionInfoList(ULONG ulCharPos) -<a name="l00092"></a>00092 { -<a name="l00093"></a>00093 section_block_type tSection; -<a name="l00094"></a>00094 -<a name="l00095"></a>00095 vGetDefaultSection(&tSection); -<a name="l00096"></a>00096 vAdd2SectionInfoList(&tSection, ulCharPos); -<a name="l00097"></a>00097 } <span class="comment">/* end of vDefault2SectionInfoList */</span> -<a name="l00098"></a>00098 -<a name="l00099"></a>00099 <span class="comment">/*</span> -<a name="l00100"></a>00100 <span class="comment"> * pGetSectionInfo - get the section information</span> -<a name="l00101"></a>00101 <span class="comment"> */</span> -<a name="l00102"></a>00102 <span class="keyword">const</span> section_block_type * -<a name="l00103"></a>00103 pGetSectionInfo(<span class="keyword">const</span> section_block_type *pOld, ULONG ulCharPos) -<a name="l00104"></a>00104 { -<a name="l00105"></a>00105 <span class="keyword">const</span> section_mem_type *pCurr; -<a name="l00106"></a>00106 -<a name="l00107"></a>00107 <span class="keywordflow">if</span> (pOld == NULL || ulCharPos == 0) { -<a name="l00108"></a>00108 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00109"></a>00109 <span class="comment">/* There are no records, make one */</span> -<a name="l00110"></a>00110 vDefault2SectionInfoList(0); -<a name="l00111"></a>00111 fail(pAnchor == NULL); -<a name="l00112"></a>00112 } -<a name="l00113"></a>00113 <span class="comment">/* The first record */</span> -<a name="l00114"></a>00114 NO_DBG_MSG(<span class="stringliteral">"First record"</span>); -<a name="l00115"></a>00115 <span class="keywordflow">return</span> &pAnchor->tInfo; -<a name="l00116"></a>00116 } -<a name="l00117"></a>00117 -<a name="l00118"></a>00118 NO_DBG_HEX(ulCharPos); -<a name="l00119"></a>00119 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00120"></a>00120 NO_DBG_HEX(pCurr->ulCharPos); -<a name="l00121"></a>00121 <span class="keywordflow">if</span> (ulCharPos == pCurr->ulCharPos || -<a name="l00122"></a>00122 ulCharPos + 1 == pCurr->ulCharPos) { -<a name="l00123"></a>00123 NO_DBG_HEX(pCurr->ulCharPos); -<a name="l00124"></a>00124 <span class="keywordflow">return</span> &pCurr->tInfo; -<a name="l00125"></a>00125 } -<a name="l00126"></a>00126 } -<a name="l00127"></a>00127 <span class="keywordflow">return</span> pOld; -<a name="l00128"></a>00128 } <span class="comment">/* end of pGetSectionInfo */</span> -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="comment">/*</span> -<a name="l00131"></a>00131 <span class="comment"> * tGetNumberOfSections - get the number of sections</span> -<a name="l00132"></a>00132 <span class="comment"> */</span> -<a name="l00133"></a>00133 <span class="keywordtype">size_t</span> -<a name="l00134"></a>00134 tGetNumberOfSections(<span class="keywordtype">void</span>) -<a name="l00135"></a>00135 { -<a name="l00136"></a>00136 <span class="keyword">const</span> section_mem_type *pCurr; -<a name="l00137"></a>00137 <span class="keywordtype">size_t</span> tCounter; -<a name="l00138"></a>00138 -<a name="l00139"></a>00139 <span class="keywordflow">for</span> (tCounter = 0, pCurr = pAnchor; -<a name="l00140"></a>00140 pCurr != NULL; -<a name="l00141"></a>00141 tCounter++, pCurr = pCurr->pNext) -<a name="l00142"></a>00142 ; <span class="comment">/* Empty */</span> -<a name="l00143"></a>00143 <span class="keywordflow">return</span> tCounter; -<a name="l00144"></a>00144 } <span class="comment">/* end of tGetNumberOfSections */</span> -<a name="l00145"></a>00145 -<a name="l00146"></a>00146 <span class="comment">/*</span> -<a name="l00147"></a>00147 <span class="comment"> * ucGetSepHdrFtrSpecification - get the Heder/footer specification</span> -<a name="l00148"></a>00148 <span class="comment"> */</span> -<a name="l00149"></a>00149 UCHAR -<a name="l00150"></a>00150 ucGetSepHdrFtrSpecification(<span class="keywordtype">size_t</span> tSectionNumber) -<a name="l00151"></a>00151 { -<a name="l00152"></a>00152 <span class="keyword">const</span> section_mem_type *pCurr; -<a name="l00153"></a>00153 <span class="keywordtype">size_t</span> tIndex; -<a name="l00154"></a>00154 -<a name="l00155"></a>00155 <span class="keywordflow">for</span> (tIndex = 0, pCurr = pAnchor; -<a name="l00156"></a>00156 tIndex < tSectionNumber && pCurr != NULL; -<a name="l00157"></a>00157 tIndex++, pCurr = pCurr->pNext) -<a name="l00158"></a>00158 ; <span class="comment">/* Empty */</span> -<a name="l00159"></a>00159 <span class="keywordflow">if</span> (pCurr == NULL) { -<a name="l00160"></a>00160 DBG_DEC(tSectionNumber); -<a name="l00161"></a>00161 DBG_FIXME(); -<a name="l00162"></a>00162 <span class="keywordflow">return</span> 0x00; -<a name="l00163"></a>00163 } -<a name="l00164"></a>00164 <span class="keywordflow">return</span> pCurr->tInfo.ucHdrFtrSpecification; -<a name="l00165"></a>00165 } <span class="comment">/* end of ucGetSepHdrFtrSpecification */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/startup_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/startup.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/startup.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * startup.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2001 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Try to force a single startup of !Antiword</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <ctype.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "DeskLib:Error.h"</span> -<a name="l00013"></a>00013 <span class="preprocessor">#include "DeskLib:Event.h"</span> -<a name="l00014"></a>00014 <span class="preprocessor">#include "DeskLib:SWI.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="preprocessor">#if !defined(TaskManager_EnumerateTasks)</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define TaskManager_EnumerateTasks 0x042681</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* TaskManager_EnumerateTasks */</span> -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/*</span> -<a name="l00023"></a>00023 <span class="comment"> * bIsMatch - decide whether the two strings match</span> -<a name="l00024"></a>00024 <span class="comment"> *</span> -<a name="l00025"></a>00025 <span class="comment"> * like strcmp, but this one ignores case</span> -<a name="l00026"></a>00026 <span class="comment"> */</span> -<a name="l00027"></a>00027 <span class="keyword">static</span> BOOL -<a name="l00028"></a>00028 bIsMatch(<span class="keyword">const</span> <span class="keywordtype">char</span> *szStr1, <span class="keyword">const</span> <span class="keywordtype">char</span> *szStr2) -<a name="l00029"></a>00029 { -<a name="l00030"></a>00030 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp1, *pcTmp2; -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 <span class="keywordflow">for</span> (pcTmp1 = szStr1, pcTmp2 = szStr2; -<a name="l00033"></a>00033 *pcTmp1 != <span class="charliteral">'\0'</span>; -<a name="l00034"></a>00034 pcTmp1++, pcTmp2++) { -<a name="l00035"></a>00035 <span class="keywordflow">if</span> (toupper(*pcTmp1) != toupper(*pcTmp2)) { -<a name="l00036"></a>00036 <span class="keywordflow">return</span> FALSE; -<a name="l00037"></a>00037 } -<a name="l00038"></a>00038 } -<a name="l00039"></a>00039 <span class="keywordflow">return</span> *pcTmp2 == <span class="charliteral">'\0'</span>; -<a name="l00040"></a>00040 } <span class="comment">/* end of bIsMatch */</span> -<a name="l00041"></a>00041 -<a name="l00042"></a>00042 <span class="comment">/*</span> -<a name="l00043"></a>00043 <span class="comment"> * tGetTaskHandle - get the task handle of the given task</span> -<a name="l00044"></a>00044 <span class="comment"> *</span> -<a name="l00045"></a>00045 <span class="comment"> * returns the task handle when found, otherwise 0</span> -<a name="l00046"></a>00046 <span class="comment"> */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> task_handle -<a name="l00048"></a>00048 tGetTaskHandle(<span class="keyword">const</span> <span class="keywordtype">char</span> *szTaskname) -<a name="l00049"></a>00049 { -<a name="l00050"></a>00050 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00051"></a>00051 <span class="keywordtype">int</span> iReg0, iIndex; -<a name="l00052"></a>00052 <span class="keywordtype">int</span> aiBuffer[4]; -<a name="l00053"></a>00053 <span class="keywordtype">char</span> szTmp[21]; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 iReg0 = 0; -<a name="l00056"></a>00056 <span class="keywordflow">do</span> { -<a name="l00057"></a>00057 <span class="comment">/* Get info on the next task */</span> -<a name="l00058"></a>00058 Error_CheckFatal(SWI(3, 1, TaskManager_EnumerateTasks | XOS_Bit, -<a name="l00059"></a>00059 iReg0, aiBuffer, <span class="keyword">sizeof</span>(aiBuffer), &iReg0)); -<a name="l00060"></a>00060 <span class="comment">/* Copy the (control character terminated) task name */</span> -<a name="l00061"></a>00061 <span class="keywordflow">for</span> (iIndex = 0, pcTmp = (<span class="keyword">const</span> <span class="keywordtype">char</span> *)aiBuffer[1]; -<a name="l00062"></a>00062 iIndex < elementsof(szTmp); -<a name="l00063"></a>00063 iIndex++, pcTmp++) { -<a name="l00064"></a>00064 <span class="keywordflow">if</span> (iscntrl(*pcTmp)) { -<a name="l00065"></a>00065 szTmp[iIndex] = <span class="charliteral">'\0'</span>; -<a name="l00066"></a>00066 <span class="keywordflow">break</span>; -<a name="l00067"></a>00067 } -<a name="l00068"></a>00068 szTmp[iIndex] = *pcTmp; -<a name="l00069"></a>00069 } -<a name="l00070"></a>00070 szTmp[elementsof(szTmp) - 1] = <span class="charliteral">'\0'</span>; -<a name="l00071"></a>00071 <span class="keywordflow">if</span> (bIsMatch(szTmp, szTaskname)) { -<a name="l00072"></a>00072 <span class="comment">/* Task found */</span> -<a name="l00073"></a>00073 <span class="keywordflow">return</span> (task_handle)aiBuffer[0]; -<a name="l00074"></a>00074 } -<a name="l00075"></a>00075 } <span class="keywordflow">while</span> (iReg0 >= 0); -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 <span class="comment">/* Task not found */</span> -<a name="l00078"></a>00078 <span class="keywordflow">return</span> 0; -<a name="l00079"></a>00079 } <span class="comment">/* end of tGetTaskHandle */</span> -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 <span class="keywordtype">int</span> -<a name="l00082"></a>00082 <a class="code" href="redirectprintf_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv) -<a name="l00083"></a>00083 { -<a name="l00084"></a>00084 message_block tMsg; -<a name="l00085"></a>00085 task_handle tTaskHandle; -<a name="l00086"></a>00086 <span class="keywordtype">size_t</span> tArgLen; -<a name="l00087"></a>00087 <span class="keywordtype">int</span> aiMessages[] = {0}; -<a name="l00088"></a>00088 <span class="keywordtype">char</span> szCommand[512]; -<a name="l00089"></a>00089 -<a name="l00090"></a>00090 Event_Initialise3(<span class="stringliteral">"StartUp"</span>, 310, aiMessages); -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 <span class="keywordflow">if</span> (argc > 1) { -<a name="l00093"></a>00093 tArgLen = strlen(argv[1]); -<a name="l00094"></a>00094 } <span class="keywordflow">else</span> { -<a name="l00095"></a>00095 tArgLen = 0; -<a name="l00096"></a>00096 } -<a name="l00097"></a>00097 <span class="keywordflow">if</span> (tArgLen >= <span class="keyword">sizeof</span>(tMsg.data.dataload.filename)) { -<a name="l00098"></a>00098 werr(1, <span class="stringliteral">"Input filename too long"</span>); -<a name="l00099"></a>00099 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00100"></a>00100 } -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 tTaskHandle = tGetTaskHandle(<span class="stringliteral">"antiword"</span>); -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 <span class="keywordflow">if</span> (tTaskHandle == 0) { -<a name="l00105"></a>00105 <span class="comment">/* Antiword is not active */</span> -<a name="l00106"></a>00106 strcpy(szCommand, <span class="stringliteral">"chain:<Antiword$Dir>.!Antiword"</span>); -<a name="l00107"></a>00107 <span class="keywordflow">if</span> (argc > 1) { -<a name="l00108"></a>00108 strcat(szCommand, <span class="stringliteral">" "</span>); -<a name="l00109"></a>00109 strcat(szCommand, argv[1]); -<a name="l00110"></a>00110 } -<a name="l00111"></a>00111 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00112"></a>00112 <span class="preprocessor"></span> strcat(szCommand, <span class="stringliteral">" "</span>); -<a name="l00113"></a>00113 strcat(szCommand, <span class="stringliteral">"2><Antiword$Dir>.Debug"</span>); -<a name="l00114"></a>00114 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00115"></a>00115 system(szCommand); -<a name="l00116"></a>00116 <span class="comment">/* If we reach here something has gone wrong */</span> -<a name="l00117"></a>00117 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00118"></a>00118 } -<a name="l00119"></a>00119 -<a name="l00120"></a>00120 <span class="comment">/* Antiword is active */</span> -<a name="l00121"></a>00121 <span class="keywordflow">if</span> (argc > 1) { -<a name="l00122"></a>00122 <span class="comment">/*</span> -<a name="l00123"></a>00123 <span class="comment"> * Send the argument to Antiword by imitating a</span> -<a name="l00124"></a>00124 <span class="comment"> * drag-and-drop to Antiword's iconbar icon</span> -<a name="l00125"></a>00125 <span class="comment"> */</span> -<a name="l00126"></a>00126 memset(&tMsg, 0, <span class="keyword">sizeof</span>(tMsg)); -<a name="l00127"></a>00127 tMsg.header.size = ROUND4(offsetof(message_block, data) + -<a name="l00128"></a>00128 offsetof(message_dataload, filename) + -<a name="l00129"></a>00129 1 + tArgLen); -<a name="l00130"></a>00130 tMsg.header.yourref = 0; -<a name="l00131"></a>00131 tMsg.header.action = message_DATALOAD; -<a name="l00132"></a>00132 tMsg.data.dataload.window = window_ICONBAR; -<a name="l00133"></a>00133 tMsg.data.dataload.icon = -1; -<a name="l00134"></a>00134 tMsg.data.dataload.size = 0; -<a name="l00135"></a>00135 tMsg.data.dataload.filetype = FILETYPE_MSWORD; -<a name="l00136"></a>00136 strcpy(tMsg.data.dataload.filename, argv[1]); -<a name="l00137"></a>00137 Error_CheckFatal(Wimp_SendMessage(event_SEND, -<a name="l00138"></a>00138 &tMsg, tTaskHandle, 0)); -<a name="l00139"></a>00139 <span class="keywordflow">return</span> EXIT_SUCCESS; -<a name="l00140"></a>00140 } <span class="keywordflow">else</span> { -<a name="l00141"></a>00141 <span class="comment">/* Give an error message and return */</span> -<a name="l00142"></a>00142 werr(1, <span class="stringliteral">"Antiword is already running"</span>); -<a name="l00143"></a>00143 <span class="keywordflow">return</span> EXIT_FAILURE; -<a name="l00144"></a>00144 } -<a name="l00145"></a>00145 } <span class="comment">/* end of main */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/stylelist_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,503 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/stylelist.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/stylelist.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * stylelist.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of Word style information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stddef.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <ctype.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="comment">/*</span> -<a name="l00016"></a>00016 <span class="comment"> * Private structure to hide the way the information</span> -<a name="l00017"></a>00017 <span class="comment"> * is stored from the rest of the program</span> -<a name="l00018"></a>00018 <span class="comment"> */</span> -<a name="l00019"></a>00019 <span class="keyword">typedef</span> <span class="keyword">struct </span>style_mem_tag { -<a name="l00020"></a>00020 style_block_type tInfo; -<a name="l00021"></a>00021 ULONG ulSequenceNumber; -<a name="l00022"></a>00022 <span class="keyword">struct </span>style_mem_tag *pNext; -<a name="l00023"></a>00023 } style_mem_type; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 <span class="comment">/* Variables needed to write the Style Information List */</span> -<a name="l00026"></a>00026 <span class="keyword">static</span> style_mem_type *pAnchor = NULL; -<a name="l00027"></a>00027 <span class="keyword">static</span> style_mem_type *pStyleLast = NULL; -<a name="l00028"></a>00028 <span class="comment">/* The type of conversion */</span> -<a name="l00029"></a>00029 <span class="keyword">static</span> conversion_type eConversionType = conversion_unknown; -<a name="l00030"></a>00030 <span class="comment">/* The character set encoding */</span> -<a name="l00031"></a>00031 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00032"></a>00032 <span class="comment">/* Values for efficiency reasons */</span> -<a name="l00033"></a>00033 <span class="keyword">static</span> <span class="keyword">const</span> style_mem_type *pMidPtr = NULL; -<a name="l00034"></a>00034 <span class="keyword">static</span> BOOL bMoveMidPtr = FALSE; -<a name="l00035"></a>00035 <span class="keyword">static</span> BOOL bInSequence = TRUE; -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 <span class="comment">/*</span> -<a name="l00039"></a>00039 <span class="comment"> * vDestroyStyleInfoList - destroy the Style Information List</span> -<a name="l00040"></a>00040 <span class="comment"> */</span> -<a name="l00041"></a>00041 <span class="keywordtype">void</span> -<a name="l00042"></a>00042 vDestroyStyleInfoList(<span class="keywordtype">void</span>) -<a name="l00043"></a>00043 { -<a name="l00044"></a>00044 style_mem_type *pCurr, *pNext; -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 DBG_MSG(<span class="stringliteral">"vDestroyStyleInfoList"</span>); -<a name="l00047"></a>00047 -<a name="l00048"></a>00048 <span class="comment">/* Free the Style Information List */</span> -<a name="l00049"></a>00049 pCurr = pAnchor; -<a name="l00050"></a>00050 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00051"></a>00051 pNext = pCurr->pNext; -<a name="l00052"></a>00052 pCurr = xfree(pCurr); -<a name="l00053"></a>00053 pCurr = pNext; -<a name="l00054"></a>00054 } -<a name="l00055"></a>00055 pAnchor = NULL; -<a name="l00056"></a>00056 <span class="comment">/* Reset all control variables */</span> -<a name="l00057"></a>00057 pStyleLast = NULL; -<a name="l00058"></a>00058 pMidPtr = NULL; -<a name="l00059"></a>00059 bMoveMidPtr = FALSE; -<a name="l00060"></a>00060 bInSequence = TRUE; -<a name="l00061"></a>00061 } <span class="comment">/* end of vDestroyStyleInfoList */</span> -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 <span class="comment">/*</span> -<a name="l00064"></a>00064 <span class="comment"> * vConvertListCharacter - convert the list character</span> -<a name="l00065"></a>00065 <span class="comment"> */</span> -<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00067"></a>00067 vConvertListCharacter(UCHAR ucNFC, USHORT usListChar, <span class="keywordtype">char</span> *szListChar) -<a name="l00068"></a>00068 { -<a name="l00069"></a>00069 options_type tOptions; -<a name="l00070"></a>00070 <span class="keywordtype">size_t</span> tLen; -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 fail(szListChar == NULL); -<a name="l00073"></a>00073 fail(szListChar[0] != <span class="charliteral">'\0'</span>); -<a name="l00074"></a>00074 -<a name="l00075"></a>00075 <span class="keywordflow">if</span> (usListChar < 0x80 && isprint((<span class="keywordtype">int</span>)usListChar)) { -<a name="l00076"></a>00076 DBG_CHR_C(isalnum((<span class="keywordtype">int</span>)usListChar), usListChar); -<a name="l00077"></a>00077 szListChar[0] = (char)usListChar; -<a name="l00078"></a>00078 szListChar[1] = <span class="charliteral">'\0'</span>; -<a name="l00079"></a>00079 <span class="keywordflow">return</span>; -<a name="l00080"></a>00080 } -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="keywordflow">if</span> (ucNFC != LIST_SPECIAL && -<a name="l00083"></a>00083 ucNFC != LIST_SPECIAL2 && -<a name="l00084"></a>00084 ucNFC != LIST_BULLETS) { -<a name="l00085"></a>00085 szListChar[0] = <span class="charliteral">'.'</span>; -<a name="l00086"></a>00086 szListChar[1] = <span class="charliteral">'\0'</span>; -<a name="l00087"></a>00087 <span class="keywordflow">return</span>; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 -<a name="l00090"></a>00090 <span class="keywordflow">if</span> (eConversionType == conversion_unknown || -<a name="l00091"></a>00091 eEncoding == encoding_neutral) { -<a name="l00092"></a>00092 vGetOptions(&tOptions); -<a name="l00093"></a>00093 eConversionType = tOptions.eConversionType; -<a name="l00094"></a>00094 eEncoding = tOptions.eEncoding; -<a name="l00095"></a>00095 } -<a name="l00096"></a>00096 -<a name="l00097"></a>00097 <span class="keywordflow">switch</span> (usListChar) { -<a name="l00098"></a>00098 <span class="keywordflow">case</span> 0x0000: <span class="keywordflow">case</span> 0x00b7: <span class="keywordflow">case</span> 0x00fe: <span class="keywordflow">case</span> 0xf021: <span class="keywordflow">case</span> 0xf043: -<a name="l00099"></a>00099 <span class="keywordflow">case</span> 0xf06c: <span class="keywordflow">case</span> 0xf093: <span class="keywordflow">case</span> 0xf0b7: -<a name="l00100"></a>00100 usListChar = 0x2022; <span class="comment">/* BULLET */</span> -<a name="l00101"></a>00101 <span class="keywordflow">break</span>; -<a name="l00102"></a>00102 <span class="keywordflow">case</span> 0x0096: <span class="keywordflow">case</span> 0xf02d: -<a name="l00103"></a>00103 usListChar = 0x2013; <span class="comment">/* EN DASH */</span> -<a name="l00104"></a>00104 <span class="keywordflow">break</span>; -<a name="l00105"></a>00105 <span class="keywordflow">case</span> 0x00a8: -<a name="l00106"></a>00106 usListChar = 0x2666; <span class="comment">/* BLACK DIAMOND SUIT */</span> -<a name="l00107"></a>00107 <span class="keywordflow">break</span>; -<a name="l00108"></a>00108 <span class="keywordflow">case</span> 0x00de: -<a name="l00109"></a>00109 usListChar = 0x21d2; <span class="comment">/* RIGHTWARDS DOUBLE ARROW */</span> -<a name="l00110"></a>00110 <span class="keywordflow">break</span>; -<a name="l00111"></a>00111 <span class="keywordflow">case</span> 0x00e0: <span class="keywordflow">case</span> 0xf074: -<a name="l00112"></a>00112 usListChar = 0x25ca; <span class="comment">/* LOZENGE */</span> -<a name="l00113"></a>00113 <span class="keywordflow">break</span>; -<a name="l00114"></a>00114 <span class="keywordflow">case</span> 0x00e1: -<a name="l00115"></a>00115 usListChar = 0x2329; <span class="comment">/* LEFT ANGLE BRACKET */</span> -<a name="l00116"></a>00116 <span class="keywordflow">break</span>; -<a name="l00117"></a>00117 <span class="keywordflow">case</span> 0xf020: -<a name="l00118"></a>00118 usListChar = 0x0020; <span class="comment">/* SPACE */</span> -<a name="l00119"></a>00119 <span class="keywordflow">break</span>; -<a name="l00120"></a>00120 <span class="keywordflow">case</span> 0xf041: -<a name="l00121"></a>00121 usListChar = 0x270c; <span class="comment">/* VICTORY HAND */</span> -<a name="l00122"></a>00122 <span class="keywordflow">break</span>; -<a name="l00123"></a>00123 <span class="keywordflow">case</span> 0xf066: -<a name="l00124"></a>00124 usListChar = 0x03d5; <span class="comment">/* GREEK PHI SYMBOL */</span> -<a name="l00125"></a>00125 <span class="keywordflow">break</span>; -<a name="l00126"></a>00126 <span class="keywordflow">case</span> 0xf06e: -<a name="l00127"></a>00127 usListChar = 0x25a0; <span class="comment">/* BLACK SQUARE */</span> -<a name="l00128"></a>00128 <span class="keywordflow">break</span>; -<a name="l00129"></a>00129 <span class="keywordflow">case</span> 0xf06f: <span class="keywordflow">case</span> 0xf070: <span class="keywordflow">case</span> 0xf0a8: -<a name="l00130"></a>00130 usListChar = 0x25a1; <span class="comment">/* WHITE SQUARE */</span> -<a name="l00131"></a>00131 <span class="keywordflow">break</span>; -<a name="l00132"></a>00132 <span class="keywordflow">case</span> 0xf071: -<a name="l00133"></a>00133 usListChar = 0x2751; <span class="comment">/* LOWER RIGHT SHADOWED WHITE SQUARE */</span> -<a name="l00134"></a>00134 <span class="keywordflow">break</span>; -<a name="l00135"></a>00135 <span class="keywordflow">case</span> 0xf075: <span class="keywordflow">case</span> 0xf077: -<a name="l00136"></a>00136 usListChar = 0x25c6; <span class="comment">/* BLACK DIAMOND */</span> -<a name="l00137"></a>00137 <span class="keywordflow">break</span>; -<a name="l00138"></a>00138 <span class="keywordflow">case</span> 0xf076: -<a name="l00139"></a>00139 usListChar = 0x2756; <span class="comment">/* BLACK DIAMOND MINUS WHITE X */</span> -<a name="l00140"></a>00140 <span class="keywordflow">break</span>; -<a name="l00141"></a>00141 <span class="keywordflow">case</span> 0xf0a7: -<a name="l00142"></a>00142 usListChar = 0x25aa; <span class="comment">/* BLACK SMALL SQUARE */</span> -<a name="l00143"></a>00143 <span class="keywordflow">break</span>; -<a name="l00144"></a>00144 <span class="keywordflow">case</span> 0xf0d8: -<a name="l00145"></a>00145 usListChar = 0x27a2; <span class="comment">/* RIGHTWARDS ARROWHEAD */</span> -<a name="l00146"></a>00146 <span class="keywordflow">break</span>; -<a name="l00147"></a>00147 <span class="keywordflow">case</span> 0xf0e5: -<a name="l00148"></a>00148 usListChar = 0x2199; <span class="comment">/* SOUTH WEST ARROW */</span> -<a name="l00149"></a>00149 <span class="keywordflow">break</span>; -<a name="l00150"></a>00150 <span class="keywordflow">case</span> 0xf0f0: -<a name="l00151"></a>00151 usListChar = 0x21e8; <span class="comment">/* RIGHTWARDS WHITE ARROW */</span> -<a name="l00152"></a>00152 <span class="keywordflow">break</span>; -<a name="l00153"></a>00153 <span class="keywordflow">case</span> 0xf0fc: -<a name="l00154"></a>00154 usListChar = 0x2713; <span class="comment">/* CHECK MARK */</span> -<a name="l00155"></a>00155 <span class="keywordflow">break</span>; -<a name="l00156"></a>00156 <span class="keywordflow">default</span>: -<a name="l00157"></a>00157 <span class="keywordflow">if</span> ((usListChar >= 0xe000 && usListChar < 0xf900) || -<a name="l00158"></a>00158 (usListChar < 0x80 && !isprint((<span class="keywordtype">int</span>)usListChar))) { -<a name="l00159"></a>00159 <span class="comment">/*</span> -<a name="l00160"></a>00160 <span class="comment"> * All remaining private area characters and all</span> -<a name="l00161"></a>00161 <span class="comment"> * remaining non-printable ASCII characters to their</span> -<a name="l00162"></a>00162 <span class="comment"> * default bullet character</span> -<a name="l00163"></a>00163 <span class="comment"> */</span> -<a name="l00164"></a>00164 DBG_HEX(usListChar); -<a name="l00165"></a>00165 DBG_FIXME(); -<a name="l00166"></a>00166 <span class="keywordflow">if</span> (ucNFC == LIST_SPECIAL || ucNFC == LIST_SPECIAL2) { -<a name="l00167"></a>00167 usListChar = 0x2190; <span class="comment">/* LEFTWARDS ARROW */</span> -<a name="l00168"></a>00168 } <span class="keywordflow">else</span> { -<a name="l00169"></a>00169 usListChar = 0x2022; <span class="comment">/* BULLET */</span> -<a name="l00170"></a>00170 } -<a name="l00171"></a>00171 } -<a name="l00172"></a>00172 <span class="keywordflow">break</span>; -<a name="l00173"></a>00173 } -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00176"></a>00176 tLen = tUcs2Utf8(usListChar, szListChar, 4); -<a name="l00177"></a>00177 szListChar[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00178"></a>00178 } <span class="keywordflow">else</span> { -<a name="l00179"></a>00179 <span class="keywordflow">switch</span> (usListChar) { -<a name="l00180"></a>00180 <span class="keywordflow">case</span> 0x03d5: <span class="keywordflow">case</span> 0x25a1: <span class="keywordflow">case</span> 0x25c6: <span class="keywordflow">case</span> 0x25ca: -<a name="l00181"></a>00181 <span class="keywordflow">case</span> 0x2751: -<a name="l00182"></a>00182 szListChar[0] = <span class="charliteral">'o'</span>; -<a name="l00183"></a>00183 <span class="keywordflow">break</span>; -<a name="l00184"></a>00184 <span class="keywordflow">case</span> 0x2013: <span class="keywordflow">case</span> 0x2500: -<a name="l00185"></a>00185 szListChar[0] = <span class="charliteral">'-'</span>; -<a name="l00186"></a>00186 <span class="keywordflow">break</span>; -<a name="l00187"></a>00187 <span class="keywordflow">case</span> 0x2190: <span class="keywordflow">case</span> 0x2199: <span class="keywordflow">case</span> 0x2329: -<a name="l00188"></a>00188 szListChar[0] = <span class="charliteral">'<'</span>; -<a name="l00189"></a>00189 <span class="keywordflow">break</span>; -<a name="l00190"></a>00190 <span class="keywordflow">case</span> 0x21d2: -<a name="l00191"></a>00191 szListChar[0] = <span class="charliteral">'='</span>; -<a name="l00192"></a>00192 <span class="keywordflow">break</span>; -<a name="l00193"></a>00193 <span class="keywordflow">case</span> 0x21e8: <span class="keywordflow">case</span> 0x27a2: -<a name="l00194"></a>00194 szListChar[0] = <span class="charliteral">'>'</span>; -<a name="l00195"></a>00195 <span class="keywordflow">break</span>; -<a name="l00196"></a>00196 <span class="keywordflow">case</span> 0x25a0: <span class="keywordflow">case</span> 0x25aa: -<a name="l00197"></a>00197 szListChar[0] = <span class="charliteral">'.'</span>; -<a name="l00198"></a>00198 <span class="keywordflow">break</span>; -<a name="l00199"></a>00199 <span class="keywordflow">case</span> 0x2666: -<a name="l00200"></a>00200 szListChar[0] = OUR_DIAMOND; -<a name="l00201"></a>00201 <span class="keywordflow">break</span>; -<a name="l00202"></a>00202 <span class="keywordflow">case</span> 0x270c: -<a name="l00203"></a>00203 szListChar[0] = <span class="charliteral">'x'</span>; -<a name="l00204"></a>00204 <span class="keywordflow">break</span>; -<a name="l00205"></a>00205 <span class="keywordflow">case</span> 0x2713: -<a name="l00206"></a>00206 szListChar[0] = <span class="charliteral">'V'</span>; -<a name="l00207"></a>00207 <span class="keywordflow">break</span>; -<a name="l00208"></a>00208 <span class="keywordflow">case</span> 0x2756: -<a name="l00209"></a>00209 szListChar[0] = <span class="charliteral">'*'</span>; -<a name="l00210"></a>00210 <span class="keywordflow">break</span>; -<a name="l00211"></a>00211 <span class="keywordflow">case</span> 0x2022: -<a name="l00212"></a>00212 <span class="keywordflow">default</span>: -<a name="l00213"></a>00213 vGetBulletValue(eConversionType, eEncoding, -<a name="l00214"></a>00214 szListChar, 2); -<a name="l00215"></a>00215 <span class="keywordflow">break</span>; -<a name="l00216"></a>00216 } -<a name="l00217"></a>00217 tLen = 1; -<a name="l00218"></a>00218 } -<a name="l00219"></a>00219 szListChar[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00220"></a>00220 } <span class="comment">/* end of vConvertListCharacter */</span> -<a name="l00221"></a>00221 -<a name="l00222"></a>00222 <span class="comment">/*</span> -<a name="l00223"></a>00223 <span class="comment"> * eGetNumType - get the level type from the given level number</span> -<a name="l00224"></a>00224 <span class="comment"> *</span> -<a name="l00225"></a>00225 <span class="comment"> * Returns the level type</span> -<a name="l00226"></a>00226 <span class="comment"> */</span> -<a name="l00227"></a>00227 level_type_enum -<a name="l00228"></a>00228 eGetNumType(UCHAR ucNumLevel) -<a name="l00229"></a>00229 { -<a name="l00230"></a>00230 <span class="keywordflow">switch</span> (ucNumLevel) { -<a name="l00231"></a>00231 <span class="keywordflow">case</span> 1: <span class="keywordflow">case</span> 2: <span class="keywordflow">case</span> 3: <span class="keywordflow">case</span> 4: <span class="keywordflow">case</span> 5: -<a name="l00232"></a>00232 <span class="keywordflow">case</span> 6: <span class="keywordflow">case</span> 7: <span class="keywordflow">case</span> 8: <span class="keywordflow">case</span> 9: -<a name="l00233"></a>00233 <span class="keywordflow">return</span> level_type_outline; -<a name="l00234"></a>00234 <span class="keywordflow">case</span> 10: -<a name="l00235"></a>00235 <span class="keywordflow">return</span> level_type_numbering; -<a name="l00236"></a>00236 <span class="keywordflow">case</span> 11: -<a name="l00237"></a>00237 <span class="keywordflow">return</span> level_type_sequence; -<a name="l00238"></a>00238 <span class="keywordflow">case</span> 12: -<a name="l00239"></a>00239 <span class="keywordflow">return</span> level_type_pause; -<a name="l00240"></a>00240 <span class="keywordflow">default</span>: -<a name="l00241"></a>00241 <span class="keywordflow">return</span> level_type_none; -<a name="l00242"></a>00242 } -<a name="l00243"></a>00243 } <span class="comment">/* end of eGetNumType */</span> -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 <span class="comment">/*</span> -<a name="l00246"></a>00246 <span class="comment"> * vCorrectStyleValues - correct style values that Antiword can't use</span> -<a name="l00247"></a>00247 <span class="comment"> */</span> -<a name="l00248"></a>00248 <span class="keywordtype">void</span> -<a name="l00249"></a>00249 vCorrectStyleValues(style_block_type *pStyleBlock) -<a name="l00250"></a>00250 { -<a name="l00251"></a>00251 <span class="keywordflow">if</span> (pStyleBlock->usBeforeIndent > 0x7fff) { -<a name="l00252"></a>00252 pStyleBlock->usBeforeIndent = 0; -<a name="l00253"></a>00253 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pStyleBlock->usBeforeIndent > 2160) { -<a name="l00254"></a>00254 <span class="comment">/* 2160 twips = 1.5 inches or 38.1 mm */</span> -<a name="l00255"></a>00255 DBG_DEC(pStyleBlock->usBeforeIndent); -<a name="l00256"></a>00256 pStyleBlock->usBeforeIndent = 2160; -<a name="l00257"></a>00257 } -<a name="l00258"></a>00258 <span class="keywordflow">if</span> (pStyleBlock->usIstd >= 1 && -<a name="l00259"></a>00259 pStyleBlock->usIstd <= 9 && -<a name="l00260"></a>00260 pStyleBlock->usBeforeIndent < HEADING_GAP) { -<a name="l00261"></a>00261 NO_DBG_DEC(pStyleBlock->usBeforeIndent); -<a name="l00262"></a>00262 pStyleBlock->usBeforeIndent = HEADING_GAP; -<a name="l00263"></a>00263 } -<a name="l00264"></a>00264 -<a name="l00265"></a>00265 <span class="keywordflow">if</span> (pStyleBlock->usAfterIndent > 0x7fff) { -<a name="l00266"></a>00266 pStyleBlock->usAfterIndent = 0; -<a name="l00267"></a>00267 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pStyleBlock->usAfterIndent > 2160) { -<a name="l00268"></a>00268 <span class="comment">/* 2160 twips = 1.5 inches or 38.1 mm */</span> -<a name="l00269"></a>00269 DBG_DEC(pStyleBlock->usAfterIndent); -<a name="l00270"></a>00270 pStyleBlock->usAfterIndent = 2160; -<a name="l00271"></a>00271 } -<a name="l00272"></a>00272 <span class="keywordflow">if</span> (pStyleBlock->usIstd >= 1 && -<a name="l00273"></a>00273 pStyleBlock->usIstd <= 9 && -<a name="l00274"></a>00274 pStyleBlock->usAfterIndent < HEADING_GAP) { -<a name="l00275"></a>00275 NO_DBG_DEC(pStyleBlock->usAfterIndent); -<a name="l00276"></a>00276 pStyleBlock->usAfterIndent = HEADING_GAP; -<a name="l00277"></a>00277 } -<a name="l00278"></a>00278 -<a name="l00279"></a>00279 <span class="keywordflow">if</span> (pStyleBlock->sLeftIndent < 0) { -<a name="l00280"></a>00280 pStyleBlock->sLeftIndent = 0; -<a name="l00281"></a>00281 } -<a name="l00282"></a>00282 <span class="keywordflow">if</span> (pStyleBlock->sRightIndent > 0) { -<a name="l00283"></a>00283 pStyleBlock->sRightIndent = 0; -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 vConvertListCharacter(pStyleBlock->ucNFC, -<a name="l00286"></a>00286 pStyleBlock->usListChar, -<a name="l00287"></a>00287 pStyleBlock->szListChar); -<a name="l00288"></a>00288 } <span class="comment">/* end of vCorrectStyleValues */</span> -<a name="l00289"></a>00289 -<a name="l00290"></a>00290 <span class="comment">/*</span> -<a name="l00291"></a>00291 <span class="comment"> * vAdd2StyleInfoList - Add an element to the Style Information List</span> -<a name="l00292"></a>00292 <span class="comment"> */</span> -<a name="l00293"></a>00293 <span class="keywordtype">void</span> -<a name="l00294"></a>00294 vAdd2StyleInfoList(<span class="keyword">const</span> style_block_type *pStyleBlock) -<a name="l00295"></a>00295 { -<a name="l00296"></a>00296 style_mem_type *pListMember; -<a name="l00297"></a>00297 -<a name="l00298"></a>00298 fail(pStyleBlock == NULL); -<a name="l00299"></a>00299 -<a name="l00300"></a>00300 NO_DBG_MSG(<span class="stringliteral">"bAdd2StyleInfoList"</span>); -<a name="l00301"></a>00301 -<a name="l00302"></a>00302 <span class="keywordflow">if</span> (pStyleBlock->ulFileOffset == FC_INVALID) { -<a name="l00303"></a>00303 NO_DBG_DEC(pStyleBlock->usIstd); -<a name="l00304"></a>00304 <span class="keywordflow">return</span>; -<a name="l00305"></a>00305 } -<a name="l00306"></a>00306 -<a name="l00307"></a>00307 NO_DBG_HEX(pStyleBlock->ulFileOffset); -<a name="l00308"></a>00308 NO_DBG_DEC_C(pStyleBlock->sLeftIndent != 0, -<a name="l00309"></a>00309 pStyleBlock->sLeftIndent); -<a name="l00310"></a>00310 NO_DBG_DEC_C(pStyleBlock->sRightIndent != 0, -<a name="l00311"></a>00311 pStyleBlock->sRightIndent); -<a name="l00312"></a>00312 NO_DBG_DEC_C(pStyleBlock->bNumPause, pStyleBlock->bNumPause); -<a name="l00313"></a>00313 NO_DBG_DEC_C(pStyleBlock->usIstd != 0, pStyleBlock->usIstd); -<a name="l00314"></a>00314 NO_DBG_DEC_C(pStyleBlock->usStartAt != 1, pStyleBlock->usStartAt); -<a name="l00315"></a>00315 NO_DBG_DEC_C(pStyleBlock->usAfterIndent != 0, -<a name="l00316"></a>00316 pStyleBlock->usAfterIndent); -<a name="l00317"></a>00317 NO_DBG_DEC_C(pStyleBlock->ucAlignment != 0, pStyleBlock->ucAlignment); -<a name="l00318"></a>00318 NO_DBG_DEC(pStyleBlock->ucNFC); -<a name="l00319"></a>00319 NO_DBG_HEX(pStyleBlock->usListChar); -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 <span class="keywordflow">if</span> (pStyleLast != NULL && -<a name="l00322"></a>00322 pStyleLast->tInfo.ulFileOffset == pStyleBlock->ulFileOffset) { -<a name="l00323"></a>00323 <span class="comment">/*</span> -<a name="l00324"></a>00324 <span class="comment"> * If two consecutive styles share the same</span> -<a name="l00325"></a>00325 <span class="comment"> * offset, remember only the last style</span> -<a name="l00326"></a>00326 <span class="comment"> */</span> -<a name="l00327"></a>00327 fail(pStyleLast->pNext != NULL); -<a name="l00328"></a>00328 pStyleLast->tInfo = *pStyleBlock; -<a name="l00329"></a>00329 <span class="comment">/* Correct the values where needed */</span> -<a name="l00330"></a>00330 vCorrectStyleValues(&pStyleLast->tInfo); -<a name="l00331"></a>00331 <span class="keywordflow">return</span>; -<a name="l00332"></a>00332 } -<a name="l00333"></a>00333 -<a name="l00334"></a>00334 <span class="comment">/* Create list member */</span> -<a name="l00335"></a>00335 pListMember = xmalloc(<span class="keyword">sizeof</span>(style_mem_type)); -<a name="l00336"></a>00336 <span class="comment">/* Fill the list member */</span> -<a name="l00337"></a>00337 pListMember->tInfo = *pStyleBlock; -<a name="l00338"></a>00338 pListMember->pNext = NULL; -<a name="l00339"></a>00339 <span class="comment">/* Add the sequence number */</span> -<a name="l00340"></a>00340 pListMember->ulSequenceNumber = -<a name="l00341"></a>00341 ulGetSeqNumber(pListMember->tInfo.ulFileOffset); -<a name="l00342"></a>00342 <span class="comment">/* Correct the values where needed */</span> -<a name="l00343"></a>00343 vCorrectStyleValues(&pListMember->tInfo); -<a name="l00344"></a>00344 <span class="comment">/* Add the new member to the list */</span> -<a name="l00345"></a>00345 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00346"></a>00346 pAnchor = pListMember; -<a name="l00347"></a>00347 <span class="comment">/* For efficiency */</span> -<a name="l00348"></a>00348 pMidPtr = pAnchor; -<a name="l00349"></a>00349 bMoveMidPtr = FALSE; -<a name="l00350"></a>00350 bInSequence = TRUE; -<a name="l00351"></a>00351 } <span class="keywordflow">else</span> { -<a name="l00352"></a>00352 fail(pStyleLast == NULL); -<a name="l00353"></a>00353 pStyleLast->pNext = pListMember; -<a name="l00354"></a>00354 <span class="comment">/* For efficiency */</span> -<a name="l00355"></a>00355 <span class="keywordflow">if</span> (bMoveMidPtr) { -<a name="l00356"></a>00356 pMidPtr = pMidPtr->pNext; -<a name="l00357"></a>00357 bMoveMidPtr = FALSE; -<a name="l00358"></a>00358 } <span class="keywordflow">else</span> { -<a name="l00359"></a>00359 bMoveMidPtr = TRUE; -<a name="l00360"></a>00360 } -<a name="l00361"></a>00361 <span class="keywordflow">if</span> (bInSequence) { -<a name="l00362"></a>00362 bInSequence = pListMember->ulSequenceNumber > -<a name="l00363"></a>00363 pStyleLast->ulSequenceNumber; -<a name="l00364"></a>00364 } -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 pStyleLast = pListMember; -<a name="l00367"></a>00367 } <span class="comment">/* end of vAdd2StyleInfoList */</span> -<a name="l00368"></a>00368 -<a name="l00369"></a>00369 <span class="comment">/*</span> -<a name="l00370"></a>00370 <span class="comment"> * Get the record that follows the given recored in the Style Information List</span> -<a name="l00371"></a>00371 <span class="comment"> */</span> -<a name="l00372"></a>00372 <span class="keyword">const</span> style_block_type * -<a name="l00373"></a>00373 pGetNextStyleInfoListItem(<span class="keyword">const</span> style_block_type *pCurr) -<a name="l00374"></a>00374 { -<a name="l00375"></a>00375 <span class="keyword">const</span> style_mem_type *pRecord; -<a name="l00376"></a>00376 <span class="keywordtype">size_t</span> tOffset; -<a name="l00377"></a>00377 -<a name="l00378"></a>00378 <span class="keywordflow">if</span> (pCurr == NULL) { -<a name="l00379"></a>00379 <span class="keywordflow">if</span> (pAnchor == NULL) { -<a name="l00380"></a>00380 <span class="comment">/* There are no records */</span> -<a name="l00381"></a>00381 <span class="keywordflow">return</span> NULL; -<a name="l00382"></a>00382 } -<a name="l00383"></a>00383 <span class="comment">/* The first record is the only one without a predecessor */</span> -<a name="l00384"></a>00384 <span class="keywordflow">return</span> &pAnchor->tInfo; -<a name="l00385"></a>00385 } -<a name="l00386"></a>00386 tOffset = offsetof(style_mem_type, tInfo); -<a name="l00387"></a>00387 <span class="comment">/* Many casts to prevent alignment warnings */</span> -<a name="l00388"></a>00388 pRecord = (style_mem_type *)(<span class="keywordtype">void</span> *)((<span class="keywordtype">char</span> *)pCurr - tOffset); -<a name="l00389"></a>00389 fail(pCurr != &pRecord->tInfo); -<a name="l00390"></a>00390 <span class="keywordflow">if</span> (pRecord->pNext == NULL) { -<a name="l00391"></a>00391 <span class="comment">/* The last record has no successor */</span> -<a name="l00392"></a>00392 <span class="keywordflow">return</span> NULL; -<a name="l00393"></a>00393 } -<a name="l00394"></a>00394 <span class="keywordflow">return</span> &pRecord->pNext->tInfo; -<a name="l00395"></a>00395 } <span class="comment">/* end of pGetNextStyleInfoListItem */</span> -<a name="l00396"></a>00396 -<a name="l00397"></a>00397 <span class="comment">/*</span> -<a name="l00398"></a>00398 <span class="comment"> * Get the next text style</span> -<a name="l00399"></a>00399 <span class="comment"> */</span> -<a name="l00400"></a>00400 <span class="keyword">const</span> style_block_type * -<a name="l00401"></a>00401 pGetNextTextStyle(<span class="keyword">const</span> style_block_type *pCurr) -<a name="l00402"></a>00402 { -<a name="l00403"></a>00403 <span class="keyword">const</span> style_block_type *pRecord; -<a name="l00404"></a>00404 -<a name="l00405"></a>00405 pRecord = pCurr; -<a name="l00406"></a>00406 <span class="keywordflow">do</span> { -<a name="l00407"></a>00407 pRecord = pGetNextStyleInfoListItem(pRecord); -<a name="l00408"></a>00408 } <span class="keywordflow">while</span> (pRecord != NULL && -<a name="l00409"></a>00409 (pRecord->eListID == hdrftr_list || -<a name="l00410"></a>00410 pRecord->eListID == macro_list || -<a name="l00411"></a>00411 pRecord->eListID == annotation_list)); -<a name="l00412"></a>00412 <span class="keywordflow">return</span> pRecord; -<a name="l00413"></a>00413 } <span class="comment">/* end of pGetNextTextStyle */</span> -<a name="l00414"></a>00414 -<a name="l00415"></a>00415 <span class="comment">/*</span> -<a name="l00416"></a>00416 <span class="comment"> * usGetIstd - get the istd that belongs to the given file offset</span> -<a name="l00417"></a>00417 <span class="comment"> */</span> -<a name="l00418"></a>00418 USHORT -<a name="l00419"></a>00419 usGetIstd(ULONG ulFileOffset) -<a name="l00420"></a>00420 { -<a name="l00421"></a>00421 <span class="keyword">const</span> style_mem_type *pCurr, *pBest, *pStart; -<a name="l00422"></a>00422 ULONG ulSeq, ulBest; -<a name="l00423"></a>00423 -<a name="l00424"></a>00424 ulSeq = ulGetSeqNumber(ulFileOffset); -<a name="l00425"></a>00425 <span class="keywordflow">if</span> (ulSeq == FC_INVALID) { -<a name="l00426"></a>00426 <span class="keywordflow">return</span> ISTD_NORMAL; -<a name="l00427"></a>00427 } -<a name="l00428"></a>00428 NO_DBG_HEX(ulFileOffset); -<a name="l00429"></a>00429 NO_DBG_DEC(ulSeq); -<a name="l00430"></a>00430 -<a name="l00431"></a>00431 <span class="keywordflow">if</span> (bInSequence && -<a name="l00432"></a>00432 pMidPtr != NULL && -<a name="l00433"></a>00433 ulSeq > pMidPtr->ulSequenceNumber) { -<a name="l00434"></a>00434 <span class="comment">/* The istd is in the second half of the chained list */</span> -<a name="l00435"></a>00435 pStart = pMidPtr; -<a name="l00436"></a>00436 } <span class="keywordflow">else</span> { -<a name="l00437"></a>00437 pStart = pAnchor; -<a name="l00438"></a>00438 } -<a name="l00439"></a>00439 -<a name="l00440"></a>00440 pBest = NULL; -<a name="l00441"></a>00441 ulBest = 0; -<a name="l00442"></a>00442 <span class="keywordflow">for</span> (pCurr = pStart; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00443"></a>00443 <span class="keywordflow">if</span> (pCurr->ulSequenceNumber != FC_INVALID && -<a name="l00444"></a>00444 (pBest == NULL || pCurr->ulSequenceNumber > ulBest) && -<a name="l00445"></a>00445 pCurr->ulSequenceNumber <= ulSeq) { -<a name="l00446"></a>00446 pBest = pCurr; -<a name="l00447"></a>00447 ulBest = pCurr->ulSequenceNumber; -<a name="l00448"></a>00448 } -<a name="l00449"></a>00449 <span class="keywordflow">if</span> (bInSequence && pCurr->ulSequenceNumber > ulSeq) { -<a name="l00450"></a>00450 <span class="keywordflow">break</span>; -<a name="l00451"></a>00451 } -<a name="l00452"></a>00452 } -<a name="l00453"></a>00453 NO_DBG_DEC(ulBest); -<a name="l00454"></a>00454 -<a name="l00455"></a>00455 <span class="keywordflow">if</span> (pBest == NULL) { -<a name="l00456"></a>00456 <span class="keywordflow">return</span> ISTD_NORMAL; -<a name="l00457"></a>00457 } -<a name="l00458"></a>00458 -<a name="l00459"></a>00459 NO_DBG_DEC(pBest->tInfo.usIstd); -<a name="l00460"></a>00460 <span class="keywordflow">return</span> pBest->tInfo.usIstd; -<a name="l00461"></a>00461 } <span class="comment">/* end of usGetIstd */</span> -<a name="l00462"></a>00462 -<a name="l00463"></a>00463 <span class="comment">/*</span> -<a name="l00464"></a>00464 <span class="comment"> * bStyleImpliesList - does style info implies being part of a list</span> -<a name="l00465"></a>00465 <span class="comment"> *</span> -<a name="l00466"></a>00466 <span class="comment"> * Decide whether the style information implies that the given paragraph is</span> -<a name="l00467"></a>00467 <span class="comment"> * part of a list</span> -<a name="l00468"></a>00468 <span class="comment"> *</span> -<a name="l00469"></a>00469 <span class="comment"> * Returns TRUE when the paragraph is part of a list, otherwise FALSE</span> -<a name="l00470"></a>00470 <span class="comment"> */</span> -<a name="l00471"></a>00471 BOOL -<a name="l00472"></a>00472 bStyleImpliesList(<span class="keyword">const</span> style_block_type *pStyle, <span class="keywordtype">int</span> iWordVersion) -<a name="l00473"></a>00473 { -<a name="l00474"></a>00474 fail(pStyle == NULL); -<a name="l00475"></a>00475 fail(iWordVersion < 0); -<a name="l00476"></a>00476 -<a name="l00477"></a>00477 <span class="keywordflow">if</span> (pStyle->usIstd >= 1 && pStyle->usIstd <= 9) { -<a name="l00478"></a>00478 <span class="comment">/* These are heading levels */</span> -<a name="l00479"></a>00479 <span class="keywordflow">return</span> FALSE; -<a name="l00480"></a>00480 } -<a name="l00481"></a>00481 <span class="keywordflow">if</span> (iWordVersion < 8) { -<a name="l00482"></a>00482 <span class="comment">/* Check for old style lists */</span> -<a name="l00483"></a>00483 <span class="keywordflow">return</span> pStyle->ucNumLevel != 0; -<a name="l00484"></a>00484 } -<a name="l00485"></a>00485 <span class="comment">/* Check for new style lists */</span> -<a name="l00486"></a>00486 <span class="keywordflow">return</span> pStyle->usListIndex != 0; -<a name="l00487"></a>00487 } <span class="comment">/* end of bStyleImpliesList */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/stylesheet_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,854 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/stylesheet.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/stylesheet.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * stylesheet.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Build, read and destroy a list of stylesheet information</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="preprocessor">#define SGC_PAP 1</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define SGC_CHP 2</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span> -<a name="l00017"></a>00017 <span class="comment">/* Variables needed to describe the stylesheet list */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> style_block_type *atStyleInfo = NULL; -<a name="l00019"></a>00019 <span class="keyword">static</span> font_block_type *atFontInfo = NULL; -<a name="l00020"></a>00020 <span class="keyword">static</span> BOOL *abFilled = NULL; -<a name="l00021"></a>00021 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tStdCount = 0; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 <span class="comment">/*</span> -<a name="l00025"></a>00025 <span class="comment"> * vDestroyStylesheetList - destroy the stylesheet list</span> -<a name="l00026"></a>00026 <span class="comment"> */</span> -<a name="l00027"></a>00027 <span class="keywordtype">void</span> -<a name="l00028"></a>00028 vDestroyStylesheetList(<span class="keywordtype">void</span>) -<a name="l00029"></a>00029 { -<a name="l00030"></a>00030 DBG_MSG(<span class="stringliteral">"vDestroyStylesheetList"</span>); -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 tStdCount = 0; -<a name="l00033"></a>00033 atStyleInfo = xfree(atStyleInfo); -<a name="l00034"></a>00034 atFontInfo = xfree(atFontInfo); -<a name="l00035"></a>00035 abFilled = xfree(abFilled); -<a name="l00036"></a>00036 } <span class="comment">/* end of vDestroyStylesheetList */</span> -<a name="l00037"></a>00037 -<a name="l00038"></a>00038 <span class="comment">/*</span> -<a name="l00039"></a>00039 <span class="comment"> * vGetDefaultStyle - fill the style struct with default values</span> -<a name="l00040"></a>00040 <span class="comment"> */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00042"></a>00042 vGetDefaultStyle(style_block_type *pStyle) -<a name="l00043"></a>00043 { -<a name="l00044"></a>00044 (void)memset(pStyle, 0, <span class="keyword">sizeof</span>(*pStyle)); -<a name="l00045"></a>00045 pStyle->usIstd = ISTD_INVALID; -<a name="l00046"></a>00046 pStyle->usIstdNext = ISTD_INVALID; -<a name="l00047"></a>00047 pStyle->usStartAt = 1; -<a name="l00048"></a>00048 pStyle->ucListLevel = 9; -<a name="l00049"></a>00049 } <span class="comment">/* end of vGetDefaultStyle */</span> -<a name="l00050"></a>00050 -<a name="l00051"></a>00051 <span class="comment">/*</span> -<a name="l00052"></a>00052 <span class="comment"> * vGetDefaultFont - fill the font struct with default values</span> -<a name="l00053"></a>00053 <span class="comment"> */</span> -<a name="l00054"></a>00054 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00055"></a>00055 vGetDefaultFont(font_block_type *pFont, USHORT usDefaultFontNumber) -<a name="l00056"></a>00056 { -<a name="l00057"></a>00057 (void)memset(pFont, 0, <span class="keyword">sizeof</span>(*pFont)); -<a name="l00058"></a>00058 pFont->usFontSize = DEFAULT_FONT_SIZE; -<a name="l00059"></a>00059 <span class="keywordflow">if</span> (usDefaultFontNumber <= (USHORT)UCHAR_MAX) { -<a name="l00060"></a>00060 pFont->ucFontNumber = (UCHAR)usDefaultFontNumber; -<a name="l00061"></a>00061 } <span class="keywordflow">else</span> { -<a name="l00062"></a>00062 DBG_DEC(usDefaultFontNumber); -<a name="l00063"></a>00063 DBG_FIXME(); -<a name="l00064"></a>00064 pFont->ucFontNumber = 0; -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 } <span class="comment">/* end of vGetDefaultFont */</span> -<a name="l00067"></a>00067 -<a name="l00068"></a>00068 <span class="comment">/*</span> -<a name="l00069"></a>00069 <span class="comment"> * iGetStyleIndex - get the index of the record with the specified istd</span> -<a name="l00070"></a>00070 <span class="comment"> *</span> -<a name="l00071"></a>00071 <span class="comment"> * returns the index when found, otherwise -1</span> -<a name="l00072"></a>00072 <span class="comment"> */</span> -<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00074"></a>00074 iGetStyleIndex(USHORT usIstd) -<a name="l00075"></a>00075 { -<a name="l00076"></a>00076 <span class="keywordtype">int</span> iIndex; -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 fail(abFilled == NULL); -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (usIstd == ISTD_INVALID || abFilled == NULL) { -<a name="l00081"></a>00081 <span class="keywordflow">return</span> -1; -<a name="l00082"></a>00082 } -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00085"></a>00085 <span class="keywordflow">if</span> (abFilled[iIndex] && atStyleInfo[iIndex].usIstd == usIstd) { -<a name="l00086"></a>00086 <span class="comment">/* The record is filled and the istd matches */</span> -<a name="l00087"></a>00087 <span class="keywordflow">return</span> iIndex; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 <span class="keywordflow">return</span> -1; -<a name="l00091"></a>00091 } <span class="comment">/* end of iGetStyleIndex */</span> -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 <span class="comment">/*</span> -<a name="l00094"></a>00094 <span class="comment"> * Get a build-in style for Winword 1/2</span> -<a name="l00095"></a>00095 <span class="comment"> */</span> -<a name="l00096"></a>00096 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00097"></a>00097 vGetBuildinStyle(UCHAR ucStc, style_block_type *pStyle) -<a name="l00098"></a>00098 { -<a name="l00099"></a>00099 fail(pStyle == NULL); -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 <span class="comment">/* Start with de defaults */</span> -<a name="l00102"></a>00102 vGetDefaultStyle(pStyle); -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 <span class="comment">/* Add the build-in style info */</span> -<a name="l00105"></a>00105 <span class="keywordflow">switch</span> (ucStc) { -<a name="l00106"></a>00106 <span class="keywordflow">case</span> 246: -<a name="l00107"></a>00107 <span class="keywordflow">case</span> 247: -<a name="l00108"></a>00108 <span class="keywordflow">case</span> 248: -<a name="l00109"></a>00109 <span class="keywordflow">case</span> 249: -<a name="l00110"></a>00110 <span class="keywordflow">case</span> 250: -<a name="l00111"></a>00111 <span class="keywordflow">case</span> 255: -<a name="l00112"></a>00112 pStyle->sLeftIndent = 720; -<a name="l00113"></a>00113 <span class="keywordflow">break</span>; -<a name="l00114"></a>00114 <span class="keywordflow">case</span> 251: -<a name="l00115"></a>00115 <span class="keywordflow">case</span> 252: -<a name="l00116"></a>00116 pStyle->sLeftIndent = 360; -<a name="l00117"></a>00117 <span class="keywordflow">break</span>; -<a name="l00118"></a>00118 <span class="keywordflow">case</span> 253: -<a name="l00119"></a>00119 pStyle->usBeforeIndent = 120; -<a name="l00120"></a>00120 <span class="keywordflow">break</span>; -<a name="l00121"></a>00121 <span class="keywordflow">case</span> 254: -<a name="l00122"></a>00122 pStyle->usBeforeIndent = 240; -<a name="l00123"></a>00123 <span class="keywordflow">break</span>; -<a name="l00124"></a>00124 <span class="keywordflow">default</span>: -<a name="l00125"></a>00125 <span class="keywordflow">if</span> (ucStc >= 233 && ucStc <= 239) { -<a name="l00126"></a>00126 pStyle->sLeftIndent = (239 - (short)ucStc) * 360; -<a name="l00127"></a>00127 } -<a name="l00128"></a>00128 <span class="keywordflow">if</span> (ucStc >= 225 && ucStc <= 232) { -<a name="l00129"></a>00129 pStyle->sLeftIndent = (232 - (short)ucStc) * 720; -<a name="l00130"></a>00130 pStyle->sRightIndent = 720; -<a name="l00131"></a>00131 } -<a name="l00132"></a>00132 <span class="keywordflow">break</span>; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 } <span class="comment">/* end of vGetBuildinStyle */</span> -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 <span class="comment">/*</span> -<a name="l00137"></a>00137 <span class="comment"> * Get a build-in fontstyle for Winword 1/2</span> -<a name="l00138"></a>00138 <span class="comment"> */</span> -<a name="l00139"></a>00139 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00140"></a>00140 vGetBuildinFont(UCHAR ucStc, font_block_type *pFont) -<a name="l00141"></a>00141 { -<a name="l00142"></a>00142 fail(pFont == NULL); -<a name="l00143"></a>00143 -<a name="l00144"></a>00144 <span class="comment">/* Start with de defaults */</span> -<a name="l00145"></a>00145 vGetDefaultFont(pFont, 0); -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 <span class="comment">/* Add the build-in fontstyle info */</span> -<a name="l00148"></a>00148 <span class="keywordflow">switch</span> (ucStc) { -<a name="l00149"></a>00149 <span class="keywordflow">case</span> 223: -<a name="l00150"></a>00150 <span class="keywordflow">case</span> 244: -<a name="l00151"></a>00151 pFont->usFontSize = 16; -<a name="l00152"></a>00152 <span class="keywordflow">break</span>; -<a name="l00153"></a>00153 <span class="keywordflow">case</span> 246: -<a name="l00154"></a>00154 <span class="keywordflow">case</span> 247: -<a name="l00155"></a>00155 <span class="keywordflow">case</span> 248: -<a name="l00156"></a>00156 pFont->usFontStyle |= FONT_ITALIC; -<a name="l00157"></a>00157 <span class="keywordflow">break</span>; -<a name="l00158"></a>00158 <span class="keywordflow">case</span> 249: -<a name="l00159"></a>00159 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00160"></a>00160 <span class="keywordflow">break</span>; -<a name="l00161"></a>00161 <span class="keywordflow">case</span> 250: -<a name="l00162"></a>00162 pFont->usFontStyle |= FONT_BOLD; -<a name="l00163"></a>00163 <span class="keywordflow">break</span>; -<a name="l00164"></a>00164 <span class="keywordflow">case</span> 251: -<a name="l00165"></a>00165 pFont->usFontStyle |= FONT_UNDERLINE; -<a name="l00166"></a>00166 pFont->usFontSize = 24; -<a name="l00167"></a>00167 <span class="keywordflow">break</span>; -<a name="l00168"></a>00168 <span class="keywordflow">case</span> 252: -<a name="l00169"></a>00169 pFont->usFontStyle |= FONT_BOLD; -<a name="l00170"></a>00170 pFont->usFontSize = 24; -<a name="l00171"></a>00171 <span class="keywordflow">break</span>; -<a name="l00172"></a>00172 <span class="keywordflow">case</span> 253: -<a name="l00173"></a>00173 pFont->ucFontNumber = 2; -<a name="l00174"></a>00174 pFont->usFontStyle |= FONT_BOLD; -<a name="l00175"></a>00175 pFont->usFontSize = 24; -<a name="l00176"></a>00176 <span class="keywordflow">break</span>; -<a name="l00177"></a>00177 <span class="keywordflow">case</span> 254: -<a name="l00178"></a>00178 pFont->ucFontNumber = 2; -<a name="l00179"></a>00179 pFont->usFontStyle |= (FONT_BOLD|FONT_UNDERLINE); -<a name="l00180"></a>00180 pFont->usFontSize = 24; -<a name="l00181"></a>00181 <span class="keywordflow">break</span>; -<a name="l00182"></a>00182 <span class="keywordflow">default</span>: -<a name="l00183"></a>00183 <span class="keywordflow">break</span>; -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 } <span class="comment">/* end of vGetBuildinFont */</span> -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 <span class="comment">/*</span> -<a name="l00188"></a>00188 <span class="comment"> * Convert a stylecode (stc) as used by WinWord 1/2 into a styleindex (istd)</span> -<a name="l00189"></a>00189 <span class="comment"> * as used by Word 6 and up</span> -<a name="l00190"></a>00190 <span class="comment"> */</span> -<a name="l00191"></a>00191 USHORT -<a name="l00192"></a>00192 usStc2istd(UCHAR ucStc) -<a name="l00193"></a>00193 { -<a name="l00194"></a>00194 <span class="comment">/* Old nil style to new nil style */</span> -<a name="l00195"></a>00195 <span class="keywordflow">if</span> (ucStc == 222) { -<a name="l00196"></a>00196 <span class="keywordflow">return</span> STI_NIL; -<a name="l00197"></a>00197 } -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 <span class="comment">/* Heading 1 through 9 must become istd 1 through 9 */</span> -<a name="l00200"></a>00200 <span class="comment">/* so 254 through 246 must become 1 through 9 and vice versa */</span> -<a name="l00201"></a>00201 <span class="keywordflow">if</span> ((ucStc >= 1 && ucStc <= 9) || -<a name="l00202"></a>00202 (ucStc >= 246 && ucStc <= 254)) { -<a name="l00203"></a>00203 <span class="keywordflow">return</span> 255 - (USHORT)ucStc; -<a name="l00204"></a>00204 } -<a name="l00205"></a>00205 <span class="keywordflow">return</span> (USHORT)ucStc; -<a name="l00206"></a>00206 } <span class="comment">/* end of usStd2istd */</span> -<a name="l00207"></a>00207 -<a name="l00208"></a>00208 <span class="comment">/*</span> -<a name="l00209"></a>00209 <span class="comment"> * Build the lists with Stylesheet Information for WinWord 1/2 files</span> -<a name="l00210"></a>00210 <span class="comment"> */</span> -<a name="l00211"></a>00211 <span class="keywordtype">void</span> -<a name="l00212"></a>00212 vGet2Stylesheet(FILE *pFile, <span class="keywordtype">int</span> iWordVersion, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00213"></a>00213 { -<a name="l00214"></a>00214 style_block_type *pStyle; -<a name="l00215"></a>00215 font_block_type *pFont; -<a name="l00216"></a>00216 UCHAR *aucBuffer; -<a name="l00217"></a>00217 ULONG ulBeginStshInfo; -<a name="l00218"></a>00218 <span class="keywordtype">size_t</span> tStshInfoLen, tName, tChpx, tPapx, tMaxIndex; -<a name="l00219"></a>00219 <span class="keywordtype">int</span> iStIndex, iChpxIndex, iPapxIndex, iSt, iChpx, iPapx; -<a name="l00220"></a>00220 <span class="keywordtype">int</span> iStd, iIndex, iBaseStyleIndex, iCounter; -<a name="l00221"></a>00221 USHORT usBaseStyle; -<a name="l00222"></a>00222 UCHAR ucStc, ucStcNext, ucStcBase; -<a name="l00223"></a>00223 -<a name="l00224"></a>00224 fail(pFile == NULL || aucHeader == NULL); -<a name="l00225"></a>00225 fail(iWordVersion != 1 && iWordVersion != 2); -<a name="l00226"></a>00226 -<a name="l00227"></a>00227 ulBeginStshInfo = ulGetLong(0x5e, aucHeader); <span class="comment">/* fcStshf */</span> -<a name="l00228"></a>00228 NO_DBG_HEX(ulBeginStshInfo); -<a name="l00229"></a>00229 tStshInfoLen = (size_t)usGetWord(0x62, aucHeader); <span class="comment">/* cbStshf */</span> -<a name="l00230"></a>00230 NO_DBG_DEC(tStshInfoLen); -<a name="l00231"></a>00231 -<a name="l00232"></a>00232 aucBuffer = xmalloc(tStshInfoLen); -<a name="l00233"></a>00233 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tStshInfoLen, ulBeginStshInfo, pFile)) { -<a name="l00234"></a>00234 aucBuffer = xfree(aucBuffer); -<a name="l00235"></a>00235 <span class="keywordflow">return</span>; -<a name="l00236"></a>00236 } -<a name="l00237"></a>00237 NO_DBG_PRINT_BLOCK(aucBuffer, tStshInfoLen); -<a name="l00238"></a>00238 -<a name="l00239"></a>00239 fail(2 > tStshInfoLen); -<a name="l00240"></a>00240 iStd = (int)usGetWord(0, aucBuffer); -<a name="l00241"></a>00241 -<a name="l00242"></a>00242 fail(2 + 2 > tStshInfoLen); -<a name="l00243"></a>00243 tName = (size_t)usGetWord(2, aucBuffer); -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 fail(2 + tName + 2 > tStshInfoLen); -<a name="l00246"></a>00246 tChpx = (size_t)usGetWord(2 + tName, aucBuffer); -<a name="l00247"></a>00247 -<a name="l00248"></a>00248 fail(2 + tName + tChpx + 2 > tStshInfoLen); -<a name="l00249"></a>00249 tPapx = (size_t)usGetWord(2 + tName + tChpx, aucBuffer); -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 fail(2 + tName + tChpx + tPapx + 2 > tStshInfoLen); -<a name="l00252"></a>00252 tStdCount = (size_t)usGetWord(2 + tName + tChpx + tPapx, aucBuffer); -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 NO_DBG_HEX(tStdCount); -<a name="l00255"></a>00255 -<a name="l00256"></a>00256 atStyleInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(style_block_type)); -<a name="l00257"></a>00257 atFontInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(font_block_type)); -<a name="l00258"></a>00258 abFilled = xcalloc(tStdCount, <span class="keyword">sizeof</span>(BOOL)); -<a name="l00259"></a>00259 -<a name="l00260"></a>00260 <span class="keywordflow">do</span> { -<a name="l00261"></a>00261 iCounter = 0; -<a name="l00262"></a>00262 iStIndex = 2 + 2; -<a name="l00263"></a>00263 iChpxIndex = 2 + (int)tName + 2; -<a name="l00264"></a>00264 iPapxIndex = 2 + (int)tName + (<span class="keywordtype">int</span>)tChpx + 2; -<a name="l00265"></a>00265 tMaxIndex = 2 + tName + tChpx + tPapx + 2; -<a name="l00266"></a>00266 <span class="comment">/* Read the styles one-by-one */</span> -<a name="l00267"></a>00267 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00268"></a>00268 pStyle = &atStyleInfo[iIndex]; -<a name="l00269"></a>00269 pFont = &atFontInfo[iIndex]; -<a name="l00270"></a>00270 iSt = (int)ucGetByte(iStIndex, aucBuffer); -<a name="l00271"></a>00271 iChpx = (int)ucGetByte(iChpxIndex, aucBuffer); -<a name="l00272"></a>00272 iPapx = (int)ucGetByte(iPapxIndex, aucBuffer); -<a name="l00273"></a>00273 NO_DBG_HEX(iSt); -<a name="l00274"></a>00274 NO_DBG_HEX(iChpx); -<a name="l00275"></a>00275 NO_DBG_HEX(iPapx); -<a name="l00276"></a>00276 <span class="keywordflow">if</span> (iSt == 0xff || tMaxIndex + 1 >= tStshInfoLen) { -<a name="l00277"></a>00277 <span class="comment">/* Undefined style or no information */</span> -<a name="l00278"></a>00278 iStIndex++; -<a name="l00279"></a>00279 iChpxIndex++; -<a name="l00280"></a>00280 iPapxIndex++; -<a name="l00281"></a>00281 tMaxIndex += 2; -<a name="l00282"></a>00282 <span class="keywordflow">if</span> (!abFilled[iIndex]) { -<a name="l00283"></a>00283 DBG_HEX_C(iChpx != 0xff, iChpx); -<a name="l00284"></a>00284 DBG_HEX_C(iPapx != 0xff, iPapx); -<a name="l00285"></a>00285 vGetDefaultStyle(pStyle); -<a name="l00286"></a>00286 vGetDefaultFont(pFont, 0); -<a name="l00287"></a>00287 abFilled[iIndex] = TRUE; -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 <span class="keywordflow">continue</span>; -<a name="l00290"></a>00290 } -<a name="l00291"></a>00291 -<a name="l00292"></a>00292 NO_DBG_STRN(aucBuffer + iStIndex + 1, iSt); -<a name="l00293"></a>00293 iStIndex += iSt + 1; -<a name="l00294"></a>00294 -<a name="l00295"></a>00295 ucStcNext = ucGetByte(tMaxIndex, aucBuffer); -<a name="l00296"></a>00296 ucStcBase = ucGetByte(tMaxIndex + 1, aucBuffer); -<a name="l00297"></a>00297 ucStc = (UCHAR)((iIndex - iStd) & 0xff); -<a name="l00298"></a>00298 NO_DBG_DEC(ucStc); -<a name="l00299"></a>00299 -<a name="l00300"></a>00300 <span class="keywordflow">if</span> (iChpx == 0xff || iPapx == 0xff) { -<a name="l00301"></a>00301 <span class="comment">/* Use a build-in style */</span> -<a name="l00302"></a>00302 iChpxIndex++; -<a name="l00303"></a>00303 iPapxIndex++; -<a name="l00304"></a>00304 tMaxIndex += 2; -<a name="l00305"></a>00305 <span class="keywordflow">if</span> (!abFilled[iIndex]) { -<a name="l00306"></a>00306 DBG_HEX_C(iChpx != 0xff, iChpx); -<a name="l00307"></a>00307 DBG_HEX_C(iPapx != 0xff, iPapx); -<a name="l00308"></a>00308 vGetBuildinStyle(ucStc, pStyle); -<a name="l00309"></a>00309 pStyle->usIstd = usStc2istd(ucStc); -<a name="l00310"></a>00310 pStyle->usIstdNext = -<a name="l00311"></a>00311 usStc2istd(ucStcNext); -<a name="l00312"></a>00312 vGetBuildinFont(ucStc, pFont); -<a name="l00313"></a>00313 abFilled[iIndex] = TRUE; -<a name="l00314"></a>00314 } -<a name="l00315"></a>00315 <span class="keywordflow">continue</span>; -<a name="l00316"></a>00316 } -<a name="l00317"></a>00317 -<a name="l00318"></a>00318 <span class="keywordflow">if</span> (abFilled[iIndex]) { -<a name="l00319"></a>00319 <span class="comment">/* This record has already been filled */</span> -<a name="l00320"></a>00320 iChpxIndex += iChpx + 1; -<a name="l00321"></a>00321 iPapxIndex += iPapx + 1; -<a name="l00322"></a>00322 tMaxIndex += 2; -<a name="l00323"></a>00323 <span class="keywordflow">continue</span>; -<a name="l00324"></a>00324 } -<a name="l00325"></a>00325 -<a name="l00326"></a>00326 usBaseStyle = usStc2istd(ucStcBase); -<a name="l00327"></a>00327 -<a name="l00328"></a>00328 <span class="keywordflow">if</span> (usBaseStyle == STI_NIL) { -<a name="l00329"></a>00329 <span class="comment">/* Based on the Nil style */</span> -<a name="l00330"></a>00330 vGetDefaultStyle(pStyle); -<a name="l00331"></a>00331 vGetDefaultFont(pFont, 0); -<a name="l00332"></a>00332 } <span class="keywordflow">else</span> { -<a name="l00333"></a>00333 iBaseStyleIndex = iGetStyleIndex(usBaseStyle); -<a name="l00334"></a>00334 NO_DBG_DEC(iBaseStyleIndex); -<a name="l00335"></a>00335 <span class="keywordflow">if</span> (iBaseStyleIndex < 0) { -<a name="l00336"></a>00336 <span class="comment">/* This style is not known yet */</span> -<a name="l00337"></a>00337 iChpxIndex += iChpx + 1; -<a name="l00338"></a>00338 iPapxIndex += iPapx + 1; -<a name="l00339"></a>00339 tMaxIndex += 2; -<a name="l00340"></a>00340 <span class="keywordflow">continue</span>; -<a name="l00341"></a>00341 } -<a name="l00342"></a>00342 fail(iBaseStyleIndex >= (<span class="keywordtype">int</span>)tStdCount); -<a name="l00343"></a>00343 fail(!abFilled[iBaseStyleIndex]); -<a name="l00344"></a>00344 <span class="comment">/* Based on the specified base style */</span> -<a name="l00345"></a>00345 *pStyle = atStyleInfo[iBaseStyleIndex]; -<a name="l00346"></a>00346 *pFont = atFontInfo[iBaseStyleIndex]; -<a name="l00347"></a>00347 } -<a name="l00348"></a>00348 pStyle->usIstd = usStc2istd(ucStc); -<a name="l00349"></a>00349 pStyle->usIstdNext = usStc2istd(ucStcNext); -<a name="l00350"></a>00350 -<a name="l00351"></a>00351 abFilled[iIndex] = TRUE; -<a name="l00352"></a>00352 iCounter++; -<a name="l00353"></a>00353 -<a name="l00354"></a>00354 <span class="comment">/* Add the changes if any */</span> -<a name="l00355"></a>00355 <span class="keywordflow">switch</span> (iChpx) { -<a name="l00356"></a>00356 <span class="keywordflow">case</span> 0x00: -<a name="l00357"></a>00357 <span class="keywordflow">case</span> 0xff: -<a name="l00358"></a>00358 iChpxIndex++; -<a name="l00359"></a>00359 <span class="keywordflow">break</span>; -<a name="l00360"></a>00360 <span class="keywordflow">default</span>: -<a name="l00361"></a>00361 NO_DBG_PRINT_BLOCK(aucBuffer + iChpxIndex + 1, -<a name="l00362"></a>00362 iChpx); -<a name="l00363"></a>00363 <span class="keywordflow">if</span> (iWordVersion == 1) { -<a name="l00364"></a>00364 vGet1FontInfo(0, -<a name="l00365"></a>00365 aucBuffer + iChpxIndex + 1, -<a name="l00366"></a>00366 (<span class="keywordtype">size_t</span>)iChpx, pFont); -<a name="l00367"></a>00367 } <span class="keywordflow">else</span> { -<a name="l00368"></a>00368 vGet2FontInfo(0, -<a name="l00369"></a>00369 aucBuffer + iChpxIndex + 1, -<a name="l00370"></a>00370 (<span class="keywordtype">size_t</span>)iChpx, pFont); -<a name="l00371"></a>00371 } -<a name="l00372"></a>00372 iChpxIndex += iChpx + 1; -<a name="l00373"></a>00373 <span class="keywordflow">break</span>; -<a name="l00374"></a>00374 } -<a name="l00375"></a>00375 -<a name="l00376"></a>00376 <span class="keywordflow">switch</span> (iPapx) { -<a name="l00377"></a>00377 <span class="keywordflow">case</span> 0x00: -<a name="l00378"></a>00378 <span class="keywordflow">case</span> 0xff: -<a name="l00379"></a>00379 iPapxIndex++; -<a name="l00380"></a>00380 <span class="keywordflow">break</span>; -<a name="l00381"></a>00381 <span class="keywordflow">default</span>: -<a name="l00382"></a>00382 NO_DBG_PRINT_BLOCK(aucBuffer + iPapxIndex + 8, -<a name="l00383"></a>00383 iPapx - 7); -<a name="l00384"></a>00384 vGet2StyleInfo(0, aucBuffer + iPapxIndex + 8, -<a name="l00385"></a>00385 iPapx - 7, pStyle); -<a name="l00386"></a>00386 iPapxIndex += iPapx + 1; -<a name="l00387"></a>00387 <span class="keywordflow">break</span>; -<a name="l00388"></a>00388 } -<a name="l00389"></a>00389 tMaxIndex += 2; -<a name="l00390"></a>00390 -<a name="l00391"></a>00391 } -<a name="l00392"></a>00392 NO_DBG_DEC(iCounter); -<a name="l00393"></a>00393 } <span class="keywordflow">while</span> (iCounter > 0); -<a name="l00394"></a>00394 -<a name="l00395"></a>00395 <span class="comment">/* Fill records that are still empty */</span> -<a name="l00396"></a>00396 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00397"></a>00397 <span class="keywordflow">if</span> (!abFilled[iIndex]) { -<a name="l00398"></a>00398 NO_DBG_DEC(iIndex); -<a name="l00399"></a>00399 vGetDefaultStyle(&atStyleInfo[iIndex]); -<a name="l00400"></a>00400 vGetDefaultFont(&atFontInfo[iIndex], 0); -<a name="l00401"></a>00401 } -<a name="l00402"></a>00402 } -<a name="l00403"></a>00403 -<a name="l00404"></a>00404 <span class="comment">/* Clean up before you leave */</span> -<a name="l00405"></a>00405 abFilled = xfree(abFilled); -<a name="l00406"></a>00406 aucBuffer = xfree(aucBuffer); -<a name="l00407"></a>00407 } <span class="comment">/* end of vGet2Stylesheet */</span> -<a name="l00408"></a>00408 -<a name="l00409"></a>00409 <span class="comment">/*</span> -<a name="l00410"></a>00410 <span class="comment"> * Build the lists with Stylesheet Information for Word 6/7 files</span> -<a name="l00411"></a>00411 <span class="comment"> */</span> -<a name="l00412"></a>00412 <span class="keywordtype">void</span> -<a name="l00413"></a>00413 vGet6Stylesheet(FILE *pFile, ULONG ulStartBlock, -<a name="l00414"></a>00414 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00415"></a>00415 { -<a name="l00416"></a>00416 style_block_type *pStyle; -<a name="l00417"></a>00417 font_block_type *pFont; -<a name="l00418"></a>00418 UCHAR *aucBuffer; -<a name="l00419"></a>00419 ULONG ulBeginStshInfo; -<a name="l00420"></a>00420 <span class="keywordtype">size_t</span> tStshInfoLen, tOffset, tStdLen, tStdBaseInFile; -<a name="l00421"></a>00421 <span class="keywordtype">size_t</span> tPos, tNameLen, tUpxLen; -<a name="l00422"></a>00422 <span class="keywordtype">int</span> iIndex, iBaseStyleIndex, iCounter; -<a name="l00423"></a>00423 USHORT usTmp, usUpxCount, usStyleType, usBaseStyle; -<a name="l00424"></a>00424 USHORT usFtcStandardChpStsh; -<a name="l00425"></a>00425 -<a name="l00426"></a>00426 fail(pFile == NULL || aucHeader == NULL); -<a name="l00427"></a>00427 fail(ulStartBlock > MAX_BLOCKNUMBER && ulStartBlock != END_OF_CHAIN); -<a name="l00428"></a>00428 fail(aulBBD == NULL); -<a name="l00429"></a>00429 -<a name="l00430"></a>00430 ulBeginStshInfo = ulGetLong(0x60, aucHeader); <span class="comment">/* fcStshf */</span> -<a name="l00431"></a>00431 NO_DBG_HEX(ulBeginStshInfo); -<a name="l00432"></a>00432 tStshInfoLen = (size_t)ulGetLong(0x64, aucHeader); <span class="comment">/* lcbStshf */</span> -<a name="l00433"></a>00433 NO_DBG_DEC(tStshInfoLen); -<a name="l00434"></a>00434 -<a name="l00435"></a>00435 aucBuffer = xmalloc(tStshInfoLen); -<a name="l00436"></a>00436 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00437"></a>00437 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00438"></a>00438 aucBuffer, ulBeginStshInfo, tStshInfoLen)) { -<a name="l00439"></a>00439 aucBuffer = xfree(aucBuffer); -<a name="l00440"></a>00440 <span class="keywordflow">return</span>; -<a name="l00441"></a>00441 } -<a name="l00442"></a>00442 NO_DBG_PRINT_BLOCK(aucBuffer, tStshInfoLen); -<a name="l00443"></a>00443 -<a name="l00444"></a>00444 tStdCount = (size_t)usGetWord(2, aucBuffer); -<a name="l00445"></a>00445 NO_DBG_DEC(tStdCount); -<a name="l00446"></a>00446 tStdBaseInFile = (size_t)usGetWord(4, aucBuffer); -<a name="l00447"></a>00447 usFtcStandardChpStsh = usGetWord(14, aucBuffer); -<a name="l00448"></a>00448 NO_DBG_DEC(usFtcStandardChpStsh); -<a name="l00449"></a>00449 -<a name="l00450"></a>00450 atStyleInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(style_block_type)); -<a name="l00451"></a>00451 atFontInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(font_block_type)); -<a name="l00452"></a>00452 abFilled = xcalloc(tStdCount, <span class="keyword">sizeof</span>(BOOL)); -<a name="l00453"></a>00453 -<a name="l00454"></a>00454 <span class="keywordflow">do</span> { -<a name="l00455"></a>00455 iCounter = 0; -<a name="l00456"></a>00456 <span class="comment">/* Read the styles one-by-one */</span> -<a name="l00457"></a>00457 <span class="keywordflow">for</span> (iIndex = 0, tOffset = 2 + (<span class="keywordtype">size_t</span>)usGetWord(0, aucBuffer); -<a name="l00458"></a>00458 iIndex < (int)tStdCount; -<a name="l00459"></a>00459 iIndex++, tOffset += 2 + tStdLen) { -<a name="l00460"></a>00460 NO_DBG_DEC(tOffset); -<a name="l00461"></a>00461 tStdLen = (size_t)usGetWord(tOffset, aucBuffer); -<a name="l00462"></a>00462 NO_DBG_DEC(tStdLen); -<a name="l00463"></a>00463 <span class="keywordflow">if</span> (abFilled[iIndex]) { -<a name="l00464"></a>00464 <span class="comment">/* This record has already been filled */</span> -<a name="l00465"></a>00465 <span class="keywordflow">continue</span>; -<a name="l00466"></a>00466 } -<a name="l00467"></a>00467 pStyle = &atStyleInfo[iIndex]; -<a name="l00468"></a>00468 pFont = &atFontInfo[iIndex]; -<a name="l00469"></a>00469 <span class="keywordflow">if</span> (tStdLen == 0) { -<a name="l00470"></a>00470 <span class="comment">/* Empty record */</span> -<a name="l00471"></a>00471 vGetDefaultStyle(pStyle); -<a name="l00472"></a>00472 vGetDefaultFont(pFont, usFtcStandardChpStsh); -<a name="l00473"></a>00473 abFilled[iIndex] = TRUE; -<a name="l00474"></a>00474 <span class="keywordflow">continue</span>; -<a name="l00475"></a>00475 } -<a name="l00476"></a>00476 usTmp = usGetWord(tOffset + 4, aucBuffer); -<a name="l00477"></a>00477 usStyleType = usTmp % 16; -<a name="l00478"></a>00478 usBaseStyle = usTmp / 16; -<a name="l00479"></a>00479 NO_DBG_DEC(usStyleType); -<a name="l00480"></a>00480 NO_DBG_DEC(usBaseStyle); -<a name="l00481"></a>00481 <span class="keywordflow">if</span> (usBaseStyle == STI_NIL || usBaseStyle == STI_USER) { -<a name="l00482"></a>00482 <span class="comment">/* Based on the Nil style */</span> -<a name="l00483"></a>00483 vGetDefaultStyle(pStyle); -<a name="l00484"></a>00484 vGetDefaultFont(pFont, usFtcStandardChpStsh); -<a name="l00485"></a>00485 } <span class="keywordflow">else</span> { -<a name="l00486"></a>00486 iBaseStyleIndex = iGetStyleIndex(usBaseStyle); -<a name="l00487"></a>00487 NO_DBG_DEC(iBaseStyleIndex); -<a name="l00488"></a>00488 <span class="keywordflow">if</span> (iBaseStyleIndex < 0) { -<a name="l00489"></a>00489 <span class="comment">/* This base style is not known yet */</span> -<a name="l00490"></a>00490 <span class="keywordflow">continue</span>; -<a name="l00491"></a>00491 } -<a name="l00492"></a>00492 fail(iBaseStyleIndex >= (<span class="keywordtype">int</span>)tStdCount); -<a name="l00493"></a>00493 fail(!abFilled[iBaseStyleIndex]); -<a name="l00494"></a>00494 <span class="comment">/* Based on the specified base style */</span> -<a name="l00495"></a>00495 *pStyle = atStyleInfo[iBaseStyleIndex]; -<a name="l00496"></a>00496 pStyle->usIstd = ISTD_INVALID; -<a name="l00497"></a>00497 *pFont = atFontInfo[iBaseStyleIndex]; -<a name="l00498"></a>00498 } -<a name="l00499"></a>00499 abFilled[iIndex] = TRUE; -<a name="l00500"></a>00500 iCounter++; -<a name="l00501"></a>00501 <span class="comment">/* STD */</span> -<a name="l00502"></a>00502 usTmp = usGetWord(tOffset + 6, aucBuffer); -<a name="l00503"></a>00503 usUpxCount = usTmp % 16; -<a name="l00504"></a>00504 pStyle->usIstdNext = usTmp / 16;; -<a name="l00505"></a>00505 NO_DBG_DEC(usUpxCount); -<a name="l00506"></a>00506 tPos = 2 + tStdBaseInFile; -<a name="l00507"></a>00507 NO_DBG_DEC(tPos); -<a name="l00508"></a>00508 tNameLen = (size_t)ucGetByte(tOffset + tPos, aucBuffer); -<a name="l00509"></a>00509 NO_DBG_DEC(tNameLen); -<a name="l00510"></a>00510 NO_DBG_STRN(aucBuffer + tOffset + tPos + 1, tNameLen); -<a name="l00511"></a>00511 tNameLen++; <span class="comment">/* Include the ASCII NULL character */</span> -<a name="l00512"></a>00512 tPos += 1 + tNameLen; -<a name="l00513"></a>00513 <span class="keywordflow">if</span> (odd(tPos)) { -<a name="l00514"></a>00514 tPos++; -<a name="l00515"></a>00515 } -<a name="l00516"></a>00516 NO_DBG_DEC(tPos); -<a name="l00517"></a>00517 <span class="keywordflow">if</span> (tPos >= tStdLen) { -<a name="l00518"></a>00518 <span class="keywordflow">continue</span>; -<a name="l00519"></a>00519 } -<a name="l00520"></a>00520 tUpxLen = (size_t)usGetWord(tOffset + tPos, aucBuffer); -<a name="l00521"></a>00521 NO_DBG_DEC(tUpxLen); -<a name="l00522"></a>00522 <span class="keywordflow">if</span> (tPos + tUpxLen > tStdLen) { -<a name="l00523"></a>00523 <span class="comment">/* UPX length too large to be a record */</span> -<a name="l00524"></a>00524 DBG_DEC_C(tPos + tUpxLen > tStdLen, -<a name="l00525"></a>00525 tPos + tUpxLen); -<a name="l00526"></a>00526 <span class="keywordflow">continue</span>; -<a name="l00527"></a>00527 } -<a name="l00528"></a>00528 <span class="keywordflow">if</span> (usStyleType == SGC_PAP && usUpxCount >= 1) { -<a name="l00529"></a>00529 <span class="keywordflow">if</span> (tUpxLen >= 2) { -<a name="l00530"></a>00530 NO_DBG_PRINT_BLOCK( -<a name="l00531"></a>00531 aucBuffer + tOffset + tPos + 2, -<a name="l00532"></a>00532 tUpxLen); -<a name="l00533"></a>00533 pStyle->usIstd = usGetWord( -<a name="l00534"></a>00534 tOffset + tPos + 2, aucBuffer); -<a name="l00535"></a>00535 NO_DBG_DEC(pStyle->usIstd); -<a name="l00536"></a>00536 NO_DBG_DEC(pStyle->usIstdNext); -<a name="l00537"></a>00537 vGet6StyleInfo(0, -<a name="l00538"></a>00538 aucBuffer + tOffset + tPos + 4, -<a name="l00539"></a>00539 tUpxLen - 2, pStyle); -<a name="l00540"></a>00540 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00541"></a>00541 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00542"></a>00542 NO_DBG_HEX(pStyle->ucAlignment); -<a name="l00543"></a>00543 } -<a name="l00544"></a>00544 tPos += 2 + tUpxLen; -<a name="l00545"></a>00545 <span class="keywordflow">if</span> (odd(tPos)) { -<a name="l00546"></a>00546 tPos++; -<a name="l00547"></a>00547 } -<a name="l00548"></a>00548 NO_DBG_DEC(tPos); -<a name="l00549"></a>00549 tUpxLen = (size_t)usGetWord( -<a name="l00550"></a>00550 tOffset + tPos, aucBuffer); -<a name="l00551"></a>00551 NO_DBG_DEC(tUpxLen); -<a name="l00552"></a>00552 } -<a name="l00553"></a>00553 <span class="keywordflow">if</span> (tUpxLen == 0 || tPos + tUpxLen > tStdLen) { -<a name="l00554"></a>00554 <span class="comment">/* Too small or too large to be a record */</span> -<a name="l00555"></a>00555 DBG_DEC_C(tPos + tUpxLen > tStdLen, -<a name="l00556"></a>00556 tPos + tUpxLen); -<a name="l00557"></a>00557 <span class="keywordflow">continue</span>; -<a name="l00558"></a>00558 } -<a name="l00559"></a>00559 <span class="keywordflow">if</span> ((usStyleType == SGC_PAP && usUpxCount >= 2) || -<a name="l00560"></a>00560 (usStyleType == SGC_CHP && usUpxCount >= 1)) { -<a name="l00561"></a>00561 NO_DBG_PRINT_BLOCK( -<a name="l00562"></a>00562 aucBuffer + tOffset + tPos + 2, -<a name="l00563"></a>00563 tUpxLen); -<a name="l00564"></a>00564 vGet6FontInfo(0, ISTD_INVALID, -<a name="l00565"></a>00565 aucBuffer + tOffset + tPos + 2, -<a name="l00566"></a>00566 (<span class="keywordtype">int</span>)tUpxLen, pFont); -<a name="l00567"></a>00567 NO_DBG_DEC(pFont->usFontSize); -<a name="l00568"></a>00568 NO_DBG_DEC(pFont->ucFontcolor); -<a name="l00569"></a>00569 NO_DBG_HEX(pFont->usFontStyle); -<a name="l00570"></a>00570 } -<a name="l00571"></a>00571 } -<a name="l00572"></a>00572 NO_DBG_DEC(iCounter); -<a name="l00573"></a>00573 } <span class="keywordflow">while</span> (iCounter > 0); -<a name="l00574"></a>00574 -<a name="l00575"></a>00575 <span class="comment">/* Fill records that are still empty */</span> -<a name="l00576"></a>00576 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00577"></a>00577 <span class="keywordflow">if</span> (!abFilled[iIndex]) { -<a name="l00578"></a>00578 NO_DBG_DEC(iIndex); -<a name="l00579"></a>00579 vGetDefaultStyle(&atStyleInfo[iIndex]); -<a name="l00580"></a>00580 vGetDefaultFont(&atFontInfo[iIndex], -<a name="l00581"></a>00581 usFtcStandardChpStsh); -<a name="l00582"></a>00582 } -<a name="l00583"></a>00583 } -<a name="l00584"></a>00584 -<a name="l00585"></a>00585 <span class="comment">/* Clean up before you leave */</span> -<a name="l00586"></a>00586 abFilled = xfree(abFilled); -<a name="l00587"></a>00587 aucBuffer = xfree(aucBuffer); -<a name="l00588"></a>00588 } <span class="comment">/* end of vGet6Stylesheet */</span> -<a name="l00589"></a>00589 -<a name="l00590"></a>00590 <span class="comment">/*</span> -<a name="l00591"></a>00591 <span class="comment"> * Build the lists with Stylesheet Information for Word 8/9/10 files</span> -<a name="l00592"></a>00592 <span class="comment"> */</span> -<a name="l00593"></a>00593 <span class="keywordtype">void</span> -<a name="l00594"></a>00594 vGet8Stylesheet(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00595"></a>00595 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00596"></a>00596 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00597"></a>00597 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00598"></a>00598 { -<a name="l00599"></a>00599 style_block_type *pStyle; -<a name="l00600"></a>00600 font_block_type *pFont; -<a name="l00601"></a>00601 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00602"></a>00602 UCHAR *aucBuffer; -<a name="l00603"></a>00603 ULONG ulBeginStshInfo; -<a name="l00604"></a>00604 <span class="keywordtype">size_t</span> tStshInfoLen, tBlockDepotLen, tOffset, tStdLen, tStdBaseInFile; -<a name="l00605"></a>00605 <span class="keywordtype">size_t</span> tBlockSize, tPos, tNameLen, tUpxLen; -<a name="l00606"></a>00606 <span class="keywordtype">int</span> iIndex, iBaseStyleIndex, iCounter; -<a name="l00607"></a>00607 USHORT usTmp, usUpxCount, usStyleType, usBaseStyle; -<a name="l00608"></a>00608 USHORT usFtcStandardChpStsh; -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 fail(pFile == NULL || pPPS == NULL || aucHeader == NULL); -<a name="l00611"></a>00611 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00612"></a>00612 -<a name="l00613"></a>00613 ulBeginStshInfo = ulGetLong(0xa2, aucHeader); <span class="comment">/* fcStshf */</span> -<a name="l00614"></a>00614 NO_DBG_HEX(ulBeginStshInfo); -<a name="l00615"></a>00615 tStshInfoLen = (size_t)ulGetLong(0xa6, aucHeader); <span class="comment">/* lcbStshf */</span> -<a name="l00616"></a>00616 NO_DBG_DEC(tStshInfoLen); -<a name="l00617"></a>00617 -<a name="l00618"></a>00618 NO_DBG_DEC(pPPS->tTable.ulSB); -<a name="l00619"></a>00619 NO_DBG_HEX(pPPS->tTable.ulSize); -<a name="l00620"></a>00620 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00621"></a>00621 DBG_MSG(<span class="stringliteral">"No stylesheet information"</span>); -<a name="l00622"></a>00622 <span class="keywordflow">return</span>; -<a name="l00623"></a>00623 } -<a name="l00624"></a>00624 -<a name="l00625"></a>00625 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00626"></a>00626 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00627"></a>00627 aulBlockDepot = aulSBD; -<a name="l00628"></a>00628 tBlockDepotLen = tSBDLen; -<a name="l00629"></a>00629 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00630"></a>00630 } <span class="keywordflow">else</span> { -<a name="l00631"></a>00631 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00632"></a>00632 aulBlockDepot = aulBBD; -<a name="l00633"></a>00633 tBlockDepotLen = tBBDLen; -<a name="l00634"></a>00634 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00635"></a>00635 } -<a name="l00636"></a>00636 aucBuffer = xmalloc(tStshInfoLen); -<a name="l00637"></a>00637 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00638"></a>00638 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00639"></a>00639 aucBuffer, ulBeginStshInfo, tStshInfoLen)) { -<a name="l00640"></a>00640 aucBuffer = xfree(aucBuffer); -<a name="l00641"></a>00641 <span class="keywordflow">return</span>; -<a name="l00642"></a>00642 } -<a name="l00643"></a>00643 NO_DBG_PRINT_BLOCK(aucBuffer, tStshInfoLen); -<a name="l00644"></a>00644 -<a name="l00645"></a>00645 tStdCount = (size_t)usGetWord(2, aucBuffer); -<a name="l00646"></a>00646 NO_DBG_DEC(tStdCount); -<a name="l00647"></a>00647 tStdBaseInFile = (size_t)usGetWord(4, aucBuffer); -<a name="l00648"></a>00648 usFtcStandardChpStsh = usGetWord(14, aucBuffer); -<a name="l00649"></a>00649 NO_DBG_DEC(usFtcStandardChpStsh); -<a name="l00650"></a>00650 -<a name="l00651"></a>00651 atStyleInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(style_block_type)); -<a name="l00652"></a>00652 atFontInfo = xcalloc(tStdCount, <span class="keyword">sizeof</span>(font_block_type)); -<a name="l00653"></a>00653 abFilled = xcalloc(tStdCount, <span class="keyword">sizeof</span>(BOOL)); -<a name="l00654"></a>00654 -<a name="l00655"></a>00655 <span class="keywordflow">do</span> { -<a name="l00656"></a>00656 iCounter = 0; -<a name="l00657"></a>00657 <span class="comment">/* Read the styles one-by-one */</span> -<a name="l00658"></a>00658 <span class="keywordflow">for</span> (iIndex = 0, tOffset = 2 + (<span class="keywordtype">size_t</span>)usGetWord(0, aucBuffer); -<a name="l00659"></a>00659 iIndex < (int)tStdCount; -<a name="l00660"></a>00660 iIndex++, tOffset += 2 + tStdLen) { -<a name="l00661"></a>00661 NO_DBG_DEC(tOffset); -<a name="l00662"></a>00662 tStdLen = (size_t)usGetWord(tOffset, aucBuffer); -<a name="l00663"></a>00663 NO_DBG_DEC(tStdLen); -<a name="l00664"></a>00664 <span class="keywordflow">if</span> (abFilled[iIndex]) { -<a name="l00665"></a>00665 <span class="comment">/* This record has already been filled */</span> -<a name="l00666"></a>00666 <span class="keywordflow">continue</span>; -<a name="l00667"></a>00667 } -<a name="l00668"></a>00668 pStyle = &atStyleInfo[iIndex]; -<a name="l00669"></a>00669 pFont = &atFontInfo[iIndex]; -<a name="l00670"></a>00670 <span class="keywordflow">if</span> (tStdLen == 0) { -<a name="l00671"></a>00671 <span class="comment">/* Empty record */</span> -<a name="l00672"></a>00672 vGetDefaultStyle(pStyle); -<a name="l00673"></a>00673 vGetDefaultFont(pFont, usFtcStandardChpStsh); -<a name="l00674"></a>00674 abFilled[iIndex] = TRUE; -<a name="l00675"></a>00675 <span class="keywordflow">continue</span>; -<a name="l00676"></a>00676 } -<a name="l00677"></a>00677 usTmp = usGetWord(tOffset + 4, aucBuffer); -<a name="l00678"></a>00678 usStyleType = usTmp % 16; -<a name="l00679"></a>00679 usBaseStyle = usTmp / 16; -<a name="l00680"></a>00680 NO_DBG_DEC(usStyleType); -<a name="l00681"></a>00681 NO_DBG_DEC(usBaseStyle); -<a name="l00682"></a>00682 <span class="keywordflow">if</span> (usBaseStyle == STI_NIL || usBaseStyle == STI_USER) { -<a name="l00683"></a>00683 <span class="comment">/* Based on the Nil style */</span> -<a name="l00684"></a>00684 vGetDefaultStyle(pStyle); -<a name="l00685"></a>00685 vGetDefaultFont(pFont, usFtcStandardChpStsh); -<a name="l00686"></a>00686 } <span class="keywordflow">else</span> { -<a name="l00687"></a>00687 iBaseStyleIndex = iGetStyleIndex(usBaseStyle); -<a name="l00688"></a>00688 NO_DBG_DEC(iBaseStyleIndex); -<a name="l00689"></a>00689 <span class="keywordflow">if</span> (iBaseStyleIndex < 0) { -<a name="l00690"></a>00690 <span class="comment">/* This base style is not known yet */</span> -<a name="l00691"></a>00691 <span class="keywordflow">continue</span>; -<a name="l00692"></a>00692 } -<a name="l00693"></a>00693 fail(iBaseStyleIndex >= (<span class="keywordtype">int</span>)tStdCount); -<a name="l00694"></a>00694 fail(!abFilled[iBaseStyleIndex]); -<a name="l00695"></a>00695 <span class="comment">/* Based on the specified base style */</span> -<a name="l00696"></a>00696 *pStyle = atStyleInfo[iBaseStyleIndex]; -<a name="l00697"></a>00697 pStyle->usIstd = ISTD_INVALID; -<a name="l00698"></a>00698 *pFont = atFontInfo[iBaseStyleIndex]; -<a name="l00699"></a>00699 } -<a name="l00700"></a>00700 abFilled[iIndex] = TRUE; -<a name="l00701"></a>00701 iCounter++; -<a name="l00702"></a>00702 <span class="comment">/* STD */</span> -<a name="l00703"></a>00703 usTmp = usGetWord(tOffset + 6, aucBuffer); -<a name="l00704"></a>00704 usUpxCount = usTmp % 16; -<a name="l00705"></a>00705 pStyle->usIstdNext = usTmp / 16; -<a name="l00706"></a>00706 NO_DBG_DEC(usUpxCount); -<a name="l00707"></a>00707 tPos = 2 + tStdBaseInFile; -<a name="l00708"></a>00708 NO_DBG_DEC(tPos); -<a name="l00709"></a>00709 tNameLen = (size_t)usGetWord(tOffset + tPos, aucBuffer); -<a name="l00710"></a>00710 NO_DBG_DEC(tNameLen); -<a name="l00711"></a>00711 tNameLen *= 2; <span class="comment">/* From Unicode characters to bytes */</span> -<a name="l00712"></a>00712 NO_DBG_UNICODE_N(aucBuffer + tOffset + tPos + 2, -<a name="l00713"></a>00713 tNameLen); -<a name="l00714"></a>00714 tNameLen += 2; <span class="comment">/* Include the Unicode NULL character */</span> -<a name="l00715"></a>00715 tPos += 2 + tNameLen; -<a name="l00716"></a>00716 <span class="keywordflow">if</span> (odd(tPos)) { -<a name="l00717"></a>00717 tPos++; -<a name="l00718"></a>00718 } -<a name="l00719"></a>00719 NO_DBG_DEC(tPos); -<a name="l00720"></a>00720 <span class="keywordflow">if</span> (tPos >= tStdLen) { -<a name="l00721"></a>00721 <span class="keywordflow">continue</span>; -<a name="l00722"></a>00722 } -<a name="l00723"></a>00723 tUpxLen = (size_t)usGetWord(tOffset + tPos, aucBuffer); -<a name="l00724"></a>00724 NO_DBG_DEC(tUpxLen); -<a name="l00725"></a>00725 <span class="keywordflow">if</span> (tPos + tUpxLen > tStdLen) { -<a name="l00726"></a>00726 <span class="comment">/* UPX length too large to be a record */</span> -<a name="l00727"></a>00727 DBG_DEC_C(tPos + tUpxLen > tStdLen, -<a name="l00728"></a>00728 tPos + tUpxLen); -<a name="l00729"></a>00729 <span class="keywordflow">continue</span>; -<a name="l00730"></a>00730 } -<a name="l00731"></a>00731 <span class="keywordflow">if</span> (usStyleType == SGC_PAP && usUpxCount >= 1) { -<a name="l00732"></a>00732 <span class="keywordflow">if</span> (tUpxLen >= 2) { -<a name="l00733"></a>00733 NO_DBG_PRINT_BLOCK( -<a name="l00734"></a>00734 aucBuffer + tOffset + tPos + 2, -<a name="l00735"></a>00735 tUpxLen); -<a name="l00736"></a>00736 pStyle->usIstd = usGetWord( -<a name="l00737"></a>00737 tOffset + tPos + 2, aucBuffer); -<a name="l00738"></a>00738 NO_DBG_DEC(pStyle->usIstd); -<a name="l00739"></a>00739 NO_DBG_DEC(pStyle->usIstdNext); -<a name="l00740"></a>00740 vGet8StyleInfo(0, -<a name="l00741"></a>00741 aucBuffer + tOffset + tPos + 4, -<a name="l00742"></a>00742 tUpxLen - 2, pStyle); -<a name="l00743"></a>00743 NO_DBG_DEC(pStyle->sLeftIndent); -<a name="l00744"></a>00744 NO_DBG_DEC(pStyle->sRightIndent); -<a name="l00745"></a>00745 NO_DBG_HEX(pStyle->ucAlignment); -<a name="l00746"></a>00746 } -<a name="l00747"></a>00747 tPos += 2 + tUpxLen; -<a name="l00748"></a>00748 <span class="keywordflow">if</span> (odd(tPos)) { -<a name="l00749"></a>00749 tPos++; -<a name="l00750"></a>00750 } -<a name="l00751"></a>00751 NO_DBG_DEC(tPos); -<a name="l00752"></a>00752 tUpxLen = (size_t)usGetWord( -<a name="l00753"></a>00753 tOffset + tPos, aucBuffer); -<a name="l00754"></a>00754 NO_DBG_DEC(tUpxLen); -<a name="l00755"></a>00755 } -<a name="l00756"></a>00756 <span class="keywordflow">if</span> (tUpxLen == 0 || tPos + tUpxLen > tStdLen) { -<a name="l00757"></a>00757 <span class="comment">/* Too small or too large to be a record */</span> -<a name="l00758"></a>00758 DBG_DEC_C(tPos + tUpxLen > tStdLen, -<a name="l00759"></a>00759 tPos + tUpxLen); -<a name="l00760"></a>00760 <span class="keywordflow">continue</span>; -<a name="l00761"></a>00761 } -<a name="l00762"></a>00762 <span class="keywordflow">if</span> ((usStyleType == SGC_PAP && usUpxCount >= 2) || -<a name="l00763"></a>00763 (usStyleType == SGC_CHP && usUpxCount >= 1)) { -<a name="l00764"></a>00764 NO_DBG_PRINT_BLOCK( -<a name="l00765"></a>00765 aucBuffer + tOffset + tPos + 2, -<a name="l00766"></a>00766 tUpxLen); -<a name="l00767"></a>00767 vGet8FontInfo(0, ISTD_INVALID, -<a name="l00768"></a>00768 aucBuffer + tOffset + tPos + 2, -<a name="l00769"></a>00769 (<span class="keywordtype">int</span>)tUpxLen, pFont); -<a name="l00770"></a>00770 NO_DBG_DEC(pFont->usFontSize); -<a name="l00771"></a>00771 NO_DBG_DEC(pFont->ucFontcolor); -<a name="l00772"></a>00772 NO_DBG_HEX(pFont->usFontStyle); -<a name="l00773"></a>00773 } -<a name="l00774"></a>00774 } -<a name="l00775"></a>00775 NO_DBG_DEC(iCounter); -<a name="l00776"></a>00776 } <span class="keywordflow">while</span> (iCounter > 0); -<a name="l00777"></a>00777 -<a name="l00778"></a>00778 <span class="comment">/* Fill records that are still empty */</span> -<a name="l00779"></a>00779 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00780"></a>00780 <span class="keywordflow">if</span> (!abFilled[iIndex]) { -<a name="l00781"></a>00781 NO_DBG_DEC(iIndex); -<a name="l00782"></a>00782 vGetDefaultStyle(&atStyleInfo[iIndex]); -<a name="l00783"></a>00783 vGetDefaultFont(&atFontInfo[iIndex], -<a name="l00784"></a>00784 usFtcStandardChpStsh); -<a name="l00785"></a>00785 } -<a name="l00786"></a>00786 } -<a name="l00787"></a>00787 -<a name="l00788"></a>00788 <span class="comment">/* Clean up before you leave */</span> -<a name="l00789"></a>00789 abFilled = xfree(abFilled); -<a name="l00790"></a>00790 aucBuffer = xfree(aucBuffer); -<a name="l00791"></a>00791 } <span class="comment">/* end of vGet8Stylesheet */</span> -<a name="l00792"></a>00792 -<a name="l00793"></a>00793 <span class="comment">/*</span> -<a name="l00794"></a>00794 <span class="comment"> * vFillStyleFromStylesheet - fill a style struct with stylesheet info</span> -<a name="l00795"></a>00795 <span class="comment"> */</span> -<a name="l00796"></a>00796 <span class="keywordtype">void</span> -<a name="l00797"></a>00797 vFillStyleFromStylesheet(USHORT usIstd, style_block_type *pStyle) -<a name="l00798"></a>00798 { -<a name="l00799"></a>00799 <span class="keywordtype">int</span> iIndex; -<a name="l00800"></a>00800 -<a name="l00801"></a>00801 fail(pStyle == NULL); -<a name="l00802"></a>00802 -<a name="l00803"></a>00803 <span class="keywordflow">if</span> (usIstd != ISTD_INVALID && usIstd != STI_NIL && usIstd != STI_USER) { -<a name="l00804"></a>00804 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00805"></a>00805 <span class="keywordflow">if</span> (atStyleInfo[iIndex].usIstd == usIstd) { -<a name="l00806"></a>00806 <span class="comment">/* Right index found; return style */</span> -<a name="l00807"></a>00807 *pStyle = atStyleInfo[iIndex]; -<a name="l00808"></a>00808 <span class="keywordflow">return</span>; -<a name="l00809"></a>00809 } -<a name="l00810"></a>00810 } -<a name="l00811"></a>00811 } -<a name="l00812"></a>00812 -<a name="l00813"></a>00813 vGetDefaultStyle(pStyle); -<a name="l00814"></a>00814 pStyle->usIstd = usIstd; -<a name="l00815"></a>00815 } <span class="comment">/* end of vFillStyleFromStylesheet */</span> -<a name="l00816"></a>00816 -<a name="l00817"></a>00817 <span class="comment">/*</span> -<a name="l00818"></a>00818 <span class="comment"> * vFillFontFromStylesheet - fill a font struct with stylesheet info</span> -<a name="l00819"></a>00819 <span class="comment"> */</span> -<a name="l00820"></a>00820 <span class="keywordtype">void</span> -<a name="l00821"></a>00821 vFillFontFromStylesheet(USHORT usIstd, font_block_type *pFont) -<a name="l00822"></a>00822 { -<a name="l00823"></a>00823 <span class="keywordtype">int</span> iIndex; -<a name="l00824"></a>00824 -<a name="l00825"></a>00825 fail(pFont == NULL); -<a name="l00826"></a>00826 -<a name="l00827"></a>00827 <span class="keywordflow">if</span> (usIstd != ISTD_INVALID && usIstd != STI_NIL && usIstd != STI_USER) { -<a name="l00828"></a>00828 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tStdCount; iIndex++) { -<a name="l00829"></a>00829 <span class="keywordflow">if</span> (atStyleInfo[iIndex].usIstd == usIstd) { -<a name="l00830"></a>00830 <span class="comment">/* Right index found; return font */</span> -<a name="l00831"></a>00831 *pFont = atFontInfo[iIndex]; -<a name="l00832"></a>00832 <span class="keywordflow">return</span>; -<a name="l00833"></a>00833 } -<a name="l00834"></a>00834 } -<a name="l00835"></a>00835 } -<a name="l00836"></a>00836 -<a name="l00837"></a>00837 vGetDefaultFont(pFont, 0); -<a name="l00838"></a>00838 } <span class="comment">/* end of vFillFontFromStylesheet */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/summary_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,904 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/summary.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/summary.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * summary.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the summary information of a Word document</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <time.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="preprocessor">#define P_HEADER_SZ 28</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define P_SECTIONLIST_SZ 20</span> -<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define P_LENGTH_SZ 4</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define P_SECTION_MAX_SZ (2 * P_SECTIONLIST_SZ + P_LENGTH_SZ)</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define P_SECTION_SZ(x) ((x) * P_SECTIONLIST_SZ + P_LENGTH_SZ)</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span> -<a name="l00019"></a>00019 <span class="preprocessor">#define PID_TITLE 2</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define PID_SUBJECT 3</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define PID_AUTHOR 4</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define PID_CREATE_DTM 12</span> -<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define PID_LASTSAVE_DTM 13</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define PID_APPNAME 18</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span> -<a name="l00026"></a>00026 <span class="preprocessor">#define PIDD_MANAGER 14</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define PIDD_COMPANY 15</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span> -<a name="l00029"></a>00029 <span class="preprocessor">#define VT_LPSTR 30</span> -<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define VT_FILETIME 64</span> -<a name="l00031"></a>00031 <span class="preprocessor"></span> -<a name="l00032"></a>00032 <span class="preprocessor">#define TIME_OFFSET_HI 0x019db1de</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#define TIME_OFFSET_LO 0xd53e8000</span> -<a name="l00034"></a>00034 <span class="preprocessor"></span> -<a name="l00035"></a>00035 <span class="keyword">static</span> <span class="keywordtype">char</span> *szTitle = NULL; -<a name="l00036"></a>00036 <span class="keyword">static</span> <span class="keywordtype">char</span> *szSubject = NULL; -<a name="l00037"></a>00037 <span class="keyword">static</span> <span class="keywordtype">char</span> *szAuthor = NULL; -<a name="l00038"></a>00038 <span class="keyword">static</span> time_t tCreateDtm = (time_t)-1; -<a name="l00039"></a>00039 <span class="keyword">static</span> time_t tLastSaveDtm= (time_t)-1; -<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keywordtype">char</span> *szAppName = NULL; -<a name="l00041"></a>00041 <span class="keyword">static</span> <span class="keywordtype">char</span> *szManager = NULL; -<a name="l00042"></a>00042 <span class="keyword">static</span> <span class="keywordtype">char</span> *szCompany = NULL; -<a name="l00043"></a>00043 <span class="keyword">static</span> USHORT usLid = (USHORT)-1; -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/*</span> -<a name="l00047"></a>00047 <span class="comment"> * vDestroySummaryInfo - destroy the summary information</span> -<a name="l00048"></a>00048 <span class="comment"> */</span> -<a name="l00049"></a>00049 <span class="keywordtype">void</span> -<a name="l00050"></a>00050 vDestroySummaryInfo(<span class="keywordtype">void</span>) -<a name="l00051"></a>00051 { -<a name="l00052"></a>00052 TRACE_MSG(<span class="stringliteral">"vDestroySummaryInfo"</span>); -<a name="l00053"></a>00053 -<a name="l00054"></a>00054 szTitle = xfree(szTitle); -<a name="l00055"></a>00055 szSubject = xfree(szSubject); -<a name="l00056"></a>00056 szAuthor = xfree(szAuthor); -<a name="l00057"></a>00057 tCreateDtm = (time_t)-1; -<a name="l00058"></a>00058 tLastSaveDtm = (time_t)-1; -<a name="l00059"></a>00059 szAppName = xfree(szAppName); -<a name="l00060"></a>00060 szManager = xfree(szManager); -<a name="l00061"></a>00061 szCompany = xfree(szCompany); -<a name="l00062"></a>00062 usLid = (USHORT)-1; -<a name="l00063"></a>00063 } <span class="comment">/* end of vDestroySummaryInfo */</span> -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="comment">/*</span> -<a name="l00066"></a>00066 <span class="comment"> * tConvertDosDate - convert DOS date format</span> -<a name="l00067"></a>00067 <span class="comment"> *</span> -<a name="l00068"></a>00068 <span class="comment"> * returns Unix time_t or -1</span> -<a name="l00069"></a>00069 <span class="comment"> */</span> -<a name="l00070"></a>00070 <span class="keyword">static</span> time_t -<a name="l00071"></a>00071 tConvertDosDate(<span class="keyword">const</span> <span class="keywordtype">char</span> *szDosDate) -<a name="l00072"></a>00072 { -<a name="l00073"></a>00073 <span class="keyword">struct </span>tm tTime; -<a name="l00074"></a>00074 <span class="keyword">const</span> <span class="keywordtype">char</span> *pcTmp; -<a name="l00075"></a>00075 time_t tResult; -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 memset(&tTime, 0, <span class="keyword">sizeof</span>(tTime)); -<a name="l00078"></a>00078 pcTmp = szDosDate; -<a name="l00079"></a>00079 <span class="comment">/* Get the month */</span> -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00081"></a>00081 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00082"></a>00082 } -<a name="l00083"></a>00083 tTime.tm_mon = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00084"></a>00084 pcTmp++; -<a name="l00085"></a>00085 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00086"></a>00086 tTime.tm_mon *= 10; -<a name="l00087"></a>00087 tTime.tm_mon += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00088"></a>00088 pcTmp++; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 <span class="comment">/* Get the first separater */</span> -<a name="l00091"></a>00091 <span class="keywordflow">if</span> (isalnum(*pcTmp)) { -<a name="l00092"></a>00092 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00093"></a>00093 } -<a name="l00094"></a>00094 pcTmp++; -<a name="l00095"></a>00095 <span class="comment">/* Get the day */</span> -<a name="l00096"></a>00096 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00097"></a>00097 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00098"></a>00098 } -<a name="l00099"></a>00099 tTime.tm_mday = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00100"></a>00100 pcTmp++; -<a name="l00101"></a>00101 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00102"></a>00102 tTime.tm_mday *= 10; -<a name="l00103"></a>00103 tTime.tm_mday += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00104"></a>00104 pcTmp++; -<a name="l00105"></a>00105 } -<a name="l00106"></a>00106 <span class="comment">/* Get the second separater */</span> -<a name="l00107"></a>00107 <span class="keywordflow">if</span> (isalnum(*pcTmp)) { -<a name="l00108"></a>00108 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00109"></a>00109 } -<a name="l00110"></a>00110 pcTmp++; -<a name="l00111"></a>00111 <span class="comment">/* Get the year */</span> -<a name="l00112"></a>00112 <span class="keywordflow">if</span> (!isdigit(*pcTmp)) { -<a name="l00113"></a>00113 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00114"></a>00114 } -<a name="l00115"></a>00115 tTime.tm_year = (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00116"></a>00116 pcTmp++; -<a name="l00117"></a>00117 <span class="keywordflow">if</span> (isdigit(*pcTmp)) { -<a name="l00118"></a>00118 tTime.tm_year *= 10; -<a name="l00119"></a>00119 tTime.tm_year += (int)(*pcTmp - <span class="charliteral">'0'</span>); -<a name="l00120"></a>00120 pcTmp++; -<a name="l00121"></a>00121 } -<a name="l00122"></a>00122 <span class="comment">/* Check the values */</span> -<a name="l00123"></a>00123 <span class="keywordflow">if</span> (tTime.tm_mon == 0 || tTime.tm_mday == 0 || tTime.tm_mday > 31) { -<a name="l00124"></a>00124 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00125"></a>00125 } -<a name="l00126"></a>00126 <span class="comment">/* Correct the values */</span> -<a name="l00127"></a>00127 tTime.tm_mon--; <span class="comment">/* From 01-12 to 00-11 */</span> -<a name="l00128"></a>00128 <span class="keywordflow">if</span> (tTime.tm_year < 80) { -<a name="l00129"></a>00129 tTime.tm_year += 100; <span class="comment">/* 00 means 2000 is 100 */</span> -<a name="l00130"></a>00130 } -<a name="l00131"></a>00131 tTime.tm_isdst = -1; -<a name="l00132"></a>00132 tResult = mktime(&tTime); -<a name="l00133"></a>00133 NO_DBG_MSG(ctime(&tResult)); -<a name="l00134"></a>00134 <span class="keywordflow">return</span> tResult; -<a name="l00135"></a>00135 } <span class="comment">/* end of tConvertDosDate */</span> -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 <span class="comment">/*</span> -<a name="l00138"></a>00138 <span class="comment"> * szLpstr - get a zero terminate string property</span> -<a name="l00139"></a>00139 <span class="comment"> */</span> -<a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">char</span> * -<a name="l00141"></a>00141 szLpstr(ULONG ulOffset, <span class="keyword">const</span> UCHAR *aucBuffer) -<a name="l00142"></a>00142 { -<a name="l00143"></a>00143 <span class="keywordtype">char</span> *szStart, *szResult, *szTmp; -<a name="l00144"></a>00144 <span class="keywordtype">size_t</span> tSize; -<a name="l00145"></a>00145 -<a name="l00146"></a>00146 tSize = (size_t)ulGetLong(ulOffset + 4, aucBuffer); -<a name="l00147"></a>00147 NO_DBG_DEC(tSize); -<a name="l00148"></a>00148 <span class="keywordflow">if</span> (tSize == 0) { -<a name="l00149"></a>00149 <span class="keywordflow">return</span> NULL; -<a name="l00150"></a>00150 } -<a name="l00151"></a>00151 <span class="comment">/* Remove white space from the start of the string */</span> -<a name="l00152"></a>00152 szStart = (<span class="keywordtype">char</span> *)aucBuffer + ulOffset + 8; -<a name="l00153"></a>00153 NO_DBG_MSG(szStart); -<a name="l00154"></a>00154 fail(strlen(szStart) >= tSize); -<a name="l00155"></a>00155 <span class="keywordflow">while</span> (isspace(*szStart)) { -<a name="l00156"></a>00156 szStart++; -<a name="l00157"></a>00157 } -<a name="l00158"></a>00158 <span class="keywordflow">if</span> (szStart[0] == <span class="charliteral">'\0'</span>) { -<a name="l00159"></a>00159 <span class="keywordflow">return</span> NULL; -<a name="l00160"></a>00160 } -<a name="l00161"></a>00161 szResult = xstrdup(szStart); -<a name="l00162"></a>00162 <span class="comment">/* Remove white space from the end of the string */</span> -<a name="l00163"></a>00163 szTmp = szResult + strlen(szResult) - 1; -<a name="l00164"></a>00164 <span class="keywordflow">while</span> (isspace(*szTmp)) { -<a name="l00165"></a>00165 *szTmp = <span class="charliteral">'\0'</span>; -<a name="l00166"></a>00166 szTmp--; -<a name="l00167"></a>00167 } -<a name="l00168"></a>00168 NO_DBG_MSG(szResult); -<a name="l00169"></a>00169 <span class="keywordflow">return</span> szResult; -<a name="l00170"></a>00170 } <span class="comment">/* end of szLpstr */</span> -<a name="l00171"></a>00171 -<a name="l00172"></a>00172 <span class="comment">/*</span> -<a name="l00173"></a>00173 <span class="comment"> * tFiletime - get a filetime property</span> -<a name="l00174"></a>00174 <span class="comment"> */</span> -<a name="l00175"></a>00175 <span class="keyword">static</span> time_t -<a name="l00176"></a>00176 tFiletime(ULONG ulOffset, <span class="keyword">const</span> UCHAR *aucBuffer) -<a name="l00177"></a>00177 { -<a name="l00178"></a>00178 <span class="keywordtype">double</span> dHi, dLo, dTmp; -<a name="l00179"></a>00179 ULONG ulHi, ulLo; -<a name="l00180"></a>00180 time_t tResult; -<a name="l00181"></a>00181 -<a name="l00182"></a>00182 ulLo = ulGetLong(ulOffset + 4, aucBuffer); -<a name="l00183"></a>00183 ulHi = ulGetLong(ulOffset + 8, aucBuffer); -<a name="l00184"></a>00184 NO_DBG_HEX(ulHi); -<a name="l00185"></a>00185 NO_DBG_HEX(ulLo); -<a name="l00186"></a>00186 -<a name="l00187"></a>00187 <span class="comment">/* Move the starting point from 01 Jan 1601 to 01 Jan 1970 */</span> -<a name="l00188"></a>00188 dHi = (double)ulHi - (<span class="keywordtype">double</span>)TIME_OFFSET_HI; -<a name="l00189"></a>00189 dLo = (double)ulLo - (<span class="keywordtype">double</span>)TIME_OFFSET_LO; -<a name="l00190"></a>00190 NO_DBG_FLT(dHi); -<a name="l00191"></a>00191 NO_DBG_FLT(dLo); -<a name="l00192"></a>00192 -<a name="l00193"></a>00193 <span class="comment">/* Combine the values and divide by 10^7 to get seconds */</span> -<a name="l00194"></a>00194 dTmp = dLo / 10000000.0; <span class="comment">/* 10^7 */</span> -<a name="l00195"></a>00195 dTmp += dHi * 429.4967926; <span class="comment">/* 2^32 / 10^7 */</span> -<a name="l00196"></a>00196 NO_DBG_FLT(dTmp); -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 <span class="comment">/* Make a time_t */</span> -<a name="l00199"></a>00199 <span class="keywordflow">if</span> (dTmp - 0.5 < TIME_T_MIN || dTmp + 0.5 > TIME_T_MAX) { -<a name="l00200"></a>00200 <span class="keywordflow">return</span> (time_t)-1; -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 tResult = dTmp < 0.0 ? (time_t)(dTmp - 0.5) : (time_t)(dTmp + 0.5); -<a name="l00203"></a>00203 NO_DBG_MSG(ctime(&tResult)); -<a name="l00204"></a>00204 <span class="keywordflow">return</span> tResult; -<a name="l00205"></a>00205 } <span class="comment">/* end of tFiletime */</span> -<a name="l00206"></a>00206 -<a name="l00207"></a>00207 <span class="comment">/*</span> -<a name="l00208"></a>00208 <span class="comment"> * vAnalyseSummaryInfo - analyse the summary information</span> -<a name="l00209"></a>00209 <span class="comment"> */</span> -<a name="l00210"></a>00210 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00211"></a>00211 vAnalyseSummaryInfo(<span class="keyword">const</span> UCHAR *aucBuffer) -<a name="l00212"></a>00212 { -<a name="l00213"></a>00213 ULONG ulOffset; -<a name="l00214"></a>00214 <span class="keywordtype">size_t</span> tIndex, tCount, tPropID, tPropType; -<a name="l00215"></a>00215 -<a name="l00216"></a>00216 tCount = (size_t)ulGetLong(4, aucBuffer); -<a name="l00217"></a>00217 DBG_DEC(tCount); -<a name="l00218"></a>00218 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tCount; tIndex++) { -<a name="l00219"></a>00219 tPropID = (size_t)ulGetLong(8 + tIndex * 8, aucBuffer); -<a name="l00220"></a>00220 ulOffset = ulGetLong(12 + tIndex * 8, aucBuffer); -<a name="l00221"></a>00221 NO_DBG_DEC(tPropID); -<a name="l00222"></a>00222 NO_DBG_HEX(ulOffset); -<a name="l00223"></a>00223 tPropType = (size_t)ulGetLong(ulOffset, aucBuffer); -<a name="l00224"></a>00224 NO_DBG_DEC(tPropType); -<a name="l00225"></a>00225 <span class="keywordflow">switch</span> (tPropID) { -<a name="l00226"></a>00226 <span class="keywordflow">case</span> PID_TITLE: -<a name="l00227"></a>00227 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szTitle == NULL) { -<a name="l00228"></a>00228 szTitle = szLpstr(ulOffset, aucBuffer); -<a name="l00229"></a>00229 } -<a name="l00230"></a>00230 <span class="keywordflow">break</span>; -<a name="l00231"></a>00231 <span class="keywordflow">case</span> PID_SUBJECT: -<a name="l00232"></a>00232 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szSubject == NULL) { -<a name="l00233"></a>00233 szSubject = szLpstr(ulOffset, aucBuffer); -<a name="l00234"></a>00234 } -<a name="l00235"></a>00235 <span class="keywordflow">break</span>; -<a name="l00236"></a>00236 <span class="keywordflow">case</span> PID_AUTHOR: -<a name="l00237"></a>00237 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szAuthor == NULL) { -<a name="l00238"></a>00238 szAuthor = szLpstr(ulOffset, aucBuffer); -<a name="l00239"></a>00239 } -<a name="l00240"></a>00240 <span class="keywordflow">break</span>; -<a name="l00241"></a>00241 <span class="keywordflow">case</span> PID_CREATE_DTM: -<a name="l00242"></a>00242 <span class="keywordflow">if</span> (tPropType == VT_FILETIME && -<a name="l00243"></a>00243 tCreateDtm == (time_t)-1) { -<a name="l00244"></a>00244 tCreateDtm = tFiletime(ulOffset, aucBuffer); -<a name="l00245"></a>00245 } -<a name="l00246"></a>00246 <span class="keywordflow">break</span>; -<a name="l00247"></a>00247 <span class="keywordflow">case</span> PID_LASTSAVE_DTM: -<a name="l00248"></a>00248 <span class="keywordflow">if</span> (tPropType == VT_FILETIME && -<a name="l00249"></a>00249 tLastSaveDtm == (time_t)-1) { -<a name="l00250"></a>00250 tLastSaveDtm = tFiletime(ulOffset, aucBuffer); -<a name="l00251"></a>00251 } -<a name="l00252"></a>00252 <span class="keywordflow">break</span>; -<a name="l00253"></a>00253 <span class="keywordflow">case</span> PID_APPNAME: -<a name="l00254"></a>00254 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szAppName == NULL) { -<a name="l00255"></a>00255 szAppName = szLpstr(ulOffset, aucBuffer); -<a name="l00256"></a>00256 } -<a name="l00257"></a>00257 <span class="keywordflow">break</span>; -<a name="l00258"></a>00258 <span class="keywordflow">default</span>: -<a name="l00259"></a>00259 <span class="keywordflow">break</span>; -<a name="l00260"></a>00260 } -<a name="l00261"></a>00261 } -<a name="l00262"></a>00262 } <span class="comment">/* end of vAnalyseSummaryInfo */</span> -<a name="l00263"></a>00263 -<a name="l00264"></a>00264 <span class="comment">/*</span> -<a name="l00265"></a>00265 <span class="comment"> * vAnalyseDocumentSummaryInfo - analyse the document summary information</span> -<a name="l00266"></a>00266 <span class="comment"> */</span> -<a name="l00267"></a>00267 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00268"></a>00268 vAnalyseDocumentSummaryInfo(<span class="keyword">const</span> UCHAR *aucBuffer) -<a name="l00269"></a>00269 { -<a name="l00270"></a>00270 ULONG ulOffset; -<a name="l00271"></a>00271 <span class="keywordtype">size_t</span> tIndex, tCount, tPropID, tPropType; -<a name="l00272"></a>00272 -<a name="l00273"></a>00273 tCount = (size_t)ulGetLong(4, aucBuffer); -<a name="l00274"></a>00274 DBG_DEC(tCount); -<a name="l00275"></a>00275 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tCount; tIndex++) { -<a name="l00276"></a>00276 tPropID = (size_t)ulGetLong(8 + tIndex * 8, aucBuffer); -<a name="l00277"></a>00277 ulOffset = ulGetLong(12 + tIndex * 8, aucBuffer); -<a name="l00278"></a>00278 NO_DBG_DEC(tPropID); -<a name="l00279"></a>00279 NO_DBG_HEX(ulOffset); -<a name="l00280"></a>00280 tPropType = (size_t)ulGetLong(ulOffset, aucBuffer); -<a name="l00281"></a>00281 NO_DBG_DEC(tPropType); -<a name="l00282"></a>00282 <span class="keywordflow">switch</span> (tPropID) { -<a name="l00283"></a>00283 <span class="keywordflow">case</span> PIDD_MANAGER: -<a name="l00284"></a>00284 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szManager == NULL) { -<a name="l00285"></a>00285 szManager = szLpstr(ulOffset, aucBuffer); -<a name="l00286"></a>00286 } -<a name="l00287"></a>00287 <span class="keywordflow">break</span>; -<a name="l00288"></a>00288 <span class="keywordflow">case</span> PIDD_COMPANY: -<a name="l00289"></a>00289 <span class="keywordflow">if</span> (tPropType == VT_LPSTR && szCompany == NULL) { -<a name="l00290"></a>00290 szCompany = szLpstr(ulOffset, aucBuffer); -<a name="l00291"></a>00291 } -<a name="l00292"></a>00292 <span class="keywordflow">break</span>; -<a name="l00293"></a>00293 <span class="keywordflow">default</span>: -<a name="l00294"></a>00294 <span class="keywordflow">break</span>; -<a name="l00295"></a>00295 } -<a name="l00296"></a>00296 } -<a name="l00297"></a>00297 } <span class="comment">/* end of vAnalyseDocumentSummaryInfo */</span> -<a name="l00298"></a>00298 -<a name="l00299"></a>00299 <span class="comment">/*</span> -<a name="l00300"></a>00300 <span class="comment"> * pucAnalyseSummaryInfoHeader-</span> -<a name="l00301"></a>00301 <span class="comment"> */</span> -<a name="l00302"></a>00302 <span class="keyword">static</span> UCHAR * -<a name="l00303"></a>00303 pucAnalyseSummaryInfoHeader(FILE *pFile, -<a name="l00304"></a>00304 ULONG ulStartBlock, ULONG ulSize, -<a name="l00305"></a>00305 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00306"></a>00306 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen) -<a name="l00307"></a>00307 { -<a name="l00308"></a>00308 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00309"></a>00309 UCHAR *aucBuffer; -<a name="l00310"></a>00310 <span class="keywordtype">size_t</span> tBlockDepotLen, tBlockSize, tSectionCount, tLength; -<a name="l00311"></a>00311 ULONG ulTmp, ulOffset; -<a name="l00312"></a>00312 USHORT usLittleEndian, usEmpty, usOS, usVersion; -<a name="l00313"></a>00313 UCHAR aucHdr[P_HEADER_SZ], aucSecLst[P_SECTION_MAX_SZ]; -<a name="l00314"></a>00314 -<a name="l00315"></a>00315 <span class="keywordflow">if</span> (ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00316"></a>00316 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00317"></a>00317 aulBlockDepot = aulSBD; -<a name="l00318"></a>00318 tBlockDepotLen = tSBDLen; -<a name="l00319"></a>00319 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00320"></a>00320 } <span class="keywordflow">else</span> { -<a name="l00321"></a>00321 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00322"></a>00322 aulBlockDepot = aulBBD; -<a name="l00323"></a>00323 tBlockDepotLen = tBBDLen; -<a name="l00324"></a>00324 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00325"></a>00325 } -<a name="l00326"></a>00326 -<a name="l00327"></a>00327 <span class="keywordflow">if</span> (tBlockDepotLen == 0) { -<a name="l00328"></a>00328 DBG_MSG(<span class="stringliteral">"The Block Depot length is zero"</span>); -<a name="l00329"></a>00329 <span class="keywordflow">return</span> NULL; -<a name="l00330"></a>00330 } -<a name="l00331"></a>00331 -<a name="l00332"></a>00332 <span class="comment">/* Read the Summery Information header */</span> -<a name="l00333"></a>00333 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00334"></a>00334 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00335"></a>00335 aucHdr, 0, P_HEADER_SZ)) { -<a name="l00336"></a>00336 <span class="keywordflow">return</span> NULL; -<a name="l00337"></a>00337 } -<a name="l00338"></a>00338 NO_DBG_PRINT_BLOCK(aucHdr, P_HEADER_SZ); -<a name="l00339"></a>00339 -<a name="l00340"></a>00340 <span class="comment">/* Analyse the Summery Information header */</span> -<a name="l00341"></a>00341 usLittleEndian = usGetWord(0, aucHdr); -<a name="l00342"></a>00342 <span class="keywordflow">if</span> (usLittleEndian != 0xfffe) { -<a name="l00343"></a>00343 DBG_HEX(usLittleEndian); -<a name="l00344"></a>00344 DBG_MSG_C(usLittleEndian == 0xfeff, <span class="stringliteral">"Big endian"</span>); -<a name="l00345"></a>00345 <span class="keywordflow">return</span> NULL; -<a name="l00346"></a>00346 } -<a name="l00347"></a>00347 usEmpty = usGetWord(2, aucHdr); -<a name="l00348"></a>00348 <span class="keywordflow">if</span> (usEmpty != 0x0000) { -<a name="l00349"></a>00349 DBG_DEC(usEmpty); -<a name="l00350"></a>00350 <span class="keywordflow">return</span> NULL; -<a name="l00351"></a>00351 } -<a name="l00352"></a>00352 ulTmp = ulGetLong(4, aucHdr); -<a name="l00353"></a>00353 DBG_HEX(ulTmp); -<a name="l00354"></a>00354 usOS = (USHORT)(ulTmp >> 16); -<a name="l00355"></a>00355 usVersion = (USHORT)(ulTmp & 0xffff); -<a name="l00356"></a>00356 <span class="keywordflow">switch</span> (usOS) { -<a name="l00357"></a>00357 <span class="keywordflow">case</span> 0: -<a name="l00358"></a>00358 DBG_MSG(<span class="stringliteral">"Win16"</span>); -<a name="l00359"></a>00359 DBG_HEX(usVersion); -<a name="l00360"></a>00360 <span class="keywordflow">break</span>; -<a name="l00361"></a>00361 <span class="keywordflow">case</span> 1: -<a name="l00362"></a>00362 DBG_MSG(<span class="stringliteral">"MacOS"</span>); -<a name="l00363"></a>00363 DBG_HEX(usVersion); -<a name="l00364"></a>00364 <span class="keywordflow">break</span>; -<a name="l00365"></a>00365 <span class="keywordflow">case</span> 2: -<a name="l00366"></a>00366 DBG_MSG(<span class="stringliteral">"Win32"</span>); -<a name="l00367"></a>00367 DBG_HEX(usVersion); -<a name="l00368"></a>00368 <span class="keywordflow">break</span>; -<a name="l00369"></a>00369 <span class="keywordflow">default</span>: -<a name="l00370"></a>00370 DBG_DEC(usOS); -<a name="l00371"></a>00371 DBG_HEX(usVersion); -<a name="l00372"></a>00372 <span class="keywordflow">break</span>; -<a name="l00373"></a>00373 } -<a name="l00374"></a>00374 tSectionCount = (size_t)ulGetLong(24, aucHdr); -<a name="l00375"></a>00375 DBG_DEC_C(tSectionCount != 1 && tSectionCount != 2, tSectionCount); -<a name="l00376"></a>00376 <span class="keywordflow">if</span> (tSectionCount != 1 && tSectionCount != 2) { -<a name="l00377"></a>00377 <span class="keywordflow">return</span> NULL; -<a name="l00378"></a>00378 } -<a name="l00379"></a>00379 -<a name="l00380"></a>00380 <span class="comment">/* Read the Summery Information Section Lists */</span> -<a name="l00381"></a>00381 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00382"></a>00382 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00383"></a>00383 aucSecLst, P_HEADER_SZ, P_SECTION_SZ(tSectionCount))) { -<a name="l00384"></a>00384 <span class="keywordflow">return</span> NULL; -<a name="l00385"></a>00385 } -<a name="l00386"></a>00386 NO_DBG_PRINT_BLOCK(aucSecLst, P_SECTION_SZ(tSectionCount)); -<a name="l00387"></a>00387 -<a name="l00388"></a>00388 ulTmp = ulGetLong(0, aucSecLst); -<a name="l00389"></a>00389 DBG_HEX(ulTmp); -<a name="l00390"></a>00390 ulTmp = ulGetLong(4, aucSecLst); -<a name="l00391"></a>00391 DBG_HEX(ulTmp); -<a name="l00392"></a>00392 ulTmp = ulGetLong(8, aucSecLst); -<a name="l00393"></a>00393 DBG_HEX(ulTmp); -<a name="l00394"></a>00394 ulTmp = ulGetLong(12, aucSecLst); -<a name="l00395"></a>00395 DBG_HEX(ulTmp); -<a name="l00396"></a>00396 ulOffset = ulGetLong(16, aucSecLst); -<a name="l00397"></a>00397 DBG_DEC_C(ulOffset != P_HEADER_SZ + P_SECTIONLIST_SZ && -<a name="l00398"></a>00398 ulOffset != P_HEADER_SZ + 2 * P_SECTIONLIST_SZ, -<a name="l00399"></a>00399 ulOffset); -<a name="l00400"></a>00400 fail(ulOffset != P_HEADER_SZ + P_SECTIONLIST_SZ && -<a name="l00401"></a>00401 ulOffset != P_HEADER_SZ + 2 * P_SECTIONLIST_SZ); -<a name="l00402"></a>00402 tLength = -<a name="l00403"></a>00403 (size_t)ulGetLong(tSectionCount * P_SECTIONLIST_SZ, aucSecLst); -<a name="l00404"></a>00404 NO_DBG_HEX(tLength); -<a name="l00405"></a>00405 fail(ulOffset + tLength > ulSize); -<a name="l00406"></a>00406 -<a name="l00407"></a>00407 <span class="comment">/* Read the Summery Information */</span> -<a name="l00408"></a>00408 aucBuffer = xmalloc(tLength); -<a name="l00409"></a>00409 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00410"></a>00410 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00411"></a>00411 aucBuffer, ulOffset, tLength)) { -<a name="l00412"></a>00412 aucBuffer = xfree(aucBuffer); -<a name="l00413"></a>00413 <span class="keywordflow">return</span> NULL; -<a name="l00414"></a>00414 } -<a name="l00415"></a>00415 NO_DBG_PRINT_BLOCK(aucBuffer, tLength); -<a name="l00416"></a>00416 <span class="keywordflow">return</span> aucBuffer; -<a name="l00417"></a>00417 } <span class="comment">/* end of pucAnalyseSummaryInfoHeader */</span> -<a name="l00418"></a>00418 -<a name="l00419"></a>00419 <span class="comment">/*</span> -<a name="l00420"></a>00420 <span class="comment"> * vSet0SummaryInfo - set summary information from a Word for DOS file</span> -<a name="l00421"></a>00421 <span class="comment"> */</span> -<a name="l00422"></a>00422 <span class="keywordtype">void</span> -<a name="l00423"></a>00423 vSet0SummaryInfo(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00424"></a>00424 { -<a name="l00425"></a>00425 UCHAR *aucBuffer; -<a name="l00426"></a>00426 ULONG ulBeginSumdInfo, ulBeginNextBlock; -<a name="l00427"></a>00427 <span class="keywordtype">size_t</span> tLen; -<a name="l00428"></a>00428 USHORT usCodepage, usOffset; -<a name="l00429"></a>00429 -<a name="l00430"></a>00430 TRACE_MSG(<span class="stringliteral">"vSet0SummaryInfo"</span>); -<a name="l00431"></a>00431 -<a name="l00432"></a>00432 fail(pFile == NULL || aucHeader == NULL); -<a name="l00433"></a>00433 -<a name="l00434"></a>00434 <span class="comment">/* First check the header */</span> -<a name="l00435"></a>00435 usCodepage = usGetWord(0x7e, aucHeader); -<a name="l00436"></a>00436 DBG_DEC(usCodepage); -<a name="l00437"></a>00437 <span class="keywordflow">switch</span> (usCodepage) { -<a name="l00438"></a>00438 <span class="keywordflow">case</span> 850: usLid = 0x0809; <span class="keywordflow">break</span>; <span class="comment">/* Latin1 -> British English */</span> -<a name="l00439"></a>00439 <span class="keywordflow">case</span> 862: usLid = 0x040d; <span class="keywordflow">break</span>; <span class="comment">/* Hebrew */</span> -<a name="l00440"></a>00440 <span class="keywordflow">case</span> 866: usLid = 0x0419; <span class="keywordflow">break</span>; <span class="comment">/* Russian */</span> -<a name="l00441"></a>00441 <span class="keywordflow">case</span> 0: -<a name="l00442"></a>00442 <span class="keywordflow">case</span> 437: -<a name="l00443"></a>00443 <span class="keywordflow">default</span>: usLid = 0x0409; <span class="keywordflow">break</span>; <span class="comment">/* ASCII -> American English */</span> -<a name="l00444"></a>00444 } -<a name="l00445"></a>00445 -<a name="l00446"></a>00446 <span class="comment">/* Second check the summary information block */</span> -<a name="l00447"></a>00447 ulBeginSumdInfo = 128 * (ULONG)usGetWord(0x1c, aucHeader); -<a name="l00448"></a>00448 DBG_HEX(ulBeginSumdInfo); -<a name="l00449"></a>00449 ulBeginNextBlock = 128 * (ULONG)usGetWord(0x6a, aucHeader); -<a name="l00450"></a>00450 DBG_HEX(ulBeginNextBlock); -<a name="l00451"></a>00451 -<a name="l00452"></a>00452 <span class="keywordflow">if</span> (ulBeginSumdInfo >= ulBeginNextBlock || ulBeginNextBlock == 0) { -<a name="l00453"></a>00453 <span class="comment">/* There is no summary information block */</span> -<a name="l00454"></a>00454 <span class="keywordflow">return</span>; -<a name="l00455"></a>00455 } -<a name="l00456"></a>00456 tLen = (size_t)(ulBeginNextBlock - ulBeginSumdInfo); -<a name="l00457"></a>00457 aucBuffer = xmalloc(tLen); -<a name="l00458"></a>00458 <span class="comment">/* Read the summary information block */</span> -<a name="l00459"></a>00459 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tLen, ulBeginSumdInfo, pFile)) { -<a name="l00460"></a>00460 <span class="keywordflow">return</span>; -<a name="l00461"></a>00461 } -<a name="l00462"></a>00462 usOffset = usGetWord(0, aucBuffer); -<a name="l00463"></a>00463 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00464"></a>00464 NO_DBG_MSG(aucBuffer + usOffset); -<a name="l00465"></a>00465 szTitle = xstrdup((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00466"></a>00466 } -<a name="l00467"></a>00467 usOffset = usGetWord(2, aucBuffer); -<a name="l00468"></a>00468 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00469"></a>00469 NO_DBG_MSG(aucBuffer + usOffset); -<a name="l00470"></a>00470 szAuthor = xstrdup((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00471"></a>00471 } -<a name="l00472"></a>00472 usOffset = usGetWord(12, aucBuffer); -<a name="l00473"></a>00473 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00474"></a>00474 NO_DBG_STRN(aucBuffer + usOffset, 8); -<a name="l00475"></a>00475 tLastSaveDtm = tConvertDosDate((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00476"></a>00476 } -<a name="l00477"></a>00477 usOffset = usGetWord(14, aucBuffer); -<a name="l00478"></a>00478 <span class="keywordflow">if</span> (aucBuffer[usOffset] != 0) { -<a name="l00479"></a>00479 NO_DBG_STRN(aucBuffer + usOffset, 8); -<a name="l00480"></a>00480 tCreateDtm = tConvertDosDate((<span class="keywordtype">char</span> *)aucBuffer + usOffset); -<a name="l00481"></a>00481 } -<a name="l00482"></a>00482 aucBuffer = xfree(aucBuffer); -<a name="l00483"></a>00483 } <span class="comment">/* end of vSet0SummaryInfo */</span> -<a name="l00484"></a>00484 -<a name="l00485"></a>00485 <span class="comment">/*</span> -<a name="l00486"></a>00486 <span class="comment"> * vSet2SummaryInfo - set summary information from a WinWord 1/2 file</span> -<a name="l00487"></a>00487 <span class="comment"> */</span> -<a name="l00488"></a>00488 <span class="keywordtype">void</span> -<a name="l00489"></a>00489 vSet2SummaryInfo(FILE *pFile, <span class="keywordtype">int</span> iWordVersion, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00490"></a>00490 { -<a name="l00491"></a>00491 UCHAR *aucBuffer; -<a name="l00492"></a>00492 ULONG ulBeginSumdInfo, ulBeginDocpInfo, ulTmp; -<a name="l00493"></a>00493 <span class="keywordtype">size_t</span> tSumdInfoLen, tDocpInfoLen, tLen, tCounter, tStart; -<a name="l00494"></a>00494 -<a name="l00495"></a>00495 TRACE_MSG(<span class="stringliteral">"vSet2SummaryInfo"</span>); -<a name="l00496"></a>00496 -<a name="l00497"></a>00497 fail(pFile == NULL || aucHeader == NULL); -<a name="l00498"></a>00498 fail(iWordVersion != 1 && iWordVersion != 2); -<a name="l00499"></a>00499 -<a name="l00500"></a>00500 <span class="comment">/* First check the header */</span> -<a name="l00501"></a>00501 usLid = usGetWord(0x06, aucHeader); <span class="comment">/* Language IDentification */</span> -<a name="l00502"></a>00502 DBG_HEX(usLid); -<a name="l00503"></a>00503 <span class="keywordflow">if</span> (usLid < 999 && iWordVersion == 1) { -<a name="l00504"></a>00504 <span class="keywordflow">switch</span> (usLid) { -<a name="l00505"></a>00505 <span class="keywordflow">case</span> 1: usLid = 0x0409; <span class="keywordflow">break</span>; <span class="comment">/* American English */</span> -<a name="l00506"></a>00506 <span class="keywordflow">case</span> 2: usLid = 0x0c0c; <span class="keywordflow">break</span>; <span class="comment">/* Canadian French */</span> -<a name="l00507"></a>00507 <span class="keywordflow">case</span> 31: usLid = 0x0413; <span class="keywordflow">break</span>; <span class="comment">/* Dutch */</span> -<a name="l00508"></a>00508 <span class="keywordflow">case</span> 33: usLid = 0x040c; <span class="keywordflow">break</span>; <span class="comment">/* French */</span> -<a name="l00509"></a>00509 <span class="keywordflow">case</span> 34: usLid = 0x040a; <span class="keywordflow">break</span>; <span class="comment">/* Spanish */</span> -<a name="l00510"></a>00510 <span class="keywordflow">case</span> 36: usLid = 0x040e; <span class="keywordflow">break</span>; <span class="comment">/* Hungarian */</span> -<a name="l00511"></a>00511 <span class="keywordflow">case</span> 39: usLid = 0x0410; <span class="keywordflow">break</span>; <span class="comment">/* Italian */</span> -<a name="l00512"></a>00512 <span class="keywordflow">case</span> 44: usLid = 0x0809; <span class="keywordflow">break</span>; <span class="comment">/* British English */</span> -<a name="l00513"></a>00513 <span class="keywordflow">case</span> 45: usLid = 0x0406; <span class="keywordflow">break</span>; <span class="comment">/* Danish */</span> -<a name="l00514"></a>00514 <span class="keywordflow">case</span> 46: usLid = 0x041f; <span class="keywordflow">break</span>; <span class="comment">/* Swedish */</span> -<a name="l00515"></a>00515 <span class="keywordflow">case</span> 47: usLid = 0x0414; <span class="keywordflow">break</span>; <span class="comment">/* Norwegian */</span> -<a name="l00516"></a>00516 <span class="keywordflow">case</span> 48: usLid = 0x0415; <span class="keywordflow">break</span>; <span class="comment">/* Polish */</span> -<a name="l00517"></a>00517 <span class="keywordflow">case</span> 49: usLid = 0x0407; <span class="keywordflow">break</span>; <span class="comment">/* German */</span> -<a name="l00518"></a>00518 <span class="keywordflow">case</span> 351: usLid = 0x0816; <span class="keywordflow">break</span>; <span class="comment">/* Portuguese */</span> -<a name="l00519"></a>00519 <span class="keywordflow">case</span> 358: usLid = 0x040b; <span class="keywordflow">break</span>; <span class="comment">/* Finnish */</span> -<a name="l00520"></a>00520 <span class="keywordflow">default</span>: -<a name="l00521"></a>00521 DBG_DEC(usLid); -<a name="l00522"></a>00522 DBG_FIXME(); -<a name="l00523"></a>00523 usLid = 0x0409; <span class="comment">/* American English */</span> -<a name="l00524"></a>00524 <span class="keywordflow">break</span>; -<a name="l00525"></a>00525 } -<a name="l00526"></a>00526 } -<a name="l00527"></a>00527 -<a name="l00528"></a>00528 <span class="keywordflow">if</span> (iWordVersion != 2) { -<a name="l00529"></a>00529 <span class="comment">/* Unknown where to find the associated strings */</span> -<a name="l00530"></a>00530 <span class="keywordflow">return</span>; -<a name="l00531"></a>00531 } -<a name="l00532"></a>00532 -<a name="l00533"></a>00533 <span class="comment">/* Second check the associated strings */</span> -<a name="l00534"></a>00534 ulBeginSumdInfo = ulGetLong(0x118, aucHeader); <span class="comment">/* fcSttbfAssoc */</span> -<a name="l00535"></a>00535 DBG_HEX(ulBeginSumdInfo); -<a name="l00536"></a>00536 tSumdInfoLen = (size_t)usGetWord(0x11c, aucHeader); <span class="comment">/* cbSttbfAssoc */</span> -<a name="l00537"></a>00537 DBG_DEC(tSumdInfoLen); -<a name="l00538"></a>00538 -<a name="l00539"></a>00539 <span class="keywordflow">if</span> (tSumdInfoLen == 0) { -<a name="l00540"></a>00540 <span class="comment">/* There is no summary information */</span> -<a name="l00541"></a>00541 <span class="keywordflow">return</span>; -<a name="l00542"></a>00542 } -<a name="l00543"></a>00543 -<a name="l00544"></a>00544 aucBuffer = xmalloc(tSumdInfoLen); -<a name="l00545"></a>00545 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tSumdInfoLen, ulBeginSumdInfo, pFile)) { -<a name="l00546"></a>00546 aucBuffer = xfree(aucBuffer); -<a name="l00547"></a>00547 <span class="keywordflow">return</span>; -<a name="l00548"></a>00548 } -<a name="l00549"></a>00549 NO_DBG_PRINT_BLOCK(aucBuffer, tSumdInfoLen); -<a name="l00550"></a>00550 tLen = (size_t)ucGetByte(0, aucBuffer); -<a name="l00551"></a>00551 DBG_DEC_C(tSumdInfoLen != tLen, tSumdInfoLen); -<a name="l00552"></a>00552 DBG_DEC_C(tSumdInfoLen != tLen, tLen); -<a name="l00553"></a>00553 tStart = 1; -<a name="l00554"></a>00554 <span class="keywordflow">for</span> (tCounter = 0; tCounter < 17; tCounter++) { -<a name="l00555"></a>00555 <span class="keywordflow">if</span> (tStart >= tSumdInfoLen) { -<a name="l00556"></a>00556 <span class="keywordflow">break</span>; -<a name="l00557"></a>00557 } -<a name="l00558"></a>00558 tLen = (size_t)ucGetByte(tStart, aucBuffer); -<a name="l00559"></a>00559 <span class="keywordflow">if</span> (tLen != 0) { -<a name="l00560"></a>00560 NO_DBG_DEC(tCounter); -<a name="l00561"></a>00561 NO_DBG_STRN(aucBuffer + tStart + 1, tLen); -<a name="l00562"></a>00562 <span class="keywordflow">switch</span> (tCounter) { -<a name="l00563"></a>00563 <span class="keywordflow">case</span> 3: -<a name="l00564"></a>00564 szTitle = xmalloc(tLen + 1); -<a name="l00565"></a>00565 strncpy(szTitle, -<a name="l00566"></a>00566 (<span class="keywordtype">char</span> *)aucBuffer + tStart + 1, tLen); -<a name="l00567"></a>00567 szTitle[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00568"></a>00568 <span class="keywordflow">break</span>; -<a name="l00569"></a>00569 <span class="keywordflow">case</span> 4: -<a name="l00570"></a>00570 szSubject = xmalloc(tLen + 1); -<a name="l00571"></a>00571 strncpy(szSubject, -<a name="l00572"></a>00572 (<span class="keywordtype">char</span> *)aucBuffer + tStart + 1, tLen); -<a name="l00573"></a>00573 szSubject[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00574"></a>00574 <span class="keywordflow">break</span>; -<a name="l00575"></a>00575 <span class="keywordflow">case</span> 7: -<a name="l00576"></a>00576 szAuthor = xmalloc(tLen + 1); -<a name="l00577"></a>00577 strncpy(szAuthor, -<a name="l00578"></a>00578 (<span class="keywordtype">char</span> *)aucBuffer + tStart + 1, tLen); -<a name="l00579"></a>00579 szAuthor[tLen] = <span class="charliteral">'\0'</span>; -<a name="l00580"></a>00580 <span class="keywordflow">break</span>; -<a name="l00581"></a>00581 <span class="keywordflow">default</span>: -<a name="l00582"></a>00582 <span class="keywordflow">break</span>; -<a name="l00583"></a>00583 } -<a name="l00584"></a>00584 } -<a name="l00585"></a>00585 tStart += tLen + 1; -<a name="l00586"></a>00586 } -<a name="l00587"></a>00587 aucBuffer = xfree(aucBuffer); -<a name="l00588"></a>00588 -<a name="l00589"></a>00589 <span class="comment">/* Third check the document properties */</span> -<a name="l00590"></a>00590 ulBeginDocpInfo = ulGetLong(0x112, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00591"></a>00591 DBG_HEX(ulBeginDocpInfo); -<a name="l00592"></a>00592 tDocpInfoLen = (size_t)usGetWord(0x116, aucHeader); <span class="comment">/* cbDop */</span> -<a name="l00593"></a>00593 DBG_DEC(tDocpInfoLen); -<a name="l00594"></a>00594 <span class="keywordflow">if</span> (tDocpInfoLen < 12) { -<a name="l00595"></a>00595 <span class="keywordflow">return</span>; -<a name="l00596"></a>00596 } -<a name="l00597"></a>00597 -<a name="l00598"></a>00598 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00599"></a>00599 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tDocpInfoLen, ulBeginDocpInfo, pFile)) { -<a name="l00600"></a>00600 aucBuffer = xfree(aucBuffer); -<a name="l00601"></a>00601 <span class="keywordflow">return</span>; -<a name="l00602"></a>00602 } -<a name="l00603"></a>00603 ulTmp = ulGetLong(0x14, aucBuffer); <span class="comment">/* dttmCreated */</span> -<a name="l00604"></a>00604 tCreateDtm = tConvertDTTM(ulTmp); -<a name="l00605"></a>00605 ulTmp = ulGetLong(0x18, aucBuffer); <span class="comment">/* dttmRevised */</span> -<a name="l00606"></a>00606 tLastSaveDtm = tConvertDTTM(ulTmp); -<a name="l00607"></a>00607 aucBuffer = xfree(aucBuffer); -<a name="l00608"></a>00608 } <span class="comment">/* end of vSet2SummaryInfo */</span> -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 <span class="comment">/*</span> -<a name="l00611"></a>00611 <span class="comment"> * vSetSummaryInfoOLE - set summary information from a Word 6+ file</span> -<a name="l00612"></a>00612 <span class="comment"> */</span> -<a name="l00613"></a>00613 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00614"></a>00614 vSetSummaryInfoOLE(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00615"></a>00615 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00616"></a>00616 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen) -<a name="l00617"></a>00617 { -<a name="l00618"></a>00618 UCHAR *pucBuffer; -<a name="l00619"></a>00619 -<a name="l00620"></a>00620 fail(pFile == NULL || pPPS == NULL); -<a name="l00621"></a>00621 fail(aulBBD == NULL || aulSBD == NULL); -<a name="l00622"></a>00622 -<a name="l00623"></a>00623 <span class="comment">/* Summary Information */</span> -<a name="l00624"></a>00624 pucBuffer = pucAnalyseSummaryInfoHeader(pFile, -<a name="l00625"></a>00625 pPPS->tSummaryInfo.ulSB, pPPS->tSummaryInfo.ulSize, -<a name="l00626"></a>00626 aulBBD, tBBDLen, aulSBD, tSBDLen); -<a name="l00627"></a>00627 <span class="keywordflow">if</span> (pucBuffer != NULL) { -<a name="l00628"></a>00628 vAnalyseSummaryInfo(pucBuffer); -<a name="l00629"></a>00629 pucBuffer = xfree(pucBuffer); -<a name="l00630"></a>00630 } -<a name="l00631"></a>00631 -<a name="l00632"></a>00632 <span class="comment">/* Document Summary Information */</span> -<a name="l00633"></a>00633 pucBuffer = pucAnalyseSummaryInfoHeader(pFile, -<a name="l00634"></a>00634 pPPS->tDocSummaryInfo.ulSB, pPPS->tDocSummaryInfo.ulSize, -<a name="l00635"></a>00635 aulBBD, tBBDLen, aulSBD, tSBDLen); -<a name="l00636"></a>00636 <span class="keywordflow">if</span> (pucBuffer != NULL) { -<a name="l00637"></a>00637 vAnalyseDocumentSummaryInfo(pucBuffer); -<a name="l00638"></a>00638 pucBuffer = xfree(pucBuffer); -<a name="l00639"></a>00639 } -<a name="l00640"></a>00640 } <span class="comment">/* end of vSetSummaryInfoOLE */</span> -<a name="l00641"></a>00641 -<a name="l00642"></a>00642 <span class="comment">/*</span> -<a name="l00643"></a>00643 <span class="comment"> * vSet6SummaryInfo - set summary information from a Word 6/7 file</span> -<a name="l00644"></a>00644 <span class="comment"> */</span> -<a name="l00645"></a>00645 <span class="keywordtype">void</span> -<a name="l00646"></a>00646 vSet6SummaryInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00647"></a>00647 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00648"></a>00648 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00649"></a>00649 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00650"></a>00650 { -<a name="l00651"></a>00651 TRACE_MSG(<span class="stringliteral">"vSet6SummaryInfo"</span>); -<a name="l00652"></a>00652 -<a name="l00653"></a>00653 <span class="comment">/* Header Information */</span> -<a name="l00654"></a>00654 usLid = usGetWord(0x06, aucHeader); <span class="comment">/* Language IDentification */</span> -<a name="l00655"></a>00655 DBG_HEX(usLid); -<a name="l00656"></a>00656 -<a name="l00657"></a>00657 <span class="comment">/* Summery Information */</span> -<a name="l00658"></a>00658 vSetSummaryInfoOLE(pFile, pPPS, aulBBD, tBBDLen, aulSBD, tSBDLen); -<a name="l00659"></a>00659 } <span class="comment">/* end of vSet6SummaryInfo */</span> -<a name="l00660"></a>00660 -<a name="l00661"></a>00661 <span class="comment">/*</span> -<a name="l00662"></a>00662 <span class="comment"> * vSet8SummaryInfo - set summary information a Word 8/9/10 file</span> -<a name="l00663"></a>00663 <span class="comment"> */</span> -<a name="l00664"></a>00664 <span class="keywordtype">void</span> -<a name="l00665"></a>00665 vSet8SummaryInfo(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00666"></a>00666 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00667"></a>00667 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00668"></a>00668 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00669"></a>00669 { -<a name="l00670"></a>00670 USHORT usTmp; -<a name="l00671"></a>00671 -<a name="l00672"></a>00672 TRACE_MSG(<span class="stringliteral">"vSet8SummaryInfo"</span>); -<a name="l00673"></a>00673 -<a name="l00674"></a>00674 <span class="comment">/* Header Information */</span> -<a name="l00675"></a>00675 usTmp = usGetWord(0x0a, aucHeader); -<a name="l00676"></a>00676 <span class="keywordflow">if</span> (usTmp & BIT(14)) { -<a name="l00677"></a>00677 <span class="comment">/* Language IDentification Far East */</span> -<a name="l00678"></a>00678 usLid = usGetWord(0x3c, aucHeader); -<a name="l00679"></a>00679 } <span class="keywordflow">else</span> { -<a name="l00680"></a>00680 <span class="comment">/* Language IDentification */</span> -<a name="l00681"></a>00681 usLid = usGetWord(0x06, aucHeader); -<a name="l00682"></a>00682 } -<a name="l00683"></a>00683 DBG_HEX(usLid); -<a name="l00684"></a>00684 -<a name="l00685"></a>00685 <span class="comment">/* Summery Information */</span> -<a name="l00686"></a>00686 vSetSummaryInfoOLE(pFile, pPPS, aulBBD, tBBDLen, aulSBD, tSBDLen); -<a name="l00687"></a>00687 } <span class="comment">/* end of vSet8SummaryInfo */</span> -<a name="l00688"></a>00688 -<a name="l00689"></a>00689 <span class="comment">/*</span> -<a name="l00690"></a>00690 <span class="comment"> * szGetTitle - get the title field</span> -<a name="l00691"></a>00691 <span class="comment"> */</span> -<a name="l00692"></a>00692 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00693"></a>00693 szGetTitle(<span class="keywordtype">void</span>) -<a name="l00694"></a>00694 { -<a name="l00695"></a>00695 <span class="keywordflow">return</span> szTitle; -<a name="l00696"></a>00696 } <span class="comment">/* end of szGetTitle */</span> -<a name="l00697"></a>00697 -<a name="l00698"></a>00698 <span class="comment">/*</span> -<a name="l00699"></a>00699 <span class="comment"> * szGetSubject - get the subject field</span> -<a name="l00700"></a>00700 <span class="comment"> */</span> -<a name="l00701"></a>00701 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00702"></a>00702 szGetSubject(<span class="keywordtype">void</span>) -<a name="l00703"></a>00703 { -<a name="l00704"></a>00704 <span class="keywordflow">return</span> szSubject; -<a name="l00705"></a>00705 } <span class="comment">/* end of szGetSubject */</span> -<a name="l00706"></a>00706 -<a name="l00707"></a>00707 <span class="comment">/*</span> -<a name="l00708"></a>00708 <span class="comment"> * szGetAuthor - get the author field</span> -<a name="l00709"></a>00709 <span class="comment"> */</span> -<a name="l00710"></a>00710 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00711"></a>00711 szGetAuthor(<span class="keywordtype">void</span>) -<a name="l00712"></a>00712 { -<a name="l00713"></a>00713 <span class="keywordflow">return</span> szAuthor; -<a name="l00714"></a>00714 } <span class="comment">/* end of szGetAuthor */</span> -<a name="l00715"></a>00715 -<a name="l00716"></a>00716 <span class="comment">/*</span> -<a name="l00717"></a>00717 <span class="comment"> * szGetLastSaveDtm - get the last save date field</span> -<a name="l00718"></a>00718 <span class="comment"> */</span> -<a name="l00719"></a>00719 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00720"></a>00720 szGetLastSaveDtm(<span class="keywordtype">void</span>) -<a name="l00721"></a>00721 { -<a name="l00722"></a>00722 <span class="keyword">static</span> <span class="keywordtype">char</span> szTime[12]; -<a name="l00723"></a>00723 <span class="keyword">struct </span>tm *pTime; -<a name="l00724"></a>00724 -<a name="l00725"></a>00725 <span class="keywordflow">if</span> (tLastSaveDtm == (time_t)-1) { -<a name="l00726"></a>00726 <span class="keywordflow">return</span> NULL; -<a name="l00727"></a>00727 } -<a name="l00728"></a>00728 pTime = localtime(&tLastSaveDtm); -<a name="l00729"></a>00729 <span class="keywordflow">if</span> (pTime == NULL) { -<a name="l00730"></a>00730 <span class="keywordflow">return</span> NULL; -<a name="l00731"></a>00731 } -<a name="l00732"></a>00732 sprintf(szTime, <span class="stringliteral">"%04d-%02d-%02d"</span>, -<a name="l00733"></a>00733 pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday); -<a name="l00734"></a>00734 <span class="keywordflow">return</span> szTime; -<a name="l00735"></a>00735 } <span class="comment">/* end of szGetLastSaveDtm */</span> -<a name="l00736"></a>00736 -<a name="l00737"></a>00737 <span class="comment">/*</span> -<a name="l00738"></a>00738 <span class="comment"> * szGetModDate - get the last save date field</span> -<a name="l00739"></a>00739 <span class="comment"> */</span> -<a name="l00740"></a>00740 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00741"></a>00741 szGetModDate(<span class="keywordtype">void</span>) -<a name="l00742"></a>00742 { -<a name="l00743"></a>00743 <span class="keyword">static</span> <span class="keywordtype">char</span> szTime[20]; -<a name="l00744"></a>00744 <span class="keyword">struct </span>tm *pTime; -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 <span class="keywordflow">if</span> (tLastSaveDtm == (time_t)-1) { -<a name="l00747"></a>00747 <span class="keywordflow">return</span> NULL; -<a name="l00748"></a>00748 } -<a name="l00749"></a>00749 pTime = localtime(&tLastSaveDtm); -<a name="l00750"></a>00750 <span class="keywordflow">if</span> (pTime == NULL) { -<a name="l00751"></a>00751 <span class="keywordflow">return</span> NULL; -<a name="l00752"></a>00752 } -<a name="l00753"></a>00753 sprintf(szTime, <span class="stringliteral">"D:%04d%02d%02d%02d%02d"</span>, -<a name="l00754"></a>00754 pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday, -<a name="l00755"></a>00755 pTime->tm_hour, pTime->tm_min); -<a name="l00756"></a>00756 <span class="keywordflow">return</span> szTime; -<a name="l00757"></a>00757 } <span class="comment">/* end of szGetModDate */</span> -<a name="l00758"></a>00758 -<a name="l00759"></a>00759 <span class="comment">/*</span> -<a name="l00760"></a>00760 <span class="comment"> * szGetCreationDate - get the last save date field</span> -<a name="l00761"></a>00761 <span class="comment"> */</span> -<a name="l00762"></a>00762 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00763"></a>00763 szGetCreationDate(<span class="keywordtype">void</span>) -<a name="l00764"></a>00764 { -<a name="l00765"></a>00765 <span class="keyword">static</span> <span class="keywordtype">char</span> szTime[20]; -<a name="l00766"></a>00766 <span class="keyword">struct </span>tm *pTime; -<a name="l00767"></a>00767 -<a name="l00768"></a>00768 <span class="keywordflow">if</span> (tCreateDtm == (time_t)-1) { -<a name="l00769"></a>00769 <span class="keywordflow">return</span> NULL; -<a name="l00770"></a>00770 } -<a name="l00771"></a>00771 pTime = localtime(&tCreateDtm); -<a name="l00772"></a>00772 <span class="keywordflow">if</span> (pTime == NULL) { -<a name="l00773"></a>00773 <span class="keywordflow">return</span> NULL; -<a name="l00774"></a>00774 } -<a name="l00775"></a>00775 sprintf(szTime, <span class="stringliteral">"D:%04d%02d%02d%02d%02d"</span>, -<a name="l00776"></a>00776 pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday, -<a name="l00777"></a>00777 pTime->tm_hour, pTime->tm_min); -<a name="l00778"></a>00778 <span class="keywordflow">return</span> szTime; -<a name="l00779"></a>00779 } <span class="comment">/* end of szGetCreationDate */</span> -<a name="l00780"></a>00780 -<a name="l00781"></a>00781 <span class="comment">/*</span> -<a name="l00782"></a>00782 <span class="comment"> * szGetCompany - get the company field</span> -<a name="l00783"></a>00783 <span class="comment"> */</span> -<a name="l00784"></a>00784 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00785"></a>00785 szGetCompany(<span class="keywordtype">void</span>) -<a name="l00786"></a>00786 { -<a name="l00787"></a>00787 <span class="keywordflow">return</span> szCompany; -<a name="l00788"></a>00788 } <span class="comment">/* end of szGetCompany */</span> -<a name="l00789"></a>00789 -<a name="l00790"></a>00790 <span class="comment">/*</span> -<a name="l00791"></a>00791 <span class="comment"> * szGetLanguage - get de language field</span> -<a name="l00792"></a>00792 <span class="comment"> */</span> -<a name="l00793"></a>00793 <span class="keyword">const</span> <span class="keywordtype">char</span> * -<a name="l00794"></a>00794 szGetLanguage(<span class="keywordtype">void</span>) -<a name="l00795"></a>00795 { -<a name="l00796"></a>00796 <span class="keywordflow">if</span> (usLid == (USHORT)-1) { -<a name="l00797"></a>00797 <span class="comment">/* No Language IDentification */</span> -<a name="l00798"></a>00798 <span class="keywordflow">return</span> NULL; -<a name="l00799"></a>00799 } -<a name="l00800"></a>00800 <span class="keywordflow">if</span> (usLid < 999) { -<a name="l00801"></a>00801 <span class="comment">/* This is a Locale, not a Language IDentification */</span> -<a name="l00802"></a>00802 DBG_DEC(usLid); -<a name="l00803"></a>00803 <span class="keywordflow">return</span> NULL; -<a name="l00804"></a>00804 } -<a name="l00805"></a>00805 -<a name="l00806"></a>00806 <span class="comment">/* Exceptions to the general rule */</span> -<a name="l00807"></a>00807 <span class="keywordflow">switch</span> (usLid) { -<a name="l00808"></a>00808 <span class="keywordflow">case</span> 0x0404: <span class="keywordflow">return</span> <span class="stringliteral">"zh_TW"</span>; <span class="comment">/* Traditional Chinese */</span> -<a name="l00809"></a>00809 <span class="keywordflow">case</span> 0x0804: <span class="keywordflow">return</span> <span class="stringliteral">"zh_CN"</span>; <span class="comment">/* Simplified Chinese */</span> -<a name="l00810"></a>00810 <span class="keywordflow">case</span> 0x0c04: <span class="keywordflow">return</span> <span class="stringliteral">"zh_HK"</span>; <span class="comment">/* Hong Kong Chinese */</span> -<a name="l00811"></a>00811 <span class="keywordflow">case</span> 0x1004: <span class="keywordflow">return</span> <span class="stringliteral">"zh_SG"</span>; <span class="comment">/* Singapore Chinese */</span> -<a name="l00812"></a>00812 <span class="keywordflow">case</span> 0x0807: <span class="keywordflow">return</span> <span class="stringliteral">"de_CH"</span>; <span class="comment">/* Swiss German */</span> -<a name="l00813"></a>00813 <span class="keywordflow">case</span> 0x0409: <span class="keywordflow">return</span> <span class="stringliteral">"en_US"</span>; <span class="comment">/* American English */</span> -<a name="l00814"></a>00814 <span class="keywordflow">case</span> 0x0809: <span class="keywordflow">return</span> <span class="stringliteral">"en_GB"</span>; <span class="comment">/* British English */</span> -<a name="l00815"></a>00815 <span class="keywordflow">case</span> 0x0c09: <span class="keywordflow">return</span> <span class="stringliteral">"en_AU"</span>; <span class="comment">/* Australian English */</span> -<a name="l00816"></a>00816 <span class="keywordflow">case</span> 0x080a: <span class="keywordflow">return</span> <span class="stringliteral">"es_MX"</span>; <span class="comment">/* Mexican Spanish */</span> -<a name="l00817"></a>00817 <span class="keywordflow">case</span> 0x080c: <span class="keywordflow">return</span> <span class="stringliteral">"fr_BE"</span>; <span class="comment">/* Belgian French */</span> -<a name="l00818"></a>00818 <span class="keywordflow">case</span> 0x0c0c: <span class="keywordflow">return</span> <span class="stringliteral">"fr_CA"</span>; <span class="comment">/* Canadian French */</span> -<a name="l00819"></a>00819 <span class="keywordflow">case</span> 0x100c: <span class="keywordflow">return</span> <span class="stringliteral">"fr_CH"</span>; <span class="comment">/* Swiss French */</span> -<a name="l00820"></a>00820 <span class="keywordflow">case</span> 0x0810: <span class="keywordflow">return</span> <span class="stringliteral">"it_CH"</span>; <span class="comment">/* Swiss Italian */</span> -<a name="l00821"></a>00821 <span class="keywordflow">case</span> 0x0813: <span class="keywordflow">return</span> <span class="stringliteral">"nl_BE"</span>; <span class="comment">/* Belgian Dutch */</span> -<a name="l00822"></a>00822 <span class="keywordflow">case</span> 0x0416: <span class="keywordflow">return</span> <span class="stringliteral">"pt_BR"</span>; <span class="comment">/* Brazilian Portuguese */</span> -<a name="l00823"></a>00823 <span class="keywordflow">case</span> 0x081a: -<a name="l00824"></a>00824 <span class="keywordflow">case</span> 0x0c1a: <span class="keywordflow">return</span> <span class="stringliteral">"sr"</span>; <span class="comment">/* Serbian */</span> -<a name="l00825"></a>00825 <span class="keywordflow">case</span> 0x081d: <span class="keywordflow">return</span> <span class="stringliteral">"sv_FI"</span>; <span class="comment">/* Finland Swedish */</span> -<a name="l00826"></a>00826 <span class="keywordflow">default</span>: -<a name="l00827"></a>00827 <span class="keywordflow">break</span>; -<a name="l00828"></a>00828 } -<a name="l00829"></a>00829 -<a name="l00830"></a>00830 <span class="comment">/* The general rule */</span> -<a name="l00831"></a>00831 <span class="keywordflow">switch</span> (usLid & 0x00ff) { -<a name="l00832"></a>00832 <span class="keywordflow">case</span> 0x01: <span class="keywordflow">return</span> <span class="stringliteral">"ar"</span>; <span class="comment">/* Arabic */</span> -<a name="l00833"></a>00833 <span class="keywordflow">case</span> 0x02: <span class="keywordflow">return</span> <span class="stringliteral">"bg"</span>; <span class="comment">/* Bulgarian */</span> -<a name="l00834"></a>00834 <span class="keywordflow">case</span> 0x03: <span class="keywordflow">return</span> <span class="stringliteral">"ca"</span>; <span class="comment">/* Catalan */</span> -<a name="l00835"></a>00835 <span class="keywordflow">case</span> 0x04: <span class="keywordflow">return</span> <span class="stringliteral">"zh"</span>; <span class="comment">/* Chinese */</span> -<a name="l00836"></a>00836 <span class="keywordflow">case</span> 0x05: <span class="keywordflow">return</span> <span class="stringliteral">"cs"</span>; <span class="comment">/* Czech */</span> -<a name="l00837"></a>00837 <span class="keywordflow">case</span> 0x06: <span class="keywordflow">return</span> <span class="stringliteral">"da"</span>; <span class="comment">/* Danish */</span> -<a name="l00838"></a>00838 <span class="keywordflow">case</span> 0x07: <span class="keywordflow">return</span> <span class="stringliteral">"de"</span>; <span class="comment">/* German */</span> -<a name="l00839"></a>00839 <span class="keywordflow">case</span> 0x08: <span class="keywordflow">return</span> <span class="stringliteral">"el"</span>; <span class="comment">/* Greek */</span> -<a name="l00840"></a>00840 <span class="keywordflow">case</span> 0x09: <span class="keywordflow">return</span> <span class="stringliteral">"en"</span>; <span class="comment">/* English */</span> -<a name="l00841"></a>00841 <span class="keywordflow">case</span> 0x0a: <span class="keywordflow">return</span> <span class="stringliteral">"es"</span>; <span class="comment">/* Spanish */</span> -<a name="l00842"></a>00842 <span class="keywordflow">case</span> 0x0b: <span class="keywordflow">return</span> <span class="stringliteral">"fi"</span>; <span class="comment">/* Finnish */</span> -<a name="l00843"></a>00843 <span class="keywordflow">case</span> 0x0c: <span class="keywordflow">return</span> <span class="stringliteral">"fr"</span>; <span class="comment">/* French */</span> -<a name="l00844"></a>00844 <span class="keywordflow">case</span> 0x0d: <span class="keywordflow">return</span> <span class="stringliteral">"he"</span>; <span class="comment">/* Hebrew */</span> -<a name="l00845"></a>00845 <span class="keywordflow">case</span> 0x0e: <span class="keywordflow">return</span> <span class="stringliteral">"hu"</span>; <span class="comment">/* Hungarian */</span> -<a name="l00846"></a>00846 <span class="keywordflow">case</span> 0x0f: <span class="keywordflow">return</span> <span class="stringliteral">"is"</span>; <span class="comment">/* Icelandic */</span> -<a name="l00847"></a>00847 <span class="keywordflow">case</span> 0x10: <span class="keywordflow">return</span> <span class="stringliteral">"it"</span>; <span class="comment">/* Italian */</span> -<a name="l00848"></a>00848 <span class="keywordflow">case</span> 0x11: <span class="keywordflow">return</span> <span class="stringliteral">"ja"</span>; <span class="comment">/* Japanese */</span> -<a name="l00849"></a>00849 <span class="keywordflow">case</span> 0x12: <span class="keywordflow">return</span> <span class="stringliteral">"ko"</span>; <span class="comment">/* Korean */</span> -<a name="l00850"></a>00850 <span class="keywordflow">case</span> 0x13: <span class="keywordflow">return</span> <span class="stringliteral">"nl"</span>; <span class="comment">/* Dutch */</span> -<a name="l00851"></a>00851 <span class="keywordflow">case</span> 0x14: <span class="keywordflow">return</span> <span class="stringliteral">"no"</span>; <span class="comment">/* Norwegian */</span> -<a name="l00852"></a>00852 <span class="keywordflow">case</span> 0x15: <span class="keywordflow">return</span> <span class="stringliteral">"pl"</span>; <span class="comment">/* Polish */</span> -<a name="l00853"></a>00853 <span class="keywordflow">case</span> 0x16: <span class="keywordflow">return</span> <span class="stringliteral">"pt"</span>; <span class="comment">/* Portuguese */</span> -<a name="l00854"></a>00854 <span class="keywordflow">case</span> 0x17: <span class="keywordflow">return</span> <span class="stringliteral">"rm"</span>; <span class="comment">/* Rhaeto-Romance */</span> -<a name="l00855"></a>00855 <span class="keywordflow">case</span> 0x18: <span class="keywordflow">return</span> <span class="stringliteral">"ro"</span>; <span class="comment">/* Romanian */</span> -<a name="l00856"></a>00856 <span class="keywordflow">case</span> 0x19: <span class="keywordflow">return</span> <span class="stringliteral">"ru"</span>; <span class="comment">/* Russian */</span> -<a name="l00857"></a>00857 <span class="keywordflow">case</span> 0x1a: <span class="keywordflow">return</span> <span class="stringliteral">"hr"</span>; <span class="comment">/* Croatian */</span> -<a name="l00858"></a>00858 <span class="keywordflow">case</span> 0x1b: <span class="keywordflow">return</span> <span class="stringliteral">"sk"</span>; <span class="comment">/* Slovak */</span> -<a name="l00859"></a>00859 <span class="keywordflow">case</span> 0x1c: <span class="keywordflow">return</span> <span class="stringliteral">"sq"</span>; <span class="comment">/* Albanian */</span> -<a name="l00860"></a>00860 <span class="keywordflow">case</span> 0x1d: <span class="keywordflow">return</span> <span class="stringliteral">"sv"</span>; <span class="comment">/* Swedish */</span> -<a name="l00861"></a>00861 <span class="keywordflow">case</span> 0x1e: <span class="keywordflow">return</span> <span class="stringliteral">"th"</span>; <span class="comment">/* Thai */</span> -<a name="l00862"></a>00862 <span class="keywordflow">case</span> 0x1f: <span class="keywordflow">return</span> <span class="stringliteral">"tr"</span>; <span class="comment">/* Turkish */</span> -<a name="l00863"></a>00863 <span class="keywordflow">case</span> 0x20: <span class="keywordflow">return</span> <span class="stringliteral">"ur"</span>; <span class="comment">/* Urdu */</span> -<a name="l00864"></a>00864 <span class="keywordflow">case</span> 0x21: <span class="keywordflow">return</span> <span class="stringliteral">"id"</span>; <span class="comment">/* Indonesian */</span> -<a name="l00865"></a>00865 <span class="keywordflow">case</span> 0x22: <span class="keywordflow">return</span> <span class="stringliteral">"uk"</span>; <span class="comment">/* Ukrainian */</span> -<a name="l00866"></a>00866 <span class="keywordflow">case</span> 0x23: <span class="keywordflow">return</span> <span class="stringliteral">"be"</span>; <span class="comment">/* Belarusian */</span> -<a name="l00867"></a>00867 <span class="keywordflow">case</span> 0x24: <span class="keywordflow">return</span> <span class="stringliteral">"sl"</span>; <span class="comment">/* Slovenian */</span> -<a name="l00868"></a>00868 <span class="keywordflow">case</span> 0x25: <span class="keywordflow">return</span> <span class="stringliteral">"et"</span>; <span class="comment">/* Estonian */</span> -<a name="l00869"></a>00869 <span class="keywordflow">case</span> 0x26: <span class="keywordflow">return</span> <span class="stringliteral">"lv"</span>; <span class="comment">/* Latvian */</span> -<a name="l00870"></a>00870 <span class="keywordflow">case</span> 0x27: <span class="keywordflow">return</span> <span class="stringliteral">"lt"</span>; <span class="comment">/* Lithuanian */</span> -<a name="l00871"></a>00871 <span class="keywordflow">case</span> 0x29: <span class="keywordflow">return</span> <span class="stringliteral">"fa"</span>; <span class="comment">/* Farsi */</span> -<a name="l00872"></a>00872 <span class="keywordflow">case</span> 0x2a: <span class="keywordflow">return</span> <span class="stringliteral">"vi"</span>; <span class="comment">/* Viet Nam */</span> -<a name="l00873"></a>00873 <span class="keywordflow">case</span> 0x2b: <span class="keywordflow">return</span> <span class="stringliteral">"hy"</span>; <span class="comment">/* Armenian */</span> -<a name="l00874"></a>00874 <span class="keywordflow">case</span> 0x2c: <span class="keywordflow">return</span> <span class="stringliteral">"az"</span>; <span class="comment">/* Azeri */</span> -<a name="l00875"></a>00875 <span class="keywordflow">case</span> 0x2d: <span class="keywordflow">return</span> <span class="stringliteral">"eu"</span>; <span class="comment">/* Basque */</span> -<a name="l00876"></a>00876 <span class="keywordflow">case</span> 0x2f: <span class="keywordflow">return</span> <span class="stringliteral">"mk"</span>; <span class="comment">/* Macedonian */</span> -<a name="l00877"></a>00877 <span class="keywordflow">case</span> 0x36: <span class="keywordflow">return</span> <span class="stringliteral">"af"</span>; <span class="comment">/* Afrikaans */</span> -<a name="l00878"></a>00878 <span class="keywordflow">case</span> 0x37: <span class="keywordflow">return</span> <span class="stringliteral">"ka"</span>; <span class="comment">/* Georgian */</span> -<a name="l00879"></a>00879 <span class="keywordflow">case</span> 0x38: <span class="keywordflow">return</span> <span class="stringliteral">"fo"</span>; <span class="comment">/* Faeroese */</span> -<a name="l00880"></a>00880 <span class="keywordflow">case</span> 0x39: <span class="keywordflow">return</span> <span class="stringliteral">"hi"</span>; <span class="comment">/* Hindi */</span> -<a name="l00881"></a>00881 <span class="keywordflow">case</span> 0x3e: <span class="keywordflow">return</span> <span class="stringliteral">"ms"</span>; <span class="comment">/* Malay */</span> -<a name="l00882"></a>00882 <span class="keywordflow">case</span> 0x3f: <span class="keywordflow">return</span> <span class="stringliteral">"kk"</span>; <span class="comment">/* Kazakh */</span> -<a name="l00883"></a>00883 <span class="keywordflow">default</span>: -<a name="l00884"></a>00884 DBG_HEX(usLid); -<a name="l00885"></a>00885 DBG_FIXME(); -<a name="l00886"></a>00886 <span class="keywordflow">return</span> NULL; -<a name="l00887"></a>00887 } -<a name="l00888"></a>00888 } <span class="comment">/* end of szGetLanguage */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/tabstop_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/tabstop.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/tabstop.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * tabstops.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Read the tab stop information from a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="preprocessor">#define HALF_INCH 36000L </span><span class="comment">/* In millipoints */</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="keyword">static</span> <span class="keywordtype">long</span> lDefaultTabWidth = HALF_INCH; -<a name="l00015"></a>00015 -<a name="l00016"></a>00016 -<a name="l00017"></a>00017 <span class="comment">/*</span> -<a name="l00018"></a>00018 <span class="comment"> * vSet0DefaultTabWidth -</span> -<a name="l00019"></a>00019 <span class="comment"> */</span> -<a name="l00020"></a>00020 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00021"></a>00021 vSet0DefaultTabWidth(<span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00022"></a>00022 { -<a name="l00023"></a>00023 USHORT usTmp; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 fail(aucHeader == NULL); -<a name="l00026"></a>00026 -<a name="l00027"></a>00027 usTmp = usGetWord(0x70, aucHeader); <span class="comment">/* dxaTab */</span> -<a name="l00028"></a>00028 DBG_DEC(usTmp); -<a name="l00029"></a>00029 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp); -<a name="l00030"></a>00030 DBG_DEC(lDefaultTabWidth); -<a name="l00031"></a>00031 } <span class="comment">/* end of vSet0DefaultTabWidth */</span> -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/*</span> -<a name="l00034"></a>00034 <span class="comment"> * vSet2DefaultTabWidth -</span> -<a name="l00035"></a>00035 <span class="comment"> */</span> -<a name="l00036"></a>00036 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00037"></a>00037 vSet2DefaultTabWidth(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00038"></a>00038 { -<a name="l00039"></a>00039 UCHAR *aucBuffer; -<a name="l00040"></a>00040 ULONG ulBeginDocpInfo; -<a name="l00041"></a>00041 <span class="keywordtype">size_t</span> tDocpInfoLen; -<a name="l00042"></a>00042 USHORT usTmp; -<a name="l00043"></a>00043 -<a name="l00044"></a>00044 fail(pFile == NULL || aucHeader == NULL); -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 ulBeginDocpInfo = ulGetLong(0x112, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00047"></a>00047 DBG_HEX(ulBeginDocpInfo); -<a name="l00048"></a>00048 tDocpInfoLen = (size_t)usGetWord(0x116, aucHeader); <span class="comment">/* cbDop */</span> -<a name="l00049"></a>00049 DBG_DEC(tDocpInfoLen); -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (tDocpInfoLen < 12) { -<a name="l00051"></a>00051 DBG_MSG(<span class="stringliteral">"No TAB information"</span>); -<a name="l00052"></a>00052 <span class="keywordflow">return</span>; -<a name="l00053"></a>00053 } -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00056"></a>00056 <span class="keywordflow">if</span> (!bReadBytes(aucBuffer, tDocpInfoLen, ulBeginDocpInfo, pFile)) { -<a name="l00057"></a>00057 aucBuffer = xfree(aucBuffer); -<a name="l00058"></a>00058 <span class="keywordflow">return</span>; -<a name="l00059"></a>00059 } -<a name="l00060"></a>00060 usTmp = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00061"></a>00061 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp); -<a name="l00062"></a>00062 DBG_DEC(lDefaultTabWidth); -<a name="l00063"></a>00063 aucBuffer = xfree(aucBuffer); -<a name="l00064"></a>00064 } <span class="comment">/* end of vSet2DefaultTabWidth */</span> -<a name="l00065"></a>00065 -<a name="l00066"></a>00066 <span class="comment">/*</span> -<a name="l00067"></a>00067 <span class="comment"> * vSet6DefaultTabWidth -</span> -<a name="l00068"></a>00068 <span class="comment"> */</span> -<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00070"></a>00070 vSet6DefaultTabWidth(FILE *pFile, ULONG ulStartBlock, -<a name="l00071"></a>00071 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00072"></a>00072 { -<a name="l00073"></a>00073 UCHAR *aucBuffer; -<a name="l00074"></a>00074 ULONG ulBeginDocpInfo; -<a name="l00075"></a>00075 <span class="keywordtype">size_t</span> tDocpInfoLen; -<a name="l00076"></a>00076 USHORT usTmp; -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 ulBeginDocpInfo = ulGetLong(0x150, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00079"></a>00079 DBG_HEX(ulBeginDocpInfo); -<a name="l00080"></a>00080 tDocpInfoLen = (size_t)ulGetLong(0x154, aucHeader); <span class="comment">/* lcbDop */</span> -<a name="l00081"></a>00081 DBG_DEC(tDocpInfoLen); -<a name="l00082"></a>00082 <span class="keywordflow">if</span> (tDocpInfoLen < 12) { -<a name="l00083"></a>00083 DBG_MSG(<span class="stringliteral">"No TAB information"</span>); -<a name="l00084"></a>00084 <span class="keywordflow">return</span>; -<a name="l00085"></a>00085 } -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00088"></a>00088 <span class="keywordflow">if</span> (!bReadBuffer(pFile, ulStartBlock, -<a name="l00089"></a>00089 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00090"></a>00090 aucBuffer, ulBeginDocpInfo, tDocpInfoLen)) { -<a name="l00091"></a>00091 aucBuffer = xfree(aucBuffer); -<a name="l00092"></a>00092 <span class="keywordflow">return</span>; -<a name="l00093"></a>00093 } -<a name="l00094"></a>00094 usTmp = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00095"></a>00095 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp); -<a name="l00096"></a>00096 DBG_DEC(lDefaultTabWidth); -<a name="l00097"></a>00097 aucBuffer = xfree(aucBuffer); -<a name="l00098"></a>00098 } <span class="comment">/* end of vSet6DefaultTabWidth */</span> -<a name="l00099"></a>00099 -<a name="l00100"></a>00100 <span class="comment">/*</span> -<a name="l00101"></a>00101 <span class="comment"> * vSet8DefaultTabWidth -</span> -<a name="l00102"></a>00102 <span class="comment"> */</span> -<a name="l00103"></a>00103 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00104"></a>00104 vSet8DefaultTabWidth(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00105"></a>00105 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00106"></a>00106 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00107"></a>00107 <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00108"></a>00108 { -<a name="l00109"></a>00109 <span class="keyword">const</span> ULONG *aulBlockDepot; -<a name="l00110"></a>00110 UCHAR *aucBuffer; -<a name="l00111"></a>00111 ULONG ulBeginDocpInfo; -<a name="l00112"></a>00112 <span class="keywordtype">size_t</span> tDocpInfoLen, tBlockDepotLen, tBlockSize; -<a name="l00113"></a>00113 USHORT usTmp; -<a name="l00114"></a>00114 -<a name="l00115"></a>00115 ulBeginDocpInfo = ulGetLong(0x192, aucHeader); <span class="comment">/* fcDop */</span> -<a name="l00116"></a>00116 DBG_HEX(ulBeginDocpInfo); -<a name="l00117"></a>00117 tDocpInfoLen = (size_t)ulGetLong(0x196, aucHeader); <span class="comment">/* lcbDop */</span> -<a name="l00118"></a>00118 DBG_DEC(tDocpInfoLen); -<a name="l00119"></a>00119 <span class="keywordflow">if</span> (tDocpInfoLen < 12) { -<a name="l00120"></a>00120 DBG_MSG(<span class="stringliteral">"No TAB information"</span>); -<a name="l00121"></a>00121 <span class="keywordflow">return</span>; -<a name="l00122"></a>00122 } -<a name="l00123"></a>00123 -<a name="l00124"></a>00124 DBG_DEC(pPPS->tTable.ulSB); -<a name="l00125"></a>00125 DBG_HEX(pPPS->tTable.ulSize); -<a name="l00126"></a>00126 <span class="keywordflow">if</span> (pPPS->tTable.ulSize == 0) { -<a name="l00127"></a>00127 DBG_MSG(<span class="stringliteral">"No TAB information"</span>); -<a name="l00128"></a>00128 <span class="keywordflow">return</span>; -<a name="l00129"></a>00129 } -<a name="l00130"></a>00130 -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (pPPS->tTable.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00132"></a>00132 <span class="comment">/* Use the Small Block Depot */</span> -<a name="l00133"></a>00133 aulBlockDepot = aulSBD; -<a name="l00134"></a>00134 tBlockDepotLen = tSBDLen; -<a name="l00135"></a>00135 tBlockSize = SMALL_BLOCK_SIZE; -<a name="l00136"></a>00136 } <span class="keywordflow">else</span> { -<a name="l00137"></a>00137 <span class="comment">/* Use the Big Block Depot */</span> -<a name="l00138"></a>00138 aulBlockDepot = aulBBD; -<a name="l00139"></a>00139 tBlockDepotLen = tBBDLen; -<a name="l00140"></a>00140 tBlockSize = BIG_BLOCK_SIZE; -<a name="l00141"></a>00141 } -<a name="l00142"></a>00142 aucBuffer = xmalloc(tDocpInfoLen); -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (!bReadBuffer(pFile, pPPS->tTable.ulSB, -<a name="l00144"></a>00144 aulBlockDepot, tBlockDepotLen, tBlockSize, -<a name="l00145"></a>00145 aucBuffer, ulBeginDocpInfo, tDocpInfoLen)) { -<a name="l00146"></a>00146 aucBuffer = xfree(aucBuffer); -<a name="l00147"></a>00147 <span class="keywordflow">return</span>; -<a name="l00148"></a>00148 } -<a name="l00149"></a>00149 usTmp = usGetWord(0x0a, aucBuffer); <span class="comment">/* dxaTab */</span> -<a name="l00150"></a>00150 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp); -<a name="l00151"></a>00151 DBG_DEC(lDefaultTabWidth); -<a name="l00152"></a>00152 aucBuffer = xfree(aucBuffer); -<a name="l00153"></a>00153 } <span class="comment">/* end of vSet8DefaultTabWidth */</span> -<a name="l00154"></a>00154 -<a name="l00155"></a>00155 <span class="comment">/*</span> -<a name="l00156"></a>00156 <span class="comment"> * vSetDefaultTabWidth -</span> -<a name="l00157"></a>00157 <span class="comment"> */</span> -<a name="l00158"></a>00158 <span class="keywordtype">void</span> -<a name="l00159"></a>00159 vSetDefaultTabWidth(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00160"></a>00160 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00161"></a>00161 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00162"></a>00162 <span class="keyword">const</span> UCHAR *aucHeader, <span class="keywordtype">int</span> iWordVersion) -<a name="l00163"></a>00163 { -<a name="l00164"></a>00164 fail(pFile == NULL && iWordVersion >= 1); -<a name="l00165"></a>00165 fail(pPPS == NULL && iWordVersion >= 6); -<a name="l00166"></a>00166 fail(aulBBD == NULL && tBBDLen != 0); -<a name="l00167"></a>00167 fail(aulSBD == NULL && tSBDLen != 0); -<a name="l00168"></a>00168 fail(aucHeader == NULL); -<a name="l00169"></a>00169 -<a name="l00170"></a>00170 <span class="comment">/* Reset to the default default value */</span> -<a name="l00171"></a>00171 lDefaultTabWidth = HALF_INCH; -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00174"></a>00174 <span class="keywordflow">case</span> 0: -<a name="l00175"></a>00175 vSet0DefaultTabWidth(aucHeader); -<a name="l00176"></a>00176 <span class="keywordflow">break</span>; -<a name="l00177"></a>00177 <span class="keywordflow">case</span> 1: -<a name="l00178"></a>00178 <span class="keywordflow">case</span> 2: -<a name="l00179"></a>00179 vSet2DefaultTabWidth(pFile, aucHeader); -<a name="l00180"></a>00180 <span class="keywordflow">break</span>; -<a name="l00181"></a>00181 <span class="keywordflow">case</span> 4: -<a name="l00182"></a>00182 <span class="keywordflow">case</span> 5: -<a name="l00183"></a>00183 <span class="keywordflow">break</span>; -<a name="l00184"></a>00184 <span class="keywordflow">case</span> 6: -<a name="l00185"></a>00185 <span class="keywordflow">case</span> 7: -<a name="l00186"></a>00186 vSet6DefaultTabWidth(pFile, pPPS->tWordDocument.ulSB, -<a name="l00187"></a>00187 aulBBD, tBBDLen, aucHeader); -<a name="l00188"></a>00188 <span class="keywordflow">break</span>; -<a name="l00189"></a>00189 <span class="keywordflow">case</span> 8: -<a name="l00190"></a>00190 vSet8DefaultTabWidth(pFile, pPPS, -<a name="l00191"></a>00191 aulBBD, tBBDLen, aulSBD, tSBDLen, aucHeader); -<a name="l00192"></a>00192 <span class="keywordflow">break</span>; -<a name="l00193"></a>00193 <span class="keywordflow">default</span>: -<a name="l00194"></a>00194 werr(0, <span class="stringliteral">"Sorry, no TAB information"</span>); -<a name="l00195"></a>00195 <span class="keywordflow">break</span>; -<a name="l00196"></a>00196 } -<a name="l00197"></a>00197 } <span class="comment">/* end of vSetDefaultTabWidth */</span> -<a name="l00198"></a>00198 -<a name="l00199"></a>00199 <span class="preprocessor">#if 0</span> -<a name="l00200"></a>00200 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00201"></a>00201 <span class="comment"> * lGetDefaultTabWidth - Get the default tabwidth in millipoints</span> -<a name="l00202"></a>00202 <span class="comment"> */</span> -<a name="l00203"></a>00203 <span class="keywordtype">long</span> -<a name="l00204"></a>00204 lGetDefaultTabWidth(<span class="keywordtype">void</span>) -<a name="l00205"></a>00205 { -<a name="l00206"></a>00206 <span class="keywordflow">if</span> (lDefaultTabWidth <= 0) { -<a name="l00207"></a>00207 DBG_DEC(lDefaultTabWidth); -<a name="l00208"></a>00208 <span class="keywordflow">return</span> lTwips2MilliPoints(1); -<a name="l00209"></a>00209 } -<a name="l00210"></a>00210 <span class="keywordflow">return</span> lDefaultTabWidth; -<a name="l00211"></a>00211 } <span class="comment">/* end of lGetDefaultTabWidth */</span> -<a name="l00212"></a>00212 <span class="preprocessor">#endif</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/text_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/text.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/text.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * text.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1999-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the Text format</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="comment">/* The character set */</span> -<a name="l00014"></a>00014 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00015"></a>00015 <span class="comment">/* Current vertical position information */</span> -<a name="l00016"></a>00016 <span class="keyword">static</span> <span class="keywordtype">long</span> lYtopCurr = 0; -<a name="l00017"></a>00017 <span class="comment">/* Local representation of the non-breaking space */</span> -<a name="l00018"></a>00018 <span class="keyword">static</span> UCHAR ucNbsp = 0; -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/*</span> -<a name="l00022"></a>00022 <span class="comment"> * vPrologueTXT - set options and perform the Text initialization</span> -<a name="l00023"></a>00023 <span class="comment"> */</span> -<a name="l00024"></a>00024 <span class="keywordtype">void</span> -<a name="l00025"></a>00025 vPrologueTXT(diagram_type *pDiag, <span class="keyword">const</span> options_type *pOptions) -<a name="l00026"></a>00026 { -<a name="l00027"></a>00027 fail(pDiag == NULL); -<a name="l00028"></a>00028 fail(pOptions == NULL); -<a name="l00029"></a>00029 -<a name="l00030"></a>00030 eEncoding = pOptions->eEncoding; -<a name="l00031"></a>00031 pDiag->lXleft = 0; -<a name="l00032"></a>00032 pDiag->lYtop = 0; -<a name="l00033"></a>00033 lYtopCurr = 0; -<a name="l00034"></a>00034 } <span class="comment">/* end of vPrologueTXT */</span> -<a name="l00035"></a>00035 -<a name="l00036"></a>00036 <span class="comment">/*</span> -<a name="l00037"></a>00037 <span class="comment"> * vEpilogueTXT - clean up after everything is done</span> -<a name="l00038"></a>00038 <span class="comment"> */</span> -<a name="l00039"></a>00039 <span class="keywordtype">void</span> -<a name="l00040"></a>00040 vEpilogueTXT(FILE *pOutFile) -<a name="l00041"></a>00041 { -<a name="l00042"></a>00042 fail(pOutFile == NULL); -<a name="l00043"></a>00043 -<a name="l00044"></a>00044 fprintf(pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00045"></a>00045 } <span class="comment">/* end of vEpilogueTXT */</span> -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 <span class="comment">/*</span> -<a name="l00048"></a>00048 <span class="comment"> * vPrintTXT - print a Text string</span> -<a name="l00049"></a>00049 <span class="comment"> */</span> -<a name="l00050"></a>00050 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00051"></a>00051 vPrintTXT(FILE *pFile, <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength) -<a name="l00052"></a>00052 { -<a name="l00053"></a>00053 <span class="keyword">const</span> UCHAR *ucBytes; -<a name="l00054"></a>00054 <span class="keywordtype">size_t</span> tCount; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 fail(szString == NULL); -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="keywordflow">if</span> (szString == NULL || szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00059"></a>00059 <span class="keywordflow">return</span>; -<a name="l00060"></a>00060 } -<a name="l00061"></a>00061 -<a name="l00062"></a>00062 <span class="keywordflow">if</span> (eEncoding == encoding_utf_8) { -<a name="l00063"></a>00063 fprintf(pFile, <span class="stringliteral">"%.*s"</span>, (<span class="keywordtype">int</span>)tStringLength, szString); -<a name="l00064"></a>00064 <span class="keywordflow">return</span>; -<a name="l00065"></a>00065 } -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 <span class="keywordflow">if</span> (ucNbsp == 0) { -<a name="l00068"></a>00068 ucNbsp = ucGetNbspCharacter(); -<a name="l00069"></a>00069 DBG_HEX_C(ucNbsp != 0xa0, ucNbsp); -<a name="l00070"></a>00070 } -<a name="l00071"></a>00071 -<a name="l00072"></a>00072 ucBytes = (UCHAR *)szString; -<a name="l00073"></a>00073 <span class="keywordflow">for</span> (tCount = 0; tCount < tStringLength ; tCount++) { -<a name="l00074"></a>00074 <span class="keywordflow">if</span> (ucBytes[tCount] == ucNbsp) { -<a name="l00075"></a>00075 (void)putc(<span class="charliteral">' '</span>, pFile); -<a name="l00076"></a>00076 } <span class="keywordflow">else</span> { -<a name="l00077"></a>00077 (void)putc(szString[tCount], pFile); -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 } -<a name="l00080"></a>00080 } <span class="comment">/* end of vPrintTXT */</span> -<a name="l00081"></a>00081 -<a name="l00082"></a>00082 <span class="comment">/*</span> -<a name="l00083"></a>00083 <span class="comment"> * vMoveTo - move to the given X,Y coordinates</span> -<a name="l00084"></a>00084 <span class="comment"> *</span> -<a name="l00085"></a>00085 <span class="comment"> * Move the current position of the given diagram to its X,Y coordinates,</span> -<a name="l00086"></a>00086 <span class="comment"> * start on a new page if needed</span> -<a name="l00087"></a>00087 <span class="comment"> */</span> -<a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00089"></a>00089 vMoveTo(diagram_type *pDiag) -<a name="l00090"></a>00090 { -<a name="l00091"></a>00091 <span class="keywordtype">int</span> iCount, iNbr; -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 fail(pDiag == NULL); -<a name="l00094"></a>00094 fail(pDiag->pOutFile == NULL); -<a name="l00095"></a>00095 -<a name="l00096"></a>00096 <span class="keywordflow">if</span> (pDiag->lYtop != lYtopCurr) { -<a name="l00097"></a>00097 iNbr = iDrawUnits2Char(pDiag->lXleft); -<a name="l00098"></a>00098 <span class="keywordflow">for</span> (iCount = 0; iCount < iNbr; iCount++) { -<a name="l00099"></a>00099 (void)putc(FILLER_CHAR, pDiag->pOutFile); -<a name="l00100"></a>00100 } -<a name="l00101"></a>00101 lYtopCurr = pDiag->lYtop; -<a name="l00102"></a>00102 } -<a name="l00103"></a>00103 } <span class="comment">/* end of vMoveTo */</span> -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 <span class="comment">/*</span> -<a name="l00106"></a>00106 <span class="comment"> * vMove2NextLineTXT - move to the next line</span> -<a name="l00107"></a>00107 <span class="comment"> */</span> -<a name="l00108"></a>00108 <span class="keywordtype">void</span> -<a name="l00109"></a>00109 vMove2NextLineTXT(diagram_type *pDiag) -<a name="l00110"></a>00110 { -<a name="l00111"></a>00111 fail(pDiag == NULL); -<a name="l00112"></a>00112 fail(pDiag->pOutFile == NULL); -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 pDiag->lYtop++; -<a name="l00115"></a>00115 (void)fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00116"></a>00116 } <span class="comment">/* end of vMove2NextLineTXT */</span> -<a name="l00117"></a>00117 -<a name="l00118"></a>00118 <span class="comment">/*</span> -<a name="l00119"></a>00119 <span class="comment"> * vSubstringTXT - print a sub string</span> -<a name="l00120"></a>00120 <span class="comment"> */</span> -<a name="l00121"></a>00121 <span class="keywordtype">void</span> -<a name="l00122"></a>00122 vSubstringTXT(diagram_type *pDiag, -<a name="l00123"></a>00123 <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth) -<a name="l00124"></a>00124 { -<a name="l00125"></a>00125 fail(pDiag == NULL || szString == NULL); -<a name="l00126"></a>00126 fail(pDiag->pOutFile == NULL); -<a name="l00127"></a>00127 fail(pDiag->lXleft < 0); -<a name="l00128"></a>00128 fail(tStringLength != strlen(szString)); -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00131"></a>00131 <span class="keywordflow">return</span>; -<a name="l00132"></a>00132 } -<a name="l00133"></a>00133 -<a name="l00134"></a>00134 vMoveTo(pDiag); -<a name="l00135"></a>00135 vPrintTXT(pDiag->pOutFile, szString, tStringLength); -<a name="l00136"></a>00136 pDiag->lXleft += lStringWidth; -<a name="l00137"></a>00137 } <span class="comment">/* end of vSubstringTXT */</span> -<a name="l00138"></a>00138 -<a name="l00139"></a>00139 <span class="comment">/*</span> -<a name="l00140"></a>00140 <span class="comment"> * Create an start of paragraph by moving the y-top mark</span> -<a name="l00141"></a>00141 <span class="comment"> */</span> -<a name="l00142"></a>00142 <span class="keywordtype">void</span> -<a name="l00143"></a>00143 vStartOfParagraphTXT(diagram_type *pDiag, <span class="keywordtype">long</span> lBeforeIndentation) -<a name="l00144"></a>00144 { -<a name="l00145"></a>00145 fail(pDiag == NULL); -<a name="l00146"></a>00146 fail(lBeforeIndentation < 0); -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="keywordflow">if</span> (lBeforeIndentation >= lTwips2MilliPoints(HEADING_GAP)) { -<a name="l00149"></a>00149 <span class="comment">/* A large gap is replaced by an empty line */</span> -<a name="l00150"></a>00150 vMove2NextLineTXT(pDiag); -<a name="l00151"></a>00151 } -<a name="l00152"></a>00152 } <span class="comment">/* end of vStartOfParagraphTXT */</span> -<a name="l00153"></a>00153 -<a name="l00154"></a>00154 <span class="comment">/*</span> -<a name="l00155"></a>00155 <span class="comment"> * Create an end of paragraph by moving the y-top mark</span> -<a name="l00156"></a>00156 <span class="comment"> */</span> -<a name="l00157"></a>00157 <span class="keywordtype">void</span> -<a name="l00158"></a>00158 vEndOfParagraphTXT(diagram_type *pDiag, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l00159"></a>00159 { -<a name="l00160"></a>00160 fail(pDiag == NULL); -<a name="l00161"></a>00161 fail(pDiag->pOutFile == NULL); -<a name="l00162"></a>00162 fail(lAfterIndentation < 0); -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 <span class="keywordflow">if</span> (pDiag->lXleft > 0) { -<a name="l00165"></a>00165 <span class="comment">/* To the start of the line */</span> -<a name="l00166"></a>00166 vMove2NextLineTXT(pDiag); -<a name="l00167"></a>00167 } -<a name="l00168"></a>00168 -<a name="l00169"></a>00169 <span class="keywordflow">if</span> (lAfterIndentation >= lTwips2MilliPoints(HEADING_GAP)) { -<a name="l00170"></a>00170 <span class="comment">/* A large gap is replaced by an empty line */</span> -<a name="l00171"></a>00171 vMove2NextLineTXT(pDiag); -<a name="l00172"></a>00172 } -<a name="l00173"></a>00173 } <span class="comment">/* end of vEndOfParagraphTXT */</span> -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 <span class="comment">/*</span> -<a name="l00176"></a>00176 <span class="comment"> * Create an end of page</span> -<a name="l00177"></a>00177 <span class="comment"> */</span> -<a name="l00178"></a>00178 <span class="keywordtype">void</span> -<a name="l00179"></a>00179 vEndOfPageTXT(diagram_type *pDiag, <span class="keywordtype">long</span> lAfterIndentation) -<a name="l00180"></a>00180 { -<a name="l00181"></a>00181 vEndOfParagraphTXT(pDiag, lAfterIndentation); -<a name="l00182"></a>00182 } <span class="comment">/* end of vEndOfPageTXT */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/unix_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/unix.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/unix.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * unix.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2000 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Unix approximations of RISC-OS functions</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <stdarg.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="comment">/*</span> -<a name="l00016"></a>00016 <span class="comment"> * werr - write an error message and exit if needed</span> -<a name="l00017"></a>00017 <span class="comment"> */</span> -<a name="l00018"></a>00018 <span class="keywordtype">void</span> -<a name="l00019"></a>00019 werr(<span class="keywordtype">int</span> iFatal, <span class="keyword">const</span> <span class="keywordtype">char</span> *szFormat, ...) -<a name="l00020"></a>00020 { -<a name="l00021"></a>00021 va_list tArg; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 va_start(tArg, szFormat); -<a name="l00024"></a>00024 (void)vfprintf(stderr, szFormat, tArg); -<a name="l00025"></a>00025 va_end(tArg); -<a name="l00026"></a>00026 fprintf(stderr, <span class="stringliteral">"\n"</span>); -<a name="l00027"></a>00027 <span class="keywordflow">switch</span> (iFatal) { -<a name="l00028"></a>00028 <span class="keywordflow">case</span> 0: <span class="comment">/* The message is just a warning, so no exit */</span> -<a name="l00029"></a>00029 <span class="keywordflow">return</span>; -<a name="l00030"></a>00030 <span class="keywordflow">case</span> 1: <span class="comment">/* Fatal error with a standard exit */</span> -<a name="l00031"></a>00031 exit(EXIT_FAILURE); -<a name="l00032"></a>00032 <span class="keywordflow">default</span>: <span class="comment">/* Fatal error with a non-standard exit */</span> -<a name="l00033"></a>00033 exit(iFatal); -<a name="l00034"></a>00034 } -<a name="l00035"></a>00035 } <span class="comment">/* end of werr */</span> -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="keywordtype">void</span> -<a name="l00038"></a>00038 Hourglass_On(<span class="keywordtype">void</span>) -<a name="l00039"></a>00039 { -<a name="l00040"></a>00040 } <span class="comment">/* end of Hourglass_On */</span> -<a name="l00041"></a>00041 -<a name="l00042"></a>00042 <span class="keywordtype">void</span> -<a name="l00043"></a>00043 Hourglass_Off(<span class="keywordtype">void</span>) -<a name="l00044"></a>00044 { -<a name="l00045"></a>00045 } <span class="comment">/* end of Hourglass_Off */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/utf8_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/utf8.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/utf8.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * utf8.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2001-2004 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> *====================================================================</span> -<a name="l00006"></a>00006 <span class="comment"> * This part of the software is based on:</span> -<a name="l00007"></a>00007 <span class="comment"> * An implementation of wcwidth() as defined in</span> -<a name="l00008"></a>00008 <span class="comment"> * "The Single UNIX Specification, Version 2, The Open Group, 1997"</span> -<a name="l00009"></a>00009 <span class="comment"> * <http://www.UNIX-systems.org/online.html></span> -<a name="l00010"></a>00010 <span class="comment"> * Markus Kuhn -- 2001-01-12 -- public domain</span> -<a name="l00011"></a>00011 <span class="comment"> *====================================================================</span> -<a name="l00012"></a>00012 <span class="comment"> * The credit should go to him, but all the bugs are mine.</span> -<a name="l00013"></a>00013 <span class="comment"> */</span> -<a name="l00014"></a>00014 -<a name="l00015"></a>00015 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00016"></a>00016 <span class="preprocessor">#include <string.h></span> -<a name="l00017"></a>00017 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 <span class="keyword">struct </span>interval { -<a name="l00020"></a>00020 USHORT first; -<a name="l00021"></a>00021 USHORT last; -<a name="l00022"></a>00022 }; -<a name="l00023"></a>00023 <span class="comment">/* Sorted list of non-overlapping intervals of non-spacing characters */</span> -<a name="l00024"></a>00024 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">struct </span>interval combining[] = { -<a name="l00025"></a>00025 { 0x0300, 0x034E }, { 0x0360, 0x0362 }, { 0x0483, 0x0486 }, -<a name="l00026"></a>00026 { 0x0488, 0x0489 }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 }, -<a name="l00027"></a>00027 { 0x05BB, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, -<a name="l00028"></a>00028 { 0x05C4, 0x05C4 }, { 0x064B, 0x0655 }, { 0x0670, 0x0670 }, -<a name="l00029"></a>00029 { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, -<a name="l00030"></a>00030 { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, -<a name="l00031"></a>00031 { 0x07A6, 0x07B0 }, { 0x0901, 0x0902 }, { 0x093C, 0x093C }, -<a name="l00032"></a>00032 { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0954 }, -<a name="l00033"></a>00033 { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, -<a name="l00034"></a>00034 { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, -<a name="l00035"></a>00035 { 0x0A02, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, -<a name="l00036"></a>00036 { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A70, 0x0A71 }, -<a name="l00037"></a>00037 { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, -<a name="l00038"></a>00038 { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0B01, 0x0B01 }, -<a name="l00039"></a>00039 { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, -<a name="l00040"></a>00040 { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, -<a name="l00041"></a>00041 { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, -<a name="l00042"></a>00042 { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, -<a name="l00043"></a>00043 { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, -<a name="l00044"></a>00044 { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, { 0x0DCA, 0x0DCA }, -<a name="l00045"></a>00045 { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 }, -<a name="l00046"></a>00046 { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, -<a name="l00047"></a>00047 { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, -<a name="l00048"></a>00048 { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, -<a name="l00049"></a>00049 { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, -<a name="l00050"></a>00050 { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, { 0x0F99, 0x0FBC }, -<a name="l00051"></a>00051 { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1032 }, -<a name="l00052"></a>00052 { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, { 0x1058, 0x1059 }, -<a name="l00053"></a>00053 { 0x1160, 0x11FF }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, -<a name="l00054"></a>00054 { 0x17C9, 0x17D3 }, { 0x180B, 0x180E }, { 0x18A9, 0x18A9 }, -<a name="l00055"></a>00055 { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x206A, 0x206F }, -<a name="l00056"></a>00056 { 0x20D0, 0x20E3 }, { 0x302A, 0x302F }, { 0x3099, 0x309A }, -<a name="l00057"></a>00057 { 0xFB1E, 0xFB1E }, { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, -<a name="l00058"></a>00058 { 0xFFF9, 0xFFFB } -<a name="l00059"></a>00059 }; -<a name="l00060"></a>00060 -<a name="l00061"></a>00061 <span class="comment">/* Auxiliary function for binary search in interval table */</span> -<a name="l00062"></a>00062 <span class="keyword">static</span> BOOL -<a name="l00063"></a>00063 bIsZeroWidthChar(ULONG ucs) -<a name="l00064"></a>00064 { -<a name="l00065"></a>00065 <span class="keywordtype">int</span> low = 0; -<a name="l00066"></a>00066 <span class="keywordtype">int</span> high = elementsof(combining) - 1; -<a name="l00067"></a>00067 <span class="keywordtype">int</span> mid; -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 <span class="keywordflow">if</span> (ucs < (ULONG)combining[low].first || -<a name="l00070"></a>00070 ucs > (ULONG)combining[high].last) { -<a name="l00071"></a>00071 <span class="keywordflow">return</span> FALSE; -<a name="l00072"></a>00072 } -<a name="l00073"></a>00073 -<a name="l00074"></a>00074 <span class="keywordflow">while</span> (high >= low) { -<a name="l00075"></a>00075 mid = (low + high) / 2; -<a name="l00076"></a>00076 <span class="keywordflow">if</span> (ucs > (ULONG)combining[mid].last) { -<a name="l00077"></a>00077 low = mid + 1; -<a name="l00078"></a>00078 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ucs < (ULONG)combining[mid].first) { -<a name="l00079"></a>00079 high = mid - 1; -<a name="l00080"></a>00080 } <span class="keywordflow">else</span> { -<a name="l00081"></a>00081 <span class="keywordflow">return</span> TRUE; -<a name="l00082"></a>00082 } -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 <span class="keywordflow">return</span> FALSE; -<a name="l00085"></a>00085 } <span class="comment">/* end of bIsZeroWidthChar */</span> -<a name="l00086"></a>00086 -<a name="l00087"></a>00087 <span class="comment">/* The following functions define the column width of an ISO 10646</span> -<a name="l00088"></a>00088 <span class="comment"> * character as follows:</span> -<a name="l00089"></a>00089 <span class="comment"> *</span> -<a name="l00090"></a>00090 <span class="comment"> * - The null character (U+0000) has a column width of 0.</span> -<a name="l00091"></a>00091 <span class="comment"> *</span> -<a name="l00092"></a>00092 <span class="comment"> * - Other C0/C1 control characters and DEL will lead to a return</span> -<a name="l00093"></a>00093 <span class="comment"> * value of -1.</span> -<a name="l00094"></a>00094 <span class="comment"> *</span> -<a name="l00095"></a>00095 <span class="comment"> * - Non-spacing and enclosing combining characters (general</span> -<a name="l00096"></a>00096 <span class="comment"> * category code Mn or Me in the Unicode database) have a</span> -<a name="l00097"></a>00097 <span class="comment"> * column width of 0.</span> -<a name="l00098"></a>00098 <span class="comment"> *</span> -<a name="l00099"></a>00099 <span class="comment"> * - Other format characters (general category code Cf in the Unicode</span> -<a name="l00100"></a>00100 <span class="comment"> * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.</span> -<a name="l00101"></a>00101 <span class="comment"> *</span> -<a name="l00102"></a>00102 <span class="comment"> * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)</span> -<a name="l00103"></a>00103 <span class="comment"> * have a column width of 0.</span> -<a name="l00104"></a>00104 <span class="comment"> *</span> -<a name="l00105"></a>00105 <span class="comment"> * - Spacing characters in the East Asian Wide (W) or East Asian</span> -<a name="l00106"></a>00106 <span class="comment"> * FullWidth (F) category as defined in Unicode Technical</span> -<a name="l00107"></a>00107 <span class="comment"> * Report #11 have a column width of 2.</span> -<a name="l00108"></a>00108 <span class="comment"> *</span> -<a name="l00109"></a>00109 <span class="comment"> * - All remaining characters (including all printable</span> -<a name="l00110"></a>00110 <span class="comment"> * ISO 8859-1 and WGL4 characters, Unicode control characters,</span> -<a name="l00111"></a>00111 <span class="comment"> * etc.) have a column width of 1.</span> -<a name="l00112"></a>00112 <span class="comment"> *</span> -<a name="l00113"></a>00113 <span class="comment"> * This implementation assumes that all characters are encoded</span> -<a name="l00114"></a>00114 <span class="comment"> * in ISO 10646.</span> -<a name="l00115"></a>00115 <span class="comment"> *</span> -<a name="l00116"></a>00116 <span class="comment"> * This function is not named wcwidth() to prevent name clashes</span> -<a name="l00117"></a>00117 <span class="comment"> */</span> -<a name="l00118"></a>00118 <span class="keyword">static</span> <span class="keywordtype">int</span> -<a name="l00119"></a>00119 iWcWidth(ULONG ucs) -<a name="l00120"></a>00120 { -<a name="l00121"></a>00121 <span class="comment">/* Test for 8-bit control characters */</span> -<a name="l00122"></a>00122 <span class="keywordflow">if</span> (ucs == 0) { -<a name="l00123"></a>00123 <span class="keywordflow">return</span> 0; -<a name="l00124"></a>00124 } -<a name="l00125"></a>00125 <span class="keywordflow">if</span> (ucs < 0x20 || (ucs >= 0x7f && ucs < 0xa0)) { -<a name="l00126"></a>00126 NO_DBG_HEX(ucs); -<a name="l00127"></a>00127 <span class="keywordflow">return</span> -1; -<a name="l00128"></a>00128 } -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="comment">/* Binary search in table of non-spacing characters */</span> -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (bIsZeroWidthChar(ucs)) { -<a name="l00132"></a>00132 <span class="keywordflow">return</span> 0; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 -<a name="l00135"></a>00135 <span class="comment">/* Ucs is not a combining or C0/C1 control character */</span> -<a name="l00136"></a>00136 -<a name="l00137"></a>00137 <span class="keywordflow">return</span> 1 + -<a name="l00138"></a>00138 (ucs >= 0x1100 && -<a name="l00139"></a>00139 (ucs <= 0x115f || <span class="comment">/* Hangul Jamo init. consonants */</span> -<a name="l00140"></a>00140 (ucs >= 0x2e80 && ucs <= 0xa4cf && (ucs & ~0x0011) != 0x300a && -<a name="l00141"></a>00141 ucs != 0x303f) || <span class="comment">/* CJK ... Yi */</span> -<a name="l00142"></a>00142 (ucs >= 0xac00 && ucs <= 0xd7a3) || <span class="comment">/* Hangul Syllables */</span> -<a name="l00143"></a>00143 (ucs >= 0xf900 && ucs <= 0xfaff) || <span class="comment">/* CJK Compatibility Ideographs */</span> -<a name="l00144"></a>00144 (ucs >= 0xfe30 && ucs <= 0xfe6f) || <span class="comment">/* CJK Compatibility Forms */</span> -<a name="l00145"></a>00145 (ucs >= 0xff00 && ucs <= 0xff5f) || <span class="comment">/* Fullwidth Forms */</span> -<a name="l00146"></a>00146 (ucs >= 0xffe0 && ucs <= 0xffe6) || -<a name="l00147"></a>00147 (ucs >= 0x20000 && ucs <= 0x2ffff))); -<a name="l00148"></a>00148 } <span class="comment">/* end of iWcWidth */</span> -<a name="l00149"></a>00149 -<a name="l00150"></a>00150 <span class="comment">/*</span> -<a name="l00151"></a>00151 <span class="comment"> * utf8_to_ucs - convert from UTF-8 to UCS</span> -<a name="l00152"></a>00152 <span class="comment"> *</span> -<a name="l00153"></a>00153 <span class="comment"> * Returns the UCS character,</span> -<a name="l00154"></a>00154 <span class="comment"> * Fills in the number of bytes in the UTF-8 character</span> -<a name="l00155"></a>00155 <span class="comment"> */</span> -<a name="l00156"></a>00156 <span class="keyword">static</span> ULONG -<a name="l00157"></a>00157 utf8_to_ucs(<span class="keyword">const</span> <span class="keywordtype">char</span> *p, <span class="keywordtype">int</span> iStrLen, <span class="keywordtype">int</span> *piUtfLen) -<a name="l00158"></a>00158 { -<a name="l00159"></a>00159 ULONG ulUcs; -<a name="l00160"></a>00160 <span class="keywordtype">int</span> iIndex, iCharLen; -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 fail(p == NULL || piUtfLen == NULL); -<a name="l00163"></a>00163 fail(iStrLen < 1); -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 ulUcs = (ULONG)(UCHAR)p[0]; -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 <span class="keywordflow">if</span> (ulUcs < 0x80) { -<a name="l00168"></a>00168 *piUtfLen = 1; -<a name="l00169"></a>00169 <span class="keywordflow">return</span> ulUcs; -<a name="l00170"></a>00170 } -<a name="l00171"></a>00171 -<a name="l00172"></a>00172 <span class="keywordflow">if</span> (ulUcs < 0xe0){ -<a name="l00173"></a>00173 iCharLen = 2; -<a name="l00174"></a>00174 ulUcs &= 0x1f; -<a name="l00175"></a>00175 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ulUcs < 0xf0){ -<a name="l00176"></a>00176 iCharLen = 3; -<a name="l00177"></a>00177 ulUcs &= 0x0f; -<a name="l00178"></a>00178 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ulUcs < 0xf8){ -<a name="l00179"></a>00179 iCharLen = 4; -<a name="l00180"></a>00180 ulUcs &= 0x07; -<a name="l00181"></a>00181 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ulUcs < 0xfc){ -<a name="l00182"></a>00182 iCharLen = 5; -<a name="l00183"></a>00183 ulUcs &= 0x03; -<a name="l00184"></a>00184 } <span class="keywordflow">else</span> { -<a name="l00185"></a>00185 iCharLen = 6; -<a name="l00186"></a>00186 ulUcs &= 0x01; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 <span class="keywordflow">for</span> (iIndex = 1; iIndex < iCharLen; iIndex++) { -<a name="l00189"></a>00189 ulUcs <<= 6; -<a name="l00190"></a>00190 <span class="keywordflow">if</span> (iIndex < iStrLen) { -<a name="l00191"></a>00191 ulUcs |= (ULONG)(UCHAR)p[iIndex] & 0x3f; -<a name="l00192"></a>00192 } -<a name="l00193"></a>00193 } -<a name="l00194"></a>00194 *piUtfLen = iCharLen; -<a name="l00195"></a>00195 <span class="keywordflow">return</span> ulUcs; -<a name="l00196"></a>00196 } <span class="comment">/* end of utf8_to_ucs */</span> -<a name="l00197"></a>00197 -<a name="l00198"></a>00198 <span class="comment">/*</span> -<a name="l00199"></a>00199 <span class="comment"> * utf8_strwidth - compute the string width of an UTF-8 string</span> -<a name="l00200"></a>00200 <span class="comment"> *</span> -<a name="l00201"></a>00201 <span class="comment"> * Returns the string width in columns</span> -<a name="l00202"></a>00202 <span class="comment"> */</span> -<a name="l00203"></a>00203 <span class="keywordtype">long</span> -<a name="l00204"></a>00204 utf8_strwidth(<span class="keyword">const</span> <span class="keywordtype">char</span> *pcString, <span class="keywordtype">size_t</span> tNumchars) -<a name="l00205"></a>00205 { -<a name="l00206"></a>00206 ULONG ulUcs; -<a name="l00207"></a>00207 <span class="keywordtype">long</span> lTotal; -<a name="l00208"></a>00208 <span class="keywordtype">int</span> iToGo, iWidth, iUtflen; -<a name="l00209"></a>00209 -<a name="l00210"></a>00210 fail(pcString == NULL || tNumchars > (<span class="keywordtype">size_t</span>)INT_MAX); -<a name="l00211"></a>00211 -<a name="l00212"></a>00212 lTotal = 0; -<a name="l00213"></a>00213 iToGo = (int)tNumchars; -<a name="l00214"></a>00214 -<a name="l00215"></a>00215 <span class="keywordflow">while</span> (iToGo > 0 && *pcString != <span class="charliteral">'\0'</span>) { -<a name="l00216"></a>00216 ulUcs = utf8_to_ucs(pcString, iToGo, &iUtflen); -<a name="l00217"></a>00217 iWidth = iWcWidth(ulUcs); -<a name="l00218"></a>00218 <span class="keywordflow">if</span> (iWidth > 0) { -<a name="l00219"></a>00219 lTotal += iWidth; -<a name="l00220"></a>00220 } -<a name="l00221"></a>00221 pcString += iUtflen; -<a name="l00222"></a>00222 iToGo -= iUtflen; -<a name="l00223"></a>00223 } -<a name="l00224"></a>00224 NO_DBG_DEC(lTotal); -<a name="l00225"></a>00225 <span class="keywordflow">return</span> lTotal; -<a name="l00226"></a>00226 } <span class="comment">/* end of utf8_strwidth */</span> -<a name="l00227"></a>00227 -<a name="l00228"></a>00228 <span class="comment">/*</span> -<a name="l00229"></a>00229 <span class="comment"> * utf8_chrlength - get the number of bytes in an UTF-8 character</span> -<a name="l00230"></a>00230 <span class="comment"> *</span> -<a name="l00231"></a>00231 <span class="comment"> * Returns the number of bytes</span> -<a name="l00232"></a>00232 <span class="comment"> */</span> -<a name="l00233"></a>00233 <span class="keywordtype">int</span> -<a name="l00234"></a>00234 utf8_chrlength(<span class="keyword">const</span> <span class="keywordtype">char</span> *p) -<a name="l00235"></a>00235 { -<a name="l00236"></a>00236 <span class="keywordtype">int</span> iUtflen; -<a name="l00237"></a>00237 -<a name="l00238"></a>00238 fail(p == NULL); -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 iUtflen = -1; <span class="comment">/* Just to make sure */</span> -<a name="l00241"></a>00241 (void)utf8_to_ucs(p, INT_MAX, &iUtflen); -<a name="l00242"></a>00242 NO_DBG_DEC(iUtflen); -<a name="l00243"></a>00243 <span class="keywordflow">return</span> iUtflen; -<a name="l00244"></a>00244 } <span class="comment">/* end of utf8_chrlength */</span> -<a name="l00245"></a>00245 -<a name="l00246"></a>00246 <span class="comment">/*</span> -<a name="l00247"></a>00247 <span class="comment"> * is_locale_utf8 - return TRUE if the locale is UTF-8</span> -<a name="l00248"></a>00248 <span class="comment"> */</span> -<a name="l00249"></a>00249 BOOL -<a name="l00250"></a>00250 is_locale_utf8(<span class="keywordtype">void</span>) -<a name="l00251"></a>00251 { -<a name="l00252"></a>00252 <span class="keywordtype">char</span> szCodeset[20]; -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 szCodeset[0] = <span class="charliteral">'\0'</span>; -<a name="l00255"></a>00255 <span class="keywordflow">if</span> (!bGetNormalizedCodeset(szCodeset, <span class="keyword">sizeof</span>(szCodeset), NULL)) { -<a name="l00256"></a>00256 <span class="keywordflow">return</span> FALSE; -<a name="l00257"></a>00257 } -<a name="l00258"></a>00258 DBG_MSG(szCodeset); -<a name="l00259"></a>00259 <span class="keywordflow">return</span> STREQ(szCodeset, <span class="stringliteral">"utf8"</span>); -<a name="l00260"></a>00260 } <span class="comment">/* end of is_locale_utf8 */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/version_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/version.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/version.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * version.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Version and release information</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__version_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __version_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="comment">/* Strings for the info box */</span> -<a name="l00013"></a>00013 <span class="preprocessor">#define PURPOSESTRING "Display MS-Word files"</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span> -<a name="l00015"></a>00015 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define AUTHORSTRING "© 1998-2005 Adri van Os"</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define AUTHORSTRING "(C) 1998-2005 Adri van Os"</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="preprocessor">#define VERSIONSTRING "0.37 (21 Oct 2005)"</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span> -<a name="l00023"></a>00023 <span class="preprocessor">#if defined(__dos)</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#if defined(__DJGPP__)</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define VERSIONSTRING2 " # 32-bit Protected Mode"</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define VERSIONSTRING2 " # 16-bit Real Mode"</span> -<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __DJGPP__ */</span> -<a name="l00029"></a>00029 <span class="preprocessor">#endif </span><span class="comment">/* __dos */</span> -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define STATUSSTRING "DEBUG version"</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define STATUSSTRING "GNU General Public License"</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="preprocessor">#endif </span><span class="comment">/* __version_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/word2text_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1521 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/word2text.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/word2text.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * word2text.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * MS Word to "text" functions</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdio.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include <string.h></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include <ctype.h></span> -<a name="l00013"></a>00013 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#include "DeskLib:Hourglass.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "drawfile.h"</span> -<a name="l00016"></a>00016 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00017"></a>00017 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00018"></a>00018 -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 <span class="preprocessor">#define INITIAL_SIZE 40</span> -<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define EXTENTION_SIZE 20</span> -<a name="l00022"></a>00022 <span class="preprocessor"></span> -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 <span class="comment">/* Macros to make sure all such statements will be identical */</span> -<a name="l00025"></a>00025 <span class="preprocessor">#define OUTPUT_LINE() \</span> -<a name="l00026"></a>00026 <span class="preprocessor"> do {\</span> -<a name="l00027"></a>00027 <span class="preprocessor"> vAlign2Window(pDiag, pAnchor, lWidthMax, ucAlignment);\</span> -<a name="l00028"></a>00028 <span class="preprocessor"> TRACE_MSG("after vAlign2Window");\</span> -<a name="l00029"></a>00029 <span class="preprocessor"> pAnchor = pStartNewOutput(pAnchor, NULL);\</span> -<a name="l00030"></a>00030 <span class="preprocessor"> pOutput = pAnchor;\</span> -<a name="l00031"></a>00031 <span class="preprocessor"> } while(0)</span> -<a name="l00032"></a>00032 <span class="preprocessor"></span> -<a name="l00033"></a>00033 <span class="preprocessor">#define RESET_LINE() \</span> -<a name="l00034"></a>00034 <span class="preprocessor"> do {\</span> -<a name="l00035"></a>00035 <span class="preprocessor"> pAnchor = pStartNewOutput(pAnchor, NULL);\</span> -<a name="l00036"></a>00036 <span class="preprocessor"> pOutput = pAnchor;\</span> -<a name="l00037"></a>00037 <span class="preprocessor"> } while(0)</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span> -<a name="l00039"></a>00039 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="comment">/* Length of the document in characters */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> ULONG ulDocumentLength; -<a name="l00042"></a>00042 <span class="comment">/* Number of characters processed so far */</span> -<a name="l00043"></a>00043 <span class="keyword">static</span> ULONG ulCharCounter; -<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">int</span> iCurrPct, iPrevPct; -<a name="l00045"></a>00045 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00046"></a>00046 <span class="comment">/* The document is in the format belonging to this version of Word */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> <span class="keywordtype">int</span> iWordVersion = -1; -<a name="l00048"></a>00048 <span class="comment">/* Special treatment for files from Word 4/5/6 on an Apple Macintosh */</span> -<a name="l00049"></a>00049 <span class="keyword">static</span> BOOL bOldMacFile = FALSE; -<a name="l00050"></a>00050 <span class="comment">/* Section Information */</span> -<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keyword">const</span> section_block_type *pSection = NULL; -<a name="l00052"></a>00052 <span class="keyword">static</span> <span class="keyword">const</span> section_block_type *pSectionNext = NULL; -<a name="l00053"></a>00053 <span class="comment">/* All the (command line) options */</span> -<a name="l00054"></a>00054 <span class="keyword">static</span> options_type tOptions; -<a name="l00055"></a>00055 <span class="comment">/* Needed for reading a complete table row */</span> -<a name="l00056"></a>00056 <span class="keyword">static</span> <span class="keyword">const</span> row_block_type *pRowInfo = NULL; -<a name="l00057"></a>00057 <span class="keyword">static</span> BOOL bStartRow = FALSE; -<a name="l00058"></a>00058 <span class="keyword">static</span> BOOL bEndRowNorm = FALSE; -<a name="l00059"></a>00059 <span class="keyword">static</span> BOOL bEndRowFast = FALSE; -<a name="l00060"></a>00060 <span class="keyword">static</span> BOOL bIsTableRow = FALSE; -<a name="l00061"></a>00061 <span class="comment">/* Index of the next style and font information */</span> -<a name="l00062"></a>00062 <span class="keyword">static</span> USHORT usIstdNext = ISTD_NORMAL; -<a name="l00063"></a>00063 <span class="comment">/* Needed for finding the start of a style */</span> -<a name="l00064"></a>00064 <span class="keyword">static</span> <span class="keyword">const</span> style_block_type *pStyleInfo = NULL; -<a name="l00065"></a>00065 <span class="keyword">static</span> style_block_type tStyleNext; -<a name="l00066"></a>00066 <span class="keyword">static</span> BOOL bStartStyle = FALSE; -<a name="l00067"></a>00067 <span class="keyword">static</span> BOOL bStartStyleNext = FALSE; -<a name="l00068"></a>00068 <span class="comment">/* Needed for finding the start of a font */</span> -<a name="l00069"></a>00069 <span class="keyword">static</span> <span class="keyword">const</span> font_block_type *pFontInfo = NULL; -<a name="l00070"></a>00070 <span class="keyword">static</span> font_block_type tFontNext; -<a name="l00071"></a>00071 <span class="keyword">static</span> BOOL bStartFont = FALSE; -<a name="l00072"></a>00072 <span class="keyword">static</span> BOOL bStartFontNext = FALSE; -<a name="l00073"></a>00073 <span class="comment">/* Needed for finding an image */</span> -<a name="l00074"></a>00074 <span class="keyword">static</span> ULONG ulFileOffsetImage = FC_INVALID; -<a name="l00075"></a>00075 -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 <span class="comment">/*</span> -<a name="l00078"></a>00078 <span class="comment"> * vUpdateCounters - Update the counters for the hourglass</span> -<a name="l00079"></a>00079 <span class="comment"> */</span> -<a name="l00080"></a>00080 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00081"></a>00081 vUpdateCounters(<span class="keywordtype">void</span>) -<a name="l00082"></a>00082 { -<a name="l00083"></a>00083 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00084"></a>00084 <span class="preprocessor"></span> ulCharCounter++; -<a name="l00085"></a>00085 iCurrPct = (int)((ulCharCounter * 100) / ulDocumentLength); -<a name="l00086"></a>00086 <span class="keywordflow">if</span> (iCurrPct != iPrevPct) { -<a name="l00087"></a>00087 Hourglass_Percentage(iCurrPct); -<a name="l00088"></a>00088 iPrevPct = iCurrPct; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00091"></a>00091 } <span class="comment">/* end of vUpdateCounters */</span> -<a name="l00092"></a>00092 -<a name="l00093"></a>00093 <span class="comment">/*</span> -<a name="l00094"></a>00094 <span class="comment"> * bOutputContainsText - see if the output contains more than white space</span> -<a name="l00095"></a>00095 <span class="comment"> */</span> -<a name="l00096"></a>00096 BOOL -<a name="l00097"></a>00097 bOutputContainsText(<span class="keyword">const</span> output_type *pAnchor) -<a name="l00098"></a>00098 { -<a name="l00099"></a>00099 <span class="keyword">const</span> output_type *pCurr; -<a name="l00100"></a>00100 <span class="keywordtype">size_t</span> tIndex; -<a name="l00101"></a>00101 -<a name="l00102"></a>00102 fail(pAnchor == NULL); -<a name="l00103"></a>00103 -<a name="l00104"></a>00104 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00105"></a>00105 fail(pCurr->lStringWidth < 0); -<a name="l00106"></a>00106 <span class="keywordflow">for</span> (tIndex = 0; tIndex < pCurr->tNextFree; tIndex++) { -<a name="l00107"></a>00107 <span class="keywordflow">if</span> (isspace((<span class="keywordtype">int</span>)(UCHAR)pCurr->szStorage[tIndex])) { -<a name="l00108"></a>00108 <span class="keywordflow">continue</span>; -<a name="l00109"></a>00109 } -<a name="l00110"></a>00110 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00111"></a>00111 <span class="preprocessor"></span> <span class="keywordflow">if</span> (pCurr->szStorage[tIndex] == FILLER_CHAR) { -<a name="l00112"></a>00112 <span class="keywordflow">continue</span>; -<a name="l00113"></a>00113 } -<a name="l00114"></a>00114 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00115"></a>00115 <span class="keywordflow">return</span> TRUE; -<a name="l00116"></a>00116 } -<a name="l00117"></a>00117 } -<a name="l00118"></a>00118 <span class="keywordflow">return</span> FALSE; -<a name="l00119"></a>00119 } <span class="comment">/* end of bOutputContainsText */</span> -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 <span class="comment">/*</span> -<a name="l00122"></a>00122 <span class="comment"> * lTotalStringWidth - compute the total width of the output string</span> -<a name="l00123"></a>00123 <span class="comment"> */</span> -<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keywordtype">long</span> -<a name="l00125"></a>00125 lTotalStringWidth(<span class="keyword">const</span> output_type *pAnchor) -<a name="l00126"></a>00126 { -<a name="l00127"></a>00127 <span class="keyword">const</span> output_type *pCurr; -<a name="l00128"></a>00128 <span class="keywordtype">long</span> lTotal; -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 lTotal = 0; -<a name="l00131"></a>00131 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l00132"></a>00132 DBG_DEC_C(pCurr->lStringWidth < 0, pCurr->lStringWidth); -<a name="l00133"></a>00133 fail(pCurr->lStringWidth < 0); -<a name="l00134"></a>00134 lTotal += pCurr->lStringWidth; -<a name="l00135"></a>00135 } -<a name="l00136"></a>00136 <span class="keywordflow">return</span> lTotal; -<a name="l00137"></a>00137 } <span class="comment">/* end of lTotalStringWidth */</span> -<a name="l00138"></a>00138 -<a name="l00139"></a>00139 <span class="comment">/*</span> -<a name="l00140"></a>00140 <span class="comment"> * vStoreByte - store one byte</span> -<a name="l00141"></a>00141 <span class="comment"> */</span> -<a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00143"></a>00143 vStoreByte(UCHAR ucChar, output_type *pOutput) -<a name="l00144"></a>00144 { -<a name="l00145"></a>00145 fail(pOutput == NULL); -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 <span class="keywordflow">if</span> (ucChar == 0) { -<a name="l00148"></a>00148 pOutput->szStorage[pOutput->tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l00149"></a>00149 <span class="keywordflow">return</span>; -<a name="l00150"></a>00150 } -<a name="l00151"></a>00151 -<a name="l00152"></a>00152 <span class="keywordflow">while</span> (pOutput->tNextFree + 2 > pOutput->tStorageSize) { -<a name="l00153"></a>00153 pOutput->tStorageSize += EXTENTION_SIZE; -<a name="l00154"></a>00154 pOutput->szStorage = xrealloc(pOutput->szStorage, -<a name="l00155"></a>00155 pOutput->tStorageSize); -<a name="l00156"></a>00156 } -<a name="l00157"></a>00157 pOutput->szStorage[pOutput->tNextFree] = (char)ucChar; -<a name="l00158"></a>00158 pOutput->szStorage[pOutput->tNextFree + 1] = <span class="charliteral">'\0'</span>; -<a name="l00159"></a>00159 pOutput->tNextFree++; -<a name="l00160"></a>00160 } <span class="comment">/* end of vStoreByte */</span> -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="comment">/*</span> -<a name="l00163"></a>00163 <span class="comment"> * vStoreChar - store a character as one or more bytes</span> -<a name="l00164"></a>00164 <span class="comment"> */</span> -<a name="l00165"></a>00165 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00166"></a>00166 vStoreChar(ULONG ulChar, BOOL bChangeAllowed, output_type *pOutput) -<a name="l00167"></a>00167 { -<a name="l00168"></a>00168 <span class="keywordtype">char</span> szResult[4]; -<a name="l00169"></a>00169 <span class="keywordtype">size_t</span> tIndex, tLen; -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 fail(pOutput == NULL); -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 <span class="keywordflow">if</span> (tOptions.eEncoding == encoding_utf_8 && bChangeAllowed) { -<a name="l00174"></a>00174 DBG_HEX_C(ulChar > 0xffff, ulChar); -<a name="l00175"></a>00175 fail(ulChar > 0xffff); -<a name="l00176"></a>00176 tLen = tUcs2Utf8(ulChar, szResult, <span class="keyword">sizeof</span>(szResult)); -<a name="l00177"></a>00177 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00178"></a>00178 vStoreByte((UCHAR)szResult[tIndex], pOutput); -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 } <span class="keywordflow">else</span> { -<a name="l00181"></a>00181 DBG_HEX_C(ulChar > 0xff, ulChar); -<a name="l00182"></a>00182 fail(ulChar > 0xff); -<a name="l00183"></a>00183 vStoreByte((UCHAR)ulChar, pOutput); -<a name="l00184"></a>00184 tLen = 1; -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 pOutput->lStringWidth += lComputeStringWidth( -<a name="l00187"></a>00187 pOutput->szStorage + pOutput->tNextFree - tLen, -<a name="l00188"></a>00188 tLen, -<a name="l00189"></a>00189 pOutput->tFontRef, -<a name="l00190"></a>00190 pOutput->usFontSize); -<a name="l00191"></a>00191 } <span class="comment">/* end of vStoreChar */</span> -<a name="l00192"></a>00192 -<a name="l00193"></a>00193 <span class="comment">/*</span> -<a name="l00194"></a>00194 <span class="comment"> * vStoreCharacter - store one character</span> -<a name="l00195"></a>00195 <span class="comment"> */</span> -<a name="l00196"></a>00196 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00197"></a>00197 vStoreCharacter(ULONG ulChar, output_type *pOutput) -<a name="l00198"></a>00198 { -<a name="l00199"></a>00199 vStoreChar(ulChar, TRUE, pOutput); -<a name="l00200"></a>00200 } <span class="comment">/* end of vStoreCharacter */</span> -<a name="l00201"></a>00201 -<a name="l00202"></a>00202 <span class="comment">/*</span> -<a name="l00203"></a>00203 <span class="comment"> * vStoreString - store a string</span> -<a name="l00204"></a>00204 <span class="comment"> */</span> -<a name="l00205"></a>00205 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00206"></a>00206 vStoreString(<span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, output_type *pOutput) -<a name="l00207"></a>00207 { -<a name="l00208"></a>00208 <span class="keywordtype">size_t</span> tIndex; -<a name="l00209"></a>00209 -<a name="l00210"></a>00210 fail(szString == NULL || pOutput == NULL); -<a name="l00211"></a>00211 -<a name="l00212"></a>00212 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tStringLength; tIndex++) { -<a name="l00213"></a>00213 vStoreCharacter((ULONG)(UCHAR)szString[tIndex], pOutput); -<a name="l00214"></a>00214 } -<a name="l00215"></a>00215 } <span class="comment">/* end of vStoreString */</span> -<a name="l00216"></a>00216 -<a name="l00217"></a>00217 <span class="comment">/*</span> -<a name="l00218"></a>00218 <span class="comment"> * vStoreNumberAsDecimal - store a number as a decimal number</span> -<a name="l00219"></a>00219 <span class="comment"> */</span> -<a name="l00220"></a>00220 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00221"></a>00221 vStoreNumberAsDecimal(UINT uiNumber, output_type *pOutput) -<a name="l00222"></a>00222 { -<a name="l00223"></a>00223 <span class="keywordtype">size_t</span> tLen; -<a name="l00224"></a>00224 <span class="keywordtype">char</span> szString[3 * <span class="keyword">sizeof</span>(UINT) + 1]; -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 fail(uiNumber == 0); -<a name="l00227"></a>00227 fail(pOutput == NULL); -<a name="l00228"></a>00228 -<a name="l00229"></a>00229 tLen = (size_t)sprintf(szString, <span class="stringliteral">"%u"</span>, uiNumber); -<a name="l00230"></a>00230 vStoreString(szString, tLen, pOutput); -<a name="l00231"></a>00231 } <span class="comment">/* end of vStoreNumberAsDecimal */</span> -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 <span class="comment">/*</span> -<a name="l00234"></a>00234 <span class="comment"> * vStoreNumberAsRoman - store a number as a roman numerical</span> -<a name="l00235"></a>00235 <span class="comment"> */</span> -<a name="l00236"></a>00236 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00237"></a>00237 vStoreNumberAsRoman(UINT uiNumber, output_type *pOutput) -<a name="l00238"></a>00238 { -<a name="l00239"></a>00239 <span class="keywordtype">size_t</span> tLen; -<a name="l00240"></a>00240 <span class="keywordtype">char</span> szString[15]; -<a name="l00241"></a>00241 -<a name="l00242"></a>00242 fail(uiNumber == 0); -<a name="l00243"></a>00243 fail(pOutput == NULL); -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 tLen = tNumber2Roman(uiNumber, FALSE, szString); -<a name="l00246"></a>00246 vStoreString(szString, tLen, pOutput); -<a name="l00247"></a>00247 } <span class="comment">/* end of vStoreNumberAsRoman */</span> -<a name="l00248"></a>00248 -<a name="l00249"></a>00249 <span class="comment">/*</span> -<a name="l00250"></a>00250 <span class="comment"> * vStoreStyle - store a style</span> -<a name="l00251"></a>00251 <span class="comment"> */</span> -<a name="l00252"></a>00252 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00253"></a>00253 vStoreStyle(diagram_type *pDiag, output_type *pOutput, -<a name="l00254"></a>00254 <span class="keyword">const</span> style_block_type *pStyle) -<a name="l00255"></a>00255 { -<a name="l00256"></a>00256 <span class="keywordtype">size_t</span> tLen; -<a name="l00257"></a>00257 <span class="keywordtype">char</span> szString[120]; -<a name="l00258"></a>00258 -<a name="l00259"></a>00259 fail(pDiag == NULL); -<a name="l00260"></a>00260 fail(pOutput == NULL); -<a name="l00261"></a>00261 fail(pStyle == NULL); -<a name="l00262"></a>00262 -<a name="l00263"></a>00263 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_xml) { -<a name="l00264"></a>00264 vSetHeaders(pDiag, pStyle->usIstd); -<a name="l00265"></a>00265 } <span class="keywordflow">else</span> { -<a name="l00266"></a>00266 tLen = tStyle2Window(szString, <span class="keyword">sizeof</span>(szString), -<a name="l00267"></a>00267 pStyle, pSection); -<a name="l00268"></a>00268 vStoreString(szString, tLen, pOutput); -<a name="l00269"></a>00269 } -<a name="l00270"></a>00270 } <span class="comment">/* end of vStoreStyle */</span> -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 <span class="comment">/*</span> -<a name="l00273"></a>00273 <span class="comment"> * vPutIndentation - output the specified amount of indentation</span> -<a name="l00274"></a>00274 <span class="comment"> */</span> -<a name="l00275"></a>00275 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00276"></a>00276 vPutIndentation(diagram_type *pDiag, output_type *pOutput, -<a name="l00277"></a>00277 BOOL bNoMarks, BOOL bFirstLine, -<a name="l00278"></a>00278 UINT uiListNumber, UCHAR ucNFC, <span class="keyword">const</span> <span class="keywordtype">char</span> *szListChar, -<a name="l00279"></a>00279 <span class="keywordtype">long</span> lLeftIndentation, <span class="keywordtype">long</span> lLeftIndentation1) -<a name="l00280"></a>00280 { -<a name="l00281"></a>00281 <span class="keywordtype">long</span> lWidth; -<a name="l00282"></a>00282 <span class="keywordtype">size_t</span> tIndex, tNextFree; -<a name="l00283"></a>00283 <span class="keywordtype">char</span> szLine[30]; -<a name="l00284"></a>00284 -<a name="l00285"></a>00285 fail(pDiag == NULL); -<a name="l00286"></a>00286 fail(pOutput == NULL); -<a name="l00287"></a>00287 fail(szListChar == NULL); -<a name="l00288"></a>00288 fail(lLeftIndentation < 0); -<a name="l00289"></a>00289 -<a name="l00290"></a>00290 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_xml) { -<a name="l00291"></a>00291 <span class="comment">/* XML does its own indentation at rendering time */</span> -<a name="l00292"></a>00292 <span class="keywordflow">return</span>; -<a name="l00293"></a>00293 } -<a name="l00294"></a>00294 -<a name="l00295"></a>00295 <span class="keywordflow">if</span> (bNoMarks) { -<a name="l00296"></a>00296 <span class="keywordflow">if</span> (bFirstLine) { -<a name="l00297"></a>00297 lLeftIndentation += lLeftIndentation1; -<a name="l00298"></a>00298 } -<a name="l00299"></a>00299 <span class="keywordflow">if</span> (lLeftIndentation < 0) { -<a name="l00300"></a>00300 lLeftIndentation = 0; -<a name="l00301"></a>00301 } -<a name="l00302"></a>00302 vSetLeftIndentation(pDiag, lLeftIndentation); -<a name="l00303"></a>00303 <span class="keywordflow">return</span>; -<a name="l00304"></a>00304 } -<a name="l00305"></a>00305 <span class="keywordflow">if</span> (lLeftIndentation <= 0) { -<a name="l00306"></a>00306 DBG_HEX_C(ucNFC != 0x00, ucNFC); -<a name="l00307"></a>00307 vSetLeftIndentation(pDiag, 0); -<a name="l00308"></a>00308 <span class="keywordflow">return</span>; -<a name="l00309"></a>00309 } -<a name="l00310"></a>00310 -<a name="l00311"></a>00311 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00312"></a>00312 <span class="preprocessor"></span> <span class="keywordflow">if</span> (tOptions.eEncoding == encoding_utf_8) { -<a name="l00313"></a>00313 fail(strlen(szListChar) > 3); -<a name="l00314"></a>00314 } <span class="keywordflow">else</span> { -<a name="l00315"></a>00315 DBG_HEX_C(iscntrl((<span class="keywordtype">int</span>)szListChar[0]), szListChar[0]); -<a name="l00316"></a>00316 fail(iscntrl((<span class="keywordtype">int</span>)szListChar[0])); -<a name="l00317"></a>00317 fail(szListChar[1] != <span class="charliteral">'\0'</span>); -<a name="l00318"></a>00318 } -<a name="l00319"></a>00319 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00320"></a>00320 -<a name="l00321"></a>00321 <span class="keywordflow">switch</span> (ucNFC) { -<a name="l00322"></a>00322 <span class="keywordflow">case</span> LIST_ARABIC_NUM: -<a name="l00323"></a>00323 <span class="keywordflow">case</span> LIST_NUMBER_TXT: -<a name="l00324"></a>00324 tNextFree = (size_t)sprintf(szLine, <span class="stringliteral">"%u"</span>, uiListNumber); -<a name="l00325"></a>00325 <span class="keywordflow">break</span>; -<a name="l00326"></a>00326 <span class="keywordflow">case</span> LIST_UPPER_ROMAN: -<a name="l00327"></a>00327 <span class="keywordflow">case</span> LIST_LOWER_ROMAN: -<a name="l00328"></a>00328 tNextFree = tNumber2Roman(uiListNumber, -<a name="l00329"></a>00329 ucNFC == LIST_UPPER_ROMAN, szLine); -<a name="l00330"></a>00330 <span class="keywordflow">break</span>; -<a name="l00331"></a>00331 <span class="keywordflow">case</span> LIST_UPPER_ALPHA: -<a name="l00332"></a>00332 <span class="keywordflow">case</span> LIST_LOWER_ALPHA: -<a name="l00333"></a>00333 tNextFree = tNumber2Alpha(uiListNumber, -<a name="l00334"></a>00334 ucNFC == LIST_UPPER_ALPHA, szLine); -<a name="l00335"></a>00335 <span class="keywordflow">break</span>; -<a name="l00336"></a>00336 <span class="keywordflow">case</span> LIST_ORDINAL_NUM: -<a name="l00337"></a>00337 <span class="keywordflow">case</span> LIST_ORDINAL_TXT: -<a name="l00338"></a>00338 <span class="keywordflow">if</span> (uiListNumber % 10 == 1 && uiListNumber != 11) { -<a name="l00339"></a>00339 tNextFree = -<a name="l00340"></a>00340 (size_t)sprintf(szLine, <span class="stringliteral">"%ust"</span>, uiListNumber); -<a name="l00341"></a>00341 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiListNumber % 10 == 2 && uiListNumber != 12) { -<a name="l00342"></a>00342 tNextFree = -<a name="l00343"></a>00343 (size_t)sprintf(szLine, <span class="stringliteral">"%und"</span>, uiListNumber); -<a name="l00344"></a>00344 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiListNumber % 10 == 3 && uiListNumber != 13) { -<a name="l00345"></a>00345 tNextFree = -<a name="l00346"></a>00346 (size_t)sprintf(szLine, <span class="stringliteral">"%urd"</span>, uiListNumber); -<a name="l00347"></a>00347 } <span class="keywordflow">else</span> { -<a name="l00348"></a>00348 tNextFree = -<a name="l00349"></a>00349 (size_t)sprintf(szLine, <span class="stringliteral">"%uth"</span>, uiListNumber); -<a name="l00350"></a>00350 } -<a name="l00351"></a>00351 <span class="keywordflow">break</span>; -<a name="l00352"></a>00352 <span class="keywordflow">case</span> LIST_OUTLINE_NUM: -<a name="l00353"></a>00353 tNextFree = (size_t)sprintf(szLine, <span class="stringliteral">"%02u"</span>, uiListNumber); -<a name="l00354"></a>00354 <span class="keywordflow">break</span>; -<a name="l00355"></a>00355 <span class="keywordflow">case</span> LIST_SPECIAL: -<a name="l00356"></a>00356 <span class="keywordflow">case</span> LIST_SPECIAL2: -<a name="l00357"></a>00357 <span class="keywordflow">case</span> LIST_BULLETS: -<a name="l00358"></a>00358 tNextFree = 0; -<a name="l00359"></a>00359 <span class="keywordflow">break</span>; -<a name="l00360"></a>00360 <span class="keywordflow">default</span>: -<a name="l00361"></a>00361 DBG_HEX(ucNFC); -<a name="l00362"></a>00362 DBG_FIXME(); -<a name="l00363"></a>00363 tNextFree = (size_t)sprintf(szLine, <span class="stringliteral">"%u"</span>, uiListNumber); -<a name="l00364"></a>00364 <span class="keywordflow">break</span>; -<a name="l00365"></a>00365 } -<a name="l00366"></a>00366 tNextFree += (size_t)sprintf(szLine + tNextFree, <span class="stringliteral">"%.3s"</span>, szListChar); -<a name="l00367"></a>00367 szLine[tNextFree++] = <span class="charliteral">' '</span>; -<a name="l00368"></a>00368 szLine[tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l00369"></a>00369 lWidth = lComputeStringWidth(szLine, tNextFree, -<a name="l00370"></a>00370 pOutput->tFontRef, pOutput->usFontSize); -<a name="l00371"></a>00371 lLeftIndentation -= lWidth; -<a name="l00372"></a>00372 <span class="keywordflow">if</span> (lLeftIndentation < 0) { -<a name="l00373"></a>00373 lLeftIndentation = 0; -<a name="l00374"></a>00374 } -<a name="l00375"></a>00375 vSetLeftIndentation(pDiag, lLeftIndentation); -<a name="l00376"></a>00376 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tNextFree; tIndex++) { -<a name="l00377"></a>00377 vStoreChar((ULONG)(UCHAR)szLine[tIndex], FALSE, pOutput); -<a name="l00378"></a>00378 } -<a name="l00379"></a>00379 } <span class="comment">/* end of vPutIndentation */</span> -<a name="l00380"></a>00380 -<a name="l00381"></a>00381 <span class="comment">/*</span> -<a name="l00382"></a>00382 <span class="comment"> * vPutSeparatorLine - output a separator line</span> -<a name="l00383"></a>00383 <span class="comment"> *</span> -<a name="l00384"></a>00384 <span class="comment"> * A separator line is a horizontal line two inches long.</span> -<a name="l00385"></a>00385 <span class="comment"> * Two inches equals 144000 millipoints.</span> -<a name="l00386"></a>00386 <span class="comment"> */</span> -<a name="l00387"></a>00387 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00388"></a>00388 vPutSeparatorLine(output_type *pOutput) -<a name="l00389"></a>00389 { -<a name="l00390"></a>00390 <span class="keywordtype">long</span> lCharWidth; -<a name="l00391"></a>00391 <span class="keywordtype">int</span> iCounter, iChars; -<a name="l00392"></a>00392 <span class="keywordtype">char</span> szOne[2]; -<a name="l00393"></a>00393 -<a name="l00394"></a>00394 fail(pOutput == NULL); -<a name="l00395"></a>00395 -<a name="l00396"></a>00396 szOne[0] = OUR_EM_DASH; -<a name="l00397"></a>00397 szOne[1] = <span class="charliteral">'\0'</span>; -<a name="l00398"></a>00398 lCharWidth = lComputeStringWidth(szOne, 1, -<a name="l00399"></a>00399 pOutput->tFontRef, pOutput->usFontSize); -<a name="l00400"></a>00400 NO_DBG_DEC(lCharWidth); -<a name="l00401"></a>00401 iChars = (int)((144000 + lCharWidth / 2) / lCharWidth); -<a name="l00402"></a>00402 NO_DBG_DEC(iChars); -<a name="l00403"></a>00403 <span class="keywordflow">for</span> (iCounter = 0; iCounter < iChars; iCounter++) { -<a name="l00404"></a>00404 vStoreCharacter((ULONG)(UCHAR)OUR_EM_DASH, pOutput); -<a name="l00405"></a>00405 } -<a name="l00406"></a>00406 } <span class="comment">/* end of vPutSeparatorLine */</span> -<a name="l00407"></a>00407 -<a name="l00408"></a>00408 <span class="comment">/*</span> -<a name="l00409"></a>00409 <span class="comment"> * pStartNextOutput - start the next output record</span> -<a name="l00410"></a>00410 <span class="comment"> *</span> -<a name="l00411"></a>00411 <span class="comment"> * returns a pointer to the next record</span> -<a name="l00412"></a>00412 <span class="comment"> */</span> -<a name="l00413"></a>00413 <span class="keyword">static</span> output_type * -<a name="l00414"></a>00414 pStartNextOutput(output_type *pCurrent) -<a name="l00415"></a>00415 { -<a name="l00416"></a>00416 output_type *pNew; -<a name="l00417"></a>00417 -<a name="l00418"></a>00418 TRACE_MSG(<span class="stringliteral">"pStartNextOutput"</span>); -<a name="l00419"></a>00419 -<a name="l00420"></a>00420 <span class="keywordflow">if</span> (pCurrent->tNextFree == 0) { -<a name="l00421"></a>00421 <span class="comment">/* The current record is empty, re-use */</span> -<a name="l00422"></a>00422 fail(pCurrent->szStorage[0] != <span class="charliteral">'\0'</span>); -<a name="l00423"></a>00423 fail(pCurrent->lStringWidth != 0); -<a name="l00424"></a>00424 <span class="keywordflow">return</span> pCurrent; -<a name="l00425"></a>00425 } -<a name="l00426"></a>00426 <span class="comment">/* The current record is in use, make a new one */</span> -<a name="l00427"></a>00427 pNew = xmalloc(<span class="keyword">sizeof</span>(*pNew)); -<a name="l00428"></a>00428 pCurrent->pNext = pNew; -<a name="l00429"></a>00429 pNew->tStorageSize = INITIAL_SIZE; -<a name="l00430"></a>00430 pNew->szStorage = xmalloc(pNew->tStorageSize); -<a name="l00431"></a>00431 pNew->szStorage[0] = <span class="charliteral">'\0'</span>; -<a name="l00432"></a>00432 pNew->tNextFree = 0; -<a name="l00433"></a>00433 pNew->lStringWidth = 0; -<a name="l00434"></a>00434 pNew->ucFontColor = FONT_COLOR_DEFAULT; -<a name="l00435"></a>00435 pNew->usFontStyle = FONT_REGULAR; -<a name="l00436"></a>00436 pNew->tFontRef = (drawfile_fontref)0; -<a name="l00437"></a>00437 pNew->usFontSize = DEFAULT_FONT_SIZE; -<a name="l00438"></a>00438 pNew->pPrev = pCurrent; -<a name="l00439"></a>00439 pNew->pNext = NULL; -<a name="l00440"></a>00440 <span class="keywordflow">return</span> pNew; -<a name="l00441"></a>00441 } <span class="comment">/* end of pStartNextOutput */</span> -<a name="l00442"></a>00442 -<a name="l00443"></a>00443 <span class="comment">/*</span> -<a name="l00444"></a>00444 <span class="comment"> * pStartNewOutput</span> -<a name="l00445"></a>00445 <span class="comment"> */</span> -<a name="l00446"></a>00446 <span class="keyword">static</span> output_type * -<a name="l00447"></a>00447 pStartNewOutput(output_type *pAnchor, output_type *pLeftOver) -<a name="l00448"></a>00448 { -<a name="l00449"></a>00449 output_type *pCurr, *pNext; -<a name="l00450"></a>00450 USHORT usFontStyle, usFontSize; -<a name="l00451"></a>00451 drawfile_fontref tFontRef; -<a name="l00452"></a>00452 UCHAR ucFontColor; -<a name="l00453"></a>00453 -<a name="l00454"></a>00454 TRACE_MSG(<span class="stringliteral">"pStartNewOutput"</span>); -<a name="l00455"></a>00455 -<a name="l00456"></a>00456 ucFontColor = FONT_COLOR_DEFAULT; -<a name="l00457"></a>00457 usFontStyle = FONT_REGULAR; -<a name="l00458"></a>00458 tFontRef = (drawfile_fontref)0; -<a name="l00459"></a>00459 usFontSize = DEFAULT_FONT_SIZE; -<a name="l00460"></a>00460 <span class="comment">/* Free the old output space */</span> -<a name="l00461"></a>00461 pCurr = pAnchor; -<a name="l00462"></a>00462 <span class="keywordflow">while</span> (pCurr != NULL) { -<a name="l00463"></a>00463 TRACE_MSG(<span class="stringliteral">"Free the old output space"</span>); -<a name="l00464"></a>00464 pNext = pCurr->pNext; -<a name="l00465"></a>00465 pCurr->szStorage = xfree(pCurr->szStorage); -<a name="l00466"></a>00466 <span class="keywordflow">if</span> (pCurr->pNext == NULL) { -<a name="l00467"></a>00467 ucFontColor = pCurr->ucFontColor; -<a name="l00468"></a>00468 usFontStyle = pCurr->usFontStyle; -<a name="l00469"></a>00469 tFontRef = pCurr->tFontRef; -<a name="l00470"></a>00470 usFontSize = pCurr->usFontSize; -<a name="l00471"></a>00471 } -<a name="l00472"></a>00472 pCurr = xfree(pCurr); -<a name="l00473"></a>00473 pCurr = pNext; -<a name="l00474"></a>00474 } -<a name="l00475"></a>00475 <span class="keywordflow">if</span> (pLeftOver == NULL) { -<a name="l00476"></a>00476 <span class="comment">/* Create new output space */</span> -<a name="l00477"></a>00477 TRACE_MSG(<span class="stringliteral">"Create new output space"</span>); -<a name="l00478"></a>00478 pLeftOver = xmalloc(<span class="keyword">sizeof</span>(*pLeftOver)); -<a name="l00479"></a>00479 pLeftOver->tStorageSize = INITIAL_SIZE; -<a name="l00480"></a>00480 NO_DBG_DEC(pLeftOver->tStorageSize); -<a name="l00481"></a>00481 TRACE_MSG(<span class="stringliteral">"before 2nd xmalloc"</span>); -<a name="l00482"></a>00482 pLeftOver->szStorage = xmalloc(pLeftOver->tStorageSize); -<a name="l00483"></a>00483 TRACE_MSG(<span class="stringliteral">"after 2nd xmalloc"</span>); -<a name="l00484"></a>00484 pLeftOver->szStorage[0] = <span class="charliteral">'\0'</span>; -<a name="l00485"></a>00485 pLeftOver->tNextFree = 0; -<a name="l00486"></a>00486 pLeftOver->lStringWidth = 0; -<a name="l00487"></a>00487 pLeftOver->ucFontColor = ucFontColor; -<a name="l00488"></a>00488 pLeftOver->usFontStyle = usFontStyle; -<a name="l00489"></a>00489 pLeftOver->tFontRef = tFontRef; -<a name="l00490"></a>00490 pLeftOver->usFontSize = usFontSize; -<a name="l00491"></a>00491 pLeftOver->pPrev = NULL; -<a name="l00492"></a>00492 pLeftOver->pNext = NULL; -<a name="l00493"></a>00493 } -<a name="l00494"></a>00494 fail(!bCheckDoubleLinkedList(pLeftOver)); -<a name="l00495"></a>00495 <span class="keywordflow">return</span> pLeftOver; -<a name="l00496"></a>00496 } <span class="comment">/* end of pStartNewOutput */</span> -<a name="l00497"></a>00497 -<a name="l00498"></a>00498 <span class="comment">/*</span> -<a name="l00499"></a>00499 <span class="comment"> * ulGetChar - get the next character from the specified list</span> -<a name="l00500"></a>00500 <span class="comment"> *</span> -<a name="l00501"></a>00501 <span class="comment"> * returns the next character of EOF</span> -<a name="l00502"></a>00502 <span class="comment"> */</span> -<a name="l00503"></a>00503 <span class="keyword">static</span> ULONG -<a name="l00504"></a>00504 ulGetChar(FILE *pFile, list_id_enum eListID) -<a name="l00505"></a>00505 { -<a name="l00506"></a>00506 <span class="keyword">const</span> font_block_type *pCurr; -<a name="l00507"></a>00507 ULONG ulChar, ulFileOffset, ulCharPos; -<a name="l00508"></a>00508 row_info_enum eRowInfo; -<a name="l00509"></a>00509 USHORT usChar, usPropMod; -<a name="l00510"></a>00510 BOOL bSkip; -<a name="l00511"></a>00511 -<a name="l00512"></a>00512 fail(pFile == NULL); -<a name="l00513"></a>00513 -<a name="l00514"></a>00514 pCurr = pFontInfo; -<a name="l00515"></a>00515 bSkip = FALSE; -<a name="l00516"></a>00516 <span class="keywordflow">for</span> (;;) { -<a name="l00517"></a>00517 usChar = usNextChar(pFile, eListID, -<a name="l00518"></a>00518 &ulFileOffset, &ulCharPos, &usPropMod); -<a name="l00519"></a>00519 <span class="keywordflow">if</span> (usChar == (USHORT)EOF) { -<a name="l00520"></a>00520 <span class="keywordflow">return</span> (ULONG)EOF; -<a name="l00521"></a>00521 } -<a name="l00522"></a>00522 -<a name="l00523"></a>00523 vUpdateCounters(); -<a name="l00524"></a>00524 -<a name="l00525"></a>00525 eRowInfo = ePropMod2RowInfo(usPropMod, iWordVersion); -<a name="l00526"></a>00526 <span class="keywordflow">if</span> (!bStartRow) { -<a name="l00527"></a>00527 <span class="preprocessor">#if 0</span> -<a name="l00528"></a>00528 <span class="preprocessor"></span> bStartRow = eRowInfo == found_a_cell || -<a name="l00529"></a>00529 (pRowInfo != NULL && -<a name="l00530"></a>00530 ulFileOffset == pRowInfo->ulFileOffsetStart && -<a name="l00531"></a>00531 eRowInfo != found_not_a_cell); -<a name="l00532"></a>00532 <span class="preprocessor">#else</span> -<a name="l00533"></a>00533 <span class="preprocessor"></span> bStartRow = pRowInfo != NULL && -<a name="l00534"></a>00534 ulFileOffset == pRowInfo->ulFileOffsetStart; -<a name="l00535"></a>00535 <span class="preprocessor">#endif</span> -<a name="l00536"></a>00536 <span class="preprocessor"></span> NO_DBG_HEX_C(bStartRow, pRowInfo->ulFileOffsetStart); -<a name="l00537"></a>00537 } -<a name="l00538"></a>00538 <span class="keywordflow">if</span> (!bEndRowNorm) { -<a name="l00539"></a>00539 <span class="preprocessor">#if 0</span> -<a name="l00540"></a>00540 <span class="preprocessor"></span> bEndRow = eRowInfo == found_end_of_row || -<a name="l00541"></a>00541 (pRowInfo != NULL && -<a name="l00542"></a>00542 ulFileOffset == pRowInfo->ulFileOffsetEnd && -<a name="l00543"></a>00543 eRowInfo != found_not_end_of_row); -<a name="l00544"></a>00544 <span class="preprocessor">#else</span> -<a name="l00545"></a>00545 <span class="preprocessor"></span> bEndRowNorm = pRowInfo != NULL && -<a name="l00546"></a>00546 ulFileOffset == pRowInfo->ulFileOffsetEnd; -<a name="l00547"></a>00547 <span class="preprocessor">#endif</span> -<a name="l00548"></a>00548 <span class="preprocessor"></span> NO_DBG_HEX_C(bEndRowNorm, pRowInfo->ulFileOffsetEnd); -<a name="l00549"></a>00549 } -<a name="l00550"></a>00550 <span class="keywordflow">if</span> (!bEndRowFast) { -<a name="l00551"></a>00551 bEndRowFast = eRowInfo == found_end_of_row; -<a name="l00552"></a>00552 NO_DBG_HEX_C(bEndRowFast, pRowInfo->ulFileOffsetEnd); -<a name="l00553"></a>00553 } -<a name="l00554"></a>00554 -<a name="l00555"></a>00555 <span class="keywordflow">if</span> (!bStartStyle) { -<a name="l00556"></a>00556 bStartStyle = pStyleInfo != NULL && -<a name="l00557"></a>00557 ulFileOffset == pStyleInfo->ulFileOffset; -<a name="l00558"></a>00558 NO_DBG_HEX_C(bStartStyle, ulFileOffset); -<a name="l00559"></a>00559 } -<a name="l00560"></a>00560 <span class="keywordflow">if</span> (pCurr != NULL && ulFileOffset == pCurr->ulFileOffset) { -<a name="l00561"></a>00561 bStartFont = TRUE; -<a name="l00562"></a>00562 NO_DBG_HEX(ulFileOffset); -<a name="l00563"></a>00563 pFontInfo = pCurr; -<a name="l00564"></a>00564 pCurr = pGetNextFontInfoListItem(pCurr); -<a name="l00565"></a>00565 } -<a name="l00566"></a>00566 -<a name="l00567"></a>00567 <span class="comment">/* Skip embedded characters */</span> -<a name="l00568"></a>00568 <span class="keywordflow">if</span> (usChar == START_EMBEDDED) { -<a name="l00569"></a>00569 bSkip = TRUE; -<a name="l00570"></a>00570 <span class="keywordflow">continue</span>; -<a name="l00571"></a>00571 } -<a name="l00572"></a>00572 <span class="keywordflow">if</span> (usChar == END_IGNORE || usChar == END_EMBEDDED) { -<a name="l00573"></a>00573 bSkip = FALSE; -<a name="l00574"></a>00574 <span class="keywordflow">continue</span>; -<a name="l00575"></a>00575 } -<a name="l00576"></a>00576 <span class="keywordflow">if</span> (bSkip) { -<a name="l00577"></a>00577 <span class="keywordflow">continue</span>; -<a name="l00578"></a>00578 } -<a name="l00579"></a>00579 ulChar = ulTranslateCharacters(usChar, -<a name="l00580"></a>00580 ulFileOffset, -<a name="l00581"></a>00581 iWordVersion, -<a name="l00582"></a>00582 tOptions.eConversionType, -<a name="l00583"></a>00583 tOptions.eEncoding, -<a name="l00584"></a>00584 bOldMacFile); -<a name="l00585"></a>00585 <span class="keywordflow">if</span> (ulChar == IGNORE_CHARACTER) { -<a name="l00586"></a>00586 <span class="keywordflow">continue</span>; -<a name="l00587"></a>00587 } -<a name="l00588"></a>00588 <span class="keywordflow">if</span> (ulChar == PICTURE) { -<a name="l00589"></a>00589 ulFileOffsetImage = ulGetPictInfoListItem(ulFileOffset); -<a name="l00590"></a>00590 } <span class="keywordflow">else</span> { -<a name="l00591"></a>00591 ulFileOffsetImage = FC_INVALID; -<a name="l00592"></a>00592 } -<a name="l00593"></a>00593 <span class="keywordflow">if</span> (ulChar == PAR_END) { -<a name="l00594"></a>00594 <span class="comment">/* End of paragraph seen, prepare for the next */</span> -<a name="l00595"></a>00595 vFillStyleFromStylesheet(usIstdNext, &tStyleNext); -<a name="l00596"></a>00596 vCorrectStyleValues(&tStyleNext); -<a name="l00597"></a>00597 bStartStyleNext = TRUE; -<a name="l00598"></a>00598 vFillFontFromStylesheet(usIstdNext, &tFontNext); -<a name="l00599"></a>00599 vCorrectFontValues(&tFontNext); -<a name="l00600"></a>00600 bStartFontNext = TRUE; -<a name="l00601"></a>00601 } -<a name="l00602"></a>00602 <span class="keywordflow">if</span> (ulChar == PAGE_BREAK) { -<a name="l00603"></a>00603 <span class="comment">/* Might be the start of a new section */</span> -<a name="l00604"></a>00604 pSectionNext = pGetSectionInfo(pSection, ulCharPos); -<a name="l00605"></a>00605 } -<a name="l00606"></a>00606 <span class="keywordflow">return</span> ulChar; -<a name="l00607"></a>00607 } -<a name="l00608"></a>00608 } <span class="comment">/* end of ulGetChar */</span> -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 <span class="comment">/*</span> -<a name="l00611"></a>00611 <span class="comment"> * lGetWidthMax - get the maximum line width from the paragraph break value</span> -<a name="l00612"></a>00612 <span class="comment"> *</span> -<a name="l00613"></a>00613 <span class="comment"> * Returns the maximum line width in millipoints</span> -<a name="l00614"></a>00614 <span class="comment"> */</span> -<a name="l00615"></a>00615 <span class="keyword">static</span> <span class="keywordtype">long</span> -<a name="l00616"></a>00616 lGetWidthMax(<span class="keywordtype">int</span> iParagraphBreak) -<a name="l00617"></a>00617 { -<a name="l00618"></a>00618 fail(iParagraphBreak < 0); -<a name="l00619"></a>00619 -<a name="l00620"></a>00620 <span class="keywordflow">if</span> (iParagraphBreak == 0) { -<a name="l00621"></a>00621 <span class="keywordflow">return</span> LONG_MAX; -<a name="l00622"></a>00622 } -<a name="l00623"></a>00623 <span class="keywordflow">if</span> (iParagraphBreak < MIN_SCREEN_WIDTH) { -<a name="l00624"></a>00624 <span class="keywordflow">return</span> lChar2MilliPoints(MIN_SCREEN_WIDTH); -<a name="l00625"></a>00625 } -<a name="l00626"></a>00626 <span class="keywordflow">if</span> (iParagraphBreak > MAX_SCREEN_WIDTH) { -<a name="l00627"></a>00627 <span class="keywordflow">return</span> lChar2MilliPoints(MAX_SCREEN_WIDTH); -<a name="l00628"></a>00628 } -<a name="l00629"></a>00629 <span class="keywordflow">return</span> lChar2MilliPoints(iParagraphBreak); -<a name="l00630"></a>00630 } <span class="comment">/* end of lGetWidthMax */</span> -<a name="l00631"></a>00631 -<a name="l00632"></a>00632 <span class="comment">/*</span> -<a name="l00633"></a>00633 <span class="comment"> * bWordDecryptor - turn Word to something more useful</span> -<a name="l00634"></a>00634 <span class="comment"> *</span> -<a name="l00635"></a>00635 <span class="comment"> * returns TRUE when succesful, otherwise FALSE</span> -<a name="l00636"></a>00636 <span class="comment"> */</span> -<a name="l00637"></a>00637 BOOL -<a name="l00638"></a>00638 bWordDecryptor(FILE *pFile, <span class="keywordtype">long</span> lFilesize, diagram_type *pDiag) -<a name="l00639"></a>00639 { -<a name="l00640"></a>00640 imagedata_type tImage; -<a name="l00641"></a>00641 <span class="keyword">const</span> style_block_type *pStyleTmp; -<a name="l00642"></a>00642 <span class="keyword">const</span> font_block_type *pFontTmp; -<a name="l00643"></a>00643 <span class="keyword">const</span> <span class="keywordtype">char</span> *szListChar; -<a name="l00644"></a>00644 output_type *pAnchor, *pOutput, *pLeftOver; -<a name="l00645"></a>00645 ULONG ulChar; -<a name="l00646"></a>00646 <span class="keywordtype">long</span> lBeforeIndentation, lAfterIndentation; -<a name="l00647"></a>00647 <span class="keywordtype">long</span> lLeftIndentation, lLeftIndentation1, lRightIndentation; -<a name="l00648"></a>00648 <span class="keywordtype">long</span> lWidthCurr, lWidthMax, lDefaultTabWidth, lHalfSpaceWidth, lTmp; -<a name="l00649"></a>00649 list_id_enum eListID; -<a name="l00650"></a>00650 image_info_enum eRes; -<a name="l00651"></a>00651 UINT uiFootnoteNumber, uiEndnoteNumber, uiTmp; -<a name="l00652"></a>00652 <span class="keywordtype">int</span> iListSeqNumber; -<a name="l00653"></a>00653 BOOL bWasTableRow, bTableFontClosed, bWasEndOfParagraph; -<a name="l00654"></a>00654 BOOL bInList, bWasInList, bNoMarks, bFirstLine; -<a name="l00655"></a>00655 BOOL bAllCapitals, bHiddenText, bMarkDelText, bSuccess; -<a name="l00656"></a>00656 USHORT usListNumber; -<a name="l00657"></a>00657 USHORT usFontStyle, usFontStyleMinimal, usFontSize, usTmp; -<a name="l00658"></a>00658 UCHAR ucFontNumber, ucFontColor; -<a name="l00659"></a>00659 UCHAR ucNFC, ucAlignment; -<a name="l00660"></a>00660 -<a name="l00661"></a>00661 fail(pFile == NULL || lFilesize <= 0 || pDiag == NULL); -<a name="l00662"></a>00662 -<a name="l00663"></a>00663 TRACE_MSG(<span class="stringliteral">"bWordDecryptor"</span>); -<a name="l00664"></a>00664 -<a name="l00665"></a>00665 iWordVersion = iInitDocument(pFile, lFilesize); -<a name="l00666"></a>00666 <span class="keywordflow">if</span> (iWordVersion < 0) { -<a name="l00667"></a>00667 DBG_DEC(iWordVersion); -<a name="l00668"></a>00668 <span class="keywordflow">return</span> FALSE; -<a name="l00669"></a>00669 } -<a name="l00670"></a>00670 -<a name="l00671"></a>00671 vGetOptions(&tOptions); -<a name="l00672"></a>00672 bOldMacFile = bIsOldMacFile(); -<a name="l00673"></a>00673 vPrepareHdrFtrText(pFile); -<a name="l00674"></a>00674 vPrepareFootnoteText(pFile); -<a name="l00675"></a>00675 -<a name="l00676"></a>00676 vPrologue2(pDiag, iWordVersion); -<a name="l00677"></a>00677 -<a name="l00678"></a>00678 <span class="comment">/* Initialisation */</span> -<a name="l00679"></a>00679 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00680"></a>00680 <span class="preprocessor"></span> ulCharCounter = 0; -<a name="l00681"></a>00681 iCurrPct = 0; -<a name="l00682"></a>00682 iPrevPct = -1; -<a name="l00683"></a>00683 ulDocumentLength = ulGetDocumentLength(); -<a name="l00684"></a>00684 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00685"></a>00685 pSection = pGetSectionInfo(NULL, 0); -<a name="l00686"></a>00686 pSectionNext = pSection; -<a name="l00687"></a>00687 lDefaultTabWidth = lGetDefaultTabWidth(); -<a name="l00688"></a>00688 DBG_DEC_C(lDefaultTabWidth != 36000, lDefaultTabWidth); -<a name="l00689"></a>00689 pRowInfo = pGetNextRowInfoListItem(); -<a name="l00690"></a>00690 DBG_HEX_C(pRowInfo != NULL, pRowInfo->ulFileOffsetStart); -<a name="l00691"></a>00691 DBG_HEX_C(pRowInfo != NULL, pRowInfo->ulFileOffsetEnd); -<a name="l00692"></a>00692 DBG_MSG_C(pRowInfo == NULL, <span class="stringliteral">"No rows at all"</span>); -<a name="l00693"></a>00693 bStartRow = FALSE; -<a name="l00694"></a>00694 bEndRowNorm = FALSE; -<a name="l00695"></a>00695 bEndRowFast = FALSE; -<a name="l00696"></a>00696 bIsTableRow = FALSE; -<a name="l00697"></a>00697 bWasTableRow = FALSE; -<a name="l00698"></a>00698 vResetStyles(); -<a name="l00699"></a>00699 pStyleInfo = pGetNextTextStyle(NULL); -<a name="l00700"></a>00700 bStartStyle = FALSE; -<a name="l00701"></a>00701 bInList = FALSE; -<a name="l00702"></a>00702 bWasInList = FALSE; -<a name="l00703"></a>00703 iListSeqNumber = 0; -<a name="l00704"></a>00704 usIstdNext = ISTD_NORMAL; -<a name="l00705"></a>00705 pAnchor = NULL; -<a name="l00706"></a>00706 pFontInfo = pGetNextFontInfoListItem(NULL); -<a name="l00707"></a>00707 DBG_HEX_C(pFontInfo != NULL, pFontInfo->ulFileOffset); -<a name="l00708"></a>00708 DBG_MSG_C(pFontInfo == NULL, <span class="stringliteral">"No fonts at all"</span>); -<a name="l00709"></a>00709 bStartFont = FALSE; -<a name="l00710"></a>00710 ucFontNumber = 0; -<a name="l00711"></a>00711 usFontStyleMinimal = FONT_REGULAR; -<a name="l00712"></a>00712 usFontStyle = FONT_REGULAR; -<a name="l00713"></a>00713 usFontSize = DEFAULT_FONT_SIZE; -<a name="l00714"></a>00714 ucFontColor = FONT_COLOR_DEFAULT; -<a name="l00715"></a>00715 pAnchor = pStartNewOutput(pAnchor, NULL); -<a name="l00716"></a>00716 pOutput = pAnchor; -<a name="l00717"></a>00717 pOutput->ucFontColor = ucFontColor; -<a name="l00718"></a>00718 pOutput->usFontStyle = usFontStyle; -<a name="l00719"></a>00719 pOutput->tFontRef = tOpenFont(ucFontNumber, usFontStyle, usFontSize); -<a name="l00720"></a>00720 pOutput->usFontSize = usFontSize; -<a name="l00721"></a>00721 bTableFontClosed = TRUE; -<a name="l00722"></a>00722 lBeforeIndentation = 0; -<a name="l00723"></a>00723 lAfterIndentation = 0; -<a name="l00724"></a>00724 lLeftIndentation = 0; -<a name="l00725"></a>00725 lLeftIndentation1 = 0; -<a name="l00726"></a>00726 lRightIndentation = 0; -<a name="l00727"></a>00727 bWasEndOfParagraph = TRUE; -<a name="l00728"></a>00728 bNoMarks = TRUE; -<a name="l00729"></a>00729 bFirstLine = TRUE; -<a name="l00730"></a>00730 ucNFC = LIST_BULLETS; -<a name="l00731"></a>00731 <span class="keywordflow">if</span> (pStyleInfo != NULL) { -<a name="l00732"></a>00732 szListChar = pStyleInfo->szListChar; -<a name="l00733"></a>00733 pStyleTmp = pStyleInfo; -<a name="l00734"></a>00734 } <span class="keywordflow">else</span> { -<a name="l00735"></a>00735 <span class="keywordflow">if</span> (tStyleNext.szListChar[0] == <span class="charliteral">'\0'</span>) { -<a name="l00736"></a>00736 vGetBulletValue(tOptions.eConversionType, -<a name="l00737"></a>00737 tOptions.eEncoding, tStyleNext.szListChar, 4); -<a name="l00738"></a>00738 } -<a name="l00739"></a>00739 szListChar = tStyleNext.szListChar; -<a name="l00740"></a>00740 pStyleTmp = &tStyleNext; -<a name="l00741"></a>00741 } -<a name="l00742"></a>00742 usListNumber = 0; -<a name="l00743"></a>00743 ucAlignment = ALIGNMENT_LEFT; -<a name="l00744"></a>00744 bAllCapitals = FALSE; -<a name="l00745"></a>00745 bHiddenText = FALSE; -<a name="l00746"></a>00746 bMarkDelText = FALSE; -<a name="l00747"></a>00747 lWidthMax = lGetWidthMax(tOptions.iParagraphBreak); -<a name="l00748"></a>00748 NO_DBG_DEC(lWidthMax); -<a name="l00749"></a>00749 -<a name="l00750"></a>00750 Hourglass_On(); -<a name="l00751"></a>00751 -<a name="l00752"></a>00752 uiFootnoteNumber = 0; -<a name="l00753"></a>00753 uiEndnoteNumber = 0; -<a name="l00754"></a>00754 eListID = text_list; -<a name="l00755"></a>00755 <span class="keywordflow">for</span>(;;) { -<a name="l00756"></a>00756 ulChar = ulGetChar(pFile, eListID); -<a name="l00757"></a>00757 <span class="keywordflow">if</span> (ulChar == (ULONG)EOF) { -<a name="l00758"></a>00758 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l00759"></a>00759 OUTPUT_LINE(); -<a name="l00760"></a>00760 } <span class="keywordflow">else</span> { -<a name="l00761"></a>00761 RESET_LINE(); -<a name="l00762"></a>00762 } -<a name="l00763"></a>00763 <span class="keywordflow">switch</span> (eListID) { -<a name="l00764"></a>00764 <span class="keywordflow">case</span> text_list: -<a name="l00765"></a>00765 <span class="keywordflow">if</span> (tOptions.eConversionType != -<a name="l00766"></a>00766 conversion_xml) { -<a name="l00767"></a>00767 eListID = footnote_list; -<a name="l00768"></a>00768 <span class="keywordflow">if</span> (uiFootnoteNumber != 0) { -<a name="l00769"></a>00769 vPutSeparatorLine(pAnchor); -<a name="l00770"></a>00770 OUTPUT_LINE(); -<a name="l00771"></a>00771 uiFootnoteNumber = 0; -<a name="l00772"></a>00772 } -<a name="l00773"></a>00773 <span class="keywordflow">break</span>; -<a name="l00774"></a>00774 } -<a name="l00775"></a>00775 <span class="comment">/* No break or return */</span> -<a name="l00776"></a>00776 <span class="keywordflow">case</span> footnote_list: -<a name="l00777"></a>00777 eListID = endnote_list; -<a name="l00778"></a>00778 <span class="keywordflow">if</span> (uiEndnoteNumber != 0) { -<a name="l00779"></a>00779 vPutSeparatorLine(pAnchor); -<a name="l00780"></a>00780 OUTPUT_LINE(); -<a name="l00781"></a>00781 uiEndnoteNumber = 0; -<a name="l00782"></a>00782 } -<a name="l00783"></a>00783 <span class="keywordflow">break</span>; -<a name="l00784"></a>00784 <span class="keywordflow">case</span> endnote_list: -<a name="l00785"></a>00785 eListID = textbox_list; -<a name="l00786"></a>00786 <span class="keywordflow">if</span> (bExistsTextBox()) { -<a name="l00787"></a>00787 vPutSeparatorLine(pAnchor); -<a name="l00788"></a>00788 OUTPUT_LINE(); -<a name="l00789"></a>00789 } -<a name="l00790"></a>00790 <span class="keywordflow">break</span>; -<a name="l00791"></a>00791 <span class="keywordflow">case</span> textbox_list: -<a name="l00792"></a>00792 eListID = hdrtextbox_list; -<a name="l00793"></a>00793 <span class="keywordflow">if</span> (bExistsHdrTextBox()) { -<a name="l00794"></a>00794 vPutSeparatorLine(pAnchor); -<a name="l00795"></a>00795 OUTPUT_LINE(); -<a name="l00796"></a>00796 } -<a name="l00797"></a>00797 <span class="keywordflow">break</span>; -<a name="l00798"></a>00798 <span class="keywordflow">case</span> hdrtextbox_list: -<a name="l00799"></a>00799 <span class="keywordflow">default</span>: -<a name="l00800"></a>00800 eListID = end_of_lists; -<a name="l00801"></a>00801 <span class="keywordflow">break</span>; -<a name="l00802"></a>00802 } -<a name="l00803"></a>00803 <span class="keywordflow">if</span> (eListID == end_of_lists) { -<a name="l00804"></a>00804 <span class="keywordflow">break</span>; -<a name="l00805"></a>00805 } -<a name="l00806"></a>00806 <span class="keywordflow">continue</span>; -<a name="l00807"></a>00807 } -<a name="l00808"></a>00808 -<a name="l00809"></a>00809 <span class="keywordflow">if</span> (ulChar == UNKNOWN_NOTE_CHAR) { -<a name="l00810"></a>00810 <span class="keywordflow">switch</span> (eListID) { -<a name="l00811"></a>00811 <span class="keywordflow">case</span> footnote_list: -<a name="l00812"></a>00812 ulChar = FOOTNOTE_CHAR; -<a name="l00813"></a>00813 <span class="keywordflow">break</span>; -<a name="l00814"></a>00814 <span class="keywordflow">case</span> endnote_list: -<a name="l00815"></a>00815 ulChar = ENDNOTE_CHAR; -<a name="l00816"></a>00816 <span class="keywordflow">break</span>; -<a name="l00817"></a>00817 <span class="keywordflow">default</span>: -<a name="l00818"></a>00818 <span class="keywordflow">break</span>; -<a name="l00819"></a>00819 } -<a name="l00820"></a>00820 } -<a name="l00821"></a>00821 -<a name="l00822"></a>00822 <span class="keywordflow">if</span> (bStartRow) { -<a name="l00823"></a>00823 <span class="comment">/* Begin of a tablerow found */</span> -<a name="l00824"></a>00824 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l00825"></a>00825 OUTPUT_LINE(); -<a name="l00826"></a>00826 } <span class="keywordflow">else</span> { -<a name="l00827"></a>00827 RESET_LINE(); -<a name="l00828"></a>00828 } -<a name="l00829"></a>00829 fail(pAnchor != pOutput); -<a name="l00830"></a>00830 <span class="keywordflow">if</span> (bTableFontClosed) { -<a name="l00831"></a>00831 <span class="comment">/* Start special table font */</span> -<a name="l00832"></a>00832 vCloseFont(); -<a name="l00833"></a>00833 <span class="comment">/*</span> -<a name="l00834"></a>00834 <span class="comment"> * Compensate for the fact that Word uses</span> -<a name="l00835"></a>00835 <span class="comment"> * proportional fonts for its tables and we</span> -<a name="l00836"></a>00836 <span class="comment"> * only one fixed-width font</span> -<a name="l00837"></a>00837 <span class="comment"> */</span> -<a name="l00838"></a>00838 uiTmp = ((UINT)usFontSize * 5 + 3) / 6; -<a name="l00839"></a>00839 <span class="keywordflow">if</span> (uiTmp < MIN_TABLEFONT_SIZE) { -<a name="l00840"></a>00840 uiTmp = MIN_TABLEFONT_SIZE; -<a name="l00841"></a>00841 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (uiTmp > MAX_TABLEFONT_SIZE) { -<a name="l00842"></a>00842 uiTmp = MAX_TABLEFONT_SIZE; -<a name="l00843"></a>00843 } -<a name="l00844"></a>00844 pOutput->usFontSize = (USHORT)uiTmp; -<a name="l00845"></a>00845 pOutput->tFontRef = -<a name="l00846"></a>00846 tOpenTableFont(pOutput->usFontSize); -<a name="l00847"></a>00847 pOutput->usFontStyle = FONT_REGULAR; -<a name="l00848"></a>00848 pOutput->ucFontColor = FONT_COLOR_BLACK; -<a name="l00849"></a>00849 bTableFontClosed = FALSE; -<a name="l00850"></a>00850 } -<a name="l00851"></a>00851 bIsTableRow = TRUE; -<a name="l00852"></a>00852 bStartRow = FALSE; -<a name="l00853"></a>00853 } -<a name="l00854"></a>00854 -<a name="l00855"></a>00855 <span class="keywordflow">if</span> (bWasTableRow && -<a name="l00856"></a>00856 !bIsTableRow && -<a name="l00857"></a>00857 ulChar != PAR_END && -<a name="l00858"></a>00858 ulChar != HARD_RETURN && -<a name="l00859"></a>00859 ulChar != PAGE_BREAK && -<a name="l00860"></a>00860 ulChar != COLUMN_FEED) { -<a name="l00861"></a>00861 <span class="comment">/*</span> -<a name="l00862"></a>00862 <span class="comment"> * The end of a table should be followed by an</span> -<a name="l00863"></a>00863 <span class="comment"> * empty line, like the end of a paragraph</span> -<a name="l00864"></a>00864 <span class="comment"> */</span> -<a name="l00865"></a>00865 OUTPUT_LINE(); -<a name="l00866"></a>00866 vEndOfParagraph(pDiag, -<a name="l00867"></a>00867 pOutput->tFontRef, -<a name="l00868"></a>00868 pOutput->usFontSize, -<a name="l00869"></a>00869 (<span class="keywordtype">long</span>)pOutput->usFontSize * 600); -<a name="l00870"></a>00870 } -<a name="l00871"></a>00871 -<a name="l00872"></a>00872 <span class="keywordflow">switch</span> (ulChar) { -<a name="l00873"></a>00873 <span class="keywordflow">case</span> PAGE_BREAK: -<a name="l00874"></a>00874 <span class="keywordflow">case</span> COLUMN_FEED: -<a name="l00875"></a>00875 <span class="keywordflow">if</span> (bIsTableRow) { -<a name="l00876"></a>00876 <span class="comment">/* Ignore when in a table */</span> -<a name="l00877"></a>00877 <span class="keywordflow">break</span>; -<a name="l00878"></a>00878 } -<a name="l00879"></a>00879 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l00880"></a>00880 OUTPUT_LINE(); -<a name="l00881"></a>00881 } <span class="keywordflow">else</span> { -<a name="l00882"></a>00882 RESET_LINE(); -<a name="l00883"></a>00883 } -<a name="l00884"></a>00884 <span class="keywordflow">if</span> (ulChar == PAGE_BREAK) { -<a name="l00885"></a>00885 vEndOfPage(pDiag, lAfterIndentation, -<a name="l00886"></a>00886 pSection != pSectionNext); -<a name="l00887"></a>00887 } <span class="keywordflow">else</span> { -<a name="l00888"></a>00888 vEndOfParagraph(pDiag, -<a name="l00889"></a>00889 pOutput->tFontRef, -<a name="l00890"></a>00890 pOutput->usFontSize, -<a name="l00891"></a>00891 lAfterIndentation); -<a name="l00892"></a>00892 } -<a name="l00893"></a>00893 <span class="keywordflow">break</span>; -<a name="l00894"></a>00894 <span class="keywordflow">default</span>: -<a name="l00895"></a>00895 <span class="keywordflow">break</span>; -<a name="l00896"></a>00896 } -<a name="l00897"></a>00897 -<a name="l00898"></a>00898 <span class="keywordflow">if</span> (bStartFont || (bStartFontNext && ulChar != PAR_END)) { -<a name="l00899"></a>00899 <span class="comment">/* Begin of a font found */</span> -<a name="l00900"></a>00900 <span class="keywordflow">if</span> (bStartFont) { -<a name="l00901"></a>00901 <span class="comment">/* bStartFont takes priority */</span> -<a name="l00902"></a>00902 fail(pFontInfo == NULL); -<a name="l00903"></a>00903 pFontTmp = pFontInfo; -<a name="l00904"></a>00904 } <span class="keywordflow">else</span> { -<a name="l00905"></a>00905 pFontTmp = &tFontNext; -<a name="l00906"></a>00906 } -<a name="l00907"></a>00907 bAllCapitals = bIsCapitals(pFontTmp->usFontStyle); -<a name="l00908"></a>00908 bHiddenText = bIsHidden(pFontTmp->usFontStyle); -<a name="l00909"></a>00909 bMarkDelText = bIsMarkDel(pFontTmp->usFontStyle); -<a name="l00910"></a>00910 usTmp = pFontTmp->usFontStyle & -<a name="l00911"></a>00911 (FONT_BOLD|FONT_ITALIC|FONT_UNDERLINE| -<a name="l00912"></a>00912 FONT_STRIKE|FONT_MARKDEL| -<a name="l00913"></a>00913 FONT_SUPERSCRIPT|FONT_SUBSCRIPT); -<a name="l00914"></a>00914 <span class="keywordflow">if</span> (!bIsTableRow && -<a name="l00915"></a>00915 (usFontSize != pFontTmp->usFontSize || -<a name="l00916"></a>00916 ucFontNumber != pFontTmp->ucFontNumber || -<a name="l00917"></a>00917 usFontStyleMinimal != usTmp || -<a name="l00918"></a>00918 ucFontColor != pFontTmp->ucFontColor)) { -<a name="l00919"></a>00919 pOutput = pStartNextOutput(pOutput); -<a name="l00920"></a>00920 vCloseFont(); -<a name="l00921"></a>00921 pOutput->ucFontColor = pFontTmp->ucFontColor; -<a name="l00922"></a>00922 pOutput->usFontStyle = pFontTmp->usFontStyle; -<a name="l00923"></a>00923 pOutput->usFontSize = pFontTmp->usFontSize; -<a name="l00924"></a>00924 pOutput->tFontRef = tOpenFont( -<a name="l00925"></a>00925 pFontTmp->ucFontNumber, -<a name="l00926"></a>00926 pFontTmp->usFontStyle, -<a name="l00927"></a>00927 pFontTmp->usFontSize); -<a name="l00928"></a>00928 fail(!bCheckDoubleLinkedList(pAnchor)); -<a name="l00929"></a>00929 } -<a name="l00930"></a>00930 ucFontNumber = pFontTmp->ucFontNumber; -<a name="l00931"></a>00931 usFontSize = pFontTmp->usFontSize; -<a name="l00932"></a>00932 ucFontColor = pFontTmp->ucFontColor; -<a name="l00933"></a>00933 usFontStyle = pFontTmp->usFontStyle; -<a name="l00934"></a>00934 usFontStyleMinimal = usTmp; -<a name="l00935"></a>00935 <span class="keywordflow">if</span> (bStartFont) { -<a name="l00936"></a>00936 <span class="comment">/* Get the next font info */</span> -<a name="l00937"></a>00937 pFontInfo = pGetNextFontInfoListItem(pFontInfo); -<a name="l00938"></a>00938 NO_DBG_HEX_C(pFontInfo != NULL, -<a name="l00939"></a>00939 pFontInfo->ulFileOffset); -<a name="l00940"></a>00940 DBG_MSG_C(pFontInfo == NULL, <span class="stringliteral">"No more fonts"</span>); -<a name="l00941"></a>00941 } -<a name="l00942"></a>00942 bStartFont = FALSE; -<a name="l00943"></a>00943 bStartFontNext = FALSE; -<a name="l00944"></a>00944 } -<a name="l00945"></a>00945 -<a name="l00946"></a>00946 <span class="keywordflow">if</span> (bStartStyle || (bStartStyleNext && ulChar != PAR_END)) { -<a name="l00947"></a>00947 bFirstLine = TRUE; -<a name="l00948"></a>00948 <span class="comment">/* Begin of a style found */</span> -<a name="l00949"></a>00949 <span class="keywordflow">if</span> (bStartStyle) { -<a name="l00950"></a>00950 <span class="comment">/* bStartStyle takes priority */</span> -<a name="l00951"></a>00951 fail(pStyleInfo == NULL); -<a name="l00952"></a>00952 pStyleTmp = pStyleInfo; -<a name="l00953"></a>00953 } <span class="keywordflow">else</span> { -<a name="l00954"></a>00954 pStyleTmp = &tStyleNext; -<a name="l00955"></a>00955 } -<a name="l00956"></a>00956 <span class="keywordflow">if</span> (!bIsTableRow) { -<a name="l00957"></a>00957 vStoreStyle(pDiag, pOutput, pStyleTmp); -<a name="l00958"></a>00958 } -<a name="l00959"></a>00959 usIstdNext = pStyleTmp->usIstdNext; -<a name="l00960"></a>00960 lBeforeIndentation = -<a name="l00961"></a>00961 lTwips2MilliPoints(pStyleTmp->usBeforeIndent); -<a name="l00962"></a>00962 lAfterIndentation = -<a name="l00963"></a>00963 lTwips2MilliPoints(pStyleTmp->usAfterIndent); -<a name="l00964"></a>00964 lLeftIndentation = -<a name="l00965"></a>00965 lTwips2MilliPoints(pStyleTmp->sLeftIndent); -<a name="l00966"></a>00966 lLeftIndentation1 = -<a name="l00967"></a>00967 lTwips2MilliPoints(pStyleTmp->sLeftIndent1); -<a name="l00968"></a>00968 lRightIndentation = -<a name="l00969"></a>00969 lTwips2MilliPoints(pStyleTmp->sRightIndent); -<a name="l00970"></a>00970 bInList = bStyleImpliesList(pStyleTmp, iWordVersion); -<a name="l00971"></a>00971 bNoMarks = !bInList || pStyleTmp->bNumPause; -<a name="l00972"></a>00972 ucNFC = pStyleTmp->ucNFC; -<a name="l00973"></a>00973 szListChar = pStyleTmp->szListChar; -<a name="l00974"></a>00974 ucAlignment = pStyleTmp->ucAlignment; -<a name="l00975"></a>00975 <span class="keywordflow">if</span> (bInList && !bWasInList) { -<a name="l00976"></a>00976 <span class="comment">/* Start of a list */</span> -<a name="l00977"></a>00977 iListSeqNumber++; -<a name="l00978"></a>00978 vStartOfList(pDiag, ucNFC, -<a name="l00979"></a>00979 bWasTableRow && !bIsTableRow); -<a name="l00980"></a>00980 } -<a name="l00981"></a>00981 <span class="keywordflow">if</span> (!bInList && bWasInList) { -<a name="l00982"></a>00982 <span class="comment">/* End of a list */</span> -<a name="l00983"></a>00983 vEndOfList(pDiag); -<a name="l00984"></a>00984 } -<a name="l00985"></a>00985 bWasInList = bInList; -<a name="l00986"></a>00986 <span class="keywordflow">if</span> (bStartStyle) { -<a name="l00987"></a>00987 pStyleInfo = pGetNextTextStyle(pStyleInfo); -<a name="l00988"></a>00988 NO_DBG_HEX_C(pStyleInfo != NULL, -<a name="l00989"></a>00989 pStyleInfo->ulFileOffset); -<a name="l00990"></a>00990 DBG_MSG_C(pStyleInfo == NULL, -<a name="l00991"></a>00991 <span class="stringliteral">"No more styles"</span>); -<a name="l00992"></a>00992 } -<a name="l00993"></a>00993 bStartStyle = FALSE; -<a name="l00994"></a>00994 bStartStyleNext = FALSE; -<a name="l00995"></a>00995 } -<a name="l00996"></a>00996 -<a name="l00997"></a>00997 <span class="keywordflow">if</span> (bWasEndOfParagraph) { -<a name="l00998"></a>00998 vStartOfParagraph1(pDiag, lBeforeIndentation); -<a name="l00999"></a>00999 } -<a name="l01000"></a>01000 -<a name="l01001"></a>01001 <span class="keywordflow">if</span> (!bIsTableRow && -<a name="l01002"></a>01002 lTotalStringWidth(pAnchor) == 0) { -<a name="l01003"></a>01003 <span class="keywordflow">if</span> (!bNoMarks) { -<a name="l01004"></a>01004 usListNumber = usGetListValue(iListSeqNumber, -<a name="l01005"></a>01005 iWordVersion, -<a name="l01006"></a>01006 pStyleTmp); -<a name="l01007"></a>01007 } -<a name="l01008"></a>01008 <span class="keywordflow">if</span> (bInList && bFirstLine) { -<a name="l01009"></a>01009 vStartOfListItem(pDiag, bNoMarks); -<a name="l01010"></a>01010 } -<a name="l01011"></a>01011 vPutIndentation(pDiag, pAnchor, bNoMarks, bFirstLine, -<a name="l01012"></a>01012 usListNumber, ucNFC, szListChar, -<a name="l01013"></a>01013 lLeftIndentation, lLeftIndentation1); -<a name="l01014"></a>01014 bFirstLine = FALSE; -<a name="l01015"></a>01015 <span class="comment">/* One number or mark per paragraph will do */</span> -<a name="l01016"></a>01016 bNoMarks = TRUE; -<a name="l01017"></a>01017 } -<a name="l01018"></a>01018 -<a name="l01019"></a>01019 <span class="keywordflow">if</span> (bWasEndOfParagraph) { -<a name="l01020"></a>01020 vStartOfParagraph2(pDiag); -<a name="l01021"></a>01021 bWasEndOfParagraph = FALSE; -<a name="l01022"></a>01022 } -<a name="l01023"></a>01023 -<a name="l01024"></a>01024 <span class="keywordflow">switch</span> (ulChar) { -<a name="l01025"></a>01025 <span class="keywordflow">case</span> PICTURE: -<a name="l01026"></a>01026 (void)memset(&tImage, 0, <span class="keyword">sizeof</span>(tImage)); -<a name="l01027"></a>01027 eRes = eExamineImage(pFile, ulFileOffsetImage, &tImage); -<a name="l01028"></a>01028 <span class="keywordflow">switch</span> (eRes) { -<a name="l01029"></a>01029 <span class="keywordflow">case</span> image_no_information: -<a name="l01030"></a>01030 bSuccess = FALSE; -<a name="l01031"></a>01031 <span class="keywordflow">break</span>; -<a name="l01032"></a>01032 <span class="keywordflow">case</span> image_minimal_information: -<a name="l01033"></a>01033 <span class="keywordflow">case</span> image_full_information: -<a name="l01034"></a>01034 <span class="preprocessor">#if 0</span> -<a name="l01035"></a>01035 <span class="preprocessor"></span> <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l01036"></a>01036 OUTPUT_LINE(); -<a name="l01037"></a>01037 } <span class="keywordflow">else</span> { -<a name="l01038"></a>01038 RESET_LINE(); -<a name="l01039"></a>01039 } -<a name="l01040"></a>01040 <span class="preprocessor">#endif</span> -<a name="l01041"></a>01041 <span class="preprocessor"></span> bSuccess = bTranslateImage(pDiag, pFile, -<a name="l01042"></a>01042 eRes == image_minimal_information, -<a name="l01043"></a>01043 ulFileOffsetImage, &tImage); -<a name="l01044"></a>01044 <span class="keywordflow">break</span>; -<a name="l01045"></a>01045 <span class="keywordflow">default</span>: -<a name="l01046"></a>01046 DBG_DEC(eRes); -<a name="l01047"></a>01047 bSuccess = FALSE; -<a name="l01048"></a>01048 <span class="keywordflow">break</span>; -<a name="l01049"></a>01049 } -<a name="l01050"></a>01050 <span class="keywordflow">if</span> (!bSuccess) { -<a name="l01051"></a>01051 vStoreString(<span class="stringliteral">"[pic]"</span>, 5, pOutput); -<a name="l01052"></a>01052 } -<a name="l01053"></a>01053 <span class="keywordflow">break</span>; -<a name="l01054"></a>01054 <span class="keywordflow">case</span> FOOTNOTE_CHAR: -<a name="l01055"></a>01055 uiFootnoteNumber++; -<a name="l01056"></a>01056 <span class="keywordflow">if</span> (tOptions.eConversionType == conversion_xml) { -<a name="l01057"></a>01057 vStoreCharacter((ULONG)FOOTNOTE_OR_ENDNOTE, -<a name="l01058"></a>01058 pOutput); -<a name="l01059"></a>01059 <span class="keywordflow">break</span>; -<a name="l01060"></a>01060 } -<a name="l01061"></a>01061 vStoreCharacter((ULONG)<span class="charliteral">'['</span>, pOutput); -<a name="l01062"></a>01062 vStoreNumberAsDecimal(uiFootnoteNumber, pOutput); -<a name="l01063"></a>01063 vStoreCharacter((ULONG)<span class="charliteral">']'</span>, pOutput); -<a name="l01064"></a>01064 <span class="keywordflow">break</span>; -<a name="l01065"></a>01065 <span class="keywordflow">case</span> ENDNOTE_CHAR: -<a name="l01066"></a>01066 uiEndnoteNumber++; -<a name="l01067"></a>01067 vStoreCharacter((ULONG)<span class="charliteral">'['</span>, pOutput); -<a name="l01068"></a>01068 vStoreNumberAsRoman(uiEndnoteNumber, pOutput); -<a name="l01069"></a>01069 vStoreCharacter((ULONG)<span class="charliteral">']'</span>, pOutput); -<a name="l01070"></a>01070 <span class="keywordflow">break</span>; -<a name="l01071"></a>01071 <span class="keywordflow">case</span> UNKNOWN_NOTE_CHAR: -<a name="l01072"></a>01072 vStoreString(<span class="stringliteral">"[?]"</span>, 3, pOutput); -<a name="l01073"></a>01073 <span class="keywordflow">break</span>; -<a name="l01074"></a>01074 <span class="keywordflow">case</span> PAR_END: -<a name="l01075"></a>01075 <span class="keywordflow">if</span> (bIsTableRow) { -<a name="l01076"></a>01076 vStoreCharacter((ULONG)<span class="charliteral">'\n'</span>, pOutput); -<a name="l01077"></a>01077 <span class="keywordflow">break</span>; -<a name="l01078"></a>01078 } -<a name="l01079"></a>01079 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l01080"></a>01080 OUTPUT_LINE(); -<a name="l01081"></a>01081 } <span class="keywordflow">else</span> { -<a name="l01082"></a>01082 vMove2NextLine(pDiag, -<a name="l01083"></a>01083 pOutput->tFontRef, pOutput->usFontSize); -<a name="l01084"></a>01084 RESET_LINE(); -<a name="l01085"></a>01085 } -<a name="l01086"></a>01086 vEndOfParagraph(pDiag, -<a name="l01087"></a>01087 pOutput->tFontRef, -<a name="l01088"></a>01088 pOutput->usFontSize, -<a name="l01089"></a>01089 lAfterIndentation); -<a name="l01090"></a>01090 bWasEndOfParagraph = TRUE; -<a name="l01091"></a>01091 <span class="keywordflow">break</span>; -<a name="l01092"></a>01092 <span class="keywordflow">case</span> HARD_RETURN: -<a name="l01093"></a>01093 <span class="keywordflow">if</span> (bIsTableRow) { -<a name="l01094"></a>01094 vStoreCharacter((ULONG)<span class="charliteral">'\n'</span>, pOutput); -<a name="l01095"></a>01095 <span class="keywordflow">break</span>; -<a name="l01096"></a>01096 } -<a name="l01097"></a>01097 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l01098"></a>01098 OUTPUT_LINE(); -<a name="l01099"></a>01099 } <span class="keywordflow">else</span> { -<a name="l01100"></a>01100 vMove2NextLine(pDiag, -<a name="l01101"></a>01101 pOutput->tFontRef, pOutput->usFontSize); -<a name="l01102"></a>01102 RESET_LINE(); -<a name="l01103"></a>01103 } -<a name="l01104"></a>01104 <span class="keywordflow">break</span>; -<a name="l01105"></a>01105 <span class="keywordflow">case</span> PAGE_BREAK: -<a name="l01106"></a>01106 <span class="keywordflow">case</span> COLUMN_FEED: -<a name="l01107"></a>01107 pSection = pSectionNext; -<a name="l01108"></a>01108 <span class="keywordflow">break</span>; -<a name="l01109"></a>01109 <span class="keywordflow">case</span> TABLE_SEPARATOR: -<a name="l01110"></a>01110 <span class="keywordflow">if</span> (bIsTableRow) { -<a name="l01111"></a>01111 vStoreCharacter(ulChar, pOutput); -<a name="l01112"></a>01112 <span class="keywordflow">break</span>; -<a name="l01113"></a>01113 } -<a name="l01114"></a>01114 vStoreCharacter((ULONG)<span class="charliteral">' '</span>, pOutput); -<a name="l01115"></a>01115 vStoreCharacter((ULONG)TABLE_SEPARATOR_CHAR, pOutput); -<a name="l01116"></a>01116 <span class="keywordflow">break</span>; -<a name="l01117"></a>01117 <span class="keywordflow">case</span> TAB: -<a name="l01118"></a>01118 <span class="keywordflow">if</span> (bIsTableRow || -<a name="l01119"></a>01119 tOptions.eConversionType == conversion_xml) { -<a name="l01120"></a>01120 vStoreCharacter((ULONG)<span class="charliteral">' '</span>, pOutput); -<a name="l01121"></a>01121 <span class="keywordflow">break</span>; -<a name="l01122"></a>01122 } -<a name="l01123"></a>01123 <span class="keywordflow">if</span> (tOptions.iParagraphBreak == 0 && -<a name="l01124"></a>01124 (tOptions.eConversionType == conversion_text || -<a name="l01125"></a>01125 tOptions.eConversionType == conversion_fmt_text)) { -<a name="l01126"></a>01126 <span class="comment">/* No logical lines, so no tab expansion */</span> -<a name="l01127"></a>01127 vStoreCharacter(TAB, pOutput); -<a name="l01128"></a>01128 <span class="keywordflow">break</span>; -<a name="l01129"></a>01129 } -<a name="l01130"></a>01130 lHalfSpaceWidth = (lComputeSpaceWidth( -<a name="l01131"></a>01131 pOutput->tFontRef, -<a name="l01132"></a>01132 pOutput->usFontSize) + 1) / 2; -<a name="l01133"></a>01133 lTmp = lTotalStringWidth(pAnchor); -<a name="l01134"></a>01134 lTmp += lDrawUnits2MilliPoints(pDiag->lXleft); -<a name="l01135"></a>01135 lTmp /= lDefaultTabWidth; -<a name="l01136"></a>01136 <span class="keywordflow">do</span> { -<a name="l01137"></a>01137 vStoreCharacter((ULONG)FILLER_CHAR, pOutput); -<a name="l01138"></a>01138 lWidthCurr = lTotalStringWidth(pAnchor); -<a name="l01139"></a>01139 lWidthCurr += -<a name="l01140"></a>01140 lDrawUnits2MilliPoints(pDiag->lXleft); -<a name="l01141"></a>01141 } <span class="keywordflow">while</span> (lTmp == lWidthCurr / lDefaultTabWidth && -<a name="l01142"></a>01142 lWidthCurr < lWidthMax + lRightIndentation); -<a name="l01143"></a>01143 <span class="keywordflow">break</span>; -<a name="l01144"></a>01144 <span class="keywordflow">default</span>: -<a name="l01145"></a>01145 <span class="keywordflow">if</span> (bHiddenText && tOptions.bHideHiddenText) { -<a name="l01146"></a>01146 <span class="keywordflow">continue</span>; -<a name="l01147"></a>01147 } -<a name="l01148"></a>01148 <span class="keywordflow">if</span> (bMarkDelText && tOptions.bRemoveRemovedText) { -<a name="l01149"></a>01149 <span class="keywordflow">continue</span>; -<a name="l01150"></a>01150 } -<a name="l01151"></a>01151 <span class="keywordflow">if</span> (ulChar == UNICODE_ELLIPSIS && -<a name="l01152"></a>01152 tOptions.eEncoding != encoding_utf_8) { -<a name="l01153"></a>01153 vStoreString(<span class="stringliteral">"..."</span>, 3, pOutput); -<a name="l01154"></a>01154 } <span class="keywordflow">else</span> { -<a name="l01155"></a>01155 <span class="keywordflow">if</span> (bAllCapitals) { -<a name="l01156"></a>01156 ulChar = ulToUpper(ulChar); -<a name="l01157"></a>01157 } -<a name="l01158"></a>01158 vStoreCharacter(ulChar, pOutput); -<a name="l01159"></a>01159 } -<a name="l01160"></a>01160 <span class="keywordflow">break</span>; -<a name="l01161"></a>01161 } -<a name="l01162"></a>01162 -<a name="l01163"></a>01163 <span class="keywordflow">if</span> (bWasTableRow && !bIsTableRow) { -<a name="l01164"></a>01164 <span class="comment">/* End of a table */</span> -<a name="l01165"></a>01165 vEndOfTable(pDiag); -<a name="l01166"></a>01166 <span class="comment">/* Resume normal font */</span> -<a name="l01167"></a>01167 NO_DBG_MSG(<span class="stringliteral">"End of table font"</span>); -<a name="l01168"></a>01168 vCloseFont(); -<a name="l01169"></a>01169 bTableFontClosed = TRUE; -<a name="l01170"></a>01170 pOutput->ucFontColor = ucFontColor; -<a name="l01171"></a>01171 pOutput->usFontStyle = usFontStyle; -<a name="l01172"></a>01172 pOutput->usFontSize = usFontSize; -<a name="l01173"></a>01173 pOutput->tFontRef = tOpenFont( -<a name="l01174"></a>01174 ucFontNumber, usFontStyle, usFontSize); -<a name="l01175"></a>01175 } -<a name="l01176"></a>01176 bWasTableRow = bIsTableRow; -<a name="l01177"></a>01177 -<a name="l01178"></a>01178 <span class="keywordflow">if</span> (bIsTableRow) { -<a name="l01179"></a>01179 fail(pAnchor != pOutput); -<a name="l01180"></a>01180 <span class="keywordflow">if</span> (!bEndRowNorm && !bEndRowFast) { -<a name="l01181"></a>01181 <span class="keywordflow">continue</span>; -<a name="l01182"></a>01182 } -<a name="l01183"></a>01183 <span class="comment">/* End of a table row */</span> -<a name="l01184"></a>01184 <span class="keywordflow">if</span> (bEndRowNorm) { -<a name="l01185"></a>01185 fail(pRowInfo == NULL); -<a name="l01186"></a>01186 vTableRow2Window(pDiag, pAnchor, pRowInfo, -<a name="l01187"></a>01187 tOptions.eConversionType, -<a name="l01188"></a>01188 tOptions.iParagraphBreak); -<a name="l01189"></a>01189 } <span class="keywordflow">else</span> { -<a name="l01190"></a>01190 fail(!bEndRowFast); -<a name="l01191"></a>01191 } -<a name="l01192"></a>01192 <span class="comment">/* Reset */</span> -<a name="l01193"></a>01193 pAnchor = pStartNewOutput(pAnchor, NULL); -<a name="l01194"></a>01194 pOutput = pAnchor; -<a name="l01195"></a>01195 <span class="keywordflow">if</span> (bEndRowNorm) { -<a name="l01196"></a>01196 pRowInfo = pGetNextRowInfoListItem(); -<a name="l01197"></a>01197 } -<a name="l01198"></a>01198 bIsTableRow = FALSE; -<a name="l01199"></a>01199 bEndRowNorm = FALSE; -<a name="l01200"></a>01200 bEndRowFast = FALSE; -<a name="l01201"></a>01201 NO_DBG_HEX_C(pRowInfo != NULL, -<a name="l01202"></a>01202 pRowInfo->ulFileOffsetStart); -<a name="l01203"></a>01203 NO_DBG_HEX_C(pRowInfo != NULL, -<a name="l01204"></a>01204 pRowInfo->ulFileOffsetEnd); -<a name="l01205"></a>01205 <span class="keywordflow">continue</span>; -<a name="l01206"></a>01206 } -<a name="l01207"></a>01207 lWidthCurr = lTotalStringWidth(pAnchor); -<a name="l01208"></a>01208 lWidthCurr += lDrawUnits2MilliPoints(pDiag->lXleft); -<a name="l01209"></a>01209 <span class="keywordflow">if</span> (lWidthCurr < lWidthMax + lRightIndentation) { -<a name="l01210"></a>01210 <span class="keywordflow">continue</span>; -<a name="l01211"></a>01211 } -<a name="l01212"></a>01212 pLeftOver = pSplitList(pAnchor); -<a name="l01213"></a>01213 vJustify2Window(pDiag, pAnchor, -<a name="l01214"></a>01214 lWidthMax, lRightIndentation, ucAlignment); -<a name="l01215"></a>01215 pAnchor = pStartNewOutput(pAnchor, pLeftOver); -<a name="l01216"></a>01216 <span class="keywordflow">for</span> (pOutput = pAnchor; -<a name="l01217"></a>01217 pOutput->pNext != NULL; -<a name="l01218"></a>01218 pOutput = pOutput->pNext) -<a name="l01219"></a>01219 ; <span class="comment">/* EMPTY */</span> -<a name="l01220"></a>01220 fail(pOutput == NULL); -<a name="l01221"></a>01221 <span class="keywordflow">if</span> (lTotalStringWidth(pAnchor) > 0) { -<a name="l01222"></a>01222 vSetLeftIndentation(pDiag, lLeftIndentation); -<a name="l01223"></a>01223 } -<a name="l01224"></a>01224 } -<a name="l01225"></a>01225 -<a name="l01226"></a>01226 pAnchor = pStartNewOutput(pAnchor, NULL); -<a name="l01227"></a>01227 pAnchor->szStorage = xfree(pAnchor->szStorage); -<a name="l01228"></a>01228 pAnchor = xfree(pAnchor); -<a name="l01229"></a>01229 vCloseFont(); -<a name="l01230"></a>01230 vFreeDocument(); -<a name="l01231"></a>01231 Hourglass_Off(); -<a name="l01232"></a>01232 <span class="keywordflow">return</span> TRUE; -<a name="l01233"></a>01233 } <span class="comment">/* end of bWordDecryptor */</span> -<a name="l01234"></a>01234 -<a name="l01235"></a>01235 <span class="comment">/*</span> -<a name="l01236"></a>01236 <span class="comment"> * lLastStringWidth - compute the width of the last part of the output string</span> -<a name="l01237"></a>01237 <span class="comment"> */</span> -<a name="l01238"></a>01238 <span class="keyword">static</span> <span class="keywordtype">long</span> -<a name="l01239"></a>01239 lLastStringWidth(<span class="keyword">const</span> output_type *pAnchor) -<a name="l01240"></a>01240 { -<a name="l01241"></a>01241 <span class="keyword">const</span> output_type *pCurr, *pStart; -<a name="l01242"></a>01242 -<a name="l01243"></a>01243 pStart = NULL; -<a name="l01244"></a>01244 <span class="keywordflow">for</span> (pCurr = pAnchor; pCurr != NULL; pCurr = pCurr->pNext) { -<a name="l01245"></a>01245 <span class="keywordflow">if</span> (pCurr->tNextFree == 1 && -<a name="l01246"></a>01246 (pCurr->szStorage[0] == PAR_END || -<a name="l01247"></a>01247 pCurr->szStorage[0] == HARD_RETURN)) { -<a name="l01248"></a>01248 <span class="comment">/* Found a separator. Start after the separator */</span> -<a name="l01249"></a>01249 pStart = pCurr->pNext; -<a name="l01250"></a>01250 } -<a name="l01251"></a>01251 } -<a name="l01252"></a>01252 <span class="keywordflow">if</span> (pStart == NULL) { -<a name="l01253"></a>01253 <span class="comment">/* No separators. Use the whole output string */</span> -<a name="l01254"></a>01254 pStart = pAnchor; -<a name="l01255"></a>01255 } -<a name="l01256"></a>01256 <span class="keywordflow">return</span> lTotalStringWidth(pStart); -<a name="l01257"></a>01257 } <span class="comment">/* end of lLastStringWidth */</span> -<a name="l01258"></a>01258 -<a name="l01259"></a>01259 <span class="comment">/*</span> -<a name="l01260"></a>01260 <span class="comment"> * pHdrFtrDecryptor - turn a header/footer list element to something useful</span> -<a name="l01261"></a>01261 <span class="comment"> */</span> -<a name="l01262"></a>01262 output_type * -<a name="l01263"></a>01263 pHdrFtrDecryptor(FILE *pFile, ULONG ulCharPosStart, ULONG ulCharPosNext) -<a name="l01264"></a>01264 { -<a name="l01265"></a>01265 output_type *pAnchor, *pOutput, *pLeftOver; -<a name="l01266"></a>01266 ULONG ulChar, ulFileOffset, ulCharPos; -<a name="l01267"></a>01267 <span class="keywordtype">long</span> lWidthCurr, lWidthMax; -<a name="l01268"></a>01268 <span class="keywordtype">long</span> lRightIndentation; -<a name="l01269"></a>01269 USHORT usChar; -<a name="l01270"></a>01270 UCHAR ucAlignment; -<a name="l01271"></a>01271 BOOL bSkip; -<a name="l01272"></a>01272 -<a name="l01273"></a>01273 fail(iWordVersion < 0); -<a name="l01274"></a>01274 fail(tOptions.eConversionType == conversion_unknown); -<a name="l01275"></a>01275 fail(tOptions.eEncoding == 0); -<a name="l01276"></a>01276 -<a name="l01277"></a>01277 <span class="keywordflow">if</span> (ulCharPosStart == ulCharPosNext) { -<a name="l01278"></a>01278 <span class="comment">/* There are no bytes to decrypt */</span> -<a name="l01279"></a>01279 <span class="keywordflow">return</span> NULL; -<a name="l01280"></a>01280 } -<a name="l01281"></a>01281 -<a name="l01282"></a>01282 lRightIndentation = 0; -<a name="l01283"></a>01283 ucAlignment = ALIGNMENT_LEFT; -<a name="l01284"></a>01284 bSkip = FALSE; -<a name="l01285"></a>01285 lWidthMax = lGetWidthMax(tOptions.iParagraphBreak); -<a name="l01286"></a>01286 pAnchor = pStartNewOutput(NULL, NULL); -<a name="l01287"></a>01287 pOutput = pAnchor; -<a name="l01288"></a>01288 pOutput->tFontRef = tOpenFont(0, FONT_REGULAR, DEFAULT_FONT_SIZE); -<a name="l01289"></a>01289 usChar = usToHdrFtrPosition(pFile, ulCharPosStart); -<a name="l01290"></a>01290 ulCharPos = ulCharPosStart; -<a name="l01291"></a>01291 ulFileOffset = ulCharPos2FileOffset(ulCharPos); -<a name="l01292"></a>01292 <span class="keywordflow">while</span> (usChar != (USHORT)EOF && ulCharPos != ulCharPosNext) { -<a name="l01293"></a>01293 <span class="comment">/* Skip embedded characters */</span> -<a name="l01294"></a>01294 <span class="keywordflow">if</span> (usChar == START_EMBEDDED) { -<a name="l01295"></a>01295 bSkip = TRUE; -<a name="l01296"></a>01296 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usChar == END_IGNORE || usChar == END_EMBEDDED) { -<a name="l01297"></a>01297 bSkip = FALSE; -<a name="l01298"></a>01298 } -<a name="l01299"></a>01299 <span class="comment">/* Translate character */</span> -<a name="l01300"></a>01300 <span class="keywordflow">if</span> (bSkip || usChar == END_IGNORE || usChar == END_EMBEDDED) { -<a name="l01301"></a>01301 ulChar = IGNORE_CHARACTER; -<a name="l01302"></a>01302 } <span class="keywordflow">else</span> { -<a name="l01303"></a>01303 ulChar = ulTranslateCharacters(usChar, -<a name="l01304"></a>01304 ulFileOffset, -<a name="l01305"></a>01305 iWordVersion, -<a name="l01306"></a>01306 tOptions.eConversionType, -<a name="l01307"></a>01307 tOptions.eEncoding, -<a name="l01308"></a>01308 bOldMacFile); -<a name="l01309"></a>01309 } -<a name="l01310"></a>01310 <span class="comment">/* Process character */</span> -<a name="l01311"></a>01311 <span class="keywordflow">if</span> (ulChar != IGNORE_CHARACTER) { -<a name="l01312"></a>01312 <span class="keywordflow">switch</span> (ulChar) { -<a name="l01313"></a>01313 <span class="keywordflow">case</span> PICTURE: -<a name="l01314"></a>01314 vStoreString(<span class="stringliteral">"[pic]"</span>, 5, pOutput); -<a name="l01315"></a>01315 <span class="keywordflow">break</span>; -<a name="l01316"></a>01316 <span class="keywordflow">case</span> PAR_END: -<a name="l01317"></a>01317 <span class="keywordflow">case</span> HARD_RETURN: -<a name="l01318"></a>01318 <span class="keywordflow">case</span> PAGE_BREAK: -<a name="l01319"></a>01319 <span class="keywordflow">case</span> COLUMN_FEED: -<a name="l01320"></a>01320 <span class="comment">/* To the next substring */</span> -<a name="l01321"></a>01321 pOutput = pStartNextOutput(pOutput); -<a name="l01322"></a>01322 vCloseFont(); -<a name="l01323"></a>01323 pOutput->tFontRef = tOpenFont(0, -<a name="l01324"></a>01324 FONT_REGULAR, DEFAULT_FONT_SIZE); -<a name="l01325"></a>01325 <span class="comment">/* A substring with just one character */</span> -<a name="l01326"></a>01326 <span class="keywordflow">if</span> (ulChar == HARD_RETURN) { -<a name="l01327"></a>01327 vStoreCharacter(HARD_RETURN, pOutput); -<a name="l01328"></a>01328 } <span class="keywordflow">else</span> { -<a name="l01329"></a>01329 vStoreCharacter(PAR_END, pOutput); -<a name="l01330"></a>01330 } -<a name="l01331"></a>01331 <span class="comment">/* To the next substring */</span> -<a name="l01332"></a>01332 pOutput = pStartNextOutput(pOutput); -<a name="l01333"></a>01333 vCloseFont(); -<a name="l01334"></a>01334 pOutput->tFontRef = tOpenFont(0, -<a name="l01335"></a>01335 FONT_REGULAR, DEFAULT_FONT_SIZE); -<a name="l01336"></a>01336 fail(!bCheckDoubleLinkedList(pAnchor)); -<a name="l01337"></a>01337 <span class="keywordflow">break</span>; -<a name="l01338"></a>01338 <span class="keywordflow">case</span> TABLE_SEPARATOR: -<a name="l01339"></a>01339 vStoreCharacter((ULONG)<span class="charliteral">' '</span>, pOutput); -<a name="l01340"></a>01340 vStoreCharacter((ULONG)TABLE_SEPARATOR_CHAR, -<a name="l01341"></a>01341 pOutput); -<a name="l01342"></a>01342 <span class="keywordflow">break</span>; -<a name="l01343"></a>01343 <span class="keywordflow">case</span> TAB: -<a name="l01344"></a>01344 vStoreCharacter((ULONG)FILLER_CHAR, pOutput); -<a name="l01345"></a>01345 <span class="keywordflow">break</span>; -<a name="l01346"></a>01346 <span class="keywordflow">default</span>: -<a name="l01347"></a>01347 vStoreCharacter(ulChar, pOutput); -<a name="l01348"></a>01348 <span class="keywordflow">break</span>; -<a name="l01349"></a>01349 } -<a name="l01350"></a>01350 } -<a name="l01351"></a>01351 lWidthCurr = lLastStringWidth(pAnchor); -<a name="l01352"></a>01352 <span class="keywordflow">if</span> (lWidthCurr >= lWidthMax + lRightIndentation) { -<a name="l01353"></a>01353 pLeftOver = pSplitList(pAnchor); -<a name="l01354"></a>01354 <span class="keywordflow">for</span> (pOutput = pAnchor; -<a name="l01355"></a>01355 pOutput->pNext != NULL; -<a name="l01356"></a>01356 pOutput = pOutput->pNext) -<a name="l01357"></a>01357 ; <span class="comment">/* EMPTY */</span> -<a name="l01358"></a>01358 fail(pOutput == NULL); -<a name="l01359"></a>01359 <span class="comment">/* To the next substring */</span> -<a name="l01360"></a>01360 pOutput = pStartNextOutput(pOutput); -<a name="l01361"></a>01361 <span class="comment">/* A substring with just one HARD_RETURN */</span> -<a name="l01362"></a>01362 vStoreCharacter(HARD_RETURN, pOutput); -<a name="l01363"></a>01363 <span class="comment">/* Put the leftover piece(s) at the end */</span> -<a name="l01364"></a>01364 pOutput->pNext = pLeftOver; -<a name="l01365"></a>01365 <span class="keywordflow">if</span> (pLeftOver != NULL) { -<a name="l01366"></a>01366 pLeftOver->pPrev = pOutput; -<a name="l01367"></a>01367 } -<a name="l01368"></a>01368 fail(!bCheckDoubleLinkedList(pAnchor)); -<a name="l01369"></a>01369 <span class="keywordflow">for</span> (pOutput = pAnchor; -<a name="l01370"></a>01370 pOutput->pNext != NULL; -<a name="l01371"></a>01371 pOutput = pOutput->pNext) -<a name="l01372"></a>01372 ; <span class="comment">/* EMPTY */</span> -<a name="l01373"></a>01373 fail(pOutput == NULL); -<a name="l01374"></a>01374 } -<a name="l01375"></a>01375 usChar = usNextChar(pFile, hdrftr_list, -<a name="l01376"></a>01376 &ulFileOffset, &ulCharPos, NULL); -<a name="l01377"></a>01377 } -<a name="l01378"></a>01378 vCloseFont(); -<a name="l01379"></a>01379 <span class="keywordflow">if</span> (bOutputContainsText(pAnchor)) { -<a name="l01380"></a>01380 <span class="keywordflow">return</span> pAnchor; -<a name="l01381"></a>01381 } -<a name="l01382"></a>01382 pAnchor = pStartNewOutput(pAnchor, NULL); -<a name="l01383"></a>01383 pAnchor->szStorage = xfree(pAnchor->szStorage); -<a name="l01384"></a>01384 pAnchor = xfree(pAnchor); -<a name="l01385"></a>01385 <span class="keywordflow">return</span> NULL; -<a name="l01386"></a>01386 } <span class="comment">/* end of pHdrFtrDecryptor */</span> -<a name="l01387"></a>01387 -<a name="l01388"></a>01388 <span class="comment">/*</span> -<a name="l01389"></a>01389 <span class="comment"> * pFootnoteDecryptor - turn a footnote text list element into text</span> -<a name="l01390"></a>01390 <span class="comment"> */</span> -<a name="l01391"></a>01391 <span class="keywordtype">char</span> * -<a name="l01392"></a>01392 szFootnoteDecryptor(FILE *pFile, ULONG ulCharPosStart, ULONG ulCharPosNext) -<a name="l01393"></a>01393 { -<a name="l01394"></a>01394 <span class="keywordtype">char</span> *szText; -<a name="l01395"></a>01395 ULONG ulChar, ulFileOffset, ulCharPos; -<a name="l01396"></a>01396 USHORT usChar; -<a name="l01397"></a>01397 <span class="keywordtype">size_t</span> tLen, tIndex, tNextFree, tStorageSize; -<a name="l01398"></a>01398 <span class="keywordtype">char</span> szResult[6]; -<a name="l01399"></a>01399 BOOL bSkip; -<a name="l01400"></a>01400 -<a name="l01401"></a>01401 fail(iWordVersion < 0); -<a name="l01402"></a>01402 fail(tOptions.eConversionType == conversion_unknown); -<a name="l01403"></a>01403 fail(tOptions.eEncoding == 0); -<a name="l01404"></a>01404 -<a name="l01405"></a>01405 <span class="keywordflow">if</span> (ulCharPosStart == ulCharPosNext) { -<a name="l01406"></a>01406 <span class="comment">/* There are no bytes to decrypt */</span> -<a name="l01407"></a>01407 <span class="keywordflow">return</span> NULL; -<a name="l01408"></a>01408 } -<a name="l01409"></a>01409 -<a name="l01410"></a>01410 <span class="keywordflow">if</span> (tOptions.eConversionType != conversion_xml) { -<a name="l01411"></a>01411 <span class="comment">/* Only implemented for XML output */</span> -<a name="l01412"></a>01412 <span class="keywordflow">return</span> NULL; -<a name="l01413"></a>01413 } -<a name="l01414"></a>01414 -<a name="l01415"></a>01415 bSkip = FALSE; -<a name="l01416"></a>01416 -<a name="l01417"></a>01417 <span class="comment">/* Initialise the text buffer */</span> -<a name="l01418"></a>01418 tStorageSize = INITIAL_SIZE; -<a name="l01419"></a>01419 szText = xmalloc(tStorageSize); -<a name="l01420"></a>01420 tNextFree = 0; -<a name="l01421"></a>01421 szText[tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l01422"></a>01422 -<a name="l01423"></a>01423 <span class="comment">/* Goto the start */</span> -<a name="l01424"></a>01424 usChar = usToFootnotePosition(pFile, ulCharPosStart); -<a name="l01425"></a>01425 ulCharPos = ulCharPosStart; -<a name="l01426"></a>01426 ulFileOffset = ulCharPos2FileOffset(ulCharPos); -<a name="l01427"></a>01427 <span class="comment">/* Skip the unwanted starting characters */</span> -<a name="l01428"></a>01428 <span class="keywordflow">while</span> (usChar != (USHORT)EOF && ulCharPos != ulCharPosNext && -<a name="l01429"></a>01429 (usChar == FOOTNOTE_OR_ENDNOTE || -<a name="l01430"></a>01430 usChar == PAR_END || -<a name="l01431"></a>01431 usChar == TAB || -<a name="l01432"></a>01432 usChar == (USHORT)<span class="charliteral">' '</span>)) { -<a name="l01433"></a>01433 usChar = usNextChar(pFile, footnote_list, -<a name="l01434"></a>01434 &ulFileOffset, &ulCharPos, NULL); -<a name="l01435"></a>01435 } -<a name="l01436"></a>01436 <span class="comment">/* Process the footnote text */</span> -<a name="l01437"></a>01437 <span class="keywordflow">while</span> (usChar != (USHORT)EOF && ulCharPos != ulCharPosNext) { -<a name="l01438"></a>01438 <span class="comment">/* Skip embedded characters */</span> -<a name="l01439"></a>01439 <span class="keywordflow">if</span> (usChar == START_EMBEDDED) { -<a name="l01440"></a>01440 bSkip = TRUE; -<a name="l01441"></a>01441 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (usChar == END_IGNORE || usChar == END_EMBEDDED) { -<a name="l01442"></a>01442 bSkip = FALSE; -<a name="l01443"></a>01443 } -<a name="l01444"></a>01444 <span class="comment">/* Translate character */</span> -<a name="l01445"></a>01445 <span class="keywordflow">if</span> (bSkip || -<a name="l01446"></a>01446 usChar == END_IGNORE || -<a name="l01447"></a>01447 usChar == END_EMBEDDED || -<a name="l01448"></a>01448 usChar == FOOTNOTE_OR_ENDNOTE) { -<a name="l01449"></a>01449 ulChar = IGNORE_CHARACTER; -<a name="l01450"></a>01450 } <span class="keywordflow">else</span> { -<a name="l01451"></a>01451 ulChar = ulTranslateCharacters(usChar, -<a name="l01452"></a>01452 ulFileOffset, -<a name="l01453"></a>01453 iWordVersion, -<a name="l01454"></a>01454 tOptions.eConversionType, -<a name="l01455"></a>01455 tOptions.eEncoding, -<a name="l01456"></a>01456 bOldMacFile); -<a name="l01457"></a>01457 } -<a name="l01458"></a>01458 <span class="comment">/* Process character */</span> -<a name="l01459"></a>01459 <span class="keywordflow">if</span> (ulChar == PICTURE) { -<a name="l01460"></a>01460 tLen = 5; -<a name="l01461"></a>01461 strcpy(szResult, <span class="stringliteral">"[pic]"</span>); -<a name="l01462"></a>01462 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ulChar == IGNORE_CHARACTER) { -<a name="l01463"></a>01463 tLen = 0; -<a name="l01464"></a>01464 szResult[0] = <span class="charliteral">'\0'</span>; -<a name="l01465"></a>01465 } <span class="keywordflow">else</span> { -<a name="l01466"></a>01466 <span class="keywordflow">switch</span> (ulChar) { -<a name="l01467"></a>01467 <span class="keywordflow">case</span> PAR_END: -<a name="l01468"></a>01468 <span class="keywordflow">case</span> HARD_RETURN: -<a name="l01469"></a>01469 <span class="keywordflow">case</span> PAGE_BREAK: -<a name="l01470"></a>01470 <span class="keywordflow">case</span> COLUMN_FEED: -<a name="l01471"></a>01471 ulChar = (ULONG)PAR_END; -<a name="l01472"></a>01472 <span class="keywordflow">break</span>; -<a name="l01473"></a>01473 <span class="keywordflow">case</span> TAB: -<a name="l01474"></a>01474 ulChar = (ULONG)<span class="charliteral">' '</span>; -<a name="l01475"></a>01475 <span class="keywordflow">break</span>; -<a name="l01476"></a>01476 <span class="keywordflow">default</span>: -<a name="l01477"></a>01477 <span class="keywordflow">break</span>; -<a name="l01478"></a>01478 } -<a name="l01479"></a>01479 tLen = tUcs2Utf8(ulChar, szResult, <span class="keyword">sizeof</span>(szResult)); -<a name="l01480"></a>01480 } -<a name="l01481"></a>01481 <span class="comment">/* Add the results to the text */</span> -<a name="l01482"></a>01482 <span class="keywordflow">if</span> (tNextFree + tLen + 1 > tStorageSize) { -<a name="l01483"></a>01483 tStorageSize += EXTENTION_SIZE; -<a name="l01484"></a>01484 szText = xrealloc(szText, tStorageSize); -<a name="l01485"></a>01485 } -<a name="l01486"></a>01486 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l01487"></a>01487 szText[tNextFree++] = szResult[tIndex]; -<a name="l01488"></a>01488 } -<a name="l01489"></a>01489 szText[tNextFree] = <span class="charliteral">'\0'</span>; -<a name="l01490"></a>01490 <span class="comment">/* Next character */</span> -<a name="l01491"></a>01491 usChar = usNextChar(pFile, footnote_list, -<a name="l01492"></a>01492 &ulFileOffset, &ulCharPos, NULL); -<a name="l01493"></a>01493 } -<a name="l01494"></a>01494 <span class="comment">/* Remove redundant spaces */</span> -<a name="l01495"></a>01495 <span class="keywordflow">while</span> (tNextFree != 0 && szText[tNextFree - 1] == <span class="charliteral">' '</span>) { -<a name="l01496"></a>01496 szText[tNextFree - 1] = <span class="charliteral">'\0'</span>; -<a name="l01497"></a>01497 tNextFree--; -<a name="l01498"></a>01498 } -<a name="l01499"></a>01499 <span class="keywordflow">if</span> (tNextFree == 0) { -<a name="l01500"></a>01500 <span class="comment">/* No text */</span> -<a name="l01501"></a>01501 szText = xfree(szText); -<a name="l01502"></a>01502 <span class="keywordflow">return</span> NULL; -<a name="l01503"></a>01503 } -<a name="l01504"></a>01504 <span class="keywordflow">return</span> szText; -<a name="l01505"></a>01505 } <span class="comment">/* end of szFootnoteDecryptor */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordconst_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,337 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/wordconst.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/wordconst.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordconst.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Constants and macros for the interpretation of MS Word files</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__wordconst_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __wordconst_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="comment">/*</span> -<a name="l00013"></a>00013 <span class="comment"> * A bit odd definition of the type Boolean, but RISC OS insists</span> -<a name="l00014"></a>00014 <span class="comment"> * on this and Linux/Unix doesn't mind.</span> -<a name="l00015"></a>00015 <span class="comment"> */</span> -<a name="l00016"></a>00016 <span class="preprocessor">#if !defined(BOOL)</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define BOOL int</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define TRUE 1</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define FALSE 0</span> -<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* !BOOL */</span> -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* Block sizes */</span> -<a name="l00023"></a>00023 <span class="preprocessor">#define HEADER_SIZE 768</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define BIG_BLOCK_SIZE 512</span> -<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define PROPERTY_SET_STORAGE_SIZE 128</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define SMALL_BLOCK_SIZE 64</span> -<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="comment">/* Switch size of Depot use */</span> -<a name="l00028"></a>00028 <span class="preprocessor">#define MIN_SIZE_FOR_BBD_USE 0x1000</span> -<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="comment">/* Table sizes */</span> -<a name="l00030"></a>00030 <span class="preprocessor">#define TABLE_COLUMN_MAX 31</span> -<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="comment">/* Maximum number of tabs positions in a paragraph */</span> -<a name="l00032"></a>00032 <span class="preprocessor">#define NUMBER_OF_TABS_MAX 64</span> -<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="comment">/* Font sizes (in half-points) */</span> -<a name="l00034"></a>00034 <span class="preprocessor">#define MIN_FONT_SIZE 8</span> -<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_FONT_SIZE 20</span> -<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define MAX_FONT_SIZE 240</span> -<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define MIN_TABLEFONT_SIZE 16</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="preprocessor">#define MAX_TABLEFONT_SIZE 20</span> -<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="comment">/* Font styles */</span> -<a name="l00040"></a>00040 <span class="preprocessor">#define FONT_REGULAR 0x0000</span> -<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define FONT_BOLD 0x0001</span> -<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define FONT_ITALIC 0x0002</span> -<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define FONT_UNDERLINE 0x0004</span> -<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#define FONT_CAPITALS 0x0008</span> -<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SMALL_CAPITALS 0x0010</span> -<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define FONT_STRIKE 0x0020</span> -<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define FONT_HIDDEN 0x0040</span> -<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define FONT_MARKDEL 0x0080</span> -<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SUPERSCRIPT 0x0100</span> -<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define FONT_SUBSCRIPT 0x0200</span> -<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="comment">/* Font colors */</span> -<a name="l00052"></a>00052 <span class="preprocessor">#define FONT_COLOR_DEFAULT 0</span> -<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_BLACK 1</span> -<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_BLUE 2</span> -<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_CYAN 3</span> -<a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_GREEN 4</span> -<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_MAGENTA 5</span> -<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_RED 6</span> -<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_YELLOW 7</span> -<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define FONT_COLOR_WHITE 8</span> -<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="comment">/* Special block numbers */</span> -<a name="l00062"></a>00062 <span class="preprocessor">#define END_OF_CHAIN 0xfffffffeUL</span> -<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#define UNUSED_BLOCK 0xffffffffUL</span> -<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="comment">/* Blocksize (512 bytes) and maximum filesize (4 GB) gives 0..7fffff */</span> -<a name="l00065"></a>00065 <span class="preprocessor">#define MAX_BLOCKNUMBER 0x007fffffUL</span> -<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="comment">/* Invalid character position */</span> -<a name="l00067"></a>00067 <span class="preprocessor">#define CP_INVALID 0xffffffffUL</span> -<a name="l00068"></a>00068 <span class="preprocessor"></span><span class="comment">/* Invalid file offset */</span> -<a name="l00069"></a>00069 <span class="preprocessor">#define FC_INVALID 0xffffffffUL</span> -<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="comment">/* Special istd values */</span> -<a name="l00071"></a>00071 <span class="preprocessor">#define ISTD_INVALID USHRT_MAX</span> -<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define ISTD_NORMAL 0</span> -<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="comment">/* Properties modifier without value */</span> -<a name="l00074"></a>00074 <span class="preprocessor">#define IGNORE_PROPMOD 0</span> -<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="comment">/* Types of lists */</span> -<a name="l00076"></a>00076 <span class="preprocessor">#define LIST_ARABIC_NUM 0x00</span> -<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define LIST_UPPER_ROMAN 0x01</span> -<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define LIST_LOWER_ROMAN 0x02</span> -<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define LIST_UPPER_ALPHA 0x03</span> -<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define LIST_LOWER_ALPHA 0x04</span> -<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ORDINAL_NUM 0x05</span> -<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define LIST_NUMBER_TXT 0x06</span> -<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define LIST_ORDINAL_TXT 0x07</span> -<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define LIST_OUTLINE_NUM 0x16</span> -<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define LIST_SPECIAL 0x17</span> -<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#define LIST_SPECIAL2 0x19</span> -<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define LIST_BULLETS 0xff</span> -<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="comment">/* Types of paragraph alignment */</span> -<a name="l00089"></a>00089 <span class="preprocessor">#define ALIGNMENT_LEFT 0x00</span> -<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define ALIGNMENT_CENTER 0x01</span> -<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define ALIGNMENT_RIGHT 0x02</span> -<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define ALIGNMENT_JUSTIFY 0x03</span> -<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="comment">/* Minimum vertical space before and after a heading line */</span> -<a name="l00094"></a>00094 <span class="preprocessor">#define HEADING_GAP 120 </span><span class="comment">/* twips */</span> -<a name="l00095"></a>00095 <span class="comment">/* Style identifier */</span> -<a name="l00096"></a>00096 <span class="preprocessor">#define STI_USER 0xffe</span> -<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define STI_NIL 0xfff</span> -<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="comment">/* Table border style codes */</span> -<a name="l00099"></a>00099 <span class="preprocessor">#define TABLE_BORDER_TOP 0x01</span> -<a name="l00100"></a>00100 <span class="preprocessor"></span><span class="preprocessor">#define TABLE_BORDER_LEFT 0x02</span> -<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#define TABLE_BORDER_BOTTOM 0x04</span> -<a name="l00102"></a>00102 <span class="preprocessor"></span><span class="preprocessor">#define TABLE_BORDER_RIGHT 0x08</span> -<a name="l00103"></a>00103 <span class="preprocessor"></span> -<a name="l00104"></a>00104 <span class="comment">/* Macros */</span> -<a name="l00105"></a>00105 <span class="comment">/* Get macros */</span> -<a name="l00106"></a>00106 <span class="preprocessor">#define ucGetByte(i,a) ((unsigned char)(a[i]))</span> -<a name="l00107"></a>00107 <span class="preprocessor"></span><span class="preprocessor">#define usGetWord(i,a) ((unsigned short)\</span> -<a name="l00108"></a>00108 <span class="preprocessor"> ((unsigned int)(a[(i)+1])<<8|\</span> -<a name="l00109"></a>00109 <span class="preprocessor"> (unsigned int)(a[i])))</span> -<a name="l00110"></a>00110 <span class="preprocessor"></span><span class="preprocessor">#define ulGetLong(i,a) ((unsigned long)(a[i])|\</span> -<a name="l00111"></a>00111 <span class="preprocessor"> (unsigned long)(a[(i)+1])<<8|\</span> -<a name="l00112"></a>00112 <span class="preprocessor"> (unsigned long)(a[(i)+2])<<16|\</span> -<a name="l00113"></a>00113 <span class="preprocessor"> (unsigned long)(a[(i)+3])<<24)</span> -<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">#define usGetWordBE(i,a) ((unsigned short)\</span> -<a name="l00115"></a>00115 <span class="preprocessor"> ((unsigned int)(a[i])<<8|\</span> -<a name="l00116"></a>00116 <span class="preprocessor"> (unsigned int)(a[(i)+1])))</span> -<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define ulGetLongBE(i,a) ((unsigned long)(a[(i)+3])|\</span> -<a name="l00118"></a>00118 <span class="preprocessor"> (unsigned long)(a[(i)+2])<<8|\</span> -<a name="l00119"></a>00119 <span class="preprocessor"> (unsigned long)(a[(i)+1])<<16|\</span> -<a name="l00120"></a>00120 <span class="preprocessor"> (unsigned long)(a[i])<<24)</span> -<a name="l00121"></a>00121 <span class="preprocessor"></span> <span class="comment">/* Font style macros */</span> -<a name="l00122"></a>00122 <span class="preprocessor">#define bIsBold(x) (((x) & FONT_BOLD) == FONT_BOLD)</span> -<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">#define bIsItalic(x) (((x) & FONT_ITALIC) == FONT_ITALIC)</span> -<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">#define bIsUnderline(x) (((x) & FONT_UNDERLINE) == FONT_UNDERLINE)</span> -<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="preprocessor">#define bIsCapitals(x) (((x) & FONT_CAPITALS) == FONT_CAPITALS)</span> -<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">#define bIsSmallCapitals(x) (((x) & FONT_SMALL_CAPITALS) == FONT_SMALL_CAPITALS)</span> -<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define bIsStrike(x) (((x) & FONT_STRIKE) == FONT_STRIKE)</span> -<a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor">#define bIsHidden(x) (((x) & FONT_HIDDEN) == FONT_HIDDEN)</span> -<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">#define bIsMarkDel(x) (((x) & FONT_MARKDEL) == FONT_MARKDEL)</span> -<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#define bIsSuperscript(x) (((x) & FONT_SUPERSCRIPT) == FONT_SUPERSCRIPT)</span> -<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define bIsSubscript(x) (((x) & FONT_SUBSCRIPT) == FONT_SUBSCRIPT)</span> -<a name="l00132"></a>00132 <span class="preprocessor"></span> <span class="comment">/* Table border style code macros */</span> -<a name="l00133"></a>00133 <span class="preprocessor">#define bIsTableBorderTop(x) (((x) & TABLE_BORDER_TOP) == TABLE_BORDER_TOP)</span> -<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor">#define bIsTableBorderLeft(x) (((x) & TABLE_BORDER_LEFT) == TABLE_BORDER_LEFT)</span> -<a name="l00135"></a>00135 <span class="preprocessor"></span><span class="preprocessor">#define bIsTableBorderBottom(x) (((x) & TABLE_BORDER_BOTTOM) == TABLE_BORDER_BOTTOM)</span> -<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor">#define bIsTableBorderRight(x) (((x) & TABLE_BORDER_RIGHT) == TABLE_BORDER_RIGHT)</span> -<a name="l00137"></a>00137 <span class="preprocessor"></span> <span class="comment">/* Computation macros */</span> -<a name="l00138"></a>00138 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00139"></a>00139 <span class="preprocessor"></span><span class="comment">/* From Words half-points to draw units (plus a percentage) */</span> -<a name="l00140"></a>00140 <span class="preprocessor">#define lWord2DrawUnits00(x) ((long)(x) * 320)</span> -<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#define lWord2DrawUnits20(x) ((long)(x) * 384)</span> -<a name="l00142"></a>00142 <span class="preprocessor"></span><span class="preprocessor">#define lToBaseLine(x) ((long)(x) * 45)</span> -<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00144"></a>00144 <span class="comment">/* From twips (1/20 of a point) to millipoints */</span> -<a name="l00145"></a>00145 <span class="preprocessor">#define lTwips2MilliPoints(x) ((long)(x) * 50)</span> -<a name="l00146"></a>00146 <span class="preprocessor"></span><span class="comment">/* From twips (1/20 of a point) to points */</span> -<a name="l00147"></a>00147 <span class="preprocessor">#define dTwips2Points(x) ((double)(x) / 20.0)</span> -<a name="l00148"></a>00148 <span class="preprocessor"></span><span class="comment">/* From default characters (16 OS units wide) to millipoints */</span> -<a name="l00149"></a>00149 <span class="preprocessor">#define lChar2MilliPoints(x) ((long)(x) * 6400)</span> -<a name="l00150"></a>00150 <span class="preprocessor"></span><span class="preprocessor">#define iMilliPoints2Char(x) (int)(((long)(x) + 3200) / 6400)</span> -<a name="l00151"></a>00151 <span class="preprocessor"></span><span class="preprocessor">#define iDrawUnits2Char(x) (int)(((long)(x) + 2048) / 4096)</span> -<a name="l00152"></a>00152 <span class="preprocessor"></span><span class="comment">/* From draw units (1/180*256 inch) to millipoints (1/72*1000 inch) */</span> -<a name="l00153"></a>00153 <span class="preprocessor">#define lDrawUnits2MilliPoints(x) (((long)(x) * 25 + 8) / 16)</span> -<a name="l00154"></a>00154 <span class="preprocessor"></span><span class="preprocessor">#define lMilliPoints2DrawUnits(x) (((long)(x) * 16 + 12) / 25)</span> -<a name="l00155"></a>00155 <span class="preprocessor"></span><span class="preprocessor">#define lPoints2DrawUnits(x) ((long)(x) * 640)</span> -<a name="l00156"></a>00156 <span class="preprocessor"></span><span class="preprocessor">#define dDrawUnits2Points(x) ((double)(x) / 640.0)</span> -<a name="l00157"></a>00157 <span class="preprocessor"></span> -<a name="l00158"></a>00158 <span class="comment">/* Special characters */</span> -<a name="l00159"></a>00159 <span class="preprocessor">#define IGNORE_CHARACTER 0x00 </span><span class="comment">/* ^@ */</span> -<a name="l00160"></a>00160 <span class="preprocessor">#define PICTURE 0x01 </span><span class="comment">/* ^A */</span> -<a name="l00161"></a>00161 <span class="preprocessor">#define FOOTNOTE_OR_ENDNOTE 0x02 </span><span class="comment">/* ^B */</span> -<a name="l00162"></a>00162 <span class="preprocessor">#define FOOTNOTE_SEPARATOR 0x03 </span><span class="comment">/* ^C */</span> -<a name="l00163"></a>00163 <span class="preprocessor">#define FOOTNOTE_CONTINUATION 0x04 </span><span class="comment">/* ^D */</span> -<a name="l00164"></a>00164 <span class="preprocessor">#define ANNOTATION 0x05 </span><span class="comment">/* ^E */</span> -<a name="l00165"></a>00165 <span class="preprocessor">#define TABLE_SEPARATOR 0x07 </span><span class="comment">/* ^G */</span> -<a name="l00166"></a>00166 <span class="preprocessor">#define FRAME 0x08 </span><span class="comment">/* ^H */</span> -<a name="l00167"></a>00167 <span class="preprocessor">#define TAB 0x09 </span><span class="comment">/* ^I */</span> -<a name="l00168"></a>00168 <span class="comment">/* End of line characters */</span> -<a name="l00169"></a>00169 <span class="preprocessor">#define LINE_FEED 0x0a </span><span class="comment">/* ^J */</span> -<a name="l00170"></a>00170 <span class="preprocessor">#define HARD_RETURN 0x0b </span><span class="comment">/* ^K */</span> -<a name="l00171"></a>00171 <span class="preprocessor">#define PAGE_BREAK 0x0c </span><span class="comment">/* ^L */</span> -<a name="l00172"></a>00172 <span class="preprocessor">#define PAR_END 0x0d </span><span class="comment">/* ^M */</span> -<a name="l00173"></a>00173 <span class="preprocessor">#define COLUMN_FEED 0x0e </span><span class="comment">/* ^N */</span> -<a name="l00174"></a>00174 <span class="comment">/* Embedded stuff */</span> -<a name="l00175"></a>00175 <span class="preprocessor">#define START_EMBEDDED 0x13 </span><span class="comment">/* ^S */</span> -<a name="l00176"></a>00176 <span class="preprocessor">#define END_IGNORE 0x14 </span><span class="comment">/* ^T */</span> -<a name="l00177"></a>00177 <span class="preprocessor">#define END_EMBEDDED 0x15 </span><span class="comment">/* ^U */</span> -<a name="l00178"></a>00178 <span class="comment">/* Special characters */</span> -<a name="l00179"></a>00179 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00180"></a>00180 <span class="preprocessor"></span><span class="preprocessor">#define FILLER_CHAR '~'</span> -<a name="l00181"></a>00181 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00182"></a>00182 <span class="preprocessor"></span><span class="preprocessor">#define FILLER_CHAR ' '</span> -<a name="l00183"></a>00183 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00184"></a>00184 <span class="preprocessor">#define TABLE_SEPARATOR_CHAR '|'</span> -<a name="l00185"></a>00185 <span class="preprocessor"></span><span class="comment">/* Pseudo characters. These must be outside the Unicode range */</span> -<a name="l00186"></a>00186 <span class="preprocessor">#define FOOTNOTE_CHAR ((unsigned long)0xffff + 1)</span> -<a name="l00187"></a>00187 <span class="preprocessor"></span><span class="preprocessor">#define ENDNOTE_CHAR ((unsigned long)0xffff + 2)</span> -<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="preprocessor">#define UNKNOWN_NOTE_CHAR ((unsigned long)0xffff + 3)</span> -<a name="l00189"></a>00189 <span class="preprocessor"></span> -<a name="l00190"></a>00190 <span class="comment">/* Charactercodes as used by Word */</span> -<a name="l00191"></a>00191 <span class="preprocessor">#define WORD_UNBREAKABLE_JOIN 0x1e</span> -<a name="l00192"></a>00192 <span class="preprocessor"></span><span class="preprocessor">#define WORD_SOFT_HYPHEN 0x1f</span> -<a name="l00193"></a>00193 <span class="preprocessor"></span> -<a name="l00194"></a>00194 <span class="comment">/* Unicode characters */</span> -<a name="l00195"></a>00195 <span class="preprocessor">#define UNICODE_DOUBLE_LEFT_ANGLE_QMARK 0x00ab</span> -<a name="l00196"></a>00196 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_MIDDLE_DOT 0x00b7</span> -<a name="l00197"></a>00197 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_RIGHT_ANGLE_QMARK 0x00bb</span> -<a name="l00198"></a>00198 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_CAPITAL_D_WITH_STROKE 0x0110</span> -<a name="l00199"></a>00199 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_D_WITH_STROKE 0x0111</span> -<a name="l00200"></a>00200 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_CAPITAL_LIGATURE_OE 0x0152</span> -<a name="l00201"></a>00201 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_LIGATURE_OE 0x0153</span> -<a name="l00202"></a>00202 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_F_HOOK 0x0192</span> -<a name="l00203"></a>00203 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_GREEK_CAPITAL_CHI 0x03a7</span> -<a name="l00204"></a>00204 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_GREEK_SMALL_UPSILON 0x03c5</span> -<a name="l00205"></a>00205 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_MODIFIER_CIRCUMFLEX 0x02c6</span> -<a name="l00206"></a>00206 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_TILDE 0x02dc</span> -<a name="l00207"></a>00207 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_LETTER_OMEGA 0x03c9</span> -<a name="l00208"></a>00208 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EN_QUAD 0x2000</span> -<a name="l00209"></a>00209 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EM_QUAD 0x2001</span> -<a name="l00210"></a>00210 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EN_SPACE 0x2002</span> -<a name="l00211"></a>00211 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EM_SPACE 0x2003</span> -<a name="l00212"></a>00212 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_THREE_PER_EM_SPACE 0x2004</span> -<a name="l00213"></a>00213 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_FOUR_PER_EM_SPACE 0x2005</span> -<a name="l00214"></a>00214 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SIX_PER_EM_SPACE 0x2006</span> -<a name="l00215"></a>00215 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_FIGURE_SPACE 0x2007</span> -<a name="l00216"></a>00216 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_PUNCTUATION_SPACE 0x2008</span> -<a name="l00217"></a>00217 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_THIN_SPACE 0x2009</span> -<a name="l00218"></a>00218 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_HAIR_SPACE 0x200a</span> -<a name="l00219"></a>00219 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ZERO_WIDTH_SPACE 0x200b</span> -<a name="l00220"></a>00220 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ZERO_WIDTH_NON_JOINER 0x200c</span> -<a name="l00221"></a>00221 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ZERO_WIDTH_JOINER 0x200d</span> -<a name="l00222"></a>00222 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFT_TO_RIGHT_MARK 0x200e</span> -<a name="l00223"></a>00223 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHT_TO_LEFT_MARK 0x200f</span> -<a name="l00224"></a>00224 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_HYPHEN 0x2010</span> -<a name="l00225"></a>00225 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_NON_BREAKING_HYPHEN 0x2011</span> -<a name="l00226"></a>00226 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_FIGURE_DASH 0x2012</span> -<a name="l00227"></a>00227 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EN_DASH 0x2013</span> -<a name="l00228"></a>00228 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EM_DASH 0x2014</span> -<a name="l00229"></a>00229 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_HORIZONTAL_BAR 0x2015</span> -<a name="l00230"></a>00230 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_VERTICAL_LINE 0x2016</span> -<a name="l00231"></a>00231 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_LOW_LINE 0x2017</span> -<a name="l00232"></a>00232 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFT_SINGLE_QMARK 0x2018</span> -<a name="l00233"></a>00233 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHT_SINGLE_QMARK 0x2019</span> -<a name="l00234"></a>00234 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SINGLE_LOW_9_QMARK 0x201a</span> -<a name="l00235"></a>00235 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SINGLE_HIGH_REV_9_QMARK 0x201b</span> -<a name="l00236"></a>00236 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFT_DOUBLE_QMARK 0x201c</span> -<a name="l00237"></a>00237 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHT_DOUBLE_QMARK 0x201d</span> -<a name="l00238"></a>00238 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_LOW_9_QMARK 0x201e</span> -<a name="l00239"></a>00239 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_HIGH_REV_9_QMARK 0x201f</span> -<a name="l00240"></a>00240 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DAGGER 0x2020</span> -<a name="l00241"></a>00241 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_DAGGER 0x2021</span> -<a name="l00242"></a>00242 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BULLET 0x2022</span> -<a name="l00243"></a>00243 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_TRIANGULAR_BULLET 0x2023</span> -<a name="l00244"></a>00244 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ONE_DOT_LEADER 0x2024</span> -<a name="l00245"></a>00245 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_TWO_DOT_LEADER 0x2025</span> -<a name="l00246"></a>00246 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ELLIPSIS 0x2026</span> -<a name="l00247"></a>00247 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_HYPHENATION_POINT 0x2027</span> -<a name="l00248"></a>00248 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFT_TO_RIGHT_EMBEDDING 0x202a</span> -<a name="l00249"></a>00249 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHT_TO_LEFT_EMBEDDING 0x202b</span> -<a name="l00250"></a>00250 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_POP_DIRECTIONAL_FORMATTING 0x202c</span> -<a name="l00251"></a>00251 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFT_TO_RIGHT_OVERRIDE 0x202d</span> -<a name="l00252"></a>00252 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHT_TO_LEFT_OVERRIDE 0x202e</span> -<a name="l00253"></a>00253 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_NARROW_NO_BREAK_SPACE 0x202f</span> -<a name="l00254"></a>00254 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_PER_MILLE_SIGN 0x2030</span> -<a name="l00255"></a>00255 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_PRIME 0x2032</span> -<a name="l00256"></a>00256 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOUBLE_PRIME 0x2033</span> -<a name="l00257"></a>00257 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SINGLE_LEFT_ANGLE_QMARK 0x2039</span> -<a name="l00258"></a>00258 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SINGLE_RIGHT_ANGLE_QMARK 0x203a</span> -<a name="l00259"></a>00259 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_UNDERTIE 0x203f</span> -<a name="l00260"></a>00260 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_FRACTION_SLASH 0x2044</span> -<a name="l00261"></a>00261 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_EURO_SIGN 0x20ac</span> -<a name="l00262"></a>00262 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_CIRCLE 0x20dd</span> -<a name="l00263"></a>00263 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SQUARE 0x20de</span> -<a name="l00264"></a>00264 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DIAMOND 0x20df</span> -<a name="l00265"></a>00265 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_NUMERO_SIGN 0x2116</span> -<a name="l00266"></a>00266 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_TRADEMARK_SIGN 0x2122</span> -<a name="l00267"></a>00267 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_KELVIN_SIGN 0x212a</span> -<a name="l00268"></a>00268 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LEFTWARDS_ARROW 0x2190</span> -<a name="l00269"></a>00269 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_UPWARDS_ARROW 0x2191</span> -<a name="l00270"></a>00270 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RIGHTWARDS_ARROW 0x2192</span> -<a name="l00271"></a>00271 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DOWNWARDS_ARROW 0x2193</span> -<a name="l00272"></a>00272 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_N_ARY_SUMMATION 0x2211</span> -<a name="l00273"></a>00273 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_MINUS_SIGN 0x2212</span> -<a name="l00274"></a>00274 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DIVISION_SLASH 0x2215</span> -<a name="l00275"></a>00275 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ASTERISK_OPERATOR 0x2217</span> -<a name="l00276"></a>00276 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BULLET_OPERATOR 0x2219</span> -<a name="l00277"></a>00277 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_RATIO 0x2236</span> -<a name="l00278"></a>00278 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_TILDE_OPERATOR 0x223c</span> -<a name="l00279"></a>00279 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_HORIZONTAL 0x2500</span> -<a name="l00280"></a>00280 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_VERTICAL 0x2502</span> -<a name="l00281"></a>00281 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_DOWN_RIGHT 0x250c</span> -<a name="l00282"></a>00282 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_DOWN_AND_LEFT 0x2510</span> -<a name="l00283"></a>00283 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_UP_AND_RIGHT 0x2514</span> -<a name="l00284"></a>00284 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_UP_AND_LEFT 0x2518</span> -<a name="l00285"></a>00285 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_VERTICAL_AND_RIGHT 0x251c</span> -<a name="l00286"></a>00286 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_VERTICAL_AND_LEFT 0x2524</span> -<a name="l00287"></a>00287 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_DOWN_AND_HORIZONTAL 0x252c</span> -<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_UP_AND_HORIZONTAL 0x2534</span> -<a name="l00289"></a>00289 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_LIGHT_VERTICAL_AND_HORIZONTAL 0x253c</span> -<a name="l00290"></a>00290 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_HORIZONTAL 0x2550</span> -<a name="l00291"></a>00291 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_VERTICAL 0x2551</span> -<a name="l00292"></a>00292 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_DOWN_AND_RIGHT 0x2554</span> -<a name="l00293"></a>00293 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_DOWN_AND_LEFT 0x2557</span> -<a name="l00294"></a>00294 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_UP_AND_RIGHT 0x255a</span> -<a name="l00295"></a>00295 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_UP_AND_LEFT 0x255d</span> -<a name="l00296"></a>00296 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_VERTICAL_AND_RIGHT 0x2560</span> -<a name="l00297"></a>00297 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_VERTICAL_AND_LEFT 0x2563</span> -<a name="l00298"></a>00298 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_DOWN_AND_HORIZONTAL 0x2566</span> -<a name="l00299"></a>00299 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_UP_AND_HORIZONTAL 0x2569</span> -<a name="l00300"></a>00300 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BD_DOUBLE_VERTICAL_AND_HORIZONTAL 0x256c</span> -<a name="l00301"></a>00301 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_LIGHT_SHADE 0x2591</span> -<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_MEDIUM_SHADE 0x2592</span> -<a name="l00303"></a>00303 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_DARK_SHADE 0x2593</span> -<a name="l00304"></a>00304 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BLACK_SQUARE 0x25a0</span> -<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_BLACK_CLUB_SUIT 0x2663</span> -<a name="l00306"></a>00306 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_LIGATURE_FI 0xfb01</span> -<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_SMALL_LIGATURE_FL 0xfb02</span> -<a name="l00308"></a>00308 <span class="preprocessor"></span><span class="preprocessor">#define UNICODE_ZERO_WIDTH_NO_BREAK_SPACE 0xfeff</span> -<a name="l00309"></a>00309 <span class="preprocessor"></span> -<a name="l00310"></a>00310 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00311"></a>00311 <span class="preprocessor"></span><span class="preprocessor">#define OUR_ELLIPSIS 0x8c</span> -<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#define OUR_EM_DASH 0x98</span> -<a name="l00313"></a>00313 <span class="preprocessor"></span><span class="preprocessor">#define OUR_UNBREAKABLE_JOIN 0x99</span> -<a name="l00314"></a>00314 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00315"></a>00315 <span class="preprocessor"></span><span class="preprocessor">#define OUR_ELLIPSIS '.'</span> -<a name="l00316"></a>00316 <span class="preprocessor"></span><span class="preprocessor">#define OUR_EM_DASH '-'</span> -<a name="l00317"></a>00317 <span class="preprocessor"></span><span class="preprocessor">#define OUR_UNBREAKABLE_JOIN '-'</span> -<a name="l00318"></a>00318 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00319"></a>00319 <span class="preprocessor">#define OUR_DIAMOND '-'</span> -<a name="l00320"></a>00320 <span class="preprocessor"></span> -<a name="l00321"></a>00321 <span class="preprocessor">#endif </span><span class="comment">/* __wordconst_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/worddos_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/worddos.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/worddos.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * worddos.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Deal with the DOS internals of a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="comment">/*</span> -<a name="l00013"></a>00013 <span class="comment"> * bGetDocumentText - make a list of the text blocks of a Word document</span> -<a name="l00014"></a>00014 <span class="comment"> *</span> -<a name="l00015"></a>00015 <span class="comment"> * Return TRUE when succesful, otherwise FALSE</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> BOOL -<a name="l00018"></a>00018 bGetDocumentText(FILE *pFile, <span class="keywordtype">long</span> lFilesize, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00019"></a>00019 { -<a name="l00020"></a>00020 text_block_type tTextBlock; -<a name="l00021"></a>00021 ULONG ulTextLen; -<a name="l00022"></a>00022 BOOL bFastSaved; -<a name="l00023"></a>00023 UCHAR ucDocStatus, ucVersion; -<a name="l00024"></a>00024 -<a name="l00025"></a>00025 fail(pFile == NULL); -<a name="l00026"></a>00026 fail(lFilesize < 128); -<a name="l00027"></a>00027 fail(aucHeader == NULL); -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00030"></a>00030 ucDocStatus = ucGetByte(0x75, aucHeader); -<a name="l00031"></a>00031 DBG_HEX(ucDocStatus); -<a name="l00032"></a>00032 bFastSaved = (ucDocStatus & BIT(1)) != 0; -<a name="l00033"></a>00033 DBG_MSG_C(bFastSaved, <span class="stringliteral">"This document is Fast Saved"</span>); -<a name="l00034"></a>00034 ucVersion = ucGetByte(0x74, aucHeader); -<a name="l00035"></a>00035 DBG_DEC(ucVersion); -<a name="l00036"></a>00036 DBG_MSG_C(ucVersion == 0, <span class="stringliteral">"Written by Word 4.0 or earlier"</span>); -<a name="l00037"></a>00037 DBG_MSG_C(ucVersion == 3, <span class="stringliteral">"Word 5.0 format, but not written by Word"</span>); -<a name="l00038"></a>00038 DBG_MSG_C(ucVersion == 4, <span class="stringliteral">"Written by Word 5.x"</span>); -<a name="l00039"></a>00039 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00040"></a>00040 werr(0, <span class="stringliteral">"Word for DOS: autosave documents are not supported"</span>); -<a name="l00041"></a>00041 <span class="keywordflow">return</span> FALSE; -<a name="l00042"></a>00042 } -<a name="l00043"></a>00043 -<a name="l00044"></a>00044 <span class="comment">/* Get length information */</span> -<a name="l00045"></a>00045 ulTextLen = ulGetLong(0x0e, aucHeader); -<a name="l00046"></a>00046 DBG_HEX(ulTextLen); -<a name="l00047"></a>00047 ulTextLen -= 128; -<a name="l00048"></a>00048 DBG_DEC(ulTextLen); -<a name="l00049"></a>00049 tTextBlock.ulFileOffset = 128; -<a name="l00050"></a>00050 tTextBlock.ulCharPos = 128; -<a name="l00051"></a>00051 tTextBlock.ulLength = ulTextLen; -<a name="l00052"></a>00052 tTextBlock.bUsesUnicode = FALSE; -<a name="l00053"></a>00053 tTextBlock.usPropMod = IGNORE_PROPMOD; -<a name="l00054"></a>00054 <span class="keywordflow">if</span> (!bAdd2TextBlockList(&tTextBlock)) { -<a name="l00055"></a>00055 DBG_HEX(tTextBlock.ulFileOffset); -<a name="l00056"></a>00056 DBG_HEX(tTextBlock.ulCharPos); -<a name="l00057"></a>00057 DBG_DEC(tTextBlock.ulLength); -<a name="l00058"></a>00058 DBG_DEC(tTextBlock.bUsesUnicode); -<a name="l00059"></a>00059 DBG_DEC(tTextBlock.usPropMod); -<a name="l00060"></a>00060 <span class="keywordflow">return</span> FALSE; -<a name="l00061"></a>00061 } -<a name="l00062"></a>00062 <span class="keywordflow">return</span> TRUE; -<a name="l00063"></a>00063 } <span class="comment">/* end of bGetDocumentText */</span> -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="comment">/*</span> -<a name="l00066"></a>00066 <span class="comment"> * iInitDocumentDOS - initialize an DOS document</span> -<a name="l00067"></a>00067 <span class="comment"> *</span> -<a name="l00068"></a>00068 <span class="comment"> * Returns the version of Word that made the document or -1</span> -<a name="l00069"></a>00069 <span class="comment"> */</span> -<a name="l00070"></a>00070 <span class="keywordtype">int</span> -<a name="l00071"></a>00071 iInitDocumentDOS(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00072"></a>00072 { -<a name="l00073"></a>00073 <span class="keywordtype">int</span> iWordVersion; -<a name="l00074"></a>00074 BOOL bSuccess; -<a name="l00075"></a>00075 USHORT usIdent; -<a name="l00076"></a>00076 UCHAR aucHeader[128]; -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 fail(pFile == NULL); -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 <span class="keywordflow">if</span> (lFilesize < 128) { -<a name="l00081"></a>00081 <span class="keywordflow">return</span> -1; -<a name="l00082"></a>00082 } -<a name="l00083"></a>00083 -<a name="l00084"></a>00084 <span class="comment">/* Read the headerblock */</span> -<a name="l00085"></a>00085 <span class="keywordflow">if</span> (!bReadBytes(aucHeader, 128, 0x00, pFile)) { -<a name="l00086"></a>00086 <span class="keywordflow">return</span> -1; -<a name="l00087"></a>00087 } -<a name="l00088"></a>00088 <span class="comment">/* Get the "magic number" from the header */</span> -<a name="l00089"></a>00089 usIdent = usGetWord(0x00, aucHeader); -<a name="l00090"></a>00090 DBG_HEX(usIdent); -<a name="l00091"></a>00091 fail(usIdent != 0xbe31); <span class="comment">/* Word for DOS */</span> -<a name="l00092"></a>00092 iWordVersion = iGetVersionNumber(aucHeader); -<a name="l00093"></a>00093 <span class="keywordflow">if</span> (iWordVersion != 0) { -<a name="l00094"></a>00094 werr(0, <span class="stringliteral">"This file is not from 'Word for DOS'."</span>); -<a name="l00095"></a>00095 <span class="keywordflow">return</span> -1; -<a name="l00096"></a>00096 } -<a name="l00097"></a>00097 bSuccess = bGetDocumentText(pFile, lFilesize, aucHeader); -<a name="l00098"></a>00098 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00099"></a>00099 vGetPropertyInfo(pFile, NULL, -<a name="l00100"></a>00100 NULL, 0, NULL, 0, -<a name="l00101"></a>00101 aucHeader, iWordVersion); -<a name="l00102"></a>00102 vSetDefaultTabWidth(pFile, NULL, -<a name="l00103"></a>00103 NULL, 0, NULL, 0, -<a name="l00104"></a>00104 aucHeader, iWordVersion); -<a name="l00105"></a>00105 vGetNotesInfo(pFile, NULL, -<a name="l00106"></a>00106 NULL, 0, NULL, 0, -<a name="l00107"></a>00107 aucHeader, iWordVersion); -<a name="l00108"></a>00108 } -<a name="l00109"></a>00109 <span class="keywordflow">return</span> bSuccess ? iWordVersion : -1; -<a name="l00110"></a>00110 } <span class="comment">/* end of iInitDocumentDOS */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordlib_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,375 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/wordlib.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/wordlib.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordlib.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Deal with the internals of a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 <span class="keyword">static</span> BOOL bOldMacFile = FALSE; -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="comment">/*</span> -<a name="l00015"></a>00015 <span class="comment"> * Common part of the file checking functions</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> BOOL -<a name="l00018"></a>00018 bCheckBytes(FILE *pFile, <span class="keyword">const</span> UCHAR *aucBytes, <span class="keywordtype">size_t</span> tBytes) -<a name="l00019"></a>00019 { -<a name="l00020"></a>00020 <span class="keywordtype">int</span> iIndex, iChar; -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 fail(pFile == NULL || aucBytes == NULL || tBytes == 0); -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 rewind(pFile); -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tBytes; iIndex++) { -<a name="l00027"></a>00027 iChar = getc(pFile); -<a name="l00028"></a>00028 <span class="keywordflow">if</span> (iChar == EOF || iChar != (<span class="keywordtype">int</span>)aucBytes[iIndex]) { -<a name="l00029"></a>00029 NO_DBG_HEX(iChar); -<a name="l00030"></a>00030 NO_DBG_HEX(aucBytes[iIndex]); -<a name="l00031"></a>00031 <span class="keywordflow">return</span> FALSE; -<a name="l00032"></a>00032 } -<a name="l00033"></a>00033 } -<a name="l00034"></a>00034 <span class="keywordflow">return</span> TRUE; -<a name="l00035"></a>00035 } <span class="comment">/* end of bCheckBytes */</span> -<a name="l00036"></a>00036 -<a name="l00037"></a>00037 <span class="comment">/*</span> -<a name="l00038"></a>00038 <span class="comment"> * This function checks whether the given file is or is not a "Word for DOS"</span> -<a name="l00039"></a>00039 <span class="comment"> * document</span> -<a name="l00040"></a>00040 <span class="comment"> */</span> -<a name="l00041"></a>00041 BOOL -<a name="l00042"></a>00042 bIsWordForDosFile(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00043"></a>00043 { -<a name="l00044"></a>00044 <span class="keyword">static</span> UCHAR aucBytes[] = -<a name="l00045"></a>00045 { 0x31, 0xbe, 0x00, 0x00, 0x00, 0xab }; <span class="comment">/* Word for DOS */</span> -<a name="l00046"></a>00046 -<a name="l00047"></a>00047 DBG_MSG(<span class="stringliteral">"bIsWordForDosFile"</span>); -<a name="l00048"></a>00048 -<a name="l00049"></a>00049 <span class="keywordflow">if</span> (pFile == NULL || lFilesize < 0) { -<a name="l00050"></a>00050 DBG_MSG(<span class="stringliteral">"No proper file given"</span>); -<a name="l00051"></a>00051 <span class="keywordflow">return</span> FALSE; -<a name="l00052"></a>00052 } -<a name="l00053"></a>00053 <span class="keywordflow">if</span> (lFilesize < 128) { -<a name="l00054"></a>00054 DBG_MSG(<span class="stringliteral">"File too small to be a Word document"</span>); -<a name="l00055"></a>00055 <span class="keywordflow">return</span> FALSE; -<a name="l00056"></a>00056 } -<a name="l00057"></a>00057 <span class="keywordflow">return</span> bCheckBytes(pFile, aucBytes, elementsof(aucBytes)); -<a name="l00058"></a>00058 } <span class="comment">/* end of bIsWordForDosFile */</span> -<a name="l00059"></a>00059 -<a name="l00060"></a>00060 <span class="comment">/*</span> -<a name="l00061"></a>00061 <span class="comment"> * This function checks whether the given file is or is not a file with an</span> -<a name="l00062"></a>00062 <span class="comment"> * OLE envelope (That is a document made by Word 6 or later)</span> -<a name="l00063"></a>00063 <span class="comment"> */</span> -<a name="l00064"></a>00064 <span class="keyword">static</span> BOOL -<a name="l00065"></a>00065 bIsWordFileWithOLE(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00066"></a>00066 { -<a name="l00067"></a>00067 <span class="keyword">static</span> UCHAR aucBytes[] = -<a name="l00068"></a>00068 { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 }; -<a name="l00069"></a>00069 <span class="keywordtype">int</span> iTailLen; -<a name="l00070"></a>00070 -<a name="l00071"></a>00071 <span class="keywordflow">if</span> (pFile == NULL || lFilesize < 0) { -<a name="l00072"></a>00072 DBG_MSG(<span class="stringliteral">"No proper file given"</span>); -<a name="l00073"></a>00073 <span class="keywordflow">return</span> FALSE; -<a name="l00074"></a>00074 } -<a name="l00075"></a>00075 <span class="keywordflow">if</span> (lFilesize < (<span class="keywordtype">long</span>)BIG_BLOCK_SIZE * 3) { -<a name="l00076"></a>00076 DBG_MSG(<span class="stringliteral">"This file is too small to be a Word document"</span>); -<a name="l00077"></a>00077 <span class="keywordflow">return</span> FALSE; -<a name="l00078"></a>00078 } -<a name="l00079"></a>00079 -<a name="l00080"></a>00080 iTailLen = (int)(lFilesize % BIG_BLOCK_SIZE); -<a name="l00081"></a>00081 <span class="keywordflow">switch</span> (iTailLen) { -<a name="l00082"></a>00082 <span class="keywordflow">case</span> 0: <span class="comment">/* No tail, as it should be */</span> -<a name="l00083"></a>00083 <span class="keywordflow">break</span>; -<a name="l00084"></a>00084 <span class="keywordflow">case</span> 1: -<a name="l00085"></a>00085 <span class="keywordflow">case</span> 2: <span class="comment">/* Filesize mismatch or a buggy email program */</span> -<a name="l00086"></a>00086 <span class="keywordflow">if</span> ((<span class="keywordtype">int</span>)(lFilesize % 3) == iTailLen) { -<a name="l00087"></a>00087 DBG_DEC(lFilesize); -<a name="l00088"></a>00088 <span class="keywordflow">return</span> FALSE; -<a name="l00089"></a>00089 } -<a name="l00090"></a>00090 <span class="comment">/*</span> -<a name="l00091"></a>00091 <span class="comment"> * Ignore extra bytes caused by buggy email programs.</span> -<a name="l00092"></a>00092 <span class="comment"> * They have bugs in their base64 encoding or decoding.</span> -<a name="l00093"></a>00093 <span class="comment"> * 3 bytes -> 4 ascii chars -> 3 bytes</span> -<a name="l00094"></a>00094 <span class="comment"> */</span> -<a name="l00095"></a>00095 DBG_MSG(<span class="stringliteral">"Document with extra bytes"</span>); -<a name="l00096"></a>00096 <span class="keywordflow">break</span>; -<a name="l00097"></a>00097 <span class="keywordflow">default</span>: <span class="comment">/* Wrong filesize for a Word document */</span> -<a name="l00098"></a>00098 DBG_DEC(lFilesize); -<a name="l00099"></a>00099 DBG_DEC(iTailLen); -<a name="l00100"></a>00100 <span class="keywordflow">return</span> FALSE; -<a name="l00101"></a>00101 } -<a name="l00102"></a>00102 <span class="keywordflow">return</span> bCheckBytes(pFile, aucBytes, elementsof(aucBytes)); -<a name="l00103"></a>00103 } <span class="comment">/* end of bIsWordFileWithOLE */</span> -<a name="l00104"></a>00104 -<a name="l00105"></a>00105 <span class="comment">/*</span> -<a name="l00106"></a>00106 <span class="comment"> * This function checks whether the given file is or is not a RTF document</span> -<a name="l00107"></a>00107 <span class="comment"> */</span> -<a name="l00108"></a>00108 BOOL -<a name="l00109"></a>00109 bIsRtfFile(FILE *pFile) -<a name="l00110"></a>00110 { -<a name="l00111"></a>00111 <span class="keyword">static</span> UCHAR aucBytes[] = -<a name="l00112"></a>00112 { <span class="charliteral">'{'</span>, <span class="charliteral">'\\'</span>, <span class="charliteral">'r'</span>, <span class="charliteral">'t'</span>, <span class="charliteral">'f'</span>, <span class="charliteral">'1'</span> }; -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 DBG_MSG(<span class="stringliteral">"bIsRtfFile"</span>); -<a name="l00115"></a>00115 -<a name="l00116"></a>00116 <span class="keywordflow">return</span> bCheckBytes(pFile, aucBytes, elementsof(aucBytes)); -<a name="l00117"></a>00117 } <span class="comment">/* end of bIsRtfFile */</span> -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * This function checks whether the given file is or is not a WP document</span> -<a name="l00121"></a>00121 <span class="comment"> */</span> -<a name="l00122"></a>00122 BOOL -<a name="l00123"></a>00123 bIsWordPerfectFile(FILE *pFile) -<a name="l00124"></a>00124 { -<a name="l00125"></a>00125 <span class="keyword">static</span> UCHAR aucBytes[] = -<a name="l00126"></a>00126 { 0xff, <span class="charliteral">'W'</span>, <span class="charliteral">'P'</span>, <span class="charliteral">'C'</span> }; -<a name="l00127"></a>00127 -<a name="l00128"></a>00128 DBG_MSG(<span class="stringliteral">"bIsWordPerfectFile"</span>); -<a name="l00129"></a>00129 -<a name="l00130"></a>00130 <span class="keywordflow">return</span> bCheckBytes(pFile, aucBytes, elementsof(aucBytes)); -<a name="l00131"></a>00131 } <span class="comment">/* end of bIsWordPerfectFile */</span> -<a name="l00132"></a>00132 -<a name="l00133"></a>00133 <span class="comment">/*</span> -<a name="l00134"></a>00134 <span class="comment"> * This function checks whether the given file is or is not a "Win Word 1 or 2"</span> -<a name="l00135"></a>00135 <span class="comment"> * document</span> -<a name="l00136"></a>00136 <span class="comment"> */</span> -<a name="l00137"></a>00137 BOOL -<a name="l00138"></a>00138 bIsWinWord12File(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00139"></a>00139 { -<a name="l00140"></a>00140 <span class="keyword">static</span> UCHAR aucBytes[2][4] = { -<a name="l00141"></a>00141 { 0x9b, 0xa5, 0x21, 0x00 }, <span class="comment">/* Win Word 1.x */</span> -<a name="l00142"></a>00142 { 0xdb, 0xa5, 0x2d, 0x00 }, <span class="comment">/* Win Word 2.0 */</span> -<a name="l00143"></a>00143 }; -<a name="l00144"></a>00144 <span class="keywordtype">int</span> iIndex; -<a name="l00145"></a>00145 -<a name="l00146"></a>00146 DBG_MSG(<span class="stringliteral">"bIsWinWord12File"</span>); -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="keywordflow">if</span> (pFile == NULL || lFilesize < 0) { -<a name="l00149"></a>00149 DBG_MSG(<span class="stringliteral">"No proper file given"</span>); -<a name="l00150"></a>00150 <span class="keywordflow">return</span> FALSE; -<a name="l00151"></a>00151 } -<a name="l00152"></a>00152 <span class="keywordflow">if</span> (lFilesize < 384) { -<a name="l00153"></a>00153 DBG_MSG(<span class="stringliteral">"This file is too small to be a Word document"</span>); -<a name="l00154"></a>00154 <span class="keywordflow">return</span> FALSE; -<a name="l00155"></a>00155 } -<a name="l00156"></a>00156 -<a name="l00157"></a>00157 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)elementsof(aucBytes); iIndex++) { -<a name="l00158"></a>00158 <span class="keywordflow">if</span> (bCheckBytes(pFile, -<a name="l00159"></a>00159 aucBytes[iIndex], -<a name="l00160"></a>00160 elementsof(aucBytes[iIndex]))) { -<a name="l00161"></a>00161 <span class="keywordflow">return</span> TRUE; -<a name="l00162"></a>00162 } -<a name="l00163"></a>00163 } -<a name="l00164"></a>00164 <span class="keywordflow">return</span> FALSE; -<a name="l00165"></a>00165 } <span class="comment">/* end of bIsWinWord12File */</span> -<a name="l00166"></a>00166 -<a name="l00167"></a>00167 <span class="comment">/*</span> -<a name="l00168"></a>00168 <span class="comment"> * This function checks whether the given file is or is not a "Mac Word 4 or 5"</span> -<a name="l00169"></a>00169 <span class="comment"> * document</span> -<a name="l00170"></a>00170 <span class="comment"> */</span> -<a name="l00171"></a>00171 BOOL -<a name="l00172"></a>00172 bIsMacWord45File(FILE *pFile) -<a name="l00173"></a>00173 { -<a name="l00174"></a>00174 <span class="keyword">static</span> UCHAR aucBytes[2][6] = { -<a name="l00175"></a>00175 { 0xfe, 0x37, 0x00, 0x1c, 0x00, 0x00 }, <span class="comment">/* Mac Word 4 */</span> -<a name="l00176"></a>00176 { 0xfe, 0x37, 0x00, 0x23, 0x00, 0x00 }, <span class="comment">/* Mac Word 5 */</span> -<a name="l00177"></a>00177 }; -<a name="l00178"></a>00178 <span class="keywordtype">int</span> iIndex; -<a name="l00179"></a>00179 -<a name="l00180"></a>00180 DBG_MSG(<span class="stringliteral">"bIsMacWord45File"</span>); -<a name="l00181"></a>00181 -<a name="l00182"></a>00182 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)elementsof(aucBytes); iIndex++) { -<a name="l00183"></a>00183 <span class="keywordflow">if</span> (bCheckBytes(pFile, -<a name="l00184"></a>00184 aucBytes[iIndex], -<a name="l00185"></a>00185 elementsof(aucBytes[iIndex]))) { -<a name="l00186"></a>00186 <span class="keywordflow">return</span> TRUE; -<a name="l00187"></a>00187 } -<a name="l00188"></a>00188 } -<a name="l00189"></a>00189 <span class="keywordflow">return</span> FALSE; -<a name="l00190"></a>00190 } <span class="comment">/* end of bIsMacWord45File */</span> -<a name="l00191"></a>00191 -<a name="l00192"></a>00192 <span class="comment">/*</span> -<a name="l00193"></a>00193 <span class="comment"> * iGuessVersionNumber - guess the Word version number from first few bytes</span> -<a name="l00194"></a>00194 <span class="comment"> *</span> -<a name="l00195"></a>00195 <span class="comment"> * Returns the guessed version number or -1 when no guess it possible</span> -<a name="l00196"></a>00196 <span class="comment"> */</span> -<a name="l00197"></a>00197 <span class="keywordtype">int</span> -<a name="l00198"></a>00198 iGuessVersionNumber(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00199"></a>00199 { -<a name="l00200"></a>00200 <span class="keywordflow">if</span>(bIsWordForDosFile(pFile, lFilesize)) { -<a name="l00201"></a>00201 <span class="keywordflow">return</span> 0; -<a name="l00202"></a>00202 } -<a name="l00203"></a>00203 <span class="keywordflow">if</span> (bIsWinWord12File(pFile, lFilesize)) { -<a name="l00204"></a>00204 <span class="keywordflow">return</span> 2; -<a name="l00205"></a>00205 } -<a name="l00206"></a>00206 <span class="keywordflow">if</span> (bIsMacWord45File(pFile)) { -<a name="l00207"></a>00207 <span class="keywordflow">return</span> 5; -<a name="l00208"></a>00208 } -<a name="l00209"></a>00209 <span class="keywordflow">if</span> (bIsWordFileWithOLE(pFile, lFilesize)) { -<a name="l00210"></a>00210 <span class="keywordflow">return</span> 6; -<a name="l00211"></a>00211 } -<a name="l00212"></a>00212 <span class="keywordflow">return</span> -1; -<a name="l00213"></a>00213 } <span class="comment">/* end of iGuessVersionNumber */</span> -<a name="l00214"></a>00214 -<a name="l00215"></a>00215 <span class="comment">/*</span> -<a name="l00216"></a>00216 <span class="comment"> * iGetVersionNumber - get the Word version number from the header</span> -<a name="l00217"></a>00217 <span class="comment"> *</span> -<a name="l00218"></a>00218 <span class="comment"> * Returns the version number or -1 when unknown</span> -<a name="l00219"></a>00219 <span class="comment"> */</span> -<a name="l00220"></a>00220 <span class="keywordtype">int</span> -<a name="l00221"></a>00221 iGetVersionNumber(<span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00222"></a>00222 { -<a name="l00223"></a>00223 USHORT usFib, usChse; -<a name="l00224"></a>00224 -<a name="l00225"></a>00225 usFib = usGetWord(0x02, aucHeader); -<a name="l00226"></a>00226 <span class="keywordflow">if</span> (usFib >= 0x1000) { -<a name="l00227"></a>00227 <span class="comment">/* To big: must be MacWord using Big Endian */</span> -<a name="l00228"></a>00228 DBG_HEX(usFib); -<a name="l00229"></a>00229 usFib = usGetWordBE(0x02, aucHeader); -<a name="l00230"></a>00230 } -<a name="l00231"></a>00231 DBG_DEC(usFib); -<a name="l00232"></a>00232 bOldMacFile = FALSE; -<a name="l00233"></a>00233 <span class="keywordflow">switch</span> (usFib) { -<a name="l00234"></a>00234 <span class="keywordflow">case</span> 0: -<a name="l00235"></a>00235 DBG_MSG(<span class="stringliteral">"Word for DOS"</span>); -<a name="l00236"></a>00236 <span class="keywordflow">return</span> 0; -<a name="l00237"></a>00237 <span class="keywordflow">case</span> 28: -<a name="l00238"></a>00238 DBG_MSG(<span class="stringliteral">"Word 4 for Macintosh"</span>); -<a name="l00239"></a>00239 bOldMacFile = TRUE; -<a name="l00240"></a>00240 <span class="keywordflow">return</span> 4; -<a name="l00241"></a>00241 <span class="keywordflow">case</span> 33: -<a name="l00242"></a>00242 DBG_MSG(<span class="stringliteral">"Word 1.x for Windows"</span>); -<a name="l00243"></a>00243 <span class="keywordflow">return</span> 1; -<a name="l00244"></a>00244 <span class="keywordflow">case</span> 35: -<a name="l00245"></a>00245 DBG_MSG(<span class="stringliteral">"Word 5 for Macintosh"</span>); -<a name="l00246"></a>00246 bOldMacFile = TRUE; -<a name="l00247"></a>00247 <span class="keywordflow">return</span> 5; -<a name="l00248"></a>00248 <span class="keywordflow">case</span> 45: -<a name="l00249"></a>00249 DBG_MSG(<span class="stringliteral">"Word 2 for Windows"</span>); -<a name="l00250"></a>00250 <span class="keywordflow">return</span> 2; -<a name="l00251"></a>00251 <span class="keywordflow">case</span> 101: -<a name="l00252"></a>00252 <span class="keywordflow">case</span> 102: -<a name="l00253"></a>00253 DBG_MSG(<span class="stringliteral">"Word 6 for Windows"</span>); -<a name="l00254"></a>00254 <span class="keywordflow">return</span> 6; -<a name="l00255"></a>00255 <span class="keywordflow">case</span> 103: -<a name="l00256"></a>00256 <span class="keywordflow">case</span> 104: -<a name="l00257"></a>00257 usChse = usGetWord(0x14, aucHeader); -<a name="l00258"></a>00258 DBG_DEC(usChse); -<a name="l00259"></a>00259 <span class="keywordflow">switch</span> (usChse) { -<a name="l00260"></a>00260 <span class="keywordflow">case</span> 0: -<a name="l00261"></a>00261 DBG_MSG(<span class="stringliteral">"Word 7 for Win95"</span>); -<a name="l00262"></a>00262 <span class="keywordflow">return</span> 7; -<a name="l00263"></a>00263 <span class="keywordflow">case</span> 256: -<a name="l00264"></a>00264 DBG_MSG(<span class="stringliteral">"Word 6 for Macintosh"</span>); -<a name="l00265"></a>00265 bOldMacFile = TRUE; -<a name="l00266"></a>00266 <span class="keywordflow">return</span> 6; -<a name="l00267"></a>00267 <span class="keywordflow">default</span>: -<a name="l00268"></a>00268 DBG_FIXME(); -<a name="l00269"></a>00269 <span class="keywordflow">if</span> ((<span class="keywordtype">int</span>)ucGetByte(0x05, aucHeader) == 0xe0) { -<a name="l00270"></a>00270 DBG_MSG(<span class="stringliteral">"Word 7 for Win95"</span>); -<a name="l00271"></a>00271 <span class="keywordflow">return</span> 7; -<a name="l00272"></a>00272 } -<a name="l00273"></a>00273 DBG_MSG(<span class="stringliteral">"Word 6 for Macintosh"</span>); -<a name="l00274"></a>00274 bOldMacFile = TRUE; -<a name="l00275"></a>00275 <span class="keywordflow">return</span> 6; -<a name="l00276"></a>00276 } -<a name="l00277"></a>00277 <span class="keywordflow">default</span>: -<a name="l00278"></a>00278 usChse = usGetWord(0x14, aucHeader); -<a name="l00279"></a>00279 DBG_DEC(usChse); -<a name="l00280"></a>00280 <span class="keywordflow">if</span> (usFib < 192) { -<a name="l00281"></a>00281 <span class="comment">/* Unknown or unsupported version of Word */</span> -<a name="l00282"></a>00282 DBG_DEC(usFib); -<a name="l00283"></a>00283 <span class="keywordflow">return</span> -1; -<a name="l00284"></a>00284 } -<a name="l00285"></a>00285 DBG_MSG_C(usChse != 256, <span class="stringliteral">"Word97 for Win95/98/NT"</span>); -<a name="l00286"></a>00286 DBG_MSG_C(usChse == 256, <span class="stringliteral">"Word98 for Macintosh"</span>); -<a name="l00287"></a>00287 <span class="keywordflow">return</span> 8; -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 } <span class="comment">/* end of iGetVersionNumber */</span> -<a name="l00290"></a>00290 -<a name="l00291"></a>00291 <span class="comment">/*</span> -<a name="l00292"></a>00292 <span class="comment"> * TRUE if the current file was made by Word version 6 or older on an</span> -<a name="l00293"></a>00293 <span class="comment"> * Apple Macintosh, otherwise FALSE.</span> -<a name="l00294"></a>00294 <span class="comment"> * This function hides the methode of how to find out from the rest of the</span> -<a name="l00295"></a>00295 <span class="comment"> * program.</span> -<a name="l00296"></a>00296 <span class="comment"> */</span> -<a name="l00297"></a>00297 BOOL -<a name="l00298"></a>00298 bIsOldMacFile(<span class="keywordtype">void</span>) -<a name="l00299"></a>00299 { -<a name="l00300"></a>00300 <span class="keywordflow">return</span> bOldMacFile; -<a name="l00301"></a>00301 } <span class="comment">/* end of bIsOldMacFile */</span> -<a name="l00302"></a>00302 -<a name="l00303"></a>00303 <span class="comment">/*</span> -<a name="l00304"></a>00304 <span class="comment"> * iInitDocument - initialize a document</span> -<a name="l00305"></a>00305 <span class="comment"> *</span> -<a name="l00306"></a>00306 <span class="comment"> * Returns the version of Word that made the document or -1</span> -<a name="l00307"></a>00307 <span class="comment"> */</span> -<a name="l00308"></a>00308 <span class="keywordtype">int</span> -<a name="l00309"></a>00309 iInitDocument(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00310"></a>00310 { -<a name="l00311"></a>00311 <span class="keywordtype">int</span> iGuess, iWordVersion; -<a name="l00312"></a>00312 -<a name="l00313"></a>00313 iGuess = iGuessVersionNumber(pFile, lFilesize); -<a name="l00314"></a>00314 <span class="keywordflow">switch</span> (iGuess) { -<a name="l00315"></a>00315 <span class="keywordflow">case</span> 0: -<a name="l00316"></a>00316 iWordVersion = iInitDocumentDOS(pFile, lFilesize); -<a name="l00317"></a>00317 <span class="keywordflow">break</span>; -<a name="l00318"></a>00318 <span class="keywordflow">case</span> 2: -<a name="l00319"></a>00319 iWordVersion = iInitDocumentWIN(pFile, lFilesize); -<a name="l00320"></a>00320 <span class="keywordflow">break</span>; -<a name="l00321"></a>00321 <span class="keywordflow">case</span> 5: -<a name="l00322"></a>00322 iWordVersion = iInitDocumentMAC(pFile, lFilesize); -<a name="l00323"></a>00323 <span class="keywordflow">break</span>; -<a name="l00324"></a>00324 <span class="keywordflow">case</span> 6: -<a name="l00325"></a>00325 iWordVersion = iInitDocumentOLE(pFile, lFilesize); -<a name="l00326"></a>00326 <span class="keywordflow">break</span>; -<a name="l00327"></a>00327 <span class="keywordflow">default</span>: -<a name="l00328"></a>00328 DBG_DEC(iGuess); -<a name="l00329"></a>00329 iWordVersion = -1; -<a name="l00330"></a>00330 <span class="keywordflow">break</span>; -<a name="l00331"></a>00331 } -<a name="l00332"></a>00332 <span class="keywordflow">return</span> iWordVersion; -<a name="l00333"></a>00333 } <span class="comment">/* end of iInitDocument */</span> -<a name="l00334"></a>00334 -<a name="l00335"></a>00335 <span class="comment">/*</span> -<a name="l00336"></a>00336 <span class="comment"> * vFreeDocument - free a document by free-ing its parts</span> -<a name="l00337"></a>00337 <span class="comment"> */</span> -<a name="l00338"></a>00338 <span class="keywordtype">void</span> -<a name="l00339"></a>00339 vFreeDocument(<span class="keywordtype">void</span>) -<a name="l00340"></a>00340 { -<a name="l00341"></a>00341 DBG_MSG(<span class="stringliteral">"vFreeDocument"</span>); -<a name="l00342"></a>00342 -<a name="l00343"></a>00343 <span class="comment">/* Free the memory */</span> -<a name="l00344"></a>00344 vDestroyTextBlockList(); -<a name="l00345"></a>00345 vDestroyDataBlockList(); -<a name="l00346"></a>00346 vDestroyListInfoList(); -<a name="l00347"></a>00347 vDestroyRowInfoList(); -<a name="l00348"></a>00348 vDestroyStyleInfoList(); -<a name="l00349"></a>00349 vDestroyFontInfoList(); -<a name="l00350"></a>00350 vDestroyStylesheetList(); -<a name="l00351"></a>00351 vDestroyPictInfoList(); -<a name="l00352"></a>00352 vDestroyDocumentInfoList(); -<a name="l00353"></a>00353 vDestroySectionInfoList(); -<a name="l00354"></a>00354 vDestroyHdrFtrInfoList(); -<a name="l00355"></a>00355 vDestroyPropModList(); -<a name="l00356"></a>00356 vDestroyNotesInfoLists(); -<a name="l00357"></a>00357 vDestroyFontTable(); -<a name="l00358"></a>00358 vDestroySummaryInfo(); -<a name="l00359"></a>00359 } <span class="comment">/* end of vFreeDocument */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordmac_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/wordmac.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/wordmac.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordmac.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2004 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Deal with the MAC internals of a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="comment">/*</span> -<a name="l00013"></a>00013 <span class="comment"> * bGetDocumentText - make a list of the text blocks of a Word document</span> -<a name="l00014"></a>00014 <span class="comment"> *</span> -<a name="l00015"></a>00015 <span class="comment"> * Return TRUE when succesful, otherwise FALSE</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> BOOL -<a name="l00018"></a>00018 bGetDocumentText(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00019"></a>00019 { -<a name="l00020"></a>00020 text_block_type tTextBlock; -<a name="l00021"></a>00021 ULONG ulBeginOfText, ulEndOfText; -<a name="l00022"></a>00022 ULONG ulTextLen; -<a name="l00023"></a>00023 UCHAR ucDocStatus; -<a name="l00024"></a>00024 BOOL bFastSaved; -<a name="l00025"></a>00025 -<a name="l00026"></a>00026 fail(pFile == NULL); -<a name="l00027"></a>00027 fail(aucHeader == NULL); -<a name="l00028"></a>00028 -<a name="l00029"></a>00029 DBG_MSG(<span class="stringliteral">"bGetDocumentText"</span>); -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 NO_DBG_PRINT_BLOCK(aucHeader, 0x20); -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00034"></a>00034 ucDocStatus = ucGetByte(0x0a, aucHeader); -<a name="l00035"></a>00035 DBG_HEX(ucDocStatus); -<a name="l00036"></a>00036 bFastSaved = (ucDocStatus & BIT(5)) != 0; -<a name="l00037"></a>00037 DBG_MSG_C(bFastSaved, <span class="stringliteral">"This document is Fast Saved"</span>); -<a name="l00038"></a>00038 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00039"></a>00039 werr(0, <span class="stringliteral">"MacWord: fast saved documents are not supported yet"</span>); -<a name="l00040"></a>00040 <span class="keywordflow">return</span> FALSE; -<a name="l00041"></a>00041 } -<a name="l00042"></a>00042 -<a name="l00043"></a>00043 <span class="comment">/* Get length information */</span> -<a name="l00044"></a>00044 ulBeginOfText = ulGetLongBE(0x14, aucHeader); -<a name="l00045"></a>00045 DBG_HEX(ulBeginOfText); -<a name="l00046"></a>00046 ulEndOfText = ulGetLongBE(0x18, aucHeader); -<a name="l00047"></a>00047 DBG_HEX(ulEndOfText); -<a name="l00048"></a>00048 ulTextLen = ulEndOfText - ulBeginOfText; -<a name="l00049"></a>00049 DBG_DEC(ulTextLen); -<a name="l00050"></a>00050 tTextBlock.ulFileOffset = ulBeginOfText; -<a name="l00051"></a>00051 tTextBlock.ulCharPos = ulBeginOfText; -<a name="l00052"></a>00052 tTextBlock.ulLength = ulTextLen; -<a name="l00053"></a>00053 tTextBlock.bUsesUnicode = FALSE; -<a name="l00054"></a>00054 tTextBlock.usPropMod = IGNORE_PROPMOD; -<a name="l00055"></a>00055 <span class="keywordflow">if</span> (!bAdd2TextBlockList(&tTextBlock)) { -<a name="l00056"></a>00056 DBG_HEX(tTextBlock.ulFileOffset); -<a name="l00057"></a>00057 DBG_HEX(tTextBlock.ulCharPos); -<a name="l00058"></a>00058 DBG_DEC(tTextBlock.ulLength); -<a name="l00059"></a>00059 DBG_DEC(tTextBlock.bUsesUnicode); -<a name="l00060"></a>00060 DBG_DEC(tTextBlock.usPropMod); -<a name="l00061"></a>00061 <span class="keywordflow">return</span> FALSE; -<a name="l00062"></a>00062 } -<a name="l00063"></a>00063 <span class="keywordflow">return</span> TRUE; -<a name="l00064"></a>00064 } <span class="comment">/* end of bGetDocumentText */</span> -<a name="l00065"></a>00065 -<a name="l00066"></a>00066 <span class="comment">/*</span> -<a name="l00067"></a>00067 <span class="comment"> * iInitDocumentMAC - initialize an MAC document</span> -<a name="l00068"></a>00068 <span class="comment"> *</span> -<a name="l00069"></a>00069 <span class="comment"> * Returns the version of Word that made the document or -1</span> -<a name="l00070"></a>00070 <span class="comment"> */</span> -<a name="l00071"></a>00071 <span class="keywordtype">int</span> -<a name="l00072"></a>00072 iInitDocumentMAC(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00073"></a>00073 { -<a name="l00074"></a>00074 <span class="keywordtype">int</span> iWordVersion; -<a name="l00075"></a>00075 BOOL bSuccess; -<a name="l00076"></a>00076 USHORT usIdent; -<a name="l00077"></a>00077 UCHAR aucHeader[256]; -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 fail(pFile == NULL); -<a name="l00080"></a>00080 -<a name="l00081"></a>00081 <span class="keywordflow">if</span> (lFilesize < 256) { -<a name="l00082"></a>00082 <span class="keywordflow">return</span> -1; -<a name="l00083"></a>00083 } -<a name="l00084"></a>00084 -<a name="l00085"></a>00085 <span class="comment">/* Read the headerblock */</span> -<a name="l00086"></a>00086 <span class="keywordflow">if</span> (!bReadBytes(aucHeader, 256, 0x00, pFile)) { -<a name="l00087"></a>00087 <span class="keywordflow">return</span> -1; -<a name="l00088"></a>00088 } -<a name="l00089"></a>00089 <span class="comment">/* Get the "magic number" from the header */</span> -<a name="l00090"></a>00090 usIdent = usGetWord(0x00, aucHeader); -<a name="l00091"></a>00091 DBG_HEX(usIdent); -<a name="l00092"></a>00092 fail(usIdent != 0x37fe); <span class="comment">/* MacWord 4 and 5 */</span> -<a name="l00093"></a>00093 iWordVersion = iGetVersionNumber(aucHeader); -<a name="l00094"></a>00094 <span class="keywordflow">if</span> (iWordVersion != 4 && iWordVersion != 5) { -<a name="l00095"></a>00095 werr(0, <span class="stringliteral">"This file is not from ''Mac Word 4 or 5'."</span>); -<a name="l00096"></a>00096 <span class="keywordflow">return</span> -1; -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 bSuccess = bGetDocumentText(pFile, aucHeader); -<a name="l00099"></a>00099 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00100"></a>00100 vGetPropertyInfo(pFile, NULL, -<a name="l00101"></a>00101 NULL, 0, NULL, 0, -<a name="l00102"></a>00102 aucHeader, iWordVersion); -<a name="l00103"></a>00103 vSetDefaultTabWidth(pFile, NULL, -<a name="l00104"></a>00104 NULL, 0, NULL, 0, -<a name="l00105"></a>00105 aucHeader, iWordVersion); -<a name="l00106"></a>00106 } -<a name="l00107"></a>00107 <span class="keywordflow">return</span> bSuccess ? iWordVersion : -1; -<a name="l00108"></a>00108 } <span class="comment">/* end of iInitDocumentMAC */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordole_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,820 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/wordole.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/wordole.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordole.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Deal with the OLE internals of a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <string.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="comment">/* Private type for Property Set Storage entries */</span> -<a name="l00013"></a>00013 <span class="keyword">typedef</span> <span class="keyword">struct </span>pps_entry_tag { -<a name="l00014"></a>00014 ULONG ulNext; -<a name="l00015"></a>00015 ULONG ulPrevious; -<a name="l00016"></a>00016 ULONG ulDir; -<a name="l00017"></a>00017 ULONG ulSB; -<a name="l00018"></a>00018 ULONG ulSize; -<a name="l00019"></a>00019 <span class="keywordtype">int</span> iLevel; -<a name="l00020"></a>00020 <span class="keywordtype">char</span> szName[32]; -<a name="l00021"></a>00021 UCHAR ucType; -<a name="l00022"></a>00022 } pps_entry_type; -<a name="l00023"></a>00023 -<a name="l00024"></a>00024 <span class="comment">/* Show that a PPS number or index should not be used */</span> -<a name="l00025"></a>00025 <span class="preprocessor">#define PPS_NUMBER_INVALID 0xffffffffUL</span> -<a name="l00026"></a>00026 <span class="preprocessor"></span> -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 <span class="comment">/* Macro to make sure all such statements will be identical */</span> -<a name="l00029"></a>00029 <span class="preprocessor">#define FREE_ALL() \</span> -<a name="l00030"></a>00030 <span class="preprocessor"> do {\</span> -<a name="l00031"></a>00031 <span class="preprocessor"> vDestroySmallBlockList();\</span> -<a name="l00032"></a>00032 <span class="preprocessor"> aulRootList = xfree(aulRootList);\</span> -<a name="l00033"></a>00033 <span class="preprocessor"> aulSbdList = xfree(aulSbdList);\</span> -<a name="l00034"></a>00034 <span class="preprocessor"> aulBbdList = xfree(aulBbdList);\</span> -<a name="l00035"></a>00035 <span class="preprocessor"> aulSBD = xfree(aulSBD);\</span> -<a name="l00036"></a>00036 <span class="preprocessor"> aulBBD = xfree(aulBBD);\</span> -<a name="l00037"></a>00037 <span class="preprocessor"> } while(0)</span> -<a name="l00038"></a>00038 <span class="preprocessor"></span> -<a name="l00039"></a>00039 -<a name="l00040"></a>00040 <span class="comment">/*</span> -<a name="l00041"></a>00041 <span class="comment"> * ulReadLong - read four bytes from the given file and offset</span> -<a name="l00042"></a>00042 <span class="comment"> */</span> -<a name="l00043"></a>00043 <span class="keyword">static</span> ULONG -<a name="l00044"></a>00044 ulReadLong(FILE *pFile, ULONG ulOffset) -<a name="l00045"></a>00045 { -<a name="l00046"></a>00046 UCHAR aucBytes[4]; -<a name="l00047"></a>00047 -<a name="l00048"></a>00048 fail(pFile == NULL); -<a name="l00049"></a>00049 -<a name="l00050"></a>00050 <span class="keywordflow">if</span> (!bReadBytes(aucBytes, 4, ulOffset, pFile)) { -<a name="l00051"></a>00051 werr(1, <span class="stringliteral">"Read long 0x%lx not possible"</span>, ulOffset); -<a name="l00052"></a>00052 } -<a name="l00053"></a>00053 <span class="keywordflow">return</span> ulGetLong(0, aucBytes); -<a name="l00054"></a>00054 } <span class="comment">/* end of ulReadLong */</span> -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 <span class="comment">/*</span> -<a name="l00057"></a>00057 <span class="comment"> * vName2String - turn the name into a proper string.</span> -<a name="l00058"></a>00058 <span class="comment"> */</span> -<a name="l00059"></a>00059 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00060"></a>00060 vName2String(<span class="keywordtype">char</span> *szName, <span class="keyword">const</span> UCHAR *aucBytes, <span class="keywordtype">size_t</span> tNameSize) -<a name="l00061"></a>00061 { -<a name="l00062"></a>00062 <span class="keywordtype">char</span> *pcChar; -<a name="l00063"></a>00063 <span class="keywordtype">size_t</span> tIndex; -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 fail(aucBytes == NULL || szName == NULL); -<a name="l00066"></a>00066 -<a name="l00067"></a>00067 <span class="keywordflow">if</span> (tNameSize < 2) { -<a name="l00068"></a>00068 szName[0] = <span class="charliteral">'\0'</span>; -<a name="l00069"></a>00069 <span class="keywordflow">return</span>; -<a name="l00070"></a>00070 } -<a name="l00071"></a>00071 <span class="keywordflow">for</span> (tIndex = 0, pcChar = szName; -<a name="l00072"></a>00072 tIndex < 2 * tNameSize; -<a name="l00073"></a>00073 tIndex += 2, pcChar++) { -<a name="l00074"></a>00074 *pcChar = (char)aucBytes[tIndex]; -<a name="l00075"></a>00075 } -<a name="l00076"></a>00076 szName[tNameSize - 1] = <span class="charliteral">'\0'</span>; -<a name="l00077"></a>00077 } <span class="comment">/* end of vName2String */</span> -<a name="l00078"></a>00078 -<a name="l00079"></a>00079 <span class="comment">/*</span> -<a name="l00080"></a>00080 <span class="comment"> * tReadBlockIndices - read the Big/Small Block Depot indices</span> -<a name="l00081"></a>00081 <span class="comment"> *</span> -<a name="l00082"></a>00082 <span class="comment"> * Returns the number of indices read</span> -<a name="l00083"></a>00083 <span class="comment"> */</span> -<a name="l00084"></a>00084 <span class="keyword">static</span> <span class="keywordtype">size_t</span> -<a name="l00085"></a>00085 tReadBlockIndices(FILE *pFile, ULONG *aulBlockDepot, -<a name="l00086"></a>00086 <span class="keywordtype">size_t</span> tMaxRec, ULONG ulOffset) -<a name="l00087"></a>00087 { -<a name="l00088"></a>00088 <span class="keywordtype">size_t</span> tDone; -<a name="l00089"></a>00089 <span class="keywordtype">int</span> iIndex; -<a name="l00090"></a>00090 UCHAR aucBytes[BIG_BLOCK_SIZE]; -<a name="l00091"></a>00091 -<a name="l00092"></a>00092 fail(pFile == NULL || aulBlockDepot == NULL); -<a name="l00093"></a>00093 fail(tMaxRec == 0); -<a name="l00094"></a>00094 -<a name="l00095"></a>00095 <span class="comment">/* Read a big block with BBD or SBD indices */</span> -<a name="l00096"></a>00096 <span class="keywordflow">if</span> (!bReadBytes(aucBytes, BIG_BLOCK_SIZE, ulOffset, pFile)) { -<a name="l00097"></a>00097 werr(0, <span class="stringliteral">"Reading big block from 0x%lx is not possible"</span>, -<a name="l00098"></a>00098 ulOffset); -<a name="l00099"></a>00099 <span class="keywordflow">return</span> 0; -<a name="l00100"></a>00100 } -<a name="l00101"></a>00101 <span class="comment">/* Split the big block into indices, an index is four bytes */</span> -<a name="l00102"></a>00102 tDone = min(tMaxRec, (<span class="keywordtype">size_t</span>)BIG_BLOCK_SIZE / 4); -<a name="l00103"></a>00103 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tDone; iIndex++) { -<a name="l00104"></a>00104 aulBlockDepot[iIndex] = ulGetLong(4 * iIndex, aucBytes); -<a name="l00105"></a>00105 NO_DBG_DEC(aulBlockDepot[iIndex]); -<a name="l00106"></a>00106 } -<a name="l00107"></a>00107 <span class="keywordflow">return</span> tDone; -<a name="l00108"></a>00108 } <span class="comment">/* end of tReadBlockIndices */</span> -<a name="l00109"></a>00109 -<a name="l00110"></a>00110 <span class="comment">/*</span> -<a name="l00111"></a>00111 <span class="comment"> * bGetBBD - get the Big Block Depot indices from the index-blocks</span> -<a name="l00112"></a>00112 <span class="comment"> */</span> -<a name="l00113"></a>00113 <span class="keyword">static</span> BOOL -<a name="l00114"></a>00114 bGetBBD(FILE *pFile, <span class="keyword">const</span> ULONG *aulDepot, <span class="keywordtype">size_t</span> tDepotLen, -<a name="l00115"></a>00115 ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen) -<a name="l00116"></a>00116 { -<a name="l00117"></a>00117 ULONG ulBegin; -<a name="l00118"></a>00118 <span class="keywordtype">size_t</span> tToGo, tDone; -<a name="l00119"></a>00119 <span class="keywordtype">int</span> iIndex; -<a name="l00120"></a>00120 -<a name="l00121"></a>00121 fail(pFile == NULL || aulDepot == NULL || aulBBD == NULL); -<a name="l00122"></a>00122 -<a name="l00123"></a>00123 DBG_MSG(<span class="stringliteral">"bGetBBD"</span>); -<a name="l00124"></a>00124 -<a name="l00125"></a>00125 tToGo = tBBDLen; -<a name="l00126"></a>00126 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) { -<a name="l00127"></a>00127 ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; -<a name="l00128"></a>00128 NO_DBG_HEX(ulBegin); -<a name="l00129"></a>00129 tDone = tReadBlockIndices(pFile, aulBBD, tToGo, ulBegin); -<a name="l00130"></a>00130 fail(tDone > tToGo); -<a name="l00131"></a>00131 <span class="keywordflow">if</span> (tDone == 0) { -<a name="l00132"></a>00132 <span class="keywordflow">return</span> FALSE; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 aulBBD += tDone; -<a name="l00135"></a>00135 tToGo -= tDone; -<a name="l00136"></a>00136 } -<a name="l00137"></a>00137 <span class="keywordflow">return</span> tToGo == 0; -<a name="l00138"></a>00138 } <span class="comment">/* end of bGetBBD */</span> -<a name="l00139"></a>00139 -<a name="l00140"></a>00140 <span class="comment">/*</span> -<a name="l00141"></a>00141 <span class="comment"> * bGetSBD - get the Small Block Depot indices from the index-blocks</span> -<a name="l00142"></a>00142 <span class="comment"> */</span> -<a name="l00143"></a>00143 <span class="keyword">static</span> BOOL -<a name="l00144"></a>00144 bGetSBD(FILE *pFile, <span class="keyword">const</span> ULONG *aulDepot, <span class="keywordtype">size_t</span> tDepotLen, -<a name="l00145"></a>00145 ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen) -<a name="l00146"></a>00146 { -<a name="l00147"></a>00147 ULONG ulBegin; -<a name="l00148"></a>00148 <span class="keywordtype">size_t</span> tToGo, tDone; -<a name="l00149"></a>00149 <span class="keywordtype">int</span> iIndex; -<a name="l00150"></a>00150 -<a name="l00151"></a>00151 fail(pFile == NULL || aulDepot == NULL || aulSBD == NULL); -<a name="l00152"></a>00152 -<a name="l00153"></a>00153 DBG_MSG(<span class="stringliteral">"bGetSBD"</span>); -<a name="l00154"></a>00154 -<a name="l00155"></a>00155 tToGo = tSBDLen; -<a name="l00156"></a>00156 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tDepotLen && tToGo != 0; iIndex++) { -<a name="l00157"></a>00157 fail(aulDepot[iIndex] >= ULONG_MAX / BIG_BLOCK_SIZE); -<a name="l00158"></a>00158 ulBegin = (aulDepot[iIndex] + 1) * BIG_BLOCK_SIZE; -<a name="l00159"></a>00159 NO_DBG_HEX(ulBegin); -<a name="l00160"></a>00160 tDone = tReadBlockIndices(pFile, aulSBD, tToGo, ulBegin); -<a name="l00161"></a>00161 fail(tDone > tToGo); -<a name="l00162"></a>00162 <span class="keywordflow">if</span> (tDone == 0) { -<a name="l00163"></a>00163 <span class="keywordflow">return</span> FALSE; -<a name="l00164"></a>00164 } -<a name="l00165"></a>00165 aulSBD += tDone; -<a name="l00166"></a>00166 tToGo -= tDone; -<a name="l00167"></a>00167 } -<a name="l00168"></a>00168 <span class="keywordflow">return</span> tToGo == 0; -<a name="l00169"></a>00169 } <span class="comment">/* end of bGetSBD */</span> -<a name="l00170"></a>00170 -<a name="l00171"></a>00171 <span class="comment">/*</span> -<a name="l00172"></a>00172 <span class="comment"> * vComputePPSlevels - compute the levels of the Property Set Storage entries</span> -<a name="l00173"></a>00173 <span class="comment"> */</span> -<a name="l00174"></a>00174 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00175"></a>00175 vComputePPSlevels(pps_entry_type *atPPSlist, pps_entry_type *pNode, -<a name="l00176"></a>00176 <span class="keywordtype">int</span> iLevel, <span class="keywordtype">int</span> iRecursionLevel) -<a name="l00177"></a>00177 { -<a name="l00178"></a>00178 fail(atPPSlist == NULL || pNode == NULL); -<a name="l00179"></a>00179 fail(iLevel < 0 || iRecursionLevel < 0); -<a name="l00180"></a>00180 -<a name="l00181"></a>00181 <span class="keywordflow">if</span> (iRecursionLevel > 25) { -<a name="l00182"></a>00182 <span class="comment">/* This removes the possibility of an infinite recursion */</span> -<a name="l00183"></a>00183 DBG_DEC(iRecursionLevel); -<a name="l00184"></a>00184 <span class="keywordflow">return</span>; -<a name="l00185"></a>00185 } -<a name="l00186"></a>00186 <span class="keywordflow">if</span> (pNode->iLevel <= iLevel) { -<a name="l00187"></a>00187 <span class="comment">/* Avoid entering a loop */</span> -<a name="l00188"></a>00188 DBG_DEC(iLevel); -<a name="l00189"></a>00189 DBG_DEC(pNode->iLevel); -<a name="l00190"></a>00190 <span class="keywordflow">return</span>; -<a name="l00191"></a>00191 } -<a name="l00192"></a>00192 -<a name="l00193"></a>00193 pNode->iLevel = iLevel; -<a name="l00194"></a>00194 -<a name="l00195"></a>00195 <span class="keywordflow">if</span> (pNode->ulDir != PPS_NUMBER_INVALID) { -<a name="l00196"></a>00196 vComputePPSlevels(atPPSlist, -<a name="l00197"></a>00197 &atPPSlist[pNode->ulDir], -<a name="l00198"></a>00198 iLevel + 1, -<a name="l00199"></a>00199 iRecursionLevel + 1); -<a name="l00200"></a>00200 } -<a name="l00201"></a>00201 <span class="keywordflow">if</span> (pNode->ulNext != PPS_NUMBER_INVALID) { -<a name="l00202"></a>00202 vComputePPSlevels(atPPSlist, -<a name="l00203"></a>00203 &atPPSlist[pNode->ulNext], -<a name="l00204"></a>00204 iLevel, -<a name="l00205"></a>00205 iRecursionLevel + 1); -<a name="l00206"></a>00206 } -<a name="l00207"></a>00207 <span class="keywordflow">if</span> (pNode->ulPrevious != PPS_NUMBER_INVALID) { -<a name="l00208"></a>00208 vComputePPSlevels(atPPSlist, -<a name="l00209"></a>00209 &atPPSlist[pNode->ulPrevious], -<a name="l00210"></a>00210 iLevel, -<a name="l00211"></a>00211 iRecursionLevel + 1); -<a name="l00212"></a>00212 } -<a name="l00213"></a>00213 } <span class="comment">/* end of vComputePPSlevels */</span> -<a name="l00214"></a>00214 -<a name="l00215"></a>00215 <span class="comment">/*</span> -<a name="l00216"></a>00216 <span class="comment"> * bGetPPS - search the Property Set Storage for three sets</span> -<a name="l00217"></a>00217 <span class="comment"> *</span> -<a name="l00218"></a>00218 <span class="comment"> * Return TRUE if the WordDocument PPS is found</span> -<a name="l00219"></a>00219 <span class="comment"> */</span> -<a name="l00220"></a>00220 <span class="keyword">static</span> BOOL -<a name="l00221"></a>00221 bGetPPS(FILE *pFile, -<a name="l00222"></a>00222 <span class="keyword">const</span> ULONG *aulRootList, <span class="keywordtype">size_t</span> tRootListLen, pps_info_type *pPPS) -<a name="l00223"></a>00223 { -<a name="l00224"></a>00224 pps_entry_type *atPPSlist; -<a name="l00225"></a>00225 ULONG ulBegin, ulOffset, ulTmp; -<a name="l00226"></a>00226 <span class="keywordtype">size_t</span> tNbrOfPPS, tNameSize; -<a name="l00227"></a>00227 <span class="keywordtype">int</span> iIndex, iStartBlock, iRootIndex; -<a name="l00228"></a>00228 BOOL bWord, bExcel; -<a name="l00229"></a>00229 UCHAR aucBytes[PROPERTY_SET_STORAGE_SIZE]; -<a name="l00230"></a>00230 -<a name="l00231"></a>00231 fail(pFile == NULL || aulRootList == NULL || pPPS == NULL); -<a name="l00232"></a>00232 -<a name="l00233"></a>00233 DBG_MSG(<span class="stringliteral">"bGetPPS"</span>); -<a name="l00234"></a>00234 -<a name="l00235"></a>00235 NO_DBG_DEC(tRootListLen); -<a name="l00236"></a>00236 -<a name="l00237"></a>00237 bWord = FALSE; -<a name="l00238"></a>00238 bExcel = FALSE; -<a name="l00239"></a>00239 (void)memset(pPPS, 0, <span class="keyword">sizeof</span>(*pPPS)); -<a name="l00240"></a>00240 -<a name="l00241"></a>00241 <span class="comment">/* Read and store all the Property Set Storage entries */</span> -<a name="l00242"></a>00242 -<a name="l00243"></a>00243 tNbrOfPPS = tRootListLen * BIG_BLOCK_SIZE / PROPERTY_SET_STORAGE_SIZE; -<a name="l00244"></a>00244 atPPSlist = xcalloc(tNbrOfPPS, <span class="keyword">sizeof</span>(pps_entry_type)); -<a name="l00245"></a>00245 iRootIndex = 0; -<a name="l00246"></a>00246 -<a name="l00247"></a>00247 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) { -<a name="l00248"></a>00248 ulTmp = (ULONG)iIndex * PROPERTY_SET_STORAGE_SIZE; -<a name="l00249"></a>00249 iStartBlock = (int)(ulTmp / BIG_BLOCK_SIZE); -<a name="l00250"></a>00250 ulOffset = ulTmp % BIG_BLOCK_SIZE; -<a name="l00251"></a>00251 ulBegin = (aulRootList[iStartBlock] + 1) * BIG_BLOCK_SIZE + -<a name="l00252"></a>00252 ulOffset; -<a name="l00253"></a>00253 NO_DBG_HEX(ulBegin); -<a name="l00254"></a>00254 <span class="keywordflow">if</span> (!bReadBytes(aucBytes, PROPERTY_SET_STORAGE_SIZE, -<a name="l00255"></a>00255 ulBegin, pFile)) { -<a name="l00256"></a>00256 werr(0, <span class="stringliteral">"Reading PPS %d is not possible"</span>, iIndex); -<a name="l00257"></a>00257 atPPSlist = xfree(atPPSlist); -<a name="l00258"></a>00258 <span class="keywordflow">return</span> FALSE; -<a name="l00259"></a>00259 } -<a name="l00260"></a>00260 tNameSize = (size_t)usGetWord(0x40, aucBytes); -<a name="l00261"></a>00261 tNameSize = (tNameSize + 1) / 2; -<a name="l00262"></a>00262 vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize); -<a name="l00263"></a>00263 atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes); -<a name="l00264"></a>00264 <span class="keywordflow">if</span> (atPPSlist[iIndex].ucType == 5) { -<a name="l00265"></a>00265 iRootIndex = iIndex; -<a name="l00266"></a>00266 } -<a name="l00267"></a>00267 atPPSlist[iIndex].ulPrevious = ulGetLong(0x44, aucBytes); -<a name="l00268"></a>00268 atPPSlist[iIndex].ulNext = ulGetLong(0x48, aucBytes); -<a name="l00269"></a>00269 atPPSlist[iIndex].ulDir = ulGetLong(0x4c, aucBytes); -<a name="l00270"></a>00270 atPPSlist[iIndex].ulSB = ulGetLong(0x74, aucBytes); -<a name="l00271"></a>00271 atPPSlist[iIndex].ulSize = ulGetLong(0x78, aucBytes); -<a name="l00272"></a>00272 atPPSlist[iIndex].iLevel = INT_MAX; -<a name="l00273"></a>00273 <span class="keywordflow">if</span> ((atPPSlist[iIndex].ulPrevious >= (ULONG)tNbrOfPPS && -<a name="l00274"></a>00274 atPPSlist[iIndex].ulPrevious != PPS_NUMBER_INVALID) || -<a name="l00275"></a>00275 (atPPSlist[iIndex].ulNext >= (ULONG)tNbrOfPPS && -<a name="l00276"></a>00276 atPPSlist[iIndex].ulNext != PPS_NUMBER_INVALID) || -<a name="l00277"></a>00277 (atPPSlist[iIndex].ulDir >= (ULONG)tNbrOfPPS && -<a name="l00278"></a>00278 atPPSlist[iIndex].ulDir != PPS_NUMBER_INVALID)) { -<a name="l00279"></a>00279 DBG_DEC(iIndex); -<a name="l00280"></a>00280 DBG_DEC(atPPSlist[iIndex].ulPrevious); -<a name="l00281"></a>00281 DBG_DEC(atPPSlist[iIndex].ulNext); -<a name="l00282"></a>00282 DBG_DEC(atPPSlist[iIndex].ulDir); -<a name="l00283"></a>00283 DBG_DEC(tNbrOfPPS); -<a name="l00284"></a>00284 werr(0, <span class="stringliteral">"The Property Set Storage is damaged"</span>); -<a name="l00285"></a>00285 atPPSlist = xfree(atPPSlist); -<a name="l00286"></a>00286 <span class="keywordflow">return</span> FALSE; -<a name="l00287"></a>00287 } -<a name="l00288"></a>00288 } -<a name="l00289"></a>00289 -<a name="l00290"></a>00290 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00291"></a>00291 DBG_MSG(<span class="stringliteral">"Before"</span>); -<a name="l00292"></a>00292 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) { -<a name="l00293"></a>00293 DBG_MSG(atPPSlist[iIndex].szName); -<a name="l00294"></a>00294 DBG_HEX(atPPSlist[iIndex].ulDir); -<a name="l00295"></a>00295 DBG_HEX(atPPSlist[iIndex].ulPrevious); -<a name="l00296"></a>00296 DBG_HEX(atPPSlist[iIndex].ulNext); -<a name="l00297"></a>00297 DBG_DEC(atPPSlist[iIndex].ulSB); -<a name="l00298"></a>00298 DBG_HEX(atPPSlist[iIndex].ulSize); -<a name="l00299"></a>00299 DBG_DEC(atPPSlist[iIndex].iLevel); -<a name="l00300"></a>00300 } -<a name="l00301"></a>00301 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00302"></a>00302 -<a name="l00303"></a>00303 <span class="comment">/* Add level information to each entry */</span> -<a name="l00304"></a>00304 vComputePPSlevels(atPPSlist, &atPPSlist[iRootIndex], 0, 0); -<a name="l00305"></a>00305 -<a name="l00306"></a>00306 <span class="comment">/* Check the entries on level 1 for the required information */</span> -<a name="l00307"></a>00307 NO_DBG_MSG(<span class="stringliteral">"After"</span>); -<a name="l00308"></a>00308 <span class="keywordflow">for</span> (iIndex = 0; iIndex < (int)tNbrOfPPS; iIndex++) { -<a name="l00309"></a>00309 <span class="preprocessor">#if 0 </span><span class="comment">/* defined(DEBUG) */</span> -<a name="l00310"></a>00310 DBG_MSG(atPPSlist[iIndex].szName); -<a name="l00311"></a>00311 DBG_HEX(atPPSlist[iIndex].ulDir); -<a name="l00312"></a>00312 DBG_HEX(atPPSlist[iIndex].ulPrevious); -<a name="l00313"></a>00313 DBG_HEX(atPPSlist[iIndex].ulNext); -<a name="l00314"></a>00314 DBG_DEC(atPPSlist[iIndex].ulSB); -<a name="l00315"></a>00315 DBG_HEX(atPPSlist[iIndex].ulSize); -<a name="l00316"></a>00316 DBG_DEC(atPPSlist[iIndex].iLevel); -<a name="l00317"></a>00317 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00318"></a>00318 <span class="keywordflow">if</span> (atPPSlist[iIndex].iLevel != 1 || -<a name="l00319"></a>00319 atPPSlist[iIndex].ucType != 2 || -<a name="l00320"></a>00320 atPPSlist[iIndex].szName[0] == <span class="charliteral">'\0'</span> || -<a name="l00321"></a>00321 atPPSlist[iIndex].ulSize == 0) { -<a name="l00322"></a>00322 <span class="comment">/* This entry can be ignored */</span> -<a name="l00323"></a>00323 <span class="keywordflow">continue</span>; -<a name="l00324"></a>00324 } -<a name="l00325"></a>00325 <span class="keywordflow">if</span> (pPPS->tWordDocument.ulSize == 0 && -<a name="l00326"></a>00326 STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"WordDocument"</span>)) { -<a name="l00327"></a>00327 pPPS->tWordDocument.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00328"></a>00328 pPPS->tWordDocument.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00329"></a>00329 bWord = TRUE; -<a name="l00330"></a>00330 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pPPS->tData.ulSize == 0 && -<a name="l00331"></a>00331 STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"Data"</span>)) { -<a name="l00332"></a>00332 pPPS->tData.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00333"></a>00333 pPPS->tData.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00334"></a>00334 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pPPS->t0Table.ulSize == 0 && -<a name="l00335"></a>00335 STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"0Table"</span>)) { -<a name="l00336"></a>00336 pPPS->t0Table.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00337"></a>00337 pPPS->t0Table.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00338"></a>00338 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pPPS->t1Table.ulSize == 0 && -<a name="l00339"></a>00339 STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"1Table"</span>)) { -<a name="l00340"></a>00340 pPPS->t1Table.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00341"></a>00341 pPPS->t1Table.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00342"></a>00342 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pPPS->tSummaryInfo.ulSize == 0 && -<a name="l00343"></a>00343 STREQ(atPPSlist[iIndex].szName, -<a name="l00344"></a>00344 <span class="stringliteral">"\005SummaryInformation"</span>)) { -<a name="l00345"></a>00345 pPPS->tSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00346"></a>00346 pPPS->tSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00347"></a>00347 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pPPS->tDocSummaryInfo.ulSize == 0 && -<a name="l00348"></a>00348 STREQ(atPPSlist[iIndex].szName, -<a name="l00349"></a>00349 <span class="stringliteral">"\005DocumentSummaryInformation"</span>)) { -<a name="l00350"></a>00350 pPPS->tDocSummaryInfo.ulSB = atPPSlist[iIndex].ulSB; -<a name="l00351"></a>00351 pPPS->tDocSummaryInfo.ulSize = atPPSlist[iIndex].ulSize; -<a name="l00352"></a>00352 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"Book"</span>) || -<a name="l00353"></a>00353 STREQ(atPPSlist[iIndex].szName, <span class="stringliteral">"Workbook"</span>)) { -<a name="l00354"></a>00354 bExcel = TRUE; -<a name="l00355"></a>00355 } -<a name="l00356"></a>00356 } -<a name="l00357"></a>00357 -<a name="l00358"></a>00358 <span class="comment">/* Free the space for the Property Set Storage entries */</span> -<a name="l00359"></a>00359 atPPSlist = xfree(atPPSlist); -<a name="l00360"></a>00360 -<a name="l00361"></a>00361 <span class="comment">/* Draw your conclusions */</span> -<a name="l00362"></a>00362 <span class="keywordflow">if</span> (bWord) { -<a name="l00363"></a>00363 <span class="keywordflow">return</span> TRUE; -<a name="l00364"></a>00364 } -<a name="l00365"></a>00365 -<a name="l00366"></a>00366 <span class="keywordflow">if</span> (bExcel) { -<a name="l00367"></a>00367 werr(0, <span class="stringliteral">"Sorry, but this is an Excel spreadsheet"</span>); -<a name="l00368"></a>00368 } <span class="keywordflow">else</span> { -<a name="l00369"></a>00369 werr(0, <span class="stringliteral">"This OLE file does not contain a Word document"</span>); -<a name="l00370"></a>00370 } -<a name="l00371"></a>00371 <span class="keywordflow">return</span> FALSE; -<a name="l00372"></a>00372 } <span class="comment">/* end of bGetPPS */</span> -<a name="l00373"></a>00373 -<a name="l00374"></a>00374 <span class="comment">/*</span> -<a name="l00375"></a>00375 <span class="comment"> * vGetBbdList - make a list of the places to find big blocks</span> -<a name="l00376"></a>00376 <span class="comment"> */</span> -<a name="l00377"></a>00377 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00378"></a>00378 vGetBbdList(FILE *pFile, <span class="keywordtype">int</span> iNbr, ULONG *aulBbdList, ULONG ulOffset) -<a name="l00379"></a>00379 { -<a name="l00380"></a>00380 <span class="keywordtype">int</span> iIndex; -<a name="l00381"></a>00381 -<a name="l00382"></a>00382 fail(pFile == NULL); -<a name="l00383"></a>00383 fail(iNbr > 127); -<a name="l00384"></a>00384 fail(aulBbdList == NULL); -<a name="l00385"></a>00385 -<a name="l00386"></a>00386 NO_DBG_DEC(iNbr); -<a name="l00387"></a>00387 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iNbr; iIndex++) { -<a name="l00388"></a>00388 aulBbdList[iIndex] = -<a name="l00389"></a>00389 ulReadLong(pFile, ulOffset + 4 * (ULONG)iIndex); -<a name="l00390"></a>00390 NO_DBG_DEC(iIndex); -<a name="l00391"></a>00391 NO_DBG_HEX(aulBbdList[iIndex]); -<a name="l00392"></a>00392 } -<a name="l00393"></a>00393 } <span class="comment">/* end of vGetBbdList */</span> -<a name="l00394"></a>00394 -<a name="l00395"></a>00395 <span class="comment">/*</span> -<a name="l00396"></a>00396 <span class="comment"> * bGetDocumentText - make a list of the text blocks of a Word document</span> -<a name="l00397"></a>00397 <span class="comment"> *</span> -<a name="l00398"></a>00398 <span class="comment"> * Return TRUE when succesful, otherwise FALSE</span> -<a name="l00399"></a>00399 <span class="comment"> */</span> -<a name="l00400"></a>00400 <span class="keyword">static</span> BOOL -<a name="l00401"></a>00401 bGetDocumentText(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00402"></a>00402 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00403"></a>00403 <span class="keyword">const</span> ULONG *aulSBD, <span class="keywordtype">size_t</span> tSBDLen, -<a name="l00404"></a>00404 <span class="keyword">const</span> UCHAR *aucHeader, <span class="keywordtype">int</span> iWordVersion) -<a name="l00405"></a>00405 { -<a name="l00406"></a>00406 ULONG ulBeginOfText; -<a name="l00407"></a>00407 ULONG ulTextLen, ulFootnoteLen, ulEndnoteLen; -<a name="l00408"></a>00408 ULONG ulHdrFtrLen, ulMacroLen, ulAnnotationLen; -<a name="l00409"></a>00409 ULONG ulTextBoxLen, ulHdrTextBoxLen; -<a name="l00410"></a>00410 UINT uiQuickSaves; -<a name="l00411"></a>00411 BOOL bFarEastWord, bTemplate, bFastSaved, bEncrypted, bSuccess; -<a name="l00412"></a>00412 USHORT usIdent, usDocStatus; -<a name="l00413"></a>00413 -<a name="l00414"></a>00414 fail(pFile == NULL || pPPS == NULL); -<a name="l00415"></a>00415 fail(aulBBD == NULL); -<a name="l00416"></a>00416 fail(aulSBD == NULL); -<a name="l00417"></a>00417 -<a name="l00418"></a>00418 DBG_MSG(<span class="stringliteral">"bGetDocumentText"</span>); -<a name="l00419"></a>00419 -<a name="l00420"></a>00420 <span class="comment">/* Get the "magic number" from the header */</span> -<a name="l00421"></a>00421 usIdent = usGetWord(0x00, aucHeader); -<a name="l00422"></a>00422 DBG_HEX(usIdent); -<a name="l00423"></a>00423 bFarEastWord = usIdent == 0x8098 || usIdent == 0x8099 || -<a name="l00424"></a>00424 usIdent == 0xa697 || usIdent == 0xa699; -<a name="l00425"></a>00425 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00426"></a>00426 usDocStatus = usGetWord(0x0a, aucHeader); -<a name="l00427"></a>00427 DBG_HEX(usDocStatus); -<a name="l00428"></a>00428 bTemplate = (usDocStatus & BIT(0)) != 0; -<a name="l00429"></a>00429 DBG_MSG_C(bTemplate, <span class="stringliteral">"This document is a Template"</span>); -<a name="l00430"></a>00430 bFastSaved = (usDocStatus & BIT(2)) != 0; -<a name="l00431"></a>00431 uiQuickSaves = (UINT)(usDocStatus & 0x00f0) >> 4; -<a name="l00432"></a>00432 DBG_MSG_C(bFastSaved, <span class="stringliteral">"This document is Fast Saved"</span>); -<a name="l00433"></a>00433 DBG_DEC_C(bFastSaved, uiQuickSaves); -<a name="l00434"></a>00434 bEncrypted = (usDocStatus & BIT(8)) != 0; -<a name="l00435"></a>00435 <span class="keywordflow">if</span> (bEncrypted) { -<a name="l00436"></a>00436 werr(0, <span class="stringliteral">"Encrypted documents are not supported"</span>); -<a name="l00437"></a>00437 <span class="keywordflow">return</span> FALSE; -<a name="l00438"></a>00438 } -<a name="l00439"></a>00439 -<a name="l00440"></a>00440 <span class="comment">/* Get length information */</span> -<a name="l00441"></a>00441 ulBeginOfText = ulGetLong(0x18, aucHeader); -<a name="l00442"></a>00442 DBG_HEX(ulBeginOfText); -<a name="l00443"></a>00443 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00444"></a>00444 <span class="keywordflow">case</span> 6: -<a name="l00445"></a>00445 <span class="keywordflow">case</span> 7: -<a name="l00446"></a>00446 ulTextLen = ulGetLong(0x34, aucHeader); -<a name="l00447"></a>00447 ulFootnoteLen = ulGetLong(0x38, aucHeader); -<a name="l00448"></a>00448 ulHdrFtrLen = ulGetLong(0x3c, aucHeader); -<a name="l00449"></a>00449 ulMacroLen = ulGetLong(0x40, aucHeader); -<a name="l00450"></a>00450 ulAnnotationLen = ulGetLong(0x44, aucHeader); -<a name="l00451"></a>00451 ulEndnoteLen = ulGetLong(0x48, aucHeader); -<a name="l00452"></a>00452 ulTextBoxLen = ulGetLong(0x4c, aucHeader); -<a name="l00453"></a>00453 ulHdrTextBoxLen = ulGetLong(0x50, aucHeader); -<a name="l00454"></a>00454 <span class="keywordflow">break</span>; -<a name="l00455"></a>00455 <span class="keywordflow">case</span> 8: -<a name="l00456"></a>00456 ulTextLen = ulGetLong(0x4c, aucHeader); -<a name="l00457"></a>00457 ulFootnoteLen = ulGetLong(0x50, aucHeader); -<a name="l00458"></a>00458 ulHdrFtrLen = ulGetLong(0x54, aucHeader); -<a name="l00459"></a>00459 ulMacroLen = ulGetLong(0x58, aucHeader); -<a name="l00460"></a>00460 ulAnnotationLen = ulGetLong(0x5c, aucHeader); -<a name="l00461"></a>00461 ulEndnoteLen = ulGetLong(0x60, aucHeader); -<a name="l00462"></a>00462 ulTextBoxLen = ulGetLong(0x64, aucHeader); -<a name="l00463"></a>00463 ulHdrTextBoxLen = ulGetLong(0x68, aucHeader); -<a name="l00464"></a>00464 <span class="keywordflow">break</span>; -<a name="l00465"></a>00465 <span class="keywordflow">default</span>: -<a name="l00466"></a>00466 werr(0, <span class="stringliteral">"This version of Word is not supported"</span>); -<a name="l00467"></a>00467 <span class="keywordflow">return</span> FALSE; -<a name="l00468"></a>00468 } -<a name="l00469"></a>00469 DBG_DEC(ulTextLen); -<a name="l00470"></a>00470 DBG_DEC(ulFootnoteLen); -<a name="l00471"></a>00471 DBG_DEC(ulHdrFtrLen); -<a name="l00472"></a>00472 DBG_DEC(ulMacroLen); -<a name="l00473"></a>00473 DBG_DEC(ulAnnotationLen); -<a name="l00474"></a>00474 DBG_DEC(ulEndnoteLen); -<a name="l00475"></a>00475 DBG_DEC(ulTextBoxLen); -<a name="l00476"></a>00476 DBG_DEC(ulHdrTextBoxLen); -<a name="l00477"></a>00477 -<a name="l00478"></a>00478 <span class="comment">/* Make a list of the text blocks */</span> -<a name="l00479"></a>00479 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00480"></a>00480 <span class="keywordflow">case</span> 6: -<a name="l00481"></a>00481 <span class="keywordflow">case</span> 7: -<a name="l00482"></a>00482 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00483"></a>00483 bSuccess = bGet6DocumentText(pFile, -<a name="l00484"></a>00484 bFarEastWord, -<a name="l00485"></a>00485 pPPS->tWordDocument.ulSB, -<a name="l00486"></a>00486 aulBBD, tBBDLen, -<a name="l00487"></a>00487 aucHeader); -<a name="l00488"></a>00488 } <span class="keywordflow">else</span> { -<a name="l00489"></a>00489 bSuccess = bAddTextBlocks(ulBeginOfText, -<a name="l00490"></a>00490 ulTextLen + -<a name="l00491"></a>00491 ulFootnoteLen + -<a name="l00492"></a>00492 ulHdrFtrLen + -<a name="l00493"></a>00493 ulMacroLen + ulAnnotationLen + -<a name="l00494"></a>00494 ulEndnoteLen + -<a name="l00495"></a>00495 ulTextBoxLen + ulHdrTextBoxLen, -<a name="l00496"></a>00496 bFarEastWord, -<a name="l00497"></a>00497 IGNORE_PROPMOD, -<a name="l00498"></a>00498 pPPS->tWordDocument.ulSB, -<a name="l00499"></a>00499 aulBBD, tBBDLen); -<a name="l00500"></a>00500 } -<a name="l00501"></a>00501 <span class="keywordflow">break</span>; -<a name="l00502"></a>00502 <span class="keywordflow">case</span> 8: -<a name="l00503"></a>00503 bSuccess = bGet8DocumentText(pFile, -<a name="l00504"></a>00504 pPPS, -<a name="l00505"></a>00505 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00506"></a>00506 aucHeader); -<a name="l00507"></a>00507 <span class="keywordflow">break</span>; -<a name="l00508"></a>00508 <span class="keywordflow">default</span>: -<a name="l00509"></a>00509 werr(0, <span class="stringliteral">"This version of Word is not supported"</span>); -<a name="l00510"></a>00510 bSuccess = FALSE; -<a name="l00511"></a>00511 <span class="keywordflow">break</span>; -<a name="l00512"></a>00512 } -<a name="l00513"></a>00513 -<a name="l00514"></a>00514 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00515"></a>00515 vSplitBlockList(pFile, -<a name="l00516"></a>00516 ulTextLen, -<a name="l00517"></a>00517 ulFootnoteLen, -<a name="l00518"></a>00518 ulHdrFtrLen, -<a name="l00519"></a>00519 ulMacroLen, -<a name="l00520"></a>00520 ulAnnotationLen, -<a name="l00521"></a>00521 ulEndnoteLen, -<a name="l00522"></a>00522 ulTextBoxLen, -<a name="l00523"></a>00523 ulHdrTextBoxLen, -<a name="l00524"></a>00524 !bFastSaved && iWordVersion == 8); -<a name="l00525"></a>00525 } <span class="keywordflow">else</span> { -<a name="l00526"></a>00526 vDestroyTextBlockList(); -<a name="l00527"></a>00527 werr(0, <span class="stringliteral">"I can't find the text of this document"</span>); -<a name="l00528"></a>00528 } -<a name="l00529"></a>00529 <span class="keywordflow">return</span> bSuccess; -<a name="l00530"></a>00530 } <span class="comment">/* end of bGetDocumentText */</span> -<a name="l00531"></a>00531 -<a name="l00532"></a>00532 <span class="comment">/*</span> -<a name="l00533"></a>00533 <span class="comment"> * vGetDocumentData - make a list of the data blocks of a Word document</span> -<a name="l00534"></a>00534 <span class="comment"> */</span> -<a name="l00535"></a>00535 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00536"></a>00536 vGetDocumentData(FILE *pFile, <span class="keyword">const</span> pps_info_type *pPPS, -<a name="l00537"></a>00537 <span class="keyword">const</span> ULONG *aulBBD, <span class="keywordtype">size_t</span> tBBDLen, -<a name="l00538"></a>00538 <span class="keyword">const</span> UCHAR *aucHeader, <span class="keywordtype">int</span> iWordVersion) -<a name="l00539"></a>00539 { -<a name="l00540"></a>00540 options_type tOptions; -<a name="l00541"></a>00541 ULONG ulBeginOfText; -<a name="l00542"></a>00542 BOOL bFastSaved, bHasImages, bSuccess; -<a name="l00543"></a>00543 USHORT usDocStatus; -<a name="l00544"></a>00544 -<a name="l00545"></a>00545 fail(pFile == NULL); -<a name="l00546"></a>00546 fail(pPPS == NULL); -<a name="l00547"></a>00547 fail(aulBBD == NULL); -<a name="l00548"></a>00548 -<a name="l00549"></a>00549 <span class="comment">/* Get the options */</span> -<a name="l00550"></a>00550 vGetOptions(&tOptions); -<a name="l00551"></a>00551 -<a name="l00552"></a>00552 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00553"></a>00553 usDocStatus = usGetWord(0x0a, aucHeader); -<a name="l00554"></a>00554 DBG_HEX(usDocStatus); -<a name="l00555"></a>00555 bFastSaved = (usDocStatus & BIT(2)) != 0; -<a name="l00556"></a>00556 bHasImages = (usDocStatus & BIT(3)) != 0; -<a name="l00557"></a>00557 -<a name="l00558"></a>00558 <span class="keywordflow">if</span> (!bHasImages || -<a name="l00559"></a>00559 tOptions.eConversionType == conversion_text || -<a name="l00560"></a>00560 tOptions.eConversionType == conversion_fmt_text || -<a name="l00561"></a>00561 tOptions.eConversionType == conversion_xml || -<a name="l00562"></a>00562 tOptions.eImageLevel == level_no_images) { -<a name="l00563"></a>00563 <span class="comment">/*</span> -<a name="l00564"></a>00564 <span class="comment"> * No images in the document or text-only output or</span> -<a name="l00565"></a>00565 <span class="comment"> * no images wanted, so no data blocks will be needed</span> -<a name="l00566"></a>00566 <span class="comment"> */</span> -<a name="l00567"></a>00567 vDestroyDataBlockList(); -<a name="l00568"></a>00568 <span class="keywordflow">return</span>; -<a name="l00569"></a>00569 } -<a name="l00570"></a>00570 -<a name="l00571"></a>00571 <span class="comment">/* Get length information */</span> -<a name="l00572"></a>00572 ulBeginOfText = ulGetLong(0x18, aucHeader); -<a name="l00573"></a>00573 DBG_HEX(ulBeginOfText); -<a name="l00574"></a>00574 -<a name="l00575"></a>00575 <span class="comment">/* Make a list of the data blocks */</span> -<a name="l00576"></a>00576 <span class="keywordflow">switch</span> (iWordVersion) { -<a name="l00577"></a>00577 <span class="keywordflow">case</span> 6: -<a name="l00578"></a>00578 <span class="keywordflow">case</span> 7: -<a name="l00579"></a>00579 <span class="comment">/*</span> -<a name="l00580"></a>00580 <span class="comment"> * The data blocks are in the text stream. The text stream</span> -<a name="l00581"></a>00581 <span class="comment"> * is in "fast saved" format or "normal saved" format</span> -<a name="l00582"></a>00582 <span class="comment"> */</span> -<a name="l00583"></a>00583 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00584"></a>00584 bSuccess = bGet6DocumentData(pFile, -<a name="l00585"></a>00585 pPPS->tWordDocument.ulSB, -<a name="l00586"></a>00586 aulBBD, tBBDLen, -<a name="l00587"></a>00587 aucHeader); -<a name="l00588"></a>00588 } <span class="keywordflow">else</span> { -<a name="l00589"></a>00589 bSuccess = bAddDataBlocks(ulBeginOfText, -<a name="l00590"></a>00590 (ULONG)LONG_MAX, -<a name="l00591"></a>00591 pPPS->tWordDocument.ulSB, -<a name="l00592"></a>00592 aulBBD, tBBDLen); -<a name="l00593"></a>00593 } -<a name="l00594"></a>00594 <span class="keywordflow">break</span>; -<a name="l00595"></a>00595 <span class="keywordflow">case</span> 8: -<a name="l00596"></a>00596 <span class="comment">/*</span> -<a name="l00597"></a>00597 <span class="comment"> * The data blocks are in the data stream. The data stream</span> -<a name="l00598"></a>00598 <span class="comment"> * is always in "normal saved" format</span> -<a name="l00599"></a>00599 <span class="comment"> */</span> -<a name="l00600"></a>00600 bSuccess = bAddDataBlocks(0, (ULONG)LONG_MAX, -<a name="l00601"></a>00601 pPPS->tData.ulSB, aulBBD, tBBDLen); -<a name="l00602"></a>00602 <span class="keywordflow">break</span>; -<a name="l00603"></a>00603 <span class="keywordflow">default</span>: -<a name="l00604"></a>00604 werr(0, <span class="stringliteral">"This version of Word is not supported"</span>); -<a name="l00605"></a>00605 bSuccess = FALSE; -<a name="l00606"></a>00606 <span class="keywordflow">break</span>; -<a name="l00607"></a>00607 } -<a name="l00608"></a>00608 -<a name="l00609"></a>00609 <span class="keywordflow">if</span> (!bSuccess) { -<a name="l00610"></a>00610 vDestroyDataBlockList(); -<a name="l00611"></a>00611 werr(0, <span class="stringliteral">"I can't find the data of this document"</span>); -<a name="l00612"></a>00612 } -<a name="l00613"></a>00613 } <span class="comment">/* end of vGetDocumentData */</span> -<a name="l00614"></a>00614 -<a name="l00615"></a>00615 <span class="comment">/*</span> -<a name="l00616"></a>00616 <span class="comment"> * iInitDocumentOLE - initialize an OLE document</span> -<a name="l00617"></a>00617 <span class="comment"> *</span> -<a name="l00618"></a>00618 <span class="comment"> * Returns the version of Word that made the document or -1</span> -<a name="l00619"></a>00619 <span class="comment"> */</span> -<a name="l00620"></a>00620 <span class="keywordtype">int</span> -<a name="l00621"></a>00621 iInitDocumentOLE(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00622"></a>00622 { -<a name="l00623"></a>00623 pps_info_type PPS_info; -<a name="l00624"></a>00624 ULONG *aulBBD, *aulSBD; -<a name="l00625"></a>00625 ULONG *aulRootList, *aulBbdList, *aulSbdList; -<a name="l00626"></a>00626 ULONG ulBdbListStart, ulAdditionalBBDlist; -<a name="l00627"></a>00627 ULONG ulRootStartblock, ulSbdStartblock, ulSBLstartblock; -<a name="l00628"></a>00628 ULONG ulStart, ulTmp; -<a name="l00629"></a>00629 <span class="keywordtype">long</span> lMaxBlock; -<a name="l00630"></a>00630 <span class="keywordtype">size_t</span> tBBDLen, tSBDLen, tNumBbdBlocks, tRootListLen; -<a name="l00631"></a>00631 <span class="keywordtype">int</span> iWordVersion, iIndex, iToGo; -<a name="l00632"></a>00632 BOOL bSuccess; -<a name="l00633"></a>00633 USHORT usIdent, usDocStatus; -<a name="l00634"></a>00634 UCHAR aucHeader[HEADER_SIZE]; -<a name="l00635"></a>00635 -<a name="l00636"></a>00636 fail(pFile == NULL); -<a name="l00637"></a>00637 -<a name="l00638"></a>00638 lMaxBlock = lFilesize / BIG_BLOCK_SIZE - 2; -<a name="l00639"></a>00639 DBG_DEC(lMaxBlock); -<a name="l00640"></a>00640 <span class="keywordflow">if</span> (lMaxBlock < 1) { -<a name="l00641"></a>00641 <span class="keywordflow">return</span> -1; -<a name="l00642"></a>00642 } -<a name="l00643"></a>00643 tBBDLen = (size_t)(lMaxBlock + 1); -<a name="l00644"></a>00644 tNumBbdBlocks = (size_t)ulReadLong(pFile, 0x2c); -<a name="l00645"></a>00645 DBG_DEC(tNumBbdBlocks); -<a name="l00646"></a>00646 ulRootStartblock = ulReadLong(pFile, 0x30); -<a name="l00647"></a>00647 DBG_DEC(ulRootStartblock); -<a name="l00648"></a>00648 ulSbdStartblock = ulReadLong(pFile, 0x3c); -<a name="l00649"></a>00649 DBG_DEC(ulSbdStartblock); -<a name="l00650"></a>00650 ulAdditionalBBDlist = ulReadLong(pFile, 0x44); -<a name="l00651"></a>00651 DBG_HEX(ulAdditionalBBDlist); -<a name="l00652"></a>00652 ulSBLstartblock = ulReadLong(pFile, -<a name="l00653"></a>00653 (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x74); -<a name="l00654"></a>00654 DBG_DEC(ulSBLstartblock); -<a name="l00655"></a>00655 tSBDLen = (size_t)(ulReadLong(pFile, -<a name="l00656"></a>00656 (ulRootStartblock + 1) * BIG_BLOCK_SIZE + 0x78) / -<a name="l00657"></a>00657 SMALL_BLOCK_SIZE); -<a name="l00658"></a>00658 <span class="comment">/* All to be xcalloc-ed pointers to NULL */</span> -<a name="l00659"></a>00659 aulRootList = NULL; -<a name="l00660"></a>00660 aulSbdList = NULL; -<a name="l00661"></a>00661 aulBbdList = NULL; -<a name="l00662"></a>00662 aulSBD = NULL; -<a name="l00663"></a>00663 aulBBD = NULL; -<a name="l00664"></a>00664 <span class="comment">/* Big Block Depot */</span> -<a name="l00665"></a>00665 aulBbdList = xcalloc(tNumBbdBlocks, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00666"></a>00666 aulBBD = xcalloc(tBBDLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00667"></a>00667 iToGo = (int)tNumBbdBlocks; -<a name="l00668"></a>00668 vGetBbdList(pFile, min(iToGo, 109), aulBbdList, 0x4c); -<a name="l00669"></a>00669 ulStart = 109; -<a name="l00670"></a>00670 iToGo -= 109; -<a name="l00671"></a>00671 <span class="keywordflow">while</span> (ulAdditionalBBDlist != END_OF_CHAIN && iToGo > 0) { -<a name="l00672"></a>00672 ulBdbListStart = (ulAdditionalBBDlist + 1) * BIG_BLOCK_SIZE; -<a name="l00673"></a>00673 vGetBbdList(pFile, min(iToGo, 127), -<a name="l00674"></a>00674 aulBbdList + ulStart, ulBdbListStart); -<a name="l00675"></a>00675 ulAdditionalBBDlist = ulReadLong(pFile, -<a name="l00676"></a>00676 ulBdbListStart + 4 * 127); -<a name="l00677"></a>00677 DBG_DEC(ulAdditionalBBDlist); -<a name="l00678"></a>00678 DBG_HEX(ulAdditionalBBDlist); -<a name="l00679"></a>00679 ulStart += 127; -<a name="l00680"></a>00680 iToGo -= 127; -<a name="l00681"></a>00681 } -<a name="l00682"></a>00682 <span class="keywordflow">if</span> (!bGetBBD(pFile, aulBbdList, tNumBbdBlocks, aulBBD, tBBDLen)) { -<a name="l00683"></a>00683 FREE_ALL(); -<a name="l00684"></a>00684 <span class="keywordflow">return</span> -1; -<a name="l00685"></a>00685 } -<a name="l00686"></a>00686 aulBbdList = xfree(aulBbdList); -<a name="l00687"></a>00687 <span class="comment">/* Small Block Depot */</span> -<a name="l00688"></a>00688 aulSbdList = xcalloc(tBBDLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00689"></a>00689 aulSBD = xcalloc(tSBDLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00690"></a>00690 <span class="keywordflow">for</span> (iIndex = 0, ulTmp = ulSbdStartblock; -<a name="l00691"></a>00691 iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; -<a name="l00692"></a>00692 iIndex++, ulTmp = aulBBD[ulTmp]) { -<a name="l00693"></a>00693 <span class="keywordflow">if</span> (ulTmp >= (ULONG)tBBDLen) { -<a name="l00694"></a>00694 DBG_DEC(ulTmp); -<a name="l00695"></a>00695 DBG_DEC(tBBDLen); -<a name="l00696"></a>00696 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00697"></a>00697 } -<a name="l00698"></a>00698 aulSbdList[iIndex] = ulTmp; -<a name="l00699"></a>00699 NO_DBG_HEX(aulSbdList[iIndex]); -<a name="l00700"></a>00700 } -<a name="l00701"></a>00701 <span class="keywordflow">if</span> (!bGetSBD(pFile, aulSbdList, tBBDLen, aulSBD, tSBDLen)) { -<a name="l00702"></a>00702 FREE_ALL(); -<a name="l00703"></a>00703 <span class="keywordflow">return</span> -1; -<a name="l00704"></a>00704 } -<a name="l00705"></a>00705 aulSbdList = xfree(aulSbdList); -<a name="l00706"></a>00706 <span class="comment">/* Root list */</span> -<a name="l00707"></a>00707 <span class="keywordflow">for</span> (tRootListLen = 0, ulTmp = ulRootStartblock; -<a name="l00708"></a>00708 tRootListLen < tBBDLen && ulTmp != END_OF_CHAIN; -<a name="l00709"></a>00709 tRootListLen++, ulTmp = aulBBD[ulTmp]) { -<a name="l00710"></a>00710 <span class="keywordflow">if</span> (ulTmp >= (ULONG)tBBDLen) { -<a name="l00711"></a>00711 DBG_DEC(ulTmp); -<a name="l00712"></a>00712 DBG_DEC(tBBDLen); -<a name="l00713"></a>00713 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00714"></a>00714 } -<a name="l00715"></a>00715 } -<a name="l00716"></a>00716 <span class="keywordflow">if</span> (tRootListLen == 0) { -<a name="l00717"></a>00717 werr(0, <span class="stringliteral">"No Rootlist found"</span>); -<a name="l00718"></a>00718 FREE_ALL(); -<a name="l00719"></a>00719 <span class="keywordflow">return</span> -1; -<a name="l00720"></a>00720 } -<a name="l00721"></a>00721 aulRootList = xcalloc(tRootListLen, <span class="keyword">sizeof</span>(ULONG)); -<a name="l00722"></a>00722 <span class="keywordflow">for</span> (iIndex = 0, ulTmp = ulRootStartblock; -<a name="l00723"></a>00723 iIndex < (int)tBBDLen && ulTmp != END_OF_CHAIN; -<a name="l00724"></a>00724 iIndex++, ulTmp = aulBBD[ulTmp]) { -<a name="l00725"></a>00725 <span class="keywordflow">if</span> (ulTmp >= (ULONG)tBBDLen) { -<a name="l00726"></a>00726 DBG_DEC(ulTmp); -<a name="l00727"></a>00727 DBG_DEC(tBBDLen); -<a name="l00728"></a>00728 werr(1, <span class="stringliteral">"The Big Block Depot is damaged"</span>); -<a name="l00729"></a>00729 } -<a name="l00730"></a>00730 aulRootList[iIndex] = ulTmp; -<a name="l00731"></a>00731 NO_DBG_DEC(aulRootList[iIndex]); -<a name="l00732"></a>00732 } -<a name="l00733"></a>00733 fail(tRootListLen != (<span class="keywordtype">size_t</span>)iIndex); -<a name="l00734"></a>00734 bSuccess = bGetPPS(pFile, aulRootList, tRootListLen, &PPS_info); -<a name="l00735"></a>00735 aulRootList = xfree(aulRootList); -<a name="l00736"></a>00736 <span class="keywordflow">if</span> (!bSuccess) { -<a name="l00737"></a>00737 FREE_ALL(); -<a name="l00738"></a>00738 <span class="keywordflow">return</span> -1; -<a name="l00739"></a>00739 } -<a name="l00740"></a>00740 <span class="comment">/* Small block list */</span> -<a name="l00741"></a>00741 <span class="keywordflow">if</span> (!bCreateSmallBlockList(ulSBLstartblock, aulBBD, tBBDLen)) { -<a name="l00742"></a>00742 FREE_ALL(); -<a name="l00743"></a>00743 <span class="keywordflow">return</span> -1; -<a name="l00744"></a>00744 } -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 <span class="keywordflow">if</span> (PPS_info.tWordDocument.ulSize < MIN_SIZE_FOR_BBD_USE) { -<a name="l00747"></a>00747 DBG_DEC(PPS_info.tWordDocument.ulSize); -<a name="l00748"></a>00748 FREE_ALL(); -<a name="l00749"></a>00749 werr(0, <span class="stringliteral">"I'm afraid the text stream of this file "</span> -<a name="l00750"></a>00750 <span class="stringliteral">"is too small to handle."</span>); -<a name="l00751"></a>00751 <span class="keywordflow">return</span> -1; -<a name="l00752"></a>00752 } -<a name="l00753"></a>00753 <span class="comment">/* Read the headerblock */</span> -<a name="l00754"></a>00754 <span class="keywordflow">if</span> (!bReadBuffer(pFile, PPS_info.tWordDocument.ulSB, -<a name="l00755"></a>00755 aulBBD, tBBDLen, BIG_BLOCK_SIZE, -<a name="l00756"></a>00756 aucHeader, 0, HEADER_SIZE)) { -<a name="l00757"></a>00757 FREE_ALL(); -<a name="l00758"></a>00758 <span class="keywordflow">return</span> -1; -<a name="l00759"></a>00759 } -<a name="l00760"></a>00760 usIdent = usGetWord(0x00, aucHeader); -<a name="l00761"></a>00761 DBG_HEX(usIdent); -<a name="l00762"></a>00762 fail(usIdent != 0x8098 && <span class="comment">/* Word 7 for oriental languages */</span> -<a name="l00763"></a>00763 usIdent != 0x8099 && <span class="comment">/* Word 7 for oriental languages */</span> -<a name="l00764"></a>00764 usIdent != 0xa5dc && <span class="comment">/* Word 6 & 7 */</span> -<a name="l00765"></a>00765 usIdent != 0xa5ec && <span class="comment">/* Word 7 & 97 & 98 */</span> -<a name="l00766"></a>00766 usIdent != 0xa697 && <span class="comment">/* Word 7 for oriental languages */</span> -<a name="l00767"></a>00767 usIdent != 0xa699); <span class="comment">/* Word 7 for oriental languages */</span> -<a name="l00768"></a>00768 iWordVersion = iGetVersionNumber(aucHeader); -<a name="l00769"></a>00769 <span class="keywordflow">if</span> (iWordVersion < 6) { -<a name="l00770"></a>00770 FREE_ALL(); -<a name="l00771"></a>00771 werr(0, <span class="stringliteral">"This file is from a version of Word before Word 6."</span>); -<a name="l00772"></a>00772 <span class="keywordflow">return</span> -1; -<a name="l00773"></a>00773 } -<a name="l00774"></a>00774 -<a name="l00775"></a>00775 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00776"></a>00776 usDocStatus = usGetWord(0x0a, aucHeader); -<a name="l00777"></a>00777 <span class="keywordflow">if</span> (usDocStatus & BIT(9)) { -<a name="l00778"></a>00778 PPS_info.tTable = PPS_info.t1Table; -<a name="l00779"></a>00779 } <span class="keywordflow">else</span> { -<a name="l00780"></a>00780 PPS_info.tTable = PPS_info.t0Table; -<a name="l00781"></a>00781 } -<a name="l00782"></a>00782 <span class="comment">/* Clean the entries that should not be used */</span> -<a name="l00783"></a>00783 memset(&PPS_info.t0Table, 0, <span class="keyword">sizeof</span>(PPS_info.t0Table)); -<a name="l00784"></a>00784 memset(&PPS_info.t1Table, 0, <span class="keyword">sizeof</span>(PPS_info.t1Table)); -<a name="l00785"></a>00785 -<a name="l00786"></a>00786 bSuccess = bGetDocumentText(pFile, &PPS_info, -<a name="l00787"></a>00787 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00788"></a>00788 aucHeader, iWordVersion); -<a name="l00789"></a>00789 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00790"></a>00790 vGetDocumentData(pFile, &PPS_info, -<a name="l00791"></a>00791 aulBBD, tBBDLen, aucHeader, iWordVersion); -<a name="l00792"></a>00792 vGetPropertyInfo(pFile, &PPS_info, -<a name="l00793"></a>00793 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00794"></a>00794 aucHeader, iWordVersion); -<a name="l00795"></a>00795 vSetDefaultTabWidth(pFile, &PPS_info, -<a name="l00796"></a>00796 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00797"></a>00797 aucHeader, iWordVersion); -<a name="l00798"></a>00798 vGetNotesInfo(pFile, &PPS_info, -<a name="l00799"></a>00799 aulBBD, tBBDLen, aulSBD, tSBDLen, -<a name="l00800"></a>00800 aucHeader, iWordVersion); -<a name="l00801"></a>00801 } -<a name="l00802"></a>00802 FREE_ALL(); -<a name="l00803"></a>00803 <span class="keywordflow">return</span> bSuccess ? iWordVersion : -1; -<a name="l00804"></a>00804 } <span class="comment">/* end of iInitDocumentOLE */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordtypes_8h_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,333 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/inc/wordtypes.h Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/inc/wordtypes.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordtypes.h</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2004 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Typedefs for the interpretation of MS Word files</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#if !defined(__wordtypes_h)</span> -<a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define __wordtypes_h 1</span> -<a name="l00011"></a>00011 <span class="preprocessor"></span> -<a name="l00012"></a>00012 <span class="preprocessor">#include <time.h></span> -<a name="l00013"></a>00013 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#include "DeskLib:Font.h"</span> -<a name="l00015"></a>00015 <span class="preprocessor">#include "DeskLib:Wimp.h"</span> -<a name="l00016"></a>00016 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00017"></a>00017 -<a name="l00018"></a>00018 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> UCHAR; -<a name="l00019"></a>00019 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> USHORT; -<a name="l00020"></a>00020 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> UINT; -<a name="l00021"></a>00021 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ULONG; -<a name="l00022"></a>00022 -<a name="l00023"></a>00023 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>diagram_tag { -<a name="l00025"></a>00025 <a class="code" href="structdrawfile__info.html">drawfile_info</a> tInfo; -<a name="l00026"></a>00026 window_handle tMainWindow; -<a name="l00027"></a>00027 window_handle tScaleWindow; -<a name="l00028"></a>00028 menu_ptr pSaveMenu; -<a name="l00029"></a>00029 <span class="keywordtype">long</span> lXleft; <span class="comment">/* In DrawUnits */</span> -<a name="l00030"></a>00030 <span class="keywordtype">long</span> lYtop; <span class="comment">/* In DrawUnits */</span> -<a name="l00031"></a>00031 <span class="keywordtype">size_t</span> tMemorySize; -<a name="l00032"></a>00032 <span class="keywordtype">int</span> iScaleFactorCurr; <span class="comment">/* In percentage */</span> -<a name="l00033"></a>00033 <span class="keywordtype">int</span> iScaleFactorTemp; <span class="comment">/* In percentage */</span> -<a name="l00034"></a>00034 <span class="keywordtype">char</span> szFilename[19+1]; -<a name="l00035"></a>00035 } diagram_type; -<a name="l00036"></a>00036 <span class="preprocessor">#else</span> -<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>diagram_tag { -<a name="l00038"></a>00038 FILE *pOutFile; -<a name="l00039"></a>00039 <span class="keywordtype">long</span> lXleft; <span class="comment">/* In DrawUnits */</span> -<a name="l00040"></a>00040 <span class="keywordtype">long</span> lYtop; <span class="comment">/* In DrawUnits */</span> -<a name="l00041"></a>00041 } diagram_type; -<a name="l00042"></a>00042 <span class="keyword">typedef</span> UCHAR drawfile_fontref; -<a name="l00043"></a>00043 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00044"></a>00044 -<a name="l00045"></a>00045 <span class="keyword">typedef</span> <span class="keyword">struct </span>output_tag { -<a name="l00046"></a>00046 <span class="keywordtype">char</span> *szStorage; -<a name="l00047"></a>00047 <span class="keywordtype">long</span> lStringWidth; <span class="comment">/* In millipoints */</span> -<a name="l00048"></a>00048 <span class="keywordtype">size_t</span> tStorageSize; -<a name="l00049"></a>00049 <span class="keywordtype">size_t</span> tNextFree; -<a name="l00050"></a>00050 USHORT usFontStyle; -<a name="l00051"></a>00051 USHORT usFontSize; -<a name="l00052"></a>00052 UCHAR ucFontColor; -<a name="l00053"></a>00053 drawfile_fontref tFontRef; -<a name="l00054"></a>00054 <span class="keyword">struct </span>output_tag *pPrev; -<a name="l00055"></a>00055 <span class="keyword">struct </span>output_tag *pNext; -<a name="l00056"></a>00056 } output_type; -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="comment">/* Types of conversion */</span> -<a name="l00059"></a>00059 <span class="keyword">typedef</span> <span class="keyword">enum</span> conversion_tag { -<a name="l00060"></a>00060 conversion_unknown = 0, -<a name="l00061"></a>00061 conversion_text, -<a name="l00062"></a>00062 conversion_draw, -<a name="l00063"></a>00063 conversion_ps, -<a name="l00064"></a>00064 conversion_xml, -<a name="l00065"></a>00065 conversion_pdf, -<a name="l00066"></a>00066 conversion_fmt_text -<a name="l00067"></a>00067 } conversion_type; -<a name="l00068"></a>00068 -<a name="l00069"></a>00069 <span class="comment">/* Types of encoding */</span> -<a name="l00070"></a>00070 <span class="keyword">typedef</span> <span class="keyword">enum</span> encoding_tag { -<a name="l00071"></a>00071 encoding_neutral = 100, -<a name="l00072"></a>00072 encoding_latin_1 = 801, -<a name="l00073"></a>00073 encoding_latin_2 = 802, -<a name="l00074"></a>00074 encoding_cyrillic = 805, -<a name="l00075"></a>00075 encoding_utf_8 = 1601 -<a name="l00076"></a>00076 } encoding_type; -<a name="l00077"></a>00077 -<a name="l00078"></a>00078 <span class="comment">/* Font translation table entry */</span> -<a name="l00079"></a>00079 <span class="keyword">typedef</span> <span class="keyword">struct </span>font_table_tag { -<a name="l00080"></a>00080 USHORT usFontStyle; -<a name="l00081"></a>00081 UCHAR ucWordFontNumber; -<a name="l00082"></a>00082 UCHAR ucFFN; -<a name="l00083"></a>00083 UCHAR ucEmphasis; -<a name="l00084"></a>00084 UCHAR ucInUse; -<a name="l00085"></a>00085 <span class="keywordtype">char</span> szWordFontname[65]; -<a name="l00086"></a>00086 <span class="keywordtype">char</span> szOurFontname[33]; -<a name="l00087"></a>00087 } font_table_type; -<a name="l00088"></a>00088 -<a name="l00089"></a>00089 <span class="comment">/* Options */</span> -<a name="l00090"></a>00090 <span class="keyword">typedef</span> <span class="keyword">enum</span> image_level_tag { -<a name="l00091"></a>00091 level_gs_special = 0, -<a name="l00092"></a>00092 level_no_images, -<a name="l00093"></a>00093 level_ps_2, -<a name="l00094"></a>00094 level_ps_3, -<a name="l00095"></a>00095 level_default = level_ps_2 -<a name="l00096"></a>00096 } image_level_enum; -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 <span class="keyword">typedef</span> <span class="keyword">struct </span>options_tag { -<a name="l00099"></a>00099 <span class="keywordtype">int</span> iParagraphBreak; -<a name="l00100"></a>00100 conversion_type eConversionType; -<a name="l00101"></a>00101 BOOL bHideHiddenText; -<a name="l00102"></a>00102 BOOL bRemoveRemovedText; -<a name="l00103"></a>00103 BOOL bUseLandscape; -<a name="l00104"></a>00104 encoding_type eEncoding; -<a name="l00105"></a>00105 <span class="keywordtype">int</span> iPageHeight; <span class="comment">/* In points */</span> -<a name="l00106"></a>00106 <span class="keywordtype">int</span> iPageWidth; <span class="comment">/* In points */</span> -<a name="l00107"></a>00107 image_level_enum eImageLevel; -<a name="l00108"></a>00108 <span class="preprocessor">#if defined(__riscos)</span> -<a name="l00109"></a>00109 <span class="preprocessor"></span> BOOL bAutofiletypeAllowed; -<a name="l00110"></a>00110 <span class="keywordtype">int</span> iScaleFactor; <span class="comment">/* As a percentage */</span> -<a name="l00111"></a>00111 <span class="preprocessor">#endif </span><span class="comment">/* __riscos */</span> -<a name="l00112"></a>00112 } options_type; -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 <span class="comment">/* Property Set Storage */</span> -<a name="l00115"></a>00115 <span class="keyword">typedef</span> <span class="keyword">struct </span>pps_tag { -<a name="l00116"></a>00116 ULONG ulSB; -<a name="l00117"></a>00117 ULONG ulSize; -<a name="l00118"></a>00118 } pps_type; -<a name="l00119"></a>00119 <span class="keyword">typedef</span> <span class="keyword">struct </span>pps_info_tag { -<a name="l00120"></a>00120 pps_type tWordDocument; <span class="comment">/* Text stream */</span> -<a name="l00121"></a>00121 pps_type tData; <span class="comment">/* Data stream */</span> -<a name="l00122"></a>00122 pps_type tTable; <span class="comment">/* Table stream */</span> -<a name="l00123"></a>00123 pps_type tSummaryInfo; <span class="comment">/* Summary Information */</span> -<a name="l00124"></a>00124 pps_type tDocSummaryInfo;<span class="comment">/* Document Summary Information */</span> -<a name="l00125"></a>00125 pps_type t0Table; <span class="comment">/* Table 0 stream */</span> -<a name="l00126"></a>00126 pps_type t1Table; <span class="comment">/* Table 1 stream */</span> -<a name="l00127"></a>00127 } pps_info_type; -<a name="l00128"></a>00128 -<a name="l00129"></a>00129 <span class="comment">/* Record of data block information */</span> -<a name="l00130"></a>00130 <span class="keyword">typedef</span> <span class="keyword">struct </span>data_block_tag { -<a name="l00131"></a>00131 ULONG ulFileOffset; -<a name="l00132"></a>00132 ULONG ulDataPos; -<a name="l00133"></a>00133 ULONG ulLength; -<a name="l00134"></a>00134 } data_block_type; -<a name="l00135"></a>00135 -<a name="l00136"></a>00136 <span class="comment">/* Record of text block information */</span> -<a name="l00137"></a>00137 <span class="keyword">typedef</span> <span class="keyword">struct </span>text_block_tag { -<a name="l00138"></a>00138 ULONG ulFileOffset; -<a name="l00139"></a>00139 ULONG ulCharPos; -<a name="l00140"></a>00140 ULONG ulLength; -<a name="l00141"></a>00141 BOOL bUsesUnicode; <span class="comment">/* This block uses 16 bits per character */</span> -<a name="l00142"></a>00142 USHORT usPropMod; -<a name="l00143"></a>00143 } text_block_type; -<a name="l00144"></a>00144 -<a name="l00145"></a>00145 <span class="comment">/* Record of the document block information */</span> -<a name="l00146"></a>00146 <span class="keyword">typedef</span> <span class="keyword">struct </span>document_block_tag { -<a name="l00147"></a>00147 time_t tCreateDate; <span class="comment">/* Unix timestamp */</span> -<a name="l00148"></a>00148 time_t tRevisedDate; <span class="comment">/* Unix timestamp */</span> -<a name="l00149"></a>00149 USHORT usDefaultTabWidth; <span class="comment">/* In twips */</span> -<a name="l00150"></a>00150 UCHAR ucHdrFtrSpecification; -<a name="l00151"></a>00151 } document_block_type; -<a name="l00152"></a>00152 -<a name="l00153"></a>00153 <span class="comment">/* Record of table-row block information */</span> -<a name="l00154"></a>00154 <span class="keyword">typedef</span> <span class="keyword">struct </span>row_block_tag { -<a name="l00155"></a>00155 ULONG ulFileOffsetStart; -<a name="l00156"></a>00156 ULONG ulFileOffsetEnd; -<a name="l00157"></a>00157 ULONG ulCharPosStart; -<a name="l00158"></a>00158 ULONG ulCharPosEnd; -<a name="l00159"></a>00159 <span class="keywordtype">short</span> asColumnWidth[TABLE_COLUMN_MAX+1]; <span class="comment">/* In twips */</span> -<a name="l00160"></a>00160 UCHAR ucNumberOfColumns; -<a name="l00161"></a>00161 UCHAR ucBorderInfo; -<a name="l00162"></a>00162 } row_block_type; -<a name="l00163"></a>00163 -<a name="l00164"></a>00164 <span class="comment">/* Various level types */</span> -<a name="l00165"></a>00165 <span class="keyword">typedef</span> <span class="keyword">enum</span> level_type_tag { -<a name="l00166"></a>00166 level_type_none = 0, -<a name="l00167"></a>00167 level_type_outline, -<a name="l00168"></a>00168 level_type_numbering, -<a name="l00169"></a>00169 level_type_sequence, -<a name="l00170"></a>00170 level_type_pause -<a name="l00171"></a>00171 } level_type_enum; -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 <span class="keyword">typedef</span> <span class="keyword">enum</span> list_id_tag { -<a name="l00174"></a>00174 no_list = 0, -<a name="l00175"></a>00175 text_list, -<a name="l00176"></a>00176 footnote_list, -<a name="l00177"></a>00177 hdrftr_list, -<a name="l00178"></a>00178 macro_list, -<a name="l00179"></a>00179 annotation_list, -<a name="l00180"></a>00180 endnote_list, -<a name="l00181"></a>00181 textbox_list, -<a name="l00182"></a>00182 hdrtextbox_list, -<a name="l00183"></a>00183 end_of_lists -<a name="l00184"></a>00184 } list_id_enum; -<a name="l00185"></a>00185 -<a name="l00186"></a>00186 <span class="comment">/* Linked list of style description information */</span> -<a name="l00187"></a>00187 <span class="keyword">typedef</span> <span class="keyword">struct </span>style_block_tag { -<a name="l00188"></a>00188 ULONG ulFileOffset; <span class="comment">/* The style start with this character */</span> -<a name="l00189"></a>00189 list_id_enum eListID;<span class="comment">/* The fileoffset is in this list */</span> -<a name="l00190"></a>00190 BOOL bNumPause; -<a name="l00191"></a>00191 BOOL bNoRestart; <span class="comment">/* Don't restart by more significant levels */</span> -<a name="l00192"></a>00192 USHORT usIstd; <span class="comment">/* Current style */</span> -<a name="l00193"></a>00193 USHORT usIstdNext; <span class="comment">/* Next style unless overruled */</span> -<a name="l00194"></a>00194 USHORT usStartAt; <span class="comment">/* Number at the start of a list */</span> -<a name="l00195"></a>00195 USHORT usBeforeIndent; <span class="comment">/* Vertical indent before paragraph in twips */</span> -<a name="l00196"></a>00196 USHORT usAfterIndent; <span class="comment">/* Vertical indent after paragraph in twips */</span> -<a name="l00197"></a>00197 USHORT usListIndex; <span class="comment">/* Before Word 8 this field was not filled */</span> -<a name="l00198"></a>00198 USHORT usListChar; <span class="comment">/* Character for an itemized list (Unicode) */</span> -<a name="l00199"></a>00199 <span class="keywordtype">short</span> sLeftIndent; <span class="comment">/* Left indentation in twips */</span> -<a name="l00200"></a>00200 <span class="keywordtype">short</span> sLeftIndent1; <span class="comment">/* First line left indentation in twips */</span> -<a name="l00201"></a>00201 <span class="keywordtype">short</span> sRightIndent; <span class="comment">/* Right indentation in twips */</span> -<a name="l00202"></a>00202 UCHAR ucAlignment; -<a name="l00203"></a>00203 UCHAR ucNFC; <span class="comment">/* Number format code */</span> -<a name="l00204"></a>00204 UCHAR ucNumLevel; -<a name="l00205"></a>00205 UCHAR ucListLevel; <span class="comment">/* Before Word 8 this field was not filled */</span> -<a name="l00206"></a>00206 <span class="keywordtype">char</span> szListChar[4]; <span class="comment">/* Character for an itemized list */</span> -<a name="l00207"></a>00207 } style_block_type; -<a name="l00208"></a>00208 -<a name="l00209"></a>00209 <span class="comment">/* Font description information */</span> -<a name="l00210"></a>00210 <span class="keyword">typedef</span> <span class="keyword">struct </span>font_block_tag { -<a name="l00211"></a>00211 ULONG ulFileOffset; -<a name="l00212"></a>00212 USHORT usFontStyle; -<a name="l00213"></a>00213 USHORT usFontSize; -<a name="l00214"></a>00214 UCHAR ucFontNumber; -<a name="l00215"></a>00215 UCHAR ucFontColor; -<a name="l00216"></a>00216 } font_block_type; -<a name="l00217"></a>00217 -<a name="l00218"></a>00218 <span class="comment">/* Picture description information */</span> -<a name="l00219"></a>00219 <span class="keyword">typedef</span> <span class="keyword">struct </span>picture_block_tag { -<a name="l00220"></a>00220 ULONG ulFileOffset; -<a name="l00221"></a>00221 ULONG ulFileOffsetPicture; -<a name="l00222"></a>00222 ULONG ulPictureOffset; -<a name="l00223"></a>00223 } picture_block_type; -<a name="l00224"></a>00224 -<a name="l00225"></a>00225 <span class="comment">/* Section description information */</span> -<a name="l00226"></a>00226 <span class="keyword">typedef</span> <span class="keyword">struct </span>section_block_tag { -<a name="l00227"></a>00227 BOOL bNewPage; -<a name="l00228"></a>00228 USHORT usNeedPrevLvl; <span class="comment">/* Print previous level numbers */</span> -<a name="l00229"></a>00229 USHORT usHangingIndent; -<a name="l00230"></a>00230 UCHAR aucNFC[9]; <span class="comment">/* Number format code */</span> -<a name="l00231"></a>00231 UCHAR ucHdrFtrSpecification; <span class="comment">/* Which headers/footers Word < 8 */</span> -<a name="l00232"></a>00232 } section_block_type; -<a name="l00233"></a>00233 -<a name="l00234"></a>00234 <span class="comment">/* Header/footer description information */</span> -<a name="l00235"></a>00235 <span class="keyword">typedef</span> <span class="keyword">struct </span>hdrftr_block_tag { -<a name="l00236"></a>00236 output_type *pText; -<a name="l00237"></a>00237 <span class="keywordtype">long</span> lHeight; <span class="comment">/* In DrawUnits */</span> -<a name="l00238"></a>00238 } hdrftr_block_type; -<a name="l00239"></a>00239 -<a name="l00240"></a>00240 <span class="comment">/* Footnote description information */</span> -<a name="l00241"></a>00241 <span class="keyword">typedef</span> <span class="keyword">struct </span>footnote_block_tag { -<a name="l00242"></a>00242 <span class="keywordtype">char</span> *szText; -<a name="l00243"></a>00243 } footnote_block_type; -<a name="l00244"></a>00244 -<a name="l00245"></a>00245 <span class="comment">/* List description information */</span> -<a name="l00246"></a>00246 <span class="keyword">typedef</span> <span class="keyword">struct </span>list_block_tag { -<a name="l00247"></a>00247 ULONG ulStartAt; <span class="comment">/* Number at the start of a list */</span> -<a name="l00248"></a>00248 BOOL bNoRestart; <span class="comment">/* Don't restart by more significant levels */</span> -<a name="l00249"></a>00249 USHORT usListChar; <span class="comment">/* Character for an itemized list (Unicode) */</span> -<a name="l00250"></a>00250 <span class="keywordtype">short</span> sLeftIndent; <span class="comment">/* Left indentation in twips */</span> -<a name="l00251"></a>00251 UCHAR ucNFC; <span class="comment">/* Number format code */</span> -<a name="l00252"></a>00252 } list_block_type; -<a name="l00253"></a>00253 -<a name="l00254"></a>00254 <span class="comment">/* Types of images */</span> -<a name="l00255"></a>00255 <span class="keyword">typedef</span> <span class="keyword">enum</span> imagetype_tag { -<a name="l00256"></a>00256 imagetype_is_unknown = 0, -<a name="l00257"></a>00257 imagetype_is_external, -<a name="l00258"></a>00258 imagetype_is_emf, -<a name="l00259"></a>00259 imagetype_is_wmf, -<a name="l00260"></a>00260 imagetype_is_pict, -<a name="l00261"></a>00261 imagetype_is_jpeg, -<a name="l00262"></a>00262 imagetype_is_png, -<a name="l00263"></a>00263 imagetype_is_dib -<a name="l00264"></a>00264 } imagetype_enum; -<a name="l00265"></a>00265 -<a name="l00266"></a>00266 <span class="comment">/* Types of compression */</span> -<a name="l00267"></a>00267 <span class="keyword">typedef</span> <span class="keyword">enum</span> compression_tag { -<a name="l00268"></a>00268 compression_unknown = 0, -<a name="l00269"></a>00269 compression_none, -<a name="l00270"></a>00270 compression_rle4, -<a name="l00271"></a>00271 compression_rle8, -<a name="l00272"></a>00272 compression_jpeg, -<a name="l00273"></a>00273 compression_zlib -<a name="l00274"></a>00274 } compression_enum; -<a name="l00275"></a>00275 -<a name="l00276"></a>00276 <span class="comment">/* Image information */</span> -<a name="l00277"></a>00277 <span class="keyword">typedef</span> <span class="keyword">struct </span>imagedata_tag { -<a name="l00278"></a>00278 <span class="comment">/* The type of the image */</span> -<a name="l00279"></a>00279 imagetype_enum eImageType; -<a name="l00280"></a>00280 <span class="comment">/* Information from the Word document */</span> -<a name="l00281"></a>00281 <span class="keywordtype">size_t</span> tPosition; -<a name="l00282"></a>00282 <span class="keywordtype">size_t</span> tLength; -<a name="l00283"></a>00283 <span class="keywordtype">int</span> iHorSizeScaled; <span class="comment">/* Size in points */</span> -<a name="l00284"></a>00284 <span class="keywordtype">int</span> iVerSizeScaled; <span class="comment">/* Size in points */</span> -<a name="l00285"></a>00285 <span class="comment">/* Information from the image */</span> -<a name="l00286"></a>00286 <span class="keywordtype">int</span> iWidth; <span class="comment">/* Size in pixels */</span> -<a name="l00287"></a>00287 <span class="keywordtype">int</span> iHeight; <span class="comment">/* Size in pixels */</span> -<a name="l00288"></a>00288 <span class="keywordtype">int</span> iComponents; <span class="comment">/* Number of color components */</span> -<a name="l00289"></a>00289 UINT uiBitsPerComponent; <span class="comment">/* Bits per color component */</span> -<a name="l00290"></a>00290 BOOL bAdobe; <span class="comment">/* Image includes Adobe comment marker */</span> -<a name="l00291"></a>00291 compression_enum eCompression; <span class="comment">/* Type of compression */</span> -<a name="l00292"></a>00292 BOOL bColorImage; <span class="comment">/* Is color image */</span> -<a name="l00293"></a>00293 <span class="keywordtype">int</span> iColorsUsed; <span class="comment">/* 0 = uses the maximum number of colors */</span> -<a name="l00294"></a>00294 UCHAR aucPalette[256][3]; <span class="comment">/* RGB palette */</span> -<a name="l00295"></a>00295 } imagedata_type; -<a name="l00296"></a>00296 -<a name="l00297"></a>00297 <span class="keyword">typedef</span> <span class="keyword">enum</span> row_info_tag { -<a name="l00298"></a>00298 found_nothing, -<a name="l00299"></a>00299 found_a_cell, -<a name="l00300"></a>00300 found_not_a_cell, -<a name="l00301"></a>00301 found_end_of_row, -<a name="l00302"></a>00302 found_not_end_of_row -<a name="l00303"></a>00303 } row_info_enum; -<a name="l00304"></a>00304 -<a name="l00305"></a>00305 <span class="keyword">typedef</span> <span class="keyword">enum</span> notetype_tag { -<a name="l00306"></a>00306 notetype_is_footnote, -<a name="l00307"></a>00307 notetype_is_endnote, -<a name="l00308"></a>00308 notetype_is_unknown -<a name="l00309"></a>00309 } notetype_enum; -<a name="l00310"></a>00310 -<a name="l00311"></a>00311 <span class="keyword">typedef</span> <span class="keyword">enum</span> image_info_tag { -<a name="l00312"></a>00312 image_no_information, -<a name="l00313"></a>00313 image_minimal_information, -<a name="l00314"></a>00314 image_full_information -<a name="l00315"></a>00315 } image_info_enum; -<a name="l00316"></a>00316 -<a name="l00317"></a>00317 <span class="preprocessor">#endif </span><span class="comment">/* __wordtypes_h */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/wordwin_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/wordwin.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/wordwin.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * wordwin.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2005 A.J. van Os; Released under GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Deal with the WIN internals of a MS Word file</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00010"></a>00010 -<a name="l00011"></a>00011 -<a name="l00012"></a>00012 <span class="comment">/*</span> -<a name="l00013"></a>00013 <span class="comment"> * bGetDocumentText - make a list of the text blocks of a Word document</span> -<a name="l00014"></a>00014 <span class="comment"> *</span> -<a name="l00015"></a>00015 <span class="comment"> * Return TRUE when succesful, otherwise FALSE</span> -<a name="l00016"></a>00016 <span class="comment"> */</span> -<a name="l00017"></a>00017 <span class="keyword">static</span> BOOL -<a name="l00018"></a>00018 bGetDocumentText(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00019"></a>00019 { -<a name="l00020"></a>00020 text_block_type tTextBlock; -<a name="l00021"></a>00021 ULONG ulBeginOfText; -<a name="l00022"></a>00022 ULONG ulTextLen, ulFootnoteLen; -<a name="l00023"></a>00023 ULONG ulHdrFtrLen, ulMacroLen, ulAnnotationLen; -<a name="l00024"></a>00024 UINT uiQuickSaves; -<a name="l00025"></a>00025 USHORT usDocStatus; -<a name="l00026"></a>00026 BOOL bTemplate, bFastSaved, bEncrypted, bSuccess; -<a name="l00027"></a>00027 -<a name="l00028"></a>00028 fail(pFile == NULL); -<a name="l00029"></a>00029 fail(aucHeader == NULL); -<a name="l00030"></a>00030 -<a name="l00031"></a>00031 DBG_MSG(<span class="stringliteral">"bGetDocumentText"</span>); -<a name="l00032"></a>00032 -<a name="l00033"></a>00033 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00034"></a>00034 usDocStatus = usGetWord(0x0a, aucHeader); -<a name="l00035"></a>00035 DBG_HEX(usDocStatus); -<a name="l00036"></a>00036 bTemplate = (usDocStatus & BIT(0)) != 0; -<a name="l00037"></a>00037 DBG_MSG_C(bTemplate, <span class="stringliteral">"This document is a Template"</span>); -<a name="l00038"></a>00038 bFastSaved = (usDocStatus & BIT(2)) != 0; -<a name="l00039"></a>00039 uiQuickSaves = (UINT)(usDocStatus & 0x00f0) >> 4; -<a name="l00040"></a>00040 DBG_MSG_C(bFastSaved, <span class="stringliteral">"This document is Fast Saved"</span>); -<a name="l00041"></a>00041 DBG_DEC_C(bFastSaved, uiQuickSaves); -<a name="l00042"></a>00042 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00043"></a>00043 werr(0, <span class="stringliteral">"Word2: fast saved documents are not supported yet"</span>); -<a name="l00044"></a>00044 <span class="keywordflow">return</span> FALSE; -<a name="l00045"></a>00045 } -<a name="l00046"></a>00046 bEncrypted = (usDocStatus & BIT(8)) != 0; -<a name="l00047"></a>00047 <span class="keywordflow">if</span> (bEncrypted) { -<a name="l00048"></a>00048 werr(0, <span class="stringliteral">"Encrypted documents are not supported"</span>); -<a name="l00049"></a>00049 <span class="keywordflow">return</span> FALSE; -<a name="l00050"></a>00050 } -<a name="l00051"></a>00051 -<a name="l00052"></a>00052 <span class="comment">/* Get length information */</span> -<a name="l00053"></a>00053 ulBeginOfText = ulGetLong(0x18, aucHeader); -<a name="l00054"></a>00054 DBG_HEX(ulBeginOfText); -<a name="l00055"></a>00055 ulTextLen = ulGetLong(0x34, aucHeader); -<a name="l00056"></a>00056 ulFootnoteLen = ulGetLong(0x38, aucHeader); -<a name="l00057"></a>00057 ulHdrFtrLen = ulGetLong(0x3c, aucHeader); -<a name="l00058"></a>00058 ulMacroLen = ulGetLong(0x40, aucHeader); -<a name="l00059"></a>00059 ulAnnotationLen = ulGetLong(0x44, aucHeader); -<a name="l00060"></a>00060 DBG_DEC(ulTextLen); -<a name="l00061"></a>00061 DBG_DEC(ulFootnoteLen); -<a name="l00062"></a>00062 DBG_DEC(ulHdrFtrLen); -<a name="l00063"></a>00063 DBG_DEC(ulMacroLen); -<a name="l00064"></a>00064 DBG_DEC(ulAnnotationLen); -<a name="l00065"></a>00065 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00066"></a>00066 bSuccess = FALSE; -<a name="l00067"></a>00067 } <span class="keywordflow">else</span> { -<a name="l00068"></a>00068 tTextBlock.ulFileOffset = ulBeginOfText; -<a name="l00069"></a>00069 tTextBlock.ulCharPos = ulBeginOfText; -<a name="l00070"></a>00070 tTextBlock.ulLength = ulTextLen + -<a name="l00071"></a>00071 ulFootnoteLen + -<a name="l00072"></a>00072 ulHdrFtrLen + ulMacroLen + ulAnnotationLen; -<a name="l00073"></a>00073 tTextBlock.bUsesUnicode = FALSE; -<a name="l00074"></a>00074 tTextBlock.usPropMod = IGNORE_PROPMOD; -<a name="l00075"></a>00075 bSuccess = bAdd2TextBlockList(&tTextBlock); -<a name="l00076"></a>00076 DBG_HEX_C(!bSuccess, tTextBlock.ulFileOffset); -<a name="l00077"></a>00077 DBG_HEX_C(!bSuccess, tTextBlock.ulCharPos); -<a name="l00078"></a>00078 DBG_DEC_C(!bSuccess, tTextBlock.ulLength); -<a name="l00079"></a>00079 DBG_DEC_C(!bSuccess, tTextBlock.bUsesUnicode); -<a name="l00080"></a>00080 DBG_DEC_C(!bSuccess, tTextBlock.usPropMod); -<a name="l00081"></a>00081 } -<a name="l00082"></a>00082 -<a name="l00083"></a>00083 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00084"></a>00084 vSplitBlockList(pFile, -<a name="l00085"></a>00085 ulTextLen, -<a name="l00086"></a>00086 ulFootnoteLen, -<a name="l00087"></a>00087 ulHdrFtrLen, -<a name="l00088"></a>00088 ulMacroLen, -<a name="l00089"></a>00089 ulAnnotationLen, -<a name="l00090"></a>00090 0, -<a name="l00091"></a>00091 0, -<a name="l00092"></a>00092 0, -<a name="l00093"></a>00093 FALSE); -<a name="l00094"></a>00094 } <span class="keywordflow">else</span> { -<a name="l00095"></a>00095 vDestroyTextBlockList(); -<a name="l00096"></a>00096 werr(0, <span class="stringliteral">"I can't find the text of this document"</span>); -<a name="l00097"></a>00097 } -<a name="l00098"></a>00098 <span class="keywordflow">return</span> bSuccess; -<a name="l00099"></a>00099 } <span class="comment">/* end of bGetDocumentText */</span> -<a name="l00100"></a>00100 -<a name="l00101"></a>00101 <span class="comment">/*</span> -<a name="l00102"></a>00102 <span class="comment"> * vGetDocumentData - make a list of the data blocks of a Word document</span> -<a name="l00103"></a>00103 <span class="comment"> */</span> -<a name="l00104"></a>00104 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00105"></a>00105 vGetDocumentData(FILE *pFile, <span class="keyword">const</span> UCHAR *aucHeader) -<a name="l00106"></a>00106 { -<a name="l00107"></a>00107 data_block_type tDataBlock; -<a name="l00108"></a>00108 options_type tOptions; -<a name="l00109"></a>00109 ULONG ulEndOfText, ulBeginCharInfo; -<a name="l00110"></a>00110 BOOL bFastSaved, bHasImages, bSuccess; -<a name="l00111"></a>00111 USHORT usDocStatus; -<a name="l00112"></a>00112 -<a name="l00113"></a>00113 <span class="comment">/* Get the options */</span> -<a name="l00114"></a>00114 vGetOptions(&tOptions); -<a name="l00115"></a>00115 -<a name="l00116"></a>00116 <span class="comment">/* Get the status flags from the header */</span> -<a name="l00117"></a>00117 usDocStatus = usGetWord(0x0a, aucHeader); -<a name="l00118"></a>00118 DBG_HEX(usDocStatus); -<a name="l00119"></a>00119 bFastSaved = (usDocStatus & BIT(2)) != 0; -<a name="l00120"></a>00120 bHasImages = (usDocStatus & BIT(3)) != 0; -<a name="l00121"></a>00121 -<a name="l00122"></a>00122 <span class="keywordflow">if</span> (!bHasImages || -<a name="l00123"></a>00123 tOptions.eConversionType == conversion_text || -<a name="l00124"></a>00124 tOptions.eConversionType == conversion_fmt_text || -<a name="l00125"></a>00125 tOptions.eConversionType == conversion_xml || -<a name="l00126"></a>00126 tOptions.eImageLevel == level_no_images) { -<a name="l00127"></a>00127 <span class="comment">/*</span> -<a name="l00128"></a>00128 <span class="comment"> * No images in the document or text-only output or</span> -<a name="l00129"></a>00129 <span class="comment"> * no images wanted, so no data blocks will be needed</span> -<a name="l00130"></a>00130 <span class="comment"> */</span> -<a name="l00131"></a>00131 vDestroyDataBlockList(); -<a name="l00132"></a>00132 <span class="keywordflow">return</span>; -<a name="l00133"></a>00133 } -<a name="l00134"></a>00134 -<a name="l00135"></a>00135 <span class="keywordflow">if</span> (bFastSaved) { -<a name="l00136"></a>00136 bSuccess = FALSE; -<a name="l00137"></a>00137 } <span class="keywordflow">else</span> { -<a name="l00138"></a>00138 <span class="comment">/* This datablock is too big, but it contains all images */</span> -<a name="l00139"></a>00139 ulEndOfText = ulGetLong(0x1c, aucHeader); -<a name="l00140"></a>00140 DBG_HEX(ulEndOfText); -<a name="l00141"></a>00141 ulBeginCharInfo = ulGetLong(0xa0, aucHeader); -<a name="l00142"></a>00142 DBG_HEX(ulBeginCharInfo); -<a name="l00143"></a>00143 <span class="keywordflow">if</span> (ulBeginCharInfo > ulEndOfText) { -<a name="l00144"></a>00144 tDataBlock.ulFileOffset = ulEndOfText; -<a name="l00145"></a>00145 tDataBlock.ulDataPos = ulEndOfText; -<a name="l00146"></a>00146 tDataBlock.ulLength = ulBeginCharInfo - ulEndOfText; -<a name="l00147"></a>00147 bSuccess = bAdd2DataBlockList(&tDataBlock); -<a name="l00148"></a>00148 DBG_HEX_C(!bSuccess, tDataBlock.ulFileOffset); -<a name="l00149"></a>00149 DBG_HEX_C(!bSuccess, tDataBlock.ulDataPos); -<a name="l00150"></a>00150 DBG_DEC_C(!bSuccess, tDataBlock.ulLength); -<a name="l00151"></a>00151 } <span class="keywordflow">else</span> { -<a name="l00152"></a>00152 bSuccess = ulBeginCharInfo == ulEndOfText; -<a name="l00153"></a>00153 } -<a name="l00154"></a>00154 } -<a name="l00155"></a>00155 -<a name="l00156"></a>00156 <span class="keywordflow">if</span> (!bSuccess) { -<a name="l00157"></a>00157 vDestroyDataBlockList(); -<a name="l00158"></a>00158 werr(0, <span class="stringliteral">"I can't find the data of this document"</span>); -<a name="l00159"></a>00159 } -<a name="l00160"></a>00160 } <span class="comment">/* end of vGetDocumentData */</span> -<a name="l00161"></a>00161 -<a name="l00162"></a>00162 <span class="comment">/*</span> -<a name="l00163"></a>00163 <span class="comment"> * iInitDocumentWIN - initialize an WIN document</span> -<a name="l00164"></a>00164 <span class="comment"> *</span> -<a name="l00165"></a>00165 <span class="comment"> * Returns the version of Word that made the document or -1</span> -<a name="l00166"></a>00166 <span class="comment"> */</span> -<a name="l00167"></a>00167 <span class="keywordtype">int</span> -<a name="l00168"></a>00168 iInitDocumentWIN(FILE *pFile, <span class="keywordtype">long</span> lFilesize) -<a name="l00169"></a>00169 { -<a name="l00170"></a>00170 <span class="keywordtype">int</span> iWordVersion; -<a name="l00171"></a>00171 BOOL bSuccess; -<a name="l00172"></a>00172 USHORT usIdent; -<a name="l00173"></a>00173 UCHAR aucHeader[384]; -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 fail(pFile == NULL); -<a name="l00176"></a>00176 -<a name="l00177"></a>00177 <span class="keywordflow">if</span> (lFilesize < 384) { -<a name="l00178"></a>00178 <span class="keywordflow">return</span> -1; -<a name="l00179"></a>00179 } -<a name="l00180"></a>00180 -<a name="l00181"></a>00181 <span class="comment">/* Read the headerblock */</span> -<a name="l00182"></a>00182 <span class="keywordflow">if</span> (!bReadBytes(aucHeader, 384, 0x00, pFile)) { -<a name="l00183"></a>00183 <span class="keywordflow">return</span> -1; -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 <span class="comment">/* Get the "magic number" from the header */</span> -<a name="l00186"></a>00186 usIdent = usGetWord(0x00, aucHeader); -<a name="l00187"></a>00187 DBG_HEX(usIdent); -<a name="l00188"></a>00188 fail(usIdent != 0xa59b && <span class="comment">/* WinWord 1.x */</span> -<a name="l00189"></a>00189 usIdent != 0xa5db); <span class="comment">/* WinWord 2.0 */</span> -<a name="l00190"></a>00190 iWordVersion = iGetVersionNumber(aucHeader); -<a name="l00191"></a>00191 <span class="keywordflow">if</span> (iWordVersion != 1 && iWordVersion != 2) { -<a name="l00192"></a>00192 werr(0, <span class="stringliteral">"This file is not from ''Win Word 1 or 2'."</span>); -<a name="l00193"></a>00193 <span class="keywordflow">return</span> -1; -<a name="l00194"></a>00194 } -<a name="l00195"></a>00195 bSuccess = bGetDocumentText(pFile, aucHeader); -<a name="l00196"></a>00196 <span class="keywordflow">if</span> (bSuccess) { -<a name="l00197"></a>00197 vGetDocumentData(pFile, aucHeader); -<a name="l00198"></a>00198 vGetPropertyInfo(pFile, NULL, -<a name="l00199"></a>00199 NULL, 0, NULL, 0, -<a name="l00200"></a>00200 aucHeader, iWordVersion); -<a name="l00201"></a>00201 vSetDefaultTabWidth(pFile, NULL, -<a name="l00202"></a>00202 NULL, 0, NULL, 0, -<a name="l00203"></a>00203 aucHeader, iWordVersion); -<a name="l00204"></a>00204 vGetNotesInfo(pFile, NULL, -<a name="l00205"></a>00205 NULL, 0, NULL, 0, -<a name="l00206"></a>00206 aucHeader, iWordVersion); -<a name="l00207"></a>00207 } -<a name="l00208"></a>00208 <span class="keywordflow">return</span> bSuccess ? iWordVersion : -1; -<a name="l00209"></a>00209 } <span class="comment">/* end of iInitDocumentWIN */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/xmalloc_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/xmalloc.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/xmalloc.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * xmalloc.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2005 A.J. van Os</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Extended malloc and friends</span> -<a name="l00007"></a>00007 <span class="comment"> */</span> -<a name="l00008"></a>00008 -<a name="l00009"></a>00009 <span class="preprocessor">#include <stdlib.h></span> -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 <span class="keyword">static</span> <span class="keywordtype">char</span> *szMessage = -<a name="l00014"></a>00014 <span class="stringliteral">"Memory allocation failed, unable to continue"</span>; -<a name="l00015"></a>00015 <span class="preprocessor">#if defined(__dos) && !defined(__DJGPP__)</span> -<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keywordtype">char</span> *szDosMessage = -<a name="l00017"></a>00017 <span class="stringliteral">"DOS can't allocate this kind of memory, unable to continue"</span>; -<a name="l00018"></a>00018 <span class="preprocessor">#endif </span><span class="comment">/* __dos && !__DJGPP__ */</span> -<a name="l00019"></a>00019 -<a name="l00020"></a>00020 -<a name="l00021"></a>00021 <span class="comment">/*</span> -<a name="l00022"></a>00022 <span class="comment"> * xmalloc - Allocates dynamic memory</span> -<a name="l00023"></a>00023 <span class="comment"> *</span> -<a name="l00024"></a>00024 <span class="comment"> * See malloc(3), but unlike malloc(3) xmalloc does not return in case</span> -<a name="l00025"></a>00025 <span class="comment"> * of error.</span> -<a name="l00026"></a>00026 <span class="comment"> */</span> -<a name="l00027"></a>00027 <span class="keywordtype">void</span> * -<a name="l00028"></a>00028 xmalloc(<span class="keywordtype">size_t</span> tSize) -<a name="l00029"></a>00029 { -<a name="l00030"></a>00030 <span class="keywordtype">void</span> *pvTmp; -<a name="l00031"></a>00031 -<a name="l00032"></a>00032 TRACE_MSG(<span class="stringliteral">"xmalloc"</span>); -<a name="l00033"></a>00033 -<a name="l00034"></a>00034 <span class="keywordflow">if</span> (tSize == 0) { -<a name="l00035"></a>00035 tSize = 1; -<a name="l00036"></a>00036 } -<a name="l00037"></a>00037 pvTmp = malloc(tSize); -<a name="l00038"></a>00038 <span class="keywordflow">if</span> (pvTmp == NULL) { -<a name="l00039"></a>00039 DBG_MSG(<span class="stringliteral">"xmalloc returned NULL"</span>); -<a name="l00040"></a>00040 DBG_DEC(tSize); -<a name="l00041"></a>00041 werr(1, szMessage); -<a name="l00042"></a>00042 } -<a name="l00043"></a>00043 <span class="keywordflow">return</span> pvTmp; -<a name="l00044"></a>00044 } <span class="comment">/* end of xmalloc */</span> -<a name="l00045"></a>00045 -<a name="l00046"></a>00046 <span class="comment">/*</span> -<a name="l00047"></a>00047 <span class="comment"> * xcalloc - Allocates and zeros dynamic memory</span> -<a name="l00048"></a>00048 <span class="comment"> *</span> -<a name="l00049"></a>00049 <span class="comment"> * See calloc(3), but unlike calloc(3) xcalloc does not return in case of error</span> -<a name="l00050"></a>00050 <span class="comment"> */</span> -<a name="l00051"></a>00051 <span class="keywordtype">void</span> * -<a name="l00052"></a>00052 xcalloc(<span class="keywordtype">size_t</span> tNmemb, <span class="keywordtype">size_t</span> tSize) -<a name="l00053"></a>00053 { -<a name="l00054"></a>00054 <span class="keywordtype">void</span> *pvTmp; -<a name="l00055"></a>00055 -<a name="l00056"></a>00056 TRACE_MSG(<span class="stringliteral">"xcalloc"</span>); -<a name="l00057"></a>00057 -<a name="l00058"></a>00058 <span class="preprocessor">#if defined(__dos) && !defined(__DJGPP__)</span> -<a name="l00059"></a>00059 <span class="preprocessor"></span> <span class="keywordflow">if</span> ((ULONG)tNmemb * (ULONG)tSize > 0xffffUL) { -<a name="l00060"></a>00060 DBG_DEC((ULONG)tNmemb * (ULONG)tSize); -<a name="l00061"></a>00061 werr(1, szDosMessage); -<a name="l00062"></a>00062 } -<a name="l00063"></a>00063 <span class="preprocessor">#endif </span><span class="comment">/* __dos && !__DJGPP__ */</span> -<a name="l00064"></a>00064 -<a name="l00065"></a>00065 <span class="keywordflow">if</span> (tNmemb == 0 || tSize == 0) { -<a name="l00066"></a>00066 tNmemb = 1; -<a name="l00067"></a>00067 tSize = 1; -<a name="l00068"></a>00068 } -<a name="l00069"></a>00069 pvTmp = calloc(tNmemb, tSize); -<a name="l00070"></a>00070 <span class="keywordflow">if</span> (pvTmp == NULL) { -<a name="l00071"></a>00071 DBG_MSG(<span class="stringliteral">"xcalloc returned NULL"</span>); -<a name="l00072"></a>00072 werr(1, szMessage); -<a name="l00073"></a>00073 } -<a name="l00074"></a>00074 <span class="keywordflow">return</span> pvTmp; -<a name="l00075"></a>00075 } <span class="comment">/* end of xcalloc */</span> -<a name="l00076"></a>00076 -<a name="l00077"></a>00077 <span class="comment">/*</span> -<a name="l00078"></a>00078 <span class="comment"> * xrealloc - Changes the size of a memory object</span> -<a name="l00079"></a>00079 <span class="comment"> *</span> -<a name="l00080"></a>00080 <span class="comment"> * See realloc(3), but unlike realloc(3) xrealloc does not return in case</span> -<a name="l00081"></a>00081 <span class="comment"> * of error.</span> -<a name="l00082"></a>00082 <span class="comment"> */</span> -<a name="l00083"></a>00083 <span class="keywordtype">void</span> * -<a name="l00084"></a>00084 xrealloc(<span class="keywordtype">void</span> *pvArg, <span class="keywordtype">size_t</span> tSize) -<a name="l00085"></a>00085 { -<a name="l00086"></a>00086 <span class="keywordtype">void</span> *pvTmp; -<a name="l00087"></a>00087 -<a name="l00088"></a>00088 TRACE_MSG(<span class="stringliteral">"xrealloc"</span>); -<a name="l00089"></a>00089 -<a name="l00090"></a>00090 pvTmp = realloc(pvArg, tSize); -<a name="l00091"></a>00091 <span class="keywordflow">if</span> (pvTmp == NULL) { -<a name="l00092"></a>00092 DBG_MSG(<span class="stringliteral">"realloc returned NULL"</span>); -<a name="l00093"></a>00093 werr(1, szMessage); -<a name="l00094"></a>00094 } -<a name="l00095"></a>00095 <span class="keywordflow">return</span> pvTmp; -<a name="l00096"></a>00096 } <span class="comment">/* end of xrealloc */</span> -<a name="l00097"></a>00097 -<a name="l00098"></a>00098 <span class="comment">/*</span> -<a name="l00099"></a>00099 <span class="comment"> * xstrdup - Duplicate a string</span> -<a name="l00100"></a>00100 <span class="comment"> *</span> -<a name="l00101"></a>00101 <span class="comment"> * See strdup(3), but unlike strdup(3) xstrdup does not return in case</span> -<a name="l00102"></a>00102 <span class="comment"> * of error.</span> -<a name="l00103"></a>00103 <span class="comment"> *</span> -<a name="l00104"></a>00104 <span class="comment"> * NOTE:</span> -<a name="l00105"></a>00105 <span class="comment"> * Does not use strdup(3), because some systems don't have it.</span> -<a name="l00106"></a>00106 <span class="comment"> */</span> -<a name="l00107"></a>00107 <span class="keywordtype">char</span> * -<a name="l00108"></a>00108 xstrdup(<span class="keyword">const</span> <span class="keywordtype">char</span> *szArg) -<a name="l00109"></a>00109 { -<a name="l00110"></a>00110 <span class="keywordtype">char</span> *szTmp; -<a name="l00111"></a>00111 -<a name="l00112"></a>00112 TRACE_MSG(<span class="stringliteral">"xstrdup"</span>); -<a name="l00113"></a>00113 -<a name="l00114"></a>00114 szTmp = xmalloc(strlen(szArg) + 1); -<a name="l00115"></a>00115 strcpy(szTmp, szArg); -<a name="l00116"></a>00116 <span class="keywordflow">return</span> szTmp; -<a name="l00117"></a>00117 } <span class="comment">/* end of xstrdup */</span> -<a name="l00118"></a>00118 -<a name="l00119"></a>00119 <span class="comment">/*</span> -<a name="l00120"></a>00120 <span class="comment"> * xfree - Deallocates dynamic memory</span> -<a name="l00121"></a>00121 <span class="comment"> *</span> -<a name="l00122"></a>00122 <span class="comment"> * See free(3).</span> -<a name="l00123"></a>00123 <span class="comment"> *</span> -<a name="l00124"></a>00124 <span class="comment"> * returns NULL;</span> -<a name="l00125"></a>00125 <span class="comment"> * This makes p=xfree(p) possible, free memory and overwrite the pointer to it.</span> -<a name="l00126"></a>00126 <span class="comment"> */</span> -<a name="l00127"></a>00127 <span class="keywordtype">void</span> * -<a name="l00128"></a>00128 xfree(<span class="keywordtype">void</span> *pvArg) -<a name="l00129"></a>00129 { -<a name="l00130"></a>00130 TRACE_MSG(<span class="stringliteral">"xfree"</span>); -<a name="l00131"></a>00131 -<a name="l00132"></a>00132 <span class="keywordflow">if</span> (pvArg != NULL) { -<a name="l00133"></a>00133 free(pvArg); -<a name="l00134"></a>00134 } -<a name="l00135"></a>00135 <span class="keywordflow">return</span> NULL; -<a name="l00136"></a>00136 } <span class="comment">/* end of xfree */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>
--- a/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/xml_8c_source.html Fri Jun 11 15:24:34 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1454 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<title>TB9.2 Example Applications: examples/PIPS/antiword/src/xml.c Source File</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<link href="doxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<!-- Generated by Doxygen 1.6.2 --> -<h1>examples/PIPS/antiword/src/xml.c</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> -<a name="l00002"></a>00002 <span class="comment"> * xml.c</span> -<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002-2005 A.J. van Os; Released under GNU GPL</span> -<a name="l00004"></a>00004 <span class="comment"> *</span> -<a name="l00005"></a>00005 <span class="comment"> * Description:</span> -<a name="l00006"></a>00006 <span class="comment"> * Functions to deal with the XML/DocBook format</span> -<a name="l00007"></a>00007 <span class="comment"> *</span> -<a name="l00008"></a>00008 <span class="comment"> */</span> -<a name="l00009"></a>00009 -<a name="l00010"></a>00010 <span class="preprocessor">#include <string.h></span> -<a name="l00011"></a>00011 <span class="preprocessor">#include "antiword.h"</span> -<a name="l00012"></a>00012 -<a name="l00013"></a>00013 -<a name="l00014"></a>00014 <span class="preprocessor">#define vAddEndTagsUntil1(p,t) vAddEndTagsUntil2(p,t,TAG_NOTAG) </span> -<a name="l00015"></a>00015 <span class="preprocessor"></span> -<a name="l00016"></a>00016 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define vStackTrace() __vStackTrace(__LINE__)</span> -<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define vStackTrace() </span><span class="comment">/* EMPTY */</span> -<a name="l00020"></a>00020 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00021"></a>00021 -<a name="l00022"></a>00022 <span class="comment">/* The character set */</span> -<a name="l00023"></a>00023 <span class="keyword">static</span> encoding_type eEncoding = encoding_neutral; -<a name="l00024"></a>00024 <span class="comment">/* Word version */</span> -<a name="l00025"></a>00025 <span class="keyword">static</span> <span class="keywordtype">int</span> iWordVersion = -1; -<a name="l00026"></a>00026 <span class="comment">/* Special treatment for files from Word 4/5/6 on an Apple Macintosh */</span> -<a name="l00027"></a>00027 <span class="keyword">static</span> BOOL bOldMacFile = FALSE; -<a name="l00028"></a>00028 <span class="comment">/* Text is emphasised */</span> -<a name="l00029"></a>00029 <span class="keyword">static</span> BOOL bEmphasisOpen = FALSE; -<a name="l00030"></a>00030 <span class="comment">/* Text is superscript */</span> -<a name="l00031"></a>00031 <span class="keyword">static</span> BOOL bSuperscriptOpen = FALSE; -<a name="l00032"></a>00032 <span class="comment">/* Text is subscript */</span> -<a name="l00033"></a>00033 <span class="keyword">static</span> BOOL bSubscriptOpen = FALSE; -<a name="l00034"></a>00034 <span class="comment">/* Title is open */</span> -<a name="l00035"></a>00035 <span class="keyword">static</span> BOOL bTitleOpen = FALSE; -<a name="l00036"></a>00036 <span class="comment">/* Table is open */</span> -<a name="l00037"></a>00037 <span class="keyword">static</span> BOOL bTableOpen = FALSE; -<a name="l00038"></a>00038 <span class="comment">/* Footnote is open */</span> -<a name="l00039"></a>00039 <span class="keyword">static</span> BOOL bFootnoteOpen = FALSE; -<a name="l00040"></a>00040 <span class="comment">/* Current paragraph level */</span> -<a name="l00041"></a>00041 <span class="keyword">static</span> UINT uiParagraphLevel = 0; -<a name="l00042"></a>00042 <span class="comment">/* Current list level */</span> -<a name="l00043"></a>00043 <span class="keyword">static</span> UINT uiListLevel = 0; -<a name="l00044"></a>00044 <span class="comment">/* Current list level is still empty */</span> -<a name="l00045"></a>00045 <span class="keyword">static</span> BOOL bEmptyListLevel = TRUE; -<a name="l00046"></a>00046 <span class="comment">/* Current header level */</span> -<a name="l00047"></a>00047 <span class="keyword">static</span> USHORT usHeaderLevelCurrent = 0; -<a name="l00048"></a>00048 <span class="comment">/* Current header level is still empty */</span> -<a name="l00049"></a>00049 <span class="keyword">static</span> BOOL bEmptyHeaderLevel = TRUE; -<a name="l00050"></a>00050 <span class="comment">/* Number of columns in the current table */</span> -<a name="l00051"></a>00051 <span class="keyword">static</span> <span class="keywordtype">int</span> iTableColumnsCurrent = 0; -<a name="l00052"></a>00052 <span class="comment">/* Footnote number */</span> -<a name="l00053"></a>00053 <span class="keyword">static</span> UINT uiFootnoteNumber = 0; -<a name="l00054"></a>00054 -<a name="l00055"></a>00055 <span class="comment">/* Constants for the stack */</span> -<a name="l00056"></a>00056 <span class="preprocessor">#define INITIAL_STACK_SIZE 10</span> -<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define EXTENSION_STACK_SIZE 2</span> -<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#else</span> -<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#define EXTENSION_STACK_SIZE 10</span> -<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00062"></a>00062 -<a name="l00063"></a>00063 <span class="comment">/* Variables for the stack */</span> -<a name="l00064"></a>00064 <span class="keyword">static</span> UCHAR *aucStack = NULL; -<a name="l00065"></a>00065 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tStacksize = 0; -<a name="l00066"></a>00066 <span class="keyword">static</span> <span class="keywordtype">size_t</span> tStackNextFree = 0; -<a name="l00067"></a>00067 -<a name="l00068"></a>00068 <span class="comment">/* Constants for the tags */</span> -<a name="l00069"></a>00069 <span class="preprocessor">#define TAG_NOTAG (UCHAR)0</span> -<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#define TAG_AUTHOR (UCHAR)1</span> -<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define TAG_BEGINPAGE (UCHAR)2</span> -<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#define TAG_BOOK (UCHAR)3</span> -<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#define TAG_BOOKINFO (UCHAR)4</span> -<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#define TAG_CHAPTER (UCHAR)5</span> -<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define TAG_COLSPEC (UCHAR)6</span> -<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define TAG_CORPNAME (UCHAR)7</span> -<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define TAG_DATE (UCHAR)8</span> -<a name="l00078"></a>00078 <span class="preprocessor"></span><span class="preprocessor">#define TAG_EMPHASIS (UCHAR)9</span> -<a name="l00079"></a>00079 <span class="preprocessor"></span><span class="preprocessor">#define TAG_ENTRY (UCHAR)10</span> -<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define TAG_FILENAME (UCHAR)11</span> -<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="preprocessor">#define TAG_FOOTNOTE (UCHAR)12</span> -<a name="l00082"></a>00082 <span class="preprocessor"></span><span class="preprocessor">#define TAG_INFORMALTABLE (UCHAR)13</span> -<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define TAG_ITEMIZEDLIST (UCHAR)14</span> -<a name="l00084"></a>00084 <span class="preprocessor"></span><span class="preprocessor">#define TAG_LISTITEM (UCHAR)15</span> -<a name="l00085"></a>00085 <span class="preprocessor"></span><span class="preprocessor">#define TAG_ORDEREDLIST (UCHAR)16</span> -<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="preprocessor">#define TAG_PARA (UCHAR)17</span> -<a name="l00087"></a>00087 <span class="preprocessor"></span><span class="preprocessor">#define TAG_ROW (UCHAR)18</span> -<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SECT1 (UCHAR)19</span> -<a name="l00089"></a>00089 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SECT2 (UCHAR)20</span> -<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SECT3 (UCHAR)21</span> -<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SECT4 (UCHAR)22</span> -<a name="l00092"></a>00092 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SECT5 (UCHAR)23</span> -<a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SUBSCRIPT (UCHAR)24</span> -<a name="l00094"></a>00094 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SUBTITLE (UCHAR)25</span> -<a name="l00095"></a>00095 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SUPERSCRIPT (UCHAR)26</span> -<a name="l00096"></a>00096 <span class="preprocessor"></span><span class="preprocessor">#define TAG_SURNAME (UCHAR)27</span> -<a name="l00097"></a>00097 <span class="preprocessor"></span><span class="preprocessor">#define TAG_TBODY (UCHAR)28</span> -<a name="l00098"></a>00098 <span class="preprocessor"></span><span class="preprocessor">#define TAG_TGROUP (UCHAR)29</span> -<a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define TAG_TITLE (UCHAR)30</span> -<a name="l00100"></a>00100 <span class="preprocessor"></span> -<a name="l00101"></a>00101 <span class="keyword">typedef</span> <span class="keyword">struct </span>docbooktags_tag { -<a name="l00102"></a>00102 UCHAR ucTagnumber; -<a name="l00103"></a>00103 <span class="keywordtype">char</span> szTagname[15]; -<a name="l00104"></a>00104 BOOL bAddNewlineStart; -<a name="l00105"></a>00105 BOOL bAddNewlineEnd; -<a name="l00106"></a>00106 } docbooktags_type; -<a name="l00107"></a>00107 -<a name="l00108"></a>00108 <span class="keyword">static</span> <span class="keyword">const</span> docbooktags_type atDocBookTags[] = { -<a name="l00109"></a>00109 { TAG_NOTAG, <span class="stringliteral">"!ERROR!"</span>, TRUE, TRUE }, -<a name="l00110"></a>00110 { TAG_AUTHOR, <span class="stringliteral">"author"</span>, TRUE, TRUE }, -<a name="l00111"></a>00111 { TAG_BEGINPAGE, <span class="stringliteral">"beginpage"</span>, TRUE, TRUE }, -<a name="l00112"></a>00112 { TAG_BOOK, <span class="stringliteral">"book"</span>, TRUE, TRUE }, -<a name="l00113"></a>00113 { TAG_BOOKINFO, <span class="stringliteral">"bookinfo"</span>, TRUE, TRUE }, -<a name="l00114"></a>00114 { TAG_CHAPTER, <span class="stringliteral">"chapter"</span>, TRUE, TRUE }, -<a name="l00115"></a>00115 { TAG_COLSPEC, <span class="stringliteral">"colspec"</span>, TRUE, TRUE }, -<a name="l00116"></a>00116 { TAG_CORPNAME, <span class="stringliteral">"corpname"</span>, FALSE, FALSE }, -<a name="l00117"></a>00117 { TAG_DATE, <span class="stringliteral">"date"</span>, FALSE, FALSE }, -<a name="l00118"></a>00118 { TAG_EMPHASIS, <span class="stringliteral">"emphasis"</span>, FALSE, FALSE }, -<a name="l00119"></a>00119 { TAG_ENTRY, <span class="stringliteral">"entry"</span>, TRUE, TRUE }, -<a name="l00120"></a>00120 { TAG_FILENAME, <span class="stringliteral">"filename"</span>, FALSE, FALSE }, -<a name="l00121"></a>00121 { TAG_FOOTNOTE, <span class="stringliteral">"footnote"</span>, FALSE, FALSE }, -<a name="l00122"></a>00122 { TAG_INFORMALTABLE, <span class="stringliteral">"informaltable"</span>,TRUE, TRUE }, -<a name="l00123"></a>00123 { TAG_ITEMIZEDLIST, <span class="stringliteral">"itemizedlist"</span>, TRUE, TRUE }, -<a name="l00124"></a>00124 { TAG_LISTITEM, <span class="stringliteral">"listitem"</span>, TRUE, TRUE }, -<a name="l00125"></a>00125 { TAG_ORDEREDLIST, <span class="stringliteral">"orderedlist"</span>, TRUE, TRUE }, -<a name="l00126"></a>00126 { TAG_PARA, <span class="stringliteral">"para"</span>, TRUE, TRUE }, -<a name="l00127"></a>00127 { TAG_ROW, <span class="stringliteral">"row"</span>, TRUE, TRUE }, -<a name="l00128"></a>00128 { TAG_SECT1, <span class="stringliteral">"sect1"</span>, TRUE, TRUE }, -<a name="l00129"></a>00129 { TAG_SECT2, <span class="stringliteral">"sect2"</span>, TRUE, TRUE }, -<a name="l00130"></a>00130 { TAG_SECT3, <span class="stringliteral">"sect3"</span>, TRUE, TRUE }, -<a name="l00131"></a>00131 { TAG_SECT4, <span class="stringliteral">"sect4"</span>, TRUE, TRUE }, -<a name="l00132"></a>00132 { TAG_SECT5, <span class="stringliteral">"sect5"</span>, TRUE, TRUE }, -<a name="l00133"></a>00133 { TAG_SUBSCRIPT, <span class="stringliteral">"subscript"</span>, FALSE, FALSE }, -<a name="l00134"></a>00134 { TAG_SUBTITLE, <span class="stringliteral">"subtitle"</span>, FALSE, FALSE }, -<a name="l00135"></a>00135 { TAG_SUPERSCRIPT, <span class="stringliteral">"superscript"</span>, FALSE, FALSE }, -<a name="l00136"></a>00136 { TAG_SURNAME, <span class="stringliteral">"surname"</span>, FALSE, FALSE }, -<a name="l00137"></a>00137 { TAG_TBODY, <span class="stringliteral">"tbody"</span>, TRUE, TRUE }, -<a name="l00138"></a>00138 { TAG_TGROUP, <span class="stringliteral">"tgroup"</span>, TRUE, TRUE }, -<a name="l00139"></a>00139 { TAG_TITLE, <span class="stringliteral">"title"</span>, FALSE, FALSE }, -<a name="l00140"></a>00140 }; -<a name="l00141"></a>00141 -<a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keywordtype">void</span> vAddStartTag(diagram_type *, UCHAR, <span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00143"></a>00143 <span class="keyword">static</span> <span class="keywordtype">void</span> vAddEndTag(diagram_type *, UCHAR); -<a name="l00144"></a>00144 <span class="keyword">static</span> <span class="keywordtype">void</span> vAddCombinedTag(diagram_type *, UCHAR, <span class="keyword">const</span> <span class="keywordtype">char</span> *); -<a name="l00145"></a>00145 <span class="keyword">static</span> <span class="keywordtype">void</span> vPrintChar(diagram_type *, <span class="keywordtype">char</span>); -<a name="l00146"></a>00146 -<a name="l00147"></a>00147 -<a name="l00148"></a>00148 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00149"></a>00149 <span class="preprocessor"></span><span class="comment">/*</span> -<a name="l00150"></a>00150 <span class="comment"> * vCheckTagTable - check the tag table</span> -<a name="l00151"></a>00151 <span class="comment"> */</span> -<a name="l00152"></a>00152 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00153"></a>00153 vCheckTagTable(<span class="keywordtype">void</span>) -<a name="l00154"></a>00154 { -<a name="l00155"></a>00155 <span class="keywordtype">size_t</span> tIndex; -<a name="l00156"></a>00156 -<a name="l00157"></a>00157 <span class="keywordflow">for</span> (tIndex = 0; tIndex < elementsof(atDocBookTags); tIndex++) { -<a name="l00158"></a>00158 <span class="keywordflow">if</span> (tIndex != (<span class="keywordtype">size_t</span>)atDocBookTags[tIndex].ucTagnumber) { -<a name="l00159"></a>00159 DBG_DEC(tIndex); -<a name="l00160"></a>00160 werr(1, <span class="stringliteral">"Array atDocBookTags is broken"</span>); -<a name="l00161"></a>00161 } -<a name="l00162"></a>00162 } -<a name="l00163"></a>00163 } <span class="comment">/* end of vCheckTagTable */</span> -<a name="l00164"></a>00164 -<a name="l00165"></a>00165 <span class="comment">/*</span> -<a name="l00166"></a>00166 <span class="comment"> * __vStackTrace - show a stack trace</span> -<a name="l00167"></a>00167 <span class="comment"> */</span> -<a name="l00168"></a>00168 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00169"></a>00169 __vStackTrace(<span class="keywordtype">int</span> iLine) -<a name="l00170"></a>00170 { -<a name="l00171"></a>00171 <span class="keywordtype">int</span> iIndex; -<a name="l00172"></a>00172 -<a name="l00173"></a>00173 fprintf(stderr, <span class="stringliteral">"%s[%3d]:\n"</span>, __FILE__, iLine); -<a name="l00174"></a>00174 -<a name="l00175"></a>00175 <span class="keywordflow">if</span> (tStackNextFree == 0) { -<a name="l00176"></a>00176 fprintf(stderr, <span class="stringliteral">"The stack is empty\n"</span>); -<a name="l00177"></a>00177 <span class="keywordflow">return</span>; -<a name="l00178"></a>00178 } -<a name="l00179"></a>00179 <span class="keywordflow">for</span> (iIndex = (<span class="keywordtype">int</span>)tStackNextFree - 1; iIndex >= 0; iIndex--) { -<a name="l00180"></a>00180 fprintf(stderr, <span class="stringliteral">"%2d: %2d: '%s'\n"</span>, -<a name="l00181"></a>00181 iIndex, -<a name="l00182"></a>00182 (<span class="keywordtype">int</span>)atDocBookTags[(UINT)aucStack[iIndex]].ucTagnumber, -<a name="l00183"></a>00183 atDocBookTags[(UINT)aucStack[iIndex]].szTagname); -<a name="l00184"></a>00184 } -<a name="l00185"></a>00185 } <span class="comment">/* end of __vStackTrace */</span> -<a name="l00186"></a>00186 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00187"></a>00187 -<a name="l00188"></a>00188 <span class="comment">/*</span> -<a name="l00189"></a>00189 <span class="comment"> * vPushStack - push a tag onto the stack</span> -<a name="l00190"></a>00190 <span class="comment"> */</span> -<a name="l00191"></a>00191 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00192"></a>00192 vPushStack(UCHAR ucTag) -<a name="l00193"></a>00193 { -<a name="l00194"></a>00194 fail(tStackNextFree > tStacksize); -<a name="l00195"></a>00195 -<a name="l00196"></a>00196 <span class="keywordflow">if</span> (tStackNextFree == tStacksize) { -<a name="l00197"></a>00197 <span class="comment">/* The stack is full; enlarge the stack */</span> -<a name="l00198"></a>00198 tStacksize += EXTENSION_STACK_SIZE; -<a name="l00199"></a>00199 aucStack = xrealloc(aucStack, tStacksize * <span class="keyword">sizeof</span>(UCHAR)); -<a name="l00200"></a>00200 DBG_DEC(tStacksize); -<a name="l00201"></a>00201 } -<a name="l00202"></a>00202 -<a name="l00203"></a>00203 fail(tStackNextFree >= tStacksize); -<a name="l00204"></a>00204 -<a name="l00205"></a>00205 aucStack[tStackNextFree++] = ucTag; -<a name="l00206"></a>00206 } <span class="comment">/* end of vPushStack */</span> -<a name="l00207"></a>00207 -<a name="l00208"></a>00208 <span class="comment">/*</span> -<a name="l00209"></a>00209 <span class="comment"> * vPopStack - pop a tag from the stack</span> -<a name="l00210"></a>00210 <span class="comment"> */</span> -<a name="l00211"></a>00211 <span class="keyword">static</span> UCHAR -<a name="l00212"></a>00212 ucPopStack(<span class="keywordtype">void</span>) -<a name="l00213"></a>00213 { -<a name="l00214"></a>00214 DBG_DEC_C(tStackNextFree > tStacksize, tStackNextFree); -<a name="l00215"></a>00215 DBG_DEC_C(tStackNextFree > tStacksize, tStacksize); -<a name="l00216"></a>00216 fail(tStackNextFree > tStacksize); -<a name="l00217"></a>00217 fail(tStackNextFree == 0); -<a name="l00218"></a>00218 -<a name="l00219"></a>00219 <span class="keywordflow">if</span> (tStackNextFree == 0) { -<a name="l00220"></a>00220 werr(1, <span class="stringliteral">"The stack is empty, unable to continue"</span>); -<a name="l00221"></a>00221 <span class="keywordflow">return</span> TAG_NOTAG; -<a name="l00222"></a>00222 } -<a name="l00223"></a>00223 <span class="keywordflow">return</span> aucStack[--tStackNextFree]; -<a name="l00224"></a>00224 } <span class="comment">/* end of ucPopStack */</span> -<a name="l00225"></a>00225 -<a name="l00226"></a>00226 <span class="comment">/*</span> -<a name="l00227"></a>00227 <span class="comment"> * vReadStack - read a tag from the top of the stack</span> -<a name="l00228"></a>00228 <span class="comment"> */</span> -<a name="l00229"></a>00229 <span class="keyword">static</span> UCHAR -<a name="l00230"></a>00230 ucReadStack(<span class="keywordtype">void</span>) -<a name="l00231"></a>00231 { -<a name="l00232"></a>00232 DBG_DEC_C(tStackNextFree > tStacksize, tStackNextFree); -<a name="l00233"></a>00233 DBG_DEC_C(tStackNextFree > tStacksize, tStacksize); -<a name="l00234"></a>00234 fail(tStackNextFree > tStacksize); -<a name="l00235"></a>00235 -<a name="l00236"></a>00236 <span class="keywordflow">if</span> (tStackNextFree == 0) { -<a name="l00237"></a>00237 <span class="comment">/* The stack is empty */</span> -<a name="l00238"></a>00238 <span class="keywordflow">return</span> TAG_NOTAG; -<a name="l00239"></a>00239 } -<a name="l00240"></a>00240 <span class="keywordflow">return</span> aucStack[tStackNextFree - 1]; -<a name="l00241"></a>00241 } <span class="comment">/* end of ucReadStack */</span> -<a name="l00242"></a>00242 -<a name="l00243"></a>00243 <span class="comment">/*</span> -<a name="l00244"></a>00244 <span class="comment"> * vPrintLevel - print the tag level</span> -<a name="l00245"></a>00245 <span class="comment"> */</span> -<a name="l00246"></a>00246 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00247"></a>00247 vPrintLevel(FILE *pOutFile) -<a name="l00248"></a>00248 { -<a name="l00249"></a>00249 <span class="keywordtype">size_t</span> tIndex; -<a name="l00250"></a>00250 -<a name="l00251"></a>00251 fail(pOutFile == NULL); -<a name="l00252"></a>00252 -<a name="l00253"></a>00253 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tStackNextFree; tIndex++) { -<a name="l00254"></a>00254 (void)putc(<span class="charliteral">' '</span>, pOutFile); -<a name="l00255"></a>00255 } -<a name="l00256"></a>00256 } <span class="comment">/* end of vPrintLevel */</span> -<a name="l00257"></a>00257 -<a name="l00258"></a>00258 <span class="comment">/*</span> -<a name="l00259"></a>00259 <span class="comment"> * vPrintFootnote - print a footnote</span> -<a name="l00260"></a>00260 <span class="comment"> */</span> -<a name="l00261"></a>00261 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00262"></a>00262 vPrintFootnote(diagram_type *pDiag, UINT uiFootnoteIndex) -<a name="l00263"></a>00263 { -<a name="l00264"></a>00264 <span class="keyword">const</span> <span class="keywordtype">char</span> *szText, *pcTmp; -<a name="l00265"></a>00265 BOOL bSuScript; -<a name="l00266"></a>00266 UCHAR ucTopTag; -<a name="l00267"></a>00267 -<a name="l00268"></a>00268 TRACE_MSG(<span class="stringliteral">"vPrintFootnote"</span>); -<a name="l00269"></a>00269 -<a name="l00270"></a>00270 szText = szGetFootnootText(uiFootnoteIndex); -<a name="l00271"></a>00271 -<a name="l00272"></a>00272 <span class="keywordflow">if</span> (szText == NULL) { -<a name="l00273"></a>00273 szText = <span class="stringliteral">""</span>; -<a name="l00274"></a>00274 } -<a name="l00275"></a>00275 -<a name="l00276"></a>00276 <span class="comment">/* Remove the subscript/superscript (if any) */</span> -<a name="l00277"></a>00277 ucTopTag = ucReadStack(); -<a name="l00278"></a>00278 bSuScript = ucTopTag == TAG_SUBSCRIPT || ucTopTag == TAG_SUPERSCRIPT; -<a name="l00279"></a>00279 <span class="keywordflow">if</span> (bSuScript) { -<a name="l00280"></a>00280 vAddEndTag(pDiag, ucTopTag); -<a name="l00281"></a>00281 } -<a name="l00282"></a>00282 -<a name="l00283"></a>00283 <span class="comment">/* Start a footnote */</span> -<a name="l00284"></a>00284 vAddStartTag(pDiag, TAG_FOOTNOTE, NULL); -<a name="l00285"></a>00285 vAddStartTag(pDiag, TAG_PARA, NULL); -<a name="l00286"></a>00286 -<a name="l00287"></a>00287 <span class="comment">/* Print a footnote */</span> -<a name="l00288"></a>00288 <span class="keywordflow">for</span> (pcTmp = szText; *pcTmp != <span class="charliteral">'\0'</span>; pcTmp++) { -<a name="l00289"></a>00289 <span class="keywordflow">if</span> (*pcTmp == PAR_END) { -<a name="l00290"></a>00290 <span class="keywordflow">if</span> (*(pcTmp + 1) != PAR_END && *(pcTmp + 1) != <span class="charliteral">'\0'</span>) { -<a name="l00291"></a>00291 <span class="comment">/* PAR_END is not empty and not last */</span> -<a name="l00292"></a>00292 vAddEndTag(pDiag, TAG_PARA); -<a name="l00293"></a>00293 vAddStartTag(pDiag, TAG_PARA, NULL); -<a name="l00294"></a>00294 } -<a name="l00295"></a>00295 } <span class="keywordflow">else</span> { -<a name="l00296"></a>00296 vPrintChar(pDiag, *pcTmp); -<a name="l00297"></a>00297 } -<a name="l00298"></a>00298 } -<a name="l00299"></a>00299 -<a name="l00300"></a>00300 <span class="comment">/* End a footnote */</span> -<a name="l00301"></a>00301 vAddEndTag(pDiag, TAG_PARA); -<a name="l00302"></a>00302 vAddEndTag(pDiag, TAG_FOOTNOTE); -<a name="l00303"></a>00303 -<a name="l00304"></a>00304 <span class="comment">/* Repair the subscript/superscript (if any) */</span> -<a name="l00305"></a>00305 <span class="keywordflow">if</span> (bSuScript) { -<a name="l00306"></a>00306 vAddStartTag(pDiag, ucTopTag, NULL); -<a name="l00307"></a>00307 } -<a name="l00308"></a>00308 } <span class="comment">/* end of vPrintFootnote */</span> -<a name="l00309"></a>00309 -<a name="l00310"></a>00310 <span class="comment">/*</span> -<a name="l00311"></a>00311 <span class="comment"> * vPrintChar - print a character with XML encoding</span> -<a name="l00312"></a>00312 <span class="comment"> */</span> -<a name="l00313"></a>00313 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00314"></a>00314 vPrintChar(diagram_type *pDiag, <span class="keywordtype">char</span> cChar) -<a name="l00315"></a>00315 { -<a name="l00316"></a>00316 fail(pDiag == NULL); -<a name="l00317"></a>00317 fail(pDiag->pOutFile == NULL); -<a name="l00318"></a>00318 -<a name="l00319"></a>00319 <span class="keywordflow">switch</span> (cChar) { -<a name="l00320"></a>00320 <span class="keywordflow">case</span> FOOTNOTE_OR_ENDNOTE: -<a name="l00321"></a>00321 uiFootnoteNumber++; -<a name="l00322"></a>00322 vPrintFootnote(pDiag, uiFootnoteNumber - 1); -<a name="l00323"></a>00323 <span class="keywordflow">break</span>; -<a name="l00324"></a>00324 <span class="keywordflow">case</span> <span class="charliteral">'<'</span>: -<a name="l00325"></a>00325 fprintf(pDiag->pOutFile, <span class="stringliteral">"%s"</span>, <span class="stringliteral">"&lt;"</span>); -<a name="l00326"></a>00326 <span class="keywordflow">break</span>; -<a name="l00327"></a>00327 <span class="keywordflow">case</span> <span class="charliteral">'>'</span>: -<a name="l00328"></a>00328 fprintf(pDiag->pOutFile, <span class="stringliteral">"%s"</span>, <span class="stringliteral">"&gt;"</span>); -<a name="l00329"></a>00329 <span class="keywordflow">break</span>; -<a name="l00330"></a>00330 <span class="keywordflow">case</span> <span class="charliteral">'&'</span>: -<a name="l00331"></a>00331 fprintf(pDiag->pOutFile, <span class="stringliteral">"%s"</span>, <span class="stringliteral">"&amp;"</span>); -<a name="l00332"></a>00332 <span class="keywordflow">break</span>; -<a name="l00333"></a>00333 <span class="keywordflow">default</span>: -<a name="l00334"></a>00334 (void)putc(cChar, pDiag->pOutFile); -<a name="l00335"></a>00335 <span class="keywordflow">break</span>; -<a name="l00336"></a>00336 } -<a name="l00337"></a>00337 } <span class="comment">/* end of vPrintChar */</span> -<a name="l00338"></a>00338 -<a name="l00339"></a>00339 <span class="comment">/*</span> -<a name="l00340"></a>00340 <span class="comment"> * vPrintSpecialChar - convert and print a character</span> -<a name="l00341"></a>00341 <span class="comment"> */</span> -<a name="l00342"></a>00342 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00343"></a>00343 vPrintSpecialChar(diagram_type *pDiag, USHORT usChar) -<a name="l00344"></a>00344 { -<a name="l00345"></a>00345 ULONG ulChar; -<a name="l00346"></a>00346 <span class="keywordtype">size_t</span> tLen, tIndex; -<a name="l00347"></a>00347 <span class="keywordtype">char</span> szResult[4]; -<a name="l00348"></a>00348 -<a name="l00349"></a>00349 fail(pDiag == NULL); -<a name="l00350"></a>00350 fail(pDiag->pOutFile == NULL); -<a name="l00351"></a>00351 fail(iWordVersion < 0); -<a name="l00352"></a>00352 fail(eEncoding == encoding_neutral); -<a name="l00353"></a>00353 -<a name="l00354"></a>00354 ulChar = ulTranslateCharacters(usChar, 0, iWordVersion, -<a name="l00355"></a>00355 conversion_xml, eEncoding, bOldMacFile); -<a name="l00356"></a>00356 tLen = tUcs2Utf8(ulChar, szResult, <span class="keyword">sizeof</span>(szResult)); -<a name="l00357"></a>00357 <span class="keywordflow">if</span> (tLen == 1) { -<a name="l00358"></a>00358 vPrintChar(pDiag, szResult[0]); -<a name="l00359"></a>00359 } <span class="keywordflow">else</span> { -<a name="l00360"></a>00360 <span class="keywordflow">for</span> (tIndex = 0; tIndex < tLen; tIndex++) { -<a name="l00361"></a>00361 (void)putc(szResult[tIndex], pDiag->pOutFile); -<a name="l00362"></a>00362 } -<a name="l00363"></a>00363 } -<a name="l00364"></a>00364 } <span class="comment">/* end of vPrintSpecialChar */</span> -<a name="l00365"></a>00365 -<a name="l00366"></a>00366 <span class="comment">/*</span> -<a name="l00367"></a>00367 <span class="comment"> * vPrintSpecialString - convert and print a string</span> -<a name="l00368"></a>00368 <span class="comment"> */</span> -<a name="l00369"></a>00369 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00370"></a>00370 vPrintSpecialString(diagram_type *pDiag, <span class="keyword">const</span> <span class="keywordtype">char</span> *szString) -<a name="l00371"></a>00371 { -<a name="l00372"></a>00372 <span class="keywordtype">int</span> iIndex; -<a name="l00373"></a>00373 USHORT usChar; -<a name="l00374"></a>00374 -<a name="l00375"></a>00375 fail(pDiag == NULL); -<a name="l00376"></a>00376 fail(pDiag->pOutFile == NULL); -<a name="l00377"></a>00377 fail(szString == NULL); -<a name="l00378"></a>00378 -<a name="l00379"></a>00379 <span class="keywordflow">for</span> (iIndex = 0; szString[iIndex] != <span class="charliteral">'\0'</span>; iIndex++) { -<a name="l00380"></a>00380 usChar = (USHORT)(UCHAR)szString[iIndex]; -<a name="l00381"></a>00381 vPrintSpecialChar(pDiag, usChar); -<a name="l00382"></a>00382 } -<a name="l00383"></a>00383 } <span class="comment">/* end of vPrintSpecialString */</span> -<a name="l00384"></a>00384 -<a name="l00385"></a>00385 <span class="comment">/*</span> -<a name="l00386"></a>00386 <span class="comment"> * vAddStartTag - add the specified start tag to the file</span> -<a name="l00387"></a>00387 <span class="comment"> */</span> -<a name="l00388"></a>00388 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00389"></a>00389 vAddStartTag(diagram_type *pDiag, UCHAR ucTag, <span class="keyword">const</span> <span class="keywordtype">char</span> *szAttribute) -<a name="l00390"></a>00390 { -<a name="l00391"></a>00391 fail(pDiag == NULL); -<a name="l00392"></a>00392 fail(pDiag->pOutFile == NULL); -<a name="l00393"></a>00393 fail((<span class="keywordtype">size_t</span>)ucTag >= elementsof(atDocBookTags)); -<a name="l00394"></a>00394 -<a name="l00395"></a>00395 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineStart) { -<a name="l00396"></a>00396 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00397"></a>00397 vPrintLevel(pDiag->pOutFile); -<a name="l00398"></a>00398 } -<a name="l00399"></a>00399 -<a name="l00400"></a>00400 <span class="keywordflow">if</span> (szAttribute == NULL || szAttribute[0] == <span class="charliteral">'\0'</span>) { -<a name="l00401"></a>00401 fprintf(pDiag->pOutFile, <span class="stringliteral">"<%s>"</span>, -<a name="l00402"></a>00402 atDocBookTags[(UINT)ucTag].szTagname); -<a name="l00403"></a>00403 } <span class="keywordflow">else</span> { -<a name="l00404"></a>00404 fprintf(pDiag->pOutFile, <span class="stringliteral">"<%s %s>"</span>, -<a name="l00405"></a>00405 atDocBookTags[(UINT)ucTag].szTagname, szAttribute); -<a name="l00406"></a>00406 } -<a name="l00407"></a>00407 -<a name="l00408"></a>00408 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineEnd) { -<a name="l00409"></a>00409 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00410"></a>00410 pDiag->lXleft = 0; -<a name="l00411"></a>00411 } -<a name="l00412"></a>00412 -<a name="l00413"></a>00413 vPushStack(ucTag); -<a name="l00414"></a>00414 -<a name="l00415"></a>00415 <span class="comment">/* Set global variables */</span> -<a name="l00416"></a>00416 <span class="keywordflow">switch</span> (ucTag) { -<a name="l00417"></a>00417 <span class="keywordflow">case</span> TAG_CHAPTER: -<a name="l00418"></a>00418 usHeaderLevelCurrent = 1; -<a name="l00419"></a>00419 bEmptyHeaderLevel = TRUE; -<a name="l00420"></a>00420 <span class="keywordflow">break</span>; -<a name="l00421"></a>00421 <span class="keywordflow">case</span> TAG_SECT1: -<a name="l00422"></a>00422 usHeaderLevelCurrent = 2; -<a name="l00423"></a>00423 bEmptyHeaderLevel = TRUE; -<a name="l00424"></a>00424 <span class="keywordflow">break</span>; -<a name="l00425"></a>00425 <span class="keywordflow">case</span> TAG_SECT2: -<a name="l00426"></a>00426 usHeaderLevelCurrent = 3; -<a name="l00427"></a>00427 bEmptyHeaderLevel = TRUE; -<a name="l00428"></a>00428 <span class="keywordflow">break</span>; -<a name="l00429"></a>00429 <span class="keywordflow">case</span> TAG_SECT3: -<a name="l00430"></a>00430 usHeaderLevelCurrent = 4; -<a name="l00431"></a>00431 bEmptyHeaderLevel = TRUE; -<a name="l00432"></a>00432 <span class="keywordflow">break</span>; -<a name="l00433"></a>00433 <span class="keywordflow">case</span> TAG_SECT4: -<a name="l00434"></a>00434 usHeaderLevelCurrent = 5; -<a name="l00435"></a>00435 bEmptyHeaderLevel = TRUE; -<a name="l00436"></a>00436 <span class="keywordflow">break</span>; -<a name="l00437"></a>00437 <span class="keywordflow">case</span> TAG_SECT5: -<a name="l00438"></a>00438 usHeaderLevelCurrent = 6; -<a name="l00439"></a>00439 bEmptyHeaderLevel = TRUE; -<a name="l00440"></a>00440 <span class="keywordflow">break</span>; -<a name="l00441"></a>00441 <span class="keywordflow">case</span> TAG_TITLE: -<a name="l00442"></a>00442 fail(uiParagraphLevel != 0); -<a name="l00443"></a>00443 bTitleOpen = TRUE; -<a name="l00444"></a>00444 <span class="keywordflow">break</span>; -<a name="l00445"></a>00445 <span class="keywordflow">case</span> TAG_FOOTNOTE: -<a name="l00446"></a>00446 bFootnoteOpen = TRUE; -<a name="l00447"></a>00447 <span class="keywordflow">break</span>; -<a name="l00448"></a>00448 <span class="keywordflow">case</span> TAG_PARA: -<a name="l00449"></a>00449 fail(bTitleOpen && !bFootnoteOpen); -<a name="l00450"></a>00450 uiParagraphLevel++; -<a name="l00451"></a>00451 bEmptyHeaderLevel = FALSE; -<a name="l00452"></a>00452 <span class="keywordflow">break</span>; -<a name="l00453"></a>00453 <span class="keywordflow">case</span> TAG_EMPHASIS: -<a name="l00454"></a>00454 bEmphasisOpen = TRUE; -<a name="l00455"></a>00455 <span class="keywordflow">break</span>; -<a name="l00456"></a>00456 <span class="keywordflow">case</span> TAG_ITEMIZEDLIST: -<a name="l00457"></a>00457 <span class="keywordflow">case</span> TAG_ORDEREDLIST: -<a name="l00458"></a>00458 uiListLevel++; -<a name="l00459"></a>00459 bEmptyListLevel = TRUE; -<a name="l00460"></a>00460 bEmptyHeaderLevel = FALSE; -<a name="l00461"></a>00461 <span class="keywordflow">break</span>; -<a name="l00462"></a>00462 <span class="keywordflow">case</span> TAG_LISTITEM: -<a name="l00463"></a>00463 bEmptyListLevel = FALSE; -<a name="l00464"></a>00464 <span class="keywordflow">break</span>; -<a name="l00465"></a>00465 <span class="keywordflow">case</span> TAG_SUPERSCRIPT: -<a name="l00466"></a>00466 bSuperscriptOpen = TRUE; -<a name="l00467"></a>00467 <span class="keywordflow">break</span>; -<a name="l00468"></a>00468 <span class="keywordflow">case</span> TAG_SUBSCRIPT: -<a name="l00469"></a>00469 bSubscriptOpen = TRUE; -<a name="l00470"></a>00470 <span class="keywordflow">break</span>; -<a name="l00471"></a>00471 <span class="keywordflow">case</span> TAG_INFORMALTABLE: -<a name="l00472"></a>00472 bTableOpen = TRUE; -<a name="l00473"></a>00473 bEmptyHeaderLevel = FALSE; -<a name="l00474"></a>00474 <span class="keywordflow">break</span>; -<a name="l00475"></a>00475 <span class="keywordflow">default</span>: -<a name="l00476"></a>00476 <span class="keywordflow">break</span>; -<a name="l00477"></a>00477 } -<a name="l00478"></a>00478 } <span class="comment">/* end of vAddStartTag */</span> -<a name="l00479"></a>00479 -<a name="l00480"></a>00480 <span class="comment">/*</span> -<a name="l00481"></a>00481 <span class="comment"> * vAddEndTag - add the specified end tag to the file</span> -<a name="l00482"></a>00482 <span class="comment"> */</span> -<a name="l00483"></a>00483 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00484"></a>00484 vAddEndTag(diagram_type *pDiag, UCHAR ucTag) -<a name="l00485"></a>00485 { -<a name="l00486"></a>00486 UCHAR ucTopTag; -<a name="l00487"></a>00487 -<a name="l00488"></a>00488 fail(pDiag == NULL); -<a name="l00489"></a>00489 fail(pDiag->pOutFile == NULL); -<a name="l00490"></a>00490 fail((<span class="keywordtype">size_t</span>)ucTag >= elementsof(atDocBookTags)); -<a name="l00491"></a>00491 -<a name="l00492"></a>00492 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00493"></a>00493 <span class="preprocessor"></span> ucTopTag = ucReadStack(); -<a name="l00494"></a>00494 <span class="keywordflow">if</span> (ucTag != ucTopTag) { -<a name="l00495"></a>00495 DBG_DEC(ucTag); -<a name="l00496"></a>00496 DBG_MSG(atDocBookTags[(UINT)ucTag].szTagname); -<a name="l00497"></a>00497 vStackTrace(); -<a name="l00498"></a>00498 } -<a name="l00499"></a>00499 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00500"></a>00500 -<a name="l00501"></a>00501 ucTopTag = ucPopStack(); -<a name="l00502"></a>00502 fail((<span class="keywordtype">size_t</span>)ucTopTag >= elementsof(atDocBookTags)); -<a name="l00503"></a>00503 <span class="keywordflow">if</span> (ucTag != ucTopTag) { -<a name="l00504"></a>00504 DBG_DEC(ucTag); -<a name="l00505"></a>00505 DBG_DEC(ucTopTag); -<a name="l00506"></a>00506 DBG_FIXME(); -<a name="l00507"></a>00507 werr(1, <span class="stringliteral">"Impossible tag sequence, unable to continue"</span>); -<a name="l00508"></a>00508 } -<a name="l00509"></a>00509 -<a name="l00510"></a>00510 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineEnd) { -<a name="l00511"></a>00511 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00512"></a>00512 vPrintLevel(pDiag->pOutFile); -<a name="l00513"></a>00513 } -<a name="l00514"></a>00514 -<a name="l00515"></a>00515 fprintf(pDiag->pOutFile, <span class="stringliteral">"</%s>"</span>, atDocBookTags[(UINT)ucTag].szTagname); -<a name="l00516"></a>00516 -<a name="l00517"></a>00517 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineStart) { -<a name="l00518"></a>00518 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00519"></a>00519 pDiag->lXleft = 0; -<a name="l00520"></a>00520 } -<a name="l00521"></a>00521 -<a name="l00522"></a>00522 <span class="comment">/* Set global variables */</span> -<a name="l00523"></a>00523 <span class="keywordflow">switch</span> (ucTag) { -<a name="l00524"></a>00524 <span class="keywordflow">case</span> TAG_CHAPTER: -<a name="l00525"></a>00525 usHeaderLevelCurrent = 0; -<a name="l00526"></a>00526 <span class="keywordflow">break</span>; -<a name="l00527"></a>00527 <span class="keywordflow">case</span> TAG_SECT1: -<a name="l00528"></a>00528 usHeaderLevelCurrent = 1; -<a name="l00529"></a>00529 <span class="keywordflow">break</span>; -<a name="l00530"></a>00530 <span class="keywordflow">case</span> TAG_SECT2: -<a name="l00531"></a>00531 usHeaderLevelCurrent = 2; -<a name="l00532"></a>00532 <span class="keywordflow">break</span>; -<a name="l00533"></a>00533 <span class="keywordflow">case</span> TAG_SECT3: -<a name="l00534"></a>00534 usHeaderLevelCurrent = 3; -<a name="l00535"></a>00535 <span class="keywordflow">break</span>; -<a name="l00536"></a>00536 <span class="keywordflow">case</span> TAG_SECT4: -<a name="l00537"></a>00537 usHeaderLevelCurrent = 4; -<a name="l00538"></a>00538 <span class="keywordflow">break</span>; -<a name="l00539"></a>00539 <span class="keywordflow">case</span> TAG_SECT5: -<a name="l00540"></a>00540 usHeaderLevelCurrent = 5; -<a name="l00541"></a>00541 <span class="keywordflow">break</span>; -<a name="l00542"></a>00542 <span class="keywordflow">case</span> TAG_TITLE: -<a name="l00543"></a>00543 bTitleOpen = FALSE; -<a name="l00544"></a>00544 <span class="keywordflow">break</span>; -<a name="l00545"></a>00545 <span class="keywordflow">case</span> TAG_FOOTNOTE: -<a name="l00546"></a>00546 bFootnoteOpen = FALSE; -<a name="l00547"></a>00547 <span class="keywordflow">break</span>; -<a name="l00548"></a>00548 <span class="keywordflow">case</span> TAG_PARA: -<a name="l00549"></a>00549 uiParagraphLevel--; -<a name="l00550"></a>00550 <span class="keywordflow">break</span>; -<a name="l00551"></a>00551 <span class="keywordflow">case</span> TAG_EMPHASIS: -<a name="l00552"></a>00552 bEmphasisOpen = FALSE; -<a name="l00553"></a>00553 <span class="keywordflow">break</span>; -<a name="l00554"></a>00554 <span class="keywordflow">case</span> TAG_SUPERSCRIPT: -<a name="l00555"></a>00555 bSuperscriptOpen = FALSE; -<a name="l00556"></a>00556 <span class="keywordflow">break</span>; -<a name="l00557"></a>00557 <span class="keywordflow">case</span> TAG_ITEMIZEDLIST: -<a name="l00558"></a>00558 <span class="keywordflow">case</span> TAG_ORDEREDLIST: -<a name="l00559"></a>00559 uiListLevel--; -<a name="l00560"></a>00560 <span class="keywordflow">break</span>; -<a name="l00561"></a>00561 <span class="keywordflow">case</span> TAG_SUBSCRIPT: -<a name="l00562"></a>00562 bSubscriptOpen = FALSE; -<a name="l00563"></a>00563 <span class="keywordflow">break</span>; -<a name="l00564"></a>00564 <span class="keywordflow">case</span> TAG_INFORMALTABLE: -<a name="l00565"></a>00565 bTableOpen = FALSE; -<a name="l00566"></a>00566 iTableColumnsCurrent = 0; -<a name="l00567"></a>00567 <span class="keywordflow">break</span>; -<a name="l00568"></a>00568 <span class="keywordflow">default</span>: -<a name="l00569"></a>00569 <span class="keywordflow">break</span>; -<a name="l00570"></a>00570 } -<a name="l00571"></a>00571 } <span class="comment">/* end of vAddEndTag */</span> -<a name="l00572"></a>00572 -<a name="l00573"></a>00573 <span class="comment">/*</span> -<a name="l00574"></a>00574 <span class="comment"> * vAddEndTagOptional - add the specified end tag to the file if needed</span> -<a name="l00575"></a>00575 <span class="comment"> */</span> -<a name="l00576"></a>00576 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00577"></a>00577 vAddEndTagOptional(diagram_type *pDiag, UCHAR ucTag) -<a name="l00578"></a>00578 { -<a name="l00579"></a>00579 UCHAR ucTopTag; -<a name="l00580"></a>00580 -<a name="l00581"></a>00581 ucTopTag = ucReadStack(); -<a name="l00582"></a>00582 <span class="keywordflow">if</span> (ucTag == ucTopTag) { -<a name="l00583"></a>00583 vAddEndTag(pDiag, ucTag); -<a name="l00584"></a>00584 } -<a name="l00585"></a>00585 } <span class="comment">/* end of vAddEndTagOptional */</span> -<a name="l00586"></a>00586 -<a name="l00587"></a>00587 <span class="comment">/*</span> -<a name="l00588"></a>00588 <span class="comment"> * vAddCombinedTag - add the specified start and end tag to the file</span> -<a name="l00589"></a>00589 <span class="comment"> */</span> -<a name="l00590"></a>00590 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00591"></a>00591 vAddCombinedTag(diagram_type *pDiag, UCHAR ucTag, <span class="keyword">const</span> <span class="keywordtype">char</span> *szAttribute) -<a name="l00592"></a>00592 { -<a name="l00593"></a>00593 fail(pDiag == NULL); -<a name="l00594"></a>00594 fail(pDiag->pOutFile == NULL); -<a name="l00595"></a>00595 fail((<span class="keywordtype">size_t</span>)ucTag >= elementsof(atDocBookTags)); -<a name="l00596"></a>00596 -<a name="l00597"></a>00597 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineStart) { -<a name="l00598"></a>00598 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00599"></a>00599 vPrintLevel(pDiag->pOutFile); -<a name="l00600"></a>00600 } -<a name="l00601"></a>00601 -<a name="l00602"></a>00602 <span class="keywordflow">if</span> (szAttribute == NULL || szAttribute[0] == <span class="charliteral">'\0'</span>) { -<a name="l00603"></a>00603 fprintf(pDiag->pOutFile, <span class="stringliteral">"<%s/>"</span>, -<a name="l00604"></a>00604 atDocBookTags[(UINT)ucTag].szTagname); -<a name="l00605"></a>00605 } <span class="keywordflow">else</span> { -<a name="l00606"></a>00606 fprintf(pDiag->pOutFile, <span class="stringliteral">"<%s %s/>"</span>, -<a name="l00607"></a>00607 atDocBookTags[(UINT)ucTag].szTagname, szAttribute); -<a name="l00608"></a>00608 } -<a name="l00609"></a>00609 -<a name="l00610"></a>00610 <span class="keywordflow">if</span> (atDocBookTags[(UINT)ucTag].bAddNewlineStart) { -<a name="l00611"></a>00611 fprintf(pDiag->pOutFile, <span class="stringliteral">"\n"</span>); -<a name="l00612"></a>00612 pDiag->lXleft = 0; -<a name="l00613"></a>00613 } -<a name="l00614"></a>00614 } <span class="comment">/* end of vAddCombinedTag */</span> -<a name="l00615"></a>00615 -<a name="l00616"></a>00616 <span class="comment">/*</span> -<a name="l00617"></a>00617 <span class="comment"> * vAddEndTagsUntil2 - add end tags until one the specified tags is seen</span> -<a name="l00618"></a>00618 <span class="comment"> */</span> -<a name="l00619"></a>00619 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00620"></a>00620 vAddEndTagsUntil2(diagram_type *pDiag, UCHAR ucTag1, UCHAR ucTag2) -<a name="l00621"></a>00621 { -<a name="l00622"></a>00622 UCHAR ucTopTag; -<a name="l00623"></a>00623 -<a name="l00624"></a>00624 <span class="keywordflow">do</span> { -<a name="l00625"></a>00625 ucTopTag = ucReadStack(); -<a name="l00626"></a>00626 <span class="keywordflow">switch</span> (ucTopTag) { -<a name="l00627"></a>00627 <span class="keywordflow">case</span> TAG_CHAPTER: -<a name="l00628"></a>00628 <span class="keywordflow">case</span> TAG_SECT1: -<a name="l00629"></a>00629 <span class="keywordflow">case</span> TAG_SECT2: -<a name="l00630"></a>00630 <span class="keywordflow">case</span> TAG_SECT3: -<a name="l00631"></a>00631 <span class="keywordflow">case</span> TAG_SECT4: -<a name="l00632"></a>00632 <span class="keywordflow">case</span> TAG_SECT5: -<a name="l00633"></a>00633 <span class="keywordflow">if</span> (bEmptyHeaderLevel) { -<a name="l00634"></a>00634 <span class="comment">/*</span> -<a name="l00635"></a>00635 <span class="comment"> * An empty chapter is legal in Word,</span> -<a name="l00636"></a>00636 <span class="comment"> * but not in DocBook.</span> -<a name="l00637"></a>00637 <span class="comment"> */</span> -<a name="l00638"></a>00638 vAddCombinedTag(pDiag, TAG_PARA, NULL); -<a name="l00639"></a>00639 bEmptyHeaderLevel = FALSE; -<a name="l00640"></a>00640 } -<a name="l00641"></a>00641 <span class="keywordflow">break</span>; -<a name="l00642"></a>00642 <span class="keywordflow">case</span> TAG_ITEMIZEDLIST: -<a name="l00643"></a>00643 <span class="keywordflow">case</span> TAG_ORDEREDLIST: -<a name="l00644"></a>00644 <span class="keywordflow">if</span> (bEmptyListLevel) { -<a name="l00645"></a>00645 <span class="comment">/*</span> -<a name="l00646"></a>00646 <span class="comment"> * A list without items is legal in Word,</span> -<a name="l00647"></a>00647 <span class="comment"> * but not in DocBook. (Nor are empty items)</span> -<a name="l00648"></a>00648 <span class="comment"> */</span> -<a name="l00649"></a>00649 vAddStartTag(pDiag, TAG_LISTITEM, NULL); -<a name="l00650"></a>00650 vAddCombinedTag(pDiag, TAG_PARA, NULL); -<a name="l00651"></a>00651 vAddEndTag(pDiag, TAG_LISTITEM); -<a name="l00652"></a>00652 bEmptyListLevel = FALSE; -<a name="l00653"></a>00653 } -<a name="l00654"></a>00654 <span class="keywordflow">break</span>; -<a name="l00655"></a>00655 <span class="keywordflow">default</span>: -<a name="l00656"></a>00656 <span class="keywordflow">break</span>; -<a name="l00657"></a>00657 } -<a name="l00658"></a>00658 vAddEndTag(pDiag, ucTopTag); -<a name="l00659"></a>00659 } <span class="keywordflow">while</span> (ucTopTag != ucTag1 && ucTopTag != ucTag2); -<a name="l00660"></a>00660 } <span class="comment">/* end of vAddEndTagsUntil2 */</span> -<a name="l00661"></a>00661 -<a name="l00662"></a>00662 <span class="comment">/*</span> -<a name="l00663"></a>00663 <span class="comment"> * vCreateBookIntro - create title and bookinfo</span> -<a name="l00664"></a>00664 <span class="comment"> */</span> -<a name="l00665"></a>00665 <span class="keywordtype">void</span> -<a name="l00666"></a>00666 vCreateBookIntro(diagram_type *pDiag, <span class="keywordtype">int</span> iVersion) -<a name="l00667"></a>00667 { -<a name="l00668"></a>00668 <span class="keyword">const</span> <span class="keywordtype">char</span> *szTitle, *szSubject, *szAuthor; -<a name="l00669"></a>00669 <span class="keyword">const</span> <span class="keywordtype">char</span> *szLastSaveDtm, *szCompany; -<a name="l00670"></a>00670 <span class="keyword">const</span> <span class="keywordtype">char</span> *szLanguage; -<a name="l00671"></a>00671 <span class="keywordtype">char</span> szTmp[13]; -<a name="l00672"></a>00672 -<a name="l00673"></a>00673 fail(pDiag == NULL); -<a name="l00674"></a>00674 fail(pDiag->pOutFile == NULL); -<a name="l00675"></a>00675 fail(iVersion < 0); -<a name="l00676"></a>00676 fail(eEncoding == encoding_neutral); -<a name="l00677"></a>00677 -<a name="l00678"></a>00678 iWordVersion = iVersion; -<a name="l00679"></a>00679 bOldMacFile = bIsOldMacFile(); -<a name="l00680"></a>00680 szTitle = szGetTitle(); -<a name="l00681"></a>00681 szSubject = szGetSubject(); -<a name="l00682"></a>00682 szAuthor = szGetAuthor(); -<a name="l00683"></a>00683 szLastSaveDtm = szGetLastSaveDtm(); -<a name="l00684"></a>00684 szCompany = szGetCompany(); -<a name="l00685"></a>00685 -<a name="l00686"></a>00686 <span class="comment">/* Start Book */</span> -<a name="l00687"></a>00687 szLanguage = szGetLanguage(); -<a name="l00688"></a>00688 <span class="keywordflow">if</span> (szLanguage != NULL) { -<a name="l00689"></a>00689 DBG_MSG(szLanguage); -<a name="l00690"></a>00690 sprintf(szTmp, <span class="stringliteral">"lang='%.5s'"</span>, szLanguage); -<a name="l00691"></a>00691 szLanguage = szTmp; -<a name="l00692"></a>00692 } -<a name="l00693"></a>00693 vAddStartTag(pDiag, TAG_BOOK, szLanguage); -<a name="l00694"></a>00694 -<a name="l00695"></a>00695 <span class="comment">/* Book title */</span> -<a name="l00696"></a>00696 <span class="keywordflow">if</span> (szTitle != NULL && szTitle[0] != <span class="charliteral">'\0'</span>) { -<a name="l00697"></a>00697 vAddStartTag(pDiag, TAG_TITLE, NULL); -<a name="l00698"></a>00698 vPrintSpecialString(pDiag, szTitle); -<a name="l00699"></a>00699 vAddEndTag(pDiag, TAG_TITLE); -<a name="l00700"></a>00700 } -<a name="l00701"></a>00701 <span class="comment">/* Bookinfo */</span> -<a name="l00702"></a>00702 <span class="keywordflow">if</span> ((szTitle != NULL && szTitle[0] != <span class="charliteral">'\0'</span>) || -<a name="l00703"></a>00703 (szSubject != NULL && szSubject[0] != <span class="charliteral">'\0'</span>) || -<a name="l00704"></a>00704 (szAuthor != NULL && szAuthor[0] != <span class="charliteral">'\0'</span>) || -<a name="l00705"></a>00705 (szLastSaveDtm != NULL && szLastSaveDtm[0] != <span class="charliteral">'\0'</span>) || -<a name="l00706"></a>00706 (szCompany != NULL && szCompany[0] != <span class="charliteral">'\0'</span>)) { -<a name="l00707"></a>00707 vAddStartTag(pDiag, TAG_BOOKINFO, NULL); -<a name="l00708"></a>00708 <span class="keywordflow">if</span> (szTitle != NULL && szTitle[0] != <span class="charliteral">'\0'</span>) { -<a name="l00709"></a>00709 vAddStartTag(pDiag, TAG_TITLE, NULL); -<a name="l00710"></a>00710 vPrintSpecialString(pDiag, szTitle); -<a name="l00711"></a>00711 vAddEndTag(pDiag, TAG_TITLE); -<a name="l00712"></a>00712 } -<a name="l00713"></a>00713 <span class="keywordflow">if</span> (szSubject != NULL && szSubject[0] != <span class="charliteral">'\0'</span>) { -<a name="l00714"></a>00714 vAddStartTag(pDiag, TAG_SUBTITLE, NULL); -<a name="l00715"></a>00715 vPrintSpecialString(pDiag, szSubject); -<a name="l00716"></a>00716 vAddEndTag(pDiag, TAG_SUBTITLE); -<a name="l00717"></a>00717 } -<a name="l00718"></a>00718 <span class="keywordflow">if</span> (szAuthor != NULL && szAuthor[0] != <span class="charliteral">'\0'</span>) { -<a name="l00719"></a>00719 vAddStartTag(pDiag, TAG_AUTHOR, NULL); -<a name="l00720"></a>00720 vAddStartTag(pDiag, TAG_SURNAME, NULL); -<a name="l00721"></a>00721 vPrintSpecialString(pDiag, szAuthor); -<a name="l00722"></a>00722 vAddEndTag(pDiag, TAG_SURNAME); -<a name="l00723"></a>00723 vAddEndTag(pDiag, TAG_AUTHOR); -<a name="l00724"></a>00724 } -<a name="l00725"></a>00725 <span class="keywordflow">if</span> (szLastSaveDtm != NULL && szLastSaveDtm[0] != <span class="charliteral">'\0'</span>) { -<a name="l00726"></a>00726 vAddStartTag(pDiag, TAG_DATE, NULL); -<a name="l00727"></a>00727 vPrintSpecialString(pDiag, szLastSaveDtm); -<a name="l00728"></a>00728 vAddEndTag(pDiag, TAG_DATE); -<a name="l00729"></a>00729 } -<a name="l00730"></a>00730 <span class="keywordflow">if</span> (szCompany != NULL && szCompany[0] != <span class="charliteral">'\0'</span>) { -<a name="l00731"></a>00731 vAddStartTag(pDiag, TAG_CORPNAME, NULL); -<a name="l00732"></a>00732 vPrintSpecialString(pDiag, szCompany); -<a name="l00733"></a>00733 vAddEndTag(pDiag, TAG_CORPNAME); -<a name="l00734"></a>00734 } -<a name="l00735"></a>00735 vAddEndTag(pDiag, TAG_BOOKINFO); -<a name="l00736"></a>00736 } -<a name="l00737"></a>00737 } <span class="comment">/* end of vCreateBookIntro */</span> -<a name="l00738"></a>00738 -<a name="l00739"></a>00739 <span class="comment">/*</span> -<a name="l00740"></a>00740 <span class="comment"> * vPrologueXML - perform the XML initialization</span> -<a name="l00741"></a>00741 <span class="comment"> */</span> -<a name="l00742"></a>00742 <span class="keywordtype">void</span> -<a name="l00743"></a>00743 vPrologueXML(diagram_type *pDiag, <span class="keyword">const</span> options_type *pOptions) -<a name="l00744"></a>00744 { -<a name="l00745"></a>00745 -<a name="l00746"></a>00746 fail(pDiag == NULL); -<a name="l00747"></a>00747 fail(pDiag->pOutFile == NULL); -<a name="l00748"></a>00748 fail(pOptions == NULL); -<a name="l00749"></a>00749 -<a name="l00750"></a>00750 <span class="preprocessor">#if defined(DEBUG)</span> -<a name="l00751"></a>00751 <span class="preprocessor"></span> vCheckTagTable(); -<a name="l00752"></a>00752 <span class="preprocessor">#endif </span><span class="comment">/* DEBUG */</span> -<a name="l00753"></a>00753 -<a name="l00754"></a>00754 <span class="comment">/* Set global variables to their start values */</span> -<a name="l00755"></a>00755 eEncoding = pOptions->eEncoding; -<a name="l00756"></a>00756 bEmphasisOpen = FALSE; -<a name="l00757"></a>00757 bSuperscriptOpen = FALSE; -<a name="l00758"></a>00758 bSubscriptOpen = FALSE; -<a name="l00759"></a>00759 bTitleOpen = FALSE; -<a name="l00760"></a>00760 bTableOpen = FALSE; -<a name="l00761"></a>00761 bFootnoteOpen = FALSE; -<a name="l00762"></a>00762 uiParagraphLevel = 0; -<a name="l00763"></a>00763 uiListLevel = 0; -<a name="l00764"></a>00764 bEmptyListLevel = TRUE; -<a name="l00765"></a>00765 usHeaderLevelCurrent = 0; -<a name="l00766"></a>00766 bEmptyHeaderLevel = TRUE; -<a name="l00767"></a>00767 iTableColumnsCurrent = 0; -<a name="l00768"></a>00768 uiFootnoteNumber = 0; -<a name="l00769"></a>00769 -<a name="l00770"></a>00770 pDiag->lXleft = 0; -<a name="l00771"></a>00771 pDiag->lYtop = 0; -<a name="l00772"></a>00772 -<a name="l00773"></a>00773 <span class="comment">/* Create an empty stack */</span> -<a name="l00774"></a>00774 tStacksize = INITIAL_STACK_SIZE; -<a name="l00775"></a>00775 aucStack = xcalloc(tStacksize, <span class="keyword">sizeof</span>(UCHAR)); -<a name="l00776"></a>00776 tStackNextFree = 0; -<a name="l00777"></a>00777 } <span class="comment">/* end of vPrologueXML */</span> -<a name="l00778"></a>00778 -<a name="l00779"></a>00779 <span class="comment">/*</span> -<a name="l00780"></a>00780 <span class="comment"> * vEpilogueXML - clean up after everything is done</span> -<a name="l00781"></a>00781 <span class="comment"> */</span> -<a name="l00782"></a>00782 <span class="keywordtype">void</span> -<a name="l00783"></a>00783 vEpilogueXML(diagram_type *pDiag) -<a name="l00784"></a>00784 { -<a name="l00785"></a>00785 vStackTrace(); -<a name="l00786"></a>00786 -<a name="l00787"></a>00787 vAddEndTagsUntil1(pDiag, TAG_BOOK); -<a name="l00788"></a>00788 -<a name="l00789"></a>00789 vStackTrace(); -<a name="l00790"></a>00790 -<a name="l00791"></a>00791 <span class="comment">/* Destroy the stack */</span> -<a name="l00792"></a>00792 fail(tStackNextFree != 0); -<a name="l00793"></a>00793 tStacksize = 0; -<a name="l00794"></a>00794 aucStack = xfree(aucStack); -<a name="l00795"></a>00795 tStackNextFree = 0; -<a name="l00796"></a>00796 } <span class="comment">/* end of vEpilogueXML */</span> -<a name="l00797"></a>00797 -<a name="l00798"></a>00798 <span class="comment">/*</span> -<a name="l00799"></a>00799 <span class="comment"> * vPrintXML - print a XML string</span> -<a name="l00800"></a>00800 <span class="comment"> */</span> -<a name="l00801"></a>00801 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l00802"></a>00802 vPrintXML(diagram_type *pDiag, <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, -<a name="l00803"></a>00803 USHORT usFontstyle) -<a name="l00804"></a>00804 { -<a name="l00805"></a>00805 <span class="keyword">const</span> <span class="keywordtype">char</span> *szAttr; -<a name="l00806"></a>00806 <span class="keywordtype">int</span> iCount; -<a name="l00807"></a>00807 <span class="keywordtype">size_t</span> tNextFree; -<a name="l00808"></a>00808 BOOL bNotReady, bEmphasisNew, bSuperscriptNew, bSubscriptNew; -<a name="l00809"></a>00809 UCHAR ucTopTag, aucStorage[3]; -<a name="l00810"></a>00810 -<a name="l00811"></a>00811 fail(szString == NULL); -<a name="l00812"></a>00812 -<a name="l00813"></a>00813 <span class="keywordflow">if</span> (szString == NULL || szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00814"></a>00814 <span class="keywordflow">return</span>; -<a name="l00815"></a>00815 } -<a name="l00816"></a>00816 -<a name="l00817"></a>00817 <span class="keywordflow">if</span> (tStringLength == 1 && szString[0] == FOOTNOTE_OR_ENDNOTE) { -<a name="l00818"></a>00818 <span class="comment">/* Don't do anything special for just a single footnote */</span> -<a name="l00819"></a>00819 bEmphasisNew = FALSE; -<a name="l00820"></a>00820 bSuperscriptNew = FALSE; -<a name="l00821"></a>00821 bSubscriptNew = FALSE; -<a name="l00822"></a>00822 } <span class="keywordflow">else</span> { -<a name="l00823"></a>00823 <span class="comment">/* Situation normal */</span> -<a name="l00824"></a>00824 bEmphasisNew = bIsBold(usFontstyle) || -<a name="l00825"></a>00825 bIsItalic(usFontstyle) || -<a name="l00826"></a>00826 bIsUnderline(usFontstyle) || -<a name="l00827"></a>00827 bIsStrike(usFontstyle); -<a name="l00828"></a>00828 bSuperscriptNew = bIsSuperscript(usFontstyle); -<a name="l00829"></a>00829 bSubscriptNew = bIsSubscript(usFontstyle); -<a name="l00830"></a>00830 } -<a name="l00831"></a>00831 -<a name="l00832"></a>00832 <span class="comment">/* End what has to be ended (or more to keep the stack happy) */</span> -<a name="l00833"></a>00833 tNextFree = 0; -<a name="l00834"></a>00834 bNotReady = TRUE; -<a name="l00835"></a>00835 <span class="keywordflow">do</span> { -<a name="l00836"></a>00836 ucTopTag = ucReadStack(); -<a name="l00837"></a>00837 <span class="keywordflow">switch</span> (ucTopTag) { -<a name="l00838"></a>00838 <span class="keywordflow">case</span> TAG_EMPHASIS: -<a name="l00839"></a>00839 fail(!bEmphasisOpen); -<a name="l00840"></a>00840 <span class="keywordflow">if</span> (bEmphasisNew) { -<a name="l00841"></a>00841 aucStorage[tNextFree++] = ucTopTag; -<a name="l00842"></a>00842 } -<a name="l00843"></a>00843 vAddEndTag(pDiag, ucTopTag); -<a name="l00844"></a>00844 <span class="keywordflow">break</span>; -<a name="l00845"></a>00845 <span class="keywordflow">case</span> TAG_SUPERSCRIPT: -<a name="l00846"></a>00846 fail(!bSuperscriptOpen); -<a name="l00847"></a>00847 <span class="keywordflow">if</span> (bSuperscriptNew) { -<a name="l00848"></a>00848 aucStorage[tNextFree++] = ucTopTag; -<a name="l00849"></a>00849 } -<a name="l00850"></a>00850 vAddEndTag(pDiag, ucTopTag); -<a name="l00851"></a>00851 <span class="keywordflow">break</span>; -<a name="l00852"></a>00852 <span class="keywordflow">case</span> TAG_SUBSCRIPT: -<a name="l00853"></a>00853 fail(!bSubscriptOpen); -<a name="l00854"></a>00854 <span class="keywordflow">if</span> (bSubscriptNew) { -<a name="l00855"></a>00855 aucStorage[tNextFree++] = ucTopTag; -<a name="l00856"></a>00856 } -<a name="l00857"></a>00857 vAddEndTag(pDiag, ucTopTag); -<a name="l00858"></a>00858 <span class="keywordflow">break</span>; -<a name="l00859"></a>00859 <span class="keywordflow">default</span>: -<a name="l00860"></a>00860 bNotReady = FALSE; -<a name="l00861"></a>00861 <span class="keywordflow">break</span>; -<a name="l00862"></a>00862 } -<a name="l00863"></a>00863 fail(tNextFree > elementsof(aucStorage)); -<a name="l00864"></a>00864 fail(bNotReady && tNextFree == elementsof(aucStorage)); -<a name="l00865"></a>00865 } <span class="keywordflow">while</span> (bNotReady); -<a name="l00866"></a>00866 -<a name="l00867"></a>00867 <span class="comment">/* Just te make sure */</span> -<a name="l00868"></a>00868 vStartOfParagraphXML(pDiag, 1); -<a name="l00869"></a>00869 -<a name="l00870"></a>00870 <span class="comment">/* Restart to keep the stack happy */</span> -<a name="l00871"></a>00871 <span class="keywordflow">for</span> (iCount = (<span class="keywordtype">int</span>)tNextFree - 1; iCount > 0; iCount--) { -<a name="l00872"></a>00872 vAddStartTag(pDiag, aucStorage[iCount], NULL); -<a name="l00873"></a>00873 } -<a name="l00874"></a>00874 -<a name="l00875"></a>00875 <span class="comment">/* Start what has to be started */</span> -<a name="l00876"></a>00876 <span class="keywordflow">if</span> (bEmphasisNew && !bEmphasisOpen) { -<a name="l00877"></a>00877 <span class="keywordflow">if</span> (bIsBold(usFontstyle)) { -<a name="l00878"></a>00878 szAttr = <span class="stringliteral">"role='bold'"</span>; -<a name="l00879"></a>00879 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bIsItalic(usFontstyle)) { -<a name="l00880"></a>00880 szAttr = NULL; -<a name="l00881"></a>00881 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bIsUnderline(usFontstyle)) { -<a name="l00882"></a>00882 szAttr = <span class="stringliteral">"role='underline'"</span>; -<a name="l00883"></a>00883 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (bIsStrike(usFontstyle)) { -<a name="l00884"></a>00884 szAttr = <span class="stringliteral">"role='strikethrough'"</span>; -<a name="l00885"></a>00885 } <span class="keywordflow">else</span> { -<a name="l00886"></a>00886 szAttr = NULL; -<a name="l00887"></a>00887 } -<a name="l00888"></a>00888 vAddStartTag(pDiag, TAG_EMPHASIS, szAttr); -<a name="l00889"></a>00889 } -<a name="l00890"></a>00890 <span class="keywordflow">if</span> (bSuperscriptNew && !bSuperscriptOpen) { -<a name="l00891"></a>00891 vAddStartTag(pDiag, TAG_SUPERSCRIPT, NULL); -<a name="l00892"></a>00892 } -<a name="l00893"></a>00893 <span class="keywordflow">if</span> (bSubscriptNew && !bSubscriptOpen) { -<a name="l00894"></a>00894 vAddStartTag(pDiag, TAG_SUBSCRIPT, NULL); -<a name="l00895"></a>00895 } -<a name="l00896"></a>00896 -<a name="l00897"></a>00897 <span class="comment">/* The print the string */</span> -<a name="l00898"></a>00898 <span class="keywordflow">for</span> (iCount = 0; iCount < (int)tStringLength; iCount++) { -<a name="l00899"></a>00899 vPrintChar(pDiag, szString[iCount]); -<a name="l00900"></a>00900 } -<a name="l00901"></a>00901 } <span class="comment">/* end of vPrintXML */</span> -<a name="l00902"></a>00902 -<a name="l00903"></a>00903 <span class="comment">/*</span> -<a name="l00904"></a>00904 <span class="comment"> * vMove2NextLineXML - move to the next line</span> -<a name="l00905"></a>00905 <span class="comment"> */</span> -<a name="l00906"></a>00906 <span class="keywordtype">void</span> -<a name="l00907"></a>00907 vMove2NextLineXML(diagram_type *pDiag) -<a name="l00908"></a>00908 { -<a name="l00909"></a>00909 fail(pDiag == NULL); -<a name="l00910"></a>00910 -<a name="l00911"></a>00911 <span class="comment">/*</span> -<a name="l00912"></a>00912 <span class="comment"> if (uiParagraphLevel != 0) {</span> -<a name="l00913"></a>00913 <span class="comment"> We need something like HTML's <BR> tag</span> -<a name="l00914"></a>00914 <span class="comment"> }</span> -<a name="l00915"></a>00915 <span class="comment"> */</span> -<a name="l00916"></a>00916 } <span class="comment">/* end of vMove2NextLineXML */</span> -<a name="l00917"></a>00917 -<a name="l00918"></a>00918 <span class="comment">/*</span> -<a name="l00919"></a>00919 <span class="comment"> * vSubstringXML - put a sub string into a diagram</span> -<a name="l00920"></a>00920 <span class="comment"> */</span> -<a name="l00921"></a>00921 <span class="keywordtype">void</span> -<a name="l00922"></a>00922 vSubstringXML(diagram_type *pDiag, -<a name="l00923"></a>00923 <span class="keyword">const</span> <span class="keywordtype">char</span> *szString, <span class="keywordtype">size_t</span> tStringLength, <span class="keywordtype">long</span> lStringWidth, -<a name="l00924"></a>00924 USHORT usFontstyle) -<a name="l00925"></a>00925 { -<a name="l00926"></a>00926 fail(pDiag == NULL || szString == NULL); -<a name="l00927"></a>00927 fail(pDiag->pOutFile == NULL); -<a name="l00928"></a>00928 fail(pDiag->lXleft < 0); -<a name="l00929"></a>00929 fail(tStringLength != strlen(szString)); -<a name="l00930"></a>00930 -<a name="l00931"></a>00931 <span class="keywordflow">if</span> (szString[0] == <span class="charliteral">'\0'</span> || tStringLength == 0) { -<a name="l00932"></a>00932 <span class="keywordflow">return</span>; -<a name="l00933"></a>00933 } -<a name="l00934"></a>00934 -<a name="l00935"></a>00935 vPrintXML(pDiag, szString, tStringLength, usFontstyle); -<a name="l00936"></a>00936 pDiag->lXleft += lStringWidth; -<a name="l00937"></a>00937 } <span class="comment">/* end of vSubstringXML */</span> -<a name="l00938"></a>00938 -<a name="l00939"></a>00939 <span class="comment">/*</span> -<a name="l00940"></a>00940 <span class="comment"> * Create an start of a paragraph</span> -<a name="l00941"></a>00941 <span class="comment"> * Only works on paragraph level one, because Word doesn't allow paragraphs</span> -<a name="l00942"></a>00942 <span class="comment"> * in paragraphs. Other paragraph levels result from DocBooks special needs.</span> -<a name="l00943"></a>00943 <span class="comment"> */</span> -<a name="l00944"></a>00944 <span class="keywordtype">void</span> -<a name="l00945"></a>00945 vStartOfParagraphXML(diagram_type *pDiag, UINT uiMaxLevel) -<a name="l00946"></a>00946 { -<a name="l00947"></a>00947 fail(pDiag == NULL); -<a name="l00948"></a>00948 -<a name="l00949"></a>00949 <span class="keywordflow">if</span> (uiParagraphLevel >= uiMaxLevel || bTitleOpen) { -<a name="l00950"></a>00950 <span class="comment">/* In Word a title is just a paragraph */</span> -<a name="l00951"></a>00951 <span class="keywordflow">return</span>; -<a name="l00952"></a>00952 } -<a name="l00953"></a>00953 <span class="keywordflow">if</span> (uiListLevel != 0 && bEmptyListLevel) { -<a name="l00954"></a>00954 <span class="comment">/* No paragraphs in a list before the first listitem */</span> -<a name="l00955"></a>00955 <span class="keywordflow">return</span>; -<a name="l00956"></a>00956 } -<a name="l00957"></a>00957 <span class="keywordflow">if</span> (usHeaderLevelCurrent == 0) { -<a name="l00958"></a>00958 <span class="comment">/* No paragraphs without an open header */</span> -<a name="l00959"></a>00959 vAddStartTag(pDiag, TAG_CHAPTER, NULL); -<a name="l00960"></a>00960 <span class="comment">/* Dummy title */</span> -<a name="l00961"></a>00961 vAddCombinedTag(pDiag, TAG_TITLE, NULL); -<a name="l00962"></a>00962 } -<a name="l00963"></a>00963 vAddStartTag(pDiag, TAG_PARA, NULL); -<a name="l00964"></a>00964 } <span class="comment">/* end of vStartOfParagraphXML */</span> -<a name="l00965"></a>00965 -<a name="l00966"></a>00966 <span class="comment">/*</span> -<a name="l00967"></a>00967 <span class="comment"> * Create an end of a paragraph</span> -<a name="l00968"></a>00968 <span class="comment"> * Only for paragraph level one and for titles</span> -<a name="l00969"></a>00969 <span class="comment"> */</span> -<a name="l00970"></a>00970 <span class="keywordtype">void</span> -<a name="l00971"></a>00971 vEndOfParagraphXML(diagram_type *pDiag, UINT uiMaxLevel) -<a name="l00972"></a>00972 { -<a name="l00973"></a>00973 UCHAR ucTopTag; -<a name="l00974"></a>00974 -<a name="l00975"></a>00975 fail(pDiag == NULL); -<a name="l00976"></a>00976 -<a name="l00977"></a>00977 <span class="keywordflow">if</span> (uiParagraphLevel > uiMaxLevel) { -<a name="l00978"></a>00978 DBG_DEC(uiParagraphLevel); -<a name="l00979"></a>00979 <span class="keywordflow">return</span>; -<a name="l00980"></a>00980 } -<a name="l00981"></a>00981 -<a name="l00982"></a>00982 <span class="keywordflow">for</span>(;;) { -<a name="l00983"></a>00983 ucTopTag = ucReadStack(); -<a name="l00984"></a>00984 <span class="keywordflow">switch</span> (ucTopTag) { -<a name="l00985"></a>00985 <span class="keywordflow">case</span> TAG_EMPHASIS: -<a name="l00986"></a>00986 fail(!bEmphasisOpen); -<a name="l00987"></a>00987 vAddEndTag(pDiag, TAG_EMPHASIS); -<a name="l00988"></a>00988 <span class="keywordflow">break</span>; -<a name="l00989"></a>00989 <span class="keywordflow">case</span> TAG_SUPERSCRIPT: -<a name="l00990"></a>00990 fail(!bSuperscriptOpen); -<a name="l00991"></a>00991 vAddEndTag(pDiag, TAG_SUPERSCRIPT); -<a name="l00992"></a>00992 <span class="keywordflow">break</span>; -<a name="l00993"></a>00993 <span class="keywordflow">case</span> TAG_SUBSCRIPT: -<a name="l00994"></a>00994 fail(!bSubscriptOpen); -<a name="l00995"></a>00995 vAddEndTag(pDiag, TAG_SUBSCRIPT); -<a name="l00996"></a>00996 <span class="keywordflow">break</span>; -<a name="l00997"></a>00997 <span class="keywordflow">case</span> TAG_TITLE: -<a name="l00998"></a>00998 fail(!bTitleOpen); -<a name="l00999"></a>00999 vAddEndTag(pDiag, TAG_TITLE); -<a name="l01000"></a>01000 <span class="keywordflow">return</span>; -<a name="l01001"></a>01001 <span class="keywordflow">case</span> TAG_PARA: -<a name="l01002"></a>01002 fail(uiParagraphLevel == 0); -<a name="l01003"></a>01003 vAddEndTag(pDiag, TAG_PARA); -<a name="l01004"></a>01004 <span class="keywordflow">return</span>; -<a name="l01005"></a>01005 <span class="keywordflow">case</span> TAG_TBODY: -<a name="l01006"></a>01006 <span class="keywordflow">case</span> TAG_TGROUP: -<a name="l01007"></a>01007 <span class="keywordflow">case</span> TAG_INFORMALTABLE: -<a name="l01008"></a>01008 fail(!bTableOpen); -<a name="l01009"></a>01009 vAddEndTag(pDiag, ucTopTag); -<a name="l01010"></a>01010 <span class="keywordflow">break</span>; -<a name="l01011"></a>01011 <span class="keywordflow">case</span> TAG_NOTAG: -<a name="l01012"></a>01012 DBG_FIXME(); -<a name="l01013"></a>01013 werr(1, <span class="stringliteral">"Impossible tag sequence, unable to continue"</span>); -<a name="l01014"></a>01014 <span class="keywordflow">break</span>; -<a name="l01015"></a>01015 <span class="keywordflow">default</span>: -<a name="l01016"></a>01016 DBG_DEC(ucTopTag); -<a name="l01017"></a>01017 DBG_MSG_C((<span class="keywordtype">size_t</span>)ucTopTag < elementsof(atDocBookTags), -<a name="l01018"></a>01018 atDocBookTags[(UINT)ucTopTag].szTagname); -<a name="l01019"></a>01019 <span class="keywordflow">return</span>; -<a name="l01020"></a>01020 } -<a name="l01021"></a>01021 } -<a name="l01022"></a>01022 } <span class="comment">/* end of vEndOfParagraphXML */</span> -<a name="l01023"></a>01023 -<a name="l01024"></a>01024 <span class="comment">/*</span> -<a name="l01025"></a>01025 <span class="comment"> * Create an end of a page</span> -<a name="l01026"></a>01026 <span class="comment"> */</span> -<a name="l01027"></a>01027 <span class="keywordtype">void</span> -<a name="l01028"></a>01028 vEndOfPageXML(diagram_type *pDiag) -<a name="l01029"></a>01029 { -<a name="l01030"></a>01030 <span class="keywordflow">if</span> (bTableOpen || usHeaderLevelCurrent == 0) { -<a name="l01031"></a>01031 <span class="comment">/* No beginpage in a table or outside a chapter */</span> -<a name="l01032"></a>01032 <span class="keywordflow">return</span>; -<a name="l01033"></a>01033 } -<a name="l01034"></a>01034 <span class="keywordflow">if</span> (bTitleOpen) { -<a name="l01035"></a>01035 <span class="comment">/* A beginpage is not allowed when in a title */</span> -<a name="l01036"></a>01036 <span class="comment">/* So start a new paragraph */</span> -<a name="l01037"></a>01037 vEndOfParagraphXML(pDiag, UINT_MAX); -<a name="l01038"></a>01038 vStartOfParagraphXML(pDiag, UINT_MAX); -<a name="l01039"></a>01039 <span class="keywordflow">return</span>; -<a name="l01040"></a>01040 } -<a name="l01041"></a>01041 vAddCombinedTag(pDiag, TAG_BEGINPAGE, NULL); -<a name="l01042"></a>01042 } <span class="comment">/* end of vEndOfPageXML */</span> -<a name="l01043"></a>01043 -<a name="l01044"></a>01044 <span class="comment">/*</span> -<a name="l01045"></a>01045 <span class="comment"> * vCloseHeaderLevels - close the specified header levels</span> -<a name="l01046"></a>01046 <span class="comment"> */</span> -<a name="l01047"></a>01047 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l01048"></a>01048 vCloseHeaderLevels(diagram_type *pDiag, USHORT usIstd) -<a name="l01049"></a>01049 { -<a name="l01050"></a>01050 BOOL bNotReady; -<a name="l01051"></a>01051 UCHAR ucTopTag; -<a name="l01052"></a>01052 -<a name="l01053"></a>01053 DBG_MSG(<span class="stringliteral">"vCloseHeaderLevels"</span>); -<a name="l01054"></a>01054 DBG_DEC(usIstd); -<a name="l01055"></a>01055 DBG_DEC(usHeaderLevelCurrent); -<a name="l01056"></a>01056 -<a name="l01057"></a>01057 vStackTrace(); -<a name="l01058"></a>01058 -<a name="l01059"></a>01059 bNotReady = TRUE; -<a name="l01060"></a>01060 <span class="keywordflow">do</span> { -<a name="l01061"></a>01061 ucTopTag = ucReadStack(); -<a name="l01062"></a>01062 <span class="keywordflow">switch</span> (ucTopTag) { -<a name="l01063"></a>01063 <span class="keywordflow">case</span> TAG_TITLE: -<a name="l01064"></a>01064 <span class="keywordflow">case</span> TAG_PARA: -<a name="l01065"></a>01065 vAddEndTag(pDiag, ucTopTag); -<a name="l01066"></a>01066 <span class="keywordflow">break</span>; -<a name="l01067"></a>01067 <span class="keywordflow">default</span>: -<a name="l01068"></a>01068 bNotReady = FALSE; -<a name="l01069"></a>01069 <span class="keywordflow">break</span>; -<a name="l01070"></a>01070 } -<a name="l01071"></a>01071 } <span class="keywordflow">while</span> (bNotReady); -<a name="l01072"></a>01072 -<a name="l01073"></a>01073 vStackTrace(); -<a name="l01074"></a>01074 -<a name="l01075"></a>01075 <span class="keywordflow">while</span> (usHeaderLevelCurrent >= usIstd) { -<a name="l01076"></a>01076 <span class="keywordflow">if</span> (bEmptyHeaderLevel) { -<a name="l01077"></a>01077 vAddCombinedTag(pDiag, TAG_PARA, NULL); -<a name="l01078"></a>01078 bEmptyHeaderLevel = FALSE; -<a name="l01079"></a>01079 } -<a name="l01080"></a>01080 <span class="keywordflow">switch</span> (usHeaderLevelCurrent) { -<a name="l01081"></a>01081 <span class="keywordflow">case</span> 1: vAddEndTag(pDiag, TAG_CHAPTER); <span class="keywordflow">break</span>; -<a name="l01082"></a>01082 <span class="keywordflow">case</span> 2: vAddEndTag(pDiag, TAG_SECT1); <span class="keywordflow">break</span>; -<a name="l01083"></a>01083 <span class="keywordflow">case</span> 3: vAddEndTag(pDiag, TAG_SECT2); <span class="keywordflow">break</span>; -<a name="l01084"></a>01084 <span class="keywordflow">case</span> 4: vAddEndTag(pDiag, TAG_SECT3); <span class="keywordflow">break</span>; -<a name="l01085"></a>01085 <span class="keywordflow">case</span> 5: vAddEndTag(pDiag, TAG_SECT4); <span class="keywordflow">break</span>; -<a name="l01086"></a>01086 <span class="keywordflow">case</span> 6: vAddEndTag(pDiag, TAG_SECT5); <span class="keywordflow">break</span>; -<a name="l01087"></a>01087 <span class="keywordflow">default</span>: -<a name="l01088"></a>01088 DBG_DEC(usHeaderLevelCurrent); -<a name="l01089"></a>01089 DBG_FIXME(); -<a name="l01090"></a>01090 <span class="keywordflow">return</span>; -<a name="l01091"></a>01091 } -<a name="l01092"></a>01092 } -<a name="l01093"></a>01093 -<a name="l01094"></a>01094 DBG_DEC(usHeaderLevelCurrent); -<a name="l01095"></a>01095 -<a name="l01096"></a>01096 vStackTrace(); -<a name="l01097"></a>01097 } <span class="comment">/* end of vCloseHeaderLevels */</span> -<a name="l01098"></a>01098 -<a name="l01099"></a>01099 <span class="comment">/*</span> -<a name="l01100"></a>01100 <span class="comment"> * vSetHeadersXML - set the headers</span> -<a name="l01101"></a>01101 <span class="comment"> */</span> -<a name="l01102"></a>01102 <span class="keywordtype">void</span> -<a name="l01103"></a>01103 vSetHeadersXML(diagram_type *pDiag, USHORT usIstd) -<a name="l01104"></a>01104 { -<a name="l01105"></a>01105 fail(pDiag == NULL); -<a name="l01106"></a>01106 -<a name="l01107"></a>01107 <span class="keywordflow">if</span> (usIstd == 0 || usIstd > 6) { -<a name="l01108"></a>01108 DBG_DEC_C(usIstd != 0 && usIstd <= 9, usIstd); -<a name="l01109"></a>01109 <span class="keywordflow">return</span>; -<a name="l01110"></a>01110 } -<a name="l01111"></a>01111 DBG_DEC(usIstd); -<a name="l01112"></a>01112 -<a name="l01113"></a>01113 <span class="keywordflow">if</span> (bTableOpen || uiListLevel != 0) { -<a name="l01114"></a>01114 <span class="comment">/* No headers when you're in a table or in a list */</span> -<a name="l01115"></a>01115 <span class="keywordflow">return</span>; -<a name="l01116"></a>01116 } -<a name="l01117"></a>01117 -<a name="l01118"></a>01118 <span class="comment">/* Close levels */</span> -<a name="l01119"></a>01119 vCloseHeaderLevels(pDiag, usIstd); -<a name="l01120"></a>01120 -<a name="l01121"></a>01121 DBG_DEC(usHeaderLevelCurrent); -<a name="l01122"></a>01122 -<a name="l01123"></a>01123 <span class="comment">/* Open levels */</span> -<a name="l01124"></a>01124 <span class="keywordflow">while</span> (usHeaderLevelCurrent < usIstd) { -<a name="l01125"></a>01125 <span class="keywordflow">switch</span> (usHeaderLevelCurrent) { -<a name="l01126"></a>01126 <span class="keywordflow">case</span> 0: vAddStartTag(pDiag, TAG_CHAPTER, NULL); <span class="keywordflow">break</span>; -<a name="l01127"></a>01127 <span class="keywordflow">case</span> 1: vAddStartTag(pDiag, TAG_SECT1, NULL); <span class="keywordflow">break</span>; -<a name="l01128"></a>01128 <span class="keywordflow">case</span> 2: vAddStartTag(pDiag, TAG_SECT2, NULL); <span class="keywordflow">break</span>; -<a name="l01129"></a>01129 <span class="keywordflow">case</span> 3: vAddStartTag(pDiag, TAG_SECT3, NULL); <span class="keywordflow">break</span>; -<a name="l01130"></a>01130 <span class="keywordflow">case</span> 4: vAddStartTag(pDiag, TAG_SECT4, NULL); <span class="keywordflow">break</span>; -<a name="l01131"></a>01131 <span class="keywordflow">case</span> 5: vAddStartTag(pDiag, TAG_SECT5, NULL); <span class="keywordflow">break</span>; -<a name="l01132"></a>01132 <span class="keywordflow">default</span>: -<a name="l01133"></a>01133 DBG_DEC(usHeaderLevelCurrent); -<a name="l01134"></a>01134 DBG_FIXME(); -<a name="l01135"></a>01135 <span class="keywordflow">return</span>; -<a name="l01136"></a>01136 } -<a name="l01137"></a>01137 fail(usIstd == 0); -<a name="l01138"></a>01138 <span class="comment">/* The next paragraph should be a title */</span> -<a name="l01139"></a>01139 <span class="keywordflow">if</span> (usHeaderLevelCurrent < usIstd) { -<a name="l01140"></a>01140 <span class="comment">/* This chapter level is not in the Word document */</span> -<a name="l01141"></a>01141 vAddCombinedTag(pDiag, TAG_TITLE, NULL); -<a name="l01142"></a>01142 } <span class="keywordflow">else</span> { -<a name="l01143"></a>01143 vAddStartTag(pDiag, TAG_TITLE, NULL); -<a name="l01144"></a>01144 } -<a name="l01145"></a>01145 } -<a name="l01146"></a>01146 } <span class="comment">/* end of vSetHeadersXML */</span> -<a name="l01147"></a>01147 -<a name="l01148"></a>01148 <span class="comment">/*</span> -<a name="l01149"></a>01149 <span class="comment"> * Create a start of a list</span> -<a name="l01150"></a>01150 <span class="comment"> */</span> -<a name="l01151"></a>01151 <span class="keywordtype">void</span> -<a name="l01152"></a>01152 vStartOfListXML(diagram_type *pDiag, UCHAR ucNFC, BOOL bIsEndOfTable) -<a name="l01153"></a>01153 { -<a name="l01154"></a>01154 <span class="keyword">const</span> <span class="keywordtype">char</span> *szAttr; -<a name="l01155"></a>01155 UCHAR ucTag; -<a name="l01156"></a>01156 -<a name="l01157"></a>01157 fail(pDiag == NULL); -<a name="l01158"></a>01158 -<a name="l01159"></a>01159 <span class="keywordflow">if</span> (bIsEndOfTable) { -<a name="l01160"></a>01160 <span class="comment">/* FIXME: until a list in a table is allowed */</span> -<a name="l01161"></a>01161 vEndOfTableXML(pDiag); -<a name="l01162"></a>01162 } -<a name="l01163"></a>01163 -<a name="l01164"></a>01164 <span class="keywordflow">if</span> (bTableOpen) { -<a name="l01165"></a>01165 <span class="comment">/* FIXME: a list in a table should be allowed */</span> -<a name="l01166"></a>01166 <span class="keywordflow">return</span>; -<a name="l01167"></a>01167 } -<a name="l01168"></a>01168 -<a name="l01169"></a>01169 <span class="keywordflow">if</span> (usHeaderLevelCurrent == 0) { -<a name="l01170"></a>01170 <span class="comment">/* No list without an open header */</span> -<a name="l01171"></a>01171 vAddStartTag(pDiag, TAG_CHAPTER, NULL); -<a name="l01172"></a>01172 <span class="comment">/* Dummy title */</span> -<a name="l01173"></a>01173 vAddCombinedTag(pDiag, TAG_TITLE, NULL); -<a name="l01174"></a>01174 } -<a name="l01175"></a>01175 -<a name="l01176"></a>01176 <span class="keywordflow">switch</span> (ucNFC) { -<a name="l01177"></a>01177 <span class="keywordflow">case</span> LIST_ARABIC_NUM: -<a name="l01178"></a>01178 <span class="keywordflow">case</span> LIST_ORDINAL_NUM: -<a name="l01179"></a>01179 <span class="keywordflow">case</span> LIST_NUMBER_TXT: -<a name="l01180"></a>01180 <span class="keywordflow">case</span> LIST_ORDINAL_TXT: -<a name="l01181"></a>01181 <span class="keywordflow">case</span> LIST_OUTLINE_NUM: -<a name="l01182"></a>01182 ucTag = TAG_ORDEREDLIST; -<a name="l01183"></a>01183 szAttr = <span class="stringliteral">"numeration='arabic'"</span>; -<a name="l01184"></a>01184 <span class="keywordflow">break</span>; -<a name="l01185"></a>01185 <span class="keywordflow">case</span> LIST_UPPER_ROMAN: -<a name="l01186"></a>01186 ucTag = TAG_ORDEREDLIST; -<a name="l01187"></a>01187 szAttr = <span class="stringliteral">"numeration='upperroman'"</span>; -<a name="l01188"></a>01188 <span class="keywordflow">break</span>; -<a name="l01189"></a>01189 <span class="keywordflow">case</span> LIST_LOWER_ROMAN: -<a name="l01190"></a>01190 ucTag = TAG_ORDEREDLIST; -<a name="l01191"></a>01191 szAttr = <span class="stringliteral">"numeration='lowerroman'"</span>; -<a name="l01192"></a>01192 <span class="keywordflow">break</span>; -<a name="l01193"></a>01193 <span class="keywordflow">case</span> LIST_UPPER_ALPHA: -<a name="l01194"></a>01194 ucTag = TAG_ORDEREDLIST; -<a name="l01195"></a>01195 szAttr = <span class="stringliteral">"numeration='upperalpha'"</span>; -<a name="l01196"></a>01196 <span class="keywordflow">break</span>; -<a name="l01197"></a>01197 <span class="keywordflow">case</span> LIST_LOWER_ALPHA: -<a name="l01198"></a>01198 ucTag = TAG_ORDEREDLIST; -<a name="l01199"></a>01199 szAttr = <span class="stringliteral">"numeration='loweralpha'"</span>; -<a name="l01200"></a>01200 <span class="keywordflow">break</span>; -<a name="l01201"></a>01201 <span class="keywordflow">case</span> LIST_SPECIAL: -<a name="l01202"></a>01202 <span class="keywordflow">case</span> LIST_SPECIAL2: -<a name="l01203"></a>01203 <span class="keywordflow">case</span> LIST_BULLETS: -<a name="l01204"></a>01204 ucTag = TAG_ITEMIZEDLIST; -<a name="l01205"></a>01205 szAttr = <span class="stringliteral">"mark='bullet'"</span>; -<a name="l01206"></a>01206 <span class="keywordflow">break</span>; -<a name="l01207"></a>01207 <span class="keywordflow">default</span>: -<a name="l01208"></a>01208 ucTag = TAG_ORDEREDLIST; -<a name="l01209"></a>01209 szAttr = <span class="stringliteral">"numeration='arabic'"</span>; -<a name="l01210"></a>01210 DBG_HEX(ucNFC); -<a name="l01211"></a>01211 DBG_FIXME(); -<a name="l01212"></a>01212 <span class="keywordflow">break</span>; -<a name="l01213"></a>01213 } -<a name="l01214"></a>01214 vAddStartTag(pDiag, ucTag, szAttr); -<a name="l01215"></a>01215 } <span class="comment">/* end of vStartOfListXML */</span> -<a name="l01216"></a>01216 -<a name="l01217"></a>01217 <span class="comment">/*</span> -<a name="l01218"></a>01218 <span class="comment"> * Create an end of a list</span> -<a name="l01219"></a>01219 <span class="comment"> */</span> -<a name="l01220"></a>01220 <span class="keywordtype">void</span> -<a name="l01221"></a>01221 vEndOfListXML(diagram_type *pDiag) -<a name="l01222"></a>01222 { -<a name="l01223"></a>01223 fail(pDiag == NULL); -<a name="l01224"></a>01224 -<a name="l01225"></a>01225 <span class="keywordflow">if</span> (bTableOpen) { -<a name="l01226"></a>01226 <span class="comment">/* FIXME: a list in a table should be allowed */</span> -<a name="l01227"></a>01227 <span class="keywordflow">return</span>; -<a name="l01228"></a>01228 } -<a name="l01229"></a>01229 -<a name="l01230"></a>01230 <span class="keywordflow">if</span> (uiListLevel != 0) { -<a name="l01231"></a>01231 vStackTrace(); -<a name="l01232"></a>01232 vAddEndTagsUntil2(pDiag, TAG_ITEMIZEDLIST, TAG_ORDEREDLIST); -<a name="l01233"></a>01233 vStackTrace(); -<a name="l01234"></a>01234 } -<a name="l01235"></a>01235 } <span class="comment">/* end of vEndOfListXML */</span> -<a name="l01236"></a>01236 -<a name="l01237"></a>01237 <span class="comment">/*</span> -<a name="l01238"></a>01238 <span class="comment"> * Create a start of a list item</span> -<a name="l01239"></a>01239 <span class="comment"> */</span> -<a name="l01240"></a>01240 <span class="keywordtype">void</span> -<a name="l01241"></a>01241 vStartOfListItemXML(diagram_type *pDiag, BOOL bNoMarks) -<a name="l01242"></a>01242 { -<a name="l01243"></a>01243 <span class="keyword">const</span> <span class="keywordtype">char</span> *szAttr; -<a name="l01244"></a>01244 UCHAR ucTopTag; -<a name="l01245"></a>01245 -<a name="l01246"></a>01246 fail(pDiag == NULL); -<a name="l01247"></a>01247 -<a name="l01248"></a>01248 <span class="keywordflow">if</span> (bTableOpen) { -<a name="l01249"></a>01249 <span class="comment">/* FIXME: a list in a table should be allowed */</span> -<a name="l01250"></a>01250 <span class="keywordflow">return</span>; -<a name="l01251"></a>01251 } -<a name="l01252"></a>01252 -<a name="l01253"></a>01253 ucTopTag = ucReadStack(); -<a name="l01254"></a>01254 <span class="keywordflow">if</span> (ucTopTag != TAG_ITEMIZEDLIST && ucTopTag != TAG_ORDEREDLIST) { -<a name="l01255"></a>01255 <span class="comment">/* Must end a previous list item first */</span> -<a name="l01256"></a>01256 vAddEndTagsUntil1(pDiag, TAG_LISTITEM); -<a name="l01257"></a>01257 } -<a name="l01258"></a>01258 -<a name="l01259"></a>01259 DBG_DEC_C(ucReadStack() != TAG_ITEMIZEDLIST && -<a name="l01260"></a>01260 ucReadStack() != TAG_ORDEREDLIST, ucReadStack()); -<a name="l01261"></a>01261 -<a name="l01262"></a>01262 <span class="comment">/* Start a new list item */</span> -<a name="l01263"></a>01263 szAttr = bNoMarks ? <span class="stringliteral">"override='none'"</span> : NULL; -<a name="l01264"></a>01264 vAddStartTag(pDiag, TAG_LISTITEM, szAttr); -<a name="l01265"></a>01265 <span class="comment">/* Start a new paragraph (independant of level) */</span> -<a name="l01266"></a>01266 vAddStartTag(pDiag, TAG_PARA, NULL); -<a name="l01267"></a>01267 } <span class="comment">/* end of vStartOfListItemXML */</span> -<a name="l01268"></a>01268 -<a name="l01269"></a>01269 <span class="comment">/*</span> -<a name="l01270"></a>01270 <span class="comment"> * Create a start of a table</span> -<a name="l01271"></a>01271 <span class="comment"> */</span> -<a name="l01272"></a>01272 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l01273"></a>01273 vStartOfTable(diagram_type *pDiag, UCHAR ucBorderInfo) -<a name="l01274"></a>01274 { -<a name="l01275"></a>01275 <span class="keyword">const</span> <span class="keywordtype">char</span> *szFrame; -<a name="l01276"></a>01276 BOOL bNotReady; -<a name="l01277"></a>01277 UCHAR ucTopTag; -<a name="l01278"></a>01278 <span class="keywordtype">char</span> cColSep, cRowSep; -<a name="l01279"></a>01279 <span class="keywordtype">char</span> szAttr[40]; -<a name="l01280"></a>01280 -<a name="l01281"></a>01281 fail(pDiag == NULL); -<a name="l01282"></a>01282 -<a name="l01283"></a>01283 <span class="comment">/* Close elements that cannot contain a table */</span> -<a name="l01284"></a>01284 bNotReady = TRUE; -<a name="l01285"></a>01285 <span class="keywordflow">do</span> { -<a name="l01286"></a>01286 ucTopTag = ucReadStack(); -<a name="l01287"></a>01287 <span class="keywordflow">switch</span> (ucTopTag) { -<a name="l01288"></a>01288 <span class="keywordflow">case</span> TAG_TITLE: -<a name="l01289"></a>01289 fail(!bTitleOpen); -<a name="l01290"></a>01290 vAddEndTag(pDiag, TAG_TITLE); -<a name="l01291"></a>01291 <span class="keywordflow">break</span>; -<a name="l01292"></a>01292 <span class="keywordflow">case</span> TAG_EMPHASIS: -<a name="l01293"></a>01293 fail(!bEmphasisOpen); -<a name="l01294"></a>01294 vAddEndTag(pDiag, TAG_EMPHASIS); -<a name="l01295"></a>01295 <span class="keywordflow">break</span>; -<a name="l01296"></a>01296 <span class="keywordflow">case</span> TAG_SUPERSCRIPT: -<a name="l01297"></a>01297 fail(!bSuperscriptOpen); -<a name="l01298"></a>01298 vAddEndTag(pDiag, TAG_SUPERSCRIPT); -<a name="l01299"></a>01299 <span class="keywordflow">break</span>; -<a name="l01300"></a>01300 <span class="keywordflow">case</span> TAG_SUBSCRIPT: -<a name="l01301"></a>01301 fail(!bSubscriptOpen); -<a name="l01302"></a>01302 vAddEndTag(pDiag, TAG_SUBSCRIPT); -<a name="l01303"></a>01303 <span class="keywordflow">break</span>; -<a name="l01304"></a>01304 <span class="keywordflow">default</span>: -<a name="l01305"></a>01305 bNotReady = FALSE; -<a name="l01306"></a>01306 <span class="keywordflow">break</span>; -<a name="l01307"></a>01307 } -<a name="l01308"></a>01308 } <span class="keywordflow">while</span> (bNotReady); -<a name="l01309"></a>01309 -<a name="l01310"></a>01310 <span class="comment">/* Create table attributes */</span> -<a name="l01311"></a>01311 <span class="keywordflow">switch</span> (ucBorderInfo) { -<a name="l01312"></a>01312 <span class="keywordflow">case</span> TABLE_BORDER_TOP: -<a name="l01313"></a>01313 szFrame = <span class="stringliteral">"top"</span>; -<a name="l01314"></a>01314 <span class="keywordflow">break</span>; -<a name="l01315"></a>01315 <span class="keywordflow">case</span> TABLE_BORDER_LEFT|TABLE_BORDER_RIGHT: -<a name="l01316"></a>01316 szFrame = <span class="stringliteral">"sides"</span>; -<a name="l01317"></a>01317 <span class="keywordflow">break</span>; -<a name="l01318"></a>01318 <span class="keywordflow">case</span> TABLE_BORDER_TOP|TABLE_BORDER_BOTTOM: -<a name="l01319"></a>01319 szFrame = <span class="stringliteral">"topbot"</span>; -<a name="l01320"></a>01320 <span class="keywordflow">break</span>; -<a name="l01321"></a>01321 <span class="keywordflow">case</span> TABLE_BORDER_BOTTOM: -<a name="l01322"></a>01322 szFrame = <span class="stringliteral">"bottom"</span>; -<a name="l01323"></a>01323 <span class="keywordflow">break</span>; -<a name="l01324"></a>01324 <span class="keywordflow">case</span> TABLE_BORDER_TOP|TABLE_BORDER_LEFT| -<a name="l01325"></a>01325 TABLE_BORDER_BOTTOM|TABLE_BORDER_RIGHT: -<a name="l01326"></a>01326 szFrame = <span class="stringliteral">"all"</span>; -<a name="l01327"></a>01327 <span class="keywordflow">break</span>; -<a name="l01328"></a>01328 <span class="keywordflow">default</span>: -<a name="l01329"></a>01329 szFrame = <span class="stringliteral">"none"</span>; -<a name="l01330"></a>01330 <span class="keywordflow">break</span>; -<a name="l01331"></a>01331 } -<a name="l01332"></a>01332 cColSep = bIsTableBorderLeft(ucBorderInfo) || -<a name="l01333"></a>01333 bIsTableBorderRight(ucBorderInfo) ? <span class="charliteral">'1'</span> : <span class="charliteral">'0'</span>; -<a name="l01334"></a>01334 cRowSep = bIsTableBorderTop(ucBorderInfo) || -<a name="l01335"></a>01335 bIsTableBorderBottom(ucBorderInfo) ? <span class="charliteral">'1'</span> : <span class="charliteral">'0'</span>; -<a name="l01336"></a>01336 -<a name="l01337"></a>01337 sprintf(szAttr, <span class="stringliteral">"frame='%.6s' colsep='%c' rowsep='%c'"</span>, -<a name="l01338"></a>01338 szFrame, cColSep, cRowSep); -<a name="l01339"></a>01339 -<a name="l01340"></a>01340 <span class="keywordflow">if</span> (usHeaderLevelCurrent == 0) { -<a name="l01341"></a>01341 <span class="comment">/* No table without an open header */</span> -<a name="l01342"></a>01342 vAddStartTag(pDiag, TAG_CHAPTER, NULL); -<a name="l01343"></a>01343 <span class="comment">/* Dummy title */</span> -<a name="l01344"></a>01344 vAddCombinedTag(pDiag, TAG_TITLE, NULL); -<a name="l01345"></a>01345 } -<a name="l01346"></a>01346 vAddStartTag(pDiag, TAG_INFORMALTABLE, szAttr); -<a name="l01347"></a>01347 } <span class="comment">/* end of vStartOfTable */</span> -<a name="l01348"></a>01348 -<a name="l01349"></a>01349 <span class="comment">/*</span> -<a name="l01350"></a>01350 <span class="comment"> * Create a start of a table group</span> -<a name="l01351"></a>01351 <span class="comment"> */</span> -<a name="l01352"></a>01352 <span class="keyword">static</span> <span class="keywordtype">void</span> -<a name="l01353"></a>01353 vStartOfTableGroup(diagram_type *pDiag, -<a name="l01354"></a>01354 <span class="keywordtype">int</span> iNbrOfColumns, <span class="keyword">const</span> <span class="keywordtype">short</span> *asColumnWidth) -<a name="l01355"></a>01355 { -<a name="l01356"></a>01356 <span class="keywordtype">double</span> dWidth; -<a name="l01357"></a>01357 <span class="keywordtype">int</span> iIndex; -<a name="l01358"></a>01358 <span class="keywordtype">char</span> szCols[6 + 3 * <span class="keyword">sizeof</span>(int) + 1 + 1]; -<a name="l01359"></a>01359 <span class="keywordtype">char</span> szColWidth[10 + 3 * <span class="keyword">sizeof</span>(short) + 3 + 3 + 1]; -<a name="l01360"></a>01360 -<a name="l01361"></a>01361 fail(iNbrOfColumns < 1); -<a name="l01362"></a>01362 fail(asColumnWidth == NULL); -<a name="l01363"></a>01363 -<a name="l01364"></a>01364 sprintf(szCols, <span class="stringliteral">"cols='%d'"</span>, iNbrOfColumns); -<a name="l01365"></a>01365 vAddStartTag(pDiag, TAG_TGROUP, szCols); -<a name="l01366"></a>01366 -<a name="l01367"></a>01367 <span class="keywordflow">for</span> (iIndex= 0; iIndex < iNbrOfColumns; iIndex++) { -<a name="l01368"></a>01368 fail(asColumnWidth[iIndex] < 0); -<a name="l01369"></a>01369 dWidth = dTwips2Points(asColumnWidth[iIndex]); -<a name="l01370"></a>01370 <span class="keywordflow">if</span> (dWidth <= 1.0) { -<a name="l01371"></a>01371 strcpy(szColWidth, <span class="stringliteral">"colwidth='1.00pt'"</span>); -<a name="l01372"></a>01372 } <span class="keywordflow">else</span> { -<a name="l01373"></a>01373 sprintf(szColWidth, <span class="stringliteral">"colwidth='%.2fpt'"</span>, dWidth); -<a name="l01374"></a>01374 } -<a name="l01375"></a>01375 vAddCombinedTag(pDiag, TAG_COLSPEC, szColWidth); -<a name="l01376"></a>01376 } -<a name="l01377"></a>01377 } <span class="comment">/* end of vStartOfTableGroup */</span> -<a name="l01378"></a>01378 -<a name="l01379"></a>01379 <span class="comment">/*</span> -<a name="l01380"></a>01380 <span class="comment"> * Create an end of a table</span> -<a name="l01381"></a>01381 <span class="comment"> */</span> -<a name="l01382"></a>01382 <span class="keywordtype">void</span> -<a name="l01383"></a>01383 vEndOfTableXML(diagram_type *pDiag) -<a name="l01384"></a>01384 { -<a name="l01385"></a>01385 fail(pDiag == NULL); -<a name="l01386"></a>01386 -<a name="l01387"></a>01387 <span class="keywordflow">if</span> (bTableOpen) { -<a name="l01388"></a>01388 vAddEndTag(pDiag, TAG_TBODY); -<a name="l01389"></a>01389 vAddEndTag(pDiag, TAG_TGROUP); -<a name="l01390"></a>01390 vAddEndTag(pDiag, TAG_INFORMALTABLE); -<a name="l01391"></a>01391 } -<a name="l01392"></a>01392 } <span class="comment">/* end of vEndOfTableXML */</span> -<a name="l01393"></a>01393 -<a name="l01394"></a>01394 <span class="comment">/*</span> -<a name="l01395"></a>01395 <span class="comment"> * Add a table row</span> -<a name="l01396"></a>01396 <span class="comment"> */</span> -<a name="l01397"></a>01397 <span class="keywordtype">void</span> -<a name="l01398"></a>01398 vAddTableRowXML(diagram_type *pDiag, <span class="keywordtype">char</span> **aszColTxt, -<a name="l01399"></a>01399 <span class="keywordtype">int</span> iNbrOfColumns, <span class="keyword">const</span> <span class="keywordtype">short</span> *asColumnWidth, UCHAR ucBorderInfo) -<a name="l01400"></a>01400 { -<a name="l01401"></a>01401 <span class="keywordtype">size_t</span> tCount, tStringLength; -<a name="l01402"></a>01402 <span class="keywordtype">int</span> iIndex; -<a name="l01403"></a>01403 -<a name="l01404"></a>01404 fail(pDiag == NULL); -<a name="l01405"></a>01405 fail(pDiag->pOutFile == NULL); -<a name="l01406"></a>01406 fail(aszColTxt == NULL); -<a name="l01407"></a>01407 fail(iNbrOfColumns < 1); -<a name="l01408"></a>01408 fail(asColumnWidth == NULL); -<a name="l01409"></a>01409 -<a name="l01410"></a>01410 <span class="keywordflow">if</span> (iNbrOfColumns != iTableColumnsCurrent) { -<a name="l01411"></a>01411 <span class="comment">/* A new number of columns */</span> -<a name="l01412"></a>01412 <span class="comment">/* End the old table body and table group (if they exist) */</span> -<a name="l01413"></a>01413 vAddEndTagOptional(pDiag, TAG_TBODY); -<a name="l01414"></a>01414 vAddEndTagOptional(pDiag, TAG_TGROUP); -<a name="l01415"></a>01415 <span class="keywordflow">if</span> (!bTableOpen) { -<a name="l01416"></a>01416 <span class="comment">/* No table yet. Start a new table */</span> -<a name="l01417"></a>01417 vStartOfTable(pDiag, ucBorderInfo); -<a name="l01418"></a>01418 } -<a name="l01419"></a>01419 <span class="comment">/* Start a new table group and a new table body */</span> -<a name="l01420"></a>01420 vStartOfTableGroup(pDiag, iNbrOfColumns, asColumnWidth); -<a name="l01421"></a>01421 vAddStartTag(pDiag, TAG_TBODY, NULL); -<a name="l01422"></a>01422 iTableColumnsCurrent = iNbrOfColumns; -<a name="l01423"></a>01423 } -<a name="l01424"></a>01424 -<a name="l01425"></a>01425 <span class="comment">/* Add the table row */</span> -<a name="l01426"></a>01426 vAddStartTag(pDiag, TAG_ROW, NULL); -<a name="l01427"></a>01427 <span class="keywordflow">for</span> (iIndex = 0; iIndex < iNbrOfColumns; iIndex++) { -<a name="l01428"></a>01428 <span class="comment">/* Add a table cell */</span> -<a name="l01429"></a>01429 fail(aszColTxt[iIndex] == NULL); -<a name="l01430"></a>01430 vAddStartTag(pDiag, TAG_ENTRY, NULL); -<a name="l01431"></a>01431 tStringLength = strlen(aszColTxt[iIndex]); -<a name="l01432"></a>01432 <span class="keywordflow">for</span> (tCount = 0; tCount < tStringLength; tCount++) { -<a name="l01433"></a>01433 vPrintChar(pDiag, aszColTxt[iIndex][tCount]); -<a name="l01434"></a>01434 } -<a name="l01435"></a>01435 vAddEndTag(pDiag, TAG_ENTRY); -<a name="l01436"></a>01436 } -<a name="l01437"></a>01437 vAddEndTag(pDiag, TAG_ROW); -<a name="l01438"></a>01438 } <span class="comment">/* end of vAddTableRowXML */</span> -</pre></div></div> -<hr size="1"/><address style="text-align: right;"><small>Generated by -<a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> -</body> -</html>