home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / bin_c / finder1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  29.0 KB  |  1,309 lines

  1. /* ANSI C code generated by SmallEiffel. */
  2. /*
  3. -- SmallEiffel  -- Release (- 0.97)    --      FRANCE
  4. -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN 
  5. -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr 
  6. -- CRIN (Centre de Recherche en Informatique de Nancy)
  7. -- FRANCE 
  8. */
  9. #include "finder.h"
  10. T0 *new(int id){
  11. int sz=s[id];
  12. T0 *n=malloc(sz);
  13. memset(n,0,sz);
  14. n->id=id;
  15. return n;
  16. }
  17. T0* rT26get_environment_variable(T26 *C,T0* a1){
  18. T0* R=NULL;
  19. rT7extend((T7*)a1,'\0');
  20. R=((T0 *)getenv(((T7 *)a1)->_storage));
  21. if (R) R=((T0 *)e2s((char *)R));
  22. rT7remove_last((T7*)a1,1);
  23. return R;
  24. }
  25. int ofBC27directory_separator=0;
  26. T3 oRBC27directory_separator;
  27. char rT26directory_separator(T26 *C){
  28. char R='\0';
  29. if (ofBC27directory_separator==0){
  30. ofBC27directory_separator=1;
  31. R=rT7last((T7*)rT26small_eiffel_directory(C));
  32. oRBC27directory_separator=R;}
  33. return oRBC27directory_separator;}
  34. void rT26die_with_code(T26 *C,int a1){
  35. exit(a1);
  36. }
  37. T0*oRBC27hlp_file_name;
  38. void rT26add_directory(T26 *C,T0* a1,T0* a2){
  39. rT7append((T7*)a1,a2);
  40. rT7extend((T7*)a1,rT26directory_separator(C));
  41. }
  42. void rT26print_hlp(T26 *C,T0* a1){
  43. rT7copy((T7*)oRBC27hlp_file_name,rT26small_eiffel_directory(C));
  44. rT26add_directory(C,oRBC27hlp_file_name,(T0 *)ms21);
  45. rT7append((T7*)oRBC27hlp_file_name,a1);
  46. /*IF*/if (!(rT7has_suffix((T7*)oRBC27hlp_file_name,(T0 *)ms22))) {
  47. rT7append((T7*)oRBC27hlp_file_name,(T0 *)ms22);
  48. }
  49. /*FI*//*IF*/if (!(rT26file_exists(C,oRBC27hlp_file_name))) {
  50. rT32put_string((T32*)oRBC1std_error,(T0 *)ms24);
  51. rT32put_string((T32*)oRBC1std_error,oRBC27hlp_file_name);
  52. rT32put_string((T32*)oRBC1std_error,(T0 *)ms25);
  53. rT26die_with_code(C,1);
  54. }
  55. /*FI*/rT38append_file((T38*)oRBC1std_output,oRBC27hlp_file_name);
  56. }
  57. T0*oRBC1std_error;
  58. T0* rT26clone(T26 *C,T0* a1){
  59. T0* R=NULL;
  60. /*IF*/if (((int)a1)) {
  61. R=(T0 *)new(a1->id);
  62. AF_1
  63. XrT28copy(R,a1);
  64. AF_0
  65. }
  66. /*FI*/return R;
  67. }
  68. T0*oRBC27small_eiffel;
  69. T0*oRBC1std_output;
  70. int ofBC27small_eiffel_directory=0;
  71. T0*oRBC27small_eiffel_directory;
  72. T0* rT26small_eiffel_directory(T26 *C){
  73. T0* R=NULL;
  74. char _slash='\0';
  75. int _i=0;
  76. if (ofBC27small_eiffel_directory==0){
  77. ofBC27small_eiffel_directory=1;
  78. R=rT26get_environment_variable(C,(T0 *)ms14);
  79. /*IF*/if (!(R)) {
  80. R=rT26clone(C,(T0 *)ms14);
  81. rT7to_upper((T7*)R);
  82. R=rT26get_environment_variable(C,R);
  83. /*IF*/if (((int)R)) {
  84. rT7to_upper((T7*)(T0 *)ms14);
  85. }
  86. /*FI*/}
  87. /*FI*//*IF*/if (!(R)) {
  88. R=(T0 *)ms20;
  89. }
  90. /*FI*/_i=((T7*)R)->_count;
  91. while (!((_i)<(0))) {
  92. _slash=rT7item((T7*)R,_i);
  93. /*IF*/if ((rT3is_letter(_slash))||(rT3is_digit(_slash))) {
  94. _i=(_i)-(1);
  95. }
  96. else {
  97. _i=-(1);
  98. }
  99. /*FI*/}
  100. /*IF*/if ((_i)==(0)) {
  101. rT7extend((T7*)R,'\57');
  102. }
  103.  else if (!((rT7last((T7*)R))==(_slash))) {
  104. rT7extend((T7*)R,_slash);
  105. }
  106. /*FI*/oRBC27small_eiffel_directory=R;}
  107. return oRBC27small_eiffel_directory;}
  108. void rT26copy(T26 *C,T0 * a1){
  109. /*IF*//*AF*//*AE*/
  110. memcpy(C,a1,s[C->id]);
  111. /*FI*/}
  112. void rT26make(T26 *C){
  113. T0* _file_name=NULL;
  114. T0* _class_name=NULL;
  115. /*IF*/if ((argument_count)!=(1)) {
  116. rT32put_string((T32*)oRBC1std_error,(T0 *)ms5);
  117. rT26print_hlp(C,(T0 *)ms28);
  118. rT26die_with_code(C,1);
  119. }
  120. /*FI*/_class_name=argument[1];
  121. _file_name=rT40find_path_for((T40*)oRBC27small_eiffel,_class_name);
  122. /*IF*/if (!(_file_name)) {
  123. rT38put_string((T38*)oRBC1std_output,_class_name);
  124. rT38put_string((T38*)oRBC1std_output,(T0 *)ms61);
  125. rT26die_with_code(C,1);
  126. }
  127. else {
  128. rT38put_string((T38*)oRBC1std_output,_file_name);
  129. rT38put_character((T38*)oRBC1std_output,'\12');
  130. }
  131. /*FI*/}
  132. int rT26file_exists(T26 *C,T0* a1){
  133. int R=0;
  134. rT7extend((T7*)a1,'\0');
  135. {FILE *f=fopen(((T7 *)a1)->_storage,"r");
  136. R=(f != NULL);
  137. fclose(f);}
  138. rT7remove_last((T7*)a1,1);
  139. return R;
  140. }
  141. void rT45resize(T45 *C,int a1){
  142. int _p=0;
  143. int _n=0;
  144. int _i=0;
  145. T0* _new_buc=NULL;
  146. int _hash=0;
  147. {T46 *n=((T46*)new(46));
  148. rT46make(n,0,(a1)-(1));
  149. _new_buc=(T0 *)n;}
  150. _i=0;
  151. while (!((_i)>=((C)->_modulus))) {
  152. _n=rT46item((T46*)(C)->_buckets,_i);
  153. while (!((_n)==(0))) {
  154. _p=rT46item((T46*)(C)->_chain,_n);
  155. _hash=(rT7hash_code((T7*)rT43item((T43*)(C)->_keys,_n)))%(a1);
  156. rT46put((T46*)(C)->_chain,rT46item((T46*)_new_buc,_hash),_n);
  157. rT46put((T46*)_new_buc,_n,_hash);
  158. _n=_p;
  159. }
  160. _i=(_i)+(1);
  161. }
  162. C->_buckets=_new_buc;
  163. C->_modulus=a1;
  164. C->_item_mem=0;
  165. }
  166. T0* rT45clone(T45 *C,T0* a1){
  167. T0* R=NULL;
  168. /*IF*/if (((int)a1)) {
  169. R=(T0 *)new(a1->id);
  170. AF_1
  171. XrT28copy(R,a1);
  172. AF_0
  173. }
  174. /*FI*/return R;
  175. }
  176. T0* rT45at(T45 *C,T0* a1){
  177. T0* R=NULL;
  178. int _foo=0;
  179. _foo=rT45has(C,a1);
  180. R=rT43item((T43*)(C)->_store,(C)->_has_mem);
  181. return R;
  182. }
  183. void rT45put(T45 *C,T0* a1,T0* a2){
  184. int _hash=0;
  185. _hash=(rT7hash_code((T7*)a2))%((C)->_modulus);
  186. /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a2,rT43item((T43*)(C)->_keys,(C)->_has_mem))))) {
  187. C->_has_mem=rT46item((T46*)(C)->_buckets,_hash);
  188. while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a2,rT43item((T43*)(C)->_keys,(C)->_has_mem))))) {
  189. C->_has_mem=rT46item((T46*)(C)->_chain,(C)->_has_mem);
  190. }
  191. /*IF*/if (((C)->_has_mem)==(0)) {
  192. /*IF*/if (((C)->_count)>=(rT43count((T43*)(C)->_store))) {
  193. rT45expand(C);
  194. }
  195. /*FI*/rT43put((T43*)(C)->_keys,a2,(C)->_free);
  196. rT43put((T43*)(C)->_store,a1,(C)->_free);
  197. C->_has_mem=(C)->_free;
  198. C->_free=rT46item((T46*)(C)->_chain,(C)->_free);
  199. rT46put((T46*)(C)->_chain,rT46item((T46*)(C)->_buckets,_hash),(C)->_has_mem);
  200. rT46put((T46*)(C)->_buckets,(C)->_has_mem,_hash);
  201. C->_count=((C)->_count)+(1);
  202. /*IF*/if (((C)->_count)>(((C)->_modulus)*(2))) {
  203. rT45resize(C,(2)*((C)->_modulus));
  204. }
  205. /*FI*/}
  206. /*FI*/}
  207. else {
  208. rT43put((T43*)(C)->_store,a1,(C)->_has_mem);
  209. }
  210. /*FI*/C->_item_mem=0;
  211. }
  212. void rT45standard_copy(T45 *C,T0 * a1){
  213. memcpy(C,a1,s[a1->id]);
  214. }
  215. void rT45copy(T45 *C,T0 * a1){
  216. rT45standard_copy(C,a1);
  217. C->_keys=rT45clone(C,((T45*)a1)->_keys);
  218. C->_store=rT45clone(C,((T45*)a1)->_store);
  219. C->_buckets=rT45clone(C,((T45*)a1)->_buckets);
  220. C->_chain=rT45clone(C,((T45*)a1)->_chain);
  221. }
  222. void rT45expand(T45 *C){
  223. int _old_size=0;
  224. int _i=0;
  225. C->_item_mem=0;
  226. _old_size=rT43count((T43*)(C)->_store);
  227. rT46resize((T46*)(C)->_chain,1,(2)*(_old_size));
  228. rT43resize((T43*)(C)->_keys,1,(2)*(_old_size));
  229. rT43resize((T43*)(C)->_store,1,(2)*(_old_size));
  230. _i=(_old_size)+(1);
  231. while (!((_i)==(rT46count((T46*)(C)->_chain)))) {
  232. rT46put((T46*)(C)->_chain,(_i)+(1),_i);
  233. _i=(_i)+(1);
  234. }
  235. rT46put((T46*)(C)->_chain,(C)->_free,_i);
  236. C->_free=(_old_size)+(1);
  237. }
  238. int rT45has(T45 *C,T0* a1){
  239. int R=0;
  240. /*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a1,rT43item((T43*)(C)->_keys,(C)->_has_mem))))) {
  241. C->_has_mem=rT46item((T46*)(C)->_buckets,(rT7hash_code((T7*)a1))%((C)->_modulus));
  242. while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a1,rT43item((T43*)(C)->_keys,(C)->_has_mem))))) {
  243. C->_has_mem=rT46item((T46*)(C)->_chain,(C)->_has_mem);
  244. }
  245. }
  246. /*FI*/R=((C)->_has_mem)!=(0);
  247. return R;
  248. }
  249. void rT45make(T45 *C){
  250. int _i=0;
  251. C->_modulus=32;
  252. C->_count=0;
  253. C->_free=1;
  254. C->_has_mem=0;
  255. C->_item_mem=0;
  256. {T46 *n=((T46*)new(46));
  257. rT46make(n,0,((C)->_modulus)-(1));
  258. C->_buckets=(T0 *)n;}
  259. {T46 *n=((T46*)new(46));
  260. rT46make(n,1,16);
  261. C->_chain=(T0 *)n;}
  262. {T43 *n=((T43*)new(43));
  263. rT43make(n,1,16);
  264. C->_store=(T0 *)n;}
  265. {T43 *n=((T43*)new(43));
  266. rT43make(n,1,16);
  267. C->_keys=(T0 *)n;}
  268. _i=1;
  269. while (!((_i)==(rT46count((T46*)(C)->_chain)))) {
  270. rT46put((T46*)(C)->_chain,(_i)+(1),_i);
  271. _i=(_i)+(1);
  272. }
  273. rT46put((T46*)(C)->_chain,0,_i);
  274. _i=0;
  275. while (!((_i)>=((C)->_modulus))) {
  276. rT46put((T46*)(C)->_buckets,0,_i);
  277. _i=(_i)+(1);
  278. }
  279. }
  280. void rT32die_with_code(T32 *C,int a1){
  281. exit(a1);
  282. }
  283. void rT32put_string(T32 *C,T0* a1){
  284. int _i=0;
  285. _i=1;
  286. while (!((_i)>(((T7*)a1)->_count))) {
  287. rT32put_character(C,rT7_ix64((T7*)a1,_i));
  288. _i=(_i)+(1);
  289. }
  290. }
  291. void rT32crash(T32 *C){
  292. rsp();
  293. rT32die_with_code(C,1);
  294. }
  295. void rT32copy(T32 *C,T0 * a1){
  296. /*IF*//*AF*//*AE*/
  297. memcpy(C,a1,s[C->id]);
  298. /*FI*/}
  299. void rT32put_character(T32 *C,char a1){
  300. char _err='\0';
  301. _err=fputc(a1,(C)->_output_stream);
  302. /*IF*/if ((_err)!=(a1)) {
  303. rT32put_string((T32*)oRBC1std_error,(T0 *)ms1);
  304. rT32crash(C);
  305. }
  306. /*FI*/}
  307. void rT32make(T32 *C){
  308. C->_output_stream=stderr;
  309. }
  310. int rT39end_of_input(T39 *C){
  311. int R=0;
  312. R=feof((FILE *)(C)->_input_stream);
  313. return R;
  314. }
  315. int rT39is_connected(T39 *C){
  316. int R=0;
  317. R=((int)(C)->_path);
  318. return R;
  319. }
  320. void rT39disconnect(T39 *C){
  321. int _err=0;
  322. _err=fclose((C)->_input_stream);
  323. C->_path=NULL;
  324. }
  325. T0*oRBC39last_string;
  326. char rT39last_character(T39 *C){
  327. char R='\0';
  328. R=(C)->_last_character_memory;
  329. return R;
  330. }
  331. void rT39connect_to(T39 *C,T0* a1){
  332. /*(IRF3*/((C)->_mode)=((T0 *)ms26);
  333. /*)*/C->_input_stream=rT39fopen(C,a1,(C)->_mode);
  334. /*IF*/{/*AT*/C->_path=a1;
  335. }
  336. /*FI*/}
  337. void rT39skip_separators(T39 *C){
  338. while (!((rT39end_of_input(C))||(!(rT3is_separator(rT39last_character(C)))))) {
  339. rT39read_character(C);
  340. }
  341. }
  342. void * rT39fopen(T39 *C,T0* a1,T0* a2){
  343. void * R=NULL;
  344. rT7extend((T7*)a1,'\0');
  345. rT7extend((T7*)a2,'\0');
  346. R=(T0 *)fopen(((Tstring *)a1)->_storage,((Tstring *)a2)->_storage);
  347. rT7remove_last((T7*)a1,1);
  348. rT7remove_last((T7*)a2,1);
  349. return R;
  350. }
  351. void rT39copy(T39 *C,T0 * a1){
  352. /*IF*//*AF*//*AE*/
  353. memcpy(C,a1,s[C->id]);
  354. /*FI*/}
  355. void rT39read_word(T39 *C){
  356. rT39skip_separators(C);
  357. /*(IRF3*/(((T7*)oRBC39last_string)->_count)=(0);
  358. /*)*/while (!((rT39end_of_input(C))||(rT3is_separator(rT39last_character(C))))) {
  359. rT7extend((T7*)oRBC39last_string,rT39last_character(C));
  360. rT39read_character(C);
  361. }
  362. }
  363. void rT39read_line_in(T39 *C,T0* a1){
  364. /*(IRF3*/(((T7*)a1)->_count)=(0);
  365. /*)*/rT39read_character(C);
  366. while (!((rT39end_of_input(C))||((rT39last_character(C))==('\12')))) {
  367. rT7extend((T7*)a1,rT39last_character(C));
  368. rT39read_character(C);
  369. }
  370. }
  371. void rT39read_line(T39 *C){
  372. rT39read_line_in(C,oRBC39last_string);
  373. }
  374. void rT39read_character(T39 *C){
  375. C->_last_character_memory=fgetc((C)->_input_stream);
  376. }
  377. char rT7_ix64(T7 *C,int a1){
  378. char R='\0';
  379. R=(C->_storage)[a1-1];
  380. return R;
  381. }
  382. int rT7hash_code(T7 *C){
  383. int R=0;
  384. int _i=0;
  385. _i=(C)->_count;
  386. /*IF*/if ((_i)>(5)) {
  387. _i=5;
  388. }
  389. /*FI*/while (!((_i)==(0))) {
  390. R=(R)+(((unsigned char)rT7item(C,_i)));
  391. _i=(_i)-(1);
  392. }
  393. return R;
  394. }
  395. void rT7extend(T7 *C,char a1){
  396. C->_count=((C)->_count)+(1);
  397. /*IF*/if (((C)->_capacity)<((C)->_count)) {
  398. /*IF*/if (((C)->_capacity)==(0)) {
  399. C->_capacity=16;
  400. C->_storage=(char *)malloc((size_t)C->_capacity);
  401. }
  402. else {
  403. C->_capacity=((C)->_capacity)+(16);
  404. C->_storage=(char *)realloc(C->_storage,(size_t)C->_capacity);
  405. }
  406. /*FI*/}
  407. /*FI*/rT7put(C,a1,(C)->_count);
  408. }
  409. void rT7to_upper(T7 *C){
  410. int _i=0;
  411. _i=(C)->_count;
  412. while (!((_i)==(0))) {
  413. rT7put(C,rT3to_upper(rT7item(C,_i)),_i);
  414. _i=(_i)-(1);
  415. }
  416. }
  417. void rT7remove_last(T7 *C,int a1){
  418. C->_count=((C)->_count)-(a1);
  419. }
  420. int rT7has_suffix(T7 *C,T0* a1){
  421. int R=0;
  422. int _i2=0;
  423. int _i1=0;
  424. /*IF*/if ((((T7*)a1)->_count)<=((C)->_count)) {
  425. _i1=(((C)->_count)-(((T7*)a1)->_count))+(1);
  426. _i2=1;
  427. while (!((((_i1)>((C)->_count))||((_i2)>(((T7*)a1)->_count)))||((rT7item(C,_i1))!=(rT7item((T7*)a1,_i2))))) {
  428. _i1=(_i1)+(1);
  429. _i2=(_i2)+(1);
  430. }
  431. R=(_i1)>((C)->_count);
  432. }
  433. /*FI*/return R;
  434. }
  435. int rT7empty(T7 *C){
  436. int R=0;
  437. R=((C)->_count)==(0);
  438. return R;
  439. }
  440. char rT7item(T7 *C,int a1){
  441. char R='\0';
  442. R=(C->_storage)[a1-1];
  443. return R;
  444. }
  445. int rT7is_equal(T7 *C,T0* a1){
  446. int R=0;
  447. int _i=0;
  448. /*IF*/if (((T0 *)C)==((T0 *)a1)) {
  449. R=1;
  450. }
  451. else {
  452. _i=(C)->_count;
  453. R=(_i)==(((T7*)a1)->_count);
  454. while (!((!(R))||((_i)==(0)))) {
  455. R=(rT7item(C,_i))==(rT7item((T7*)a1,_i));
  456. _i=(_i)-(1);
  457. }
  458. }
  459. /*FI*/return R;
  460. }
  461. void rT7append(T7 *C,T0* a1){
  462. int _i=0;
  463. _i=1;
  464. while (!((_i)>(((T7*)a1)->_count))) {
  465. rT7extend(C,rT7_ix64((T7*)a1,_i));
  466. _i=(_i)+(1);
  467. }
  468. }
  469. char rT7last(T7 *C){
  470. char R='\0';
  471. R=rT7item(C,(C)->_count);
  472. return R;
  473. }
  474. void rT7put(T7 *C,char a1,int a2){
  475. (C->_storage)[a2-1]=a1;
  476. }
  477. void rT7copy(T7 *C,T0* a1){
  478. int _i=0;
  479. _i=((T7*)a1)->_count;
  480. C->_count=_i;
  481. /*IF*/if ((_i)>(0)) {
  482. /*IF*/if (((C)->_capacity)<(_i)) {
  483. /*IF*/if (((C)->_capacity)==(0)) {
  484. C->_storage=(char *)malloc((size_t)_i);
  485. }
  486. else {
  487. C->_storage=(char *)realloc(C->_storage,(size_t)_i);
  488. }
  489. /*FI*/C->_capacity=_i;
  490. }
  491. /*FI*/while (!((_i)==(0))) {
  492. rT7put(C,rT7item((T7*)a1,_i),_i);
  493. _i=(_i)-(1);
  494. }
  495. }
  496. /*FI*/}
  497. void rT7prepend(T7 *C,T0* a1){
  498. int _old_count=0;
  499. int _i=0;
  500. _old_count=(C)->_count;
  501. _i=((T7*)a1)->_count;
  502. while (!((_i)==(0))) {
  503. rT7extend(C,'\40');
  504. _i=(_i)-(1);
  505. }
  506. _i=(C)->_count;
  507. while (!((_old_count)==(0))) {
  508. rT7put(C,rT7item(C,_old_count),_i);
  509. _i=(_i)-(1);
  510. _old_count=(_old_count)-(1);
  511. }
  512. _i=((T7*)a1)->_count;
  513. while (!((_i)==(0))) {
  514. rT7put(C,rT7_ix64((T7*)a1,_i),_i);
  515. _i=(_i)-(1);
  516. }
  517. }
  518. void rT7to_lower(T7 *C){
  519. int _i=0;
  520. _i=(C)->_count;
  521. while (!((_i)==(0))) {
  522. rT7put(C,rT3to_lower(rT7item(C,_i)),_i);
  523. _i=(_i)-(1);
  524. }
  525. }
  526. void rT7make(T7 *C,int a1){
  527. C->_count=0;
  528. /*IF*/if ((a1)>(0)) {
  529. /*IF*/if (((C)->_capacity)<(a1)) {
  530. /*IF*/if (((C)->_capacity)==(0)) {
  531. C->_storage=(char *)malloc((size_t)a1);
  532. }
  533. else {
  534. C->_storage=(char *)realloc(C->_storage,(size_t)a1);
  535. }
  536. /*FI*/C->_capacity=a1;
  537. }
  538. /*FI*/}
  539. /*FI*/}
  540. int rT2min(T2 C,int a1){
  541. int R=0;
  542. /*IF*/if ((C)<(a1)) {
  543. R=C;
  544. }
  545. else {
  546. R=a1;
  547. }
  548. /*FI*/return R;
  549. }
  550. int rT2max(T2 C,int a1){
  551. int R=0;
  552. /*IF*/if ((a1)<(C)) {
  553. R=C;
  554. }
  555. else {
  556. R=a1;
  557. }
  558. /*FI*/return R;
  559. }
  560. T0* rT40find_path_for(T40 *C,T0* a1){
  561. T0* R=NULL;
  562. int _i=0;
  563. rT7copy((T7*)(T0 *)ms29,a1);
  564. rT7to_lower((T7*)(T0 *)ms29);
  565. /*IF*/if (!(rT7has_suffix((T7*)(T0 *)ms29,(T0 *)ms30))) {
  566. rT7append((T7*)(T0 *)ms29,(T0 *)ms30);
  567. }
  568. /*FI*//*IF*/if (rT40file_exists(C,(T0 *)ms29)) {
  569. R=rT40clone(C,(T0 *)ms29);
  570. }
  571. else {
  572. _i=((T43*)rT40loading_path(C))->_lower;
  573. while (!(((_i)>(((T43*)rT40loading_path(C))->_upper))||(((int)R)))) {
  574. rT7copy((T7*)(T0 *)ms43,rT43item((T43*)rT40loading_path(C),_i));
  575. rT7append((T7*)(T0 *)ms43,(T0 *)ms29);
  576. /*IF*/if (rT40file_exists(C,(T0 *)ms43)) {
  577. R=rT40clone(C,(T0 *)ms43);
  578. }
  579. /*FI*/_i=(_i)+(1);
  580. }
  581. }
  582. /*FI*//*IF*/if ((!(R))&&(rT45has((T45*)rT40rename_dictionary(C),(T0 *)ms29))) {
  583. rT7copy((T7*)(T0 *)ms43,rT45at((T45*)rT40rename_dictionary(C),(T0 *)ms29));
  584. /*IF*/if (rT40file_exists(C,(T0 *)ms43)) {
  585. R=(T0 *)ms43;
  586. }
  587. else {
  588. rT32put_string((T32*)oRBC1std_error,(T0 *)ms51);
  589. rT32put_string((T32*)oRBC1std_error,(T0 *)ms43);
  590. rT32put_string((T32*)oRBC1std_error,(T0 *)ms52);
  591. rT40die_with_code(C,1);
  592. }
  593. /*FI*/}
  594. /*FI*//*IF*/if (!(R)) {
  595. rT32put_string((T32*)oRBC1std_error,(T0 *)ms53);
  596. rT32put_string((T32*)oRBC1std_error,a1);
  597. rT32put_string((T32*)oRBC1std_error,(T0 *)ms54);
  598. /*(IRF3*/(((T7*)(T0 *)ms43)->_count)=(0);
  599. /*)*/rT40append_loading_path_in(C,(T0 *)ms43);
  600. rT32put_string((T32*)oRBC1std_error,(T0 *)ms43);
  601. }
  602. /*FI*/return R;
  603. }
  604. T0* rT40get_environment_variable(T40 *C,T0* a1){
  605. T0* R=NULL;
  606. rT7extend((T7*)a1,'\0');
  607. R=((T0 *)getenv(((T7 *)a1)->_storage));
  608. if (R) R=((T0 *)e2s((char *)R));
  609. rT7remove_last((T7*)a1,1);
  610. return R;
  611. }
  612. char rT40directory_separator(T40 *C){
  613. char R='\0';
  614. if (ofBC27directory_separator==0){
  615. ofBC27directory_separator=1;
  616. R=rT7last((T7*)rT40small_eiffel_directory(C));
  617. oRBC27directory_separator=R;}
  618. return oRBC27directory_separator;}
  619. void rT40die_with_code(T40 *C,int a1){
  620. exit(a1);
  621. }
  622. int ofBC40loading_path=0;
  623. T0*oRBC40loading_path;
  624. T0* rT40loading_path(T40 *C){
  625. T0* R=NULL;
  626. T0 * _file=NULL;
  627. T0* _defaults=NULL;
  628. char _slash='\0';
  629. int _i=0;
  630. T0* _path=NULL;
  631. if (ofBC40loading_path==0){
  632. ofBC40loading_path=1;
  633. _path=(T0 *)ms31;
  634. {T43 *n=((T43*)new(43));
  635. rT43make(n,1,10);
  636. R=(T0 *)n;}
  637. rT43clear((T43*)R);
  638. _slash=rT40directory_separator(C);
  639. /*IF*/if (rT40file_exists(C,_path)) {
  640. {T39 *n=((T39*)new(39));
  641. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  642. /*)*/_file=(T0 *)n;}
  643. rT40open_read(C,_file,_path);
  644. while (!(rT39end_of_input((T39*)_file))) {
  645. rT39read_line((T39*)_file);
  646. _path=rT40clone(C,oRBC39last_string);
  647. /*IF*/if (!(rT7empty((T7*)_path))) {
  648. /*IF*/if ((rT7last((T7*)_path))!=(_slash)) {
  649. rT7extend((T7*)_path,_slash);
  650. }
  651. /*FI*/rT43add_last((T43*)R,_path);
  652. }
  653. /*FI*/}
  654. rT39disconnect((T39*)_file);
  655. }
  656. /*FI*/_defaults=ma(43,0,3,ms39,ms40,ms41);
  657. _i=1;
  658. while (!((_i)>(((T43*)_defaults)->_upper))) {
  659. _path=rT43item((T43*)_defaults,_i);
  660. rT7prepend((T7*)_path,rT40small_eiffel_directory(C));
  661. rT7extend((T7*)_path,_slash);
  662. rT43add_last((T43*)R,_path);
  663. _i=(_i)+(1);
  664. }
  665. oRBC40loading_path=R;}
  666. return oRBC40loading_path;}
  667. void rT40open_read(T40 *C,T0 * a1,T0* a2){
  668. rT39connect_to((T39*)a1,a2);
  669. /*IF*/if (!(rT39is_connected((T39*)a1))) {
  670. rT32put_string((T32*)oRBC1std_error,(T0 *)ms35);
  671. rT32put_string((T32*)oRBC1std_error,a2);
  672. rT32put_string((T32*)oRBC1std_error,(T0 *)ms36);
  673. rT40die_with_code(C,1);
  674. }
  675. /*FI*/}
  676. T0* rT40clone(T40 *C,T0* a1){
  677. T0* R=NULL;
  678. /*IF*/if (((int)a1)) {
  679. R=(T0 *)new(a1->id);
  680. AF_1
  681. XrT28copy(R,a1);
  682. AF_0
  683. }
  684. /*FI*/return R;
  685. }
  686. int ofBC40rename_dictionary=0;
  687. T0*oRBC40rename_dictionary;
  688. T0 * rT40rename_dictionary(T40 *C){
  689. T0 * R=NULL;
  690. T0* _short_name=NULL;
  691. T0* _full_name=NULL;
  692. int _i=0;
  693. if (ofBC40rename_dictionary==0){
  694. ofBC40rename_dictionary=1;
  695. {T45 *n=((T45*)new(45));
  696. rT45make(n);
  697. R=(T0 *)n;}
  698. _i=1;
  699. while (!((_i)>(((T43*)rT40loading_path(C))->_upper))) {
  700. rT7copy((T7*)(T0 *)ms43,rT43item((T43*)rT40loading_path(C),_i));
  701. rT7append((T7*)(T0 *)ms43,(T0 *)ms44);
  702. /*IF*/if (rT40file_exists(C,(T0 *)ms43)) {
  703. rT40open_read(C,rT40tmp_file_read(),(T0 *)ms43);
  704. while (!(rT39end_of_input((T39*)rT40tmp_file_read()))) {
  705. rT39read_word((T39*)rT40tmp_file_read());
  706. _full_name=rT40clone(C,oRBC39last_string);
  707. rT39read_word((T39*)rT40tmp_file_read());
  708. _short_name=rT40clone(C,oRBC39last_string);
  709. rT7prepend((T7*)_short_name,rT43item((T43*)rT40loading_path(C),_i));
  710. /*IF*/if (rT45has((T45*)R,_full_name)) {
  711. rT32put_string((T32*)oRBC1std_error,(T0 *)ms45);
  712. rT32put_string((T32*)oRBC1std_error,_full_name);
  713. rT32put_string((T32*)oRBC1std_error,(T0 *)ms46);
  714. rT32put_string((T32*)oRBC1std_error,_short_name);
  715. rT32put_string((T32*)oRBC1std_error,(T0 *)ms47);
  716. rT32put_string((T32*)oRBC1std_error,rT45at((T45*)R,_full_name));
  717. rT32put_string((T32*)oRBC1std_error,(T0 *)ms48);
  718. rT40die_with_code(C,1);
  719. }
  720. /*FI*/rT45put((T45*)R,_short_name,_full_name);
  721. rT39skip_separators((T39*)rT40tmp_file_read());
  722. }
  723. rT39disconnect((T39*)rT40tmp_file_read());
  724. }
  725. /*FI*/_i=(_i)+(1);
  726. }
  727. oRBC40rename_dictionary=R;}
  728. return oRBC40rename_dictionary;}
  729. void rT40append_loading_path_in(T40 *C,T0* a1){
  730. T0* _sed=NULL;
  731. int _i=0;
  732. rT7append((T7*)a1,(T0 *)ms55);
  733. _i=((T43*)rT40loading_path(C))->_lower;
  734. while (!((_i)>(((T43*)rT40loading_path(C))->_upper))) {
  735. rT7extend((T7*)a1,'\42');
  736. rT7append((T7*)a1,rT43item((T43*)rT40loading_path(C),_i));
  737. rT7extend((T7*)a1,'\42');
  738. rT7extend((T7*)a1,'\12');
  739. _i=(_i)+(1);
  740. }
  741. rT7append((T7*)a1,(T0 *)ms56);
  742. rT7append((T7*)a1,(T0 *)ms14);
  743. _sed=rT40get_environment_variable(C,(T0 *)ms14);
  744. rT7append((T7*)a1,(T0 *)ms57);
  745. /*IF*/if (!(_sed)) {
  746. rT7append((T7*)a1,(T0 *)ms58);
  747. }
  748. else {
  749. rT7append((T7*)a1,(T0 *)ms59);
  750. rT7append((T7*)a1,_sed);
  751. rT7append((T7*)a1,(T0 *)ms60);
  752. }
  753. /*FI*/rT7extend((T7*)a1,'\12');
  754. }
  755. int ofBC27tmp_file_read=0;
  756. T0*oRBC27tmp_file_read;
  757. T0 * rT40tmp_file_read(/*C*/void){
  758. T0 * R=NULL;
  759. if (ofBC27tmp_file_read==0){
  760. ofBC27tmp_file_read=1;
  761. {T39 *n=((T39*)new(39));
  762. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  763. /*)*/R=(T0 *)n;}
  764. oRBC27tmp_file_read=R;}
  765. return oRBC27tmp_file_read;}
  766. T0* rT40small_eiffel_directory(T40 *C){
  767. T0* R=NULL;
  768. char _slash='\0';
  769. int _i=0;
  770. if (ofBC27small_eiffel_directory==0){
  771. ofBC27small_eiffel_directory=1;
  772. R=rT40get_environment_variable(C,(T0 *)ms14);
  773. /*IF*/if (!(R)) {
  774. R=rT40clone(C,(T0 *)ms14);
  775. rT7to_upper((T7*)R);
  776. R=rT40get_environment_variable(C,R);
  777. /*IF*/if (((int)R)) {
  778. rT7to_upper((T7*)(T0 *)ms14);
  779. }
  780. /*FI*/}
  781. /*FI*//*IF*/if (!(R)) {
  782. R=(T0 *)ms20;
  783. }
  784. /*FI*/_i=((T7*)R)->_count;
  785. while (!((_i)<(0))) {
  786. _slash=rT7item((T7*)R,_i);
  787. /*IF*/if ((rT3is_letter(_slash))||(rT3is_digit(_slash))) {
  788. _i=(_i)-(1);
  789. }
  790. else {
  791. _i=-(1);
  792. }
  793. /*FI*/}
  794. /*IF*/if ((_i)==(0)) {
  795. rT7extend((T7*)R,'\57');
  796. }
  797.  else if (!((rT7last((T7*)R))==(_slash))) {
  798. rT7extend((T7*)R,_slash);
  799. }
  800. /*FI*/oRBC27small_eiffel_directory=R;}
  801. return oRBC27small_eiffel_directory;}
  802. void rT40copy(T40 *C,T0 * a1){
  803. /*IF*//*AF*//*AE*/
  804. memcpy(C,a1,s[C->id]);
  805. /*FI*/}
  806. int rT40file_exists(T40 *C,T0* a1){
  807. int R=0;
  808. rT7extend((T7*)a1,'\0');
  809. {FILE *f=fopen(((T7 *)a1)->_storage,"r");
  810. R=(f != NULL);
  811. fclose(f);}
  812. rT7remove_last((T7*)a1,1);
  813. return R;
  814. }
  815. void rT38die_with_code(T38 *C,int a1){
  816. exit(a1);
  817. }
  818. void rT38put_string(T38 *C,T0* a1){
  819. int _i=0;
  820. _i=1;
  821. while (!((_i)>(((T7*)a1)->_count))) {
  822. rT38put_character(C,rT7_ix64((T7*)a1,_i));
  823. _i=(_i)+(1);
  824. }
  825. }
  826. void rT38crash(T38 *C){
  827. rsp();
  828. rT38die_with_code(C,1);
  829. }
  830. void rT38append_file(T38 *C,T0* a1){
  831. char _c='\0';
  832. rT39connect_to((T39*)rT38tmp_file_read(),a1);
  833. rT39read_character((T39*)rT38tmp_file_read());
  834. while (!(rT39end_of_input((T39*)rT38tmp_file_read()))) {
  835. _c=rT39last_character((T39*)rT38tmp_file_read());
  836. rT38put_character(C,_c);
  837. rT39read_character((T39*)rT38tmp_file_read());
  838. }
  839. rT39disconnect((T39*)rT38tmp_file_read());
  840. }
  841. int ofBC33tmp_file_read=0;
  842. T0*oRBC33tmp_file_read;
  843. T0 * rT38tmp_file_read(/*C*/void){
  844. T0 * R=NULL;
  845. if (ofBC33tmp_file_read==0){
  846. ofBC33tmp_file_read=1;
  847. {T39 *n=((T39*)new(39));
  848. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  849. /*)*/R=(T0 *)n;}
  850. oRBC33tmp_file_read=R;}
  851. return oRBC33tmp_file_read;}
  852. void rT38copy(T38 *C,T0 * a1){
  853. /*IF*//*AF*//*AE*/
  854. memcpy(C,a1,s[C->id]);
  855. /*FI*/}
  856. void rT38put_character(T38 *C,char a1){
  857. char _err='\0';
  858. _err=fputc(a1,(C)->_output_stream);
  859. /*IF*/if ((_err)!=(a1)) {
  860. rT32put_string((T32*)oRBC1std_error,(T0 *)ms1);
  861. rT38crash(C);
  862. }
  863. /*FI*/}
  864. void rT38make(T38 *C){
  865. C->_output_stream=stdout;
  866. }
  867. void rT46clear_all(T46 *C){
  868. int _value=0;
  869. rT46set_all_with(C,_value);
  870. }
  871. int rT46count(T46 *C){
  872. int R=0;
  873. R=(((C)->_upper)-((C)->_lower))+(1);
  874. return R;
  875. }
  876. void rT46set_all_with(T46 *C,int a1){
  877. int _i=0;
  878. _i=(C)->_upper;
  879. while (!((_i)<((C)->_lower))) {
  880. rT46put(C,a1,_i);
  881. _i=(_i)-(1);
  882. }
  883. }
  884. void rT46resize(T46 *C,int a1,int a2){
  885. int _up=0;
  886. int _i=0;
  887. T0* _other=NULL;
  888. {T46 *n=((T46*)new(46));
  889. rT46make(n,a1,a2);
  890. _other=(T0 *)n;}
  891. _i=rT2max((C)->_lower,((T46*)_other)->_lower);
  892. _up=rT2min((C)->_upper,((T46*)_other)->_upper);
  893. while (!((_i)>(_up))) {
  894. rT46put((T46*)_other,rT46item(C,_i),_i);
  895. _i=(_i)+(1);
  896. }
  897. /*IF*/{/*AT*/free(C->_storage);
  898. }
  899. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  900. }
  901. int rT46item(T46 *C,int a1){
  902. int R=0;
  903. R=(C->_storage)[a1-(C->_lower)];
  904. return R;
  905. }
  906. void rT46put(T46 *C,int a1,int a2){
  907. (C->_storage)[a2-(C->_lower)]=a1;
  908. }
  909. void rT46copy(T46 *C,T0* a1){
  910. int _i=0;
  911. C->_upper=((C)->_lower)-(1);
  912. /*IF*/if (((C)->_capacity)==(0)) {
  913. rT46make(C,((T46*)a1)->_lower,((T46*)a1)->_upper);
  914. }
  915. else {
  916. rT46resize(C,((T46*)a1)->_lower,((T46*)a1)->_upper);
  917. }
  918. /*FI*/_i=(C)->_lower;
  919. while (!((_i)>((C)->_upper))) {
  920. rT46put(C,rT46item((T46*)a1,_i),_i);
  921. _i=(_i)+(1);
  922. }
  923. }
  924. void rT46make(T46 *C,int a1,int a2){
  925. /*IF*/{/*AT*/free(C->_storage);
  926. }
  927. /*FI*/C->_lower=a1;
  928. C->_upper=a2;
  929. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  930. C->_storage=NULL;
  931. /*IF*/if (((C)->_capacity)>(0)) {
  932. C->_capacity=((C)->_capacity)+(16);
  933. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  934. rT46clear_all(C);
  935. }
  936. /*FI*/}
  937. void rT43clear(T43 *C){
  938. C->_upper=((C)->_lower)-(1);
  939. }
  940. void rT43clear_all(T43 *C){
  941. T0* _value=NULL;
  942. rT43set_all_with(C,_value);
  943. }
  944. int rT43count(T43 *C){
  945. int R=0;
  946. R=(((C)->_upper)-((C)->_lower))+(1);
  947. return R;
  948. }
  949. void rT43set_all_with(T43 *C,T0* a1){
  950. int _i=0;
  951. _i=(C)->_upper;
  952. while (!((_i)<((C)->_lower))) {
  953. rT43put(C,a1,_i);
  954. _i=(_i)-(1);
  955. }
  956. }
  957. void rT43resize(T43 *C,int a1,int a2){
  958. int _up=0;
  959. int _i=0;
  960. T0* _other=NULL;
  961. {T43 *n=((T43*)new(43));
  962. rT43make(n,a1,a2);
  963. _other=(T0 *)n;}
  964. _i=rT2max((C)->_lower,((T43*)_other)->_lower);
  965. _up=rT2min((C)->_upper,((T43*)_other)->_upper);
  966. while (!((_i)>(_up))) {
  967. rT43put((T43*)_other,rT43item(C,_i),_i);
  968. _i=(_i)+(1);
  969. }
  970. /*IF*/{/*AT*/free(C->_storage);
  971. }
  972. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  973. }
  974. T0* rT43item(T43 *C,int a1){
  975. T0* R=NULL;
  976. R=(C->_storage)[a1-(C->_lower)];
  977. return R;
  978. }
  979. void rT43add_last(T43 *C,T0* a1){
  980. /*IF*/if (((C)->_capacity)<((rT43count(C))+(1))) {
  981. C->_capacity=((C)->_capacity)+(16);
  982. /*IF*/if (((C)->_capacity)==(16)) {
  983. C->_storage=malloc(16*sizeof(*(C->_storage)));
  984. }
  985. else {
  986. C->_storage=realloc(C->_storage,((C->_capacity)*sizeof(*(C->_storage))));
  987. }
  988. /*FI*/}
  989. /*FI*/C->_upper=((C)->_upper)+(1);
  990. rT43put(C,a1,(C)->_upper);
  991. }
  992. void rT43put(T43 *C,T0* a1,int a2){
  993. (C->_storage)[a2-(C->_lower)]=a1;
  994. }
  995. void rT43copy(T43 *C,T0* a1){
  996. int _i=0;
  997. C->_upper=((C)->_lower)-(1);
  998. /*IF*/if (((C)->_capacity)==(0)) {
  999. rT43make(C,((T43*)a1)->_lower,((T43*)a1)->_upper);
  1000. }
  1001. else {
  1002. rT43resize(C,((T43*)a1)->_lower,((T43*)a1)->_upper);
  1003. }
  1004. /*FI*/_i=(C)->_lower;
  1005. while (!((_i)>((C)->_upper))) {
  1006. rT43put(C,rT43item((T43*)a1,_i),_i);
  1007. _i=(_i)+(1);
  1008. }
  1009. }
  1010. void rT43make(T43 *C,int a1,int a2){
  1011. /*IF*/{/*AT*/free(C->_storage);
  1012. }
  1013. /*FI*/C->_lower=a1;
  1014. C->_upper=a2;
  1015. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  1016. C->_storage=NULL;
  1017. /*IF*/if (((C)->_capacity)>(0)) {
  1018. C->_capacity=((C)->_capacity)+(16);
  1019. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  1020. rT43clear_all(C);
  1021. }
  1022. /*FI*/}
  1023. char rT3to_upper(T3 C){
  1024. char R='\0';
  1025. /*IF*/if ((((unsigned char)C))<(97)) {
  1026. R=C;
  1027. }
  1028.  else if ((((unsigned char)C))>(122)) {
  1029. R=C;
  1030. }
  1031. else {
  1032. R=(((unsigned char)C))-(32);
  1033. }
  1034. /*FI*/return R;
  1035. }
  1036. int rT3is_digit(T3 C){
  1037. int R=0;
  1038. {int iv1=C;
  1039. if ((48 <= iv1) && (iv1<= 57)) goto l2;
  1040. goto l3;
  1041.  l2: ;
  1042. R=1;
  1043. goto l1;
  1044.  l3: ;
  1045.  l1: ;
  1046. }
  1047. return R;
  1048. }
  1049. int rT3is_letter(T3 C){
  1050. int R=0;
  1051. {int iv1=C;
  1052. if ((65 <= iv1) && (iv1<= 90)) goto l5;
  1053. if ((97 <= iv1) && (iv1<= 122)) goto l5;
  1054. goto l6;
  1055.  l5: ;
  1056. R=1;
  1057. goto l4;
  1058.  l6: ;
  1059.  l4: ;
  1060. }
  1061. return R;
  1062. }
  1063. int rT3is_separator(T3 C){
  1064. int R=0;
  1065. {int iv1=C;
  1066. if (0 == iv1) goto l8;
  1067. if ((9 <= iv1) && (iv1<= 10)) goto l8;
  1068. if (13 == iv1) goto l8;
  1069. if (32 == iv1) goto l8;
  1070. goto l9;
  1071.  l8: ;
  1072. R=1;
  1073. goto l7;
  1074.  l9: ;
  1075.  l7: ;
  1076. }
  1077. return R;
  1078. }
  1079. char rT3to_lower(T3 C){
  1080. char R='\0';
  1081. /*IF*/if ((((unsigned char)C))<(65)) {
  1082. R=C;
  1083. }
  1084.  else if ((((unsigned char)C))>(90)) {
  1085. R=C;
  1086. }
  1087. else {
  1088. R=(((unsigned char)C))+(32);
  1089. }
  1090. /*FI*/return R;
  1091. }
  1092. int argument_count;
  1093. T0 **argument;
  1094. void main(int argc, char *argv[]) {initialize();{T26 *n=((T26*)new(26));
  1095. int i;
  1096. argument_count = argc - 1;
  1097. argument = (T0 **)malloc(sizeof(Tstring *)*argc);
  1098. for (i = 0; i < argc ; i++) 
  1099. argument[i] = (T0 *)e2s(argv[i]);
  1100. signal(SIGINT,sigrsp);
  1101. signal(SIGQUIT,sigrsp);
  1102. signal(SIGKILL,sigrsp);
  1103. ms1=e2s("Error while writing character.");
  1104. ms5=e2s("Bad use of command `finder\'.\n");
  1105. ms14=e2s("SmallEiffel");
  1106. ms17=e2s("C=a1;");
  1107. ms18=e2s("memcpy(C,a1,s[C->id]);");
  1108. ms20=e2s("/usr/local/logiciel/SmallEiffel");
  1109. ms21=e2s("man");
  1110. ms22=e2s(".hlp");
  1111. ms24=e2s("Unable to find help file \"");
  1112. ms25=e2s("\".\n");
  1113. ms26=e2s("r");
  1114. ms28=e2s("finder");
  1115. ms29=e2s("                                                    ");
  1116. ms30=e2s(".e");
  1117. ms31=e2s("loadpath.se");
  1118. ms35=e2s("Cannot read file \"");
  1119. ms36=e2s("\".\n");
  1120. ms39=e2s("lib_std");
  1121. ms40=e2s("lib_show");
  1122. ms41=e2s("lib_test");
  1123. ms43=e2s("                                                    ");
  1124. ms44=e2s("rename.se");
  1125. ms45=e2s("Multiple entry for \"");
  1126. ms46=e2s("\" in \"rename.se\" files.\nClash for \n\"");
  1127. ms47=e2s("\" and \n\"");
  1128. ms48=e2s(".\n");
  1129. ms51=e2s("Bad \"rename.se\" file.\nCannot open \"");
  1130. ms52=e2s("\".");
  1131. ms53=e2s("Unable to find file for class \"");
  1132. ms54=e2s("\". ");
  1133. ms55=e2s("\nLoading path is :\n");
  1134. ms56=e2s("Environment Variable \"");
  1135. ms57=e2s("\" is\n");
  1136. ms58=e2s("not set. ");
  1137. ms59=e2s("set to \"");
  1138. ms60=e2s("\". ");
  1139. ms61=e2s(": not found.\n");
  1140. {T0 *R;
  1141. {T32 *n=((T32*)new(32));
  1142. rT32make(n);
  1143. R=(T0 *)n;}
  1144. oRBC1std_error=R;}/*PCO*/
  1145. {T0 *R;
  1146. {T7 *n=((T7*)new(7));
  1147. rT7make(n,256);
  1148. R=(T0 *)n;}
  1149. oRBC39last_string=R;}/*PCO*/
  1150. {T0 *R;
  1151. {T38 *n=((T38*)new(38));
  1152. rT38make(n);
  1153. R=(T0 *)n;}
  1154. oRBC1std_output=R;}/*PCO*/
  1155. {T0 *R;
  1156. {T40 *n=((T40*)new(40));
  1157. /*(IRF3*//*)*/R=(T0 *)n;}
  1158. oRBC27small_eiffel=R;}/*PCO*/
  1159. {T0 *R;
  1160. {T7 *n=((T7*)new(7));
  1161. rT7make(n,256);
  1162. R=(T0 *)n;}
  1163. oRBC27hlp_file_name=R;}/*PCO*/
  1164. rT26make(n);
  1165. exit(0);}}
  1166. char *s2e(Tstring *s){
  1167. char *e = (char *)malloc((s->_count)+1);
  1168. memcpy(e,s->_storage,s->_count);
  1169. e[s->_count] = '\0';
  1170. return e;
  1171. }
  1172. Tstring *e2s(char *e){
  1173. Tstring *s = (Tstring *)new(stringId);
  1174. if (e != NULL) {
  1175. s->_capacity = strlen(e) + 1;
  1176. s->_count = (s->_capacity) - 1;
  1177. s->_storage = (char *)malloc(sizeof(char)*s->_capacity);
  1178. strcpy(s->_storage,e);}
  1179. return s;
  1180. }
  1181. T0 *ma(int aid,int eid,int argc,...){
  1182. va_list pa;
  1183. Tarray *a=((Tarray *)new(aid));
  1184. char *store=0;
  1185. a->_capacity=argc;
  1186. a->_lower=1;
  1187. a->_upper=argc;
  1188. a->_storage=0;
  1189. if (argc) {va_start(pa,argc);
  1190. if (eid) store=(char *)malloc(argc*(s[eid]));
  1191. else store=(char *)malloc(argc*(sizeof(T0*)));
  1192. a->_storage=(T0 **)store;
  1193. switch (eid){
  1194. case 0:
  1195. while (argc--){*((T0 **)store)=va_arg(pa,T0 *);
  1196. store+=sizeof(T0 *);}break;
  1197. case 2:case 6:
  1198. while (argc--){*((int *)store)=va_arg(pa,int);
  1199. store+=sizeof(int);}break;
  1200. case 3:
  1201. while (argc--){*((char *)store)=((char)va_arg(pa,int));
  1202. store+=sizeof(char);}break;
  1203. case 4:
  1204. while (argc--){*((float *)store)=va_arg(pa,double);
  1205. store+=sizeof(float);}break;
  1206. case 5:
  1207. while (argc--){*((double *)store)=va_arg(pa,double);
  1208. store+=sizeof(double);}break;
  1209. while (argc--){
  1210. memcpy(*((T0 **)va_arg(pa,T0 *)),store,s[eid]);
  1211. store+=s[eid];}}
  1212. va_end(pa);}
  1213. return (T0 *)a;
  1214. }
  1215. Tstring *ms1;
  1216. Tstring *ms5;
  1217. Tstring *ms14;
  1218. Tstring *ms17;
  1219. Tstring *ms18;
  1220. Tstring *ms20;
  1221. Tstring *ms21;
  1222. Tstring *ms22;
  1223. Tstring *ms24;
  1224. Tstring *ms25;
  1225. Tstring *ms26;
  1226. Tstring *ms28;
  1227. Tstring *ms29;
  1228. Tstring *ms30;
  1229. Tstring *ms31;
  1230. Tstring *ms35;
  1231. Tstring *ms36;
  1232. Tstring *ms39;
  1233. Tstring *ms40;
  1234. Tstring *ms41;
  1235. Tstring *ms43;
  1236. Tstring *ms44;
  1237. Tstring *ms45;
  1238. Tstring *ms46;
  1239. Tstring *ms47;
  1240. Tstring *ms48;
  1241. Tstring *ms51;
  1242. Tstring *ms52;
  1243. Tstring *ms53;
  1244. Tstring *ms54;
  1245. Tstring *ms55;
  1246. Tstring *ms56;
  1247. Tstring *ms57;
  1248. Tstring *ms58;
  1249. Tstring *ms59;
  1250. Tstring *ms60;
  1251. Tstring *ms61;
  1252. void rsp(void){
  1253. printf("Eiffel program crash at run time.\n");
  1254. printf("No trace when using option \"-boost\"\n");
  1255. exit(1);
  1256. }
  1257. void sigrsp(int sig){
  1258. printf("Received signal %d (man signal).\n",sig);
  1259. rsp();
  1260. exit(1);
  1261. }
  1262. void  XrT28copy(void *C,T0* a1){
  1263. int id=((T0 *)C)->id;
  1264. if (id <= 39) {
  1265. if (id <= 32) {
  1266. if (id <= 26) {
  1267. if (id <= 7) {
  1268. rT7copy((T7 *)C,a1);
  1269. } else {
  1270. rT26copy((T26 *)C,a1);
  1271. }} else {
  1272. rT32copy((T32 *)C,a1);
  1273. }} else {
  1274. if (id <= 38) {
  1275. rT38copy((T38 *)C,a1);
  1276. } else {
  1277. rT39copy((T39 *)C,a1);
  1278. }}} else {
  1279. if (id <= 43) {
  1280. if (id <= 40) {
  1281. rT40copy((T40 *)C,a1);
  1282. } else {
  1283. rT43copy((T43 *)C,a1);
  1284. }} else {
  1285. if (id <= 45) {
  1286. rT45copy((T45 *)C,a1);
  1287. } else {
  1288. rT46copy((T46 *)C,a1);
  1289. }}}}
  1290. size_t s[47];
  1291. Tstring * gt[47];
  1292. Tstring * g[47];
  1293. char * p[47];
  1294. void initialize(void){
  1295. s[26]=sizeof(T26);
  1296. s[8]=sizeof(T8);
  1297. s[45]=sizeof(T45);
  1298. s[32]=sizeof(T32);
  1299. s[39]=sizeof(T39);
  1300. s[7]=sizeof(T7);
  1301. s[6]=sizeof(T6);
  1302. s[2]=sizeof(T2);
  1303. s[40]=sizeof(T40);
  1304. s[38]=sizeof(T38);
  1305. s[46]=sizeof(T46);
  1306. s[43]=sizeof(T43);
  1307. s[3]=sizeof(T3);
  1308. }
  1309.