version 1.9, 2001/10/09 01:36:20 |
version 1.14, 2009/03/16 16:43:03 |
|
|
* 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.8 2000/08/29 04:03:05 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/io.c,v 1.13 2009/03/13 04:45:16 ohara Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#if defined(VISUAL) || MPI |
#if defined(VISUAL) || defined(MPI) |
#include "wsio.h" |
#include "wsio.h" |
#endif |
#endif |
|
|
Line 141 int gen_fread (char *ptr,int size,int nitems,FILE *str |
|
Line 141 int gen_fread (char *ptr,int size,int nitems,FILE *str |
|
if ( _fileno(stream) < 0 ) |
if ( _fileno(stream) < 0 ) |
n = cread(ptr,size,nitems,(STREAM *)stream); |
n = cread(ptr,size,nitems,(STREAM *)stream); |
else |
else |
#elif MPI |
#elif defined(MPI) |
if ( (char)fileno(stream) < 0 ) |
if ( (char)fileno(stream) < 0 ) |
n = cread(ptr,size,nitems,(STREAM *)stream); |
n = cread(ptr,size,nitems,(STREAM *)stream); |
else |
else |
Line 175 int gen_fwrite (char *ptr,int size,int nitems,FILE *st |
|
Line 175 int gen_fwrite (char *ptr,int size,int nitems,FILE *st |
|
if ( _fileno(stream) < 0 ) |
if ( _fileno(stream) < 0 ) |
return cwrite(ptr,size,nitems,(STREAM *)stream); |
return cwrite(ptr,size,nitems,(STREAM *)stream); |
else |
else |
#elif MPI |
#elif defined(MPI) |
if ( (char)fileno(stream) < 0 ) |
if ( (char)fileno(stream) < 0 ) |
return cwrite(ptr,size,nitems,(STREAM *)stream); |
return cwrite(ptr,size,nitems,(STREAM *)stream); |
else |
else |
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); |
} |
} |
|
|
#if defined(VISUAL) && 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}; |
static unsigned char deskey_string[96]; |
static unsigned char deskey_string[96]; |
Line 230 void write_intarray(FILE *f,unsigned int *p,int l) |
|
Line 230 void write_intarray(FILE *f,unsigned int *p,int l) |
|
{ |
{ |
int i; |
int i; |
unsigned int t; |
unsigned int t; |
#if defined(VISUAL) && defined(DES_ENC) |
#if defined(DES_ENC) |
int l2; |
int l2; |
unsigned int plain[2],encrypted[2]; |
unsigned int plain[2],encrypted[2]; |
|
|
Line 263 void write_intarray(FILE *f,unsigned int *p,int l) |
|
Line 263 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 |
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 322 void read_int(FILE *f,unsigned int *p) |
|
Line 322 void read_int(FILE *f,unsigned int *p) |
|
void read_intarray(FILE *f,unsigned int *p,int l) |
void read_intarray(FILE *f,unsigned int *p,int l) |
{ |
{ |
int i; |
int i; |
#if defined(VISUAL) && defined(DES_ENC) |
#if defined(DES_ENC) |
int l2; |
int l2; |
unsigned int plain[2],encrypted[2]; |
unsigned int plain[2],encrypted[2]; |
|
|
Line 353 void read_intarray(FILE *f,unsigned int *p,int l) |
|
Line 353 void read_intarray(FILE *f,unsigned int *p,int l) |
|
} |
} |
} |
} |
|
|
#if defined(LONG_IS_64BIT) |
#if SIZEOF_LONG == 8 |
void read_longarray(FILE *f,unsigned long *p,int l) |
void read_longarray(FILE *f,unsigned long *p,int l) |
{ |
{ |
int i; |
int i; |