source: trunk/gsdl/packages/wv-0.5.44-gs/src/sed.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.1 KB
Line 
1#include <stdlib.h>
2#include <stdio.h>
3#include "wv.h"
4
5
6void wvGetSED(SED *item,FILE *fd)
7 {
8 item->fn = (S16)read_16ubit(fd);
9 item->fcSepx = read_32ubit(fd);
10 item->fnMpr = (S16)read_16ubit(fd);
11 item->fcMpr = read_32ubit(fd);
12 }
13
14int wvGetSED_PLCF(SED **item,U32 **pos,U32 *noitem,U32 offset,U32 len,FILE *fd)
15 {
16 U32 i;
17 if (len == 0)
18 {
19 *item = NULL;
20 *pos = NULL;
21 *noitem = 0;
22 }
23 else
24 {
25 *noitem=(len-4)/(cbSED+4);
26 *pos = (U32 *) malloc( (*noitem+1) * sizeof(U32));
27 if (*pos == NULL)
28 {
29 wvError(("NO MEM 1, failed to alloc %d bytes\n",(*noitem+1) * sizeof(U32)));
30 return(1);
31 }
32
33 *item = (SED *) malloc(*noitem * sizeof(SED));
34 if (*item == NULL)
35 {
36 wvError(("NO MEM 1, failed to alloc %d bytes\n",*noitem * sizeof(SED)));
37 free(pos);
38 return(1);
39 }
40 fseek(fd,offset,SEEK_SET);
41 for(i=0;i<=*noitem;i++)
42 (*pos)[i]=read_32ubit(fd);
43 for(i=0;i<*noitem;i++)
44 wvGetSED(&((*item)[i]),fd);
45 }
46 return(0);
47 }
Note: See TracBrowser for help on using the repository browser.