source: trunk/gsdl/packages/wv-0.5.44-gs/src/numrm.c@ 1468

Last change on this file since 1468 was 1468, checked in by paynter, 24 years ago

The wv Packages from www.wvware.com is used to convert Word documents into
HTML. This is an adaptation of wv version 0.5.44 for greenstone; it is
called by the gsConvert.pl script.

  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#include <stdlib.h>
2#include <stdio.h>
3#include "wv.h"
4#include "wvinternal.h"
5
6/*
7The NUMRM structure is used to track revision marking data for paragraph
8numbers, and is stored in the PAP for each numbered paragraph. When revision
9marking tracking is turned on, we fill out the NUMRM for each number with
10the data required to recreate the number's text. Then at display time, that
11string is compared with the current paragraph number string, and displayed
12as changed (old deleted, current inserted) if the strings differ. The string
13construction algorithm is the same as for an LVL structure.
14*/
15
16void wvGetNUMRM_internal(NUMRM *item,FILE *fd,U8 *pointer)
17 {
18 int i;
19 item->fNumRM = dgetc(fd,&pointer);
20 item->Spare1 = dgetc(fd,&pointer);
21 item->ibstNumRM = (S16)dread_16ubit(fd,&pointer);
22 if (fd != NULL)
23 wvGetDTTM(&(item->dttmNumRM),fd);
24 else
25 {
26 wvGetDTTMFromBucket(&(item->dttmNumRM),pointer);
27 pointer+=cbDTTM;
28 }
29 for (i=0;i<9;i++)
30 item->rgbxchNums[i] = dgetc(fd,&pointer);
31 for (i=0;i<9;i++)
32 item->rgnfc[i] = dgetc(fd,&pointer);
33 item->Spare2 = (S16)dread_16ubit(fd,&pointer);
34 for (i=0;i<9;i++)
35 item->PNBR[i] = (S32)dread_32ubit(fd,&pointer);
36 for (i=0;i<32;i++)
37 item->xst[i] = dread_16ubit(fd,&pointer);
38 }
39
40void wvGetNUMRM(NUMRM *item,FILE *fd)
41 {
42 wvGetNUMRM_internal(item,fd,NULL);
43 }
44
45void wvGetNUMRMFromBucket(NUMRM *item,U8 *pointer)
46 {
47 wvGetNUMRM_internal(item,NULL,pointer);
48 }
49
50void wvCopyNUMRM(NUMRM *dest,NUMRM *src)
51 {
52 memcpy(dest,src,sizeof(NUMRM));
53 }
54
55void wvInitNUMRM(NUMRM *item)
56 {
57 int i;
58 item->fNumRM = 0;
59 item->Spare1 = 0;
60 item->ibstNumRM = 0;
61 wvInitDTTM(&(item->dttmNumRM));
62 for (i=0;i<9;i++)
63 item->rgbxchNums[i] = 0;
64 for (i=0;i<9;i++)
65 item->rgnfc[i] = 0;
66 item->Spare2 = 0;
67 for (i=0;i<9;i++)
68 item->PNBR[i] = 0;
69 for (i=0;i<32;i++)
70 item->xst[i] = 0;
71 }
Note: See TracBrowser for help on using the repository browser.