version 1.5, 2000/09/07 23:59:54 |
version 1.6, 2000/11/08 08:02:51 |
|
|
* 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/cio.c,v 1.4 2000/08/22 05:04:17 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/io/cio.c,v 1.5 2000/09/07 23:59:54 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
return 1; |
return 1; |
switch ( OID(obj) ) { |
switch ( OID(obj) ) { |
case O_MATHCAP: case O_P: case O_R: case O_DP: case O_STR: |
case O_MATHCAP: case O_P: case O_R: case O_DP: case O_STR: |
case O_ERR: case O_USINT: case O_VOID: |
case O_ERR: case O_USINT: case O_BYTEARRAY: case O_VOID: |
return 1; |
return 1; |
case O_N: |
case O_N: |
if ( NID((Num)obj) == N_Q || NID((Num)obj) == N_R ) |
if ( NID((Num)obj) == N_Q || NID((Num)obj) == N_R ) |
|
|
case O_ERR: |
case O_ERR: |
write_cmo_error(s,obj); |
write_cmo_error(s,obj); |
break; |
break; |
|
case O_BYTEARRAY: |
|
write_cmo_bytearray(s,obj); |
|
break; |
case O_VOID: |
case O_VOID: |
r = ((USINT)obj)->body; write_int(s,&r); |
r = ((USINT)obj)->body; write_int(s,&r); |
break; |
break; |
|
|
savestr(s,BDY(str)); |
savestr(s,BDY(str)); |
} |
} |
|
|
|
write_cmo_bytearray(s,array) |
|
FILE *s; |
|
BYTEARRAY array; |
|
{ |
|
int r; |
|
|
|
r = CMO_DATUM; write_int(s,&r); |
|
write_int(s,&array->len); |
|
write_string(s,array->body,array->len); |
|
} |
|
|
write_cmo_error(s,e) |
write_cmo_error(s,e) |
FILE *s; |
FILE *s; |
ERR e; |
ERR e; |
|
|
Obj obj; |
Obj obj; |
ERR e; |
ERR e; |
MATHCAP mc; |
MATHCAP mc; |
|
BYTEARRAY array; |
|
|
read_int(s,&id); |
read_int(s,&id); |
switch ( id ) { |
switch ( id ) { |
|
|
read_cmo_uint(s,rp); |
read_cmo_uint(s,rp); |
break; |
break; |
case CMO_DATUM: |
case CMO_DATUM: |
|
loadbytearray(s,&array); *rp = (Obj)array; |
|
break; |
case CMO_STRING: |
case CMO_STRING: |
loadstring(s,&str); *rp = (Obj)str; |
loadstring(s,&str); *rp = (Obj)str; |
break; |
break; |