Go to the source code of this file.
Define Documentation
Function Documentation
| do_float |
( |
int |
fd, |
|
|
double |
value, |
|
|
int |
row, |
|
|
int |
column |
|
) |
| |
Definition at line 270 of file libbif.c.
{
#endif
struct float_record floatrec;
short s_row,s_column;
unsigned char *sptr,*dptr;
s_row=(short)row;
s_column=(short)column;
floatrec.hi_opcode=FLOAT;
floatrec.lo_opcode=0x00;
floatrec.hi_length=0xf;
floatrec.lo_length=0x00;
floatrec.rgbhi=0x0;
floatrec.rgbmed=0x0;
floatrec.rgblo=0x0;
floatrec.hi_row=(char)(s_row&0xff);
floatrec.lo_row=(char)((s_row>>8)&0xff);
floatrec.hi_column=(char)(s_column&0xff);
floatrec.lo_column=(char)((s_column>>8)&0xff);
sptr =(unsigned char *) &value;
dptr =(unsigned char *) &floatrec.data;
if(endian()==ENDIAN_2)
{
dptr[0]=sptr[7];
dptr[1]=sptr[6];
dptr[2]=sptr[5];
dptr[3]=sptr[4];
dptr[4]=sptr[3];
dptr[5]=sptr[2];
dptr[6]=sptr[1];
dptr[7]=sptr[0];
}
if(endian()==ENDIAN_3)
{
dptr[0]=sptr[4];
dptr[1]=sptr[5];
dptr[2]=sptr[6];
dptr[3]=sptr[7];
dptr[4]=sptr[0];
dptr[5]=sptr[1];
dptr[6]=sptr[2];
dptr[7]=sptr[3];
}
if(endian()==ENDIAN_1)
{
dptr[0]=sptr[0];
dptr[1]=sptr[1];
dptr[2]=sptr[2];
dptr[3]=sptr[3];
dptr[4]=sptr[4];
dptr[5]=sptr[5];
dptr[6]=sptr[6];
dptr[7]=sptr[7];
}
if(endian()==-1)
{
dptr[0]=0;
dptr[1]=0;
dptr[2]=0;
dptr[3]=0;
dptr[4]=0;
dptr[5]=0;
dptr[6]=0;
dptr[7]=0;
printf("Excel output not supported on this architecture.\n");
}
junk=write(fd,&floatrec,11);
junk=write(fd,&floatrec.data,8);
}
| do_int |
( |
int |
fd, |
|
|
int |
val, |
|
|
int |
row, |
|
|
int |
column |
|
) |
| |
Definition at line 234 of file libbif.c.
{
#endif
struct int_record intrec;
short s_row,s_column;
s_row=(short)row;
s_column=(short)column;
intrec.hi_opcode=INTEGER;
intrec.lo_opcode=0x00;
intrec.hi_length=0x09;
intrec.lo_length=0x00;
intrec.rgbhi=0x0;
intrec.rgbmed=0x0;
intrec.rgblo=0x0;
intrec.hi_row=(char)s_row&0xff;
intrec.lo_row=(char)(s_row>>8)&0xff;
intrec.hi_column=(char)(s_column&0xff);
intrec.lo_column=(char)(s_column>>8)&0xff;
intrec.hi_data=(val & 0xff);
intrec.lo_data=(val & 0xff00)>>8;
junk=write(fd,&intrec,13);
}
| do_label |
( |
int |
fd, |
|
|
char * |
string, |
|
|
int |
row, |
|
|
int |
column |
|
) |
| |
Definition at line 353 of file libbif.c.
{
#endif
struct label_record labelrec;
short s_row,s_column;
int i;
for(i=0;i<255;i++)
labelrec.str_array[i]=0;
s_row=(short)row;
s_column=(short)column;
i=strlen(string);
labelrec.hi_opcode=LABEL;
labelrec.lo_opcode=0x00;
labelrec.hi_length=0x08;
labelrec.lo_length=0x01;
labelrec.rgblo=0x0;
labelrec.rgbmed=0x0;
labelrec.rgbhi=0x0;
labelrec.hi_row=(char)(s_row&0xff);
labelrec.lo_row=(char)((s_row>>8)&0xff);
labelrec.hi_column=(char)(s_column&0xff);
labelrec.lo_column=(char)((s_column>>8)&0xff);
labelrec.string_length=i;
if(i > 255)
string[254]=0;
i=strlen(string);
strcpy(labelrec.str_array,string);
junk=write(fd,&labelrec,sizeof(struct label_record));
}
Definition at line 411 of file libbif.c.
{
long long foo = 0x0102030405060708LL;
long foo1 = 0x012345678;
unsigned char *c,c1,c2,c3,c4,c5,c6,c7,c8;
c=(unsigned char *)&foo;
c1=*c++;
c2=*c++;
c3=*c++;
c4=*c++;
c5=*c++;
c6=*c++;
c7=*c++;
c8=*c;
if( (c1==0x08) && (c2==0x07) && (c3==0x06) && (c4==0x05) &&
(c5==0x04) && (c6==0x03) && (c7==0x02) && (c8==0x01) )
return(ENDIAN_1);
if( (c1==0x01) && (c2==0x02) && (c3==0x03) && (c4==0x04) &&
(c5==0x05) && (c6==0x06) && (c7==0x07) && (c8==0x08) )
return(ENDIAN_2);
if( (c1==0x04) && (c2==0x03) && (c3==0x02) && (c4==0x01) &&
(c5==0x08) && (c6==0x07) && (c7==0x06) && (c8==0x05) )
return(ENDIAN_3);
c=(unsigned char *)&foo1;
c1=*c++;
c2=*c++;
c3=*c++;
c4=*c++;
if( (c1==0x34) && (c2==0x12) && (c3==0x78) && (c4==0x56))
return(ENDIAN_4);
return(-1);
}
Variable Documentation