File: olst.c

package info (click to toggle)
abiword 0.7.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 20,604 kB
  • ctags: 18,358
  • sloc: cpp: 88,791; ansic: 66,296; sh: 7,777; makefile: 3,397; xml: 687; perl: 361; awk: 273; sed: 36; csh: 28
file content (49 lines) | stat: -rw-r--r-- 992 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdlib.h>
#include <stdio.h>
#include "wv.h"
#include "wvinternal.h"

void wvInitOLST(OLST *item)
	{
	U8 i;
	for (i=0;i<9;i++)
		wvInitANLV(&item->rganlv[i]);
 	item->fRestartHdr=0;
 	item->fSpareOlst2=0;
 	item->fSpareOlst3=0;
 	item->fSpareOlst4=0;
	for (i=0;i<64;i++)
 		item->rgxch[i]=0;
	} 


void wvGetOLST_internal(version ver,OLST *item,FILE *fd,U8 *pointer)
	{
	U8 i;
	for (i=0;i<9;i++)
		wvGetANLV_internal(&item->rganlv[i],fd,pointer);
 	item->fRestartHdr=dgetc(fd,&pointer);
 	item->fSpareOlst2=dgetc(fd,&pointer);
 	item->fSpareOlst3=dgetc(fd,&pointer);
 	item->fSpareOlst4=dgetc(fd,&pointer);
	if (ver == WORD8)
		{
		for (i=0;i<32;i++)
			item->rgxch[i]=dread_16ubit(fd,&pointer);
		}
	else
		{
		for (i=0;i<64;i++)
			item->rgxch[i]=dgetc(fd,&pointer);
		}
	}

void wvGetOLST(version ver,OLST *item,FILE *fd)
	{
	wvGetOLST_internal(ver,item,fd,NULL);
	}

void wvGetOLSTFromBucket(version ver,OLST *item,U8 *pointer)
	{
	wvGetOLST_internal(ver,item,NULL,pointer);
	}