version 1.13, 2009/03/13 04:45:16 |
version 1.15, 2015/08/04 06:20:45 |
|
|
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* $OpenXM: OpenXM_contrib2/asir2000/io/io.c,v 1.12 2003/03/07 06:39:57 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/io.c,v 1.14 2009/03/16 16:43:03 ohara Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include "ca.h" |
#include "ca.h" |
Line 210 void write_int(FILE *f,unsigned int *p) |
|
Line 210 void write_int(FILE *f,unsigned int *p) |
|
gen_fwrite((char *)p,sizeof(unsigned int),1,f); |
gen_fwrite((char *)p,sizeof(unsigned int),1,f); |
} |
} |
|
|
|
void write_int64(FILE *f,UL *p) |
|
{ |
|
unsigned int t; |
|
|
|
if ( little_endian && (ox_file_io || ox_need_conv) ) { |
|
t = htonl(((unsigned int *)p)[1]); |
|
gen_fwrite((char *)&t,sizeof(unsigned int),1,f); |
|
t = htonl(((unsigned int *)p)[0]); |
|
gen_fwrite((char *)&t,sizeof(unsigned int),1,f); |
|
} else |
|
gen_fwrite((char *)p,sizeof(UL),1,f); |
|
} |
|
|
#if defined(DES_ENC) |
#if defined(DES_ENC) |
int des_encryption; |
int des_encryption; |
static unsigned char asir_deskey[8] = {0xc7,0xe0,0xfc,0xb5,0xc3,0xad,0x8e,0x3a}; |
static unsigned char asir_deskey[8] = {0xc7,0xe0,0xfc,0xb5,0xc3,0xad,0x8e,0x3a}; |
Line 263 void write_intarray(FILE *f,unsigned int *p,int l) |
|
Line 276 void write_intarray(FILE *f,unsigned int *p,int l) |
|
gen_fwrite((char *)p,sizeof(unsigned int),l,f); |
gen_fwrite((char *)p,sizeof(unsigned int),l,f); |
} |
} |
|
|
#if defined(LONG_IS_64BIT) |
#if SIZEOF_LONG == 8 |
|
/* write l longword (1longword=8bytes) */ |
void write_longarray(FILE *f,unsigned long *p,int l) |
void write_longarray(FILE *f,unsigned long *p,int l) |
{ |
{ |
int i; |
int i; |
Line 319 void read_int(FILE *f,unsigned int *p) |
|
Line 333 void read_int(FILE *f,unsigned int *p) |
|
*p = ntohl(*p); |
*p = ntohl(*p); |
} |
} |
|
|
|
void read_int64(FILE *f,UL *p) |
|
{ |
|
unsigned int t; |
|
|
|
if ( little_endian && (ox_file_io || ox_need_conv) ) { |
|
gen_fread((char *)&t,sizeof(unsigned int),1,f); |
|
((unsigned int *)p)[1] = ntohl(t); |
|
gen_fread((char *)&t,sizeof(unsigned int),1,f); |
|
((unsigned int *)p)[0] = ntohl(t); |
|
} else |
|
gen_fread((char *)p,sizeof(UL),1,f); |
|
} |
|
|
void read_intarray(FILE *f,unsigned int *p,int l) |
void read_intarray(FILE *f,unsigned int *p,int l) |
{ |
{ |
int i; |
int i; |
Line 353 void read_intarray(FILE *f,unsigned int *p,int l) |
|
Line 380 void read_intarray(FILE *f,unsigned int *p,int l) |
|
} |
} |
} |
} |
|
|
#if defined(LONG_IS_64BIT) |
#if SIZEOF_LONG == 8 |
|
/* read l word (1word=4bytes) */ |
void read_longarray(FILE *f,unsigned long *p,int l) |
void read_longarray(FILE *f,unsigned long *p,int l) |
{ |
{ |
int i; |
int i; |