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

This is clean2.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 "clean.h"
/*STRING*/T0* rT7twin(T7 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT7copy((T7*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*STRING*/void rT7extend(T7 *C,char a1){
T37 _mem={0/*dummy*/};
/*IF*/if (((C)->_capacity)>((C)->_count)) {
}
 else if (((C)->_capacity)==(0)) {
C->_capacity=32;
C->_storage=malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(32);
C->_storage=realloc((C)->_storage,(C)->_capacity);
}
/*FI*/C->_count=((C)->_count)+(1);
rT7put(C,a1,(C)->_count);
}/*STRING*/void rT7to_upper(T7 *C){
int _i=0;
_i=(C)->_count;
while (!((_i)==(0))) {
rT7put(C,rT3to_upper(rT7item(C,_i)),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7remove_last(T7 *C,int a1){
C->_count=((C)->_count)-(a1);
}/*STRING*/void rT7remove_suffix(T7 *C,T0* a1){
rT7remove_last(C,((T7*)a1)->_count);
}/*STRING*/int rT7has_suffix(T7 *C,T0* a1){
int R=0;
int _i2=0;
int _i1=0;
/*IF*/if ((((T7*)a1)->_count)<=((C)->_count)) {
_i1=(((C)->_count)-(((T7*)a1)->_count))+(1);
_i2=1;
while (!((((_i1)>((C)->_count))||((_i2)>(((T7*)a1)->_count)))||((rT7item(C,_i1))!=(rT7item((T7*)a1,_i2))))) {
_i1=(_i1)+(1);
_i2=(_i2)+(1);
}
R=(_i1)>((C)->_count);
}
/*FI*/return R;
}
/*STRING*/char rT7item(T7 *C,int a1){
char R=0;
R=(C->_storage)[a1-1];
return R;
}
/*STRING*/int rT7is_equal(T7 *C,T0* a1){
int R=0;
int _i=0;
/*IF*/if (((T0 *)C)==((T0 *)a1)) {
R=1;
}
else {
_i=(C)->_count;
R=(_i)==(((T7*)a1)->_count);
while (!(((!(R))||((_i)==(0))))) {
R=(rT7item(C,_i))==(rT7item((T7*)a1,_i));
_i=(_i)-(1);
}
}
/*FI*/return R;
}
/*STRING*/void rT7append(T7 *C,T0* a1){
int _i=0;
_i=1;
while (!((_i)>(((T7*)a1)->_count))) {
rT7extend(C,rT7item((T7*)a1,_i));
_i=(_i)+(1);
}
}/*STRING*/char rT7last(T7 *C){
char R=0;
R=rT7item(C,(C)->_count);
return R;
}
/*STRING*/void rT7put(T7 *C,char a1,int a2){
(C->_storage)[a2-1]=a1;
}/*STRING*/void rT7swap(T7 *C,int a1,int a2){
char _tmp=0;
_tmp=rT7item(C,a1);
rT7put(C,rT7item(C,a2),a1);
rT7put(C,_tmp,a2);
}/*STRING*/void rT7copy(T7 *C,T0* a1){
int _i=0;
/*IF*/if (((C)->_capacity)<(((T7*)a1)->_count)) {
rT7make(C,((T7*)a1)->_count);
}
/*FI*/_i=((T7*)a1)->_count;
C->_count=_i;
while (!((_i)==(0))) {
rT7put(C,rT7item((T7*)a1,_i),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7to_lower(T7 *C){
int _i=0;
_i=(C)->_count;
while (!((_i)==(0))) {
rT7put(C,rT3to_lower(rT7item(C,_i)),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7make(T7 *C,int a1){
T37 _mem={0/*dummy*/};
/*IF*/if ((a1)>(0)) {
/*IF*/if (((C)->_capacity)<(a1)) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_storage=malloc(a1);
}
else {
C->_storage=realloc((C)->_storage,a1);
}
/*FI*/C->_capacity=a1;
}
/*FI*/}
/*FI*/C->_count=0;
}/*STRING*/char * rT7to_external(T7 *C){
char * R=0;
rT7extend(C,'\0');
C->_count=((C)->_count)-(1);
R=(C)->_storage;
return R;
}
/*BOOLEAN*/int rT6_ix111114(T6 C,int a1){
int R=0;
R=(C)||(a1);
return R;
}
/*BOOLEAN*/int rT6_px110111116(T6 C){
int R=0;
/*IF*/if (C) {
}
else {
R=1;
}
/*FI*/return R;
}
/*INTEGER*/char rT2digit(T2 C){
char R=0;
R=rT7item(ms1_2,(C)+(1));
return R;
}
/*INTEGER*/void rT2append_in(T2 C,T0* a1){
int _i=0;
int _val=0;
/*IF*/if ((C)==(0)) {
rT7extend((T7*)a1,'0');
}
else {
/*IF*/if ((C)<(0)) {
rT7extend((T7*)a1,'\55');
rT2append_in(-(C),a1);
}
else {
_i=(((T7*)a1)->_count)+(1);
_val=C;
while (!((_val)==(0))) {
rT7extend((T7*)a1,rT2digit((_val)%(10)));
_val=(_val)/(10);
}
_val=((T7*)a1)->_count;
while (!((_i)>=(_val))) {
rT7swap((T7*)a1,_i,_val);
_val=(_val)-(1);
_i=(_i)+(1);
}
}
/*FI*/}
/*FI*/}/*STD_OUTPUT*/void rT42die_with_code(/*C*/int a1){
exit(a1);
}/*STD_OUTPUT*/void rT42put_string(T42 *C,T0* a1){
int _i=0;
_i=1;
while (!((_i)>(((T7*)a1)->_count))) {
rT42put_character(C,rT7item((T7*)a1,_i));
_i=(_i)+(1);
}
}/*STD_OUTPUT*/void rT42append_file(T42 *C,T0* a1){
char _c=0;
rT43connect_to((T43*)oRBC39tmp_file_read,a1);
rT43read_character((T43*)oRBC39tmp_file_read);
while (!(rT43end_of_input((T43*)oRBC39tmp_file_read))) {
_c=rT43last_character((T43*)oRBC39tmp_file_read);
rT42put_character(C,_c);
rT43read_character((T43*)oRBC39tmp_file_read);
}
rT43disconnect((T43*)oRBC39tmp_file_read);
}T0*oRBC39tmp_file_read;
/*STD_OUTPUT*/void rT42put_character(T42 *C,char a1){
char _err=0;
_err=fputc(a1,(C)->_output_stream);
/*IF*/if ((_err)!=(a1)) {
rT38put_string((T38*)oRBC1std_error,(T0 *)ms2_39);
/*[IRF3:crash*/rsp();
rT42die_with_code(1);
/*]*/
}
/*FI*/}/*STD_OUTPUT*/void rT42make(T42 *C){
C->_output_stream=stdout;
}/*ARRAY[STRING]*/T0* rT44item(T44 *C,int a1){
T0* R=NULL;
R=(((T0**)(C->_storage))[a1-(C->_lower)]);
return R;
}
/*ARRAY[STRING]*/int rT44equal_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 rT44index_of(T44 *C,T0* a1){
int R=0;
R=(C)->_lower;
while (!(((R)>((C)->_upper))||(rT44equal_like(a1,rT44item(C,R))))) {
R=(R)+(1);
}
return R;
}
/*CHARACTER*/char rT3to_upper(T3 C){
char R=0;
/*IF*/if ((((unsigned char)C))<(97)) {
R=C;
}
 else if ((((unsigned char)C))>(122)) {
R=C;
}
else {
R=(((unsigned char)C))-(32);
}
/*FI*/return R;
}
/*CHARACTER*/int rT3is_digit(T3 C){
int R=0;
{int iv1=C;
if ((48<=iv1)&&(iv1<=57)) goto l2;
goto l3;
 l2: ;
R=1;
goto l1;
 l3: ;
 l1: ;
}
return R;
}
/*CHARACTER*/int rT3is_letter(T3 C){
int R=0;
{int iv1=C;
if ((65<=iv1)&&(iv1<=90)) goto l5;
if ((97<=iv1)&&(iv1<=122)) goto l5;
goto l6;
 l5: ;
R=1;
goto l4;
 l6: ;
 l4: ;
}
return R;
}
/*CHARACTER*/int rT3is_separator(T3 C){
int R=0;
{int iv1=C;
if (0 == iv1) goto l8;
if ((9<=iv1)&&(iv1<=10)) goto l8;
if (13 == iv1) goto l8;
if (32 == iv1) goto l8;
goto l9;
 l8: ;
R=1;
goto l7;
 l9: ;
 l7: ;
}
return R;
}
/*CHARACTER*/char rT3to_lower(T3 C){
char R=0;
/*IF*/if ((((unsigned char)C))<(65)) {
R=C;
}
 else if ((((unsigned char)C))>(90)) {
R=C;
}
else {
R=(((unsigned char)C))+(32);
}
/*FI*/return R;
}

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