ftp.nice.ch/pub/next/developer/languages/eiffel/SmallEiffel.0.91.N.bs.tar.gz#/SmallEiffel/bin_c/compile_to_c40.c

This is compile_to_c40.c in view mode; [Download] [Up]

/* ANSI C code generated by SmallEiffel. */
/*
-- SmallEiffel  -- Release (- 0.91)    --      FRANCE
-- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN 
-- University Henri Poincare' - Nancy 1 - email colnet@loria.fr 
-- CRIN (Centre de Recherche en Informatique de Nancy)
-- FRANCE 
*/
#include "compile_to_c.h"
/*ARRAY[DECLARATION]*/int rT147count(T147 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[DECLARATION]*/T0* rT147item(T147 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[DECLARATION]*/T0** rT147realloc(/*C*/T0** a1,int a2){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=realloc(a1,(a2)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[DECLARATION]*/void rT147add_last(T147 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT147count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT147malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT147realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT147put(C,a1,(C)->_upper);
}/*ARRAY[DECLARATION]*/T0** rT147malloc(/*C*/int a1){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=malloc((a1)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[DECLARATION]*/void rT147put(T147 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[INTEGER_CONSTANT]*/T0* rT151twin(T151 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT151copy((T151*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*ARRAY[INTEGER_CONSTANT]*/void rT151clear_all(T151 *C){
T0* _value=NULL;
rT151set_all_with(C,_value);
}/*ARRAY[INTEGER_CONSTANT]*/int rT151count(T151 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[INTEGER_CONSTANT]*/void rT151set_all_with(T151 *C,T0* a1){
int _i=0;
_i=(C)->_upper;
while (!((_i)<((C)->_lower))) {
rT151put(C,a1,_i);
_i=(_i)-(1);
}
}/*ARRAY[INTEGER_CONSTANT]*/void rT151resize(T151 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
int _up=0;
int _i=0;
T0* _other=NULL;
{T151 *n=((T151*)se_new(151));
rT151make(n,a1,a2);
_other=(T0 *)n;}
_i=rT2max((C)->_lower,((T151*)_other)->_lower);
_up=rT2min((C)->_upper,((T151*)_other)->_upper);
while (!((_i)>(_up))) {
rT151put((T151*)_other,rT151item(C,_i),_i);
_i=(_i)+(1);
}
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/rT151standard_copy(C,_other);
free(((void *)(T151*)_other));
}/*ARRAY[INTEGER_CONSTANT]*/T0* rT151item(T151 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[INTEGER_CONSTANT]*/T0** rT151realloc(/*C*/T0** a1,int a2){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=realloc(a1,(a2)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[INTEGER_CONSTANT]*/void rT151add_last(T151 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT151count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT151malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT151realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT151put(C,a1,(C)->_upper);
}/*ARRAY[INTEGER_CONSTANT]*/T0** rT151malloc(/*C*/int a1){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=malloc((a1)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[INTEGER_CONSTANT]*/void rT151put(T151 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[INTEGER_CONSTANT]*/void rT151standard_copy(T151 *C,T0* a1){
memcpy(C,a1,s[a1->id]);
}/*ARRAY[INTEGER_CONSTANT]*/void rT151copy(T151 *C,T0* a1){
int _i=0;
C->_upper=((C)->_lower)-(1);
/*IF*/if (((C)->_capacity)==(0)) {
rT151make(C,((T151*)a1)->_lower,((T151*)a1)->_upper);
}
else {
rT151resize(C,((T151*)a1)->_lower,((T151*)a1)->_upper);
}
/*FI*/_i=(C)->_lower;
while (!((_i)>((C)->_upper))) {
rT151put(C,rT151item((T151*)a1,_i),_i);
_i=(_i)+(1);
}
}/*ARRAY[INTEGER_CONSTANT]*/void rT151make(T151 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
C->_lower=a1;
C->_upper=a2;
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/C->_capacity=((a2)-(a1))+(1);
/*IF*/if (((C)->_capacity)>(0)) {
/*IF*/if (((C)->_capacity)<(16)) {
C->_capacity=16;
}
/*FI*/C->_storage=rT151malloc((C)->_capacity);
rT151clear_all(C);
}
/*FI*/}/*ARRAY[MANIFEST_STRING]*/T0* rT155twin(T155 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT155copy((T155*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155clear_all(T155 *C){
T0* _value=NULL;
rT155set_all_with(C,_value);
}/*ARRAY[MANIFEST_STRING]*/int rT155count(T155 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155set_all_with(T155 *C,T0* a1){
int _i=0;
_i=(C)->_upper;
while (!((_i)<((C)->_lower))) {
rT155put(C,a1,_i);
_i=(_i)-(1);
}
}/*ARRAY[MANIFEST_STRING]*/int rT155fast_index_of(T155 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT155item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155resize(T155 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
int _up=0;
int _i=0;
T0* _other=NULL;
{T155 *n=((T155*)se_new(155));
rT155make(n,a1,a2);
_other=(T0 *)n;}
_i=rT2max((C)->_lower,((T155*)_other)->_lower);
_up=rT2min((C)->_upper,((T155*)_other)->_upper);
while (!((_i)>(_up))) {
rT155put((T155*)_other,rT155item(C,_i),_i);
_i=(_i)+(1);
}
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/rT155standard_copy(C,_other);
free(((void *)(T155*)_other));
}/*ARRAY[MANIFEST_STRING]*/T0* rT155item(T155 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[MANIFEST_STRING]*/T0** rT155realloc(/*C*/T0** a1,int a2){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=realloc(a1,(a2)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155add_last(T155 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT155count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT155malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT155realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT155put(C,a1,(C)->_upper);
}/*ARRAY[MANIFEST_STRING]*/T0** rT155malloc(/*C*/int a1){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=malloc((a1)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[MANIFEST_STRING]*/int rT155equal_like(/*C*/T0* a1,T0* a2){
int R=0;
/*IF*//*AF*//*AF*/if (((T0 *)a1)==((T0 *)a2)) {
R=1;
}
 else if ((!(a1))||(!(a2))) {
}
else {
R=rT80is_equal((T80*)a1,a2);
}
/*FI*/return R;
}
/*ARRAY[MANIFEST_STRING]*/int rT155index_of(T155 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(rT155equal_like(a1,rT155item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155put(T155 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[MANIFEST_STRING]*/void rT155standard_copy(T155 *C,T0* a1){
memcpy(C,a1,s[a1->id]);
}/*ARRAY[MANIFEST_STRING]*/void rT155copy(T155 *C,T0* a1){
int _i=0;
C->_upper=((C)->_lower)-(1);
/*IF*/if (((C)->_capacity)==(0)) {
rT155make(C,((T155*)a1)->_lower,((T155*)a1)->_upper);
}
else {
rT155resize(C,((T155*)a1)->_lower,((T155*)a1)->_upper);
}
/*FI*/_i=(C)->_lower;
while (!((_i)>((C)->_upper))) {
rT155put(C,rT155item((T155*)a1,_i),_i);
_i=(_i)+(1);
}
}/*ARRAY[MANIFEST_STRING]*/void rT155with_capacity(T155 *C,int a1,int a2){
rT155make(C,a2,((a2)+(a1))-(1));
C->_upper=(a2)-(1);
}/*ARRAY[MANIFEST_STRING]*/int rT155has(T155 *C,T0* a1){
int R=0;
R=(rT155index_of(C,a1))!=(((C)->_upper)+(1));
return R;
}
/*ARRAY[MANIFEST_STRING]*/void rT155make(T155 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
C->_lower=a1;
C->_upper=a2;
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/C->_capacity=((a2)-(a1))+(1);
/*IF*/if (((C)->_capacity)>(0)) {
/*IF*/if (((C)->_capacity)<(16)) {
C->_capacity=16;
}
/*FI*/C->_storage=rT155malloc((C)->_capacity);
rT155clear_all(C);
}
/*FI*/}/*ARRAY[ASSERTION]*/T0* rT162twin(T162 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT162copy((T162*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*ARRAY[ASSERTION]*/void rT162clear(T162 *C){
C->_upper=((C)->_lower)-(1);
}/*ARRAY[ASSERTION]*/void rT162clear_all(T162 *C){
T0* _value=NULL;
rT162set_all_with(C,_value);
}/*ARRAY[ASSERTION]*/int rT162count(T162 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[ASSERTION]*/void rT162set_all_with(T162 *C,T0* a1){
int _i=0;
_i=(C)->_upper;
while (!((_i)<((C)->_lower))) {
rT162put(C,a1,_i);
_i=(_i)-(1);
}
}/*ARRAY[ASSERTION]*/void rT162resize(T162 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
int _up=0;
int _i=0;
T0* _other=NULL;
{T162 *n=((T162*)se_new(162));
rT162make(n,a1,a2);
_other=(T0 *)n;}
_i=rT2max((C)->_lower,((T162*)_other)->_lower);
_up=rT2min((C)->_upper,((T162*)_other)->_upper);
while (!((_i)>(_up))) {
rT162put((T162*)_other,rT162item(C,_i),_i);
_i=(_i)+(1);
}
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/rT162standard_copy(C,_other);
free(((void *)(T162*)_other));
}/*ARRAY[ASSERTION]*/int rT162fast_index_of(T162 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT162item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*ARRAY[ASSERTION]*/int rT162fast_has(T162 *C,T0* a1){
int R=0;
R=(rT162fast_index_of(C,a1))!=(((C)->_upper)+(1));
return R;
}
/*ARRAY[ASSERTION]*/int rT162empty(T162 *C){
int R=0;
R=(rT162count(C))==(0);
return R;
}
/*ARRAY[ASSERTION]*/T0* rT162item(T162 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[ASSERTION]*/T0** rT162realloc(/*C*/T0** a1,int a2){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=realloc(a1,(a2)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[ASSERTION]*/void rT162add_last(T162 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT162count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT162malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT162realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT162put(C,a1,(C)->_upper);
}/*ARRAY[ASSERTION]*/T0** rT162malloc(/*C*/int a1){
T0** R=0;
T37 _mem={0/*dummy*/};
T0* _x=NULL;
/*IF*//*AF*//*AE*/
R=malloc((a1)*(sizeof(char *)));
/*FI*/return R;
}
/*ARRAY[ASSERTION]*/void rT162put(T162 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[ASSERTION]*/void rT162standard_copy(T162 *C,T0* a1){
memcpy(C,a1,s[a1->id]);
}/*ARRAY[ASSERTION]*/void rT162copy(T162 *C,T0* a1){
int _i=0;
C->_upper=((C)->_lower)-(1);
/*IF*/if (((C)->_capacity)==(0)) {
rT162make(C,((T162*)a1)->_lower,((T162*)a1)->_upper);
}
else {
rT162resize(C,((T162*)a1)->_lower,((T162*)a1)->_upper);
}
/*FI*/_i=(C)->_lower;
while (!((_i)>((C)->_upper))) {
rT162put(C,rT162item((T162*)a1,_i),_i);
_i=(_i)+(1);
}
}/*ARRAY[ASSERTION]*/void rT162make(T162 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
C->_lower=a1;
C->_upper=a2;
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/C->_capacity=((a2)-(a1))+(1);
/*IF*/if (((C)->_capacity)>(0)) {
/*IF*/if (((C)->_capacity)<(16)) {
C->_capacity=16;
}
/*FI*/C->_storage=rT162malloc((C)->_capacity);
rT162clear_all(C);
}
/*FI*/}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.