File: gpprl.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 (97 lines) | stat: -rw-r--r-- 2,222 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <stdlib.h>
#include <stdio.h>
#include "wv.h"

extern FILE *erroroutput;
extern FILE *outputfile;
extern long int cp;
extern int insuper;
extern int footnotehack;


void decode_gpprls(pap *apap,chp *achp,sep *asep,U16 *gpprl,int index,tSprm *sprmlists,style *sheet)
	{
	/**/
	int j=0;
	U16 i=0;
	tSprm *thesprmlist=sprmlists;
	U16 sprm;
	U8 operand;
	U8 *pointer;
	U8 littlelist[2];
	int val;

	error(erroroutput,"index were looking for is %d\n",index);
	if (index <0)
		return;

	/*the index were given is the sprm, if its a varient 1 
	ignore it for now, if its varient 2 go through the list of sprms countinf
	varients 2, until we get to this one*/
	if (0 == (gpprl[index] & 0x01))
		{
		error(erroroutput,"varient 1s, (%x)\n",gpprl[index]);
		error(erroroutput,"sprm varient 1, isprm is %x, val is %d\n",(gpprl[index]&0x00fe)>>1,(gpprl[index]&0xff00)>>8);
		sprm = (gpprl[index]&0x00fe)>>1;
		operand = (gpprl[index]&0xff00)>>8;
		error(erroroutput,"GPRL is (%x) operand is %d",sprm,operand);
		switch (sprm)
			{
			case 5:
				sprm = 0x2403;
				littlelist[0] = operand;
				break;
			default:
				error(erroroutput,"unsupported gpprl %d\n",sprm);
				return;
				break;
			}
		pointer = littlelist;
		decode_sprm(NULL,sprm,apap,achp,asep,&i,&pointer,sheet,apap->istd);
		return;
		}
	else
		{
		error(erroroutput,"varient 2s, (%x) (%x) (%x)\n",(gpprl[index]&0xFFFE)>>1,gpprl[index]>>1,gpprl[index]);
		/*
		for (i=0;i<index;i++)
			{
			if (gpprl[i] & 0x01)
				j++;
			}
		*/
		error(erroroutput,"read index val is %d\n",j);
		}
	i=0;	
	val = (gpprl[index]&0xFFFE)>>1;
	
	while(i<val)
		{
		thesprmlist=thesprmlist->next;
		if (thesprmlist == NULL)
			{
			error(erroroutput,"gpprl index is wrong at %d!\n",i);
			return;
			}
		i++;
		}


/*hum 261*/
	i=0;
	error(erroroutput,"sprm list len is %d\n",thesprmlist->len);
	while (i<thesprmlist->len)
		{
		sprm = sread_16ubit(thesprmlist->list+i);
		i+=2;
		error(erroroutput,"clist is %x, at len point %d\n",sprm,i);

		pointer = thesprmlist->list+i;
		if (apap == NULL)
			fprintf(erroroutput,"aha !!\n");

		decode_sprm(NULL,sprm,apap,achp,asep,&i,&pointer,sheet,apap->istd);
		error(erroroutput,"after line\n");
		/*change above to include sep*/
		}
	}