This is finder3.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 "finder.h" /*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[INTEGER]*/void rT50clear_all(T50 *C){ int _value=0; rT50set_all_with(C,_value); }/*ARRAY[INTEGER]*/int rT50count(T50 *C){ int R=0; R=(((C)->_upper)-((C)->_lower))+(1); return R; } /*ARRAY[INTEGER]*/void rT50set_all_with(T50 *C,int a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT50put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[INTEGER]*/void rT50resize(T50 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T50 *n=((T50*)se_new(50)); rT50make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T50*)_other)->_lower); _up=rT2min((C)->_upper,((T50*)_other)->_upper); while (!((_i)>(_up))) { rT50put((T50*)_other,rT50item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT50standard_copy(C,_other); free(((void *)(T50*)_other)); }/*ARRAY[INTEGER]*/int rT50item(T50 *C,int a1){ int R=0; R=(((int*)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[INTEGER]*/int* rT50malloc(/*C*/int a1){ int* R=0; T37 _mem={0/*dummy*/}; int _x=0; /*IF*/{/*AT*/R=malloc((a1)*(((0),sizeof(T2)))); } /*FI*/return R; } /*ARRAY[INTEGER]*/void rT50put(T50 *C,int a1,int a2){ ((int*)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[INTEGER]*/void rT50standard_copy(T50 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[INTEGER]*/void rT50make(T50 *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=rT50malloc((C)->_capacity); rT50clear_all(C); } /*FI*/}/*ARRAY[STRING]*/void rT46clear(T46 *C){ C->_upper=((C)->_lower)-(1); }/*ARRAY[STRING]*/void rT46clear_all(T46 *C){ T0* _value=NULL; rT46set_all_with(C,_value); }/*ARRAY[STRING]*/int rT46count(T46 *C){ int R=0; R=(((C)->_upper)-((C)->_lower))+(1); return R; } /*ARRAY[STRING]*/void rT46set_all_with(T46 *C,T0* a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT46put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[STRING]*/void rT46resize(T46 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T46 *n=((T46*)se_new(46)); rT46make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T46*)_other)->_lower); _up=rT2min((C)->_upper,((T46*)_other)->_upper); while (!((_i)>(_up))) { rT46put((T46*)_other,rT46item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT46standard_copy(C,_other); free(((void *)(T46*)_other)); }/*ARRAY[STRING]*/T0* rT46item(T46 *C,int a1){ T0* R=NULL; R=(((T0**)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[STRING]*/T0** rT46realloc(/*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 rT46add_last(T46 *C,T0* a1){ /*IF*//*AF*//*AE*/ /*FI*//*IF*/if (((C)->_capacity)<((rT46count(C))+(1))) { /*IF*/if (((C)->_capacity)==(0)) { C->_capacity=16; C->_storage=rT46malloc((C)->_capacity); } else { C->_capacity=((C)->_capacity)+(16); C->_storage=rT46realloc((C)->_storage,(C)->_capacity); } /*FI*/} /*FI*/C->_upper=((C)->_upper)+(1); rT46put(C,a1,(C)->_upper); }/*ARRAY[STRING]*/T0** rT46malloc(/*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]*/void rT46put(T46 *C,T0* a1,int a2){ ((T0**)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[STRING]*/void rT46standard_copy(T46 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[STRING]*/void rT46make(T46 *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=rT46malloc((C)->_capacity); rT46clear_all(C); } /*FI*/}/*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.