home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / g / bug / 1839 < prev    next >
Encoding:
Text File  |  1992-11-17  |  42.9 KB  |  3,645 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!idiap.CH!tmb
  3. From: tmb@idiap.CH (Thomas M. Breuel)
  4. Subject: GNU C++ version 2.3.1 core dump/bad assembler output
  5. Message-ID: <9211162156.AA09247@idiap.ch>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: tmb@idiap.ch
  8. Organization: GNUs Not Usenet
  9. Distribution: gnu
  10. Date: Mon, 16 Nov 1992 23:56:46 GMT
  11. Approved: bug-g++@prep.ai.mit.edu
  12. Lines: 3631
  13.  
  14. The file "foo.cc" (appended) makes GNU C++ 2.3.1 dump core, but only
  15. if not compiled with optimization. With optimization, bad assembly
  16. language output is generated.
  17.  
  18.                     Thomas.
  19.  
  20. arolla$ ngcc -v -c foo.cc
  21. Reading specs from /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/specs
  22. gcc version 2.3.1
  23.  /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix foo.cc /local/tmp/cca18336.i
  24. GNU CPP version 2.3.1 (sparc)
  25.  /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cc1plus /local/tmp/cca18336.i -quiet -dumpbase foo.cc -version -o /local/tmp/cca18336.s
  26. GNU C++ version 2.3.1 (sparc) compiled by GNU C version 2.3.1.
  27. NISTImages.cc:240: warning: class `NISTDigitImages' has virtual functions but non-virtual destructor
  28. ngcc: Internal compiler error: program cc1plus got fatal signal 6
  29. arolla$ ngcc -v -O4 -c foo.cc
  30. Reading specs from /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/specs
  31. gcc version 2.3.1
  32.  /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -D__OPTIMIZE__ foo.cc /local/tmp/cca18357.i
  33. GNU CPP version 2.3.1 (sparc)
  34.  /sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/cc1plus /local/tmp/cca18357.i -quiet -dumpbase foo.cc -O4 -version -o /local/tmp/cca18357.s
  35. GNU C++ version 2.3.1 (sparc) compiled by GNU C version 2.3.1.
  36. NISTImages.cc:240: warning: class `NISTDigitImages' has virtual functions but non-virtual destructor
  37.  as -o foo.o /local/tmp/cca18357.s
  38. as: "/local/tmp/cca18357.s", line 1395: error: redefinition of symbol "_art_initialize"
  39. as: "/local/tmp/cca18357.s", line 1979: error: redefinition of symbol "_art_initialize"
  40. as: "/local/tmp/cca18357.s", line 2465: error: redefinition of symbol "_art_initialize"
  41. as: "/local/tmp/cca18357.s", line 3442: error: redefinition of symbol "_art_initialize"
  42. ngcc: foo.o: No such file or directory
  43. arolla$
  44.  
  45. = foo.cc ===============================================================
  46. # 1 "NISTImages.cc"
  47. # 1 "Vision.h" 1
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. extern "C" {
  58. # 1 "/sym/gnu/lib/g++-include/stdio.h" 1 3
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. #pragma interface
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. # 1 "/sym/gnu/lib/g++-include/_G_config.h" 1 3
  92.   
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. # 33 "/sym/gnu/lib/g++-include/stdio.h" 2 3
  137.  
  138.  
  139. extern "C" {
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdio.h" 1 3
  174.  
  175. # 1 "/sym/gnu/lib/g++-include/stdarg.h" 1 3
  176. extern "C" {
  177. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdarg.h" 1 3
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/va-sparc.h" 1 3
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221. typedef char * __gnuc_va_list;
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231. # 79 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/va-sparc.h" 3
  232.  
  233.  
  234. # 32 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdarg.h" 2 3
  235.  
  236. # 77 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdarg.h" 3
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243. # 140 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdarg.h" 3
  244.  
  245.  
  246.  
  247.  
  248.  
  249. # 2 "/sym/gnu/lib/g++-include/stdarg.h" 2 3
  250.  
  251. }
  252. # 2 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stdio.h" 2 3
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259. extern    struct    _iobuf {
  260.     int    _cnt;
  261.     unsigned char *_ptr;
  262.     unsigned char *_base;
  263.     int    _bufsiz;
  264.     short    _flag;
  265.     char    _file;         
  266. } _iob[];
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307. extern struct _iobuf     *__hide_fopen ();
  308. extern struct _iobuf     *__hide_fdopen ();
  309. extern struct _iobuf     *__hide_freopen ();
  310. extern struct _iobuf     *__hide_popen ();
  311. extern struct _iobuf     *tmpfile();
  312. extern long    __hide_ftell ();
  313. extern char    *fgets();
  314. extern char    *gets();
  315. extern char    *__hide_sprintf ();
  316. extern char    *ctermid();
  317. extern char    *cuserid();
  318. extern char    *__hide_tempnam ();
  319. extern char    *tmpnam();
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326. # 69 "/sym/gnu/lib/g++-include/stdio.h" 2 3
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366. }
  367.  
  368. extern "C" {
  369.  
  370. int    fclose(struct _iobuf *);
  371. struct _iobuf *  fdopen(int, const char*);
  372. int    fflush(struct _iobuf *);
  373. int    fgetc(struct _iobuf *);
  374. char*  fgets(char*, int, struct _iobuf  *);
  375. struct _iobuf *  fopen(const char*, const char*);
  376. int    fprintf(struct _iobuf *, const char* ...);
  377. int    fputc(int, struct _iobuf *);
  378. int    fputs(const char*, struct _iobuf *);
  379. int   fread(void*, int  , int  , struct _iobuf *);
  380.  
  381.  
  382.  
  383. struct _iobuf *  freopen(const char*, const char*, struct _iobuf *);
  384.  
  385. int    fscanf(struct _iobuf *, const char* ...);
  386. int    fseek(struct _iobuf *, long, int);
  387. long   ftell(struct _iobuf  *);
  388. int   fwrite(const void*, int  , int  , struct _iobuf *);
  389. char*  gets(char*);
  390. int    getw(struct _iobuf *);
  391. int    pclose(struct _iobuf *);
  392. void   perror(const char*);
  393. struct _iobuf *  popen(const char*, const char*);
  394. int    printf(const char* ...);
  395. int    puts(const char*);
  396. int    putw(int, struct _iobuf *);
  397. int    rewind(struct _iobuf *);
  398. int    scanf(const char* ...);
  399. void   setbuf(struct _iobuf *, char*);
  400. void   setbuffer(struct _iobuf *, char*, int);
  401. int    setlinebuf(struct _iobuf *);
  402. int    setvbuf(struct _iobuf *, char*, int, int  );
  403. int    sscanf(char*, const char* ...);
  404. struct _iobuf *  tmpfile();
  405. int    ungetc(int, struct _iobuf *);
  406. int    vfprintf (...) ;
  407. int    vprintf (...) ;
  408. char*  sprintf (...) ;
  409. char*  vsprintf (...) ;
  410.  
  411. extern int _filbuf (...) ;
  412. extern int _flsbuf (...) ;
  413.  
  414. }
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433. # 11 "Vision.h" 2
  434.  
  435. # 1 "/usr/include/floatingpoint.h" 1 3
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/ieeefp.h" 1 3
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471. enum fp_direction_type          
  472.     {
  473.     fp_nearest    = 0,
  474.     fp_tozero    = 1,
  475.     fp_positive    = 2,
  476.     fp_negative    = 3
  477.     } ;
  478.  
  479. # 34 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/ieeefp.h" 3
  480.  
  481. # 43 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/ieeefp.h" 3
  482.  
  483.  
  484. # 53 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/ieeefp.h" 3
  485.  
  486. enum fp_precision_type         
  487.     {
  488.     fp_extended    = 0,
  489.     fp_single    = 1,
  490.     fp_double    = 2,
  491.     fp_precision_3    = 3
  492.     } ;
  493.  
  494.  
  495. # 73 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/ieeefp.h" 3
  496.  
  497. enum fp_exception_type         
  498.     {
  499.     fp_inexact    = 0,
  500.     fp_division    = 1,
  501.     fp_underflow    = 2,
  502.     fp_overflow    = 3,
  503.     fp_invalid    = 4
  504.     } ;
  505.  
  506.  
  507. enum fp_class_type         
  508.     {
  509.     fp_zero        = 0,
  510.     fp_subnormal    = 1,
  511.     fp_normal    = 2,
  512.     fp_infinity       = 3,
  513.     fp_quiet    = 4,
  514.     fp_signaling    = 5
  515.     } ;
  516.  
  517.  
  518. # 18 "/usr/include/floatingpoint.h" 2 3
  519.  
  520.  
  521.  
  522.  
  523. typedef float   single;
  524. typedef unsigned long extended[3];     
  525.  
  526. typedef long double quadruple;     
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535. typedef unsigned fp_exception_field_type;
  536.  
  537.  
  538.  
  539.  
  540. typedef int     sigfpe_code_type;     
  541.  
  542. typedef void    (*sigfpe_handler_type) ();
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551. extern enum fp_direction_type fp_direction;
  552.  
  553.  
  554.  
  555.  
  556. extern enum fp_precision_type fp_precision;
  557.  
  558.  
  559.  
  560.  
  561. extern fp_exception_field_type fp_accrued_exceptions;
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573. typedef char    decimal_string[512 ];
  574.  
  575.  
  576. typedef struct {
  577.     enum fp_class_type fpclass;
  578.     int             sign;
  579.     int             exponent;
  580.     decimal_string  ds;     
  581.  
  582.  
  583.     int             more;     
  584.  
  585.  
  586.     int             ndigits; 
  587.  
  588.  
  589. }
  590.                 decimal_record;
  591.  
  592. enum decimal_form {
  593.     fixed_form,         
  594.  
  595.  
  596.  
  597.     floating_form         
  598.  
  599. };
  600.  
  601. typedef struct {
  602.     enum fp_direction_type rd;
  603.      
  604.     enum decimal_form df;     
  605.     int             ndigits; 
  606. }
  607.                 decimal_mode;
  608.  
  609. enum decimal_string_form {     
  610.     invalid_form,         
  611.     whitespace_form,     
  612.     fixed_int_form,         
  613.     fixed_intdot_form,     
  614.     fixed_dotfrac_form,     
  615.     fixed_intdotfrac_form,     
  616.     floating_int_form,     
  617.     floating_intdot_form,     
  618.     floating_dotfrac_form,     
  619.     floating_intdotfrac_form,     
  620.     inf_form,         
  621.     infinity_form,         
  622.     nan_form,         
  623.     nanstring_form         
  624. };
  625.  
  626.  
  627.  
  628. extern void     double_to_decimal();
  629. extern void     quadruple_to_decimal();
  630. extern char    *econvert();
  631. extern char    *fconvert();
  632. extern char    *gconvert();
  633. extern char    *qeconvert();
  634. extern char    *qfconvert();
  635. extern char    *qgconvert();
  636.  
  637.  
  638.  
  639.  
  640.  
  641. extern sigfpe_handler_type ieee_handlers[5    ];
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649. extern sigfpe_handler_type sigfpe();
  650.  
  651. extern void     single_to_decimal();
  652. extern void     extended_to_decimal();
  653.  
  654. extern void     decimal_to_single();
  655. extern void     decimal_to_double();
  656. extern void     decimal_to_extended();
  657. extern void     decimal_to_quadruple();
  658.  
  659. extern char    *seconvert();
  660. extern char    *sfconvert();
  661. extern char    *sgconvert();
  662.  
  663. extern void     string_to_decimal();
  664. extern void     file_to_decimal();
  665. extern void     func_to_decimal();
  666.  
  667.  
  668.  
  669. extern double   atof();
  670.  
  671.  
  672.  
  673. extern int      errno;
  674.  
  675. extern double   strtod();
  676.  
  677.  
  678. # 12 "Vision.h" 2
  679.  
  680. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/malloc.h" 1 3
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697. struct    mallinfo  {
  698.     int arena;     
  699.     int ordblks;     
  700.     int smblks;     
  701.     int hblks;     
  702.     int hblkhd;     
  703.     int usmblks;     
  704.     int fsmblks;     
  705.     int uordblks;     
  706.     int fordblks;     
  707.     int keepcost;     
  708.  
  709.     int mxfast;     
  710.     int nlblks;     
  711.     int grain;     
  712.     int uordbytes;     
  713.     int allocated;     
  714.     int treeoverhead;     
  715. };
  716.  
  717. typedef void *    malloc_t;
  718.  
  719. extern    malloc_t    calloc( );
  720. extern    void    free( );
  721. extern    malloc_t    malloc( );
  722. extern    malloc_t    realloc( );
  723. extern    int        mallopt();
  724. extern    struct mallinfo mallinfo();
  725.  
  726.  
  727. # 13 "Vision.h" 2
  728.  
  729. long time(long *);
  730. int ieee_handler();
  731. }
  732.  
  733. # 1 "/sym/gnu/lib/g++-include/std.h" 1 3
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757. # 1 "/sym/gnu/lib/g++-include/stddef.h" 1 3
  758.  
  759.  
  760. extern "C" {
  761.  
  762.  
  763.  
  764. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stddef.h" 1 3
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792. # 41 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/stddef.h" 3
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823. typedef int ptrdiff_t;
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861. typedef int int  ;
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902. typedef __wchar_t wchar_t;
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948. # 7 "/sym/gnu/lib/g++-include/stddef.h" 2 3
  949.  
  950.  
  951.  
  952.  
  953. }
  954.  
  955. # 24 "/sym/gnu/lib/g++-include/std.h" 2 3
  956.  
  957. # 1 "/sym/gnu/lib/g++-include/stdlib.h" 1 3
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965. extern "C" {
  966.  
  967. int       abs(int);
  968.  
  969.  
  970. void volatile abort(void);
  971.  
  972.  
  973.  
  974.  
  975. double    atof(const char*);
  976. int       atoi(const char*);
  977. long      atol(const char*);
  978.  
  979. int       atexit(auto void (*p) (void));
  980. int       bsearch (const void *, const void *, int  , 
  981.                    int  , auto int (*ptf)(const void*, const void*));
  982. void*     calloc(int  , int  );
  983. void      cfree(void*);
  984.  
  985.  
  986. void volatile exit(int);
  987.  
  988.  
  989.  
  990.  
  991. char*     fcvt(double, int, int*, int*);
  992. void      free(void*);
  993. char*     getenv(const char*);
  994. int       getopt(int, char * const *, const char*);
  995. int       getpw(int, char*);
  996. char*     gcvt(double, int, char*);
  997. char*     ecvt(double, int, int*, int*);
  998. extern char**   environ;
  999.  
  1000. long      labs(long);
  1001. void*     malloc(int  );
  1002. int      malloc_usable_size(void*);
  1003. int       putenv(const char*);
  1004. extern char*    optarg;
  1005. extern int      opterr;
  1006. extern int      optind;
  1007. void      qsort(void*, int  , int  , auto int (*ptf)(void*,void*));
  1008. int       rand(void);
  1009. void*     realloc(void*, int  );
  1010. int       setkey(const char*);
  1011. int       srand(unsigned int);
  1012. double    strtod(const char*, char**);
  1013. long      strtol(const char*, char**, int);
  1014. unsigned long stroul(const char**, int);
  1015. int       system(const char*);
  1016.  
  1017. long      random(void);
  1018. void      srandom(int);
  1019. char*     setstate(char*);
  1020. char*     initstate(unsigned, char*, int);
  1021.  
  1022. double    drand48(void);
  1023. void      lcong48(short*);
  1024. long      jrand48(short*);
  1025. long      lrand48(void);
  1026. long      mrand48(void);
  1027. long      nrand48(short*);
  1028. short*    seed48(short*);
  1029. void      srand48(long);
  1030.  
  1031. char*     ctermid(char*);
  1032. char*     cuserid(char*);
  1033. char*     tempnam(const char*, const char*);
  1034. char*     tmpnam(char*);
  1035.  
  1036. }
  1037.  
  1038. # 25 "/sym/gnu/lib/g++-include/std.h" 2 3
  1039.  
  1040. # 1 "/sym/gnu/lib/g++-include/string.h" 1 3
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055. extern "C" {
  1056.  
  1057. char*     strcat(char*, const char*);
  1058. char*     strchr(const char*, int);
  1059. int       strcmp(const char*, const char*);
  1060. int       strcoll(const char*, const char*);
  1061. char*     strcpy(char*, const char*);
  1062. int      strcspn(const char*, const char*);
  1063. char*     strdup(const char*);
  1064.  
  1065.  
  1066.  
  1067.  
  1068. int      strlen(const char*);
  1069. char*     strncat(char*, const char*, int  );
  1070. int       strncmp(const char*, const char*, int  );
  1071. char*     strncpy(char*, const char*, int  );
  1072. char*     strpbrk(const char*, const char*);
  1073. char*     strrchr(const char*, int);
  1074. int      strspn(const char*, const char*);
  1075. char*     strstr(const char*, const char *);
  1076. char*     strtok(char*, const char*);
  1077. int      strxfrm(char*, const char*, int  );
  1078.  
  1079. char*     index(const char*, int);
  1080. char*     rindex(const char*, int);
  1081. }
  1082.  
  1083. # 1 "/sym/gnu/lib/g++-include/memory.h" 1 3
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091. extern "C" {
  1092.  
  1093. void*     memalign (...) ;
  1094. void*     memccpy (...) ;
  1095. void*     memchr (...) ;
  1096. int       memcmp (...) ;
  1097. void*     memcpy (...) ;
  1098. void*     memmove (...) ;
  1099. void*     memset (...) ;
  1100. int       ffs (...) ;
  1101. int     getpagesize (...) ;
  1102. void*     valloc (...) ;
  1103.  
  1104. void      bcopy (...) ;
  1105. int       bcmp (...) ;
  1106. void      bzero (...) ;
  1107. }
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. # 43 "/sym/gnu/lib/g++-include/string.h" 2 3
  1123.  
  1124.  
  1125.  
  1126. # 26 "/sym/gnu/lib/g++-include/std.h" 2 3
  1127.  
  1128.  
  1129. # 1 "/sym/gnu/lib/g++-include/unistd.h" 1 3
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135. extern "C" {
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/unistd.h" 1 3
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227. # 1 "/sym/gnu/lib/g++-include/sys/types.h" 1 3
  1228.  
  1229.  
  1230. extern "C"
  1231. {
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/types.h" 1 3
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. # 1 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/stdtypes.h" 1 3
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272. typedef    int        sigset_t;     
  1273.  
  1274. typedef    unsigned int    speed_t;     
  1275. typedef    unsigned long    tcflag_t;     
  1276. typedef    unsigned char    cc_t;         
  1277. typedef    int        pid_t;         
  1278.  
  1279. typedef    unsigned short    mode_t;         
  1280. typedef    short        nlink_t;     
  1281.  
  1282. typedef    long        clock_t;     
  1283. typedef    long        time_t;         
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300. # 16 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/types.h" 2 3
  1301.  
  1302.  
  1303.  
  1304. # 1 "/usr/include/sys/sysmacros.h" 1 3
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. # 19 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/types.h" 2 3
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330. typedef    unsigned char    u_char;
  1331. typedef    unsigned short    u_short;
  1332. typedef    unsigned int    u_int;
  1333. typedef    unsigned long    u_long;
  1334. typedef    unsigned short    ushort;         
  1335. typedef    unsigned int    uint;         
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351. typedef    struct  _physadr_t { int r[1]; } *physadr_t;
  1352. typedef    struct label_t {
  1353.     int    val[2];
  1354. } label_t;
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362. typedef    struct    _quad_t { long val[2]; } quad_t;
  1363. typedef    long    daddr_t;
  1364. typedef    char *    caddr_t;
  1365. typedef    unsigned long    ino_t;
  1366. typedef    short    dev_t;
  1367. typedef    long    off_t;
  1368. typedef    unsigned short    uid_t;
  1369. typedef    unsigned short    gid_t;
  1370. typedef    long    key_t;
  1371. typedef    char *    addr_t;
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386. typedef    long    fd_mask;
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396. typedef    struct fd_set {
  1397.     fd_mask    fds_bits[(((256 )+(( (sizeof (fd_mask) * 8        )    )-1))/( (sizeof (fd_mask) * 8        )    )) ];
  1398. } fd_set;
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406. # 113 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/sys/types.h" 3
  1407.  
  1408.  
  1409.  
  1410. # 15 "/sym/gnu/lib/g++-include/sys/types.h" 2 3
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417. }
  1418.  
  1419.  
  1420.  
  1421.  
  1422. # 73 "/sym/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include/unistd.h" 2 3
  1423.  
  1424.  
  1425. extern void    _exit( );
  1426. extern int    access( );
  1427. extern unsigned    alarm( );
  1428. extern int    chdir( );
  1429. extern int    __hide_chmod ( );
  1430. extern int    __hide_chown ( );
  1431. extern int    close( );
  1432. extern char    *ctermid( );
  1433. extern char    *cuserid( );
  1434. extern int    dup( );
  1435. extern int    dup2( );
  1436. extern int    __hide_execl ( );
  1437. extern int    __hide_execle ( );
  1438. extern int    __hide_execlp ( );
  1439. extern int    execv( );
  1440. extern int    execve( );
  1441. extern int    execvp( );
  1442. extern pid_t    fork( );
  1443. extern long    fpathconf( );
  1444. extern char    *getcwd( );
  1445. extern gid_t    getegid( );
  1446. extern uid_t    geteuid( );
  1447. extern gid_t    getgid( );
  1448. extern int    getgroups( );
  1449. extern char    *getlogin( );
  1450. extern pid_t    getpgrp( );
  1451. extern pid_t    getpid( );
  1452. extern pid_t    getppid( );
  1453. extern uid_t    getuid( );
  1454. extern int    isatty( );
  1455. extern int    link( );
  1456. extern off_t    lseek( );
  1457. extern long    pathconf( );
  1458. extern int    pause( );
  1459. extern int    pipe( );
  1460. extern int    read( );
  1461. extern int    rmdir( );
  1462. extern int    __hide_setgid ( );
  1463. extern int    setpgid( );
  1464. extern pid_t    setsid( );
  1465. extern int    __hide_setuid ( );
  1466. extern unsigned    sleep( );
  1467. extern long    sysconf( );
  1468. extern pid_t    tcgetpgrp( );
  1469. extern int    tcsetpgrp( );
  1470. extern char    *ttyname( );
  1471. extern int    unlink( );
  1472. extern int    write( );
  1473.  
  1474.  
  1475.  
  1476. # 25 "/sym/gnu/lib/g++-include/unistd.h" 2 3
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492. # 59 "/sym/gnu/lib/g++-include/unistd.h" 3
  1493.  
  1494.  
  1495.  
  1496. extern void volatile _exit(int);
  1497.  
  1498.  
  1499.  
  1500.  
  1501. extern unsigned alarm (...) ;
  1502. extern int      brk (...) ;
  1503. extern int      chdir (...) ;
  1504. extern int      chmod  (...) ;
  1505. extern int      chown (const char*, unsigned short , unsigned short );
  1506. extern int      close (...) ;
  1507. extern char*    crypt (...) ;
  1508. extern int      dup (...) ;
  1509. extern int      dup2 (...) ;
  1510. extern void    encrypt (...) ;
  1511. extern int      execl (const char*, const char *, ...);
  1512. extern int      execle (const char*, const char *, ...);
  1513. extern int      execlp (const char*, const char*, ...);
  1514. extern int      exect (...) ;
  1515. extern int      execv (...) ;
  1516. extern int      execve (...) ;
  1517. extern int      execvp (...) ;
  1518. extern int      fchown (int, unsigned short , unsigned short );
  1519. extern int  fork (...) ;
  1520. extern int      fsync (...) ;
  1521. extern int      ftruncate (...) ;
  1522. extern char*    getcwd (...) ;
  1523. extern int      getdomainname (...) ;
  1524. extern int      getdtablesize (...) ;
  1525. extern int      getgroups (...) ;
  1526. extern unsigned short  geteuid (...) ;
  1527. extern unsigned short  getegid (...) ;
  1528. extern unsigned short  getgid (...) ;
  1529. extern long     gethostid (...) ;
  1530. extern int      gethostname (...) ;
  1531. extern int  getpgrp (...) ;
  1532. extern int  getpid (...) ;
  1533. extern int  getppid (...) ;
  1534. extern char*    getlogin (...) ;
  1535. extern char*    getpass (...) ;
  1536. extern unsigned short  getuid (...) ;
  1537. extern int      ioctl (int, int, ... );
  1538. extern int      isatty (...) ;
  1539. extern int      link (...) ;
  1540. extern int      mkstemp (...) ;
  1541. extern char*    mktemp (...) ;
  1542. extern int      nice (...) ;
  1543. extern int      pause (...) ;
  1544. extern int      pipe (...) ;
  1545. extern int      readlink (...) ;
  1546. extern int      rename (...) ;
  1547. extern int      rmdir (...) ; 
  1548. extern void*    sbrk (...) ; 
  1549. extern int      syscall (...) ;
  1550. extern int      setgid (unsigned short );
  1551. extern int      sethostname (...) ;
  1552.  
  1553.  
  1554.  
  1555.  
  1556. extern int  setpgrp (...) ;
  1557.  
  1558. extern int      setregid (...) ;
  1559. extern int      setreuid (...) ;
  1560. extern int      setuid (unsigned short );
  1561. extern unsigned sleep (...) ;
  1562. extern void     swab (...) ;
  1563. extern int      symlink (...) ;
  1564. extern long     sysconf (...) ;
  1565. extern int      truncate (...) ;
  1566. extern char*    ttyname (...) ;
  1567. extern int      ttyslot (...) ;
  1568.  
  1569. extern int      unlink (...) ;
  1570. extern int  vfork (...) ;
  1571. extern int      vadvise (...) ;
  1572. extern int      vhangup (...) ;
  1573. extern long  lseek (...) ;
  1574. extern int  read (...) ;
  1575. extern int  write (...) ;
  1576. extern int      access (...) ;
  1577.  
  1578. extern int      flock (...) ;
  1579.  
  1580.  
  1581. }
  1582.  
  1583.  
  1584. # 28 "/sym/gnu/lib/g++-include/std.h" 2 3
  1585.  
  1586. # 1 "/sym/gnu/lib/g++-include/stdio.h" 1 3
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605. # 174 "/sym/gnu/lib/g++-include/stdio.h" 3
  1606.  
  1607. # 29 "/sym/gnu/lib/g++-include/std.h" 2 3
  1608.  
  1609. # 1 "/sym/gnu/lib/g++-include/errno.h" 1 3
  1610.  
  1611.  
  1612. extern "C" {
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618. # 1 "/usr/include/errno.h" 1 3
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628. # 1 "/usr/include/sys/errno.h" 1 3
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.      
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.      
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.      
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762. # 10 "/usr/include/errno.h" 2 3
  1763.  
  1764. extern int errno;
  1765.  
  1766.  
  1767. # 9 "/sym/gnu/lib/g++-include/errno.h" 2 3
  1768.  
  1769.  
  1770.  
  1771.  
  1772. extern char*    sys_errlist[];
  1773. extern int      sys_nerr;
  1774.  
  1775. extern int      errno;
  1776.  
  1777. void      perror(const char*);
  1778. char*     strerr(int);
  1779.  
  1780.  
  1781. }
  1782.  
  1783.  
  1784. # 30 "/sym/gnu/lib/g++-include/std.h" 2 3
  1785.  
  1786. # 1 "/sym/gnu/lib/g++-include/fcntl.h" 1 3
  1787.  
  1788.  
  1789. extern "C" {
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800. # 1 "/usr/include/fcntl.h" 1 3
  1801.  
  1802.  
  1803.  
  1804.  
  1805.  
  1806. # 1 "/usr/include/sys/fcntlcom.h" 1 3
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931. struct flock {
  1932.     short    l_type;         
  1933.     short    l_whence;     
  1934.     long    l_start;     
  1935.     long    l_len;         
  1936.     short    l_pid;         
  1937.     short    l_xxx;         
  1938. };
  1939.  
  1940.  
  1941.  
  1942. struct eflock {
  1943.     short    l_type;         
  1944.     short    l_whence;     
  1945.     long    l_start;     
  1946.     long    l_len;         
  1947.     short    l_pid;         
  1948.     short    l_xxx;         
  1949.     long    l_rpid;         
  1950.     long    l_rsys;         
  1951. };
  1952.  
  1953.  
  1954.  
  1955. # 1 "/sym/gnu/lib/g++-include/sys/stat.h" 1 3
  1956.  
  1957.  
  1958. extern "C"
  1959. {
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969. # 1 "/usr/include/sys/stat.h" 1 3
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981. struct    stat {
  1982.     dev_t    st_dev;
  1983.     ino_t    st_ino;
  1984.     mode_t    st_mode;
  1985.     short    st_nlink;
  1986.     uid_t    st_uid;
  1987.     gid_t    st_gid;
  1988.     dev_t    st_rdev;
  1989.     off_t    st_size;
  1990.     time_t    st_atime;
  1991.     int    st_spare1;
  1992.     time_t    st_mtime;
  1993.     int    st_spare2;
  1994.     time_t    st_ctime;
  1995.     int    st_spare3;
  1996.     long    st_blksize;
  1997.     long    st_blocks;
  1998.     long    st_spare4[2];
  1999. };
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054. int    __hide_chmod ( );
  2055. int    fstat( );
  2056. int    mkdir( );
  2057. int    mkfifo( );
  2058. int    stat( );
  2059. mode_t    umask( );
  2060.  
  2061.  
  2062.  
  2063. # 14 "/sym/gnu/lib/g++-include/sys/stat.h" 2 3
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070. extern int       chmod  (...) ;
  2071. extern int       stat (...) ;
  2072. extern int       lstat (...) ;
  2073. extern int       fstat (...) ;
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092. }
  2093.  
  2094.  
  2095. # 149 "/usr/include/sys/fcntlcom.h" 2 3
  2096.  
  2097.  
  2098. int     __hide_open ( );
  2099. int    __hide_creat ( );
  2100. int    __hide_fcntl ( );
  2101.  
  2102.  
  2103. # 6 "/usr/include/fcntl.h" 2 3
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109. # 14 "/sym/gnu/lib/g++-include/fcntl.h" 2 3
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118. int       fcntl(int, int, ...);
  2119. int      creat (...) ;
  2120.  
  2121. int       open (...) ;
  2122.  
  2123.  
  2124. }
  2125.  
  2126. # 31 "/sym/gnu/lib/g++-include/std.h" 2 3
  2127.  
  2128.  
  2129. extern "C" {
  2130. int strcasecmp (...) ;
  2131. }
  2132.  
  2133.  
  2134. # 18 "Vision.h" 2
  2135.  
  2136. # 1 "/sym/gnu/lib/g++-include/math.h" 1 3
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158. #pragma interface
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170. # 64 "/sym/gnu/lib/g++-include/math.h" 3
  2171.  
  2172. extern "C" {
  2173.  
  2174. double  acos(double);
  2175. double  acosh(double);
  2176. double  asin(double);
  2177. double  asinh(double);
  2178. double  atan(double);
  2179. double  atan2(double, double);
  2180. double  atanh(double);
  2181. double  cbrt(double);
  2182. double  ceil(double);
  2183. double  copysign(double,double);
  2184. double  cos(double);
  2185. double  cosh(double);
  2186. double  drem(double,double);
  2187. double  erf(double);
  2188. double  erfc(double);
  2189. double  exp(double);
  2190. double  expm1(double);
  2191. double  fabs(double);
  2192. double  finite(double);
  2193. double  floor(double);
  2194. double    fmod(double, double);
  2195. double  frexp(double, int*);
  2196. double  gamma(double);
  2197. double  hypot(double,double);
  2198. double  infnan(int);
  2199.  
  2200.  
  2201. int     isinf(double);
  2202. int     isnan(double);
  2203.  
  2204. double  j0(double);
  2205. double  j1(double);
  2206. double  jn(int, double);
  2207. double  ldexp(double, int);
  2208. double  lgamma(double);
  2209. double  log(double);
  2210. double  log10(double);
  2211. double  log1p(double);
  2212. double  logb(double);
  2213. double  modf(double, double*);
  2214. double  pow(double, double);
  2215. double  rint(double);
  2216. double  scalb(double, int);
  2217. double  sin(double);
  2218. double  sinh(double);
  2219. double  sqrt(double);
  2220. double  tan(double);
  2221. double  tanh(double);
  2222. double  y0(double);
  2223. double  y1(double);
  2224. double  yn(int, double);
  2225.  
  2226. double aint(double);
  2227. double anint(double);
  2228. int irint(double);
  2229. int nint(double);
  2230. }
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239. struct libm_exception
  2240. {
  2241.   int type;
  2242.   char* name;
  2243.   double arg1, arg2, retval;
  2244. };
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253. extern "C" int matherr(libm_exception*);
  2254.  
  2255.  
  2256.  
  2257. # 1 "/sym/gnu/lib/g++-include/values.h" 1 3
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303. # 57 "/sym/gnu/lib/g++-include/values.h" 3
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319. # 166 "/sym/gnu/lib/g++-include/values.h" 3
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329. # 150 "/sym/gnu/lib/g++-include/math.h" 2 3
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396. # 19 "Vision.h" 2
  2397.  
  2398.  
  2399. # 1 "MiscUtilities.h" 1
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405. # 1 "/sym/gnu/lib/g++-include/std.h" 1 3
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425. # 37 "/sym/gnu/lib/g++-include/std.h" 3
  2426.  
  2427. # 6 "MiscUtilities.h" 2
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437. inline int used_mem() {
  2438.     struct mallinfo mi = mallinfo();
  2439.     return mi.usmblks+mi.uordblks;
  2440. }
  2441. inline volatile void abort() {
  2442.     fprintf((&_iob[2]) ,"abort\n");
  2443.     exit(1);
  2444. }
  2445.  
  2446. inline volatile void error(char *s) {
  2447.     fprintf((&_iob[2]) ,"FATAL ERROR: ");
  2448.     fprintf((&_iob[2]) ,"%s\n",s);
  2449.     exit(1);
  2450. }
  2451. template <class Y>
  2452. struct NameValuePair {
  2453.     char *name;
  2454.     Y y;
  2455. };
  2456.  
  2457. template <class Y>
  2458. Y lookup(NameValuePair<Y> *data,char *name) {
  2459.     while(data->name) {
  2460.         if(!strcmp(data->name,name)) return data->y;
  2461.         data++;
  2462.     }
  2463.     abort();
  2464.     return data->y;         
  2465. }
  2466.  
  2467. template <class T>
  2468. void swap(T &x,T &y) {
  2469.     T temp = x;
  2470.     x = y;
  2471.     y = temp;
  2472. }
  2473.  
  2474.  
  2475. # 21 "Vision.h" 2
  2476.  
  2477. # 1 "Counted.h" 1
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483. # 1 "/sym/gnu/lib/g++-include/std.h" 1 3
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503. # 37 "/sym/gnu/lib/g++-include/std.h" 3
  2504.  
  2505. # 6 "Counted.h" 2
  2506.  
  2507.  
  2508. template <class T>
  2509. struct Counted {
  2510.  private:
  2511.     int *count;
  2512.     T *object;
  2513.     T *operator&() {
  2514.         return object;
  2515.     }
  2516.     void dec_count() {
  2517.         if(!count) return;
  2518.         (*count)--;
  2519.         if(*count<=0) {
  2520.             delete count;
  2521.             delete object;
  2522.             count=0;
  2523.             object=0;
  2524.         }
  2525.     }
  2526.     void inc_count() {
  2527.         if(!count) return;
  2528.         (*count)++;
  2529.     }
  2530.  public:
  2531.     Counted() {
  2532.         count=0;
  2533.         object=0;
  2534.     }
  2535.     Counted(T *object):object(object) {
  2536.         count = new int(1);
  2537.     }
  2538.     ~Counted() {
  2539.         dec_count();
  2540.     }
  2541.     Counted(Counted &other) {
  2542.         count=other.count;
  2543.         object=other.object;
  2544.         inc_count();
  2545.     }
  2546.     Counted &operator=(Counted &other) {
  2547.         other.inc_count();
  2548.         dec_count();
  2549.         count=other.count;
  2550.         object=other.object;
  2551.         return *this;
  2552.     }
  2553.  
  2554.     T &operator*() {if(!object) abort(); else return *object; return *object;}
  2555.     T *operator->() {if(!object) abort(); else return object; return object;}
  2556.     operator T&() {if(!object) abort(); else return *object; return *object;}
  2557.  
  2558.      
  2559. };
  2560.  
  2561.  
  2562. # 22 "Vision.h" 2
  2563.  
  2564. # 1 "Art.h" 1
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571. extern "C" { void abort(); }
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584. template <class X>
  2585. inline void art_initialize(X *,int) {}
  2586.  
  2587. # 39 "Art.h"
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594. template <class T>
  2595. class Art {
  2596. protected:
  2597.     int mark_temp;
  2598.     T *data;
  2599.     int dims[1];
  2600.     void constructor(int d) {
  2601.         if(d<0) abort() ;
  2602.         mark_temp=0;
  2603.         dims[0]=d;
  2604.         if(d>0) {
  2605.             data=new T[d];
  2606.             if(!data) abort() ;
  2607.         } else data=0;
  2608.         art_initialize(data,d);
  2609.     }
  2610.     void destructor() {
  2611.         if(!data) return;
  2612.         delete [] data;
  2613.         mark_temp=0;
  2614.         data=0;
  2615.         dims[0]=0;
  2616.      }
  2617.     void copy(Art &other) {
  2618.         int d0=dims[0]<?other.dims[0];
  2619.         for(int i=0;i<d0;i++) data[i]=other.data[i];
  2620.     }
  2621. public:
  2622.     void copyclear(Art &other) {
  2623.         dims[0]=other.dims[0];
  2624.         data=other.data;
  2625.         other.dims[0]=0;
  2626.         other.data=0;
  2627.     }
  2628. private:
  2629.     void copyconstructor(Art &other) {
  2630.         mark_temp=0;
  2631.         if(other.mark_temp) {
  2632.             copyclear(other);
  2633.         } else {
  2634.             constructor(other.dims[0]);
  2635.             copy(other);
  2636.         }
  2637.     }
  2638.  public:
  2639.     Art() {constructor(0);}
  2640.     Art(int d) {constructor(d);}
  2641.     Art(Art &other) {copyconstructor(other);}
  2642.     ~Art() {destructor();}
  2643.      
  2644.     Art &operator=(Art &other) {
  2645.         destructor();
  2646.         copyconstructor(other);
  2647.         return *this;
  2648.     }
  2649.     int dim(int i) {return dims[i];}
  2650.     T &operator()(int i) {
  2651.         if(unsigned(i)>=unsigned(dims[0])) abort()  ;
  2652.         return data[i];
  2653.     }
  2654.     T &sub(int i) {return data[i];}
  2655.     void resize(int nd) {
  2656.         if(nd<0) abort() ;
  2657.         Art t(nd);
  2658.         int limit=nd<?dims[0];
  2659.         for(int i=0;i<limit;i++) t.data[i]=data[i];
  2660.         t.mark_temp=1;
  2661.         *this=t;
  2662.     }
  2663.     Art &temp() { mark_temp=1; return *this; }
  2664.     T *pointer() {return data;}
  2665.     void fill(T value) {for(int i=0;i<dims[0];i++) data[i]=value;}
  2666.  
  2667.     int length() {return dims[0];}
  2668.     T &operator[](int i) {return operator()(i);}
  2669. };
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678. template <class T>
  2679. class Stk {
  2680. protected:
  2681.     Art<T> stack;
  2682.     int fill;
  2683. public:
  2684.     Stk() {stack.resize(4); fill=0;}
  2685.     Stk(Stk &other) {
  2686.         stack=other.stack;
  2687.         fill=other.fill;
  2688.     }
  2689.     int dim(int i) {return stack.dim(i);}
  2690.     void push(T &element) {
  2691.         if(fill>=stack.dim(0)) stack.resize(2*fill);
  2692.         stack.sub(fill++)=element;
  2693.     }
  2694.     T &tos() {
  2695.         return stack(fill-1);
  2696.     }
  2697.     T &pop() {
  2698.         return stack(--fill);
  2699.     }
  2700.     T &operator()(int i) {return stack(i);}
  2701.     T &sub(int i) {return stack.sub(i);}
  2702.     void clear() {
  2703.         stack.resize(0);
  2704.         stack.resize(4);
  2705.         fill=0;
  2706.     }
  2707.     void compact() {
  2708.         stack.resize(fill+1);
  2709.     }
  2710.     Stk temp() { stack.temp(); return *this; }
  2711.     T *pointer() {return stack.pointer();}
  2712.     operator Art<T>&() {return stack;}
  2713.  
  2714.     int length() {return fill;}
  2715.     T &operator[](int i) {return operator()(i);}
  2716. };
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722. template <class T>
  2723. class Art2 {
  2724. protected:
  2725.     int mark_temp;
  2726.     T **data;
  2727.     int dims[2];
  2728.     int total_length;
  2729.     void constructor(int d0,int d1) {
  2730.         if(d0<0||d1<0) abort() ;
  2731.         mark_temp=0;
  2732.         dims[0]=d0;
  2733.         dims[1]=d1;
  2734.         total_length=dims[0]*dims[1];
  2735.         if(d0>0) {
  2736.             data=new T*[d0];
  2737.             if(!data) abort() ;
  2738.         } else data=0;
  2739.         if(d0>0&&d1>0) {
  2740.             T *p=new T[d0*d1];
  2741.             if(!p) abort() ;
  2742.             for(int i=0;i<d0;i++) data[i]=p+i*d1;
  2743.             art_initialize(data[0],d0*d1);
  2744.         }
  2745.     }
  2746.     void destructor() {
  2747.         if(dims[0]<1) return;
  2748.         if(!data) return;
  2749.         delete [] data[0];
  2750.         delete [] data;
  2751.         mark_temp=0;
  2752.         data=0;
  2753.         dims[0]=0;
  2754.         dims[1]=0;
  2755.     }
  2756.     void copy(Art2 &other) {
  2757.         int d0=dims[0]<?other.dims[0];
  2758.         int d1=dims[1]<?other.dims[1];
  2759.         for(int i=0;i<d0;i++) for(int j=0;j<d1;j++)
  2760.             data[i][j]=other.data[i][j];
  2761.     }
  2762. public:
  2763.     void copyclear(Art2 &other) {
  2764.         dims[0]=other.dims[0];
  2765.         dims[1]=other.dims[1];
  2766.         total_length=dims[0]*dims[1];
  2767.         data=other.data;
  2768.         other.dims[0]=0;
  2769.         other.dims[1]=0;
  2770.         other.total_length=0;
  2771.         other.data=0;
  2772.     }
  2773. private:
  2774.     void copyconstructor(Art2 &other) {
  2775.         mark_temp=0;
  2776.         if(other.mark_temp) {
  2777.             copyclear(other);
  2778.         } else {
  2779.             constructor(other.dims[0],other.dims[1]);
  2780.             copy(other);
  2781.         }
  2782.     }
  2783.  public:
  2784.     Art2() {constructor(0,0);}
  2785.     Art2(int d0,int d1) {constructor(d0,d1);}
  2786.     Art2(Art2 &other) {copyconstructor(other);}
  2787.     ~Art2() {destructor();}
  2788.      
  2789.     Art2 &operator=(Art2 &other) {
  2790.         destructor();
  2791.         copyconstructor(other);
  2792.         return *this;
  2793.     }
  2794.     int dim(int i) {return dims[i];}
  2795.     T &operator()(int i,int j) {
  2796.         if(unsigned(i)>=unsigned(dims[0])||unsigned(j)>=unsigned(dims[1]))
  2797.             abort() ; 
  2798.         return data[i][j];
  2799.     }
  2800.     T &sub(int i,int j) {return data[i][j];}
  2801.     void resize(int nd0,int nd1) {
  2802.         if(nd0<0||nd1<0) abort() ;
  2803.         Art2 t(nd0,nd1);
  2804.         int limit0=nd0<?dims[0];
  2805.         int limit1=nd1<?dims[1];
  2806.         for(int i=0;i<limit0;i++) for(int j=0;j<limit1;j++) t.data[i][j]=data[i][j];
  2807.         t.mark_temp=1;
  2808.         *this=t;
  2809.     }
  2810.     Art2 &temp() { mark_temp=1; return *this; }
  2811.     T **pointer() {return data;}
  2812.     void fill(T value) {
  2813.         for(int i=0;i<dims[0];i++) for(int j=0;j<dims[1];j++)
  2814.             data[i][j]=value;
  2815.     }
  2816.  
  2817.      
  2818.  
  2819.     int length() {return total_length;}
  2820.     T &sub(int i) {return data[0][i];}
  2821.     T &operator()(int i) {
  2822.         if(unsigned(i)>=total_length) abort() ; 
  2823.         return data[0][i];
  2824.     }
  2825. };
  2826.  
  2827. template <class T>
  2828. inline void art_swap(T &x,T &y) {
  2829.     T temp = x;
  2830.     x = y;
  2831.     y = temp;
  2832. }
  2833.  
  2834. template <class T>
  2835. inline void reverse(Art<T> &a) {
  2836.     int i;
  2837.     for(i=a.length()/2;i>=0;i--) art_swap(a.sub(i),a.sub(a.length()-i-1));
  2838. }
  2839.  
  2840. template <class T>
  2841. inline void reverse(Stk<T> &a) {
  2842.     reverse(a.stack);
  2843. }
  2844.  
  2845. template <class T>
  2846. inline void bag_remove(Stk<T> &a,T &element) {
  2847.     for(int i=0;i<a.length()-1;i++) {
  2848.         if(a(i)==element) {
  2849.             a.sub(i)=a.tos();
  2850.             a.pop();
  2851.         }
  2852.     }
  2853.     if(i<a.length()&&a.sub(i)==element) a.pop();
  2854. }
  2855.  
  2856. template <class T>
  2857. inline void ordered_remove(Stk<T> &a,T &element) {
  2858.     int source=0,dest=0;
  2859.     while(source<a.length()) {
  2860.         if(a(source)!=element) {
  2861.             a(dest)=a(source);
  2862.             dest++;
  2863.         }
  2864.         source++;
  2865.     }
  2866.     a.stack.resize(dest);
  2867. }
  2868.  
  2869. template <class T>
  2870. inline Art<T> concatenate(Art<T> &a,Art<T> &b) {
  2871.     int i,k;
  2872.     k=a.length();
  2873.     Art<T> result(k+b.length());
  2874.     for(i=0;i<a.length();i++) result.sub(i)=a.sub(i);
  2875.     for(i=0;i<b.length();i++) result.sub(i+k)=b.sub(i);
  2876.     return result.temp();
  2877. }
  2878.  
  2879. template <class T>
  2880. inline Stk<T> concatenate(Stk<T> &a,Stk<T> &b) {
  2881.     int i;
  2882.     Stk<T> result;
  2883.     for(i=0;i<a.length();i++) result.push(a.sub(i));
  2884.     for(i=0;i<b.length();i++) result.push(b.sub(i));
  2885.     return result.temp();
  2886. }
  2887.  
  2888.  
  2889. # 23 "Vision.h" 2
  2890.  
  2891. # 1 "Geo.h" 1
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897. # 1 "/sym/gnu/lib/g++-include/math.h" 1 3
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917. # 215 "/sym/gnu/lib/g++-include/math.h" 3
  2918.  
  2919. # 6 "Geo.h" 2
  2920.  
  2921.  
  2922. extern "C" {
  2923. void abort();
  2924. }
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939. template <class T,int n>
  2940. class vec {
  2941. protected:
  2942.     T v[n];
  2943. public:
  2944.     int length() {return n;}
  2945.     int dim(int) {return n;}
  2946.     vec() {}
  2947.     vec(T v0) { v[0]=v0; }
  2948.     vec(T v0,T v1) { v[0]=v0; v[1]=v1; }
  2949.     vec(T v0,T v1,T v2) { v[0]=v0; v[1]=v1; v[2]=v2; }
  2950.     vec(T v0,T v1,T v2,T v3) { v[0]=v0; v[1]=v1; v[2]=v2; v[3]=v3; }
  2951.     vec(T v0,T v1,T v2,T v3,T v4) { v[0]=v0; v[1]=v1; v[2]=v2; v[3]=v3; v[4]=v4; }
  2952.     
  2953.     T &operator[](int i) {return v[i];}
  2954.     T &sub(int i) {return v[i];}
  2955.     T &operator()(int i) {
  2956.         if(unsigned(i)>=n) abort(); 
  2957.         return v[i];
  2958.     }
  2959.  
  2960.      
  2961.      
  2962.      
  2963.      
  2964.      
  2965.      
  2966.      
  2967.      
  2968.      
  2969.  
  2970.      
  2971.     T operator*(vec &other) {
  2972.         T result=0;
  2973.         for(int i=0;i<n;i++) result=result+sub(i)*other.sub(i);
  2974.         return result;
  2975.     }
  2976.  
  2977.      
  2978.     vec operator-() {
  2979.         vec result;
  2980.         for(int i=0;i<n;i++) result.sub(i)= -sub(i);
  2981.         return result;
  2982.     }
  2983.     vec operator*(T other) {
  2984.         vec result;
  2985.         for(int i=0;i<n;i++) result.sub(i)=sub(i)*other;
  2986.         return result;
  2987.     }
  2988.     vec operator/(T other) {
  2989.         vec result;
  2990.         for(int i=0;i<n;i++) result.sub(i)=sub(i)/other;
  2991.         return result;
  2992.     }
  2993.     vec operator+(vec &other) {
  2994.         vec result;
  2995.         for(int i=0;i<n;i++) result.sub(i)=sub(i)+other.sub(i);
  2996.         return result;
  2997.     }
  2998.     vec operator-(vec &other) {
  2999.         vec result;
  3000.         for(int i=0;i<n;i++) result.sub(i)=sub(i)-other.sub(i);
  3001.         return result;
  3002.     }
  3003.     vec operator<?(vec &other) {
  3004.         vec result;
  3005.         for(int i=0;i<n;i++) result.sub(i)=sub(i)<?other.sub(i);
  3006.         return result;
  3007.     }
  3008.     vec operator>?(vec &other) {
  3009.         vec result;
  3010.         for(int i=0;i<n;i++) result.sub(i)=sub(i)>?other.sub(i);
  3011.         return result;
  3012.     }
  3013.  
  3014.      
  3015.     int operator==(vec &other) {
  3016.         for(int i=0;i<n;i++) if(sub(i)!=other.sub(i)) return 0;
  3017.         return 1;
  3018.     }
  3019.     int operator!=(vec &other) {
  3020.         for(int i=0;i<n;i++) if(sub(i)!=other.sub(i)) return 1;
  3021.         return 0;
  3022.     }
  3023.     int operator<(vec &other) {
  3024.         for(int i=0;i<n;i++) if(sub(i)>=other.sub(i)) return 0;
  3025.         return 1;
  3026.     }
  3027.     int operator>(vec &other) {
  3028.         for(int i=0;i<n;i++) if(sub(i)<=other.sub(i)) return 0;
  3029.         return 1;
  3030.     }
  3031.     int operator<=(vec &other) {
  3032.         for(int i=0;i<n;i++) if(sub(i)>other.sub(i)) return 0;
  3033.         return 1;
  3034.     }
  3035.     int operator>=(vec &other) {
  3036.         for(int i=0;i<n;i++) if(sub(i)<other.sub(i)) return 0;
  3037.         return 1;
  3038.     }
  3039. };
  3040.  
  3041. template <class T>
  3042. inline float euclidean_norm(T &v) {
  3043.     float total=0.0;
  3044.     for(int i=0;i<v.dim(0);i++) total+=v(i)*v(i);
  3045.     return sqrt(total);
  3046. }
  3047.  
  3048. template <class T>
  3049. inline float euclidean_distance(T &u,T &v) {
  3050.     float total=0.0;
  3051.     for(int i=0;i<u.dim(0);i++) {
  3052.         float d=u(i)-v(i);
  3053.         total+=d*d;
  3054.     }
  3055.     return sqrt(total);
  3056. }
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062. template <class T,int n>
  3063. class mat:vec<T,n*n> {
  3064. protected:
  3065. public:
  3066.     int dim(int) {return n;}
  3067.     T &operator[](int i) {return v[i];}
  3068.     T &sub(int i,int j) {return v[i*n+j];}
  3069.     T &operator()(int i,int j) {
  3070.         if(unsigned(i)>=n||unsigned(j)>=n) abort(); 
  3071.         return sub(i,j);
  3072.     }
  3073.     mat operator*(mat &other) {
  3074.         mat result;
  3075.         for(int i=0;i<n;i++) for(int j=0;j<n;j++) {
  3076.             T total=0;
  3077.             for(int k=0;k<n;k++) total=total+sub(i,k)*other.sub(k,j);
  3078.             result.sub(i,j)=total;
  3079.         }
  3080.         return result;
  3081.     }
  3082.     vec<T,n> operator*(vec<T,n> &other) {
  3083.         vec<T,n> result;
  3084.         for(int i=0;i<n;i++) {
  3085.             T total=0;
  3086.             for(int k=0;k<n;k++) total=total+sub(i,k)*other.sub(k);
  3087.             result.sub(i)=total;
  3088.         }
  3089.         return result;
  3090.     }
  3091. };
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097. typedef vec<float,2> vec2;
  3098. typedef vec<float,3> vec3;
  3099. typedef vec<float,4> vec4;
  3100.  
  3101. typedef mat<float,2> mat2;
  3102. typedef mat<float,3> mat3;
  3103. typedef mat<float,4> mat4;
  3104.  
  3105. typedef vec<int,2> ivec2;
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113. inline float norm_angle(float p) {
  3114.     while(p<0) p+=2*       3.14159265358979323846 ; while(p>=2*       3.14159265358979323846 ) p-=2*       3.14159265358979323846 ; return p;
  3115. }
  3116. inline float norm_angle0(float p) {
  3117.     while(p<-       3.14159265358979323846 ) p+=2*       3.14159265358979323846 ; while(p>=       3.14159265358979323846 ) p-=2*       3.14159265358979323846 ; return p;
  3118. }
  3119. inline float norm_orientation(float p) {
  3120.     while(p<0) p+=       3.14159265358979323846 ; while(p>=       3.14159265358979323846 ) p-=       3.14159265358979323846 ; return p;
  3121. }
  3122. inline float norm_orientation0(float p) {
  3123.     while(p<-       3.14159265358979323846 /2) p+=       3.14159265358979323846 ; while(p>=       3.14159265358979323846 /2) p-=       3.14159265358979323846 ; return p;
  3124. }
  3125. inline float orientation_difference(float p,float q) {
  3126.     fabs(norm_orientation0(p-q));
  3127. }
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.  
  3142. inline vec2 cmul(vec2 &p,vec2 &q) {
  3143.     return vec2(p.sub(0)*q.sub(0)-p.sub(1)*q.sub(1),
  3144.             p.sub(0)*q.sub(1)+p.sub(1)*q.sub(0));
  3145. }
  3146.  
  3147. inline vec2 cdiv(vec2 &p,vec2 &q) {
  3148.     float n=q*q;
  3149.     return vec2((p.sub(0)*q.sub(0)+p.sub(1)*q.sub(1))/n,
  3150.             (p.sub(1)*q.sub(0)-p.sub(0)*q.sub(1))/n);
  3151. }
  3152.  
  3153. inline vec2 csqrt(vec2 &x) {
  3154.     if (x.sub(0)==0.0&&x.sub(1)==0.0)
  3155.         return vec2(0.0,0.0);
  3156.     else {
  3157.         float a=sqrt((fabs(x.sub(0))+hypot(x.sub(0),x.sub(1)))*0.5);
  3158.         float b=0.5*(x.sub(1)/a);
  3159.         if(x.sub(0)>0.0) return vec2(a, b);
  3160.         else if(x.sub(1)>=0.0) return vec2(a,b);
  3161.         else return vec2(-a,-b);
  3162.     }
  3163. }
  3164. inline vec2 cpow(vec2& x, double p) {
  3165.     float h=hypot(x.sub(0),x.sub(1));
  3166.     if (h<=0.0) abort();
  3167.     float lr=pow(h,p);
  3168.     float a=atan2(x.sub(1),x.sub(0));
  3169.     float li=p*a;
  3170.     return vec2(lr*cos(li),lr*sin(li));
  3171. }
  3172.  
  3173.  
  3174.  
  3175. inline float cross(vec2 p,vec2 q) {
  3176.     return p.sub(0)*q.sub(1)-p.sub(1)*q.sub(0);
  3177. }
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183. struct TRS2 {
  3184.     vec2 t;
  3185.     vec2 r;
  3186.     TRS2(vec2 t=vec2(0.0,0.0),vec2 r=vec2(1.0,0.0)):t(t),r(r) {
  3187.     }
  3188.     vec2 operator()(vec2 &arg) {
  3189.         return cmul(r,arg)+t;
  3190.     }
  3191.     float rotation() {
  3192.         return atan2(r(1),r(0));
  3193.     }
  3194. };
  3195.  
  3196.  
  3197.  
  3198. # 24 "Vision.h" 2
  3199.  
  3200.  
  3201.  
  3202.  
  3203. # 1 "VisionTypes.h" 1
  3204.  
  3205.  
  3206.  
  3207.  
  3208. typedef Art2<float> FImage;
  3209. typedef Art2<int> IImage;
  3210. typedef Art2<unsigned char> CImage;
  3211.  
  3212. struct FImageOp {virtual FImage operator()(FImage &) = 0;};
  3213. struct FImageOp2 {virtual FImage operator()(FImage &,FImage &) = 0;};
  3214. struct CImageOp {virtual CImage operator()(CImage &) = 0;};
  3215. struct CImageOp2 {virtual CImage operator()(CImage &,CImage &) = 0;};
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221. struct PFeature {
  3222.     ivec2 p;
  3223.     float a;
  3224.     short group;
  3225.     short type;
  3226.     PFeature() {}
  3227.     PFeature(ivec2 p,float a,int group,int type):p(p),a(a),group(group),type(type) {}
  3228. };
  3229.  
  3230. typedef Stk<PFeature> PFeatureStk;
  3231.  
  3232. struct FIExtractor {virtual PFeatureStk operator()(FImage &) = 0;};
  3233. struct CIExtractor {virtual PFeatureStk operator()(CImage &) = 0;};
  3234. # 28 "Vision.h" 2
  3235.  
  3236. # 1 "ImageDatabase.h" 1
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242. # 1 "Art.h" 1
  3243.  
  3244.  
  3245. # 339 "Art.h"
  3246.  
  3247. # 6 "ImageDatabase.h" 2
  3248.  
  3249.  
  3250. typedef Art2<unsigned char> CImage;
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259. struct ImageDatabase {
  3260.      
  3261.      
  3262.      
  3263.  
  3264.     virtual int length() = 0;
  3265.     virtual int nclassifications() = 0;
  3266.     virtual int nusers() = 0;
  3267.     
  3268.      
  3269.      
  3270.  
  3271.     virtual int classification(int offset) = 0;
  3272.     virtual int user(int offset) = 0;
  3273.     
  3274.     virtual CImage cimage(int offset) {abort();}
  3275.     virtual PFeatureStk features(int offset) {abort();}
  3276.  
  3277.      
  3278.      
  3279.      
  3280.      
  3281.  
  3282.     virtual int user_offset(int user) = 0;
  3283.     virtual int user_length(int user) = 0;
  3284. };
  3285.  
  3286. ImageDatabase *make_NISTDigitImages();
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292. struct ImageDatabaseIterator {
  3293.     virtual int done() = 0;
  3294.     virtual void next() = 0;
  3295.     virtual operator int() = 0;
  3296.     virtual void mark_upto_here() {}
  3297. };
  3298.  
  3299. ImageDatabaseIterator *make_IDI_Sequential(ImageDatabase *digits,int current,int stride);
  3300. ImageDatabaseIterator *make_IDI_OnePerUser(ImageDatabase *digits,int current);
  3301. ImageDatabaseIterator *make_IDI_FromFile(char *name);
  3302.  
  3303.  
  3304. # 29 "Vision.h" 2
  3305.  
  3306.  
  3307.  
  3308. # 1 "NISTImages.cc" 2
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319. # 1 "/sym/gnu/lib/g++-include/std.h" 1 3
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339. # 37 "/sym/gnu/lib/g++-include/std.h" 3
  3340.  
  3341. # 11 "NISTImages.cc" 2
  3342.  
  3343. # 1 "Art.h" 1
  3344.  
  3345.  
  3346. # 339 "Art.h"
  3347.  
  3348. # 12 "NISTImages.cc" 2
  3349.  
  3350.  
  3351. extern "C" {
  3352. # 1 "./nist/ihead.h" 1
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367. typedef struct ihead{
  3368.    char id[    80    ];             
  3369.    char created[    26    ];         
  3370.    char width[    8    ];         
  3371.    char height[    8    ];         
  3372.    char depth[    8    ];         
  3373.    char density[    8    ];         
  3374.    char compress[    8    ];         
  3375.    char complen[    8    ];         
  3376.    char align[    8    ];         
  3377.    char unitsize[    8    ];         
  3378.    char sigbit;                 
  3379.    char byte_order;             
  3380.    char pix_offset[    8    ];     
  3381.    char whitepix[    8    ];         
  3382.    char issigned;             
  3383.    char rm_cm;                 
  3384.    char tb_bt;                 
  3385.    char lr_rl;                 
  3386.    char parent[    80    ];         
  3387.    char par_x[    8    ];         
  3388.    char par_y[    8    ];         
  3389. }IHEAD;
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411. # 15 "NISTImages.cc" 2
  3412.  
  3413. int readihdrfile();
  3414.  
  3415. }
  3416.  
  3417. typedef Art2<unsigned char> CImage;
  3418.  
  3419. Stk<char*> mis_files;
  3420.  
  3421. extern "C" {
  3422.     char *re_comp(char *);
  3423.     int re_exec(char *);
  3424. }
  3425.  
  3426. struct NISTCharFile {
  3427.  private:
  3428.     NISTCharFile(NISTCharFile &);
  3429.     void operator=(NISTCharFile &);
  3430.  public:
  3431.     IHEAD *bit_header;
  3432.     int bit_w,bit_h;
  3433.     char *bit_data;
  3434.     int field_w,field_h;
  3435.     Stk<int> classes;
  3436.  
  3437.     static void maybe_read_mis_files() {
  3438.         if(mis_files.length()>0) return;
  3439.         struct _iobuf  *stream = fopen("/com/nist/mis-files" ,"r");
  3440.         if(!stream) abort() ;
  3441.         char buf[1024];
  3442.         while(fgets(buf,sizeof buf,stream)) {
  3443.             buf[strlen(buf)-1]='\0';
  3444.             mis_files.push(strdup(buf));
  3445.         }
  3446.         fclose(stream);
  3447.     }
  3448.  
  3449.     static char *find_matching_mis_file_prefix(char *pattern) {
  3450.         if(re_comp(pattern)) abort() ;
  3451.         for(int i=0;i<mis_files.length();i++) {
  3452.             if(re_exec(mis_files(i))) break;
  3453.         }
  3454.         if(i<mis_files.length()) return mis_files(i);
  3455.         else return 0;
  3456.     }
  3457.  
  3458.     static int part_of_user(int user) {
  3459.         int part;
  3460.         if(user<500) part=0;
  3461.         else if(user<1000) part=1;
  3462.         else if(user<1500) part=2;
  3463.         else part=3;
  3464.         return part;
  3465.     }
  3466.  
  3467.     static char type_of_itype(int itype) {
  3468.         char type;
  3469.         switch(itype) {
  3470.         case 0: type='d'; break;
  3471.         case 1: type='u'; break;
  3472.         case 2: type='l'; break;
  3473.         default: abort() ;
  3474.         };
  3475.         return type;
  3476.     }
  3477.  
  3478.     NISTCharFile(int user,char itype) {
  3479.         maybe_read_mis_files();
  3480.         int type = type_of_itype(itype);
  3481.         int part = part_of_user(user);
  3482.  
  3483.         char buf[512];
  3484.         sprintf(buf,"/com/nist3/data/" "hsf_%d/f%04d_.*/%c%04d_.*",part,user,type,user);
  3485.         char *prefix = find_matching_mis_file_prefix(buf);
  3486.          ;
  3487.         
  3488.         if(!prefix) {
  3489.             bit_w = 0;
  3490.             bit_h = 0;
  3491.             field_w = 0;
  3492.             field_h = 0;
  3493.             return;
  3494.         }
  3495.  
  3496.         char file[512];
  3497.  
  3498.         strcpy(file,prefix); strcat(file,".mis");
  3499.         if(!readihdrfile(file,&bit_header,&bit_data,&bit_w,&bit_h))
  3500.             abort() ;
  3501.         field_w=atoi(bit_header->par_x);
  3502.         field_h=atoi(bit_header->par_y);
  3503.  
  3504.         strcpy(file,prefix); strcat(file,".cls");
  3505.         struct _iobuf  *stream = fopen(file,"r");
  3506.         if(!stream)
  3507.             abort() ;
  3508.         int total=atoi(fgets(buf,sizeof buf,stream));
  3509.         if(total!=bit_h/field_h)
  3510.             abort() ;
  3511.         while(fgets(buf,sizeof buf,stream)) classes.push(strtol(buf,0,16));
  3512.         fclose(stream);
  3513.     }
  3514.  
  3515.     ~NISTCharFile() {
  3516.         free(bit_header);
  3517.         free(bit_data);
  3518.     }
  3519.  
  3520.     int length() {
  3521.         return bit_h/field_h;
  3522.     }
  3523.  
  3524.     CImage image(int i) {
  3525.          ;
  3526.         CImage result(field_w,field_h);
  3527.         int bit_w8=bit_w/8;
  3528.         int offset=i*field_h;
  3529.         if(offset>=bit_h) abort() ;
  3530.         int i,j;
  3531.  
  3532.  
  3533.         for(i=0;i<field_w;i++) for(j=0;j<field_h;j++) {
  3534.             int jj=j+offset;
  3535.             result(i,field_h-j-1)=(!!(bit_data[bit_w8*jj+(i>>3)]&(1<<(7-i&7)))) ;
  3536.         }
  3537.  
  3538.         return result.temp();
  3539.     }
  3540.  
  3541.     int classification(int i) {
  3542.         return classes(i);
  3543.     }
  3544. };
  3545.  
  3546. int *NISTDigitImages_table;
  3547.  
  3548. struct NISTDigitImages:ImageDatabase {
  3549.  private:
  3550.     NISTDigitImages(NISTDigitImages&);
  3551.     void operator=(NISTDigitImages&);
  3552.  public:
  3553.     enum {table_size=2101};
  3554.  
  3555.     int nclassifications() {return 10;}
  3556.     int nusers() {return 2200;}
  3557.  
  3558.     static void init_table() {
  3559.         struct _iobuf  *stream=fopen("/com/nist/nist-digits" ,"r");
  3560.         NISTDigitImages_table = new int[table_size];
  3561.         if(!stream) abort() ;
  3562.         int i=1;
  3563.         while(fscanf(stream,"%d",&NISTDigitImages_table[i])==1) i++;
  3564.         if(i!=table_size) abort() ;
  3565.         fclose(stream);
  3566.         int total=0;
  3567.         for(i=1;i<table_size;i++) NISTDigitImages_table[i]+=NISTDigitImages_table[i-1];
  3568.     }
  3569.  
  3570.     static int locate(int v) {
  3571.         int low=0;
  3572.         int high=table_size;
  3573.         if(v>=NISTDigitImages_table[table_size-1]) abort() ;
  3574.         while(low+1<high) {
  3575.             int mid=(low+high)/2;
  3576.             if(NISTDigitImages_table[mid]<=v) low=mid;
  3577.             else high=mid;
  3578.         }
  3579.         while(low<table_size-1&&NISTDigitImages_table[low+1]<=v) low++;
  3580.         return low;
  3581.     }
  3582.  
  3583.     int user_offset(int user) {
  3584.         if(unsigned(user)>=2100) abort() ;
  3585.         return NISTDigitImages_table[user];
  3586.     }
  3587.  
  3588.     int user_length(int user) {
  3589.         if(unsigned(user)>=2100) abort() ;
  3590.         return NISTDigitImages_table[user+1]-NISTDigitImages_table[user];
  3591.     }
  3592.  
  3593.     int current_user;
  3594.     NISTCharFile *current_file;
  3595.  
  3596.  private:
  3597.     void get_cache(int user) {
  3598.         if(user!=current_user) {
  3599.             delete current_file;
  3600.             current_file = new NISTCharFile(user,0);
  3601.             current_user = user;
  3602.         }
  3603.     }
  3604.  
  3605.  public:
  3606.     NISTDigitImages() {
  3607.          ;
  3608.         if(!NISTDigitImages_table) init_table();
  3609.         current_user=0;
  3610.         current_file=new NISTCharFile(0,0);
  3611.          ;
  3612.     }
  3613.  
  3614.     ~NISTDigitImages() {
  3615.         delete current_file;
  3616.     }
  3617.  
  3618.     int length() {return NISTDigitImages_table[table_size-1];}
  3619.  
  3620.     int user(int i) {
  3621.         return locate(i);
  3622.     }
  3623.  
  3624.     CImage image(int i) {
  3625.         int user = locate(i);
  3626.         get_cache(user);
  3627.         int offset = i-NISTDigitImages_table[user];
  3628.         return current_file->image(offset);
  3629.     }
  3630.  
  3631.     int classification(int i) {
  3632.         int user = locate(i);
  3633.         get_cache(user);
  3634.         int offset = i-NISTDigitImages_table[user];
  3635.         return current_file->classification(offset);
  3636.     }
  3637. };
  3638.  
  3639. ImageDatabase *make_NISTDigitImages() {
  3640.     return new NISTDigitImages();
  3641. }
  3642.  
  3643. ================================================================
  3644.  
  3645.