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

This is pretty32.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 "pretty.h"
/*ARRAY[STRING]*/void rT45clear(T45 *C){
C->_upper=((C)->_lower)-(1);
}/*ARRAY[STRING]*/void rT45clear_all(T45 *C){
T0* _value=NULL;
rT45set_all_with(C,_value);
}/*ARRAY[STRING]*/T0* rT45first(T45 *C){
T0* R=NULL;
R=rT45item(C,(C)->_lower);
return R;
}
/*ARRAY[STRING]*/int rT45count(T45 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[STRING]*/void rT45set_all_with(T45 *C,T0* a1){
int _i=0;
_i=(C)->_upper;
while (!((_i)<((C)->_lower))) {
rT45put(C,a1,_i);
_i=(_i)-(1);
}
}/*ARRAY[STRING]*/int rT45fast_index_of(T45 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT45item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*ARRAY[STRING]*/int rT45fast_has(T45 *C,T0* a1){
int R=0;
R=(rT45fast_index_of(C,a1))!=(((C)->_upper)+(1));
return R;
}
/*ARRAY[STRING]*/void rT45resize(T45 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
int _up=0;
int _i=0;
T0* _other=NULL;
{T45 *n=((T45*)se_new(45));
rT45make(n,a1,a2);
_other=(T0 *)n;}
_i=rT2max((C)->_lower,((T45*)_other)->_lower);
_up=rT2min((C)->_upper,((T45*)_other)->_upper);
while (!((_i)>(_up))) {
rT45put((T45*)_other,rT45item(C,_i),_i);
_i=(_i)+(1);
}
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/rT45standard_copy(C,_other);
free(((void *)(T45*)_other));
}/*ARRAY[STRING]*/int rT45empty(T45 *C){
int R=0;
R=(rT45count(C))==(0);
return R;
}
/*ARRAY[STRING]*/T0* rT45item(T45 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[STRING]*/T0** rT45realloc(/*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[STRING]*/void rT45add_last(T45 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT45count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT45malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT45realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT45put(C,a1,(C)->_upper);
}/*ARRAY[STRING]*/T0** rT45malloc(/*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[STRING]*/int rT45equal_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=rT7is_equal((T7*)a1,a2);
}
/*FI*/return R;
}
/*ARRAY[STRING]*/int rT45index_of(T45 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(rT45equal_like(a1,rT45item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*ARRAY[STRING]*/void rT45put(T45 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[STRING]*/void rT45standard_copy(T45 *C,T0* a1){
memcpy(C,a1,s[a1->id]);
}/*ARRAY[STRING]*/void rT45make(T45 *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=rT45malloc((C)->_capacity);
rT45clear_all(C);
}
/*FI*/}/*ARRAY[TYPE]*/int rT106count(T106 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[TYPE]*/T0* rT106item(T106 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[TYPE]*/T0** rT106realloc(/*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[TYPE]*/void rT106add_last(T106 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT106count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT106malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT106realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT106put(C,a1,(C)->_upper);
}/*ARRAY[TYPE]*/T0** rT106malloc(/*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[TYPE]*/void rT106put(T106 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[RENAME_PAIR]*/int rT121count(T121 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[RENAME_PAIR]*/T0* rT121item(T121 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[RENAME_PAIR]*/T0** rT121realloc(/*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[RENAME_PAIR]*/void rT121add_last(T121 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT121count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT121malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT121realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT121put(C,a1,(C)->_upper);
}/*ARRAY[RENAME_PAIR]*/T0** rT121malloc(/*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[RENAME_PAIR]*/void rT121put(T121 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[CLASS_NAME]*/int rT125count(T125 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[CLASS_NAME]*/T0* rT125item(T125 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[CLASS_NAME]*/T0** rT125realloc(/*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[CLASS_NAME]*/void rT125add_last(T125 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT125count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT125malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT125realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT125put(C,a1,(C)->_upper);
}/*ARRAY[CLASS_NAME]*/T0** rT125malloc(/*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[CLASS_NAME]*/void rT125put(T125 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[EXPORT_ITEM]*/int rT127count(T127 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[EXPORT_ITEM]*/T0* rT127item(T127 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[EXPORT_ITEM]*/T0** rT127realloc(/*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[EXPORT_ITEM]*/void rT127add_last(T127 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT127count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT127malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT127realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT127put(C,a1,(C)->_upper);
}/*ARRAY[EXPORT_ITEM]*/T0** rT127malloc(/*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[EXPORT_ITEM]*/void rT127put(T127 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[FEATURE_NAME]*/T0* rT129twin(T129 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT129copy((T129*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*ARRAY[FEATURE_NAME]*/void rT129clear(T129 *C){
C->_upper=((C)->_lower)-(1);
}/*ARRAY[FEATURE_NAME]*/void rT129clear_all(T129 *C){
T0* _value=NULL;
rT129set_all_with(C,_value);
}/*ARRAY[FEATURE_NAME]*/T0* rT129first(T129 *C){
T0* R=NULL;
R=rT129item(C,(C)->_lower);
return R;
}
/*ARRAY[FEATURE_NAME]*/int rT129count(T129 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[FEATURE_NAME]*/void rT129set_all_with(T129 *C,T0* a1){
int _i=0;
_i=(C)->_upper;
while (!((_i)<((C)->_lower))) {
rT129put(C,a1,_i);
_i=(_i)-(1);
}
}/*ARRAY[FEATURE_NAME]*/void rT129resize(T129 *C,int a1,int a2){
T37 _mem={0/*dummy*/};
int _up=0;
int _i=0;
T0* _other=NULL;
{T129 *n=((T129*)se_new(129));
rT129make(n,a1,a2);
_other=(T0 *)n;}
_i=rT2max((C)->_lower,((T129*)_other)->_lower);
_up=rT2min((C)->_upper,((T129*)_other)->_upper);
while (!((_i)>(_up))) {
rT129put((T129*)_other,rT129item(C,_i),_i);
_i=(_i)+(1);
}
/*IF*/if (((int)(C)->_storage)) {
free((C)->_storage);
}
/*FI*/rT129standard_copy(C,_other);
free(((void *)(T129*)_other));
}/*ARRAY[FEATURE_NAME]*/T0* rT129item(T129 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[FEATURE_NAME]*/T0** rT129realloc(/*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[FEATURE_NAME]*/void rT129add_last(T129 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT129count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT129malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT129realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT129put(C,a1,(C)->_upper);
}/*ARRAY[FEATURE_NAME]*/T0** rT129malloc(/*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[FEATURE_NAME]*/void rT129put(T129 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}
/*ARRAY[FEATURE_NAME]*/void rT129standard_copy(T129 *C,T0* a1){
memcpy(C,a1,s[a1->id]);
}/*ARRAY[FEATURE_NAME]*/void rT129copy(T129 *C,T0* a1){
int _i=0;
C->_upper=((C)->_lower)-(1);
/*IF*/if (((C)->_capacity)==(0)) {
rT129make(C,((T129*)a1)->_lower,((T129*)a1)->_upper);
}
else {
rT129resize(C,((T129*)a1)->_lower,((T129*)a1)->_upper);
}
/*FI*/_i=(C)->_lower;
while (!((_i)>((C)->_upper))) {
rT129put(C,rT129item((T129*)a1,_i),_i);
_i=(_i)+(1);
}
}/*ARRAY[FEATURE_NAME]*/void rT129make(T129 *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=rT129malloc((C)->_capacity);
rT129clear_all(C);
}
/*FI*/}/*ARRAY[PARENT]*/int rT130count(T130 *C){
int R=0;
R=(((C)->_upper)-((C)->_lower))+(1);
return R;
}
/*ARRAY[PARENT]*/T0* rT130item(T130 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[PARENT]*/T0** rT130realloc(/*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[PARENT]*/void rT130add_last(T130 *C,T0* a1){
/*IF*//*AF*//*AE*/
/*FI*//*IF*/if (((C)->_capacity)<((rT130count(C))+(1))) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_capacity=16;
C->_storage=rT130malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(16);
C->_storage=rT130realloc((C)->_storage,(C)->_capacity);
}
/*FI*/}
/*FI*/C->_upper=((C)->_upper)+(1);
rT130put(C,a1,(C)->_upper);
}/*ARRAY[PARENT]*/T0** rT130malloc(/*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[PARENT]*/void rT130put(T130 *C,T0* a1,int a2){
((T0**)(C->_storage))[a2-(C->_lower)]=a1;
}

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