This is pretty19.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" /*DICTIONARY[STRING,STRING]*/void rT59resize(T59 *C,int a1){ int _p=0; int _n=0; int _i=0; T0* _new_buc=NULL; int _hash=0; {T56 *n=((T56*)se_new(56)); rT56make(n,a1); _new_buc=(T0 *)n;} _i=0; while (!((_i)>=((C)->_modulus))) { _n=rT56item((T56*)(C)->_buckets,_i); while (!((_n)==(0))) { _p=rT57item((T57*)(C)->_chain,_n); _hash=(rT7hash_code((T7*)rT45item((T45*)(C)->_keys,_n)))%(a1); rT57put((T57*)(C)->_chain,rT56item((T56*)_new_buc,_hash),_n); rT56put((T56*)_new_buc,_n,_hash); _n=_p; } _i=(_i)+(1); } C->_buckets=_new_buc; C->_modulus=a1; C->_item_mem=0; }/*DICTIONARY[STRING,STRING]*/T0* rT59at(T59 *C,T0* a1){ T0* R=NULL; int _foo=0; _foo=rT59has(C,a1); R=rT45item((T45*)(C)->_store,(C)->_has_mem); return R; } /*DICTIONARY[STRING,STRING]*/void rT59put(T59 *C,T0* a1,T0* a2){ int _hash=0; _hash=(rT7hash_code((T7*)a2))%((C)->_modulus); /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT56item((T56*)(C)->_buckets,_hash); while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem); } /*IF*/if (((C)->_has_mem)==(0)) { /*IF*/if (((C)->_count)>=(rT45count((T45*)(C)->_store))) { rT59expand(C); } /*FI*/rT45put((T45*)(C)->_keys,a2,(C)->_free); rT45put((T45*)(C)->_store,a1,(C)->_free); C->_has_mem=(C)->_free; C->_free=rT57item((T57*)(C)->_chain,(C)->_free); rT57put((T57*)(C)->_chain,rT56item((T56*)(C)->_buckets,_hash),(C)->_has_mem); rT56put((T56*)(C)->_buckets,(C)->_has_mem,_hash); C->_count=((C)->_count)+(1); /*IF*/if (((C)->_count)>(((C)->_modulus)*(2))) { rT59resize(C,(2)*((C)->_modulus)); } /*FI*/} /*FI*/} else { rT45put((T45*)(C)->_store,a1,(C)->_has_mem); } /*FI*/C->_item_mem=0; }/*DICTIONARY[STRING,STRING]*/void rT59expand(T59 *C){ int _old_size=0; int _i=0; C->_item_mem=0; _old_size=rT45count((T45*)(C)->_store); rT57resize((T57*)(C)->_chain,1,(2)*(_old_size)); rT45resize((T45*)(C)->_keys,1,(2)*(_old_size)); rT45resize((T45*)(C)->_store,1,(2)*(_old_size)); _i=(_old_size)+(1); while (!((_i)==(rT57count((T57*)(C)->_chain)))) { rT57put((T57*)(C)->_chain,(_i)+(1),_i); _i=(_i)+(1); } rT57put((T57*)(C)->_chain,(C)->_free,_i); C->_free=(_old_size)+(1); }/*DICTIONARY[STRING,STRING]*/int rT59has(T59 *C,T0* a1){ int R=0; /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT56item((T56*)(C)->_buckets,(rT7hash_code((T7*)a1))%((C)->_modulus)); while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem); } } /*FI*/R=((C)->_has_mem)!=(0); return R; } /*DICTIONARY[STRING,STRING]*/void rT59make(T59 *C){ int _i=0; C->_modulus=32; C->_count=0; C->_free=1; C->_has_mem=0; C->_item_mem=0; {T56 *n=((T56*)se_new(56)); rT56make(n,(C)->_modulus); C->_buckets=(T0 *)n;} {T57 *n=((T57*)se_new(57)); rT57make(n,1,16); C->_chain=(T0 *)n;} {T45 *n=((T45*)se_new(45)); rT45make(n,1,16); C->_store=(T0 *)n;} {T45 *n=((T45*)se_new(45)); rT45make(n,1,16); C->_keys=(T0 *)n;} _i=1; while (!((_i)==(rT57count((T57*)(C)->_chain)))) { rT57put((T57*)(C)->_chain,(_i)+(1),_i); _i=(_i)+(1); } rT57put((T57*)(C)->_chain,0,_i); _i=0; while (!((_i)>=((C)->_modulus))) { rT56put((T56*)(C)->_buckets,0,_i); _i=(_i)+(1); } }/*DICTIONARY[BASE_CLASS,STRING]*/void rT55shrink(T55 *C){ int _k=0; int _j=0; int _i=0; T0* _chn=NULL; T0* _kys=NULL; T0* _str=NULL; {T45 *n=((T45*)se_new(45)); rT45make(n,1,(rT58count((T58*)(C)->_store))/(2)); _kys=(T0 *)n;} {T58 *n=((T58*)se_new(58)); rT58make(n,1,(rT58count((T58*)(C)->_store))/(2)); _str=(T0 *)n;} {T57 *n=((T57*)se_new(57)); rT57make(n,1,(rT58count((T58*)(C)->_store))/(2)); _chn=(T0 *)n;} _i=1; _j=0; while (!((_j)>=((C)->_modulus))) { _k=rT56item((T56*)(C)->_buckets,_j); /*IF*/if ((_k)!=(0)) { rT56put((T56*)(C)->_buckets,_i,_j); } /*FI*/while (!((_k)==(0))) { rT45put((T45*)_kys,rT45item((T45*)(C)->_keys,_k),_i); rT58put((T58*)_str,rT58item((T58*)(C)->_store,_k),_i); _k=rT57item((T57*)(C)->_chain,_k); /*IF*/if ((_k)==(0)) { rT57put((T57*)_chn,0,_i); } else { rT57put((T57*)_chn,(_i)+(1),_i); } /*FI*/_i=(_i)+(1); } _j=(_j)+(1); } _i=((C)->_count)+(1); while (!((_i)>=(rT57count((T57*)_chn)))) { rT57put((T57*)_chn,(_i)+(1),_i); _i=(_i)+(1); } rT57put((T57*)_chn,0,_i); C->_free=((C)->_count)+(1); C->_chain=_chn; C->_keys=_kys; C->_store=_str; C->_item_mem=0; }/*DICTIONARY[BASE_CLASS,STRING]*/void rT55remove(T55 *C,T0* a1){ int _p=0; int _n=0; int _hash=0; _hash=(rT7hash_code((T7*)a1))%((C)->_modulus); _n=rT56item((T56*)(C)->_buckets,_hash); while (!(((_n)==(0))||(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,_n))))) { _p=_n; _n=rT57item((T57*)(C)->_chain,_n); } /*IF*/if ((_n)!=(0)) { /*IF*/if ((_p)!=(0)) { rT57put((T57*)(C)->_chain,rT57item((T57*)(C)->_chain,_n),_p); } else { rT56put((T56*)(C)->_buckets,rT57item((T57*)(C)->_chain,_n),_hash); } /*FI*/rT57put((T57*)(C)->_chain,(C)->_free,_n); C->_free=_n; C->_count=((C)->_count)-(1); /*IF*/if ((_n)==((C)->_has_mem)) { C->_has_mem=0; } /*FI*//*IF*/if ((((C)->_count)<((rT58count((T58*)(C)->_store))/(4)))&&(((C)->_count)>(16))) { rT55shrink(C); } /*FI*/} /*FI*/C->_item_mem=0; }/*DICTIONARY[BASE_CLASS,STRING]*/void rT55resize(T55 *C,int a1){ int _p=0; int _n=0; int _i=0; T0* _new_buc=NULL; int _hash=0; {T56 *n=((T56*)se_new(56)); rT56make(n,a1); _new_buc=(T0 *)n;} _i=0; while (!((_i)>=((C)->_modulus))) { _n=rT56item((T56*)(C)->_buckets,_i); while (!((_n)==(0))) { _p=rT57item((T57*)(C)->_chain,_n); _hash=(rT7hash_code((T7*)rT45item((T45*)(C)->_keys,_n)))%(a1); rT57put((T57*)(C)->_chain,rT56item((T56*)_new_buc,_hash),_n); rT56put((T56*)_new_buc,_n,_hash); _n=_p; } _i=(_i)+(1); } C->_buckets=_new_buc; C->_modulus=a1; C->_item_mem=0; }/*DICTIONARY[BASE_CLASS,STRING]*/T0* rT55at(T55 *C,T0* a1){ T0* R=NULL; int _foo=0; _foo=rT55has(C,a1); R=rT58item((T58*)(C)->_store,(C)->_has_mem); return R; } /*DICTIONARY[BASE_CLASS,STRING]*/void rT55put(T55 *C,T0* a1,T0* a2){ int _hash=0; _hash=(rT7hash_code((T7*)a2))%((C)->_modulus); /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT56item((T56*)(C)->_buckets,_hash); while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem); } /*IF*/if (((C)->_has_mem)==(0)) { /*IF*/if (((C)->_count)>=(rT58count((T58*)(C)->_store))) { rT55expand(C); } /*FI*/rT45put((T45*)(C)->_keys,a2,(C)->_free); rT58put((T58*)(C)->_store,a1,(C)->_free); C->_has_mem=(C)->_free; C->_free=rT57item((T57*)(C)->_chain,(C)->_free); rT57put((T57*)(C)->_chain,rT56item((T56*)(C)->_buckets,_hash),(C)->_has_mem); rT56put((T56*)(C)->_buckets,(C)->_has_mem,_hash); C->_count=((C)->_count)+(1); /*IF*/if (((C)->_count)>(((C)->_modulus)*(2))) { rT55resize(C,(2)*((C)->_modulus)); } /*FI*/} /*FI*/} else { rT58put((T58*)(C)->_store,a1,(C)->_has_mem); } /*FI*/C->_item_mem=0; }/*DICTIONARY[BASE_CLASS,STRING]*/void rT55expand(T55 *C){ int _old_size=0; int _i=0; C->_item_mem=0; _old_size=rT58count((T58*)(C)->_store); rT57resize((T57*)(C)->_chain,1,(2)*(_old_size)); rT45resize((T45*)(C)->_keys,1,(2)*(_old_size)); rT58resize((T58*)(C)->_store,1,(2)*(_old_size)); _i=(_old_size)+(1); while (!((_i)==(rT57count((T57*)(C)->_chain)))) { rT57put((T57*)(C)->_chain,(_i)+(1),_i); _i=(_i)+(1); } rT57put((T57*)(C)->_chain,(C)->_free,_i); C->_free=(_old_size)+(1); }/*DICTIONARY[BASE_CLASS,STRING]*/int rT55has(T55 *C,T0* a1){ int R=0; /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT56item((T56*)(C)->_buckets,(rT7hash_code((T7*)a1))%((C)->_modulus)); while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) { C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem); } } /*FI*/R=((C)->_has_mem)!=(0); return R; } /*DICTIONARY[BASE_CLASS,STRING]*/void rT55make(T55 *C){ int _i=0; C->_modulus=32; C->_count=0; C->_free=1; C->_has_mem=0; C->_item_mem=0; {T56 *n=((T56*)se_new(56)); rT56make(n,(C)->_modulus); C->_buckets=(T0 *)n;} {T57 *n=((T57*)se_new(57)); rT57make(n,1,16); C->_chain=(T0 *)n;} {T58 *n=((T58*)se_new(58)); rT58make(n,1,16); C->_store=(T0 *)n;} {T45 *n=((T45*)se_new(45)); rT45make(n,1,16); C->_keys=(T0 *)n;} _i=1; while (!((_i)==(rT57count((T57*)(C)->_chain)))) { rT57put((T57*)(C)->_chain,(_i)+(1),_i); _i=(_i)+(1); } rT57put((T57*)(C)->_chain,0,_i); _i=0; while (!((_i)>=((C)->_modulus))) { rT56put((T56*)(C)->_buckets,0,_i); _i=(_i)+(1); } }/*CREATION_CALL_4*/T0* rT253add_comment(T253 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } /*AF*/else { {T222 *n=((T222*)se_new(222)); rT222make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*CREATION_CALL_4*/void rT253pretty_print(T253 *C){ rT267put_character((T267*)oRBC27fmt,'\41'); XrT60pretty_print((C)->_type); rT267put_character((T267*)oRBC27fmt,'\41'); XrT180pretty_print((C)->_call); }/*CREATION_CALL_4*/void rT253make(T253 *C,T0* a1,T0* a2,T0* a3,T0* a4){ C->_start_position=a1; C->_type=a2; C->_writable=a3; C->_call=a4; }/*CREATION_CALL_3*/T0* rT251add_comment(T251 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } /*AF*/else { {T222 *n=((T222*)se_new(222)); rT222make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*CREATION_CALL_3*/void rT251pretty_print(T251 *C){ rT267put_string((T267*)oRBC27fmt,(T0 *)ms6_251); XrT180pretty_print((C)->_call); }/*CREATION_CALL_3*/void rT251make(T251 *C,T0* a1,T0* a2,T0* a3){ C->_start_position=a1; C->_writable=a2; C->_call=a3; }/*CREATION_CALL_2*/T0* rT249add_comment(T249 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } /*AF*/else { {T222 *n=((T222*)se_new(222)); rT222make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*CREATION_CALL_2*/void rT249pretty_print(T249 *C){ rT267put_character((T267*)oRBC27fmt,'\41'); XrT60pretty_print((C)->_type); rT267put_character((T267*)oRBC27fmt,'\41'); XrT70pretty_print((C)->_writable); /*IF*/if (((T267*)oRBC27fmt)->_semi_colon_flag) { rT267put_character((T267*)oRBC27fmt,'\73'); } /*FI*/}/*CREATION_CALL_2*/void rT249make(T249 *C,T0* a1,T0* a2,T0* a3){ C->_start_position=a1; C->_type=a2; C->_writable=a3; }/*CREATION_CALL_1*/T0* rT246add_comment(T246 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } /*AF*/else { {T222 *n=((T222*)se_new(222)); rT222make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*CREATION_CALL_1*/void rT246pretty_print(T246 *C){ rT267put_string((T267*)oRBC27fmt,(T0 *)ms3_246); XrT70pretty_print((C)->_writable); /*IF*/if (((T267*)oRBC27fmt)->_semi_colon_flag) { rT267put_character((T267*)oRBC27fmt,'\73'); } /*FI*/}/*CREATION_CALL_1*/void rT246make(T246 *C,T0* a1,T0* a2){ C->_start_position=a1; C->_writable=a2; }/*E_DEBUG*/T0* rT221add_comment(T221 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } else {/*AT*//*IF*/if ((rT61count((T61*)a1))==(1)) { R=(T0 *)C; } else { {T222 *n=((T222*)se_new(222)); rT222make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/} /*FI*/return R; } /*E_DEBUG*/void rT221pretty_print(T221 *C){ int _i=0; rT267keyword((T267*)oRBC27fmt,(T0 *)ms1_221); rT267level_incr((T267*)oRBC27fmt); /*IF*/if (((int)(C)->_list)) { rT267put_character((T267*)oRBC27fmt,'\50'); _i=((T153*)(C)->_list)->_lower; while (!((_i)>(((T153*)(C)->_list)->_upper))) { rT78pretty_print((T78*)rT153item((T153*)(C)->_list,_i)); _i=(_i)+(1); /*IF*/if ((_i)<=(((T153*)(C)->_list)->_upper)) { rT267put_character((T267*)oRBC27fmt,'\54'); } /*FI*/} rT267put_character((T267*)oRBC27fmt,'\51'); } /*FI*/rT267level_decr((T267*)oRBC27fmt); /*IF*/if (((int)(C)->_compound)) { rT140pretty_print((T140*)(C)->_compound); } /*FI*/rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms2_221); /*IF*/if (((T267*)oRBC27fmt)->_print_end_debug) { rT267put_end((T267*)oRBC27fmt,(T0 *)ms3_221); } /*FI*/}/*E_DEBUG*/void rT221make(T221 *C,T0* a1,T0* a2,T0* a3){ C->_start_position=a1; C->_list=a2; C->_compound=a3; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.