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