117 unsigned char *
p,*n,pb=0;
119 if ((a == NULL) || (a->
data == NULL))
return(0);
127 if (!neg && (i > 127)) {
134 }
else if(i == 128) {
139 for(i = 1; i < a->
length; i++)
if(a->
data[i]) {
148 if (pp == NULL)
return(ret);
152 if (a->
length == 0) *(p++)=0;
153 else if (!neg) memcpy(p,a->
data,(
unsigned int)a->
length);
166 *(p--) = ((*(n--)) ^ 0xff) + 1;
169 for(;i > 0; i--) *(p--) = *(n--) ^ 0xff;
182 const unsigned char *
p, *pend;
183 unsigned char *to,*s;
186 if ((a == NULL) || ((*a) == NULL))
211 }
else if (*p & 0x80)
214 if ((*p == 0xff) && (len != 1)) {
238 *(to--) = (*(p--) ^ 0xff) + 1;
240 for(;i > 0; i--) *(to--) = *(p--) ^ 0xff;
244 if ((*p == 0) && (len != 1))
249 memcpy(s,p,(
int)len);
255 if (a != NULL) (*a)=ret;
260 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
275 const unsigned char *
p;
281 if ((a == NULL) || ((*a) == NULL))
313 if ((*p == 0) && (len != 1))
318 memcpy(s,p,(
int)len);
325 if (a != NULL) (*a)=ret;
330 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
339 unsigned char buf[
sizeof(long)+1];
343 if (a->
length < (
int)(
sizeof(long)+1))
348 memset((
char *)a->
data,0,
sizeof(
long)+1);
362 for (i=0; i<
sizeof(long); i++)
369 for (k=i-1; k >=0; k--)
380 if (a == NULL)
return(0L);
387 if (a->
length > (
int)
sizeof(
long))
395 for (i=0; i<a->
length; i++)
398 r|=(
unsigned char)a->
data[i];
422 len=((j == 0)?0:((j/8)+1));