Imported from antiword-0.37.tar.gz.
[antiword.git] / doclist.c
blobd4ac3802669ea4b941b3f29a9196827e543a8def
1 /*
2 * doclist.c
3 * Copyright (C) 2004 A.J. van Os; Released under GNU GPL
5 * Description:
6 * Build, read and destroy list(s) of Word document information
8 * Note:
9 * There is no real list there is always one document per document
12 #include "antiword.h"
14 #define HALF_INCH 36000L /* In millipoints */
16 /* Variables needed to write the Document Information List */
17 static document_block_type *pAnchor = NULL;
18 static document_block_type tInfo;
22 * vDestroyDocumentInfoList - destroy the Document Information List
24 void
25 vDestroyDocumentInfoList(void)
27 DBG_MSG("vDestroyDocumentInfoList");
29 pAnchor = NULL;
30 } /* end of vDestoryDocumentInfoList */
33 * vCreateDocumentInfoList - create the Document Information List
35 void
36 vCreateDocumentInfoList(const document_block_type *pDocument)
38 fail(pDocument == NULL);
39 fail(pAnchor != NULL);
41 tInfo = *pDocument;
42 pAnchor = &tInfo;
43 } /* end of vCreateDocumentInfoList */
46 * lGetDefaultTabWidth - get the default tabwidth in millipoints
48 long
49 lGetDefaultTabWidth(void)
51 long lDefaultTabWidth;
52 USHORT usTmp;
54 if (pAnchor == NULL) {
55 DBG_FIXME();
56 return HALF_INCH;
58 usTmp = pAnchor->usDefaultTabWidth;
59 lDefaultTabWidth = usTmp == 0 ? HALF_INCH : lTwips2MilliPoints(usTmp);
60 NO_DBG_DEC(lDefaultTabWidth);
61 return lDefaultTabWidth;
62 } /* end of lGetDefaultTabWidth */
65 * ucGetDopHdrFtrSpecification - get the Heder/footer specification
67 UCHAR
68 ucGetDopHdrFtrSpecification(void)
70 if (pAnchor == NULL) {
71 DBG_FIXME();
72 return 0x00;
74 return pAnchor->ucHdrFtrSpecification;
75 } /* end of ucGetDopHdrFtrSpecification */