This is compile1.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.h" T0 *se_new(int id){ int sz=s[id]; T0 *n=malloc((size_t)sz); memset(n,0,sz); n->id=id; return n; } /*STD_ERROR*/void rT38die_with_code(/*C*/int a1){ exit(a1); }/*STD_ERROR*/void rT38put_string(T38 *C,T0* a1){ int _i=0; _i=1; while (!((_i)>(((T7*)a1)->_count))) { rT38put_character(C,rT7item((T7*)a1,_i)); _i=(_i)+(1); } }T0*oRBC1std_error; /*STD_ERROR*/void rT38put_character(T38 *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(); rT38die_with_code(1); /*]*/ } /*FI*/}/*STD_ERROR*/void rT38make(T38 *C){ C->_output_stream=stderr; }/*STD_FILE_READ*/int rT43feof(T43 *C,void * a1){ int R=0; R=feof((FILE*)C->_input_stream); return R; } /*STD_FILE_READ*/int rT43end_of_input(T43 *C){ int R=0; R=rT43feof(C,(C)->_input_stream); return R; } /*STD_FILE_READ*/int rT43is_connected(T43 *C){ int R=0; R=((int)(C)->_path); return R; } /*STD_FILE_READ*/void rT43disconnect(T43 *C){ int _err=0; _err=fclose((C)->_input_stream); C->_path=NULL; }T0*oRBC43last_string; /*STD_FILE_READ*/char rT43last_character(T43 *C){ char R=0; R=(C)->_last_character_memory; return R; } /*STD_FILE_READ*/void rT43connect_to(T43 *C,T0* a1){ /*[IRF3:make*//*AW*/(C)->_mode=((T0 *)ms1_43);/*]*/ C->_input_stream=rT43fopen(a1,(C)->_mode); /*IF*/{/*AT*/C->_path=a1; } /*FI*/}/*STD_FILE_READ*/void rT43skip_separators(T43 *C){ while (!((rT43end_of_input(C))||(!(rT3is_separator(rT43last_character(C)))))) { rT43read_character(C); } }/*STD_FILE_READ*/void * rT43fopen(/*C*/T0* a1,T0* a2){ void * R=0; void * _pm=0; void * _pf=0; _pf=rT7to_external((T7*)a1); _pm=rT7to_external((T7*)a2); R=(void*)fopen(((char*)_pf),((char*)_pm)); return R; } /*STD_FILE_READ*/void rT43read_line_in(T43 *C,T0* a1){ /*[IRF3:clear*//*AW*/((T7*)a1)->_count=(0);/*]*/ rT43read_character(C); while (!((rT43end_of_input(C))||((rT43last_character(C))==('\12')))) { rT7extend((T7*)a1,rT43last_character(C)); rT43read_character(C); } }/*STD_FILE_READ*/void rT43read_line(T43 *C){ rT43read_line_in(C,oRBC43last_string); }/*STD_FILE_READ*/void rT43read_word(T43 *C){ rT43skip_separators(C); /*[IRF3:clear*//*AW*/((T7*)oRBC43last_string)->_count=(0);/*]*/ while (!((rT43end_of_input(C))||(rT3is_separator(rT43last_character(C))))) { rT7extend((T7*)oRBC43last_string,rT43last_character(C)); rT43read_character(C); } }/*STD_FILE_READ*/void rT43read_character(T43 *C){ C->_last_character_memory=fgetc((C)->_input_stream); }/*FIXED_ARRAY[STRING]*/void rT34clear_all(T34 *C){ T0* _value=NULL; rT34set_all_with(C,_value); }/*FIXED_ARRAY[STRING]*/void rT34set_all_with(T34 *C,T0* a1){ int _i=0; _i=(C)->_upper; while (!((_i)<(0))) { rT34put(C,a1,_i); _i=(_i)-(1); } }/*FIXED_ARRAY[STRING]*/T0* rT34item(T34 *C,int a1){ T0* R=NULL; R=(((T0**)(C->_storage))[a1]); return R; } /*FIXED_ARRAY[STRING]*/T0** rT34realloc(/*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; } /*FIXED_ARRAY[STRING]*/T0** rT34malloc(/*C*/int a1){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=malloc((a1)*(sizeof(char *))); /*FI*/return R; } /*FIXED_ARRAY[STRING]*/void rT34put(T34 *C,T0* a1,int a2){ ((T0**)(C->_storage))[a2]=a1; } /*FIXED_ARRAY[STRING]*/void rT34make(T34 *C,int a1){ /*IF*/if (((int)(C)->_storage)) { C->_storage=rT34realloc((C)->_storage,a1); } else { C->_storage=rT34malloc(a1); } /*FI*/C->_upper=(a1)-(1); rT34clear_all(C); }/*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_suffix(T7 *C,T0* a1){ rT7remove_last(C,((T7*)a1)->_count); }/*STRING*/void rT7remove_between(T7 *C,int a1,int a2){ int _i=0; _i=a2; while (!((_i)>=((C)->_count))) { rT7put(C,rT7item(C,(_i)+(1)),((a1)+(_i))-(a2)); _i=(_i)+(1); } C->_count=((C)->_count)-(((a2)-(a1))+(1)); }/*STRING*/void rT7remove_first(T7 *C,int a1){ /*IF*/if ((a1)>(0)) { rT7remove_between(C,1,a1); } /*FI*/}/*STRING*/void rT7remove_last(T7 *C,int a1){ C->_count=((C)->_count)-(a1); }/*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; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.