--- psiconv/trunk/lib/psiconv/parse_simple.c 2001/06/30 13:36:39 118 +++ psiconv/trunk/lib/psiconv/parse_simple.c 2001/07/24 22:44:59 132 @@ -90,6 +90,21 @@ return *ptr0 + (*ptr1 << 8) + (*ptr2 << 16) + (*ptr3 << 24); } +psiconv_s32 psiconv_read_sint(const psiconv_buffer buf,int lev,psiconv_u32 off, + int *length,int *status) +{ + int localstatus; + psiconv_u32 temp; + + temp=psiconv_read_u32(buf,lev,off,&localstatus); + if (status) + *status = localstatus; + if (length) + *length = localstatus?0:4; + + return localstatus?0:(temp & 0x7fffffff)*(temp&0x80000000?-1:1); +} + psiconv_S_t psiconv_read_S(const psiconv_buffer buf, int lev, psiconv_u32 off, int *length,int *status) { @@ -107,7 +122,7 @@ goto ERROR; len = 1; psiconv_debug(lev+2,off,"Indicator (1 byte): %02x",res); - } else if ((temp & 0x07) == 0x03) { + } else if ((temp & 0x07) == 0x05) { res = psiconv_read_u16(buf,lev+2,off,&localstatus) >> 3; if (localstatus) goto ERROR;