1 | #include <stdlib.h>
|
---|
2 | #include <stdio.h>
|
---|
3 | #include "wv.h"
|
---|
4 | #include "wvinternal.h"
|
---|
5 |
|
---|
6 | /*
|
---|
7 | The NUMRM structure is used to track revision marking data for paragraph
|
---|
8 | numbers, and is stored in the PAP for each numbered paragraph. When revision
|
---|
9 | marking tracking is turned on, we fill out the NUMRM for each number with
|
---|
10 | the data required to recreate the number's text. Then at display time, that
|
---|
11 | string is compared with the current paragraph number string, and displayed
|
---|
12 | as changed (old deleted, current inserted) if the strings differ. The string
|
---|
13 | construction algorithm is the same as for an LVL structure.
|
---|
14 | */
|
---|
15 |
|
---|
16 | void 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 |
|
---|
40 | void wvGetNUMRM(NUMRM *item,FILE *fd)
|
---|
41 | {
|
---|
42 | wvGetNUMRM_internal(item,fd,NULL);
|
---|
43 | }
|
---|
44 |
|
---|
45 | void wvGetNUMRMFromBucket(NUMRM *item,U8 *pointer)
|
---|
46 | {
|
---|
47 | wvGetNUMRM_internal(item,NULL,pointer);
|
---|
48 | }
|
---|
49 |
|
---|
50 | void wvCopyNUMRM(NUMRM *dest,NUMRM *src)
|
---|
51 | {
|
---|
52 | memcpy(dest,src,sizeof(NUMRM));
|
---|
53 | }
|
---|
54 |
|
---|
55 | void 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 | }
|
---|