From: Victor Wagner Date: Tue, 31 Dec 2002 19:38:08 +0000 (+0000) Subject: First checked in version X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=7fc95240daaa1c2d6e4ff61a559a4feedef4fcbd;p=oss%2Ffgis.git First checked in version --- 7fc95240daaa1c2d6e4ff61a559a4feedef4fcbd diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..99bf0da --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ + +all: fgis.so epu doc + +fgis.so: dll/fgis.so + cp dll/fgis.so . + +dll/fgis.so: lib/libepp.a proj/libproj.a dll/*.c + cd dll; make fgis.so + +lib/libepp.a: + cd lib; make + +proj/libproj.a: + cd proj; make + +epu: lib/libepp.a epu/*.[chy] + cd epu; make all +clean: + for i in dll epu doc proj lib ; do make clean; done + +doc: + cd doc; make + +tar: + ./maketar + + diff --git a/TODO b/TODO new file mode 100644 index 0000000..a43c4e8 --- /dev/null +++ b/TODO @@ -0,0 +1,71 @@ +Near future + +Fgis tcl extension: + +1. Compile tcl extension for NT/Win 95 + +2. Finish pattern handling + +3. Write drawing of patterned raster + +4. Write projection object + +5. Finish editing primitives + +6. Separate tk-dependent part from non-GUI part of C code. + +7. Develop initialization code for Win32 + +Tcl scripts + +1. Invent interface to call EPU from within TCL + +2. Complete chart (choropleth) type of layer + +3. Write tag (point) type of layer + +4. Invent standartized interface to SQL databases (Postgres, Oracle, + ODBC for start) + +5. Write ``object'' layer - collection of arbitrary Tk canvas items, + which are treated as layer and can be saved and loaded + +EPU + +1. Debug outtable + +2. Write projection conversion tool + +3. Write evaluate + +4. Do something with border and debug rasterize + +5. Write ppmtoepp and epptoppm converters + +6. Design and write RADIUS + +7. Design and write INTERPOLATE + +Distribution: + +1. Write top-level Makefile + +2. Provide example dataset + +3. Write installation program for Win32 binary distr. + +Documentation + +1. Fill holes in docs for already written commands + +2. Document layered structure of fGIS + +3. Translte epp_lib docs to English + +4. Complete (and translate to english) EPU manual + +IDEAS TO CONSIDER + +fGIS user environment should be able to store layers in RCS + +Invent and document vector format diff --git a/colors/150color.clr b/colors/150color.clr new file mode 100644 index 0000000..4bef0c9 --- /dev/null +++ b/colors/150color.clr @@ -0,0 +1,152 @@ + 0 0 0 0 BLACK + 1 462 729 196 + 2 533 847 219 + 3 603 913 298 + 4 678 964 388 + 5 498 1000 749 LT. GREEN + 6 196 729 462 + 7 219 847 533 + 8 298 913 603 + 9 388 964 678 + 10 498 1000 749 + 11 0 729 0 + 12 0 796 0 + 13 0 862 0 + 14 0 929 0 + 15 0 1000 0 GREEN + 16 792 792 129 + 17 898 898 168 + 18 941 941 266 + 19 976 976 376 + 20 1000 1000 500 YELLOW + 21 1000 444 0 ORANGE + 22 1000 634 0 + 23 1000 730 0 + 24 1000 825 0 + 25 1000 904 0 + 26 729 462 196 + 27 847 533 219 + 28 913 603 298 + 29 964 678 388 + 30 1000 749 498 + 31 792 129 129 + 32 898 168 168 + 33 941 266 266 + 34 976 376 376 + 35 1000 498 498 + 36 729 0 0 + 37 796 0 0 DK. RED + 38 862 0 0 + 39 929 0 0 + 40 1000 0 0 RED + 41 650 215 215 DK. BROWN + 42 756 270 270 + 43 796 388 388 BROWN + 44 835 505 505 + 45 874 623 623 LT. BROWN + 46 650 215 650 + 47 756 270 756 + 48 796 388 796 + 49 835 505 835 + 50 874 623 874 + 51 0 729 729 DK. CYAN + 52 0 796 796 + 53 0 862 862 + 54 0 929 929 + 55 0 1000 1000 CYAN + 56 129 792 792 + 57 168 898 898 + 58 266 941 941 + 59 376 976 976 + 60 498 1000 1000 LT. CYAN + 61 215 650 650 + 62 270 756 756 + 63 388 796 796 + 64 505 835 835 + 65 623 874 874 + 66 0 0 929 DK. BLUE + 67 0 0 1000 BLUE + 68 298 576 996 + 69 196 678 996 + 70 98 819 996 LT. BLUE + 71 196 462 729 + 72 219 533 847 + 73 298 603 913 + 74 388 678 964 + 75 498 749 1000 + 76 462 196 729 DK. PURPLE + 77 533 219 847 + 78 603 298 913 PURPLE + 79 678 388 964 + 80 749 498 1000 LT. PURPLE + 81 729 0 729 DK. MAGENTA + 82 796 0 796 + 83 862 0 862 + 84 929 0 929 + 85 1000 0 1000 MAGENTA + 86 792 129 792 + 87 898 168 898 + 88 941 266 941 + 89 976 376 976 + 90 1000 498 1000 LT. MAGENTA + 91 1000 0 1000 + 92 240 1000 1000 + 93 500 1000 1000 + 94 750 1000 1000 + 95 750 750 1000 + 96 1000 500 1000 + 97 1000 750 1000 + 98 1000 1000 750 LT. YELLOW + 99 1000 1000 0 BT. YELLOW +100 1000 793 587 +101 750 1000 750 +102 500 1000 500 +103 627 313 0 +104 730 63 63 +105 627 313 0 +106 1000 650 650 +107 888 523 587 +108 825 571 269 +109 904 0 476 +110 1000 857 888 +111 0 0 0 BLACK +112 492 492 492 DK. GRAY +113 501 501 501 +114 507 507 507 +115 523 523 523 +116 539 539 539 +117 555 555 555 +118 555 555 555 +119 571 571 571 +120 587 587 587 +121 492 492 492 +122 603 603 603 +123 619 619 619 MD. GRAY +124 634 634 634 +125 666 666 666 +126 682 682 682 +127 698 698 698 +128 714 714 714 +129 730 730 730 +130 746 746 746 +131 746 746 746 +132 873 873 873 +133 761 761 761 +134 777 777 777 +135 793 793 793 +136 809 809 809 +137 825 825 825 +138 841 841 841 +139 857 857 857 +140 873 873 873 LT. GRAY +141 873 873 873 +142 886 886 886 +143 888 888 888 +144 904 904 904 +145 920 920 920 +146 936 936 936 +147 952 952 952 +148 952 952 952 +149 968 968 968 +150 1000 1000 1000 WHITE +255 1000 1000 1000 WHITE diff --git a/colors/50grays.clr b/colors/50grays.clr new file mode 100644 index 0000000..7624013 --- /dev/null +++ b/colors/50grays.clr @@ -0,0 +1,52 @@ +0 0 0 0 BLACK +1 0 0 0 BLACK +2 3 3 3 +3 31 31 31 +4 156 156 156 +5 478 478 478 +6 482 482 482 +7 494 494 494 +8 509 509 509 +9 525 525 525 +10 533 533 533 +11 541 541 541 +12 545 545 545 +13 576 576 576 +14 592 592 592 +15 603 603 603 +16 507 507 507 +17 611 611 611 +18 623 623 623 +19 635 635 635 +20 666 666 666 +21 670 670 670 +22 674 674 674 +23 682 682 682 +24 701 701 701 +25 713 713 713 +26 733 733 733 +27 737 737 737 +28 741 741 741 +29 756 756 756 +30 772 772 772 +31 788 788 788 +32 800 800 800 +33 803 803 803 +34 807 807 807 +35 835 835 835 +36 850 850 850 +37 866 866 866 +38 870 870 870 +39 874 874 874 +40 886 886 886 +41 894 894 894 +42 909 909 909 +43 929 929 929 +44 933 933 933 +45 937 937 937 +46 964 964 964 +47 968 968 968 +48 980 980 980 +49 984 984 984 +50 1000 1000 1000 +255 1000 1000 1000 diff --git a/colors/aspect.clr b/colors/aspect.clr new file mode 100644 index 0000000..9d8e885 --- /dev/null +++ b/colors/aspect.clr @@ -0,0 +1,181 @@ + 0 726 726 726 + 1 0 407 298 + 2 0 423 290 + 3 0 439 282 + 4 0 454 274 + 5 0 470 266 + 6 0 486 258 + 7 0 501 250 + 8 11 509 243 + 9 23 517 235 + 10 35 525 227 + 11 47 533 219 + 12 58 541 211 + 13 70 549 203 + 14 82 556 196 + 15 98 564 188 + 16 109 572 180 + 17 121 580 172 + 18 133 588 164 + 19 145 596 156 + 20 156 603 149 + 21 168 611 141 + 22 180 619 133 + 23 196 627 125 + 24 207 635 117 + 25 219 643 109 + 26 231 650 101 + 27 243 658 94 + 28 254 666 86 + 29 266 674 78 + 30 278 682 70 + 31 294 690 62 + 32 305 698 54 + 33 317 705 47 + 34 329 713 39 + 35 341 721 31 + 36 352 729 23 + 37 364 737 15 + 38 376 745 7 + 39 392 752 0 + 40 407 756 0 + 41 427 764 0 + 42 447 772 0 + 43 466 780 0 + 44 486 788 0 + 45 505 796 0 + 46 521 803 0 + 47 541 811 0 + 48 560 819 0 + 49 580 827 0 + 50 600 835 0 + 51 619 843 0 + 52 635 850 0 + 53 654 858 0 + 54 674 866 0 + 55 694 874 0 + 56 713 882 0 + 57 733 890 0 + 58 752 898 0 + 59 768 905 0 + 60 788 913 0 + 61 807 921 0 + 62 827 929 0 + 63 847 937 0 + 64 866 945 0 + 65 882 952 0 + 66 901 960 0 + 67 921 968 0 + 68 941 976 0 + 69 960 984 0 + 70 980 992 0 + 71 1000 1000 0 + 72 1000 980 0 + 73 1000 960 0 + 74 1000 941 0 + 75 1000 921 0 + 76 1000 901 0 + 77 1000 882 0 + 78 1000 866 0 + 79 1000 847 0 + 80 1000 827 0 + 81 1000 807 0 + 82 1000 788 0 + 83 1000 768 0 + 84 1000 752 0 + 85 1000 733 0 + 86 1000 713 0 + 87 1000 694 0 + 88 1000 674 0 + 89 1000 654 0 + 90 1000 635 0 + 91 1000 619 0 + 92 1000 600 0 + 93 1000 580 0 + 94 1000 560 0 + 95 1000 541 0 + 96 1000 521 0 + 97 1000 505 0 + 98 1000 486 0 + 99 1000 466 0 +100 1000 447 0 +101 1000 427 0 +102 1000 407 0 +103 1000 392 0 +104 1000 376 11 +105 1000 364 23 +106 1000 352 35 +107 1000 341 47 +108 1000 329 58 +109 1000 317 70 +110 1000 305 82 +111 1000 294 98 +112 1000 278 109 +113 1000 266 121 +114 1000 254 133 +115 1000 243 145 +116 1000 231 156 +117 1000 219 168 +118 1000 207 180 +119 1000 196 196 +120 1000 180 207 +121 1000 168 219 +122 1000 156 231 +123 1000 145 243 +124 1000 133 254 +125 1000 121 266 +126 1000 109 278 +127 1000 98 294 +128 1000 82 305 +129 1000 70 317 +130 1000 58 329 +131 1000 47 341 +132 1000 35 352 +133 1000 23 364 +134 1000 11 376 +135 1000 0 392 +136 988 0 400 +137 980 0 411 +138 968 0 419 +139 960 0 431 +140 952 0 439 +141 941 0 450 +142 933 0 458 +143 925 0 470 +144 913 0 478 +145 905 0 490 +146 898 0 498 +147 886 0 509 +148 878 0 517 +149 870 0 529 +150 858 0 537 +151 850 0 549 +152 682 0 674 +153 674 0 662 +154 662 0 647 +155 650 0 631 +156 643 0 619 +157 631 0 603 +158 623 0 592 +159 611 0 576 +160 600 0 560 +161 592 0 549 +162 580 0 533 +163 568 0 517 +164 560 0 505 +165 549 0 490 +166 541 0 478 +167 529 0 462 +168 549 0 447 +169 509 0 435 +170 498 0 419 +171 486 0 403 +172 478 0 392 +173 466 0 376 +174 458 0 364 +175 447 0 349 +176 435 0 333 +177 427 0 321 +178 415 0 305 +179 403 0 290 +180 396 0 278 \ No newline at end of file diff --git a/colors/aspect8.clr b/colors/aspect8.clr new file mode 100644 index 0000000..7eb7675 --- /dev/null +++ b/colors/aspect8.clr @@ -0,0 +1,256 @@ + 0 726 726 726 + 1 0 0 444 + 2 0 158 365 + 3 0 317 285 + 4 380 730 0 + 5 1000 825 0 + 6 1000 539 0 + 7 1000 285 15 + 8 1000 111 206 + 9 1000 1000 1000 + 10 1000 1000 1000 + 11 1000 1000 1000 + 12 1000 1000 1000 + 13 1000 1000 1000 + 14 1000 1000 1000 + 15 1000 1000 1000 + 16 0 0 0 + 17 0 0 0 + 18 0 0 0 + 19 0 0 0 + 20 0 0 0 + 21 0 0 0 + 22 0 0 0 + 23 0 0 0 + 24 0 0 0 + 25 0 0 0 + 26 0 0 0 + 27 0 0 0 + 28 0 0 0 + 29 0 0 0 + 30 0 0 0 + 31 0 0 0 + 32 0 0 0 + 33 0 0 0 + 34 0 0 0 + 35 0 0 0 + 36 0 0 0 + 37 0 0 0 + 38 0 0 0 + 39 0 0 0 + 40 0 0 0 + 41 0 0 0 + 42 0 0 0 + 43 0 0 0 + 44 0 0 0 + 45 0 0 0 + 46 0 0 0 + 47 0 0 0 + 48 0 0 0 + 49 0 0 0 + 50 0 0 0 + 51 0 0 0 + 52 0 0 0 + 53 0 0 0 + 54 0 0 0 + 55 0 0 0 + 56 0 0 0 + 57 0 0 0 + 58 0 0 0 + 59 0 0 0 + 60 0 0 0 + 61 0 0 0 + 62 0 0 0 + 63 0 0 0 + 64 0 0 0 + 65 0 0 0 + 66 0 0 0 + 67 0 0 0 + 68 0 0 0 + 69 0 0 0 + 70 0 0 0 + 71 0 0 0 + 72 0 0 0 + 73 0 0 0 + 74 0 0 0 + 75 0 0 0 + 76 0 0 0 + 77 0 0 0 + 78 0 0 0 + 79 0 0 0 + 80 0 0 0 + 81 0 0 0 + 82 0 0 0 + 83 0 0 0 + 84 0 0 0 + 85 0 0 0 + 86 0 0 0 + 87 0 0 0 + 88 0 0 0 + 89 0 0 0 + 90 0 0 0 + 91 0 0 0 + 92 0 0 0 + 93 0 0 0 + 94 0 0 0 + 95 0 0 0 + 96 0 0 0 + 97 0 0 0 + 98 0 0 0 + 99 0 0 0 +100 0 0 0 +101 0 0 0 +102 0 0 0 +103 0 0 0 +104 0 0 0 +105 0 0 0 +106 0 0 0 +107 0 0 0 +108 0 0 0 +109 0 0 0 +110 0 0 0 +111 0 0 0 +112 0 0 0 +113 0 0 0 +114 0 0 0 +115 0 0 0 +116 0 0 0 +117 0 0 0 +118 0 0 0 +119 0 0 0 +120 0 0 0 +121 0 0 0 +122 0 0 0 +123 0 0 0 +124 0 0 0 +125 0 0 0 +126 0 0 0 +127 0 0 0 +128 0 0 0 +129 0 0 0 +130 0 0 0 +131 0 0 0 +132 0 0 0 +133 0 0 0 +134 0 0 0 +135 0 0 0 +136 0 0 0 +137 0 0 0 +138 0 0 0 +139 0 0 0 +140 0 0 0 +141 0 0 0 +142 0 0 0 +143 0 0 0 +144 0 0 0 +145 0 0 0 +146 0 0 0 +147 0 0 0 +148 0 0 0 +149 0 0 0 +150 0 0 0 +151 0 0 0 +152 0 0 0 +153 0 0 0 +154 0 0 0 +155 0 0 0 +156 0 0 0 +157 0 0 0 +158 0 0 0 +159 0 0 0 +160 0 0 0 +161 0 0 0 +162 0 0 0 +163 0 0 0 +164 0 0 0 +165 0 0 0 +166 0 0 0 +167 0 0 0 +168 0 0 0 +169 0 0 0 +170 0 0 0 +171 0 0 0 +172 0 0 0 +173 0 0 0 +174 0 0 0 +175 0 0 0 +176 0 0 0 +177 0 0 0 +178 0 0 0 +179 0 0 0 +180 0 0 0 +181 0 0 0 +182 0 0 0 +183 0 0 0 +184 0 0 0 +185 0 0 0 +186 0 0 0 +187 0 0 0 +188 0 0 0 +189 0 0 0 +190 0 0 0 +191 0 0 0 +192 0 0 0 +193 0 0 0 +194 0 0 0 +195 0 0 0 +196 0 0 0 +197 0 0 0 +198 0 0 0 +199 0 0 0 +200 0 0 0 +201 0 0 0 +202 0 0 0 +203 0 0 0 +204 0 0 0 +205 0 0 0 +206 0 0 0 +207 0 0 0 +208 0 0 0 +209 0 0 0 +210 0 0 0 +211 0 0 0 +212 0 0 0 +213 0 0 0 +214 0 0 0 +215 0 0 0 +216 0 0 0 +217 0 0 0 +218 0 0 0 +219 0 0 0 +220 0 0 0 +221 0 0 0 +222 0 0 0 +223 0 0 0 +224 0 0 0 +225 0 0 0 +226 0 0 0 +227 0 0 0 +228 0 0 0 +229 0 0 0 +230 0 0 0 +231 0 0 0 +232 0 0 0 +233 0 0 0 +234 0 0 0 +235 0 0 0 +236 0 0 0 +237 0 0 0 +238 0 0 0 +239 0 0 0 +240 0 0 0 +241 0 0 0 +242 0 0 0 +243 0 0 0 +244 0 0 0 +245 0 0 0 +246 0 0 0 +247 0 0 0 +248 0 0 0 +249 0 0 0 +250 0 0 0 +251 0 0 0 +252 0 0 0 +253 0 0 0 +254 0 0 0 +255 1000 1000 1000 diff --git a/colors/bw100.clr b/colors/bw100.clr new file mode 100644 index 0000000..bf5ffc9 --- /dev/null +++ b/colors/bw100.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 0 0 0 + 2 15 15 15 + 3 15 15 15 + 4 31 31 31 + 5 47 47 47 + 6 47 47 47 + 7 63 63 63 + 8 79 79 79 + 9 79 79 79 + 10 95 95 95 + 11 95 95 95 + 12 111 111 111 + 13 126 126 126 + 14 126 126 126 + 15 142 142 142 + 16 158 158 158 + 17 158 158 158 + 18 174 174 174 + 19 174 174 174 + 20 190 190 190 + 21 206 206 206 + 22 206 206 206 + 23 222 222 222 + 24 238 238 238 + 25 238 238 238 + 26 253 253 253 + 27 269 269 269 + 28 269 269 269 + 29 285 285 285 + 30 285 285 285 + 31 301 301 301 + 32 317 317 317 + 33 317 317 317 + 34 333 333 333 + 35 349 349 349 + 36 349 349 349 + 37 365 365 365 + 38 365 365 365 + 39 380 380 380 + 40 396 396 396 + 41 396 396 396 + 42 412 412 412 + 43 428 428 428 + 44 428 428 428 + 45 444 444 444 + 46 444 444 444 + 47 460 460 460 + 48 476 476 476 + 49 476 476 476 + 50 492 492 492 + 51 507 507 507 + 52 507 507 507 + 53 523 523 523 + 54 539 539 539 + 55 539 539 539 + 56 555 555 555 + 57 555 555 555 + 58 571 571 571 + 59 587 587 587 + 60 587 587 587 + 61 603 603 603 + 62 619 619 619 + 63 619 619 619 + 64 634 634 634 + 65 634 634 634 + 66 650 650 650 + 67 666 666 666 + 68 666 666 666 + 69 682 682 682 + 70 698 698 698 + 71 698 698 698 + 72 714 714 714 + 73 714 714 714 + 74 730 730 730 + 75 746 746 746 + 76 746 746 746 + 77 761 761 761 + 78 777 777 777 + 79 777 777 777 + 80 793 793 793 + 81 809 809 809 + 82 809 809 809 + 83 825 825 825 + 84 825 825 825 + 85 841 841 841 + 86 857 857 857 + 87 857 857 857 + 88 873 873 873 + 89 888 888 888 + 90 888 888 888 + 91 904 904 904 + 92 904 904 904 + 93 920 920 920 + 94 936 936 936 + 95 936 936 936 + 96 952 952 952 + 97 968 968 968 + 98 968 968 968 + 99 984 984 984 +100 1000 1000 1000 +101 0 0 0 +102 0 0 0 +103 0 0 0 +104 0 0 0 +105 0 0 0 +106 0 0 0 +107 0 0 0 +108 0 0 0 +109 0 0 0 +110 0 0 0 +111 0 0 0 +112 0 0 0 +113 0 0 0 +114 0 0 0 +115 0 0 0 +116 0 0 0 +117 0 0 0 +118 0 0 0 +119 0 0 0 +120 0 0 0 +121 0 0 0 +122 0 0 0 +123 0 0 0 +124 0 0 0 +125 0 0 0 +126 0 0 0 +127 0 0 0 +128 0 0 0 +129 0 0 0 +130 0 0 0 +131 0 0 0 +132 0 0 0 +133 0 0 0 +134 0 0 0 +135 0 0 0 +136 0 0 0 +137 0 0 0 +138 0 0 0 +139 0 0 0 +140 0 0 0 +141 0 0 0 +142 0 0 0 +143 0 0 0 +144 0 0 0 +145 0 0 0 +146 0 0 0 +147 0 0 0 +148 0 0 0 +149 0 0 0 +150 0 0 0 +151 0 0 0 +152 0 0 0 +153 0 0 0 +154 0 0 0 +155 0 0 0 +156 0 0 0 +157 0 0 0 +158 0 0 0 +159 0 0 0 +160 0 0 0 +161 0 0 0 +162 0 0 0 +163 0 0 0 +164 0 0 0 +165 0 0 0 +166 0 0 0 +167 0 0 0 +168 0 0 0 +169 0 0 0 +170 0 0 0 +171 0 0 0 +172 0 0 0 +173 0 0 0 +174 0 0 0 +175 0 0 0 +176 0 0 0 +177 0 0 0 +178 0 0 0 +179 0 0 0 +180 0 0 0 +181 0 0 0 +182 0 0 0 +183 0 0 0 +184 0 0 0 +185 0 0 0 +186 0 0 0 +187 0 0 0 +188 0 0 0 +189 0 0 0 +190 0 0 0 +191 0 0 0 +192 0 0 0 +193 0 0 0 +194 0 0 0 +195 0 0 0 +196 0 0 0 +197 0 0 0 +198 0 0 0 +199 0 0 0 +200 0 0 0 +201 0 0 0 +202 0 0 0 +203 0 0 0 +204 0 0 0 +205 0 0 0 +206 0 0 0 +207 0 0 0 +208 0 0 0 +209 0 0 0 +210 0 0 0 +211 0 0 0 +212 0 0 0 +213 0 0 0 +214 0 0 0 +215 0 0 0 +216 0 0 0 +217 0 0 0 +218 0 0 0 +219 0 0 0 +220 0 0 0 +221 0 0 0 +222 0 0 0 +223 0 0 0 +224 0 0 0 +225 0 0 0 +226 0 0 0 +227 0 0 0 +228 0 0 0 +229 0 0 0 +230 0 0 0 +231 0 0 0 +232 0 0 0 +233 0 0 0 +234 0 0 0 +235 0 0 0 +236 0 0 0 +237 0 0 0 +238 0 0 0 +239 0 0 0 +240 0 0 0 +241 0 0 0 +242 0 0 0 +243 0 0 0 +244 0 0 0 +245 0 0 0 +246 0 0 0 +247 0 0 0 +248 0 0 0 +249 0 0 0 +250 0 0 0 +251 0 0 0 +252 0 0 0 +253 0 0 0 +254 396 0 278 +255 1000 1000 1000 diff --git a/colors/bw17.clr b/colors/bw17.clr new file mode 100644 index 0000000..9241a46 --- /dev/null +++ b/colors/bw17.clr @@ -0,0 +1,17 @@ +0 0 0 0 +1 42 42 42 +2 86 86 86 +3 133 133 133 +4 180 180 180 +5 231 231 231 +6 282 282 282 +7 341 341 341 +8 400 400 400 +9 462 462 462 +10 529 529 529 +11 600 600 600 +12 670 670 670 +13 749 749 749 +14 831 831 831 +15 917 917 917 +16 998 998 998 \ No newline at end of file diff --git a/colors/bw256.clr b/colors/bw256.clr new file mode 100644 index 0000000..abd765d --- /dev/null +++ b/colors/bw256.clr @@ -0,0 +1,257 @@ + 0 0 0 0 + 1 3 3 3 + 2 7 7 7 + 3 11 11 11 + 4 15 15 15 + 5 19 19 19 + 6 23 23 23 + 7 27 27 27 + 8 31 31 31 + 9 35 35 35 + 10 39 39 39 + 11 43 43 43 + 12 47 47 47 + 13 50 50 50 + 14 54 54 54 + 15 58 58 58 + 16 62 62 62 + 17 66 66 66 + 18 70 70 70 + 19 74 74 74 + 20 78 78 78 + 21 82 82 82 + 22 86 86 86 + 23 90 90 90 + 24 94 94 94 + 25 98 98 98 + 26 101 101 101 + 27 105 105 105 + 28 109 109 109 + 29 113 113 113 + 30 117 117 117 + 31 121 121 121 + 32 125 125 125 + 33 129 129 129 + 34 133 133 133 + 35 137 137 137 + 36 141 141 141 + 37 145 145 145 + 38 149 149 149 + 39 152 152 152 + 40 156 156 156 + 41 160 160 160 + 42 164 164 164 + 43 168 168 168 + 44 172 172 172 + 45 176 176 176 + 46 180 180 180 + 47 184 184 184 + 48 188 188 188 + 49 192 192 192 + 50 196 196 196 + 51 200 200 200 + 52 203 203 203 + 53 207 207 207 + 54 211 211 211 + 55 215 215 215 + 56 219 219 219 + 57 223 223 223 + 58 227 227 227 + 59 231 231 231 + 60 235 235 235 + 61 239 239 239 + 62 243 243 243 + 63 247 247 247 + 64 250 250 250 + 65 254 254 254 + 66 258 258 258 + 67 262 262 262 + 68 266 266 266 + 69 270 270 270 + 70 274 274 274 + 71 278 278 278 + 72 282 282 282 + 73 286 286 286 + 74 290 290 290 + 75 294 294 294 + 76 298 298 298 + 77 301 301 301 + 78 305 305 305 + 79 309 309 309 + 80 313 313 313 + 81 317 317 317 + 82 321 321 321 + 83 325 325 325 + 84 329 329 329 + 85 333 333 333 + 86 337 337 337 + 87 341 341 341 + 88 345 345 345 + 89 349 349 349 + 90 352 352 352 + 91 356 356 356 + 92 360 360 360 + 93 364 364 364 + 94 368 368 368 + 95 372 372 372 + 96 376 376 376 + 97 380 380 380 + 98 384 384 384 + 99 388 388 388 +100 392 392 392 +101 396 396 396 +102 400 400 400 +103 403 403 403 +104 407 407 407 +105 411 411 411 +106 415 415 415 +107 419 419 419 +108 423 423 423 +109 427 427 427 +110 431 431 431 +111 435 435 435 +112 439 439 439 +113 443 443 443 +114 447 447 447 +115 450 450 450 +116 454 454 454 +117 458 458 458 +118 462 462 462 +119 466 466 466 +120 470 470 470 +121 474 474 474 +122 478 478 478 +123 482 482 482 +124 486 486 486 +125 490 490 490 +126 494 494 494 +127 498 498 498 +128 501 501 501 +129 505 505 505 +130 509 509 509 +131 513 513 513 +132 517 517 517 +133 521 521 521 +134 525 525 525 +135 529 529 529 +136 533 533 533 +137 537 537 537 +138 541 541 541 +139 545 545 545 +140 549 549 549 +141 552 552 552 +142 556 556 556 +143 560 560 560 +144 564 564 564 +145 568 568 568 +146 572 572 572 +147 576 576 576 +148 580 580 580 +149 584 584 584 +150 588 588 588 +151 592 592 592 +152 596 596 596 +153 600 600 600 +154 603 603 603 +155 607 607 607 +156 611 611 611 +157 615 615 615 +158 619 619 619 +159 623 623 623 +160 627 627 627 +161 631 631 631 +162 635 635 635 +163 639 639 639 +164 643 643 643 +165 647 647 647 +166 650 650 650 +167 654 654 654 +168 658 658 658 +169 662 662 662 +170 666 666 666 +171 670 670 670 +172 674 674 674 +173 678 678 678 +174 682 682 682 +175 686 686 686 +176 690 690 690 +177 694 694 694 +178 698 698 698 +179 701 701 701 +180 705 705 705 +181 709 709 709 +182 713 713 713 +183 717 717 717 +184 721 721 721 +185 725 725 725 +186 729 729 729 +187 733 733 733 +188 737 737 737 +189 741 741 741 +190 745 745 745 +191 749 749 749 +192 752 752 752 +193 756 756 756 +194 760 760 760 +195 764 764 764 +196 768 768 768 +197 772 772 772 +198 776 776 776 +199 780 780 780 +200 784 784 784 +201 788 788 788 +202 792 792 792 +203 796 796 796 +204 800 800 800 +205 803 803 803 +206 807 807 807 +207 811 811 811 +208 815 815 815 +209 819 819 819 +210 823 823 823 +211 827 827 827 +212 831 831 831 +213 835 835 835 +214 839 839 839 +215 843 843 843 +216 847 847 847 +217 850 850 850 +218 854 854 854 +219 858 858 858 +220 862 862 862 +221 866 866 866 +222 870 870 870 +223 874 874 874 +224 878 878 878 +225 882 882 882 +226 886 886 886 +227 890 890 890 +228 894 894 894 +229 898 898 898 +230 901 901 901 +231 905 905 905 +232 909 909 909 +233 913 913 913 +234 917 917 917 +235 921 921 921 +236 925 925 925 +237 929 929 929 +238 933 933 933 +239 937 937 937 +240 941 941 941 +241 945 945 945 +242 949 949 949 +243 952 952 952 +244 956 956 956 +245 960 960 960 +246 964 964 964 +247 968 968 968 +248 972 972 972 +249 976 976 976 +250 980 980 980 +251 984 984 984 +252 988 988 988 +253 992 992 992 +254 1000 1000 1000 +255 1000 1000 1000 + \ No newline at end of file diff --git a/colors/bw256inv.clr b/colors/bw256inv.clr new file mode 100644 index 0000000..020b754 --- /dev/null +++ b/colors/bw256inv.clr @@ -0,0 +1,256 @@ + 0 1000 1000 1000 + 1 997 997 997 + 2 993 993 993 + 3 989 989 989 + 4 985 985 985 + 5 981 981 981 + 6 977 977 977 + 7 974 974 974 + 8 970 970 970 + 9 966 966 966 + 10 962 962 962 + 11 958 958 958 + 12 954 954 954 + 13 950 950 950 + 14 946 946 946 + 15 942 942 942 + 16 938 938 938 + 17 934 934 934 + 18 930 930 930 + 19 926 926 926 + 20 923 923 923 + 21 919 919 919 + 22 915 915 915 + 23 911 911 911 + 24 907 907 907 + 25 903 903 903 + 26 899 899 899 + 27 895 895 895 + 28 891 891 891 + 29 887 887 887 + 30 883 883 883 + 31 879 879 879 + 32 876 876 876 + 33 872 872 872 + 34 868 868 868 + 35 864 864 864 + 36 860 860 860 + 37 856 856 856 + 38 852 852 852 + 39 848 848 848 + 40 844 844 844 + 41 840 840 840 + 42 836 836 836 + 43 832 832 832 + 44 828 828 828 + 45 825 825 825 + 46 821 821 821 + 47 817 817 817 + 48 813 813 813 + 49 809 809 809 + 50 805 805 805 + 51 801 801 801 + 52 797 797 797 + 53 793 793 793 + 54 789 789 789 + 55 785 785 785 + 56 781 781 781 + 57 777 777 777 + 58 774 774 774 + 59 770 770 770 + 60 766 766 766 + 61 762 762 762 + 62 758 758 758 + 63 754 754 754 + 64 750 750 750 + 65 746 746 746 + 66 742 742 742 + 67 738 738 738 + 68 734 734 734 + 69 730 730 730 + 70 726 726 726 + 71 723 723 723 + 72 719 719 719 + 73 715 715 715 + 74 711 711 711 + 75 707 707 707 + 76 703 703 703 + 77 699 699 699 + 78 695 695 695 + 79 691 691 691 + 80 687 687 687 + 81 683 683 683 + 82 679 679 679 + 83 676 676 676 + 84 672 672 672 + 85 668 668 668 + 86 664 664 664 + 87 660 660 660 + 88 656 656 656 + 89 652 652 652 + 90 648 648 648 + 91 644 644 644 + 92 640 640 640 + 93 636 636 636 + 94 632 632 632 + 95 628 628 628 + 96 625 625 625 + 97 621 621 621 + 98 617 617 617 + 99 613 613 613 +100 609 609 609 +101 605 605 605 +102 601 601 601 +103 597 597 597 +104 593 593 593 +105 589 589 589 +106 585 585 585 +107 581 581 581 +108 577 577 577 +109 574 574 574 +110 570 570 570 +111 566 566 566 +112 562 562 562 +113 558 558 558 +114 554 554 554 +115 550 550 550 +116 546 546 546 +117 542 542 542 +118 538 538 538 +119 534 534 534 +120 530 530 530 +121 526 526 526 +122 523 523 523 +123 519 519 519 +124 515 515 515 +125 511 511 511 +126 507 507 507 +127 503 503 503 +128 499 499 499 +129 495 495 495 +130 491 491 491 +131 487 487 487 +132 483 483 483 +133 479 479 479 +134 476 476 476 +135 472 472 472 +136 468 468 468 +137 464 464 464 +138 460 460 460 +139 456 456 456 +140 452 452 452 +141 448 448 448 +142 444 444 444 +143 440 440 440 +144 436 436 436 +145 432 432 432 +146 428 428 428 +147 425 425 425 +148 421 421 421 +149 417 417 417 +150 413 413 413 +151 409 409 409 +152 405 405 405 +153 401 401 401 +154 397 397 397 +155 393 393 393 +156 389 389 389 +157 385 385 385 +158 381 381 381 +159 377 377 377 +160 374 374 374 +161 370 370 370 +162 366 366 366 +163 362 362 362 +164 358 358 358 +165 354 354 354 +166 350 350 350 +167 346 346 346 +168 342 342 342 +169 338 338 338 +170 334 334 334 +171 330 330 330 +172 326 326 326 +173 323 323 323 +174 319 319 319 +175 315 315 315 +176 311 311 311 +177 307 307 307 +178 303 303 303 +179 299 299 299 +180 295 295 295 +181 291 291 291 +182 287 287 287 +183 283 283 283 +184 279 279 279 +185 276 276 276 +186 272 272 272 +187 268 268 268 +188 264 264 264 +189 260 260 260 +190 256 256 256 +191 252 252 252 +192 248 248 248 +193 244 244 244 +194 240 240 240 +195 236 236 236 +196 232 232 232 +197 228 228 228 +198 225 225 225 +199 221 221 221 +200 217 217 217 +201 213 213 213 +202 209 209 209 +203 205 205 205 +204 201 201 201 +205 197 197 197 +206 193 193 193 +207 189 189 189 +208 185 185 185 +209 181 181 181 +210 177 177 177 +211 174 174 174 +212 170 170 170 +213 166 166 166 +214 162 162 162 +215 158 158 158 +216 154 154 154 +217 150 150 150 +218 146 146 146 +219 142 142 142 +220 138 138 138 +221 134 134 134 +222 130 130 130 +223 126 126 126 +224 123 123 123 +225 119 119 119 +226 115 115 115 +227 111 111 111 +228 107 107 107 +229 103 103 103 +230 99 99 99 +231 95 95 95 +232 91 91 91 +233 87 87 87 +234 83 83 83 +235 79 79 79 +236 76 76 76 +237 72 72 72 +238 68 68 68 +239 64 64 64 +240 60 60 60 +241 56 56 56 +242 52 52 52 +243 48 48 48 +244 44 44 44 +245 40 40 40 +246 36 36 36 +247 32 32 32 +248 28 28 28 +249 25 25 25 +250 21 21 21 +251 17 17 17 +252 13 13 13 +253 9 9 9 +254 5 5 5 +255 0 0 0 diff --git a/colors/bw5.clr b/colors/bw5.clr new file mode 100644 index 0000000..7e88da4 --- /dev/null +++ b/colors/bw5.clr @@ -0,0 +1,5 @@ +0 0 0 0 +1 180 180 180 +2 400 400 400 +3 670 670 670 +4 1000 1000 1000 diff --git a/colors/bw64.clr b/colors/bw64.clr new file mode 100644 index 0000000..a45048a --- /dev/null +++ b/colors/bw64.clr @@ -0,0 +1,64 @@ + 0 0 0 0 + 1 15 15 15 + 2 31 31 31 + 3 47 47 47 + 4 62 62 62 + 5 78 78 78 + 6 94 94 94 + 7 109 109 109 + 8 125 125 125 + 9 141 141 141 +10 156 156 156 +11 172 172 172 +12 188 188 188 +13 203 203 203 +14 219 219 219 +15 235 235 235 +16 250 250 250 +17 266 266 266 +18 282 282 282 +19 298 298 298 +20 313 313 313 +21 329 329 329 +22 345 345 345 +23 360 360 360 +24 376 376 376 +25 392 392 392 +26 407 407 407 +27 423 423 423 +28 439 439 439 +29 454 454 454 +30 470 470 470 +31 486 486 486 +32 501 501 501 +33 517 517 517 +34 533 533 533 +35 549 549 549 +36 564 564 564 +37 580 580 580 +38 596 596 596 +39 611 611 611 +40 627 627 627 +41 643 643 643 +42 658 658 658 +43 674 674 674 +44 690 690 690 +45 705 705 705 +46 721 721 721 +47 737 737 737 +48 752 752 752 +49 768 768 768 +50 784 784 784 +51 800 800 800 +52 815 815 815 +53 831 831 831 +54 847 847 847 +55 862 862 862 +56 878 878 878 +57 894 894 894 +58 909 909 909 +59 925 925 925 +60 941 941 941 +61 956 956 956 +62 972 972 972 +63 1000 1000 1000 diff --git a/colors/default.clr b/colors/default.clr new file mode 100644 index 0000000..53ae720 --- /dev/null +++ b/colors/default.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 1000 0 0 + 2 0 1000 0 + 3 650 650 1000 + 4 1000 1000 0 + 5 1000 0 1000 + 6 0 1000 1000 + 7 650 650 650 + 8 1000 650 0 + 9 650 317 0 + 10 0 650 0 + 11 0 0 1000 + 12 650 650 0 + 13 650 0 650 + 14 0 650 650 + 15 857 857 857 + 16 587 587 587 + 17 0 380 380 + 18 0 539 539 + 19 0 682 682 + 20 0 841 841 + 21 0 1000 1000 + 22 95 809 984 + 23 190 666 984 + 24 285 571 984 + 25 380 507 984 + 26 492 492 1000 + 27 365 0 365 + 28 523 0 523 + 29 682 0 682 + 30 841 0 841 + 31 1000 0 1000 + 32 984 95 904 + 33 984 190 825 + 34 984 285 777 + 35 984 380 746 + 36 1000 492 746 + 37 0 0 190 + 38 0 0 380 + 39 0 0 587 + 40 0 0 793 + 41 0 0 1000 + 42 142 63 920 + 43 269 126 857 + 44 365 206 777 + 45 444 269 714 + 46 333 333 634 + 47 190 190 0 + 48 380 380 0 + 49 587 587 0 + 50 793 793 0 + 51 1000 1000 0 + 52 920 920 63 + 53 857 857 126 + 54 777 777 206 + 55 714 714 269 + 56 634 634 333 + 57 0 190 0 + 58 0 380 0 + 59 0 587 0 + 60 0 793 0 + 61 0 1000 0 + 62 63 904 63 + 63 142 825 142 + 64 238 746 238 + 65 301 666 301 + 66 396 587 396 + 67 190 0 0 + 68 380 0 0 + 69 587 0 0 + 70 793 0 0 + 71 1000 0 0 + 72 904 63 63 + 73 825 142 142 + 74 746 238 238 + 75 666 301 301 + 76 587 396 396 + 77 238 746 746 + 78 238 634 746 + 79 238 523 746 + 80 238 412 746 + 81 238 285 746 + 82 285 238 746 + 83 412 238 746 + 84 523 238 746 + 85 634 238 746 + 86 746 238 746 + 87 746 238 634 + 88 746 238 539 + 89 746 238 444 + 90 746 238 349 + 91 746 238 253 + 92 746 333 238 + 93 746 444 238 + 94 746 539 238 + 95 746 634 238 + 96 746 746 238 + 97 634 746 238 + 98 412 746 238 + 99 238 746 285 +100 238 746 507 +101 238 746 746 +102 380 158 0 +103 587 238 0 +104 793 317 0 +105 1000 412 0 +106 1000 523 190 +107 79 79 79 +108 190 190 190 +109 285 285 285 +110 396 396 396 +111 492 492 492 +112 587 587 587 +113 682 682 682 +114 777 777 777 +115 888 888 888 +116 984 984 984 +117 0 492 1000 +118 0 1000 1000 +119 746 492 0 +120 0 841 15 +121 650 0 650 +122 698 396 0 +123 841 587 285 +124 1000 650 650 +125 1000 793 587 +126 0 793 1000 +127 0 1000 793 +128 380 380 380 +129 1000 238 238 +130 1000 650 317 +131 317 317 1000 +132 0 317 1000 +133 1000 317 0 +134 746 238 0 +135 746 79 79 +136 0 0 0 +137 857 1000 857 +138 1000 1000 0 +139 1000 0 1000 +140 650 650 650 +141 1000 492 0 +142 1000 0 0 +143 492 1000 0 +144 0 492 0 +145 317 698 0 +146 0 0 1000 +147 0 492 1000 +148 0 1000 1000 +149 746 492 0 +150 0 841 0 +151 650 0 650 +152 698 396 0 +153 841 587 285 +154 1000 650 650 +155 1000 793 587 +156 0 793 1000 +157 0 1000 793 +158 380 380 380 +159 1000 238 238 +160 1000 650 317 +161 317 317 1000 +162 0 317 1000 +163 1000 317 0 +164 746 238 15 +165 746 79 79 +166 0 0 15 +167 857 920 1000 +168 1000 1000 0 +169 1000 0 1000 +170 650 650 650 +171 1000 492 0 +172 1000 0 0 +173 492 1000 0 +174 0 492 0 +175 317 698 0 +176 0 0 1000 +177 0 492 1000 +178 0 1000 1000 +179 746 492 0 +180 0 841 0 +181 650 0 650 +182 698 396 0 +183 841 587 285 +184 1000 650 650 +185 1000 793 587 +186 0 793 1000 +187 0 1000 793 +188 380 380 380 +189 1000 238 238 +190 1000 650 317 +191 317 317 1000 +192 0 317 1000 +193 1000 317 0 +194 746 238 15 +195 746 79 79 +196 0 0 0 +197 1000 857 857 +198 1000 1000 0 +199 1000 0 1000 +200 650 650 650 +201 1000 492 0 +202 1000 0 0 +203 492 1000 0 +204 0 492 0 +205 317 698 0 +206 0 0 1000 +207 0 492 1000 +208 0 1000 1000 +209 746 492 0 +210 0 841 15 +211 650 0 650 +212 698 396 0 +213 841 587 285 +214 1000 650 650 +215 1000 793 587 +216 0 793 1000 +217 0 1000 793 +218 380 380 380 +219 1000 238 238 +220 1000 650 317 +221 317 317 1000 +222 746 238 0 +223 746 79 79 +224 0 0 0 +225 1000 857 1000 +226 1000 1000 0 +227 1000 0 1000 +228 650 650 650 +229 1000 492 0 +230 1000 0 0 +231 492 1000 0 +232 0 492 0 +233 317 698 0 +234 0 0 1000 +235 0 492 1000 +236 0 1000 1000 +237 746 492 0 +238 0 841 0 +239 650 0 650 +240 698 396 0 +241 841 587 285 +242 1000 650 650 +243 1000 793 587 +244 0 793 1000 +245 0 1000 793 +246 380 380 380 +247 1000 238 238 +248 1000 650 317 +249 317 317 1000 +250 0 317 1000 +251 1000 317 0 +252 746 238 0 +253 746 79 79 +254 0 0 0 +255 1000 1000 1000 diff --git a/colors/digdoq.clr b/colors/digdoq.clr new file mode 100644 index 0000000..493d067 --- /dev/null +++ b/colors/digdoq.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 850 0 0 + 2 7 7 7 + 3 11 11 11 + 4 15 15 15 + 5 19 19 19 + 6 23 23 23 + 7 27 27 27 + 8 31 31 31 + 9 35 35 35 + 10 39 39 39 + 11 43 43 43 + 12 47 47 47 + 13 50 50 50 + 14 54 54 54 + 15 58 58 58 + 16 62 62 62 + 17 66 66 66 + 18 70 70 70 + 19 74 74 74 + 20 78 78 78 + 21 82 82 82 + 22 86 86 86 + 23 90 90 90 + 24 94 94 94 + 25 98 98 98 + 26 101 101 101 + 27 105 105 105 + 28 109 109 109 + 29 113 113 113 + 30 117 117 117 + 31 121 121 121 + 32 125 125 125 + 33 129 129 129 + 34 133 133 133 + 35 137 137 137 + 36 141 141 141 + 37 145 145 145 + 38 149 149 149 + 39 152 152 152 + 40 156 156 156 + 41 160 160 160 + 42 164 164 164 + 43 168 168 168 + 44 172 172 172 + 45 176 176 176 + 46 180 180 180 + 47 184 184 184 + 48 188 188 188 + 49 192 192 192 + 50 196 196 196 + 51 200 200 200 + 52 203 203 203 + 53 207 207 207 + 54 211 211 211 + 55 215 215 215 + 56 219 219 219 + 57 223 223 223 + 58 227 227 227 + 59 231 231 231 + 60 235 235 235 + 61 239 239 239 + 62 243 243 243 + 63 247 247 247 + 64 250 250 250 + 65 254 254 254 + 66 258 258 258 + 67 262 262 262 + 68 266 266 266 + 69 270 270 270 + 70 274 274 274 + 71 278 278 278 + 72 282 282 282 + 73 286 286 286 + 74 290 290 290 + 75 294 294 294 + 76 298 298 298 + 77 301 301 301 + 78 305 305 305 + 79 309 309 309 + 80 313 313 313 + 81 317 317 317 + 82 321 321 321 + 83 325 325 325 + 84 329 329 329 + 85 333 333 333 + 86 337 337 337 + 87 341 341 341 + 88 345 345 345 + 89 349 349 349 + 90 352 352 352 + 91 356 356 356 + 92 360 360 360 + 93 364 364 364 + 94 368 368 368 + 95 372 372 372 + 96 376 376 376 + 97 380 380 380 + 98 384 384 384 + 99 388 388 388 +100 392 392 392 +101 396 396 396 +102 400 400 400 +103 403 403 403 +104 407 407 407 +105 411 411 411 +106 415 415 415 +107 419 419 419 +108 423 423 423 +109 427 427 427 +110 431 431 431 +111 435 435 435 +112 439 439 439 +113 443 443 443 +114 447 447 447 +115 450 450 450 +116 454 454 454 +117 458 458 458 +118 462 462 462 +119 466 466 466 +120 470 470 470 +121 474 474 474 +122 478 478 478 +123 482 482 482 +124 486 486 486 +125 490 490 490 +126 494 494 494 +127 498 498 498 +128 501 501 501 +129 505 505 505 +130 509 509 509 +131 513 513 513 +132 517 517 517 +133 521 521 521 +134 525 525 525 +135 529 529 529 +136 533 533 533 +137 537 537 537 +138 541 541 541 +139 545 545 545 +140 549 549 549 +141 552 552 552 +142 556 556 556 +143 560 560 560 +144 564 564 564 +145 568 568 568 +146 572 572 572 +147 576 576 576 +148 580 580 580 +149 584 584 584 +150 588 588 588 +151 592 592 592 +152 596 596 596 +153 600 600 600 +154 603 603 603 +155 607 607 607 +156 611 611 611 +157 615 615 615 +158 619 619 619 +159 623 623 623 +160 627 627 627 +161 631 631 631 +162 635 635 635 +163 639 639 639 +164 643 643 643 +165 647 647 647 +166 650 650 650 +167 654 654 654 +168 658 658 658 +169 662 662 662 +170 666 666 666 +171 670 670 670 +172 674 674 674 +173 678 678 678 +174 682 682 682 +175 686 686 686 +176 690 690 690 +177 694 694 694 +178 698 698 698 +179 701 701 701 +180 705 705 705 +181 709 709 709 +182 713 713 713 +183 717 717 717 +184 721 721 721 +185 725 725 725 +186 729 729 729 +187 733 733 733 +188 737 737 737 +189 741 741 741 +190 745 745 745 +191 749 749 749 +192 752 752 752 +193 756 756 756 +194 760 760 760 +195 764 764 764 +196 768 768 768 +197 772 772 772 +198 776 776 776 +199 780 780 780 +200 784 784 784 +201 788 788 788 +202 792 792 792 +203 796 796 796 +204 800 800 800 +205 803 803 803 +206 807 807 807 +207 811 811 811 +208 815 815 815 +209 819 819 819 +210 823 823 823 +211 827 827 827 +212 831 831 831 +213 835 835 835 +214 839 839 839 +215 843 843 843 +216 847 847 847 +217 850 850 850 +218 854 854 854 +219 858 858 858 +220 862 862 862 +221 866 866 866 +222 870 870 870 +223 874 874 874 +224 878 878 878 +225 882 882 882 +226 886 886 886 +227 890 890 890 +228 894 894 894 +229 898 898 898 +230 901 901 901 +231 905 905 905 +232 909 909 909 +233 913 913 913 +234 917 917 917 +235 921 921 921 +236 925 925 925 +237 929 929 929 +238 933 933 933 +239 937 937 937 +240 941 941 941 +241 945 945 945 +242 949 949 949 +243 952 952 952 +244 956 956 956 +245 960 960 960 +246 964 964 964 +247 968 968 968 +248 972 972 972 +249 976 976 976 +250 980 980 980 +251 984 984 984 +252 988 988 988 +253 992 992 992 +254 1000 1000 1000 +255 1000 1000 1000 diff --git a/colors/drgbw.clr b/colors/drgbw.clr new file mode 100644 index 0000000..e87a574 --- /dev/null +++ b/colors/drgbw.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 1000 1000 1000 + 2 380 380 380 + 3 439 439 439 + 4 349 349 349 + 5 894 894 894 + 6 474 474 474 + 7 411 411 411 + 8 862 862 862 + 9 764 764 764 + 10 811 811 811 + 11 781 781 781 + 12 678 678 678 + 13 0 0 0 + 14 0 0 0 + 15 0 0 0 + 16 0 0 0 + 17 0 0 0 + 18 0 0 0 + 19 0 0 0 + 20 0 0 0 + 21 0 0 0 + 22 0 0 0 + 23 0 0 0 + 24 0 0 0 + 25 0 0 0 + 26 0 0 0 + 27 0 0 0 + 28 0 0 0 + 29 0 0 0 + 30 0 0 0 + 31 0 0 0 + 32 0 0 0 + 33 0 0 0 + 34 0 0 0 + 35 0 0 0 + 36 0 0 0 + 37 0 0 0 + 38 0 0 0 + 39 0 0 0 + 40 0 0 0 + 41 0 0 0 + 42 0 0 0 + 43 0 0 0 + 44 0 0 0 + 45 0 0 0 + 46 0 0 0 + 47 0 0 0 + 48 0 0 0 + 49 0 0 0 + 50 0 0 0 + 51 0 0 0 + 52 0 0 0 + 53 0 0 0 + 54 0 0 0 + 55 0 0 0 + 56 0 0 0 + 57 0 0 0 + 58 0 0 0 + 59 0 0 0 + 60 0 0 0 + 61 0 0 0 + 62 0 0 0 + 63 0 0 0 + 64 0 0 0 + 65 0 0 0 + 66 0 0 0 + 67 0 0 0 + 68 0 0 0 + 69 0 0 0 + 70 0 0 0 + 71 0 0 0 + 72 0 0 0 + 73 0 0 0 + 74 0 0 0 + 75 0 0 0 + 76 0 0 0 + 77 0 0 0 + 78 0 0 0 + 79 0 0 0 + 80 0 0 0 + 81 0 0 0 + 82 0 0 0 + 83 0 0 0 + 84 0 0 0 + 85 0 0 0 + 86 0 0 0 + 87 0 0 0 + 88 0 0 0 + 89 0 0 0 + 90 0 0 0 + 91 0 0 0 + 92 0 0 0 + 93 0 0 0 + 94 0 0 0 + 95 0 0 0 + 96 0 0 0 + 97 0 0 0 + 98 0 0 0 + 99 0 0 0 +100 0 0 0 +101 0 0 0 +102 0 0 0 +103 0 0 0 +104 0 0 0 +105 0 0 0 +106 0 0 0 +107 0 0 0 +108 0 0 0 +109 0 0 0 +110 0 0 0 +111 0 0 0 +112 0 0 0 +113 0 0 0 +114 0 0 0 +115 0 0 0 +116 0 0 0 +117 0 0 0 +118 0 0 0 +119 0 0 0 +120 0 0 0 +121 0 0 0 +122 0 0 0 +123 0 0 0 +124 0 0 0 +125 0 0 0 +126 0 0 0 +127 0 0 0 +128 0 0 0 +129 0 0 0 +130 0 0 0 +131 0 0 0 +132 0 0 0 +133 0 0 0 +134 0 0 0 +135 0 0 0 +136 0 0 0 +137 0 0 0 +138 0 0 0 +139 0 0 0 +140 0 0 0 +141 0 0 0 +142 0 0 0 +143 0 0 0 +144 0 0 0 +145 0 0 0 +146 0 0 0 +147 0 0 0 +148 0 0 0 +149 0 0 0 +150 0 0 0 +151 0 0 0 +152 0 0 0 +153 0 0 0 +154 0 0 0 +155 0 0 0 +156 0 0 0 +157 0 0 0 +158 0 0 0 +159 0 0 0 +160 0 0 0 +161 0 0 0 +162 0 0 0 +163 0 0 0 +164 0 0 0 +165 0 0 0 +166 0 0 0 +167 0 0 0 +168 0 0 0 +169 0 0 0 +170 0 0 0 +171 0 0 0 +172 0 0 0 +173 0 0 0 +174 0 0 0 +175 0 0 0 +176 0 0 0 +177 0 0 0 +178 0 0 0 +179 0 0 0 +180 0 0 0 +181 0 0 0 +182 0 0 0 +183 0 0 0 +184 0 0 0 +185 0 0 0 +186 0 0 0 +187 0 0 0 +188 0 0 0 +189 0 0 0 +190 0 0 0 +191 0 0 0 +192 0 0 0 +193 0 0 0 +194 0 0 0 +195 0 0 0 +196 0 0 0 +197 0 0 0 +198 0 0 0 +199 0 0 0 +200 0 0 0 +201 0 0 0 +202 0 0 0 +203 0 0 0 +204 0 0 0 +205 0 0 0 +206 0 0 0 +207 0 0 0 +208 0 0 0 +209 0 0 0 +210 0 0 0 +211 0 0 0 +212 0 0 0 +213 0 0 0 +214 0 0 0 +215 0 0 0 +216 0 0 0 +217 0 0 0 +218 0 0 0 +219 0 0 0 +220 0 0 0 +221 0 0 0 +222 0 0 0 +223 0 0 0 +224 0 0 0 +225 0 0 0 +226 0 0 0 +227 0 0 0 +228 0 0 0 +229 0 0 0 +230 0 0 0 +231 0 0 0 +232 0 0 0 +233 0 0 0 +234 0 0 0 +235 0 0 0 +236 0 0 0 +237 0 0 0 +238 0 0 0 +239 0 0 0 +240 0 0 0 +241 0 0 0 +242 0 0 0 +243 0 0 0 +244 0 0 0 +245 0 0 0 +246 0 0 0 +247 0 0 0 +248 0 0 0 +249 0 0 0 +250 0 0 0 +251 0 0 0 +252 0 0 0 +253 0 0 0 +254 0 0 0 +255 0 0 0 diff --git a/colors/drgclr.clr b/colors/drgclr.clr new file mode 100644 index 0000000..314a8f5 --- /dev/null +++ b/colors/drgclr.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 996 996 996 + 2 0 589 640 + 3 792 0 89 + 4 511 257 144 + 5 785 914 613 + 6 535 199 500 + 7 996 914 0 + 8 652 882 882 + 9 996 718 718 + 10 851 699 835 + 11 816 816 816 + 12 808 640 554 + 13 0 0 0 + 14 0 0 0 + 15 0 0 0 + 16 0 0 0 + 17 0 0 0 + 18 0 0 0 + 19 0 0 0 + 20 0 0 0 + 21 0 0 0 + 22 0 0 0 + 23 0 0 0 + 24 0 0 0 + 25 0 0 0 + 26 0 0 0 + 27 0 0 0 + 28 0 0 0 + 29 0 0 0 + 30 0 0 0 + 31 0 0 0 + 32 0 0 0 + 33 0 0 0 + 34 0 0 0 + 35 0 0 0 + 36 0 0 0 + 37 0 0 0 + 38 0 0 0 + 39 0 0 0 + 40 0 0 0 + 41 0 0 0 + 42 0 0 0 + 43 0 0 0 + 44 0 0 0 + 45 0 0 0 + 46 0 0 0 + 47 0 0 0 + 48 0 0 0 + 49 0 0 0 + 50 0 0 0 + 51 0 0 0 + 52 0 0 0 + 53 0 0 0 + 54 0 0 0 + 55 0 0 0 + 56 0 0 0 + 57 0 0 0 + 58 0 0 0 + 59 0 0 0 + 60 0 0 0 + 61 0 0 0 + 62 0 0 0 + 63 0 0 0 + 64 0 0 0 + 65 0 0 0 + 66 0 0 0 + 67 0 0 0 + 68 0 0 0 + 69 0 0 0 + 70 0 0 0 + 71 0 0 0 + 72 0 0 0 + 73 0 0 0 + 74 0 0 0 + 75 0 0 0 + 76 0 0 0 + 77 0 0 0 + 78 0 0 0 + 79 0 0 0 + 80 0 0 0 + 81 0 0 0 + 82 0 0 0 + 83 0 0 0 + 84 0 0 0 + 85 0 0 0 + 86 0 0 0 + 87 0 0 0 + 88 0 0 0 + 89 0 0 0 + 90 0 0 0 + 91 0 0 0 + 92 0 0 0 + 93 0 0 0 + 94 0 0 0 + 95 0 0 0 + 96 0 0 0 + 97 0 0 0 + 98 0 0 0 + 99 0 0 0 + 100 0 0 0 + 101 0 0 0 + 102 0 0 0 + 103 0 0 0 + 104 0 0 0 + 105 0 0 0 + 106 0 0 0 + 107 0 0 0 + 108 0 0 0 + 109 0 0 0 + 110 0 0 0 + 111 0 0 0 + 112 0 0 0 + 113 0 0 0 + 114 0 0 0 + 115 0 0 0 + 116 0 0 0 + 117 0 0 0 + 118 0 0 0 + 119 0 0 0 + 120 0 0 0 + 121 0 0 0 + 122 0 0 0 + 123 0 0 0 + 124 0 0 0 + 125 0 0 0 + 126 0 0 0 + 127 0 0 0 + 128 0 0 0 + 129 0 0 0 + 130 0 0 0 + 131 0 0 0 + 132 0 0 0 + 133 0 0 0 + 134 0 0 0 + 135 0 0 0 + 136 0 0 0 + 137 0 0 0 + 138 0 0 0 + 139 0 0 0 + 140 0 0 0 + 141 0 0 0 + 142 0 0 0 + 143 0 0 0 + 144 0 0 0 + 145 0 0 0 + 146 0 0 0 + 147 0 0 0 + 148 0 0 0 + 149 0 0 0 + 150 0 0 0 + 151 0 0 0 + 152 0 0 0 + 153 0 0 0 + 154 0 0 0 + 155 0 0 0 + 156 0 0 0 + 157 0 0 0 + 158 0 0 0 + 159 0 0 0 + 160 0 0 0 + 161 0 0 0 + 162 0 0 0 + 163 0 0 0 + 164 0 0 0 + 165 0 0 0 + 166 0 0 0 + 167 0 0 0 + 168 0 0 0 + 169 0 0 0 + 170 0 0 0 + 171 0 0 0 + 172 0 0 0 + 173 0 0 0 + 174 0 0 0 + 175 0 0 0 + 176 0 0 0 + 177 0 0 0 + 178 0 0 0 + 179 0 0 0 + 180 0 0 0 + 181 0 0 0 + 182 0 0 0 + 183 0 0 0 + 184 0 0 0 + 185 0 0 0 + 186 0 0 0 + 187 0 0 0 + 188 0 0 0 + 189 0 0 0 + 190 0 0 0 + 191 0 0 0 + 192 0 0 0 + 193 0 0 0 + 194 0 0 0 + 195 0 0 0 + 196 0 0 0 + 197 0 0 0 + 198 0 0 0 + 199 0 0 0 + 200 0 0 0 + 201 0 0 0 + 202 0 0 0 + 203 0 0 0 + 204 0 0 0 + 205 0 0 0 + 206 0 0 0 + 207 0 0 0 + 208 0 0 0 + 209 0 0 0 + 210 0 0 0 + 211 0 0 0 + 212 0 0 0 + 213 0 0 0 + 214 0 0 0 + 215 0 0 0 + 216 0 0 0 + 217 0 0 0 + 218 0 0 0 + 219 0 0 0 + 220 0 0 0 + 221 0 0 0 + 222 0 0 0 + 223 0 0 0 + 224 0 0 0 + 225 0 0 0 + 226 0 0 0 + 227 0 0 0 + 228 0 0 0 + 229 0 0 0 + 230 0 0 0 + 231 0 0 0 + 232 0 0 0 + 233 0 0 0 + 234 0 0 0 + 235 0 0 0 + 236 0 0 0 + 237 0 0 0 + 238 0 0 0 + 239 0 0 0 + 240 0 0 0 + 241 0 0 0 + 242 0 0 0 + 243 0 0 0 + 244 0 0 0 + 245 0 0 0 + 246 0 0 0 + 247 0 0 0 + 248 0 0 0 + 249 0 0 0 + 250 0 0 0 + 251 0 0 0 + 252 0 0 0 + 253 0 0 0 + 254 0 0 0 + 255 0 0 0 diff --git a/colors/ega.clr b/colors/ega.clr new file mode 100644 index 0000000..ced8633 --- /dev/null +++ b/colors/ega.clr @@ -0,0 +1,17 @@ + 0 0 0 0 BLACK + 1 1000 0 0 RED + 2 0 1000 0 GREEN + 3 666 666 1000 BLUE + 4 1000 1000 0 YELLOW + 5 1000 0 1000 VIOLET + 6 0 1000 1000 CYAN + 7 666 666 666 GRAY + 8 1000 666 0 ORANGE + 9 666 333 0 BROWN + 10 0 666 0 DK.GREEN + 11 0 0 1000 DK.BLUE + 12 666 666 0 DK.YELLOW + 13 666 0 666 DK.VIOLET + 14 0 666 666 DK.CYAN + 15 1000 1000 1000 WHITE + \ No newline at end of file diff --git a/colors/fort.clr b/colors/fort.clr new file mode 100644 index 0000000..be6ec09 --- /dev/null +++ b/colors/fort.clr @@ -0,0 +1,12 @@ + 0 0 0 0 + 1 1000 0 0 + 2 666 666 666 + 3 333 701 0 + 4 0 800 1000 + 5 498 1000 0 + 6 0 498 1000 + 7 392 392 392 + 8 0 0 0 + 9 1000 1000 1000 +255 1000 1000 1000 + \ No newline at end of file diff --git a/colors/lesson.clr b/colors/lesson.clr new file mode 100644 index 0000000..d0f24b8 --- /dev/null +++ b/colors/lesson.clr @@ -0,0 +1,17 @@ + 0 0 0 0 + 1 1000 0 0 + 2 1000 1000 0 + 3 1000 666 666 + 4 0 666 0 + 5 666 666 0 + 6 0 666 666 + 7 666 0 666 + 8 666 666 666 + 9 1000 1000 0 + 10 333 666 1000 + 11 0 666 1000 + 12 333 666 0 + 13 333 333 333 + 14 666 666 666 + 15 1000 1000 1000 + \ No newline at end of file diff --git a/colors/luse.clr b/colors/luse.clr new file mode 100644 index 0000000..ab29772 --- /dev/null +++ b/colors/luse.clr @@ -0,0 +1,11 @@ +0 0 0 0 +1 0 1000 0 +2 1000 1000 0 +3 500 500 0 +4 1000 0 1000 +5 500 0 500 +6 0 1000 1000 +7 0 500 500 +8 1000 1000 1000 +9 500 500 500 + \ No newline at end of file diff --git a/colors/names.clr b/colors/names.clr new file mode 100644 index 0000000..741b1dc --- /dev/null +++ b/colors/names.clr @@ -0,0 +1,25 @@ + -1 0 0 0 BLACK + -1 1000 1000 1000 WHITE + -1 0 850 0 GREEN + -1 850 0 0 RED + -1 0 0 850 BLUE + -1 1000 1000 0 YELLOW + -1 1000 0 1000 MAGENTA + -1 0 1000 1000 CYAN + -1 0 1000 0 LT.GREEN + -1 0 498 0 DK.GREEN + -1 0 0 500 DK.BLUE + -1 0 0 1000 LT.BLUE + -1 500 0 0 DK.RED + -1 1000 0 0 LT.RED + -1 666 666 666 GRAY + -1 392 392 392 DK.GRAY + -1 1000 498 0 ORANGE + -1 333 701 0 OLIVE + -1 749 498 0 TAN + -1 666 0 666 PURPLE + -1 701 400 0 BROWN + -1 850 600 298 PEACH + -1 1000 666 666 PINK + -1 1000 800 600 SAND + diff --git a/colors/pal100.clr b/colors/pal100.clr new file mode 100644 index 0000000..7aa71d3 --- /dev/null +++ b/colors/pal100.clr @@ -0,0 +1,256 @@ + 0 600 600 600 + 1 0 396 396 + 2 0 549 549 + 3 0 698 698 + 4 0 847 847 + 5 0 1000 1000 + 6 98 819 996 + 7 196 678 996 + 8 298 576 996 + 9 396 517 996 + 10 498 498 1000 + 11 376 0 376 + 12 533 0 533 + 13 686 0 686 + 14 843 0 843 + 15 1000 0 1000 + 16 996 98 909 + 17 996 196 839 + 18 996 298 788 + 19 996 396 756 + 20 1000 498 749 + 21 0 0 196 + 22 0 0 396 + 23 0 0 596 + 24 0 0 796 + 25 0 0 1000 + 26 152 66 929 + 27 282 137 858 + 28 380 207 788 + 29 454 278 717 + 30 349 349 647 + 31 196 196 0 + 32 396 396 0 + 33 596 596 0 + 34 796 796 0 + 35 1000 1000 0 + 36 929 929 66 + 37 858 858 137 + 38 788 788 207 + 39 717 717 278 + 40 647 647 349 + 41 0 196 0 + 42 0 396 0 + 43 0 596 0 + 44 0 796 0 + 45 0 1000 0 + 46 78 917 78 + 47 156 839 156 + 48 239 756 239 + 49 317 678 317 + 50 400 596 400 + 51 196 0 0 + 52 396 0 0 + 53 596 0 0 + 54 796 0 0 + 55 1000 0 0 + 56 917 78 78 + 57 839 156 156 + 58 756 239 239 + 59 678 317 317 + 60 596 400 400 + 61 247 749 749 + 62 247 635 749 + 63 247 525 749 + 64 247 415 749 + 65 247 301 749 + 66 301 247 749 + 67 415 247 749 + 68 525 247 749 + 69 635 247 749 + 70 749 247 749 + 71 749 247 647 + 72 749 247 549 + 73 749 247 450 + 74 749 247 352 + 75 749 247 254 + 76 749 349 247 + 77 749 447 247 + 78 749 549 247 + 79 749 647 247 + 80 749 749 247 + 81 647 749 247 + 82 423 749 247 + 83 247 749 298 + 84 247 749 521 + 85 247 749 749 + 86 396 164 0 + 87 596 247 0 + 88 796 329 0 + 89 1000 415 0 + 90 1000 529 196 + 91 94 94 94 + 92 200 200 200 + 93 294 294 294 + 94 400 400 400 + 95 494 494 494 + 96 592 592 592 + 97 694 694 694 + 98 792 792 792 + 99 894 894 894 +100 992 992 992 +101 0 498 1000 +102 0 1000 1000 +103 749 498 0 +104 0 850 27 +105 666 0 666 +106 701 400 0 +107 850 600 298 +108 1000 666 666 +109 1000 800 600 +110 0 800 1000 +111 0 1000 800 +112 392 392 392 +113 1000 250 250 +114 1000 666 333 +115 333 333 1000 +116 0 333 1000 +117 1000 333 0 +118 749 250 0 +119 749 94 94 +120 0 0 0 +121 1000 1000 1000 +122 1000 1000 0 +123 1000 0 1000 +124 666 666 666 +125 1000 498 0 +126 1000 0 0 +127 498 1000 0 +128 0 498 0 +129 333 701 0 +130 0 0 1000 +131 0 498 1000 +132 0 1000 1000 +133 749 498 0 +134 0 850 0 +135 666 0 666 +136 701 400 0 +137 850 600 298 +138 1000 666 666 +139 1000 800 600 +140 0 800 1000 +141 0 1000 800 +142 392 392 392 +143 1000 250 250 +144 1000 666 333 +145 333 333 1000 +146 0 333 1000 +147 1000 333 0 +148 749 250 27 +149 749 94 94 +150 0 0 27 +151 1000 1000 1000 +152 1000 1000 0 +153 1000 0 1000 +154 666 666 666 +155 1000 498 0 +156 1000 0 11 +157 498 1000 0 +158 0 498 0 +159 333 701 0 +160 0 0 1000 +161 0 498 1000 +162 0 1000 1000 +163 749 498 0 +164 0 850 0 +165 666 0 666 +166 701 400 0 +167 850 600 298 +168 1000 666 666 +169 1000 800 600 +170 0 800 1000 +171 0 1000 800 +172 392 392 392 +173 1000 250 250 +174 1000 666 333 +175 333 333 1000 +176 0 333 1000 +177 1000 333 0 +178 749 250 27 +179 749 94 94 +180 0 0 0 +181 1000 1000 1000 +182 1000 1000 0 +183 1000 0 1000 +184 666 666 666 +185 1000 498 0 +186 1000 0 0 +187 498 1000 0 +188 0 498 0 +189 333 701 0 +190 0 0 1000 +191 0 498 1000 +192 0 1000 1000 +193 749 498 0 +194 0 850 27 +195 666 0 666 +196 701 400 0 +197 850 600 298 +198 1000 666 666 +199 1000 800 600 +200 0 800 1000 +201 0 1000 800 +202 392 392 392 +203 1000 250 250 +204 1000 666 333 +205 333 333 1000 +206 749 250 0 +207 749 94 94 +208 0 0 11 +209 1000 1000 1000 +210 1000 1000 0 +211 1000 0 1000 +212 666 666 666 +213 1000 498 0 +214 1000 0 0 +215 498 1000 0 +216 0 498 0 +217 333 701 0 +218 0 0 1000 +219 0 498 1000 +220 0 1000 1000 +221 749 498 0 +222 0 850 0 +223 666 0 666 +224 701 400 0 +225 850 600 298 +226 1000 666 666 +227 1000 800 600 +228 0 800 1000 +229 0 1000 800 +230 392 392 392 +231 1000 250 250 +232 1000 666 333 +233 333 333 1000 +234 0 333 1000 +235 1000 333 0 +236 749 250 0 +237 749 94 94 +238 0 0 0 +239 1000 1000 1000 +240 1000 1000 0 +241 1000 0 1000 +242 666 666 666 +243 1000 498 0 +244 1000 27 0 +245 498 1000 0 +246 0 498 0 +247 333 701 0 +248 0 0 1000 +249 0 498 1000 +250 0 1000 1000 +251 749 498 0 +252 0 850 0 +253 666 0 666 +254 701 400 0 +255 0 0 0 diff --git a/colors/pal24.clr b/colors/pal24.clr new file mode 100644 index 0000000..580d5fa --- /dev/null +++ b/colors/pal24.clr @@ -0,0 +1,26 @@ + 0 1000 1000 1000 white + 1 0 1000 1000 cyan + 2 1000 0 1000 magenta + 3 1000 1000 0 yellow + 4 0 0 0 black + 5 500 1000 1000 med. cyan + 6 1000 500 1000 med. magenta + 7 1000 1000 500 med. yellow + 8 500 500 500 grey + 9 750 1000 1000 lt. cyan + 10 1000 750 1000 lt. magenta + 11 1000 1000 750 lt. yellow + 12 750 750 750 lt. grey + 13 240 240 240 dark grey + 14 240 1000 1000 dark cyan + 15 1000 1000 1000 white + 16 1000 0 0 red + 17 0 1000 0 green + 18 0 0 1000 blue + 19 1000 500 500 med. red + 20 500 1000 500 med. green + 21 500 500 1000 med. blue + 22 1000 750 750 lt. red + 23 750 1000 750 lt. green + 24 750 750 1000 lt. blue + \ No newline at end of file diff --git a/colors/pal255.clr b/colors/pal255.clr new file mode 100644 index 0000000..6b1e29d --- /dev/null +++ b/colors/pal255.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 62 62 62 + 2 129 129 129 + 3 196 196 196 + 4 262 262 262 + 5 329 329 329 + 6 396 396 396 + 7 462 462 462 + 8 529 529 529 + 9 596 596 596 + 10 662 662 662 + 11 729 729 729 + 12 796 796 796 + 13 862 862 862 + 14 929 929 929 + 15 996 996 996 + 16 0 0 0 + 17 62 0 0 + 18 129 0 0 + 19 196 0 0 + 20 262 0 0 + 21 329 0 0 + 22 396 0 0 + 23 462 0 0 + 24 529 0 0 + 25 596 0 0 + 26 662 0 0 + 27 729 0 0 + 28 796 0 0 + 29 862 0 0 + 30 929 0 0 + 31 1000 0 0 + 32 0 0 0 + 33 62 3 0 + 34 129 15 0 + 35 196 39 0 + 36 262 70 0 + 37 329 109 0 + 38 396 156 0 + 39 462 215 0 + 40 529 282 0 + 41 596 356 0 + 42 662 443 0 + 43 729 537 0 + 44 796 639 0 + 45 862 749 0 + 46 929 870 0 + 47 1000 1000 0 + 48 0 0 0 + 49 0 62 0 + 50 0 129 0 + 51 0 196 0 + 52 0 262 0 + 53 0 329 0 + 54 0 396 0 + 55 0 462 0 + 56 0 529 0 + 57 0 596 0 + 58 0 662 0 + 59 0 729 0 + 60 0 796 0 + 61 0 862 0 + 62 0 929 0 + 63 0 1000 0 + 64 0 0 0 + 65 0 62 62 + 66 0 129 129 + 67 0 196 196 + 68 0 262 262 + 69 0 329 329 + 70 0 396 396 + 71 0 462 462 + 72 0 529 529 + 73 0 596 596 + 74 0 662 662 + 75 0 729 729 + 76 0 796 796 + 77 0 862 862 + 78 0 929 929 + 79 0 1000 1000 + 80 0 0 0 + 81 0 0 62 + 82 0 0 129 + 83 0 0 196 + 84 0 0 262 + 85 0 0 329 + 86 0 0 396 + 87 0 0 462 + 88 0 0 529 + 89 0 0 596 + 90 0 0 662 + 91 0 0 729 + 92 0 0 796 + 93 0 0 862 + 94 0 0 929 + 95 0 0 1000 + 96 0 0 0 + 97 62 0 62 + 98 129 0 129 + 99 196 0 196 +100 262 0 262 +101 329 0 329 +102 396 0 396 +103 462 0 462 +104 529 0 529 +105 596 0 596 +106 662 0 662 +107 729 0 729 +108 796 0 796 +109 862 0 862 +110 929 0 929 +111 1000 0 1000 +112 372 121 121 +113 501 137 137 +114 643 137 137 +115 792 129 129 +116 898 168 168 +117 941 266 266 +118 976 376 376 +119 1000 498 498 +120 372 372 121 +121 501 501 137 +122 643 643 137 +123 792 792 129 +124 898 898 168 +125 941 941 266 +126 976 976 376 +127 1000 1000 498 +128 121 372 121 +129 137 501 137 +130 137 643 137 +131 129 792 129 +132 168 898 168 +133 266 941 266 +134 376 976 376 +135 498 1000 498 +136 121 372 372 +137 137 501 501 +138 137 643 643 +139 129 792 792 +140 168 898 898 +141 266 941 941 +142 376 976 976 +143 498 1000 1000 +144 121 121 372 +145 137 137 501 +146 137 137 643 +147 129 129 792 +148 168 168 898 +149 266 266 941 +150 376 376 976 +151 498 498 1000 +152 372 121 372 +153 501 137 501 +154 643 137 643 +155 792 129 792 +156 898 168 898 +157 941 266 941 +158 976 376 976 +159 1000 498 1000 +160 309 247 184 +161 435 317 203 +162 572 392 207 +163 729 462 196 +164 847 533 219 +165 913 603 298 +166 964 678 388 +167 1000 749 498 +168 247 309 184 +169 317 435 203 +170 392 572 207 +171 462 729 196 +172 533 847 219 +173 603 913 298 +174 678 964 388 +175 498 1000 749 +176 184 309 247 +177 203 435 317 +178 207 572 392 +179 196 729 462 +180 219 847 533 +181 298 913 603 +182 388 964 678 +183 498 1000 749 +184 184 247 309 +185 203 317 435 +186 207 392 572 +187 196 462 729 +188 219 533 847 +189 298 603 913 +190 388 678 964 +191 498 749 1000 +192 247 184 309 +193 317 203 435 +194 392 207 572 +195 462 196 729 +196 533 219 847 +197 603 298 913 +198 678 388 964 +199 749 498 1000 +200 298 98 98 +201 415 137 137 +202 533 176 176 +203 650 215 215 +204 756 270 270 +205 796 388 388 +206 835 505 505 +207 874 623 623 +208 298 298 98 +209 415 415 137 +210 533 533 176 +211 650 650 215 +212 756 756 270 +213 796 796 388 +214 835 835 505 +215 874 874 623 +216 98 298 98 +217 137 415 137 +218 176 533 176 +219 215 650 215 +220 270 756 270 +221 388 796 388 +222 505 835 505 +223 623 874 623 +224 98 298 298 +225 137 415 415 +226 176 533 533 +227 215 650 650 +228 270 756 756 +229 388 796 796 +230 505 835 835 +231 623 874 874 +232 98 98 298 +233 137 137 415 +234 176 176 533 +235 215 215 650 +236 270 270 756 +237 388 388 796 +238 505 505 835 +239 623 623 874 +240 298 98 298 +241 415 137 415 +242 533 176 533 +243 650 215 650 +244 756 270 756 +245 796 388 796 +246 835 505 835 +247 874 623 874 +248 396 196 0 +249 513 254 0 +250 627 313 0 +251 741 368 0 +252 854 427 0 +253 968 482 0 +254 996 541 82 +255 996 596 196 diff --git a/colors/rainbow.clr b/colors/rainbow.clr new file mode 100644 index 0000000..43f4840 --- /dev/null +++ b/colors/rainbow.clr @@ -0,0 +1,257 @@ + 0 0 0 0 + 1 243 0 258 + 2 235 0 266 + 3 227 0 274 + 4 219 0 282 + 5 211 0 290 + 6 203 0 298 + 7 196 0 305 + 8 188 0 313 + 9 180 0 321 + 10 172 0 329 + 11 164 0 337 + 12 156 0 345 + 13 149 0 352 + 14 141 0 360 + 15 133 0 368 + 16 125 0 376 + 17 117 0 384 + 18 109 0 392 + 19 101 0 400 + 20 94 0 407 + 21 86 0 415 + 22 78 0 423 + 23 70 0 431 + 24 62 0 439 + 25 54 0 447 + 26 47 0 454 + 27 39 0 462 + 28 31 0 470 + 29 23 0 478 + 30 15 0 486 + 31 7 0 494 + 32 0 0 501 + 33 0 15 494 + 34 0 31 486 + 35 0 47 478 + 36 0 62 470 + 37 0 78 462 + 38 0 94 454 + 39 0 109 447 + 40 0 125 439 + 41 0 141 431 + 42 0 156 423 + 43 0 172 415 + 44 0 188 407 + 45 0 203 400 + 46 0 219 392 + 47 0 235 384 + 48 0 250 376 + 49 0 266 368 + 50 0 282 360 + 51 0 298 352 + 52 0 313 345 + 53 0 329 337 + 54 0 345 329 + 55 0 360 321 + 56 0 376 313 + 57 0 392 305 + 58 0 407 298 + 59 0 423 290 + 60 0 439 282 + 61 0 454 274 + 62 0 470 266 + 63 0 486 258 + 64 0 501 250 + 65 11 509 243 + 66 23 517 235 + 67 35 525 227 + 68 47 533 219 + 69 58 541 211 + 70 70 549 203 + 71 82 556 196 + 72 98 564 188 + 73 109 572 180 + 74 121 580 172 + 75 133 588 164 + 76 145 596 156 + 77 156 603 149 + 78 168 611 141 + 79 180 619 133 + 80 196 627 125 + 81 207 635 117 + 82 219 643 109 + 83 231 650 101 + 84 243 658 94 + 85 254 666 86 + 86 266 674 78 + 87 278 682 70 + 88 294 690 62 + 89 305 698 54 + 90 317 705 47 + 91 329 713 39 + 92 341 721 31 + 93 352 729 23 + 94 364 737 15 + 95 376 745 7 + 96 392 752 0 + 97 407 756 0 + 98 427 764 0 + 99 447 772 0 +100 466 780 0 +101 486 788 0 +102 505 796 0 +103 521 803 0 +104 541 811 0 +105 560 819 0 +106 580 827 0 +107 600 835 0 +108 619 843 0 +109 635 850 0 +110 654 858 0 +111 674 866 0 +112 694 874 0 +113 713 882 0 +114 733 890 0 +115 752 898 0 +116 768 905 0 +117 788 913 0 +118 807 921 0 +119 827 929 0 +120 847 937 0 +121 866 945 0 +122 882 952 0 +123 901 960 0 +124 921 968 0 +125 941 976 0 +126 960 984 0 +127 980 992 0 +128 1000 1000 0 +129 1000 980 0 +130 1000 960 0 +131 1000 941 0 +132 1000 921 0 +133 1000 901 0 +134 1000 882 0 +135 1000 866 0 +136 1000 847 0 +137 1000 827 0 +138 1000 807 0 +139 1000 788 0 +140 1000 768 0 +141 1000 752 0 +142 1000 733 0 +143 1000 713 0 +144 1000 694 0 +145 1000 674 0 +146 1000 654 0 +147 1000 635 0 +148 1000 619 0 +149 1000 600 0 +150 1000 580 0 +151 1000 560 0 +152 1000 541 0 +153 1000 521 0 +154 1000 505 0 +155 1000 486 0 +156 1000 466 0 +157 1000 447 0 +158 1000 427 0 +159 1000 407 0 +160 1000 392 0 +161 1000 376 11 +162 1000 364 23 +163 1000 352 35 +164 1000 341 47 +165 1000 329 58 +166 1000 317 70 +167 1000 305 82 +168 1000 294 98 +169 1000 278 109 +170 1000 266 121 +171 1000 254 133 +172 1000 243 145 +173 1000 231 156 +174 1000 219 168 +175 1000 207 180 +176 1000 196 196 +177 1000 180 207 +178 1000 168 219 +179 1000 156 231 +180 1000 145 243 +181 1000 133 254 +182 1000 121 266 +183 1000 109 278 +184 1000 98 294 +185 1000 82 305 +186 1000 70 317 +187 1000 58 329 +188 1000 47 341 +189 1000 35 352 +190 1000 23 364 +191 1000 11 376 +192 1000 0 392 +193 988 0 400 +194 980 0 411 +195 968 0 419 +196 960 0 431 +197 952 0 439 +198 941 0 450 +199 933 0 458 +200 925 0 470 +201 913 0 478 +202 905 0 490 +203 898 0 498 +204 886 0 509 +205 878 0 517 +206 870 0 529 +207 858 0 537 +208 850 0 549 +209 843 0 556 +210 831 0 568 +211 823 0 576 +212 815 0 588 +213 803 0 596 +214 796 0 607 +215 788 0 615 +216 776 0 627 +217 768 0 635 +218 760 0 647 +219 749 0 654 +220 741 0 666 +221 733 0 674 +222 721 0 686 +223 713 0 694 +224 705 0 705 +225 694 0 690 +226 682 0 674 +227 674 0 662 +228 662 0 647 +229 650 0 631 +230 643 0 619 +231 631 0 603 +232 623 0 592 +233 611 0 576 +234 600 0 560 +235 592 0 549 +236 580 0 533 +237 568 0 517 +238 560 0 505 +239 549 0 490 +240 541 0 478 +241 529 0 462 +242 549 0 447 +243 509 0 435 +244 498 0 419 +245 486 0 403 +246 478 0 392 +247 466 0 376 +248 458 0 364 +249 447 0 349 +250 435 0 333 +251 427 0 321 +252 415 0 305 +253 403 0 290 +254 396 0 278 +255 1000 1000 1000 + \ No newline at end of file diff --git a/colors/random.clr b/colors/random.clr new file mode 100644 index 0000000..763cc23 --- /dev/null +++ b/colors/random.clr @@ -0,0 +1,256 @@ + 0 0 0 0 + 1 1000 1000 1000 + 2 1000 0 1000 + 3 1000 1000 0 + 4 1000 0 1000 + 5 666 666 666 + 6 1000 498 0 + 7 1000 0 0 + 8 498 1000 0 + 9 0 498 0 + 10 333 701 0 + 11 0 0 1000 + 12 0 498 1000 + 13 0 1000 1000 + 14 749 498 0 + 15 0 850 0 + 16 666 0 666 + 17 701 400 0 + 18 850 600 298 + 19 1000 666 666 + 20 1000 800 600 + 21 0 800 1000 + 22 0 1000 800 + 23 392 392 392 + 24 1000 250 250 + 25 1000 666 333 + 26 333 333 1000 + 27 0 333 1000 + 28 1000 333 27 + 29 749 250 0 + 30 749 94 94 + 31 0 0 0 + 32 1000 1000 1000 + 33 1000 1000 0 + 34 1000 0 1000 + 35 666 666 666 + 36 1000 498 0 + 37 1000 0 0 + 38 498 1000 0 + 39 0 498 0 + 40 333 701 0 + 41 0 0 1000 + 42 0 498 1000 + 43 0 1000 1000 + 44 749 498 0 + 45 0 850 0 + 46 666 0 666 + 47 701 400 0 + 48 850 600 298 + 49 1000 666 666 + 50 1000 800 600 + 51 0 800 1000 + 52 0 1000 800 + 53 392 392 392 + 54 1000 250 250 + 55 1000 666 333 + 56 333 333 1000 + 57 0 333 1000 + 58 1000 333 0 + 59 749 250 0 + 60 749 94 94 + 61 0 0 0 + 62 1000 1000 1000 + 63 1000 1000 0 + 64 1000 0 1000 + 65 666 666 666 + 66 1000 498 11 + 67 1000 0 0 + 68 498 1000 0 + 69 0 498 0 + 70 333 701 0 + 71 0 0 1000 + 72 0 0 1000 + 73 0 498 1000 + 74 0 1000 1000 + 75 749 498 0 + 76 0 850 27 + 77 666 0 666 + 78 701 400 0 + 79 850 600 298 + 80 1000 666 666 + 81 1000 800 600 + 82 0 800 1000 + 83 0 1000 800 + 84 392 392 392 + 85 1000 250 250 + 86 1000 666 333 + 87 333 333 1000 + 88 0 333 1000 + 89 1000 333 0 + 90 749 250 0 + 91 1000 1000 0 + 92 749 94 94 + 93 1000 0 1000 + 94 666 666 666 + 95 1000 498 0 + 96 1000 0 0 + 97 498 1000 0 + 98 0 498 11 + 99 0 0 1000 +100 333 701 27 +101 0 498 1000 +102 0 1000 1000 +103 749 498 0 +104 0 850 27 +105 666 0 666 +106 701 400 0 +107 850 600 298 +108 1000 666 666 +109 1000 800 600 +110 0 800 1000 +111 0 1000 800 +112 392 392 392 +113 1000 250 250 +114 1000 666 333 +115 333 333 1000 +116 0 333 1000 +117 1000 333 0 +118 749 250 0 +119 749 94 94 +120 0 0 0 +121 1000 1000 1000 +122 1000 1000 0 +123 1000 0 1000 +124 666 666 666 +125 1000 498 0 +126 1000 0 0 +127 498 1000 0 +128 0 498 0 +129 333 701 0 +130 0 0 1000 +131 0 498 1000 +132 0 1000 1000 +133 749 498 0 +134 0 850 0 +135 666 0 666 +136 701 400 0 +137 850 600 298 +138 1000 666 666 +139 1000 800 600 +140 0 800 1000 +141 0 1000 800 +142 392 392 392 +143 1000 250 250 +144 1000 666 333 +145 333 333 1000 +146 0 333 1000 +147 1000 333 0 +148 749 250 27 +149 749 94 94 +150 0 0 27 +151 1000 1000 1000 +152 1000 1000 0 +153 1000 0 1000 +154 666 666 666 +155 1000 498 0 +156 1000 0 11 +157 498 1000 0 +158 0 498 0 +159 333 701 0 +160 0 0 1000 +161 0 498 1000 +162 0 1000 1000 +163 749 498 0 +164 0 850 0 +165 666 0 666 +166 701 400 0 +167 850 600 298 +168 1000 666 666 +169 1000 800 600 +170 0 800 1000 +171 0 1000 800 +172 392 392 392 +173 1000 250 250 +174 1000 666 333 +175 333 333 1000 +176 0 333 1000 +177 1000 333 0 +178 749 250 27 +179 749 94 94 +180 0 0 0 +181 1000 1000 1000 +182 1000 1000 0 +183 1000 0 1000 +184 666 666 666 +185 1000 498 0 +186 1000 0 0 +187 498 1000 0 +188 0 498 0 +189 333 701 0 +190 0 0 1000 +191 0 498 1000 +192 0 1000 1000 +193 749 498 0 +194 0 850 27 +195 666 0 666 +196 701 400 0 +197 850 600 298 +198 1000 666 666 +199 1000 800 600 +200 0 800 1000 +201 0 1000 800 +202 392 392 392 +203 1000 250 250 +204 1000 666 333 +205 333 333 1000 +206 749 250 0 +207 749 94 94 +208 0 0 11 +209 1000 1000 1000 +210 1000 1000 0 +211 1000 0 1000 +212 666 666 666 +213 1000 498 0 +214 1000 0 0 +215 498 1000 0 +216 0 498 0 +217 333 701 0 +218 0 0 1000 +219 0 498 1000 +220 0 1000 1000 +221 749 498 0 +222 0 850 0 +223 666 0 666 +224 701 400 0 +225 850 600 298 +226 1000 666 666 +227 1000 800 600 +228 0 800 1000 +229 0 1000 800 +230 392 392 392 +231 1000 250 250 +232 1000 666 333 +233 333 333 1000 +234 0 333 1000 +235 1000 333 0 +236 749 250 0 +237 749 94 94 +238 0 0 0 +239 1000 1000 1000 +240 1000 1000 0 +241 1000 0 1000 +242 666 666 666 +243 1000 498 0 +244 1000 27 0 +245 498 1000 0 +246 0 498 0 +247 333 701 0 +248 0 0 1000 +249 0 498 1000 +250 0 1000 1000 +251 749 498 0 +252 0 850 0 +253 666 0 666 +254 701 400 0 +255 1000 1000 1000 diff --git a/dll/Makefile b/dll/Makefile new file mode 100644 index 0000000..da04b2b --- /dev/null +++ b/dll/Makefile @@ -0,0 +1,47 @@ +CC=gcc +FGIS_HOME=/usr/lib/fgis +CFLAGS=-g -Wall -pedantic -fPIC\ + -I/usr/openwin/include -I/usr/local/include -I../include \ + -DFGIS_HOME=\"${FGIS_HOME}\" +LDFLAGS=-L../lib -L/usr/openwin/lib -L/usr/local/lib +LOADLIBES=-ldl -lm -lepp -lX11 -ltcl8.0 -ltk8.0 + +OBJS=\ +fgisInit.o\ +fgisMisc.o\ +fgisPalette.o\ +fgisRaster.o\ +fgisPlanchet.o\ +fgisEppCalc.o\ +fgisEppDraw.o\ +fgisVector.o\ +fgisPatterns.o\ +fgisProjection.o +SRC=\ +RCS/fgisInit.c,v\ +RCS/fgisMisc.c,v\ +RCS/fgisPalette.c,v\ +RCS/fgisRaster.c,v\ +RCS/fgisVector.c,v\ +RCS/fgisPlanchet.c,v\ +RCS/fgisEppCalc.c,v\ +RCS/fgisEppDraw.c,v\ +RCS/fgisVector.c,v\ +RCS/fgisPatterns.c,v\ +RCS/fgisProjection.c,v\ +RCS/fgis.h,v\ +RCS/fgisInt.h,v + +RCS/%,v : % + ci $< +%.E : %.c + gcc ${CFLAGS} -E $< > $* +all: fgis.so +fgis.so: ${OBJS} +# cc -G ${OBJS} ../lib/*.o -o fgis.so -lm -ltcl8.0 -L/usr/local/lib + gcc -shared -o fgis.so ${OBJS} ../lib/*.o -lm -ltcl8.0 +rcs: ${SRC} +test: fgis.so + echo load ./fgis.so|wish +clean: + rm -f ${OBJS} fgis.so diff --git a/dll/fgis.h b/dll/fgis.h new file mode 100644 index 0000000..06500b3 --- /dev/null +++ b/dll/fgis.h @@ -0,0 +1,122 @@ +#ifndef FGIS_H +#define FGIS_H + +#include +#include +#include +#include "fgisInt.h" + + +#define CACHE_THRESHOLD 4000000L +/* maximum size of cache, allowed for raster files */ + +#define MAX_PALETTE_SIZE 20480 +/* The size of palette file wihch never would be exceeded + (256 lines, 80 chars each - is it enough?) + */ + +/* This header file contain all definition of routines, + which implements EPTcl commands. Neccessary for Eptcl_Init + */ + +void Fgis_DefDeleteProc(ClientData client_data); +/* Empty command delete proc */ + +/* Argument parsing and checking*/ + +int Fgis_GetInt(Tcl_Interp *interp,int argc,char **argv,int index, + int min, int max,int *result, char *name); +/* Fetches int argument from argv array at index, checking for its presence, + format and range. Puts into result. name is descriptive name for errir + reporting + */ +int Fgis_GetLimits(Tcl_Interp *interp,char *list,double *X1,double *Y1, + double *X2,double *Y2); +/* Parses four element list of doubles, representing region on map or + window */ +int Fgis_CkArgs(Tcl_Interp *interp,int cond, char *cmd, char *msg); +/* + * Palette - related procedures + */ +PATTERNS Fgis_GetPatterns(Tcl_Interp *interp,char *name); + +int Fgis_Palette(ClientData data,Tcl_Interp *interp,int argc,char **argv); +/* palette object construction */ + +int Fgis_PaletteObj(ClientData data,Tcl_Interp *interp,int argc,char **argv); +/* Command procedure for palette object command */ + +void Fgis_DeletePalette(ClientData data); +/* all the same for pattern sets */ +int Fgis_CreatePatterns(ClientData data,Tcl_Interp *interp,int argc,char **argv); +int Fgis_PatternObj(ClientData data,Tcl_Interp *interp, int argc, char **argv); +void Fgis_DeletePatterns(ClientData data); +/* + * Accessible from other modules Returns palette, corresponding with + * tcl command name in interp. Don't try to fool it, passing non palette-object + * command! Returns NULL and leaves message in interpreter in case of error. + */ +PALETTE Fgis_GetPalette(Tcl_Interp *interp, char *name); +/* Allows to fetch palette, if its Tcl name is given */ + +/* Raster related stuff */ + +int Fgis_Raster(ClientData data,Tcl_Interp *interp,int argc,char **argv); +/* implements raster command */ +int Fgis_RasterObj(ClientData data,Tcl_Interp *interp,int argc, char **argv); +/* implements object command of raster objects */ + +void Fgis_DeleteRaster(ClientData data); +/* delete proc for command raster - desroys global tables*/ +void Fgis_DeleteRasterObj(ClientData data); +/* delete proc for raster object command - destroys raster itself*/ + +RASTER_OBJECT Fgis_GetRaster(Tcl_Interp *interp, char *name); +/* vector related stuff */ + +int Fgis_Vector(ClientData data,Tcl_Interp *interp,int argc,char **argv); +int Fgis_VectorObj(ClientData data,Tcl_Interp *interp,int argc,char **argv); +void Fgis_DeleteVectorObj(ClientData data); + +/* projection object */ +int Fgis_Projection(ClientData data,Tcl_Interp* interp,int argc, char **argv); +int Fgis_ProjObject(ClientData data,Tcl_Interp* interp,int argc, char **argv); +void Fgis_DeleteProj(ClientData data); +/* Drawing objects */ + +int Fgis_RasterImage(ClientData data,Tcl_Interp* interp,int argc, + char **argv); + + +/* Planchet methods */ +int Fgis_MapX(ClientData data,Tcl_Interp* interp,int argc, char **argv); +int Fgis_MapY(ClientData data,Tcl_Interp* interp,int argc, char **argv); +int Fgis_ScrY(ClientData data,Tcl_Interp* interp,int argc, char **argv); +int Fgis_ScrX(ClientData data,Tcl_Interp* interp,int argc, char **argv); +int Fgis_Fit(ClientData data,Tcl_Interp* interp,int argc, char **argv); + +/* Functions for access planchet from C code */ +double Fgis_AltX(Tcl_Interp *interp,char *planchet ,int x); +double Fgis_AltY(Tcl_Interp *interp,char *planchet ,int y); +int Fgis_PlanchetX(Tcl_Interp *interp, char *planchet ,double x); +int Fgis_PlanchetY(Tcl_Interp *interp, char *planchet ,double y); +int Fgis_ValidPlanchet(Tcl_Interp *interp, char *planchet); +int Fgis_CreateObjectCommand(Tcl_Interp *interp,char *prefix, + Tcl_CmdProc *proc,ClientData data, Tcl_CmdDeleteProc deleteProc); +/* handy defines */ + +/* Makes dynamically allocante copy of string, using Tcl allocator */ +#define stralloc(x) (strcpy(Tcl_Alloc(strlen(x)+1),x)) + +/* Body of non-implemented procedure. When it goes away, I would be + VERY happy*/ +#define NOT_YET {Tcl_SetResult(interp,"Not implemented yet",TCL_STATIC); return TCL_ERROR;} + +/* Set result and return error */ +#define ERROR_MESSAGE(msg,mode) {Tcl_SetResult(interp,msg,mode);return TCL_ERROR;} + +/* Set result and return success */ +#define RETURN(value,mode) {Tcl_SetResult(interp,value,mode);return TCL_OK;} +/* Given raster object, returns EPP* */ +#define epp(x) (x->file->e) +#endif diff --git a/dll/fgisCount.c b/dll/fgisCount.c new file mode 100644 index 0000000..26522cb --- /dev/null +++ b/dll/fgisCount.c @@ -0,0 +1,34 @@ +#include +#include +#include +#include "fgisInt.h" +#include "fgis.h" +/* + * This file is part of fGIS C library + * fgisCount.c Various routines to perform area counting on rasters + */ +int count_to_array(Tcl_Interp *interp,RASTER_OBJECT raster,char *array /* here geomerty spec should be*/) +{ EPP *e=epp(raster); + int *accumulate; + RECLASS r=raster->reclass; + int v,i,j,size=Fgis_RasterMax(raster)+1; + accumulate=calloc(ize,sizeof(int)); +/* loop should vary according to geometry specifications */ + for (i=e->fr;ilr;i++) + for (j=e->fc;jlc;j++) { + v=epp_get(e,j,i); + if (v!=e->offsite)) { + accumulate[r[v]]++; + } + } + for (i=0;icell_area,result); + sprintf(index,"%d",i); + Tcl_SetVar2(interp,array.index,result) + } + } + free(accumulate) + return TCL_OK; +} diff --git a/dll/fgisEppCalc.c b/dll/fgisEppCalc.c new file mode 100644 index 0000000..2aa6c16 --- /dev/null +++ b/dll/fgisEppCalc.c @@ -0,0 +1,161 @@ +#include +#include +#include +#include "fgisInt.h" +#include "fgis.h" +/* + * fgisEppCalc.c + * + * Functions to deal with raster objects, which are not directly interfaces + * TCL + */ + +/* Some global variables are defined here */ +/* Default reclass - property of reclass command + Something wrong with it. It should be allocated once, not upon each + intiialization of package + */ +RECLASS def_reclass; +/* Points to list of all open rasters. This is good, becouse it would + correctly handle access to open rasters from multiple interptreters + */ +XEPP *first_raster=NULL; +RASTER_OBJECT firstobject=NULL; +/* + * Returns maximal value of raster, using current reclass + * + */ +int Fgis_RasterMax(RASTER_OBJECT handle) +{ + EPP *e=epp(handle); + int max,i; + if(handle->reclass==def_reclass) + max=e->max; + else { + max=0; + for(i=e->min;i<=e->max;i++) + if (i!=e->offsite&&handle->reclass[i]>max) + max=handle->reclass[i]; + } + return max; +} + +/* + * Returns minimal value of raster, taking into account current reclass + * + */ +int Fgis_RasterMin(RASTER_OBJECT handle) +{ + EPP *e=epp(handle); + int min,i; + if(handle->reclass==def_reclass) + min=e->min; + else { + min=65535; + for(i=e->min;i<=e->min;i++) + if (i!=e->offsite&&handle->reclass[i]reclass[i]; + } + return min; +} +/* + * Reopens file in new mode. Returns 0 on success, non-zero on failure. + * If fails, file remains open in old mode. + */ + + +/* + * Creates new XEPP object from open EPP* object. + * + */ + +XEPP* Fgis_NewXEPP(EPP *file,char *filename) +{XEPP* xptr; + + xptr=malloc(sizeof(XEPP)); + xptr->e=file; + xptr->linkcount=1; + xptr->filename=stralloc(filename); + xptr->next=first_raster; + xptr->editable=1; + first_raster=xptr; + return xptr; +} +/* + * Opens existing epp file. If file already opened, returns pointer + * to it + */ + +XEPP* Fgis_OpenXEPP(char *filename,EPP *(*openfunc)(char *)) +{ + EPP* epp_ptr; + XEPP * xptr=first_raster; + RASTER_OBJECT obj; + int reclass_size; + while (xptr) { + if (!strcmp(xptr->filename,filename)) break; + xptr=xptr->next; + } + + if (!xptr) { + /* îÅÔ ÔÁËÏÇÏ × ÔÁÂÌÉÃÅ, ÏÔËÒÙ×ÁÅÍ ÎÏ×ÙÊ*/ + epp_ptr=openfunc(filename); + if (!epp_ptr) { + return NULL; + } + xptr=Fgis_NewXEPP(epp_ptr,filename); + xptr->editable=(openfunc==load_epp); + + } else { + (xptr->linkcount)++; + /* if it was open in read-only mode and now we want it to + be read-write */ + if (!xptr->editable&&openfunc==load_epp) { + /* close it */ + close_epp(xptr->e); + /* reopen for read-write */ + xptr->e=load_epp(filename); + /* if failed, restore it back in readonly mode and return NULL*/ + if (!xptr->e) { + xptr->e=open_epp(filename); + xptr->linkcount--; + return NULL; + } + /* fix reclass tables for all objects, which refers to this file*/ + reclass_size=1<<(xptr->e->kind); + for (obj=firstobject;obj!=NULL;obj=obj->next) { + if (obj->file==xptr) { + obj->reclass=realloc(obj->reclass,reclass_size*sizeof(short)); + } + } + + } + } + return xptr; + +} + +/* + * Gets rid of XEPP object (if only reference - deletes, otherwise + * decrements link count) + */ + +void Fgis_CloseXEPP(XEPP* file) +{ + file->linkcount--; + if(!file->linkcount) { + /* Remove it from list */ + if (first_raster==file) { + first_raster=file->next; + } else { + XEPP* tmp=first_raster; + while (tmp->next!=file) + tmp=tmp->next; + tmp->next=file->next; + } + /* Close eppfile */ + close_epp(file->e); + free(file->filename); + free(file); + } +} diff --git a/dll/fgisEppDraw.c b/dll/fgisEppDraw.c new file mode 100644 index 0000000..7cd9017 --- /dev/null +++ b/dll/fgisEppDraw.c @@ -0,0 +1,364 @@ +#include +#include +#include +#include +#include +#include "fgis.h" +#include "fgisInt.h" +unsigned short int *border_buffer1, *border_buffer2, *bbuf_ptr1, *bbuf_ptr2; + +void init_border (int width, int offsite) +{ + int i; + border_buffer1 = (unsigned short int *)Tcl_Alloc ( + (width + 1) * sizeof (unsigned short int)); + border_buffer2 = (unsigned short int *)Tcl_Alloc ( + (width + 1) * sizeof (unsigned short int)); + *border_buffer2 = offsite; + for (i = 0, bbuf_ptr1 = border_buffer1; i <= width; i++, bbuf_ptr1++) + *bbuf_ptr1 = offsite; +} +void new_border_row () +{ + unsigned short int *tmp; + tmp = border_buffer1; + border_buffer1 = border_buffer2; + border_buffer2 = tmp; + bbuf_ptr1 = border_buffer1; + bbuf_ptr2 = border_buffer2; + +} int check_border (int class) +{ + *(++bbuf_ptr1) = class; + bbuf_ptr2++; + return *bbuf_ptr2 != class || *(bbuf_ptr1 - 1) != + class || *(bbuf_ptr2 - 1) != class; +} +void done_border () +{ + Tcl_Free ((char*)border_buffer1); + Tcl_Free ((char*)border_buffer2); +} +/* + +òÉÓÕÅÔ ÕËÁÚÁÎÎÙÊ ËÕÓÏË ÒÁÓÔÒÁ (× ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔÁÈ) +*/ + +int Fgis_MakePhotoImage (Tk_PhotoHandle imghandle, + int xl, int yb, int xr, int yt, + double XL, double XR, double YT, double YB, + RASTER_OBJECT handle, + int border,/* 0 - ÎÉÞÅÇÏ, 1, ÐÒÉ ÎÅÓÏ×ÐÁÄÅÎÉÉ + Ã×ÅÔÏ× ÐÏÓÌÅ ÒÅËÌÁÓÓÁ, + 2 - ÐÒÉ ÎÅÓÏ×ÐÁÄÅÎÉÉ Ã×ÅÔÏ× + ÂÁÚÏ×ÏÇÏ ÒÁÓÔÒÁ + */ + PALETTE palette, + int bordercolor, + int mapmode /* 0 - wrap (x&0xFF), -1 x>255?255:x, + >0 map + */ + ) +{ + Tk_PhotoImageBlock block = + {NULL, 0, 1, 1000, 4, +#ifdef LSB_FIRST + {2, 1, 0} +#else + {1, 2, 3} +#endif + }; + + EPP *e = epp (handle); + RECLASS r = handle->reclass; + int width = xr - xl, height = yb - yt; + int *irow, *rp; + int *pal; + int *coltab, *col; + double W_Alt = XR - XL, H_Alt = YB - YT; + int x, y, row, i, j, maxclass=0; + int max_base_class; + int base ; +/* + ÜÔÏ ÂÕÆÅÒ ÄÌÑ ÈÒÁÎÅÎÉÑ ÐÒÏÒÉÓÏ×ÁÎÎÏÊ ÓÔÒÏËÉ + */ + irow =(int *) Tcl_Alloc (width * sizeof (int)); + max_base_class = epp_table_size (e) + 1; +/* + íÁÓÓÉ× ×ÈÏÄÏ× × ÐÁÌÉÔÒÕ ÄÌÑ ËÌÁÓÓÏ× ÂÁÚÏ×ÏÇÏ ÒÁÓÔÒÁ + */ + pal = (int *)Tcl_Alloc(max_base_class * sizeof (int)); + if (mapmode > 0) + maxclass = Fgis_RasterMax (handle); + for (i = 0; i < max_base_class; i++) { + int index; + index = r[i]; + if (index > 255) + switch (mapmode) { + case 0: + index &= 0xFF; + break; /* + wrap + */ + case -1: + index = 255; + break; /* + no wrap + */ + default: + index = index * mapmode / maxclass; + if (i == e->offsite) + index = 255; + + } + pal[i] = palette[index]; + if (i!= e->offsite) + pal[i]|=0xff000000; + } + /* + ÜÔÏ ÔÁÂÌÉÃÁ ÐÏÒÑÄËÏ×ÙÈ ÎÏÍÅÒÏ× ËÏÌÏÎÏË × epp-ÆÁÊÌÅ, ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÈ + ÐÉËÓÅÌÁÍ ÒÁÓÔÒÁ + */ + coltab =(int *) Tcl_Alloc (width * sizeof (int)); + for (i = xl, col = coltab, j = 0; i < xr; i++, j++, col++) { + *col = epp_col (e, W_Alt * (j + 0.5) / width + XL); + } +/* + úÁÐÏÌÎÉÍ ÔÅ ÐÏÌÑ ÓÔÒÕËÔÕÒÙ block, ËÏÔÏÒÙÅ ÍÙ ÎÅ ÍÏÇÌÉ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ + */ + block.pixelPtr = (unsigned char *) irow; + block.width = width; + block.pitch = width * sizeof (int); + if (border) { + if (border == 1) + init_border (width, r[e->offsite]); + else + init_border (width, e->offsite); + } + /* ðÏÞÉÓÔÉÍ image */ + Tk_PhotoBlank(imghandle); + for (y = yt, i = 0; y < yb; y++, i++) { + row = epp_row (e, H_Alt * (i + 0.5) / height + YT); + if (border) + new_border_row (); + for (x = xl, j = 0, col = coltab, rp = irow; x < xr; + j++, col++, rp++, x++) { + base = epp_get (e, *col, row); + if (border) { + if (border == 1 ? check_border (r[base]) : + check_border (base)) { + *rp = bordercolor; + continue; + } + } + *rp = pal[base]; + } + Tk_PhotoPutBlock (imghandle, &block, xl, y, width, 1); + } + done_border (); + Tcl_Free ((char *)pal); + Tcl_Free ((char *)irow); + Tcl_Free ((char *)coltab); + return TCL_OK; + +} + +void Fgis_PlotPatterns(Tcl_Interp *interp, + char *bitmap_image, + int xl,int yb,int xr,int yt, + double XL, double XR,double YT,double YB, + RASTER_OBJECT handle, + int bordermode, PATTERNS patterns,XColor* color,int mapmode) +{ /* NOT IMPLEMENTED YET */ +} +void Fgis_PlotSymbols(Tcl_Interp *interp, + char *bitmap_image, + int xl,int yb,int xr,int yt, + double XL,double XR,double YT,double YB, + RASTER_OBJECT handle, + PATTERNS patterns, XColor* color, + int mapmode) +{ /*NOT IMPLEMENTED YET*/ + +} +/* + * Fgis_RasterImage + * - implementation of command fgisRasterColorImage and + * fgisRasterBWImage + */ +EXPORT(int, Fgis_RasterImage) (ClientData data, Tcl_Interp *interp, + int argc, char **argv) +{ + int listc; char **listv; /* for parsing result of $planchet bbox $item */ + Tk_PhotoHandle imghandle=NULL; + int colorplot=(int)data; /* how to distinguish between color and bw */ + char *bitmap_image=NULL; + enum {PATTERNS_MODE,SYMBOLS_MODE} symbolmode=PATTERNS_MODE; + int mapmode=0; + int bordercolor=0; + int bordermode=((int)data)?0:1; + PATTERNS patterns=NULL; + PALETTE palette=default_palette; + RASTER_OBJECT raster; + int i; + int xl=0,yt=0,xr,yb,imgstartx,imgstarty; + double XL,YT,XR,YB; + XColor *clr; + Tk_Window canvas=Tk_NameToWindow(interp,argv[2],Tk_MainWindow(interp)); + + clr=Tk_GetColor(interp,canvas,"black"); + if (Fgis_CkArgs(interp,argc<5, + argv[0],"raster planchet item ?options?")) + return TCL_ERROR; + if (!Fgis_ValidPlanchet(interp,argv[2])) + return TCL_ERROR; + if (Tcl_VarEval(interp,argv[2]," bbox ",argv[3],NULL)!=TCL_OK) + return TCL_ERROR; + if (Tcl_SplitList(interp,interp->result,&listc,&listv)!=TCL_OK) + return TCL_ERROR; + imgstartx=atol(listv[0]); + imgstarty=atol(listv[1]); + xr=atol(listv[2]); + yb=atol(listv[3]); + XL=Fgis_AltX(interp,argv[2],imgstartx); + XR=Fgis_AltX(interp,argv[2],xr+1); + YT=Fgis_AltY(interp,argv[2],imgstarty); + YB=Fgis_AltY(interp,argv[2],yb+1); + xr-=imgstartx; + yb-=imgstarty; + Tcl_Free((char *)listv); + if (Tcl_VarEval(interp,argv[2]," itemcget ",argv[3]," -image",NULL)!=TCL_OK) + return TCL_ERROR; + if (colorplot) { + imghandle=Tk_FindPhoto(interp,interp->result); + if (!imghandle) { + Tcl_AppendResult(interp,"No valid image for item ",argv[3], + " in planchet ", argv[2],NULL); + return TCL_ERROR; + } + } else { + if (interp->result) + bitmap_image=stralloc(interp->result); + else { + Tcl_AppendResult(interp,"No valid image for item ",argv[3], + " in planchet ", argv[2],NULL); + return TCL_ERROR; + } + } + raster=Fgis_GetRaster(interp,argv[1]); + if (!raster) { + Tcl_AppendResult(interp,argv[1]," is not valid raster",NULL); + return TCL_ERROR; + } + +for(i=4;ired&0xff)<<16)|((clr->green&0xff)<<8)| + (clr->blue&0xff); + } + } else + if (!strcmp(argv[i],"-map")) { + if (mapmode) + ERROR_MESSAGE("Duplicate color remapping specification",TCL_STATIC); + i++; + if (!strcmp(argv[i],"wrap")) { + mapmode=0; + } else + if (!strcmp(argv[i],"none")) { + mapmode=-1; + } else + if (Fgis_GetInt(interp, argc, argv, ++i, 0, 256, &mapmode, + "color index") !=TCL_OK) { + return TCL_ERROR; + } + } else + if (!strcmp(argv[i],"-update")) { + double X1,Y1,X2,Y2; + int x1,y1,x2,y2; + if (++i==argc) + ERROR_MESSAGE("List of four doubles expected",TCL_STATIC); + if (Fgis_GetLimits(interp,argv[i],&X1,&Y1,&X2,&Y2)!=TCL_OK) + return TCL_ERROR; + x1=Fgis_PlanchetX(interp,argv[2],X1)-imgstartx; + x2=Fgis_PlanchetX(interp,argv[2],X2)-imgstartx; + if (x20) {xl=x1;XL=Fgis_AltX(interp,argv[2],x1+imgstartx);} + if (x20) {yt=y1;YT=Fgis_AltY(interp,argv[2],y1+imgstarty);} + if (y2 +#include +#include +#include +char *mapErrorExplanation[]={NULL, + "Coordinates outside physical borders of file", + "Raster is not editable", + "File read error", + "File write error", + "Memory exhaused", + "File access denied", + "File not found", + "File doesn't conform format", + "File creation error", + }; +/* + * Checks if given EPP file is open in read-write mode and + * given value is good class value for it. + * Should be called each time when one of drawing routines from + * this file is about to be called. + * Returns TCL_ERROR and leaves error message in interp->result + */ +int Fgis_RasterEditable(Tcl_Interp *interp,EPP *epp,char *rastername,int value) +{ if (!(epp->mode&MAP_LOADED)) { + Tcl_AppendResult(interp,"Raster ",rastername," is read-only",NULL); + return TCL_ERROR; + } + if (value>=(1<kind)) { + Tcl_SetResult(interp,"Value too large for this raster",TCL_STATIC); + return TCL_ERROR; + } + return TCL_OK; +} + +/* + * Modifies given cell. + * Return value: 0 on success, nonzero if error + * Side effects: modifies raster if arguments are good + * leaves error message in interp->result, if they are bad + */ +int Fgis_DrawCell(Tcl_Interp *interp,EPP* epp,double x,double y, int value) +{ + map_error=0; + epp_put(epp,epp_col(epp,x),epp_row(epp,y),value); + if (map_error) { + Tcl_SetResult(interp,mapErrorExplanation[map_error],TCL_STATIC); + map_error=0; + return TCL_ERROR; + } + return TCL_OK; +} + +/* + * Draws circle with center in given point and radius given in + * map units + * + */ +int Fgis_DrawCircle(Tcl_Interp *interp,EPP* epp,double x,double y,double r, + int value) +{ + return TCL_OK; +} + +/* + * Draws circle with center in given point and radius given in + * raster cells + * + */ +int Fgis_DrawCircleInt(Tcl_Interp *interp, EPP *epp, double x, double y, + int r, int value) +{ + return TCL_OK; +} +/* + * Draws filled rectangle + * + * + */ + +int Fgis_DrawBox(Tcl_Interp *interp, EPP *epp, double x1, double y1, + double x2, double y2, int value) +{int i, + row1=epp_row(epp,y1), + row2=epp_row(epp,y2), + col1=epp_col(epp,x1), + col2=epp_col(epp,x2); + if (row1fr) row1=epp->fr; + if (row2>=epp->lr) row2=epp->lr-1; + if (row1>row2) { + Tcl_SetResult(interp,mapErrorExplanation[ME_POINT_OUTSIDE],TCL_STATIC); + return TCL_ERROR; + } + map_error=0; + for (i=row1;i<=row2;i++) { + epp_putline(epp,col1,col2,i,value); + if (map_error) { + Tcl_SetResult(interp,mapErrorExplanation[map_error],TCL_STATIC); + map_error=0; + return TCL_ERROR; + } + } + return TCL_OK; +} +/* + * Draws rectangular frame with width, given in pixels + * + * + */ + +int Fgis_DrawFrame(Tcl_Interp *interp, EPP *epp, double x1, double y1, + double x2, double y2, int width, int value) +{ + return TCL_OK; +} +/* + * Draws polyline + * + */ +int Fgis_DrawLine(Tcl_Interp *interp, EPP *epp, int pointc, double *pointv, + int width, int value) +{ + + return TCL_OK; +} + +/* + * Draws filled polygon + * + */ +int Fgis_DrawPolygon(Tcl_Interp *interp, EPP *epp, int pointc, double *pointv, + int value) +{ + + return TCL_OK; +} +/* + * Fills area of raster until encounters different class than in starting + * point. Takes into account four neighbours (left, right, top, bottom) + * + */ +int Fgis_Fill4(Tcl_Interp *interp, EPP *epp, double x, double y, int value) +{ + + return TCL_OK; +} + +/* + * Fills area of raster until encounters given class + * Takes into account four neighbours (left, right, top, bottom) + * + */ +int Fgis_Fill4Until(Tcl_Interp *interp, EPP *epp, double x, double y, + int value, int stopValue) +{ + return TCL_OK; + +} + +/* + * Fills area of raster until encounters different class than in starting + * point. Takes into account eight neighbours (left, right, top, bottom + * and four diagonals) + */ +int Fgis_Fill8(Tcl_Interp *interp, EPP *epp, double x, double y, int value) +{ + return TCL_OK; +} + +/* + * Fills area of raster until encounters given class + * Takes into account eight neighbours (left, right, top, bottom + * and four diagonals) + */ +int Fgis_Fill8Until(Tcl_Interp *interp, EPP *epp, double x, double y, + int value, int stopValue) +{ + return TCL_OK; + +} + + diff --git a/dll/fgisEppEdit.h b/dll/fgisEppEdit.h new file mode 100644 index 0000000..e366d14 --- /dev/null +++ b/dll/fgisEppEdit.h @@ -0,0 +1,26 @@ +#ifndef FGIS_EDIT_H +#define FGIS_EDIT_H +extern char *mapErrorExplanation[]; + +int Fgis_RasterEditable(Tcl_Interp *interp,EPP *epp,char *rastername,int value); +int Fgis_DrawCell(Tcl_Interp *interp,EPP* epp,double x,double y, int value); + +int Fgis_DrawCircle(Tcl_Interp *interp,EPP* epp,double x,double y,double r, + int value); +int Fgis_DrawCircleInt(Tcl_Interp *interp, EPP *epp, double x, double y, + int r, int value); +int Fgis_DrawBox(Tcl_Interp *interp, EPP *epp, double x1, double y1, + double x2, double y2, int value); +int Fgis_DrawFrame(Tcl_Interp *interp, EPP *epp, double x1, double y1, + double x2, double y2, int width, int value); +int Fgis_DrawLine(Tcl_Interp *interp, EPP *epp, int pointc, double *pointv, + int width, int value); +int Fgis_DrawPolygon(Tcl_Interp *interp, EPP *epp, int pointc, double *pointv, + int value); +int Fgis_Fill4(Tcl_Interp *interp, EPP *epp, double x, double y, int value); +int Fgis_Fill4Until(Tcl_Interp *interp, EPP *epp, double x, double y, + int value, int stopValue); +int Fgis_Fill8(Tcl_Interp *interp, EPP *epp, double x, double y, int value); +int Fgis_Fill8Until(Tcl_Interp *interp, EPP *epp, double x, double y, + int value, int stopValue); +#endif diff --git a/dll/fgisInit.c b/dll/fgisInit.c new file mode 100644 index 0000000..59f2fd5 --- /dev/null +++ b/dll/fgisInit.c @@ -0,0 +1,126 @@ +/* + *fgisInit.c - + *initialization procedure for Fgis package + * Copyright (C) by SoftWeyr, 1997 + */ +#include +#include +#include +#include + +#include +#include +#include "fgis.h" + +int check_for_rc(Tcl_Interp *interp,char *home,char *path); +/* Global variables */ + +/* + * Initialization procedure for Environmental Planning Tcl extension + * Return value TCL_OK if success + * Side effects: + * defines commands raster vector palette fgisPlanchet_mapx fgisPlanchet_mapy + * fgisPlanchet_scrx fgisPlanchet_scry fgisPlanchet_fit defaultpalette + * defines default (1:1) reclass table + * defines fGIS_HOME variable to directory, containing fgis.rc + * Directories are searched in following order + * FGIS_HOME as defined in Makefile + * ~/lib/fgis + * executes fgis.rc + */ +EXPORT(int, Fgis_Init)(Tcl_Interp *interp) +{ + char *fGIS_HOME; + char buffer[1024]; +/* Defining commands */ + +/* Palette objects */ + if (!Tcl_CreateCommand(interp,"palette",Fgis_Palette,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"defaultpalette",Fgis_PaletteObj, + (ClientData)default_palette,Fgis_DeletePalette)) + return TCL_ERROR; +/* Pattern objects */ + if (!Tcl_CreateCommand(interp,"patterns",Fgis_CreatePatterns, + NULL,Fgis_DefDeleteProc)) + return TCL_ERROR; +/* Raster objects */ + if (!Tcl_CreateCommand(interp,"raster",Fgis_Raster, + NULL,Fgis_DeleteRaster)) + return TCL_ERROR; +/* Vector objects */ + if (!Tcl_CreateCommand(interp,"vector",Fgis_Vector,NULL,Fgis_DefDeleteProc)) + return TCL_ERROR; + /* Tk dependent fgis commands. Should eventually go into separate package*/ + /* Object Drawing */ + if (!Tcl_CreateCommand(interp,"fgisRasterColorImage",Fgis_RasterImage, + (ClientData)1,Fgis_DefDeleteProc)) return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"fgisRasterBWImage",Fgis_RasterImage, + NULL,Fgis_DefDeleteProc)) return TCL_ERROR; + /* planchet widget subcommands, written on C */ + if (!Tcl_CreateCommand(interp,"fgisPlanchet_mapx",Fgis_MapX,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"fgisPlanchet_mapy",Fgis_MapY,NULL, + Fgis_DefDeleteProc)) + + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"fgisPlanchet_scrx",Fgis_ScrX,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"fgisPlanchet_scry",Fgis_ScrY,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"fgisPlanchet_fit",Fgis_Fit,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + if (!Tcl_CreateCommand(interp,"projection",Fgis_Projection,NULL, + Fgis_DefDeleteProc)) + return TCL_ERROR; + + /* Searching for fgis.rc and executing it */ + /* First, check if fGIS_HOME already set */ + if ((fGIS_HOME=Tcl_GetVar(interp,"fGIS_HOME",TCL_GLOBAL_ONLY))==NULL) { + fGIS_HOME=buffer; + /* Check if compilied in default is valid */ + if (!check_for_rc(interp,fGIS_HOME,FGIS_HOME)&& +#ifdef __unix__ + !check_for_rc(interp,fGIS_HOME,"/usr/local/lib/fgis")&& + !check_for_rc(interp,fGIS_HOME,"/usr/lib/fgis")&& + !check_for_rc(interp,fGIS_HOME,"~/fgis") +#else + !check_for_rc(interp,fGIS_HOME,"C:/FGIS") && + !check_for_rc(interp,fGIS_HOME,"C:/Program Files/fGIS") && + !check_for_rc(interp,fGIS_HOME,"C:/TCL/LIB/fGIS") +#endif + ) { + Tcl_SetResult(interp,"Cannot determine fGIS home directory", + TCL_STATIC); + return TCL_ERROR; + }; + Tcl_SetVar(interp,"fGIS_HOME",fGIS_HOME,TCL_GLOBAL_ONLY); + } + + if (Tcl_EvalFile(interp,FGIS_HOME "/fgis.rc")!=TCL_OK) { + Tcl_SetResult(interp,"Error in initialization file",TCL_STATIC); + return TCL_ERROR; + } + /* Providing package for Tcl versions, which supports it */ +#if (TCL_MAJOR_VERSION>7)||((TCL_MAJOR_VERSION==7)&&(TCL_MINOR_VERSION>=5)) + Tcl_PkgProvide(interp,"Fgis","0.1"); +#endif + return TCL_OK; +} + +int check_for_rc (Tcl_Interp *interp,char *home,char *path) +{ char buffer[1024]; + int result; + sprintf(buffer,"file readable [file join {%s} fgis.rc]",path); + Tcl_Eval(interp,buffer); + if (Tcl_GetInt(interp,interp->result,&result)==TCL_OK&& result) { + strcpy(home,path); + return 1; + } + return 0; +} diff --git a/dll/fgisInt.h b/dll/fgisInt.h new file mode 100644 index 0000000..4a1caaa --- /dev/null +++ b/dll/fgisInt.h @@ -0,0 +1,72 @@ +#ifndef FGISINT_H +#define FGISINT_H +#include +#include +#include +typedef int *PALETTE; +extern PALETTE default_palette; + +/* raster related types and variables*/ + + +typedef struct XEPP { int linkcount; /*Count of links */ + char *filename; /* name of raster file */ + struct XEPP* next; /* to chain all open rasters + into list*/ + EPP *e; + int editable; + } XEPP; +typedef struct RASTER_OBJECT { XEPP *file; + RECLASS reclass; + struct RASTER_OBJECT *next; + } *RASTER_OBJECT ; + +extern XEPP *first_raster; /* This pointer intentionally made global. + even if there are serveral Tcl interpreters, + they all should share same list of open rasters*/ +extern RASTER_OBJECT firstobject; + +#define MAX_PATTERN_SIZE (32*256) + + +typedef struct PATTERNS { struct PATTERNS *next; /* patterns are linked in order + to be re-used */ + char *name; + int width,height; + unsigned int bits[MAX_PATTERN_SIZE]; + } *PATTERNS; +#define patternSize(width,height) ((height*256)*sizeof(int)+sizeof (struct PATTERNS)-MAX_PATTERN_SIZE*sizeof(int)) + + +extern PATTERNS def_patterns; + +int Fgis_RasterMin(RASTER_OBJECT handle); + +int Fgis_RasterMax(RASTER_OBJECT handle); + +void Fgis_CloseXEPP(XEPP *file); + +XEPP* Fgis_OpenXEPP(char *filename,EPP *(*openfunc)(char *)); + +XEPP* Fgis_NewXEPP(EPP* file, char *filename); + + +#define FGIS_INVALID_RECLASS ((RECLASS)0x1) +#define MAX_EPP_CLASS 65535 + +/* EXPORT macro to cope with ugly Win32 DDLs */ +#ifdef WIN32 +# if defined(_MSC_VER) +# define EXPORT(a,b) __declspec(dllexport) a b +# define DllEntryPoint DllMain +# else +# if defined(__BORLANDC__) +# define EXPORT(a,b) a _export b +# else +# define EXPORT(a,b) a b +# endif +# endif +#else /* ! WIN32 */ +# define EXPORT(a,b) a b +#endif /* WIN32 */ +#endif diff --git a/dll/fgisMisc.c b/dll/fgisMisc.c new file mode 100644 index 0000000..1056177 --- /dev/null +++ b/dll/fgisMisc.c @@ -0,0 +1,133 @@ +#include +#include +#include +#include "fgis.h" +/* + * Utility functions, I need to program fgis + * Copyright (c) Softweyr, 1997 + */ +/* + * If passed condition is true, puts standard error message, appended + * by msg argument to interp->result. + * Returns cond + * + */ +int Fgis_CkArgs(Tcl_Interp *interp,int cond,char *cmd, char *msg) +{ static char buffer[256]="Wrong # args. Should be "; + if (cond) { + Tcl_ResetResult(interp); + Tcl_AppendResult(interp,buffer,cmd," ",msg,NULL); + } + return cond; +} +/* + * Get integer value from command argument and checks it for valid range. + * ARGUMENTS: + * interp: Tcl interpreter to leave error message + * argc, argv - command arguments + * index - position of argument in question in argv + * min, max - range limits + * name - string name of parameter to report errors more clearly + * RETURNS: + * TCL_OK on success, TCL_ERROR on failure + * SIDE EFFECTS: + * Places read integer in location, specified by result + */ + +int Fgis_GetInt(Tcl_Interp *interp,int argc,char **argv,int index, + int min, int max,int *result, char *name) +{ + int tmp;/* Temporary place to hold result */ + char msg[1024]; /* place to format error messages */ + + if (index==argc) { + Tcl_SetResult(interp, "Integer value expected",TCL_STATIC); + return TCL_ERROR; + } + + if (Tcl_GetInt(interp,argv[index],&tmp)!=TCL_OK) + return TCL_ERROR; + if (tmp<=min||tmp>=max) { + sprintf(msg,"Invalid %s: %d. Should be between %d and %d", + name,tmp,min,max); + Tcl_SetResult(interp,msg,TCL_VOLATILE); + return TCL_ERROR; + } + *result=tmp; + return TCL_OK; +} +char *inttostr(long src,char *dest) +{ sprintf(dest,"%ld",src); + return dest; +} + +/* + * Searches for free command name with given prefix and creates command + * with it. Places name of command into interp->result + * Returns TCL_OK on success, TCL_ERROR otherwise + */ +int Fgis_CreateObjectCommand(Tcl_Interp *interp,char *prefix, + Tcl_CmdProc *proc,ClientData data,Tcl_CmdDeleteProc deleteProc) + +{ int num=0; + static char token[30],*numstart; + Tcl_CmdInfo info; + strcpy(token,prefix); + numstart=token+strlen(prefix); + while (1) { + inttostr(num,numstart); + if (Tcl_GetCommandInfo(interp,token,&info)) num++; else break; + } + Tcl_SetResult(interp,token,TCL_VOLATILE); + if (!Tcl_CreateCommand(interp,token,proc,data,deleteProc)) { + (*deleteProc)(data); return TCL_ERROR; + } else { + return TCL_OK; + } +} + + +/* + * Standard TclDeleteProc for commads, which have no ClientData + * Does nothing, successifully + */ +EXPORT(void, Fgis_DefDeleteProc)(ClientData clientdata) +{ +} + +/* + * Fgis_GetLimits - parses four-element list of doubles, putting them + * into four specified global variables + * ARGUMENTS: interp - Tcl interpreter to return error + * list - string to parse + * X1,Y1,X2,Y2 - double variables to put results + * RETURNS: TCL_OK on success, TCL_ERROR otherwise + * SIDE EFFECTS: Fills four double variables + */ +int Fgis_GetLimits(Tcl_Interp *interp,char *list,double *X1,double *Y1, + double *X2,double *Y2) +{ + int no_error;/* Temporary flag, to pass success around Tcl_Free */ + int listc; char **listv; /* for TclSplitList */ + double x1,y1,x2,y2; /* Temporary place for results to avoid overriding if + error occurs */ + + if(Tcl_SplitList(interp,list,&listc,&listv)==TCL_ERROR) + return TCL_ERROR; + if (listc!=4) { + Tcl_SetResult(interp,"Invalid limits list",TCL_STATIC); + Tcl_Free((char *)listv); + return TCL_ERROR; + } + no_error = (Tcl_GetDouble(interp,listv[0],&x1)==TCL_OK) && + (Tcl_GetDouble(interp,listv[1],&y1)==TCL_OK) && + (Tcl_GetDouble(interp,listv[2],&x2)==TCL_OK) && + (Tcl_GetDouble(interp,listv[3],&y2)==TCL_OK); + Tcl_Free((char*)listv); + if (no_error) { + *X1=x1; *Y1=y1; *X2=x2; *Y2=y2; + return TCL_OK; + } else { + return TCL_ERROR; + } +} diff --git a/dll/fgisPalette.c b/dll/fgisPalette.c new file mode 100644 index 0000000..d6e129d --- /dev/null +++ b/dll/fgisPalette.c @@ -0,0 +1,272 @@ +#include +#include +#include +#include +#include "fgis.h" +/* + * fgisclr.c - palette handling for Fgis + * Copyringht (C) by SoftWeyr, 1997 + */ +/* + * Global variables + */ + +/* + *# Default palette array + */ +int defarray[]={ +#include "defpal.h" +}; + +PALETTE default_palette=defarray; +/* + * Creates new palette. Optionally fills from existing palette. If no existing + * palette supplied, all colors will be white + */ + +PALETTE new_palette(PALETTE copy_from) +{ PALETTE new_p= (PALETTE)Tcl_Alloc(256*sizeof(int)); + if (copy_from) { + memcpy(new_p,copy_from,256*sizeof(int)); + } else { + int i,*c; + for (i=0,c=new_p;i<256;i++) + *(c++)=0xffffff; + } + return new_p; +} +/* + * Parses string, containing pallette in EPPL7 file format EPPL7 + */ +PALETTE parse_palette(Tcl_Interp *interp,char *string) +{ PALETTE pal; + int index,r,g,b; + char *start=string,*end, line[80]; + pal=new_palette(default_palette); + /* ASSIGNMENT INSIDE IF */ + while (( end=strchr(start,'\n'))) { + int n=(end-start); + if (n==0) continue; /*won't bother with empty lines */ + if (n>79) n=79; + strncpy(line,start,n); + start=end+1; + if (sscanf(line,"%d %d %d %d",&index,&r,&g,&b)!=4) { + Tcl_Free((char *)pal); + return NULL; + } + if (index>255||index<0) + continue; + pal[index]=(r*255/1000)<<16|(g*255/1000)<<8|(b*255/1000); + } ; + return pal; +} +/* + * Returns index entry of palette in form #RRGGBB + * + */ + + +char *Xcolor_string(PALETTE palette,int index) +{ int value; + static char buffer[24]; + if(index>=0&&index<255) + value=palette[index]; + else + value=palette[255]; + sprintf(buffer,"#%06x",value); + return buffer; +} +/* + * parses RGB specification in form #RRGGBB. + * Returns integer value or 0x1000000 in case of error. + */ +int ParseRGB(Tcl_Interp *interp,char *spec) +{ int val;char *endptr; + val= strtol(spec+1,&endptr,16); + if ((*endptr)||(spec[0]!='#')||(strlen(spec)!=7)) { + Tcl_SetResult(interp,"Only #RRGGBB color specification is supported", + TCL_STATIC); + return 0x1000000; + } + return val; +} +/* + * Implements "palette" fgis command. + * input - argv[1] subcommand, argv[2] parameter, if required. + * subcommands: + * read filename + * parse string + * copy palettename + * blank + * Returns (in interp result) - name of newly created palette + * Side effects: defines new Tcl command to handle this palette + */ +EXPORT(int, Fgis_Palette)(ClientData data,Tcl_Interp *interp,int argc,char **argv) +{ PALETTE pal; + if (argc<2) { + Tcl_SetResult(interp,"Wrong # of args. Should be palette command ?arg?", + TCL_STATIC); return TCL_ERROR; + } + if (!strcmp(argv[1],"read")) { + Tcl_Channel f; /* no comments */ + int size; /* return value from Tcl_Read. its size,yes but used just for + error checking */ + char buf[MAX_PALETTE_SIZE];/* place to hold readed file */ + + if (Fgis_CkArgs(interp,argc!=3,argv[0]," read filename")) return TCL_ERROR; + f=Tcl_OpenFileChannel(interp,argv[2],"r",0666); + if (!f) return TCL_ERROR; + size=Tcl_Read(f,buf,MAX_PALETTE_SIZE); + Tcl_Close(interp,f); + if (size==-1) {return TCL_ERROR;} + if (!(pal=parse_palette(interp,buf))) return TCL_ERROR; + } else if (!strcmp(argv[1],"parse")) { + if (Fgis_CkArgs(interp,argc!=3,argv[0]," parse string")) return TCL_ERROR; + if (!(pal=parse_palette(interp,argv[2]))) { + return TCL_ERROR; + } + } else if (!strcmp(argv[1],"set")) { + int listc,i;char **listv; + if (Fgis_CkArgs(interp,argc!=3,argv[0]," set list")) return TCL_ERROR; + pal=new_palette(default_palette); + if (TCL_ERROR==Tcl_SplitList(interp,argv[2],&listc,&listv)) + return TCL_ERROR; + for (i=0;i>16)*1000/255, + ((clr[i]>>8) & 0xFF)*1000/255, + (clr[i] & 0xff)*1000/255); + Tcl_AppendResult(interp,buffer,NULL); + } + return TCL_OK; + } else + if (!strcmp(argv[1],"get")) { + int index; + if (Fgis_CkArgs(interp,argc!=3,argv[0], + " get index")) + return TCL_ERROR; + if (Tcl_GetInt(interp,argv[2],&index)==TCL_ERROR) return TCL_ERROR; + if (index<0||index>255) { + Tcl_SetResult(interp,"#ffffff",TCL_STATIC); + } else { + Tcl_SetResult(interp,Xcolor_string(clr,index),TCL_VOLATILE); + } + return TCL_OK; + } + else + if (!strcmp(argv[1],"set")) { + int index,RGB; + if (read_only) { + Tcl_AppendResult(interp,argv[0]," is read only",NULL); + return TCL_ERROR; + } + if (Fgis_CkArgs(interp,argc!=4,argv[0], + " set index color")) + return TCL_ERROR; + if (Tcl_GetInt(interp,argv[2],&index)==TCL_ERROR) return TCL_ERROR; + if (index<0||index>255) { + Tcl_SetResult(interp, "Palette index must be from 0 to 255", + TCL_STATIC); + return TCL_ERROR; + } + if ((RGB=ParseRGB(interp,argv[3]))>0xFFFFFF) return TCL_ERROR; + clr[index]=RGB; + return TCL_OK; + } + else + if (!strcmp(argv[1],"list")) { + int i; + if (Fgis_CkArgs(interp,argc!=2,argv[0]," list")) + return TCL_ERROR; + for(i=0;i<256;i++) + { Tcl_AppendElement(interp,Xcolor_string(clr,i)); + } + return TCL_OK; + } + else + if (!strcmp(argv[1],"delete")) { + if (Fgis_CkArgs(interp,argc!=2,argv[0]," delete")) return TCL_ERROR; + if (read_only) { + Tcl_AppendResult(interp,buffer," is read only",NULL); + return TCL_ERROR; + } + Tcl_DeleteCommand(interp,argv[0]); + return TCL_OK; + } + else + { Tcl_SetResult(interp,"Wrong option. Should be one of print, get, set, " + " list, delete", TCL_STATIC); + return TCL_ERROR; + } + return TCL_OK; +} + +EXPORT(void, Fgis_DeletePalette)(ClientData data) +{ + if (data == default_palette) return; + Tcl_Free((char *)data); +} diff --git a/dll/fgisPatterns.c b/dll/fgisPatterns.c new file mode 100644 index 0000000..2f24267 --- /dev/null +++ b/dll/fgisPatterns.c @@ -0,0 +1,402 @@ +#include +#include +#include +#include +#include "fgis.h" +struct { struct PATTERNS* next; + char *name; + int width; + int height; + int bits[1]; + } empty_patterns={NULL,"empty",0,0,{0}}; + +/* WARNING - this is internal function from tkImgBmap.c which is + used here. It might not be exported from tk80.dll on Windows + and might changed in future releases. It is prototyped in + tkInt.h, but I prefer declare it explicitely in order to put this + warning comment here */ +char * TkGetBitmapData(Tcl_Interp *interp, char *string, + char *filename, int *widthPtr, int *heightPtr, + int *hotXPtr, int *hotYPtr); + +PATTERNS def_patterns=(PATTERNS)&empty_patterns; +PATTERNS first_patterns=(PATTERNS)&empty_patterns; + +/* Forward declarations of functions from this file*/ +PATTERNS Fgis_ParsePatterns(Tcl_Interp *interp,char *patterns); +PATTERNS new_patterns(int width,int height,char *name); +void print_patterns(Tcl_Interp *interp,PATTERNS ptn) ; +void make_xbm(Tcl_Interp *interp,int index,PATTERNS data,int width, + int height, int frame); +int parse_xbm(Tcl_Interp *interp,int index,char *data,PATTERNS ptn); + + + +EXPORT(PATTERNS, Fgis_GetPatterns)(Tcl_Interp *interp,char *name) +{ + if (name==NULL||name[0]=='\0') { + return def_patterns; + } else { + Tcl_CmdInfo info;char buffer[255]="Invalid pattern set name: "; + if (!Tcl_GetCommandInfo(interp,name,&info)) return NULL; + if (info.proc!=&Fgis_PatternObj) { + strcat(buffer,name); + Tcl_SetResult(interp,buffer,TCL_VOLATILE); + return NULL; + } + return (PATTERNS)(info.clientData); + } +} +/* + * Implementation of ``patterns'' command + * + */ +EXPORT(int, Fgis_CreatePatterns)(ClientData clientData, Tcl_Interp *interp, int argc, + char **argv) +{ PATTERNS ptn; + if (Fgis_CkArgs(interp,argc<2,argv[0],"command ?arg?")) { + return TCL_ERROR; + } + if (!strcmp(argv[1],"read")) { + FILE *f; + int size; + char *s; + if (Fgis_CkArgs(interp,argc!=3,argv[0],"read filename")) { + return TCL_ERROR; + } + if (!(f=fopen(argv[2],"rb"))) { + Tcl_AppendResult(interp,"Cannot open ",argv[2],": ", + Tcl_PosixError(interp),NULL); + return TCL_ERROR; + } + fseek(f,0,SEEK_END); + size=ftell(f); + fseek(f,0,SEEK_SET); + s=Tcl_Alloc(size+1); + fread(s,1,size,f); + fclose(f); + *(s+size)=0; + if (!(ptn=Fgis_ParsePatterns(interp,s))) { + Tcl_Free(s); + return TCL_ERROR; + } + Tcl_Free(s); + } else if (!strcmp(argv[1],"set")) { + if (Fgis_CkArgs(interp,argc!=3,argv[0],"read string")) { + return TCL_ERROR; + } + if (!(ptn=Fgis_ParsePatterns(interp,argv[2]))) + return TCL_ERROR; + } else if (!strcmp(argv[1],"blank")) { + int sizex,sizey; + if (Fgis_CkArgs(interp,argc<3||argc>4,argv[0],"blank sizex ?sizey?")) { + return TCL_ERROR; + } + if (Tcl_GetInt(interp,argv[2],&sizex)!=TCL_OK) { + return TCL_ERROR; + } + if (argc==4) { + if (Tcl_GetInt(interp,argv[3],&sizey)!=TCL_OK) { + return TCL_ERROR; + } + } else { + sizey=sizex; + } + if (sizex<0||sizex>32||sizey<0||sizey>32) { + Tcl_SetResult(interp,"pattern size should be in range 0 - 32", + TCL_STATIC); + return TCL_ERROR; + } + ptn=new_patterns(sizex,sizey,NULL); + } else if (!strcmp(argv[1],"copy")) { + PATTERNS old; + int size; + if (!(old=Fgis_GetPatterns(interp,argv[2]))) { + return TCL_ERROR; + } + ptn=new_patterns(old->width,old->height,old->name); + memmove(ptn,old,size); + } else { + Tcl_AppendResult(interp,"Wrong option. Should be one of ", + " set, read, copy, blank",NULL); + return TCL_ERROR; + } + return Fgis_CreateObjectCommand(interp,"pattern",Fgis_PatternObj, + (ClientData)ptn,Fgis_DeletePatterns); + +} + +/* + * Deletes pattern + * + */ +EXPORT(void, Fgis_DeletePatterns)(ClientData data) { + PATTERNS ptn=(PATTERNS) data; + if (ptn->name) Tcl_Free(ptn->name); + Tcl_Free((char *)ptn); +} +/* + * Implementation of pattern object command. + * + */ +EXPORT(int, Fgis_PatternObj)(ClientData data,Tcl_Interp *interp, int argc, char **argv) +{ if (Fgis_CkArgs(interp,argc<=1,argv[0],"option ?arg?")) { + return TCL_ERROR; + } + if (!strcmp(argv[1],"print")) { + if (Fgis_CkArgs(interp,argc!=2,argv[0],"print")) + return TCL_ERROR; + print_patterns(interp,(PATTERNS)data); + } else if (!strcmp(argv[1],"set")) { + int index; + if (Fgis_CkArgs(interp,argc!=4,argv[0],"set index dataString")) { + return TCL_ERROR; + } + if (Tcl_GetInt(interp,argv[2],&index)!=TCL_OK) { + return TCL_ERROR; + } + if (index<0||index>255) { + Tcl_SetResult(interp,"pattern index should be in 0..255 range", + TCL_STATIC); + return TCL_ERROR; + } + if (!parse_xbm(interp,index,argv[3],(PATTERNS)data)) { + return TCL_ERROR; + } + } else if (!strcmp(argv[1],"get")) { + int i,index,width,height,frame=0; + if (Fgis_CkArgs(interp,argc<3,argv[0],"index ?-width n? ?-height n? ?-frame bool?")) { + return TCL_ERROR; + } + if (Tcl_GetInt(interp,argv[2],&index)!=TCL_OK) { + return TCL_ERROR; + } + if (index<0||index>255) { + Tcl_SetResult(interp,"pattern index should be in 0..255 range", + TCL_STATIC); + return TCL_ERROR; + } + i=3; + width=((PATTERNS)data)->width; + height=((PATTERNS)data)->height; + while (i3,argv[0],"name ?new name?")) { + return TCL_ERROR; + } + if (argc==3) { + int len; + if (p->name) Tcl_Free(p->name); + len = strlen(argv[2]); + p->name=Tcl_Alloc(len>80?81:len+1); + strncpy(p->name,argv[2],80); + if (len>80) p->name[80]=0; + } + Tcl_SetResult(interp,p->name,TCL_VOLATILE); + } else if (!strcmp(argv[1],"delete")) { + if (Fgis_CkArgs(interp,argc!=2,argv[0],"delete")) return TCL_ERROR; + Tcl_DeleteCommand(interp,argv[0]); + } else { + Tcl_SetResult(interp,"invalid option. Should be one of name, print, get, set, delete",TCL_STATIC); + return TCL_ERROR; + } + return TCL_OK; +} +/* + * Parses string, which looks like content of EPPL symbol file and + * returns PATTERNS structure (or NULL, if there was parsing error) + * + */ +PATTERNS Fgis_ParsePatterns(Tcl_Interp *interp, char *str) { + PATTERNS ptn; + char namebuf[256]=""; + char hex[9] = {0,0,0,0,0,0,0,0,0}; + char *next_line,*p; + char *name; + int block_size,index, old_index; + unsigned int *bitptr; + int width,height; + + Tcl_SetResult(interp,"Invalid pattern file",TCL_STATIC); + if (sscanf(str,"%d %d%[^\n]",&width,&height,namebuf)<=2) { + return NULL; + } + if (width<-32||width>-1||height<-32||height>-1) { + return NULL; + } + width=-width; + height=-height; + name=namebuf+strlen(namebuf)-1; + while (name>=namebuf&&isspace(*name)) name--; + *(++name)=0; + next_line =strchr(str,'\n'); + if (!next_line) return NULL; + name=namebuf; + while(*name&&isspace(*name))name++; + + ptn=new_patterns(width,height,name); + block_size=width<=16?4:8; + while (*next_line&&*(++next_line)) { + while(*next_line&&isspace(*next_line)) next_line++; + if (!*next_line) break; + p=next_line; + index=strtol(next_line,&p,10); + if (!isspace(*p)) { + Fgis_DeletePatterns((ClientData)ptn); + return NULL; + } + p++; + if (index != old_index) { + bitptr=ptn->bits+index*height; + old_index = index; + } + while (*p&&*p!='\n' && *p!='\r') { + strncpy(hex,p,block_size); + p+=block_size; + *(bitptr++)=strtol(hex,NULL,16); + } + next_line=p; + } + Tcl_ResetResult(interp); + return ptn; +} + +PATTERNS new_patterns(int width,int height,char *name) { + PATTERNS p=(PATTERNS)Tcl_Alloc(patternSize(width,height)); + char *name_ptr=NULL; + + if (name && *name) { + name_ptr=Tcl_Alloc(strlen(name)+1); + strcpy(name_ptr,name); + } + p->width=width; + p->height=height; + p->next=NULL; + p->name=name_ptr; + memset(&p->bits,0,sizeof(int)*height*256); + return p; +} +/* + Puts in interp->result printable representation of pattern set + ptn in EPPL symbol file format + */ +void print_patterns(Tcl_Interp *interp,PATTERNS ptn) +{ int i,j,l;char *name=""; + unsigned int *a,*b; + char buffer[256],num[9]; + char *fmt=ptn->width>16?"%08X":"%04X"; + int d=ptn->width>16?8:4; + if (ptn->name) name=ptn->name; + sprintf(buffer,"%3d %3d %s\n",-ptn->width,-ptn->height,name); + Tcl_AppendResult(interp,buffer,NULL); + for (i=0,a=ptn->bits;i<=255;i++,a+=ptn->height) { + /* Check if pattern is empty */ + unsigned int sum=0; + for (j=0,b=a;jheight;j++,b++) sum|=*b; + if (!sum) continue; + /* print pattern */ + sprintf(buffer,"%3d ",i); + for (j=0,l=0,b=a;jheight;j++,b++) { + sprintf(num,fmt,*b); + strcat(buffer,num); + l+=d; + if (l>=64) { + l=0; + Tcl_AppendResult(interp,buffer,"\n",NULL); + buffer[4]=0; + } + } + if (l) Tcl_AppendResult(interp,buffer,"\n",NULL); + } +} +/* + Parses xbm file given by data argiment and replaces by it pattern N + index in pattern set ptn + returns 0 and leaves error message in interp if something goes wrong. +*/ +int parse_xbm(Tcl_Interp *interp,int index,char *data,PATTERNS ptn) { +char *bitmap,*b; +int width,height,hotX,hotY; +int mask, i,j, bm; +unsigned int *p; + bitmap = TkGetBitmapData(interp, data, NULL, &width, &height, + &hotX, &hotY); + if (!bitmap) return 0; + if (width!=ptn->width || height!=ptn->height) { + ckfree(bitmap); + Tcl_SetResult(interp,"bitmap size doesn't match pattern size", + TCL_STATIC); + return 0; + } + b=bitmap; + /*Now copy bitmap data into patterns structure*/ + for (i=0,p=ptn->bits+index*ptn->height;iheight;i++,p++) { + *p=0; + for(j=0,mask=1<<(ptn->width-1), bm=1;jwidth;j++,mask>>=1) { + if (*b&bm) *p|=mask; + bm<<=1; + if (bm>0x80) { + b++; bm=1; + } + } + if (bm!=1) b++; + } + ckfree(bitmap); + return 1; +} +void make_xbm(Tcl_Interp *interp, int index,PATTERNS data,int width, + int height, int frame) +{ char buffer[256]; + int i,j,row,bit; + unsigned int mask, *bitp, current; + int value; + sprintf(buffer,"#define pattern_width %d\n#define pattern_height %d\n" + "static char pattern_bits[] = {\n",width,height); + Tcl_AppendResult(interp,buffer,NULL); + for (i=0,row=33;i=data->height) { + row=0; + bitp=data->bits+(index*(data->height)); + } + current=*bitp; + value=0; + for (j=0,mask=0,bit=1;j>=1) { + if (!mask) { + mask=1<<(data->width-1); + } + if (current & mask) value|=bit; + + if ((bit<<=1)==0x100) { + sprintf(buffer," 0x%02x,",value); + Tcl_AppendResult(interp,buffer,NULL); + bit=1; + value=0; + } + } + if (bit==1) { + Tcl_AppendResult(interp,"\n",NULL); + } else { + sprintf(buffer,"0x%02x,\n",value); + Tcl_AppendResult(interp,buffer,NULL); + } + } + Tcl_AppendResult(interp,"};\n",NULL); +} diff --git a/dll/fgisPlanchet.c b/dll/fgisPlanchet.c new file mode 100644 index 0000000..c194bd4 --- /dev/null +++ b/dll/fgisPlanchet.c @@ -0,0 +1,255 @@ +#include +#include +#include +#include "fgis.h" +/* + * fgisPlanchet.c - coordinate recalculating commands for planchet widget, + * implemented in C + * Copyright (c) by softweyr + */ + +/* internal converting function */ + +/* + * Fills x1 y1 x2 y2 with limits of planchet coordinate system + * Returns TCL_OK on success + */ +int Fgis_GetPlanchetLimits(Tcl_Interp *interp,char *planchet, + double *x1,double *y1,double *x2, double *y2) +{ + char *list; + list=Tcl_GetVar2(interp,planchet,"limits",TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); + if (!list) return TCL_ERROR; + return Fgis_GetLimits(interp,list,x1,y1,x2,y2); +} + +int Fgis_GetPlanchetWidth(Tcl_Interp *interp,char *planchet) +{ + Tk_Window p=Tk_NameToWindow(interp,planchet,Tk_MainWindow(interp)); + if (p==NULL) return 0; + + return Tk_ReqWidth(p); +} +int Fgis_GetPlanchetHeight(Tcl_Interp *interp,char *planchet) +{ + + Tk_Window p=Tk_NameToWindow(interp,planchet,Tk_MainWindow(interp)); + if (p==NULL) return 0; + return Tk_ReqHeight(p); +} + + +/* + * Returns alternative (map) x, given planchet x in pixels + * No error checking - fast, for internal use. In case of error returns 0 + * + */ +double Fgis_AltX(Tcl_Interp *interp,char *planchet,int x) +{double X1,Y1,X2,Y2,result; + int width=Fgis_GetPlanchetWidth(interp,planchet); + if (!width||Fgis_GetPlanchetLimits(interp,planchet,&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return 0.0; + result= (x*(X2-X1)/width+X1); + return result; +} + +/* + * Returns alternative (map) y, given planchet y in pixels + * No error checking - fast, for internal use. In case of error returns 0 + * + */ +double Fgis_AltY(Tcl_Interp *interp,char *planchet,int y) +{double X1,Y1,X2,Y2,result; + int height=Fgis_GetPlanchetHeight(interp,planchet); + if (!height||Fgis_GetPlanchetLimits(interp,planchet,&X1,&Y1,&X2,&Y2) + ==TCL_ERROR) + return 0.0; + result= ((height-y)*(Y2-Y1)/height+Y1); + return result; +} + +/* + * Returns planchet x coordinate in pixels, given alternative (map) coordinate + */ +int Fgis_PlanchetX(Tcl_Interp *interp,char *planchet,double x) +{double X1,Y1,X2,Y2; + if (Fgis_GetPlanchetLimits(interp,planchet,&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return 0; + return floor((x-X1)/(X2-X1)*Fgis_GetPlanchetWidth(interp,planchet)); +} + + +/* + * Returns planchet y coordinate in pixels, given alternative (map) coordinate + */ +int Fgis_PlanchetY(Tcl_Interp *interp,char *planchet,double y) +{double X1,Y1,X2,Y2; + if (Fgis_GetPlanchetLimits(interp,planchet,&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return 0; + return floor((y-Y2)/(Y1-Y2)*Fgis_GetPlanchetHeight(interp,planchet)); +} + +/* + * Tcl commands to deal with coordinates. These commands duplicates + * functionality of quick-and-dirty ones above, but adds more error-cheking + * and eliminates duplication in Tk data structures access + */ + +/* + * Tcl command fgisPlanchet_mapx implementation + */ +EXPORT (int, Fgis_MapX)(ClientData data,Tcl_Interp* interp,int argc, char **argv) +{ char result [255]; + int x,width; + double X1,Y1,X2,Y2; + Tk_Window p; + if (argc!=3) { + sprintf(result,"Wrong # args. Should be %s planchet value",argv[0]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + p=Tk_NameToWindow(interp,argv[1],Tk_MainWindow(interp)); + if (!p) return TCL_ERROR; + if (Tk_GetPixels(interp,p,argv[2],&x)==TCL_ERROR) return TCL_ERROR; + if (Fgis_GetPlanchetLimits(interp,argv[1],&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return TCL_ERROR; + width=Tk_ReqWidth(p); + if (width==0) { + sprintf(result,"Planchet %s is not mapped",argv[1]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + Tcl_PrintDouble(interp,(x*(X2-X1)/width+X1),result); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_OK; +} + +/* + * Tcl command fgisPlanchet_mapy implementation + */ +EXPORT(int, Fgis_MapY)(ClientData data,Tcl_Interp* interp,int argc, char **argv) +{ char result [255]; + int y,height; + double X1,Y1,X2,Y2; + Tk_Window p; + if (argc!=3) { + sprintf(result,"Wrong # args. Should be %s planchet value",argv[0]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + p=Tk_NameToWindow(interp,argv[1],Tk_MainWindow(interp)); + if (!p) return TCL_ERROR; + if (Tk_GetPixels(interp,p,argv[2],&y)==TCL_ERROR) return TCL_ERROR; + if (Fgis_GetPlanchetLimits(interp,argv[1],&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return TCL_ERROR; + height=Tk_ReqHeight(p); + if (height==0) { + sprintf(result,"Planchet %s is not mapped",argv[1]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + Tcl_PrintDouble(interp,((height-y)*(Y2-Y1)/height+Y1),result); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_OK; +} + +/* + * Tcl command fgisPlanchet_scrx implementation + */ +EXPORT(int, Fgis_ScrX)(ClientData data,Tcl_Interp* interp,int argc, char **argv) +{ char result [255]; + int width; + double x,X1,Y1,X2,Y2; + Tk_Window p; + if (argc!=3) { + sprintf(result,"Wrong # args. Should be %s planchet value",argv[0]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + p=Tk_NameToWindow(interp,argv[1],Tk_MainWindow(interp)); + if (!p) return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[2],&x)==TCL_ERROR) return TCL_ERROR; + if (Fgis_GetPlanchetLimits(interp,argv[1],&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return TCL_ERROR; + width=Tk_ReqWidth(p); + if (width==0) { + sprintf(result,"Planchet %s is not mapped",argv[1]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + sprintf(result,"%d",(int)floor((x-X1)/(X2-X1)*width)); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_OK; +} + +/* + * Tcl command fgisPlanchet_scry implementation + */ +EXPORT(int, Fgis_ScrY)(ClientData data,Tcl_Interp* interp,int argc, char **argv) +{ char result [255]; + int height; + double y,X1,Y1,X2,Y2; + Tk_Window p; + if (argc!=3) { + sprintf(result,"Wrong # args. Should be %s planchet value",argv[0]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + p=Tk_NameToWindow(interp,argv[1],Tk_MainWindow(interp)); + if (!p) return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[2],&y)==TCL_ERROR) return TCL_ERROR; + if (Fgis_GetPlanchetLimits(interp,argv[1],&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return TCL_ERROR; + height=Tk_ReqHeight(p); + if (height==0) { + sprintf(result,"Planchet %s is not mapped",argv[1]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + sprintf(result,"%d",(int)floor((y-Y2)/(Y1-Y2)*height)); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_OK; +} + +EXPORT(int, Fgis_Fit)(ClientData data,Tcl_Interp* interp,int argc, char **argv) +{ char result [255]; + double xrel,yrel,x,y,X1,Y1,X2,Y2; + if (argc!=4) { + sprintf(result,"Wrong # args. Should be %s planchet x y",argv[0]); + Tcl_SetResult(interp,result,TCL_VOLATILE); + return TCL_ERROR; + } + if (Tcl_GetDouble(interp,argv[2],&x)==TCL_ERROR) return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[3],&y)==TCL_ERROR) return TCL_ERROR; + if (Fgis_GetPlanchetLimits(interp,argv[1],&X1,&Y1,&X2,&Y2)==TCL_ERROR) + return TCL_ERROR; + xrel=(x-X1)/(X2-X1); + yrel=(y-Y1)/(Y2-Y1); + if (yrel>0.0 && yrel<1.0 && xrel>0.0 && yrel<1.0) + Tcl_SetResult(interp,"1",TCL_STATIC); + else + Tcl_SetResult(interp,"0",TCL_STATIC); + return TCL_OK; +} + +/* + * Checks if given window is really planchet and coordinate system + * is defined. returns 0 on failure, 1 on success + */ + +int Fgis_ValidPlanchet(Tcl_Interp *interp,char *planchet) +{ double a; + Tk_Window p=Tk_NameToWindow(interp,planchet,Tk_MainWindow(interp)); + if (!p) return 0; + if (Tk_GetUid("Canvas")!=Tk_Class(p)) { + Tcl_AppendResult(interp,planchet," is not Planchet window",NULL); + return 0; + } + if (Fgis_GetPlanchetLimits(interp,planchet,&a,&a,&a,&a)!=TCL_OK) { + Tcl_AppendResult(interp,planchet," has no coordinate system defined", + NULL); + return 0; + } + return 1; +} + diff --git a/dll/fgisProjection.c b/dll/fgisProjection.c new file mode 100644 index 0000000..9407ecb --- /dev/null +++ b/dll/fgisProjection.c @@ -0,0 +1,25 @@ +#include +#include +#include "fgis.h" + +/* + * fgisProjection - definition for projection handling objects + * Copyright (c) SoftWeyr,1997 + * + */ + + +EXPORT(int, Fgis_ProjectionObj)(ClientData data,Tcl_Interp *interp,int +argc, char **argv) { + return TCL_ERROR; +} + +EXPORT(void,Fgis_DeleteProjection)(ClientData data) { + +} + +EXPORT(int, Fgis_Projection)(ClientData data,Tcl_Interp *interp,int argc, char **argv) +{ + Tcl_SetResult(interp,"Projection objects not implemented",TCL_STATIC); + return TCL_ERROR; +} diff --git a/dll/fgisRaster.c b/dll/fgisRaster.c new file mode 100644 index 0000000..ddd5215 --- /dev/null +++ b/dll/fgisRaster.c @@ -0,0 +1,998 @@ +/* This is an implementation for EPP handling in fgis*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "fgis.h" +#include "fgisInt.h" +#include "fgisEppEdit.h" +/* + * Declaration + * + */ + + +int Fgis_CreateNewRaster(ClientData data,Tcl_Interp *interp, + int argc,char **argv); + + +typedef int (Fgis_CmdProc)(RASTER_OBJECT handle,Tcl_Interp *interp, + int argc, char **argv); +Fgis_CmdProc SaveRaster, ReturnBaseRaster, + ReturnCellValue, ReturnLimits, RasterComments, ChangeReclass, + ReturnRow, ReturnCol, DumpReclass, ReturnBPP, OffsiteValue, + XLeft, XRight, YTop, YBottom, + ShiftCoords, ListClasses, CountClass, FindUnused, CalcExtents, + SetRasterCache, GetMinValue, GetMaxValue, CellUnit, + ModifyCell, PlotLine, PlotFrame, PlotBox, PlotContour, FillContour, + PlotCircle, ReturnCell, ReturnCellLimits, + CountContour, CountTranssect; + +RECLASS Fgis_ListToReclass(Tcl_Interp *interp,char *list,RECLASS src,int size); +RECLASS Fgis_ParseReclass(Tcl_Interp *interp,char *program,RECLASS src,int size); + + +int DumpReclassToList(Tcl_Interp *interp,RECLASS reclass,int size); +int DumpReclassToProgram(Tcl_Interp *interp,RASTER_OBJECT handle); +/* + * Cleans up global data, used by raster objects. Probably, should also + * clean up all existing raster objects (?) + */ + +EXPORT(void, Fgis_DeleteRaster)(ClientData table) +{ +} +/* + * parses standard raster options -reclass and -table. + * Returns pointer to reclass on success, NULL if option is not one of these + * and FGIS_INVALID_RECLASS + * if there was error parsing option argument. + */ +RECLASS Fgis_StdRasterOptions(Tcl_Interp *interp, int size, char **arg) +{ RECLASS table; + if (!strcmp(*arg,"-reclass")) { + table=Fgis_ParseReclass(interp,*(arg+1),create_reclass_table(size),size); + } else if (!strcmp(*arg,"-table")) { + table=Fgis_ListToReclass(interp,*(arg+1),create_reclass_table(size),size); + } else return NULL; + if (!table) + return FGIS_INVALID_RECLASS; + else + return table; +} + +/* + * Implements raster Tcl command - various ways to create new raster object + * (deals itself with existing raster files and calls CreateNewRaster for new + * ones. + */ + +EXPORT(int, Fgis_Raster)(ClientData data,Tcl_Interp *interp, + int argc, + char **argv) +{ + RASTER_OBJECT curfile; + XEPP* xptr; + int reclass_size; + EPP *(*openfunc)(char *)=open_epp; + if (Fgis_CkArgs(interp,argc<2,argv[0],"?mode? filename ?options?")) { + return TCL_ERROR; + } + if (!strcmp(argv[1],"load")) { + argc--; + argv++; + openfunc=load_epp; + } else if (!strcmp(argv[1],"new")){ + return Fgis_CreateNewRaster(data,interp,argc-2,argv+2); + } + if (Fgis_CkArgs(interp,argc!=2&&argc!=4,argv[0],"filename ?options?")) { + return TCL_ERROR; + } + /* Open file, or get pointer to existing one */ + xptr=Fgis_OpenXEPP(argv[1],open_epp); + if (!xptr) { + if (map_error==ME_NO_FILE||map_error==ME_CREATE_ERROR) { + Tcl_AppendResult(interp,"Cannot open ",argv[1],": ", + Tcl_PosixError(interp),NULL); + } else { + Tcl_AppendResult(interp,"Invalid epp file:",argv[1],NULL); + } + return TCL_ERROR; + } + /* Create reclass table with size of epp_max, if file is not loaded, + or 1<editable) { + reclass_size=1<<(xptr->e->kind); + } else { + reclass_size=xptr->e->kind==8?256:epp_table_size(xptr->e); + } + + /* Allocate new raster object */ + curfile=malloc(sizeof(struct RASTER_OBJECT)); + curfile->file=xptr; + if (argc>2) { + /* If there is reclass option, parse it */ + curfile->reclass=Fgis_StdRasterOptions(interp,reclass_size,argv+2); + if (!(curfile->reclass)||curfile->reclass==FGIS_INVALID_RECLASS) { + curfile->reclass=NULL; + Fgis_CloseXEPP(curfile->file); + return TCL_ERROR; + } + } else { + /* otherwise create empty reclass */ + curfile->reclass=create_reclass_table(reclass_size); + } + curfile->next=firstobject; + firstobject=curfile; + return Fgis_CreateObjectCommand(interp,"raster",Fgis_RasterObj, + (ClientData)curfile, Fgis_DeleteRasterObj); +} + +/* + * Creates new raster object. returns TCL_ERROR if file already exists + * + */ + +EXPORT(int, Fgis_CreateNewRaster)(ClientData data,Tcl_Interp *interp,int argc, + char **argv) +{ struct stat BUF; + RECLASS table=NULL,t1; + int i,width=0,height=0,offsite=-1,explicit_limits=0; + EPP *e,*pattern=NULL; + XEPP *xptr; + double X1,Y1,X2,Y2; + RASTER_OBJECT object; + int bits=16; + char filename[1024]; + strcpy(filename,argv[1]); + /* checking file existence */ + if (stat(filename,&BUF)||errno!=ENOENT) { + Tcl_AppendResult(interp,"File ",filename," already exists",NULL); + return TCL_ERROR; + } + /* Option parsing loop */ + for(i=0;i255&&offsite!=65535) { + if (table) free(table); + ERROR_MESSAGE("Invalid offsite for 8-bit file",TCL_STATIC); + } + + if(offsite<0) { + if (bits==8) + offsite=255; + else + offsite=65535; + } + if (!pattern) { + if (!width || !height) { + if (table) free(table); + ERROR_MESSAGE("Raster size is not specified",TCL_STATIC); + } + if (!explicit_limits||X1==X2||Y1==Y2) { + X1=0;X2=width;Y1=height;Y2=0; + } + e=creat_epp(filename,1,1,width,height,X1,Y1,X2,Y2,100,0,offsite); + if (!e) { + if (table) free(table); + Tcl_AppendResult(interp,"Error creating file ",filename,":", + Tcl_PosixError(interp),NULL); + return TCL_ERROR; + } + } else { + if (width || height) { + if (table) free(table); + ERROR_MESSAGE("Raster size is specified twice",TCL_STATIC); + } + if (explicit_limits) { + if (table) free(table); + ERROR_MESSAGE("Coordinate system is specified twice",TCL_STATIC); + } + e=creat_epp_as(filename,pattern); + if (!e) { + if (table) free(table); + Tcl_AppendResult(interp,"Error creating file ",filename,":", + Tcl_PosixError(interp),NULL); + return TCL_ERROR; + } + e->offsite=offsite; + } + /* Fill entire raster with offsite value */ + /* And load it into memory to make editable */ + load_new_epp(e); + /* Now create raster object around it */ + xptr=Fgis_NewXEPP(e,filename); + xptr->editable=1; + object=malloc(sizeof (struct RASTER_OBJECT)); + object->file=xptr; + if (!table) { + object->reclass=create_reclass_table(1<kind); + } else { + object->reclass=table; + } + object->next=firstobject; + firstobject=object; + return Fgis_CreateObjectCommand(interp,"raster",Fgis_RasterObj, + (ClientData)object, Fgis_DeleteRasterObj); +} + +/* + * Fgis_GetRaster + * returns pointer to raster object, associated with tcl command + * + * + */ +EXPORT(RASTER_OBJECT, Fgis_GetRaster)(Tcl_Interp *interp, char *name) +{ + Tcl_CmdInfo info;char buffer[255]="Invalid palette: "; + if (!Tcl_GetCommandInfo(interp,name,&info)) return NULL; + if (info.proc!=&Fgis_RasterObj) { + strcat(buffer,name); + Tcl_SetResult(interp,name,TCL_VOLATILE); + return NULL; + } + return (RASTER_OBJECT)(info.clientData); +} + + +/* + * + * Fgis_DeleteRasterObj - deletes raster object, associated with + * command. Called as Tcl_CmdDeleteProc, but not for base rasters. + * + */ + +EXPORT(void, Fgis_DeleteRasterObj)(ClientData data) +{ RASTER_OBJECT r=(RASTER_OBJECT)data; + RASTER_OBJECT prev; + /* Remove it from list */ + if (firstobject==r) { + firstobject=r->next; + } else { + for (prev=firstobject;prev->next!=r;prev=prev->next); + prev->next=r->next; + } + Fgis_CloseXEPP(r->file); + free(r->reclass); + free(r); +} + +/* + * Fgis_RasterObj - implementation of object command for rasters. + * mostly calls some procedure according to first argument. But few commands, + * which returns info of object itself, rather then of raster or reclass, + * are inlined, as well as delete command. + */ +EXPORT(int, Fgis_RasterObj)(ClientData data,Tcl_Interp *interp, int argc, char **argv) +{ + RASTER_OBJECT object=(RASTER_OBJECT)data; + + if (Fgis_CkArgs(interp,argc<2,argv[0], " option ?args?")) + return TCL_ERROR; + + /* Checking for valid options*/ + /* delete */ + if (!strcmp(argv[1],"delete")) { + if (Fgis_CkArgs(interp,argc!=2,argv[0], "delete")) + return TCL_ERROR; + Tcl_DeleteCommand(interp,argv[0]); + return TCL_OK; + /* filename */ + } else if (!strcmp(argv[1],"filename")) { + if (Fgis_CkArgs(interp,argc!=2,argv[0], + " filename")) + return TCL_ERROR; + RETURN(object->file->filename,TCL_VOLATILE); + /*load */ + } else if (!strcmp(argv[1],"cell")) { + return ReturnCell(object,interp,argc,argv); + } else if (!strcmp(argv[1],"save")) { + return SaveRaster(object,interp,argc,argv); + } else if (!strcmp(argv[1],"bpp")) { + return ReturnBPP(object,interp,argc,argv); + } else if (!strcmp(argv[1],"cache")) { + return SetRasterCache(object,interp,argc,argv); + }else if (!strcmp(argv[1],"get")) { + return ReturnCellValue(object,interp,argc,argv); + }else if (!strcmp(argv[1],"limits")) { + return ReturnLimits(object,interp,argc,argv); + }else if (!strcmp(argv[1],"comment")) { + return RasterComments(object,interp,argc,argv); + }else if (!strcmp(argv[1],"reclass")) { + return ChangeReclass(object,interp,argc,argv); + }else if (!strcmp(argv[1],"offsite")) { + return OffsiteValue(object,interp,argc,argv); + }else if (!strcmp(argv[1],"row")) { + return ReturnRow(object,interp,argc,argv); + }else if (!strcmp(argv[1],"col")) { + return ReturnCol(object,interp,argc,argv); + }else if (!strcmp(argv[1],"put")) { + return ModifyCell(object,interp,argc,argv); + }else if (!strcmp(argv[1],"line")) { + return PlotLine(object,interp,argc,argv); + }else if (!strcmp(argv[1],"frame")) { + return PlotFrame(object,interp,argc,argv); + }else if (!strcmp(argv[1],"box")) { + return PlotBox(object,interp,argc,argv); + }else if (!strcmp(argv[1],"fill")) { + return FillContour(object,interp,argc,argv); + }else if (!strcmp(argv[1],"circle")) { + return PlotCircle(object,interp,argc,argv); + }else if (!strcmp(argv[1],"classes")) { + return ListClasses(object,interp,argc,argv); + }else if (!strcmp(argv[1],"count")) { + return CountClass(object,interp,argc,argv); + }else if (!strcmp(argv[1],"unused")) { + return FindUnused(object,interp,argc,argv); + }else if (!strcmp(argv[1],"extents")) { + return CalcExtents(object,interp,argc,argv); + }else if (!strcmp(argv[1],"celllimits")) { + return ReturnCellLimits(object,interp,argc,argv); + }else if (!strcmp(argv[1],"xleft")) { + return XLeft(object,interp,argc,argv); + }else if (!strcmp(argv[1],"xright")) { + return XRight(object,interp,argc,argv); + }else if (!strcmp(argv[1],"ytop")) { + return YTop(object,interp,argc,argv); + }else if (!strcmp(argv[1],"ybottom")) { + return YBottom(object,interp,argc,argv); + }else if (!strcmp(argv[1],"shift")) { + return ShiftCoords(object,interp,argc,argv); + }else if (!strcmp(argv[1],"max")) { + return GetMaxValue(object,interp,argc,argv); + }else if (!strcmp(argv[1],"min")) { + return GetMinValue(object,interp,argc,argv); + }else if (!strcmp(argv[1],"unit")) { + return CellUnit(object,interp,argc,argv); + }else { + Tcl_SetResult(interp,"Invalid option. Should be one of " + "box bpp cache circle classes col comment count delete " + "extents filename fill first_row first_col frame get " + "limits line load max min " + "polygon put reclass row save shift transect unused unit" + "xleft xright ybottom ytop",TCL_STATIC); + return TCL_ERROR; + } +} +int SaveRaster (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET + + +int ReturnCellValue (RASTER_OBJECT data, Tcl_Interp *interp, int argc, + char **argv) +{ char buffer[10]; + EPP *e=data->file->e; + double X,Y; + int value; + + if (Fgis_CkArgs(interp,(argc != 4&&!(argc==5&&!strcmp(argv[4],"-base"))), + argv[0],"get x y ?-base?")) return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[2],&X)!=TCL_OK) + return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[3],&Y)!=TCL_OK) + return TCL_ERROR; + value= epp_get(e,epp_col(e,X),epp_row(e,Y)); + sprintf(buffer,"%d",argc!=5?data->reclass[value]:value); + RETURN(buffer,TCL_VOLATILE); +} + +int ReturnLimits (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + char buffer[255]; + EPP *e=epp(data); + + if (Fgis_CkArgs(interp,argc!=2,argv[0],"limits")) + return TCL_ERROR; + Tcl_PrintDouble(interp,e->XLeft,buffer); + Tcl_AppendElement(interp,buffer); + Tcl_PrintDouble(interp,e->YBottom,buffer); + Tcl_AppendElement(interp,buffer); + Tcl_PrintDouble(interp,e->XRight,buffer); + Tcl_AppendElement(interp,buffer); + Tcl_PrintDouble(interp,e->YTop,buffer); + Tcl_AppendElement(interp,buffer); + return TCL_OK; +} +int RasterComments (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + + switch (argc) { + case 3: /* set comment */ + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only.",TCL_STATIC); + setcomment(e,argv[2]); + /* NO BREAK HERE */ + case 2: /* return comment */ + RETURN(getcomment(e),TCL_VOLATILE); + default:{ + Tcl_AppendResult(interp,"Wrong #args. Should be ", + argv[0], " comment ?string?",NULL); + return TCL_ERROR; + } + } +} +int OffsiteValue (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[7]; + int new_offsite; + + switch (argc) { + case 3: /*set new offsite value*/ + if (!data->file->editable); + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Fgis_GetInt(interp,argc,argv,2,-1, + (1<kind)-1,&new_offsite,"offsite value")!=TCL_OK) + return TCL_ERROR; + if (new_offsite<0) new_offsite=65535; + e->offsite=new_offsite; + /* NO BREAK HERE!!*/ + case 2: /* return offsite value */ + sprintf(result,"%d",data->reclass[e->offsite]); + RETURN(result,TCL_VOLATILE); + default: Tcl_AppendResult(interp, + "Wrong # args. Should be ",argv[0]," offsite ?value?",NULL); + return TCL_ERROR; + } +} + +int CellUnit (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + static char *units[]={"undefined","ft","m","km","mile","ha","acre",NULL}; + EPPHEADER h; + + get_epp_header(e,&h); + if (h.area_unit>6) h.area_unit=0; + if (argc==3) { + char **u; + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + for(u=units;*u&&strcmp(*u,argv[2]);u++); + if (!*u) { + Tcl_SetResult(interp,"Wrong area unit. should be one of: ", + TCL_STATIC); + for(u=units;*u;u++) + Tcl_AppendResult(interp,*u," ",NULL); + return TCL_ERROR; + } + h.area_unit=u-units; + change_epp_header(e,h); + } else if (Fgis_CkArgs(interp,argc!=2,argv[0], + " unit ?new-unit?")) { + return TCL_ERROR; + } + RETURN(units[(int)h.area_unit],TCL_STATIC); +} + +int GetMaxValue (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + char result[255]; + + if (Fgis_CkArgs(interp,argc!=2,argv[0],"max")) + return TCL_ERROR; + sprintf(result,"%d",Fgis_RasterMax(data)); + RETURN(result,TCL_VOLATILE); +} + +int GetMinValue (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + char result[255]; + + if (Fgis_CkArgs(interp,argc!=2,argv[0],"min")) + return TCL_ERROR; + sprintf(result,"%d",Fgis_RasterMin(data)); + RETURN(result,TCL_VOLATILE); +} + +int ReturnBPP (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + if (Fgis_CkArgs(interp,argc!=2,argv[0],"bpp")) + return TCL_ERROR; + RETURN(e->kind==8?"8":"16",TCL_STATIC); +} + +int ReturnCell (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[32]; + if (Fgis_CkArgs(interp,argc!=2&&!(argc==3&&!strcmp(argv[2],"-area")),argv[0], + "cell ?-area?")) + return TCL_ERROR; + if (argc==3) { + Tcl_PrintDouble(interp,e->cell_area,result); + } else { + Tcl_PrintDouble(interp,fabs(e->XRight-e->XLeft)/(e->lc-e->fc),result); + } + RETURN(result,TCL_VOLATILE); +} +int ReturnCellLimits (RASTER_OBJECT data, Tcl_Interp *interp, + int argc, char **argv) +{ + EPP *e=epp(data); + char result[7]; + if (Fgis_CkArgs(interp,argc!=2,argv[0],"celllimits")) + return TCL_ERROR; + sprintf(result,"%d",e->fc); + Tcl_AppendElement(interp,result); + sprintf(result,"%d",e->lr-1); + Tcl_AppendElement(interp,result); + sprintf(result,"%d",e->lc-1); + Tcl_AppendElement(interp,result); + sprintf(result,"%d",e->fr); + Tcl_AppendElement(interp,result); + return TCL_OK; +} + +int XLeft (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[64]; + if (argc==3) { + EPPHEADER h; + double tmp; + + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Tcl_GetDouble(interp,argv[2],&tmp)!=TCL_OK) + return TCL_ERROR; + get_epp_header(e,&h); + h.fcx=tmp; + e->XLeft=tmp; + change_epp_header(e,h); + } else if (argc!=2) { + Tcl_AppendResult(interp,"Wrong # args. Should be", argv[0]," ", + argv[1]," ?value?", NULL); + } + Tcl_PrintDouble(interp,e->XLeft,result); + RETURN(result,TCL_VOLATILE); +} +int XRight (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[64]; + if (argc==3) { + EPPHEADER h; + double tmp; + + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Tcl_GetDouble(interp,argv[2],&tmp)!=TCL_OK) + return TCL_ERROR; + get_epp_header(e,&h); + h.lcx=tmp; + e->XRight=tmp; + change_epp_header(e,h); + } else if (argc!=2) { + Tcl_AppendResult(interp,"Wrong # args. Should be", argv[0]," ", + argv[1]," ?value?", NULL); + } + Tcl_PrintDouble(interp,e->XRight,result); + RETURN(result,TCL_VOLATILE); +} +int YTop (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[64]; + if (argc==3) { + EPPHEADER h; + double tmp; + + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Tcl_GetDouble(interp,argv[2],&tmp)!=TCL_OK) + return TCL_ERROR; + get_epp_header(e,&h); + h.fry=tmp; + e->YTop=tmp; + change_epp_header(e,h); + } else if (argc!=2) { + Tcl_AppendResult(interp,"Wrong # args. Should be", argv[0]," ", + argv[1]," ?value?", NULL); + } + Tcl_PrintDouble(interp,e->YTop,result); + RETURN(result,TCL_VOLATILE); +} +int YBottom (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[64]; + if (argc==3) { + EPPHEADER h; + double tmp; + + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Tcl_GetDouble(interp,argv[2],&tmp)!=TCL_OK) + return TCL_ERROR; + get_epp_header(e,&h); + h.lry=tmp; + e->YBottom=tmp; + change_epp_header(e,h); + } else if (argc!=2) { + Tcl_AppendResult(interp,"Wrong # args. Should be", argv[0]," ", + argv[1]," ?value?", NULL); + } + Tcl_PrintDouble(interp,e->YBottom,result); + RETURN(result,TCL_VOLATILE); +} + +int ShiftCoords (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + EPPHEADER h; + double dx,dy; + if (Fgis_CkArgs(interp,argc!=4,argv[0], "shift dx dy")) { + return TCL_ERROR; + } + + if (!data->file->editable) + ERROR_MESSAGE("Raster is read-only",TCL_STATIC); + if (Tcl_GetDouble(interp,argv[2],&dx)!=TCL_OK) + return TCL_ERROR; + if (Tcl_GetDouble(interp,argv[3],&dy)!=TCL_OK) + return TCL_ERROR; + get_epp_header(e,&h); + h.fcx=e->XLeft+=dx; + h.lcx=e->XRight+=dx; + h.fry=e->YTop+=dy; + h.lry=e->YBottom+=dy; + change_epp_header(e,h); + return TCL_OK; +} + +int ChangeReclass(RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + RECLASS tmp; + EPP *e=epp(data); + if (argc==2) + return DumpReclassToList(interp,data->reclass,epp_table_size(e)); + if (!strcmp(argv[2],"-table")) { + if (Fgis_CkArgs(interp,(argc!=4), argv[0],"reclass -table list")) { + return TCL_ERROR; + } + tmp=Fgis_ListToReclass(interp,argv[3],data->reclass, + epp_table_size(e)); + } else + if (!strcmp(argv[2],"-statements")) { + if (Fgis_CkArgs(interp,argc!=3, argv[0], "reclass -statements")) { + return TCL_ERROR; + } + return DumpReclassToProgram(interp,data); + } else { + if (Fgis_CkArgs(interp,argc!=3, argv[0], " reclass ?option? arg")) { + return TCL_ERROR; + } + tmp=Fgis_ParseReclass(interp,argv[2],data->reclass,epp_table_size(e)); + } + if(!tmp) return TCL_ERROR; + free(data->reclass); + data->reclass=tmp; + return TCL_OK; +} + +int ReturnRow (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[7]; + int row; + double Y; + if (Fgis_CkArgs(interp,argc != 3, argv[0],"row y")) { + return TCL_ERROR; + } + if (Tcl_GetDouble(interp,argv[2],&Y)!=TCL_OK) return TCL_ERROR; + row=epp_row(e,Y); + if (rowfr||row>=e->lr) + ERROR_MESSAGE("Y coordinate outside file boundaries",TCL_STATIC); + sprintf(result,"%d",row); + RETURN(result,TCL_VOLATILE); +} +int ReturnCol (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + EPP *e=epp(data); + char result[7]; + int col; + double X; + if (Fgis_CkArgs(interp,argc != 3,argv[0],"col x")) { + return TCL_ERROR; + } + if (Tcl_GetDouble(interp,argv[2],&X)!=TCL_OK) return TCL_ERROR; + col=epp_col(e,X); + if (colfc||col>=e->lc) + ERROR_MESSAGE("X coordinate outside file boundaries",TCL_STATIC); + sprintf(result,"%d",col); + RETURN(result,TCL_VOLATILE); +} + +int SetRasterCache (RASTER_OBJECT data, Tcl_Interp *interp, int argc, + char **argv) +{ +EPP *e=epp(data); +char result[7]; + +if (Fgis_CkArgs(interp,argc>3,argv[0],"cache ?cache-size?")) { + return TCL_ERROR; +} +if (argc==2) { + if (e->mode&MAP_LOADED) + RETURN("loaded",TCL_STATIC); + /* Otherwise cache size would be returned, as it is done after change */ +} else { + int newsize; + if (e->mode&MAP_LOADED) { + Tcl_AppendResult(interp,argv[0]," already loaded into memory",NULL); + return TCL_ERROR; + } + if (Fgis_GetInt(interp,argc,argv,2,-1,CACHE_THRESHOLD/ + (e->width*(e->kind>>3)), + &newsize,"cache size")!=TCL_OK) return TCL_ERROR; + set_epp_cache(e,newsize); +} +sprintf(result,"%d",e->cache_size); +RETURN(result,TCL_VOLATILE); +} +/* +# $raster put value x y +# modifies raster (if modifiable). Value should be specified in +# terms of base raster, not of current raster object. +# +*/ +int ModifyCell (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ EPP *e=epp(data); + int row,col,value; + double X,Y; + if (Fgis_CkArgs(interp,argc!=5,argv[0]," put value x y")) { + return TCL_ERROR; + } + if (!(e->mode&MAP_LOADED)) { + Tcl_AppendResult(interp,"Raster \"",argv[0],"\" is read-only",NULL); + return TCL_ERROR; + } + if (Tcl_GetInt(interp,argv[2],&value)==TCL_ERROR) { + return TCL_ERROR; + } + if (Tcl_GetDouble(interp,argv[3],&X)==TCL_ERROR) { + return TCL_ERROR; + } + if (Tcl_GetDouble(interp,argv[4],&Y)==TCL_ERROR) { + return TCL_ERROR; + } + if (value<0||value>=MAX_EPP_CLASS) { + Tcl_AppendResult(interp,"Value ",argv[2]," is out of range",NULL); + return TCL_ERROR; + } + row=epp_row(e,Y); + col=epp_col(e,X); + if (rowfr||row>=e->lr||colfc||col>=e->lc) { + Tcl_AppendResult(interp,"Point ",argv[3],",",argv[4]," is out of physical" + " boundaries of file", NULL); + return TCL_ERROR; + } + /* If we have value, which does't fit to 8 */ + if (value>=(1<kind)) { + Tcl_AppendResult(interp,"Value ",argv[2]," doesn't fit into raster ", + argv[0],NULL); + return TCL_ERROR; + } + epp_put(e,col,row,value); + return TCL_OK; +} +int PlotLine (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int PlotFrame (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int PlotBox (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int FillContour (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int PlotCircle (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET + +int ListClasses (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) +{ + int value,i; + char result[7]; + EPP *e=epp(data); + if( Fgis_CkArgs(interp,argc!=3,argv[0]," classes value")) { + return TCL_ERROR; + } + if (Fgis_GetInt(interp,argc,argv,2,0,65535,&value,"cell value")!=TCL_OK) + return TCL_ERROR; + + for(i=e->min;i<=e->max;i++) + if ((i!=e->offsite)&&(data->reclass[i]==value)) { + sprintf(result,"%d",i); + Tcl_AppendElement(interp,result); + } + return TCL_OK; +} +int CountClass (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int FindUnused (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET +int CalcExtents (RASTER_OBJECT data, Tcl_Interp *interp, int argc, char **argv) + NOT_YET + +#define LIST_ERROR(msg,mode) { Tcl_Free((char *)listv);free(table);\ + Tcl_SetResult(interp,msg,mode);\ + return NULL;} + +RECLASS Fgis_ListToReclass(Tcl_Interp *interp,char *list,RECLASS src,int size) +{ + int listc,i,index,value; + char **listv; + RECLASS table; + + if (Tcl_SplitList(interp,list,&listc,&listv)!=TCL_OK) + return NULL; + table=memcpy(malloc((size+1)*sizeof(short int)), + src, + (size+1)*sizeof(short int)); + + for(i=0;i=0) + table[index]=value; + } + return table; +} + +unsigned char *reclass_program; + +static int get_prog_char() +{ + return *(reclass_program++); +} + +RECLASS Fgis_ParseReclass(Tcl_Interp *interp,char *program,RECLASS src,int size) +{ + RECLASS table; + reclass_program = (unsigned char *) program; + table=memcpy(malloc((size+1)*sizeof(short int)), + src, + (size+1)*sizeof(short int)); + table = parse_statements(size,table, get_prog_char); + if (!table) { + Tcl_SetResult (interp, "Error in reclass statements", TCL_STATIC); + } + return table; +} + + + +int DumpReclassToList(Tcl_Interp *interp,RECLASS reclass,int size) +{ + int i; + char result[15]; + + for (i=0;i<=size;i++) { + if (reclass[i]!=i) { + sprintf(result,"%d %d",i,reclass[i]); + Tcl_AppendElement(interp,result); + } + } + return TCL_OK; +} +struct STATEMENT {int newclass; + char *list; + int lastclass; + int rangestart; + }; + +char *addtostring(char *source,char separator,int class) +{ + char tmp[10]; + sprintf(tmp,"%c%d",separator,class); + if(!source) + return strcpy(malloc(strlen(tmp)+1),tmp); + else + return strcat(realloc(source,strlen(source)+strlen(tmp)+1),tmp); + +} + +void add_class(struct STATEMENT *stmt,int class) +{ + if (!(stmt->list)) { + stmt->list=addtostring(NULL,'=',class); + stmt->rangestart=stmt->lastclass=class; + } else + if ((stmt->lastclass==class-1)|| + ((class==stmt->newclass+1)&&(stmt->lastclass==class-2))) { + stmt->lastclass=class; + } else { + if (stmt->lastclass!=stmt->rangestart) + stmt->list=addtostring(stmt->list,':',stmt->lastclass); + stmt->list=addtostring(stmt->list,' ',class); + stmt->rangestart=stmt->lastclass=class; + } +} +int DumpReclassToProgram(Tcl_Interp *interp,RASTER_OBJECT data) +{ + int max=Fgis_RasterMax(data)+1,i; + struct STATEMENT *p,*cur; + EPP *e=epp(data); + RECLASS r=data->reclass; + p=malloc(max*sizeof(struct STATEMENT)); + memset(p,0,max*sizeof(struct STATEMENT)); + for(i=0;imax;i++) { + if(i!=e->offsite&&r[i]!=i) + add_class(p+r[i],i); + } + for(i=0,cur=p;ilist) { + char n[7]; + if (cur->lastclass!=cur->rangestart) + cur->list=addtostring(cur->list,':',cur->lastclass); + sprintf(n,"%d",cur->newclass); + Tcl_AppendResult(interp,n,cur->list,"\n",NULL); + free(cur->list); + } + } + free(p); + return TCL_OK; +} diff --git a/dll/fgisVector.c b/dll/fgisVector.c new file mode 100644 index 0000000..c49791c --- /dev/null +++ b/dll/fgisVector.c @@ -0,0 +1,12 @@ + +/* This is an implementation for DGT handling in EP tcl*/ +#include +#include +#include +#include "fgis.h" + +EXPORT(int, Fgis_Vector)(ClientData data,Tcl_Interp *interp,int argc, char **argv) +{ + Tcl_SetResult(interp,"Vector objects not implemented",TCL_STATIC); + return TCL_ERROR; +} diff --git a/dll/patterns.n b/dll/patterns.n new file mode 100644 index 0000000..34870f3 --- /dev/null +++ b/dll/patterns.n @@ -0,0 +1,13 @@ + +patterns set - ÓÏÚÄÁÔØ ÎÁÂÏÒ ÛÔÒÉÈÏ×ÏË ÉÚ ÓÔÒÏËÉ +patterns read - ÐÒÏÞÉÔÁÔØ ÆÁÊÌ ÛÔÒÉÈÏ×ÏË + +patternName print - ×ÙÄÁÔØ ÎÁÂÏÒ ÛÔÒÉÈÏ×ÏË × ×ÉÄÅ, ÐÒÉÅÍÌÅÍÏÍ ÄÌÑ patterns set +patternName get index ?-width n? ?-height n? ?frame -boolean? - ×ÏÚ×ÒÁÝÁÅÔ +ÚÁÄÁÎÎÕÀ ÛÔÒÉÈÏ×ËÕ ËÁË xbm. ðÏ ÕÍÏÌÞÁÎÉÀ Ó ÒÏÄÎÙÍ ÒÁÚÍÅÒÏÍ ÛÔÒÉÈÏ×ËÉ. åÓÌÉ ÚÁÄÁÎÙ width É height, + ÐÒÑÍÏÕÇÏÌØÎÉË ÕËÁÚÁÎÎÏÇÏ ÒÁÚÍÅÒÁ. +patternName set index string + ÉÚÍÅÎÑÅÔ ÕËÁÚÁÎÎÕÀ ÛÔÒÉÈÏ×ËÕ. string ÓÏÄÅÒÖÉÔ ÄÁÎÎÙÅ × xbm ÆÏÒÍÁÔÅ + ÐÒÁ×ÉÌØÎÏÇÏ ÒÁÚÍÅÒÁ + + diff --git a/doc/.log b/doc/.log new file mode 100644 index 0000000..eceff34 --- /dev/null +++ b/doc/.log @@ -0,0 +1,40 @@ +This is TeX, Version 3.14159 (C version 6.1) (format=latex 96.11.10) 29 JAN 1998 13:46 +**epu_doc +(/usr/lib/texmf/texmf/tex/latex/tools/.tex +! Interruption. +l.1 + %% +? +LaTeX2e <1996/06/01> +File ignored) +*\bye +! Undefined control sequence. +<*> \bye + +? + +*\end +! Interruption. +<*> + \end +? + +*\end +! TeX capacity exceeded, sorry [parameter stack size=60]. +\end #1-> + \csname end#1\endcsname \@checkend {#1}\expandafter \endgroup \if@e... +<*> \end + +If you really absolutely need more capacity, +you can ask a wizard to enlarge me. + + +Here is how much of TeX's memory you used: + 4 strings out of 10942 + 52 string characters out of 72781 + 40742 words of memory out of 262141 + 2948 multiletter control sequences out of 9500 + 3640 words of font info for 14 fonts, out of 150000 for 255 + 14 hyphenation exceptions out of 607 + 60i,0n,61p,82b,7s stack positions out of 300i,40n,60p,3000b,4000s +No pages of output. diff --git a/doc/3rd.attempt b/doc/3rd.attempt new file mode 100644 index 0000000..0258900 --- /dev/null +++ b/doc/3rd.attempt @@ -0,0 +1,282 @@ + +÷ ÄÁÎÎÏÍ ÔÅËÓÔÅ ÐÒÅÄÌÁÇÁÅÔÓÑ ÎÏ×ÙÊ ÐÏÄÈÏÄ Ë ÐÒÅÄÓÔÁ×ÌÅÎÉÀ +ÐÒÏÓÔÒÁÎÓÔ×ÅÎÎÏÊ ÉÎÆÏÒÍÁÃÉÉ. ïÎ ÎÅ ÓÏ×ÓÅÍ ÎÏ×ÙÊ. íÎÏÇÉÅ ÓÕÝÅÓÔ×ÕÀÝÉÅ +çéó, ÏÓÏÂÅÎÎÏ ÏÒÉÅÎÔÉÒÏ×ÁÎÎÙÅ ÎÁ ÏÂÒÁÂÏÔËÕ ÓÎÉÍËÏ×, ÎÅÑ×ÎÏ ÉÓÐÏÌØÚÕÀÔ +ÅÇÏ. îÏ ÎÉËÔÏ ÅÝÅ ÎÅ ÐÙÔÁÌÓÑ × Ñ×ÎÏÍ ×ÉÄÅ ÓÆÏÒÍÕÌÉÒÏ×ÁÔØ ÅÇÏ É ÐÏËÁÚÁÔØ +ÅÇÏ ÄÏÓÔÁÔÏÞÎÏÓÔØ ÄÌÑ ÂÏÌØÛÉÎÓÔ×Á çéó-ÚÁÄÁÞ. + +1. ïÐÒÅÄÅÌÅÎÉÅ + îÁÚÏ×ÅÍ ËÁÒÔÏÊ ÆÕÎËÃÉÀ ÏÔ ËÏÏÒÄÉÎÁÔ, ÏÐÒÅÄÅÌÅÎÎÕÀ ÎÁ ÎÅËÏÔÏÒÏÍ + ÐÏÄÍÎÏÖÅÓÔ×Å ÐÏ×ÅÒÈÎÏÓÔÉ ÚÅÍÎÏÇÏ ÛÁÒÁ É ÐÒÉÎÉÍÁÀÝÕÀ ÌÉÂÏ ÞÉÓÌÏ×ÙÅ + (×ÅÝÅÓÔ×ÅÎÎÙÅ) ÚÎÁÞÅÎÉÑ, ÌÉÂÏ ÚÎÁÞÅÎÉÑ ÉÚ ËÁËÏÇÏ-ÔÏ ËÏÎÅÞÎÏÇÏ ÍÎÏÖÅÓÔ×Á. + + ðÏÞÅÍÕ ÜÔÏÇÏ ÄÏÓÔÁÔÏÞÎÏ? + 1. ïÂÌÁÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ ÍÏÖÅÔ ÂÙÔØ ÌÉÂÏ ÎÅÐÒÅÒÙ×ÎÙÍ ÕÞÁÓÔËÏÍ ÔÅÒÒÉÔÏÒÉÉ, + ÅÓÌÉ ÎÁÓ ÉÎÔÅÒÅÓÕÅÔ ÆÅÎÏÍÅÎ, ÉÍÅÀÝÉÊ ÐÌÏÝÁÄÎÕÀ ÐÒÉÒÏÄÕ, + ÌÉÂÏ ÍÎÏÖÅÓÔ×ÏÍ ÌÉÎÉÊ (ÄÏÒÏÖÎÁÑ ÓÅÔØ, ÒÅÞÎÁÑ ÓÅÔØ), ÌÉÂÏ ËÏÎÅÞÎÙÍ +ÍÎÏÖÅÓÔ×ÏÍ ÉÚÏÌÉÒÏ×ÁÎÎÙÈ ÔÏÞÅË (ÎÁÓÅÌÅÎÎÙÅ ÐÕÎËÔÙ, ÔÏÞËÉ ÏÐÒÏÂÏ×ÁÎÉÑ). + + ïÞÅ×ÉÄÎÏ, ÞÔÏ ×ÓÅ ÓÕÝÅÓÔ×ÕÀÝÉÅ ÓÐÏÓÏÂÙ ËÁÒÔÏÇÒÁÆÉÞÅÓËÏÇÏ ÉÚÏÂÒÁÖÅÎÉÑ + ÐÏÚ×ÏÌÑÀÔ ÉÚÏÂÒÁÚÉÔØ ÏÂßÅËÔÙ, ÏÔÎÏÓÑÝÉÅÓÑ Ë ÏÄÎÏÊ ÉÚ ÔÒÅÈ ÜÔÉÈ ÇÒÕÐÐ. + + 2. ìÀÂÏÊ ÐÁÒÁÍÅÔÒ, ËÏÔÏÒÙÊ ÍÙ ÍÏÖÅÍ ÉÚÏÂÒÁÚÉÔØ ÎÁ ËÁÒÔÅ, ÌÉÂÏ + ËÏÌÉÞÅÓÔ×ÅÎÎÙÊ, ÌÉÂÏ ËÁËÉÍ-ÔÏ ÏÂÒÁÚÏÍ ËÌÁÓÓÉÆÉÃÉÒÏ×ÁÎ. åÓÌÉ ÍÙ ÒÁÓÓÍÏÔÒÉÍ + ËÌÁÓÓÉÆÉËÁÃÉÀ ËÁË ËÏÎÅÞÎÏÅ ÍÎÏÖÅÓÔ×Ï ËÌÁÓÓÏ×, ÔÏ ÓÔÁÎÅÔ ÏÞÅ×ÉÄÎÏ, ÞÔÏ + ×ÓÅ ËÁÒÔÙ ËÁÞÅÓÔ×ÅÎÎÙÈ ÐÒÉÚÎÁËÏ× (ÐÏÞ×ÅÎÎÙÅ, ÒÁÓÔÉÔÅÌØÎÙÅ É ÄÁÖÅ ÁÄÍÉÎÉÓÔÒÁ- + ÔÉ×ÎÏÅ ÒÁÊÏÎÉÒÏ×ÁÎÉÅ) ÐÏÐÁÄÁÀÔ ÐÏÄ ÎÁÛÅ ÏÐÒÅÄÅÌÅÎÉÅ. + +åÄÉÎÓÔ×ÅÎÎÏÅ × ÎÁÛÅÍ ÏÐÒÅÄÅÌÅÎÉÉ, ÞÔÏ ÍÏÖÅÔ ×ÏÚÍÕÔÉÔØ ÞÅÌÏ×ÅËÁ, ÐÒÉ×ÙËÛÅÇÏ +ÒÁÂÏÔÁÔØ Ó ÂÕÍÁÖÎÙÍÉ ËÁÒÔÁÍÉ, ÜÔÏ ÔÏ, ÞÔÏ ÍÙ ÐÏÚ×ÏÌÑÅÍ ËÁÒÔÅ ÉÚÏÂÒÁÖÁÔØ ÔÏÌØËÏ +ÏÄÉÎ ÐÏËÁÚÁÔÅÌØ, × ÔÏ ×ÒÅÍÑ ËÁË ÎÁ ÂÕÍÁÖÎÙÈ ËÁÒÔÁÈ ÏÂÙÞÎÏ ÏÄÎÏ×ÒÅÍÅÎÎÏ +ÉÚÏÂÒÁÖÁÅÔÓÑ ÎÅÓËÏÌØËÏ ÔÅÍÁÔÉÞÅÓËÉ ÓÈÏÄÎÙÈ ÐÏËÁÚÁÔÅÌÅÊ, ÎÅ ÓÞÉÔÁÑ +ÏÂÝÅÇÅÏÇÒÁÆÉÞÅÓËÏÊ ÓÉÔÕÁÃÉÉ. + +íÙ ÎÁÍÅÒÅÎÎÏ ÉÄÅÍ ÎÁ ÜÔÏ ÏÇÒÁÎÉÞÅÎÉÅ, ÐÏÓËÏÌØËÕ ÏÎÏ ÏÂÌÅÇÞÁÅÔ ÄÁÌØÎÅÊÛÕÀ +ÒÁÂÏÔÕ Ó ËÁÒÔÁÍÉ. òÁÚÄÅÌÉ× ËÁÖÄÕÀ ÉÓÈÏÄÎÕÀ ËÁÒÔÕ ÎÁ ÎÅÓËÏÌØËÏ ÓÌÏÅ×, +ËÁÖÄÙÊ ÉÚ ËÏÔÏÒÙÈ ÏÔ×ÅÞÁÅÔ ÔÏÌØËÏ ÚÁ ÏÄÉÎ ÐÏËÁÚÁÔÅÌØ, ÍÙ ÐÏÌÕÞÁÅÍ ÐÏÌÎÕÀ +Ó×ÏÂÏÄÕ ÐÒÉ ÐÏÓÔÒÏÅÎÉÉ ÐÒÏÉÚ×ÏÄÎÙÈ ËÁÒÔ. íÙ ÍÏÖÅÍ ÉÓÐÏÌØÚÏ×ÁÔØ ÐÒÉ +ÁÎÁÌÉÚÅ ÌÀÂÙÅ ÐÏËÁÚÁÔÅÌÉ, ÎÅ ÏÂÒÁÝÁÑ ×ÎÉÍÁÎÉÅ ÎÁ ÔÏ, ËÁËÉÍ ÐÕÔÅÍ +ÜÔÁ ÉÎÆÏÒÍÁÃÉÑ ÐÏÌÕÞÅÎÁ. ÷ÓÅ ËÁÒÔÙ Õ ÎÁÓ ÎÅÚÁ×ÉÓÉÍÙ É ÒÁ×ÎÏÐÒÁ×ÎÙ. + +2. ôÏÞÎÏÓÔØ ËÁÒÔÙ. + +ìÀÂÁÑ ÉÎÆÏÒÍÁÃÉÑ Ï ÒÅÁÌØÎÏ ÓÕÝÅÓÔ×ÕÀÝÉÈ ÏÂßÅËÔÁÈ ÉÍÅÅÔ ÏÇÒÁÎÉÞÅÎÎÕÀ ÔÏÞÎÏÓÔØ. +ðÏÜÔÏÍÕ ÎÕÖÎÏ ××ÅÓÔÉ ÓÐÏÓÏ ÏÃÅÎËÉ ÔÏÞÎÏÓÔÉ ËÁÒÔ. +õ ÐÒÏÂÌÅÍÙ ÔÏÞÎÏÓÔÉ ËÁÒÔÙ ÅÓÔØ Ä×Å ÓÔÏÒÏÎÙ: + 1. ôÏÞÎÏÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ ËÏÏÒÄÉÎÁÔ + 2. ôÏÞÎÏÓÔØ ÉÎÆÏÒÍÁÃÉÉ Ï ÚÎÁÞÅÎÉÉ ËÁÒÔÙ. + +ôÏÞÎÏÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ ËÏÏÒÄÉÎÁÔ ÜË×É×ÁÌÅÎÔÎÁ ÔÏÞÎÏÓÔÉ ÐÒÏ×ÅÄÅÎÉÑ +ËÏÎÔÕÒÏ× ÉÓÈÏÄÎÏÊ ËÁÒÔÙ É ÏÂÙÞÎÏ ÎÅ ÐÒÅ×ÙÛÁÅÔ 1-2 ÍÍ × ÍÁÓÛÔÁÂÅ ÉÓÈÏÄÎÏÊ +ËÁÒÔÙ. ïÐÒÅÄÅÌÅÎÎÙÅ ÐÏÇÒÅÛÎÏÓÔÉ ×ÎÏÓÉÔ É ××ÏÄ ËÁÒÔ × ÍÁÛÉÎÕ, ÎÏ ÏÎÉ +ÏÂÙÞÎÏ ÎÁ ÐÏÒÑÄÏË ÍÅÎØÛÅ. + +÷ ËÁÞÅÓÔ×Å ÏÃÅÎËÉ ËÏÏÒÄÉÎÁÔÎÏÊ ÔÏÞÎÏÓÔÉ ËÁÒÔÙ ÍÙ ÂÕÄÅÍ ÉÓÐÏÌØÚÏ×ÁÔØ +ÐÒÏÓÔÒÁÎÓÔ×ÅÎÎÏÅ ÒÁÚÒÅÛÅÎÉÅ. üÔÏ ÍÉÎÉÍÁÌØÎÏÅ ÒÁÓÓÔÏÑÎÉÅ ÍÅÖÄÕ ÔÏÞËÁÍÉ +× ËÏÔÏÒÙÈ ËÁÒÔÁ ÍÏÖÅÔ ÉÍÅÔØ ÒÁÚÌÉÞÎÙÅ ÚÎÁÞÅÎÉÅ. ôÅ ËÏÍÕ ÐÒÉÈÏÄÉÌÏÓØ +ÒÁÂÏÔÁÔØ Ó ÏÔÓËÁÎÉÒÏ×ÁÎÎÙÍÉ ÉÚÏÂÒÁÖÅÎÉÑÍÉ ÓÒÁÚÕ ÚÁÍÅÔÑÔ ÓÈÏÄÓÔ×Ï +ÜÔÏÇÏ ÐÏÎÑÔÉÑ Ó ÒÁÚÒÅÛÅÎÉÅÍ ÒÁÓÔÒÏ×ÏÇÏ ÉÚÏÂÒÁÖÅÎÉÑ. üÔÏ ÄÅÊÔÓ×ÉÔÅÌØÎÏ +ÏÄÎÏ É ÔÏ ÖÅ ÐÏÎÑÔÉÅ, ÐÏÓËÏÌØËÕ ÄÌÑ ÈÒÁÎÅÎÉÑ ËÁÒÔ ÉÓÐÏÌØÚÕÅÔÓÑ ÒÁÓÔÒÏ×ÙÊ +ÆÏÒÍÁÔ. + +þÔÏ ËÁÓÁÅÔÓÑ ÔÏÞÎÏÓÔÉ ÚÎÁÞÎÅÎÉÊ, ÔÏ ÔÕÔ ×ÏÐÒÏÓ ÂÏÌÅÅ ÓÌÏÖÎÙÊ. +äÁÔØ ÆÏÒÍÁÌÉÚÏ×ÁÎÎÕÀ ÏÃÅÎËÕ ÔÏÞÎÏÓÔÉ ËÌÁÓÓÉÆÉËÁÃÉÉ ÎÅÌØÚÑ, ÅÓÌÉ ÔÏÌØËÏ +ÜÔÁ ËÌÁÓÓÉÆÉËÁÃÉÑ ÎÅ ÐÏÌÕÞÅÎÁ × ÒÅÚÕÌØÔÁÔÅ ËÁËÏÇÏ-ÌÉÂÏ ÓÔÁÔÉÓÔÉÞÅÓËÏÇÏ +ÍÅÔÏÄÁ. + +ôÅÏÒÉÑ ÔÏÞÎÏÓÔÉ ÉÚÍÅÒÅÎÉÊ ËÏÌÉÞÅÓÔ×ÅÎÎÙÈ ÐÏËÁÚÁÔÅÌÅÊ É ÔÏÞÎÏÓÔÉ +ÉÎÔÅÒÐÏÌÑÃÉÉ, ÎÁÐÒÏÔÉ×, ÈÏÒÏÛÏ ÒÁÚÒÁÂÏÔÁÎÁ. + +ëÒÏÍÅ ÔÏÇÏ ÓÕÝÅÓÔ×ÕÅÔ ÔÏÞÎÏÓÔØ ÐÒÅÄÓÔÁ×ÌÅÎÉÑ ÞÉÓÅÌ × ËÏÍÐØÀÔÅÒÅ. + +ðÏÜÔÏÍÕ ÄÌÑ ËÁÒÔ ËÏÌÉÞÅÓÔ×ÅÎÎÙÈ ÐÁÒÁÍÅÔÒÏ× ËÒÏÍÅ ÒÁÚÒÅÛÅÎÉÑ ÉÓÐÏÌØÚÕÅÔÓÑ +ÐÏÎÑÔÉÅ Z-ÔÏÞÎÏÓÔÉ - ÍÉÎÉÍÁÌØÎÁÑ ÒÁÚÎÉÃÁ ÍÅÖÄÕ ÚÎÁÞÅÎÉÑÍÉ ËÁÒÔÙ, +ÐÒÉ ËÏÔÏÒÙÈ ÜÔÉ ÚÎÁÞÅÎÉÑ ÓÞÉÔÁÀÔÓÑ ÎÅÒÁ×ÎÙÍÉ. Z-ÔÏÞÎÏÓÔØ ÜÔÏ + +3. çÄÅ ÖÅ ËÏÎÔÕÒ? + +÷Ï ×ÓÅÍ ×ÙÛÅÉÚÌÏÖÅÎÎÏÍ ÞÅÌÏ×ÅË ÐÒÉ×ÙËÛÉÊ ÒÁÂÏÔÁÔØ Ó ËÁÒÔÁÍÉ ÎÅ ÎÁÊÄÅÔ +ÏÄÎÏÇÏ ×ÁÖÎÏÇÏ ÐÏÎÑÔÉÑ --- ËÏÎÔÕÒÁ. åÇÏ ÚÄÅÓØ ÄÅÊÓÔ×ÉÔÅÌØÎÏ ÎÅÔ. + +ëÏÎÔÕÒ ÜÔÏ Ó×ÑÚÎÏÅ ÍÎÏÖÅÓÔ×Ï ÔÏÞÅË, × ËÏÔÏÒÙÈ ËÁÒÔÁ ÉÍÅÅÔ ÏÄÉÎÁËÏ×ÏÅ ÚÎÁÞÅÎÉÅ. +åÓÌÉ ÍÙ ÒÁÓÓÍÏÔÒÉÍ ËÁÒÔÕ ËÏÌÉÞÅÓÔ×ÅÎÎÏÇÏ ÐÏËÁÚÁÔÅÌÑ, ËÏÔÏÒÁÑ ÏÂÙÞÎÏ +ÉÚÏÂÒÁÖÁÅÔÓÑ Ó ÐÏÍÏÝØÀ ÐÏÓÌÏÊÎÏÊ ÒÁÓËÒÁÓËÉ, ÔÏ ÍÙ Õ×ÉÄÉÍ, ÞÔÏ +ËÏÎÔÕÒ ÚÄÅÓØ - ÏÂÌÁÓÔØ × ËÏÔÏÒÏÊ ÚÎÁÞÅÎÉÑ ÐÏËÁÚÁÔÅÌÑ ÚÁËÌÀÞÅÎÙ × ÏÐÒÅÄÅÌÅÎÎÏÍ +ÉÎÔÅÒ×ÁÌÅ - ÏÔ ÏÄÎÏÊ ÉÚÏÌÉÎÉÉ ÄÏ ÓÏÓÅÄÎÅÊ. åÓÌÉ ÍÙ ÉÚÍÅÎÉÍ ÇÒÁÎÉÃÙ +ÉÎÔÅÒ×ÁÌÏ×, ÉÚÍÅÎÉÔÓÑ É ×ÓÑ ËÏÎÔÕÒÎÁÑ ÓÅÔØ, ÈÏÔÑ ÓÁÍÁ ËÁÒÔÁ, ÔÏ ÅÓÔØ +ÐÒÏÓÔÒÁÎÓÔ×ÅÎÎÏÅ ÒÁÓÐÒÅÄÅÌÅÎÉÅ ÚÎÁÞÅÎÉÊ ÐÏËÁÚÁÔÅÌÑ, ÏÓÔÁÌÁÓØ ÐÒÅÖÎÅÊ. + +äÌÑ ËÁÒÔ ËÌÁÓÓÉÆÉËÁÃÉÊ ËÏÎÔÕÒ --- ×ÅÝØ ÂÏÌÅÅ ÕÓÔÏÊÞÉ×ÁÑ. ïÎ ÍÏÖÅÔ +ÉÚÍÅÎÉÔØÓÑ ÅÓÌÉ ÐÏ ËÁËÉÍ-ÔÏ ÐÒÉÞÉÎÁÍ ÉÚÍÅÎÉÔÓÑ ËÌÁÓÓÉÆÉËÁÃÉÑ ÌÉÂÏ +ÎÁÛÉ ÚÎÁÎÉÑ Ï ÔÅÒÒÉÔÏÒÉÉ. + +ðÏÜÔÏÍÕ ÄÌÑ ÜÔÉÈ ËÁÒÔ ×ÏÚÍÏÖÎÁ ÒÁÂÏÔÁ ÎÁ ÕÒÏ×ÎÅ ËÏÎÔÕÒÏ×. ÷ ÏÓÎÏ×ÎÏÍ +ÏÐÅÒÁÃÉÉ Ó ËÏÎÔÕÒÁÍÉ ÜÔÏ ÉÈ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ËÏÔÏÒÏÅ +Ó ÔÏÞËÉ ÚÒÅÎÉÑ ÆÕÎËÃÉÏÎÁÌØÎÏÊ ËÁÒÔÙ ÏÚÎÁÞÁÅÔ: ÍÙ ×ÙÄÅÌÑÅÍ ËÁËÕÀ-ÔÏ ÇÒÕÐÐÕ +ÔÏÞÅË (ÎÁÐÒÉÍÅÒ, ÎÁÒÉÓÏ×Á× ÚÁÍËÎÕÔÕÀ ÌÉÎÉÀ) É ÇÏ×ÏÒÉÍ: ÚÎÁÞÅÎÉÅ ËÁÒÔÙ +× ÜÔÉÈ ÔÏÞËÁÈ ÔÅÐÅÒØ ÂÕÄÅÔ ÔÁËÏÅ-ÔÏ. + +ïÞÅ×ÉÄÎÏ, ÜÔÏÊ ÏÐÅÒÁÃÉÅÊ ÎÁÄÏ ÐÏÌØÚÏ×ÁÔØÓÑ Ó ÏÓÔÏÒÏÖÎÏÓÔØÀ, ÏÓÔÁ×É× +ÅÇÏ ÄÌÑ ÜÔÁÐÏ× ÐÅÒ×ÉÞÎÏÇÏ ××ÏÄÁ ÉÎÆÏÒÍÁÃÉÉ É ÅÅ ÏÂÎÏ×ÌÅÎÉÑ. + +4. ïÐÅÒÁÃÉÉ Ó ËÁÒÔÁÍÉ. + +ôÅÐÅÒØ ÐÅÒÅÊÄÅÍ Ë ÔÏÍÕ, ÄÌÑ ÞÅÇÏ ×ÓÅ ÜÔÏ ÚÁÔÅ×ÁÌÏÓØ - Ë ÏÐÅÒÁÃÉÑÍ ÁÎÁÌÉÚÁ +ËÁÒÔ. + +éÈ ÍÏÖÎÏ ÓÒÁÚÕ ÒÁÚÄÅÌÉÔØ ÎÁ Ä×Å ÂÏÌØÛÉÅ ÇÒÕÐÐÙ: +1) ëÏÇÄÁ ÎÁÍ × ÒÅÚÕÌØÔÁÔÅ ÎÕÖÎÏ ÐÏÌÕÞÉÔØ ËÁÒÔÕ +2) ëÏÇÄÁ × ÒÅÚÕÌØÔÁÔÅ ÍÙ ÐÏÌÕÞÁÅÍ ËÁËÕÀ-ÔÏ ÓÕÍÍÁÒÎÕÀ ÉÎÆÏÒÍÁÃÉÀ + (ÏÂÙÞÎÏ × ÆÏÒÍÅ ÔÁÂÌÉÃÙ). + +ïÇÒÁÎÉÞÉÍÓÑ ÐÏËÁ ÐÅÒ×ÏÊ ÇÒÕÐÐÏÊ ÏÐÅÒÁÃÉÊ. + +1. úÁÞÁÓÔÕÀ, ÞÔÏÂÙ ÐÏÌÕÞÉÔØ ÉÎÔÅÒÅÓÕÀÝÉÊ ÎÁÓ ÐÏËÁÚÁÔÅÌØ × ËÁËÏÊ-ÔÏ +ÔÏÞËÅ, ÎÁÍ +ÄÏÓÔÁÔÏÞÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÔÏÌØËÏ ÚÎÁÞÅÎÉÑ ÎÅËÏÔÏÒÙÈ ÄÒÕÇÉÈ ÐÏËÁÚÁÔÅÌÅÊ +× ÔÏÊ ÖÅ ÔÏÞËÅ. + +îÁÐÒÉÍÅÒ, ÄÌÑ ÒÁÓÞÅÔÁ ÐÏÔÅÎÃÉÁÌØÎÏÊ ÜÒÏÚÉÉ ÎÁÍ ÎÕÖÎÙ Ó×ÅÄÅÎÉÑ Ï +ÍÅÈÁÎÉÞÅÓËÏÍ ÓÏÓÔÁ×Å ÐÏÞ×, ÕËÌÏÎÁÈ, ÄÌÉÎÅ ÓËÌÏÎÏ×, ÎÁÐÏÞ×ÅÎÎÏÍ ÐÏËÒÏ×Å +É Ô.Ä. åÓÌÉ ×ÓÅ ÜÔÉ ÄÁÎÎÙÅ ÅÓÔØ Õ ÎÁÓ × ×ÉÄÅ ËÁÒÔ, ÔÏ ÐÒÉÍÅÎÉ× +ÉÚ×ÅÓÔÎÏÅ ÕÒÁ×ÎÅÎÉÅ Ë ËÁÖÄÏÊ ÔÏÞËÅ ÔÅÒÒÉÔÏÒÉÉ, ÍÙ ÐÏÌÕÞÉÍ ÎÏ×ÕÀ ËÁÒÔÕ. + +ôÒÁÄÉÃÉÏÎÎÏ × ÄÌÑ ÜÔÏÇÏ ÓÎÁÞÁÌÁ ÎÁËÌÁÄÙ×ÁÀÔ ÄÒÕÇ ÎÁ ÄÒÕÇÁ ×ÓÅ ÉÓÈÏÄÎÙÅ +ËÁÒÔÙ É ÐÏÌÕÞÁÀÔ ÓÅÔËÕ ÍÉÎÉÍÁÌØÎÙÈ ËÏÎÔÕÒÏ×, × ËÏÔÏÒÙÈ ×ÓÅ ÉÓÈÏÄÎÙÅ +ÐÏËÁÚÁÔÅÌÉ ÏÄÎÏÒÏÄÎÙ, Á ÐÏÔÏÍ ÄÌÑ ËÁÖÄÏÇÏ ÔÁËÏÇÏ ËÏÎÔÕÒÁ ÒÁÓÞÉÔÙ×ÁÀÔ +ÉÔÏÇÏ×ÙÊ ÐÏËÁÚÁÔÅÌØ. + +åÓÌÉ ÖÅ ÍÙ ×ÙÐÏÌÎÉÍ ÒÁÓÓÞÅÔ ÄÌÑ ËÁÖÄÏÊ ÔÏÞËÉ ËÁÒÔÙ (Á ÉÈ ËÏÎÅÞÎÏÅ ÞÉÓÌÏ, +ÐÏÓËÏÌØËÕ ×ÓÅ ÉÓÈÏÄÎÙÅ ËÁÒÔÙ ÉÍÅÀÔ ËÏÎÅÞÎÏÅ ÒÁÚÒÅÛÅÎÉÅ), ÔÏ +ÉÔÏÇÏ×ÙÅ ËÏÎÔÕÒÁ ÏÂÒÁÚÕÀÔÓÑ ÓÁÍÉ, ËÁË ÇÒÕÐÐÙ ÔÏÞÅË ÇÄÅ ×ÙÞÉÓÌÅÎÎÙÊ +ÐÏËÁÚÁÔÅÌØ ÉÍÅÅÔ ÏÄÉÎÁËÏ×ÙÅ ÚÎÁÞÅÎÉÑ. + +íÁÔÅÍÁÔÉÞÅÓËÉ ÜÔÏ ÏÐÉÓÙ×ÁÅÔÓÑ ÐÏÎÑÔÉÅÍ ÆÕÎËÃÉÏÎÁÌÁ - ÏÐÅÒÁÃÉÉ, +ËÏÔÏÒÁÑ ÐÏ ÎÅÓËÏÌØËÉÍ ÉÓÈÏÄÎÙÍ ÆÕÎËÃÉÑÍ ÓÔÒÏÉÔ ÒÅÚÕÌØÔÉÒÕÀÝÕÀ. + +ó ÐÒÁËÔÉÞÅÓËÏÊ ÔÏÞËÉ ÚÒÅÎÉÑ ÐÒÏ×ÅÓÔÉ ×ÙÞÉÓÌÅÎÉÑ × ÎÅÓËÏÌØËÉÈ ÍÉÌÌÉÏÎÁÈ +ÔÏÞÅË ÇÏÒÁÚÄÏ ÂÙÓÔÒÅÅ, ÞÅÍ ×ÙÞÉÓÌÑÔØ ÐÅÒÅÓÅÞÅÎÉÑ ÓÏÔÅÎ ËÏÎÔÕÒÏ×. + +2. éÎÏÇÄÁ ÄÌÑ ×ÙÞÉÓÌÅÎÉÑ ÚÎÁÞÅÎÉÑ ÐÏËÁÚÁÔÅÌÑ × ÔÏÞËÅ ÎÁÍ ÎÕÖÎÁ + ÉÎÆÏÒÍÁÃÉÑ Ï ÎÅËÏÔÏÒÏÊ ÏËÒÅÓÔÎÏÓÔÉ ÜÔÏÊ ÔÏÞËÅ (ÔÅÏÒÅÔÉÞÅÓËÉ - +× ÂÅÓËÏÎÅÞÎÏ ÍÁÌÏÊ, ÎÁ ÐÒÁËÔÉËÅ - ÎÅ ÍÅÎØÛÅ ÒÁÚÒÅÛÅÎÉÑ ËÁÒÔÙ) +ëÌÁÓÓÉÞÅÓËÉÊ ÐÒÉÍÅÒ ÔÁËÏÊ ÚÁÄÁÞÉ - ÎÁÈÏÖÄÅÎÉÅ ÕËÌÏÎÏ× ÐÏ +ÇÉÐÓÏÍÅÔÒÉÞÅÓËÏÊ ËÁÒÔÅ. äÒÕÇÏÊ, ÓÔÏÌØ ÖÅ ÈÁÒÁËÔÅÒÎÙÊ ÐÒÉÍÅÒ - ÔÅËÓÔÕÒÁ +ÉÚÏÂÒÁÖÅÎÉÑ ÎÁ ÁÜÒÏÆÏÔÏÓÎÉÍËÅ. + +3. é, ÎÁËÏÎÅÃ, ÉÎÏÇÄÁ ÎÁÍ ÎÕÖÎÙ ÕÄÁÌÅÎÎÙÅ ÔÏÞËÉ, ÏÂÌÁÄÁÀÝÉÅ +ÏÐÒÅÄÅÌÅÎÎÙÍÉ Ó×ÏÊÓÔ×ÁÍÉ. îÁÐÒÉÍÅÒ, ×Ï ÍÎÏÇÉÈ ÚÁÄÁÞÁÈ ÒÁÚÍÅÝÅÎÉÑ +ÎÁÓ ÉÎÔÅÒÅÓÕÅÔ ÒÁÓÓÔÏÑÎÉÅ ÄÏ ÂÌÉÖÁÊÛÅÊ ÄÏÒÏÇÉ, ÐÒÉ ÐÏÓÔÒÏÅÎÉÉ +ËÁÒÔ ÈÉÍÉÞÅÓËÏÇÏ ÓÏÓÔÁ×Á ÎÁÓ ÉÎÔÅÒÅÓÕÀÔ ÎÅÓËÏÌØËÏ ÂÌÉÖÁÊÛÉÈ ÔÏÞÅË +ÏÐÒÏÂÏ×ÏÁÎÉÑ. + +éÎÔÅÒÅÓÎÏÊ ÔÅÍÏÊ ÄÌÑ ÉÓÓÌÅÄÏ×ÁÎÉÑ Ñ×ÌÑÅÔÓÑ ×ÏÚÍÏÖÎÏÓÔØ ËÏÍÐÏÚÉÃÉÉ +ÆÕÎËÃÉÏÎÁÌÏ×, ÐÏÓËÏÌØËÕ ÒÁÂÏÔÁ Ó ËÏÍÐÏÚÉÃÉÑÍÉ ÆÕÎËÃÉÏÎÁÌÏ× +ÐÏÚ×ÏÌÑÅÔ ÓÞÉÔÁÔØ ÓÌÏÖÎÙÅ ÍÏÄÅÌÉ ÚÁ ÏÄÉÎ ÐÒÏÈÏÄ, ÂÅÚ ÓÏÚÄÁÎÉÑ +ÓÌÏÖÎÙÈ ÐÒÏÍÅÖÕÔÏÞÎÙÈ ËÁÒÔ. + +ïÞÅ×ÉÄÎÏ, Ë ÏÐÅÒÁÃÉÑÍ 1-Ê ÇÒÕÐÐÙ ËÏÍÐÏÚÉÃÉÑ ÐÒÉÍÅÎÉÍÁ ×ÓÅÇÄÁ +z=f(g(x)) ÐÏÓÞÉÔÁÔØ ÎÅ ÓÌÏÖÎÅÅ ÞÅÍ y=g(x) z=f(y). + +óÌÏÖÎÅÅ Ó ÏÐÅÒÁÃÉÑÍÉ ×ÔÏÒÏÊ ÇÒÕÐÐÙ, ÐÏÓËÏÌØËÕ ÅÓÌÉ × ×ÙÞÉÓÌÅÎÉÉ +f(x) ÕÞÁÓÔ×ÕÀÔ ÚÎÁÞÅÎÉÑ g(x+dx) ÉÈ ÎÁÄÏ ×ÙÞÉÓÌÉÔØ ÚÁÒÁÎÅÅ, Á ÅÓÌÉ +É ÏÎÉ ÔÒÅÂÕÀÔ ÏËÒÅÓÔÎÏÓÔÉ... óÒÁ×ÎÉÔÅ, ÎÁÐÒÉÍÅÒ, Ó ÆÏÒÍÕÌÏÊ ×ÔÏÒÏÊ +ÐÒÏÉÚ×ÏÄÎÏÊ ÓÌÏÖÎÏÊ ÆÕÎËÃÉÉ. + +åÓÌÉ ÖÅ ÒÅÞØ ÉÄÅÔ Ï ÎÅÌÏËÁÌØÎÙÈ ÏÐÅÒÁÃÉÑÈ, ÔÁËÉÈ ËÁË ÂÕÆÅÒÉÚÁÃÉÑ +É ÉÎÔÅÒÐÏÌÑÃÉÑ, ÂÅÚ ÓÏÈÒÁÎÅÎÉÑ ÐÒÏÍÅÖÕÔÏÞÎÙÈ ÒÅÚÕÌØÔÁÔÏ× × ×ÉÄÅ +ËÁÒÔ ×ÉÄÉÍÏ ÎÅ ÏÂÏÊÔÉÓØ. + + +÷ÉÚÕÁÌÉÚÁÃÉÑ ËÁÒÔ É ÍÅÔÁÄÁÎÎÙÅ. + +äÁÔØ ÓÔÒÏÇÏÅ ÍÁÔÅÍÁÔÉÞÅÓËÏÅ ÏÐÒÅÄÅÌÅÎÉÅ ËÁÒÔÙ ËÏÎÅÞÎÏ ÈÏÒÏÛÏ, ÎÏ +ÉÓÓÌÅÄÏ×ÁÔÅÌÉ ÐÒÉ×ÙËÌÉ ×ÉÄÅÔØ ËÁÒÔÕ ÐÅÒÅÄ ÇÌÁÚÁÍÉ. + +üÔÏ ËÁË ÒÁÚ ÔÏ, ÞÅÇÏ ÎÅ ÐÏÚ×ÏÌÑÀÔ ÓÕÝÅÓÔ×ÕÀÝÉÅ çéó. ÷ ÎÉÈ ÓÏÚÄÁÎÉÅ +ËÁÒÔÏÇÒÁÆÉÞÅÓËÏÊ ËÏÍÐÏÚÉÃÉÉ ÎÁ ÜËÒÁÎÅ ÉÌÉ ÎÁ ÂÕÍÁÇÅ - ÄÌÉÔÅÌØÎÙÊ +É ÓÌÏÖÎÙÊ ÐÒÏÃÅÓÓ, ÓÏ×ÅÒÛÅÎÎÏ ÎÅ Ó×ÑÚÁÎÎÙÊ Ó ÓÏÂÓÔ×ÅÎÎÏ ÐÒÏÓÔÒÁÎÓÔ×ÅÎÎÙÍ +ÁÎÁÌÉÚÏÍ É ÍÏÄÅÌÉÒÏ×ÁÎÉÅÍ. + +äÁ, ÓÔÁÄÉÑ ÄÉÚÁÊÎÁ ÎÅÏÂÈÏÄÉÍÁ, ËÏÇÄÁ ×Ù ÇÏÔÏ×ÉÔÅ ËÁÒÔÕ ÄÌÑ ÐÕÂÌÉËÁÃÉÉ, +ÎÏ ×ÏÚÍÏÖÎÏÓÔØ ÂÙÓÔÒÏ Õ×ÉÄÅÔØ ÒÅÚÕÌØÔÁÔ ËÁËÏÊ-ÔÏ ÏÐÅÒÁÃÉÉ × ÂÏÌÅÅ +ÍÅÎÅÅ ÁÄÅË×ÁÔÎÙÈ ËÁÒÔÏÇÒÁÆÉÞÅÓËÉÈ ÚÎÁËÁÈ ÍÏÖÅÔ ÉÚÂÁ×ÉÔØ ÏÔ ÍÎÏÖÅÓÔ×Á +ÏÛÉÂÏË. + +æÕÎËÃÉÏÎÁÌØÎÙÅ ËÁÒÔÙ ÍÏÇÕÔ ÐÏÍÏÞØ É ÚÄÅÓØ. +ðÏÓËÏÌØËÕ ËÁÖÄÁÑ ËÁÒÔÁ Õ ÎÁÓ ÏÔÏÂÒÁÖÁÅÔ ÒÏ×ÎÏ ÏÄÉÎ ÐÏËÁÚÁÔÅÌØ, +ÍÙ ÍÏÖÅÍ Ó×ÑÚÁÔØ ÓÐÏÓÏ ËÁÒÔÏÇÒÁÆÉÞÅÓËÏÇÏ ÉÚÏÂÒÁÖÅÎÉÑ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ +Ó ÍÎÏÖÅÓÔ×ÏÍ ÚÎÁÞÅÎÉÊ ËÁÒÔÙ. (×Ï ÍÎÏÇÉÈ ÏÂÌÁÓÔÑÈ ÎÁÕË Ï ÚÅÍÌÅ ÜÔÏ +ÕÖÅ É ÔÁË ÓÄÅÌÁÎÏ - ÓÕÝÅÓÔ×ÕÀÔ ÓÔÁÎÄÁÒÔÎÙÅ Ã×ÅÔÁ ÄÌÑ ÔÉÐÏ× ÐÏÞ× ÉÌÉ +ÇÅÏÈÒÏÎÏÌÏÇÉÞÅÓËÉÈ ÜÐÏÈ). + +ðÏÓÌÅ ÜÔÏÇÏ, ÐÏÓÔÒÏÉ× ËÁÒÔÕ ÍÙ ÍÏÖÅÍ ÎÅÍÅÄÌÅÎÎÏ ÅÅ ÉÚÏÂÒÁÚÉÔØ × +ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÈ ÕÓÌÏ×ÎÙÈ ÚÎÁËÁÈ, Á ÚÁÄÁÞÁ ÄÉÚÁÊÎÁ ËÁÒÔÏÇÒÁÆÉÞÅÓËÏÊ +ËÏÍÐÏÚÉÃÉÉ ÒÁÓÐÁÄÁÅÔÓÑ ÎÁ ÓÏÚÄÁÎÉÅ ÎÁÂÏÒÁ ÚÎÁËÏ× ÄÌÑ ËÁÖÄÏÇÏ +ÐÏËÁÚÁÔÅÌÑ É ÉÚÏÂÒÁÖÅÎÉÅ ÎÁ ÏÄÎÏÍ ÌÉÓÔÅ ÔÅÈ ÓÌÏÅ×, ËÏÔÏÒÙÅ ÔÅÍÁÔÉÞÅÓËÉ +ÉÎÔÅÒÅÓÎÏ ÒÁÓÓÍÁÔÒÉ×ÁÔØ ×ÍÅÓÔÅ, ÔÁË , ÞÔÏÂÙ ÏÎÉ ÎÅ ÍÅÛÁÌÉ ÄÒÕÇ ÄÒÕÇÕ. + +íÁÓÛÔÁÂÎÙÊ ÒÑÄ ÉÌÉ ÉÅÒÁÒÈÉÑ ÒÅÇÉÏÎÏ×. + +äÁÌÅËÏ ÎÅ ×ÓÅÇÄÁ ÒÁÂÏÔÁ Ó ËÁÒÔÁÍÉ Ó×ÏÄÉÔÓÑ Ë ÒÁÂÏÔÅ Ó ÏÄÎÏÊ É ÔÏÊ ÖÅ +ÔÅÒÒÉÔÏÒÉÅÊ. äÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ ÐÒÉÈÏÄÉÔÓÑ ÉÍÅÔØ ÄÅÌÏ Ó ÉÅÒÁÒÈÉÅÊ +ÍÁÓÛÔÁÂÏ× É ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ÅÊ ÉÅÒÁÒÈÉÅÊ ÔÅÒÒÉÔÏÒÉÊ. + +ðÒÉ ÜÔÏÍ ÉÓÐÏÌØÚÕÅÍÙÅ ËÁÒÔÏÇÒÁÆÉÞÅÓËÉÅ ÐÒÏÅËÃÉÉ É ËÌÁÓÓÉÆÉËÁÃÉÉ +ËÁÞÅÓÔ×ÅÎÎÙÈ ÐÏËÁÚÁÔÅÌÅÊ (ÐÏÞ×, ÒÁÓÔÉÔÅÌØÎÏÓÔÉ É Ô.Ä.) ÚÁËÏÎÏÍÅÒÎÏ +ÍÅÎÑÀÔÓÑ Ó ÉÚÍÅÎÅÎÅÍ ÍÁÓÛÔÁÂÁ. + +äÁÌÅËÏ ÎÅ ×ÓÅÇÄÁ ÎÁ ÎÕÖÎÏÍ ÍÁÓÛÔÁÂÎÏÍ ÕÒÏ×ÎÅ ÅÓÔØ ×ÓÑ ÎÅÏÂÈÏÄÉÍÁÑ +ÉÎÆÏÒÍÁÃÉÑ. ðÏÜÔÏÍÕ ÞÁÓÔÏ ×ÏÚÎÉËÁÅÔ ÚÁÄÁÞÁ ÌÉÂÏ ÓÏÂÒÁÔØ ËÁÒÔÕ +ÉÚ ÂÏÌÅÅ ËÒÕÐÎÏÍÁÓÛÔÁÂÎÙÈ ËÕÓËÏ×, Ó ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ÇÅÎÅÒÁÌÉÚÁÃÉÅÊ, +ÌÉÂÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÆÒÁÇÍÅÎÔ ÂÏÌÅÅ ÍÅÌËÏÍÁÓÛÔÁÂÎÏÊ ËÁÒÔÙ. ðÏÔÅÒÑ ÔÏÞÎÏÓÔÉ +ÔÕÔ ÎÅÉÚÂÅÖÎÁ, ÎÏ ÞÁÓÔÏ ÌÕÞÛÅ ÎÅÔÏÞÎÙÅ ÄÁÎÎÙÅ, ÞÅÍ ÎÉËÁËÉÈ. + +ðÏÜÔÏÍÕ ÍÙ ××ÏÄÉÍ ËÏÎÃÅÐÃÉÀ ÒÅÇÉÏÎÁ. òÅÇÉÏÎ ÜÔÏ ÇÒÕÐÐÁ ËÁÒÔ ÎÁ ÏÄÎÕ +É ÔÕ ÖÅ ÔÅÒÒÉÔÏÒÉÀ. ÷ÓÅ ËÁÒÔÙ ÒÅÇÉÏÎÁ ÉÍÅÀÔ ÏÄÎÕ É ÔÕ ÖÅ ËÏÏÒÄÉÎÁÔÎÕÀ +ÓÉÓÔÅÍÕ (ËÁÒÔÏÇÒÁÆÉÞÅÓËÕÀ ÐÒÏÅËÃÉÀ) ÎÏ ÍÏÇÕÔ ÒÁÚÌÉÞÁÔØÓÑ ÐÏ ÒÁÚÒÅÛÅÎÉÀ. +ðÏÓÌÅÄÎÅÅ ÎÅ ÍÅÛÁÅÔ ÓÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÉÈ × ÁÎÁÌÉÚÅ. +äÌÑ ÔÏÇÏ ÞÔÏÂÙ ÉÓÐÏÌØÚÏ×ÁÔØ ËÁÒÔÕ ÉÚ ÄÒÕÇÏÇÏ ÒÅÇÉÏÎÁ ×ÍÅÓÔÅ Ó ËÁÒÔÁÍÉ +ÔÅËÕÝÅÇÏ, ÅÅ ÎÁÄÏ ÓËÏÐÉÒÏ×ÁÔØ × ÜÔÏÔ ÒÅÇÉÏÎ. ðÒÉ ÜÔÏÍ ÏÎÁ ÂÕÄÅÔ +Á×ÔÏÍÁÔÉÞÅÓËÉ ÐÒÅÏÂÒÁÚÏ×ÁÎÁ × ÎÕÖÎÕÀ ÐÒÏÅËÃÉÀ, ÎÏ ÓÏÈÒÁÎÉÔ Ó×ÏÅ ÏÒÉÇÉÎÁÌØÎÏÅ +ÒÁÚÒÅÛÅÎÉÅ É ÌÅÇÅÎÄÕ. åÅ ÇÅÎÅÒÁÌÉÚÁÃÉÑ (ÕÍÅÎØÛÅÎÉÅ ÒÁÚÒÅÛÅÎÉÑ) É +ÐÅÒÅËÌÁÓÓÉÆÉËÁÃÉÑ ÌÅÇÅÎÄÙ - ÄÅÌÏ ÐÏÌØÚÏ×ÁÔÅÌÑ. + +òÅÇÉÏÎÙ ÉÍÅÀÔ ÉÅÒÁÒÈÉÞÅÓËÕÀ ÓÉÓÔÅÍÕ ÓÏÐÏÄÞÉÎÅÎÉÑ. ðÏËÁÖÅÍ, ÞÔÏ ÜÔÏ +ÔÁËÏÅ ÎÁ ÐÒÉÍÅÒÅ ÁÄÍÉÎÉÓÔÒÁÔÉ×ÎÏÇÏ ÄÅÌÅÎÉÑ òÏÓÓÉÉ. + +òÅÇÉÏÎ ×ÅÒÈÎÅÇÏ ÕÒÏ×ÎÑ - òÏÓÓÉÑ × ÃÅÌÏÍ. èÁÒÁËÔÅÒÎÏÅ ÒÁÚÒÅÛÅÎÉÅ 1-2ËÍ, + ÐÒÏÅËÃÉÑ ÓËÏÒÅÅ ×ÓÅÇÏ ËÏÎÉÞÅÓËÁÑ. +÷ ÜÔÏÔ ÒÅÇÉÏÎ ×ÈÏÄÑÔ 86 ÐÏÄÒÅÇÉÏÎÏ× - ÁÄÍÉÎÉÓÔÒÁÔÉ×ÎÙÈ ÏÂÌÁÓÔÅÊ. +òÁÚÒÅÛÅÎÉÅ × ÎÉÈ ÏÔ 500 ÄÏ 100 Í, Á ÐÒÏÅËÃÉÑ ÍÏÖÅÔ ÂÙÔØ ËÏÎÉÞÅÓËÏÊ, +ËÏÓÏÊ ÁÚÉÍÕÔÁÌØÎÏÊ ÉÌÉ UTM(çÁÕÓÓÁ), × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÒÁÚÍÅÒÏ× ÏÂÌÁÓÔÉ. + +åÓÌÉ ÄÅÌÅÎÉÅ ÏÄÎÏÇÏ ÒÅÇÉÏÎÁ ÓÒÁÚÕ ÎÁ 86 ÞÁÓÔÅÊ ËÁÖÅÔÓÑ ÓÌÉÛËÏÍ ÍÅÌËÉÍ, +ÍÏÖÎÏ ××ÅÓÔÉ ÐÒÏÍÅÖÕÔÏÞÎÙÊ ÕÒÏ×ÅÎØ ÜËÏÎÏÍÉÞÅÓËÉÈ ÒÁÊÏÎÏ×. + +ëÁÖÄÁÑ ÏÂÌÁÓÔØ ÓÏÓÔÏÉÔ ÉÚ ÒÁÊÏÎÏ×. ðÒÉ ÎÁÌÉÞÉÉ ÉÓÈÏÄÎÙÈ ÄÁÎÎÙÈ +ÍÏÖÎÏ ××ÅÓÔÉ ÅÝÅ É ÐÏÄÒÅÇÉÏÎÙ ÄÌÑ ÒÁÊÏÎÏ× - ÏÔÄÅÌØÎÙÅ ÈÏÚÑÊÓÔ×Á Ó +ÒÁÚÒÅÛÅÎÉÅÍ ÐÏÒÑÄËÁ ÍÅÔÒÏ× (ÍÁÓÛÔÁ 1:5000 - 1:10000) + +óÉÓÔÅÍÁ ÐÏÚ×ÏÌÑÅÔ ÐÅÒÅÊÔÉ ÎÁ ÓÏÓÅÄÎÉÊ ÕÒÏ×ÅÎØ × ÜÔÏÊ ÉÅÒÁÒÈÉÉ - ÌÉÂÏ +ÐÏÄÎÑÔØÓÑ ××ÅÒÈ × ÏÂßÅÍÌÀÝÉÊ ÒÅÇÉÏÎ, ÌÉÂÏ, ×ÙÂÒÁ× ÎÕÖÎÙÊ ÐÏÄÒÅÇÉÏÎ +ÎÁ ÓÐÅÃÉÁÌØÎÏÊ ËÁÒÔÅ (× ÄÁÎÎÏÍ ÓÌÕÞÁÅ ÁÄÍÉÎÉÓÔÒÁÔÉ×ÎÏÊ) ÐÅÒÅÊÔÉ +× ÎÅÇÏ. + +ðÒÉ ËÏÐÉÒÏ×ÁÎÉÉ ËÁÒÔÙ Ó ÎÉÖÎÅÇÏ ÕÒÏ×ÎÑ ÎÁ ×ÅÒÈÎÉÊ, ÏÎÁ ËÏÐÉÒÕÅÔÓÑ +ÃÅÌÉËÏÍ, Á ×ÏÔ ÐÒÉ ÏÂÒÁÔÎÏÍ ËÏÐÉÒÏ×ÁÎÉÉ ×ÏÚÎÉËÁÅÔ ÚÁÄÁÞÁ ×ÙÒÅÚÁÎÉÑ +ÎÕÖÎÏÇÏ ËÕÓËÁ. ïÄÉÎ ÉÚ ×ÏÚÍÏÖÎÙÈ ÐÕÔÅÊ ÅÅ ÒÅÛÅÎÉÑ - ÉÍÅÔØ × ËÁÖÄÏÍ +ÒÅÇÉÏÎÅ ÓÐÅÃÉÁÌØÎÕÀ ËÁÒÔÕ (×ÉÄÉÍÏ, ÔÕ ÖÅ, ËÏÔÏÒÁÑ ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ +ÐÏÉÓËÁ ÓÕÂÒÅÇÉÏÎÏ×), ÏÂÌÁÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ ËÏÔÏÒÏÊ ÓÏ×ÐÁÄÁÅÔ ÓÏ ×ÓÅÊ +ÔÅÒÒÉÔÏÒÉÅÊ ÒÅÇÉÏÎÁ, É ÐÏÌØÚÏ×ÁÔØÓÑ ÅÊ ËÁË ÍÁÓËÏÊ. + +ðÒÉÎÃÉÐÙ ÐÏÓÔÒÏÅÎÉÑ ÓÉÓÔÅÍÙ + +óÉÓÔÅÍÁ ÓÔÒÏÉÔÓÑ ×ÏËÒÕÇ ×ØÀÅÒÁ/ÒÅÄÁËÔÏÒÁ ËÁÒÔ. +üÔÏÔ ×ØÀÅÒ/ÒÅÄÁËÔÏÒ ÕÍÅÅÔ ×Ù×ÏÄÉÔØ ËÁÒÔÙ ÂÏÌÅÅ-ÍÅÎÅÅ ×ÓÅÍÉ +ÓÕÝÅÓÔ×ÕÀÝÉÍÉ ÓÐÏÓÏÂÁÍÉ ËÁÒÔÏÇÒÁÆÉÞÅÓËÏÇÏ ÉÚÏÂÒÁÖÅÎÉÑ, × ÔÏÍ ÞÉÓÌÅ +ÎÁÐÒÉÍÅÒ ÓÌÏÊ ÛÔÒÉÈÏ×ËÁÍÉ ÐÏ×ÅÒÈ ÓÌÏÑ Ã×ÅÔÏ×. + +ïÔËÒÙÔØ ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ × ËÁÖÄÙÊ ËÏÎËÒÅÔÎÙÊ ÍÏÍÅÎÔ ÍÏÖÎÏ ÔÏÌØËÏ ÏÄÉÎ +ÓÌÏÊ. + +ðÒÉ ÔÙËÁÎØÅ ÍÙÛØÀ × ÏËÏÎ ËÁÒÔÙ ÏÂÙÞÎÏ × ËÁËÏÍ-ÔÏ ÄÒÕÇÏÍ ÏËÎÅ +ÐÏËÁÚÙ×ÁÅÔÓÑ ÚÎÁÞÅÎÉÅ ÐÏ ÎÅËÏÔÏÒÙÍ ×ÙÂÒÁÎÎÙÍ ËÁÒÔÁÍ (×ÓÅ ×ÉÄÉÍÙÅ + +ÔÅ ËÏÔÏÒÙÅ ÐÏÌØÚÏ×ÁÔÅÌØ ÕËÁÚÁÌ Ñ×ÎÏ) × ÜÔÏÊ ÔÏÞËÅ. + +íÅÎÀ ÓÉÓÔÅÍÙ ÐÏÚ×ÏÌÑÅÔ ×ÙÐÏÌÎÉÔØ ÌÀÂÙÅ ÏÐÅÒÁÃÉÉ ÁÎÁÌÉÚÁ, ÐÅÒÅÈÏÄ +ÍÅÖÄÕ ÒÅÇÉÏÎÁÍÉ É Ô.Ð. åÓÌÉ × ÒÅÚÕÌØÔÁÔÅ ÏÐÅÒÁÃÉÉ ÏÂÒÁÂÏÔËÉ ËÁÒÔ +ÓÏÚÄÁÎÁ ÒÏ×ÎÏ ÏÄÎÁ ÎÏ×ÁÑ ËÁÒÔÁ, ÔÏ ÏÎÁ ÚÁÍÅÝÁÅÔ × ÏËÎÅ ×ØÀÅÒÁ ÔÕ, +ËÏÔÏÒÁÑ ÂÙÌÁ ×Ù×ÅÄÅÎÁ Ã×ÅÔÏÍ (ÓÌÕÞÁÊ ÓÉÎÈÒÏÎÎÏÇÏ ×ÙÐÏÌÎÅÎÉÑ). + +÷ÓÅ ÏÐÅÒÁÃÉÉ, ËÏÔÏÒÙÅ ÐÏÌØÚÏ×ÁÔÅÌØ ÍÏÖÅÔ ÐÒÏÉÚ×ÅÓÔÉ ÉÚ ÍÅÎÀ ÓÉÓÔÅÍÙ +ÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÉÚ ÐÒÏÇÒÁÍÍÙ ÎÁ Tcl, ×ËÌÀÞÁÑ ÔÁËÉÅ ËÁË ÒÉÓÏ×ÁÎÉÅ +ÔÏÞËÉ ÉÌÉ ÌÉÎÉÉ × ÒÅÄÁËÔÏÒÅ + +á×ÔÏÍÁÔÉÞÅÓËÁÑ ÁËÔÕÁÌÉÚÁÃÉÑ ËÁÒÔ. + +äÌÑ ËÁÒÔ ÓÏÚÄÁÎÎÙÈ × ÒÅÚÕÌØÔÁÔÅ ÏÐÅÒÁÃÉÊ ÏÂÒÁÂÏÔËÉ ÈÒÁÎÉÔÓÑ +ËÏÍÁÎÄÁ, ÓÏÚÄÁ×ÛÁÑ ËÁÒÔÕ, É ÓÐÉÓÏË ÉÓÈÏÄÎÙÈ ËÁÒÔ. ðÒÉ ×ÉÚÕÁÌÉÚÁÃÉÉ +ÜÔÏÊ ËÁÒÔÙ ÐÒÏ×ÅÒÑÅÔÓÑ, ÎÅ ÂÙÌÉ ÌÉ ÉÚÍÅÎÅÎÙ ËÁËÉÅ-ÔÏ ÉÚ ÉÓÈÏÄÎÙÈ +ËÁÒÔ, É ÅÓÌÉ ÄÁ, ÐÒÅÄÌÁÇÁÅÔÓÑ ÐÏ×ÔÏÒÉÔØ ÇÅÎÅÒÁÃÉÀ ËÁÒÔÙ. + diff --git a/doc/concepts.html b/doc/concepts.html new file mode 100644 index 0000000..08dc673 --- /dev/null +++ b/doc/concepts.html @@ -0,0 +1,360 @@ + + + +f(GIS) concepts + + + +

f(GIS) + concepts

+ +
    +
  1. Data model +
      +
    1. Functional model +
    2. Layer classification +
    3. Implementation of data model +
    4. Regions and chartographic projection +
    +
  2. Program design +
      +
    1. Layer as Tcl object +
    2. Planchet - object for displaying maps +
    3. Low level objects +
    4. GIS operation +
    5. Utilities +
    6. Data access library +
    +
+ + + + +

Data model

+ +GIS is a software system for processing spatial data. So, adequate model +of spatial phenomena is most important thing for GIS. +

+It should provide way to represent spatial phenomena in computer memory, +allow to perform desired operation on this representation and let user +see the results in form, he used to. Ideally, GIS system should hide +complicated issues of internal data storage from user as well as text +processor hides questions of font rendering or kerning or SQL database +hides actual file layout and search technologies, providing simple, +but powerful relational operations instead. +

+Many modern +GIS systems, especially vector based, like ARC/Info, try to +represent map of spatial phenomena rather than spatial phenomena +itself. It leads to overcomplication of storage format and processing +algorithms, and makes user worry about such technical things as polygon +topology, which are completely irrelevant to his problem (say geology +or soil science), as font rendering hints and kerning is irrelevant to +contents of article, typesetted with some partcular font. Maps are +tool for analyse spatial data, widely used, but no more than tool. +GIS system should deal with them, becouse it is neccesary to use +existing data, which are represented on maps, and present results to +user in understandable form of maps, but while processing data we should +take into account properties of actual phenomena, rather then properties +of chartographic representation like polygons. +

+

Functional model

+ +In f(GIS) we use term layer to denote computer representation of +spatial phenomena. We define layer as function which maps geographical +coordinates to value of some property. Closest analogue of our +layer is spatial variable in geostatistics. +

+Layer values can be either real numbers or elements of some finite sets. +If you want to study more complicated spatial phenomena, it is better +to describe it as set of layers rather then individual layer with +structured value. Obvoisly you'll not need values of all attributes in +question for all desired calculations, and separating them makes your +actions more clear. +

+Becouse layers are defined as functions it is theoretically possible to +apply well develped mathematical apparatus of functional analysis to +them. + + +

Layer classification

+Layers can be classified by their area of definition and their set of +values. By area of definition we can distinguish between: + +
+
Two-dimensional layers +
which are defined on some contineous area. + It is most frequently used type of layers for physical geography. + Relief and soil type are perfect examples of such layers. Area of + definition of two-dimensional layers is usially finite, limited by + boundaries of study area or by availability of data. Areas which are + outside of area of definition are called offsite areas. +
One-dimensional layers +
are defined on set of lines within study area. Examples of such + layers are hydrography or railroad network. +
Zero-dimensional layers +
are defined on set of separate points. This layers can be used + for store information about sampling points or weather station +networks. +
+ +By the set of values layers can be classified to: +
+
Numeric layers +
whose values belong to some contineous interval on numeric axis, +for example relief layers, which have any value between lowest and +highest altitude in the study area. +
Classification layers +
which have finite set of values. f(GIS) allows to use arbitrary +strings as elements of such set. Soil map which has names of soil series +as values can be used as an example. +
+ +This simple classification covers all theoretically important types of +layers. Dealing with implementation we'll have to classify layers +further, for example, according to source of thematic data. But for +data analysis it is not significant whether data are stored in disk +file or come from some data asquition system on the fly. It is only +important to know type of values and whether they are defined for +any point of study area or not. + +

Implementation of data model

+ +Spatial phenomena seldom can be expressed by some mathematical equation. +Even if they can, finding of this equation is usially aim of analysis, +not a starting point. So, we need to store values of layers in any +point they are defined. Raster is natural way to store data for +two-dimensional layers.

+ (Raster is just big matrix of numeric values, stored +in special format to reduce storage space. If raster is used in GIS +processing, it should be known, how to find row and column numbers given +real word coordinates and vice versa) +

+f(GIS) uses raster data format developed for EPPL7 GIS system. This +format have several advantages - it is compressed and allows random +access at the same time and it is able to deal with very fine +resolution. For example Landscape map of exUSSR with spatial resolution +(raster cell size) 500m and more than 3000 distinct kinds of landscapes +occupies about 9MB of disk space. Due to such properties of data +format, it is advisable to work with raster cell size significantly less +then known accuracy of data. Resolution of maps can be compatible with +resolution of your scanner and printer - modern processors are powerful +enough to bear it, so raster doesn't mean loss of precession. +

+This data format is able to hold values in range 0..65535. While it is +always sufficient for classification layers, it can look that for +numeric layers it is better to use real numbers. But data always have +finite accuracy, which is usially less than 1/65535 of total range, +and even if we can take measurements with larger precession, we should +take into account spatial variability within one raster cell. +

+For example, if we have map of relief of Russia with 500 meter cell, +we need to represent range from -28 (Caspian coast) to 5642 (Elbrus) +meters above sea level. Thus smallest usable unit is about 10 cm. +Some points' altitude may be measured with more accuracy (for example, +triangualtion points), but each raster cell represents 500x500 meters +square which always would have more than 10cm of variability. +Even if value of our layer should have more precession in some part +of its range, we could use non-linear (for instance logarithmic) mapping +of raster cell values to layer values. +

+But even with compression, raster files occupy significant storage +space. So, we should avoid duplication of them if possible. Thus we +introduce concept of reclass tables. Reclass table maps values +of raster cell to another set of integer in arbitrary order. Don't mix +reclass table with mapping function which is used for convert raster +cell values to real units of numeric layer. For example if we have +statistical data of populations by county and want to create population +them as map, we can use reclass table over county map. Several counties +with different names, which have distinct values in county map raster, +can be mapped to same class in population density map if their population +density is same. +

+Point layer is just list of triplets < X, Y, Value >. Typically +point layer doesn't contain more than few thousands of points, so there +is no need to optimize performance or storage space. +

+Natural storage form of one-dimensional layer is vector format. +It is most questionable area in current fGIS design. There are a lot of +advantages of EPPL7 vector format (compactness, speed of processing), +but it have only one drawback, which overcomes them all - it can +associate only one value with whole vector object (polyline). But +if we are talking about the function, defined on set of lines, whe +should be prepared that this function (stream depth for instance) would +vary from one end of line to other. +

+It is also a question how intersections and joints of lines should +be stored/interpreted, becouse most interesting network analysis +algorithmes require ability to cross joints and intersections. +

+ +

Regions and chartographic projection

+ +Study area usially have hierarchical structure. For example Russia +can be subdivided to administrative regions, which consists of +districts. United States consists of states, which are divided into +counties. Often study is concerned only with one of such hierarchy +levels, but there are opposite examples. +

+Each hierarchy level have its typical data accuracy (which is rough +representation of map scale in GIS world, becouse GIS maps can be +arbitrarily scaled, but only certain scale range make sense for +particular data accuracy), chartographic projection (especially +significant for large areas like whole country or continent). +On thematic maps like soils or vegetation, different classifications +can be used in different scales. +

+So, f(GIS) uses concept of regions. Region is set of layers, +which cover almost same territory, have exactly same projection and +simular spatial resolution. Regions can be nested, i.e. region of +Russia can have several subregions of administrative regions, which +have subregions of districts etc. In this case there should be base +layer +which have subregion names as values. When copiing data between regions +f(GIS) authomatically performs neccessary projection and resolution + conversion using base layer as reference. Classification conversion, +if neccessary, should be performed by user, becouse it requires +knowledge in problem area. + +

Program design

+ +f(GIS) is designed as set of extensions to Tcl programming language +and set of independent utilities, which perform most time consuming +raster and vector processing tasks. Thus long operations can be launched +in background as separate while user continues to view/analyze data in +main program. +

+From users point of view, fGIS is Tcl application which allows him +to operate with set of layers from GUI as well as from Tcl command line. +It is essential design constraing that there should be no operation, +which can be performed from GUI, but couldn't be from Tcl script. There +should be way to automate everything. Other way around is enusred by +very nature of Tcl. Nothing prevent user, which have direct access to +Tcl interpreter from creating new button or menu item and binding any +Tcl command to it. +

+From programmers point of view, fGIS consists of several abstraction +levels, all available for extension and modification. And I think that +every fGIS user can eventually become programmer, if he discoveres need +to implement some, just invented, data analysis algorithm, or customize +graphical user interface to his needs. Relationship between fGIS +abstraction levels is shown on this figure. +

+ +

+

Layer as Tcl object

+Layers in fGIS behave like objects in object-oriented programming +language. Once created with layer command they become tcl +commands itself (i.e. name of layer can be used as Tcl command), +just like Tk widget. Options of layer command allow to manipulate +properties of layer and store layer definition to file. This file +is just Tcl script which creates neccessary subobjects and invokes +appropriate command to create layer. +

Layer have following properties +

+
It can return value by coordinates +
It is why whole thing is about +
It can one or more ways to draw itself +
Raster layer can be drawn in opaque colors, so only offsite area is +transparent or using transparent monochrome patterns, thus allowing to +overlay one raster over another. In most existing raster GIS, like +Idrisi only vector or point layers can be overlayed over raster. +In f(GIS) any +layer can be drawn as overlay +
It has underlying data source +
Data source for layers typically consist of some object which can + return integer value given coordinate (raster file, combined with +reclass table, for example) and legend table or map +function which maps values of underlying raster object to +thematically meaningful values. +
It has visualization parameters +
visualization fo layer is controlled by several parameters such as +color palette, pattern set, flag, indicating if boundaries between +classes are drawn or not. All these parameters can be changed +interactively. +
It has metadata +
Metadata for layer typically include layer title, units in which +its values are managed, spatial resolution and value precession. +Chartographic projection is property of region rather than layer. +
+ +Besides layer types described above fGIS have +object layer type. This layer type can consist of any objects +allowed in Tcl canvas - lines, arcs, polygons, images with only one +thematic value for each object. This type is primarily for annotation +purposes, but also can be used as substitute for vector layers, while +later are not developed +

+

Planchet - object for displaying maps

+Another type of object which is essential for fGIS user is +planchet. It is Tk widget like canvas (and actially derived from +canvas) which has chartographic projection and real-world coordinates. +It is used for displaying layers and picking points on them. Becouse +it has real-world coordinates and physical size on the screen, it always +knows its scale. When scale is changed (via zoom or window resize operation), +all layers currently displayed on planchet are redrawn appropriately. +

+Planchet also have look feature. If right mouse button is pressed +on some point in planchet, it displays values of several layers in this +point in pop-up window. +

+There can be also "friend widgets" like status line which +display current coordinates if mouse is over planchet or zoom/unzoom +buttons which change its state depending of current state of planchet. +

+

Low level objects

+ +There are additional objects like rasters, palettes and pattern sets. +But user seldom need to operate on them directly. They are primarily +for developers of new layer types. + +

GIS operation

+GIS operation like calculationg buffer zones or computing new layer +from several existing are performed by separate utilities running in background. For user convinience +there are tcl procedures which take one or more layer names as arguments +and call appropriate utility. +

+Example of such procedure is interregion copy command, which tooks +layer name and name of target region, determines projections and calls +projection conversion program. +

+In some cases such procedures need to perform sufficient preprocessing +of user-supplied arguments +

Utilities

+ +GIS processing utilities are more general than fGIS. They use just +data files and user-supplied arguments. So they can be used separately +from fGIS, for example by users of EPPL7 GIS. Utilities are designed +for batch environment, so they use exit codes to report status and +stdin/stdout to recieve and return values which are not fit in command +line. Important concept of these utilities is that user shouldn't worry +about raster cell size. All utilites which operate on several raster +files are able to deal with files with different cell sizes as long +as there is non-empty intersection in terms of real-world coordinates. + +

Data access library

+ +Both low-level Tcl objects (rasters, vectors) and utilites use common +C library to access data files. This library provides appropriately +high-level framework for those who want implement own data analysis + algorithmes. For example it includes iterator routines, which recieve +user-written function and open raster file and perform this function +on every cell of given file. While library operates primarily in terms +of raster cells (which can be important for cellular automata +algorithmes, which need to distinguish between ``this cell'' and +``neighbouring cell'') it provides ways to process files with different +cell sizes simulateously. + + + + + + + + + + + + + diff --git a/doc/doc.formats b/doc/doc.formats new file mode 100644 index 0000000..5f62da2 --- /dev/null +++ b/doc/doc.formats @@ -0,0 +1,37 @@ + æÁÊÌ ÏÐÉÓÁÎÉÑ ÒÅÇÉÏÎÁ +îÁÚÙ×ÁÅÔÓÑ .region +ÉÌÉ REGION × Windows ×ÅÒÓÉÉ + +óÏÄÅÒÖÉÔ ÓÌÅÄÕÀÝÕÀ ÉÎÆÏÒÍÁÃÉÀ + +1. NAME "îÁÚ×ÁÎÉÅ ÒÅÇÉÏÎÁ" + CYRILLIC ÉÍÑ ËÏÄÉÒÏ×ËÉ +2. PROJECTION ÎÁÚ×ÁÎÉÅ + .... + END +ïÐÉÓÁÎÉÅ ÐÒÏÅËÃÉÉ × ÆÏÒÍÁÔÅ, ÓÏ×ÐÁÄÁÀÝÅÍ Ó ARC/Info. +3. SHOW ÓÐÉÓÏË ËÁÒÔ + éÍÅÎÁ ËÁÒÔ, ËÏÔÏÒÙÅ ×Ù×ÏÄÑÔÓÑ ÐÒÉ ×ÈÏÄÅ × ÄÁÎÎÙÊ ÒÅÇÉÏÎ. +4 DATABASE ÉÍÑ ÂÁÚÙ ÄÁÎÎÙÈ +5. MAP ÉÍÑ ÆÁÊÌÁ +éÍÑ ÒÁÓÔÒÁ, ÉÓÐÏÌØÚÕÅÍÏÇÏ ÄÌÑ ÐÅÒÅÈÏÄÁ Ë ÒÅÇÉÏÎÁÍ ÓÌÅÄÕÀÝÅÇÏ ÕÒÏ×ÎÑ +6. SUBREGIONS +ËÌÁÓÓ ÉÍÑ ËÁÔÁÌÏÇÁ +... +ÉÌÉ SUBREGIONS QUERY sql-ÚÁÐÏÒÏÓ +æÁÊÌ ÏÐÉÓÁÎÉÑ ËÁÒÔÙ + +NAME ÉÍÑ +[GROUP ÉÍÑ ÇÒÕÐÐÙ ËÁÒÔ] +[CYRILLIC ÉÍÑ ËÏÄÉÒÏ×ËÉ] +INFO +ÎÅÓÔÒÕËÔÕÒÉÒÏ×ÁÎÎÑÊ ÔÅËÓÔ +ENDINFO +RASTER ÉÍÑ ÆÁÊÌÁ +RECLASS [QUERY sql- ÚÁÐÒÏÓ|FILE ÉÍÑ|\nÓÐÉÓÏË ÏÐÅÒÁÔÏÒÏ×] +[RECALC ×ÙÒÁÖÅÎÉÅ \n[CCT\nÔÁÂÌÉÃÁ ÉÎÔÅÒ×ÁÌÏ×|INTERVAL ÞÉÓÌÏ] +|LEGEND [FILE ÉÍÑ|QUERY sql-ÚÁÐÒÏÓ|\nÔÅËÓÔ ÌÅÇÅÄÙ] +PALETTE [ÉÍÑ ÆÁÊÌÁ|\n ÓÐÉÓÏË ÏÐÉÓÁÎÉÊ Ã×ÅÔÏ×] +[SYMBOLS/PATTERNS [BORDER]] ÓÐÉÓÏË ÏÐÉÓÁÎÉÊ ÛÔÒÉÈÏ×ÏË +COMPANIONS ÓÐÉÓÏË ÉÍÅÎ ËÁÒÔ - ÉÍÅÎÁ ËÁÒÔ, ËÏÔÏÒÙÅ ÎÁÄÏ ×Ù×ÏÄÉÔØ, ÅÓÌÉ +ÕËÁÚÁÎÎÁÑ ×Ù×ÏÄÉÔÓÑ ËÁË ÏÓÎÏ×ÎÁÑ diff --git a/doc/epu_doc.tex b/doc/epu_doc.tex new file mode 100644 index 0000000..7f4f896 --- /dev/null +++ b/doc/epu_doc.tex @@ -0,0 +1,181 @@ +\documentclass{article} +\usepackage{russian,academy} +\title{Environmental planning utilities\\òÕËÏ×ÏÄÓÔ×Ï ÐÏÌØÚÏ×ÁÔÅÌÑ} +\author{÷.â.~÷ÁÇÎÅÒ} +\newcommand{\obsoletes}[1]{\par úÁÍÅÎÑÅÔ ËÏÍÁÎÄÙ EPPL7: {\bf #1}\par} +\begin{document} +\maketitle +\section*{÷×ÅÄÅÎÉÅ} + +Environmental planning utilities (ÄÁÌÅÅ EPU)~--- ÎÁÂÏÒ ÐÒÏÇÒÁÍÍ, ×ÙÐÏÌÎÑÀÝÉÈ +ÐÒÉÍÅÒÎÏ ÔÅ ÖÅ ÏÐÅÒÁÃÉÉ, ÞÔÏ É ËÏÍÁÎÄÙ çéó EPPL7. ïÓÎÏ×ÎÙÍ ÍÏÔÉ×ÏÍ ÉÈ +ÒÁÚÒÁÂÏÔËÉ ÂÙÌÏ ÐÒÅÏÄÏÌÅÎÉÅ ÎÅËÏÔÏÒÙÈ ÏÇÒÁÎÉÞÅÎÉÊ EPPL7 ×ÅÒÓÉÉ 3.0, +Ó×ÑÚÁÎÎÙÈ Ó 16-ÂÉÔÎÏÊ ÁÒÈÉÔÅËÔÏÒÏÊ ÜÔÏÊ ÐÒÏÇÒÁÍÍÙ, É ÏÂÅÓÐÅÞÅÎÉÅ ×ÏÚÍÏÖÎÏÓÔÉ +ÒÁÂÏÔÙ Ó ÆÁÊÌÁÍÉ EPPL7 × ÓÒÅÄÅ UNIX. + +EPPL7 ÒÁÓÛÉÆÒÏ×Ù×ÁÅÔÓÑ ËÁË +Environmental Planning Programming Language. ë ÓÏÖÁÌÅÎÉÀ × ÑÚÙËÅ EPPL7 +ÎÅ È×ÁÔÁÅÔ ÓÔÒÕËÔÕÒ ÕÐÒÁ×ÌÅÎÉÑ, ÐÅÒÅÍÅÎÎÙÈ É ÄÒÕÇÉÈ ÐÏÌÅÚÎÙÈ ËÏÎÓÔÒÕÔÃÉÊ, +× ÓÉÌÕ ÞÅÇÏ ÏÎ ÎÅ ÐÒÉÇÏÄÅÎ ÄÌÑ ÓÅÒØÅÚÎÏÇÏ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ. + +ðÏÜÔÏÍÕ, ÐÒÉ ÒÁÚÒÁÂÏÔËÅ EPU ÂÙÌÏ ÒÅÛÅÎÏ ÎÅ ÐÙÔÁÔØÓÑ ×ÏÓÐÒÏÉÚ×ÅÓÔÉ ËÏÎÃÅÐÃÉÀ +ÏÒÉÇÉÎÁÌÁ, Á ÒÁÚÒÁÂÏÔÁÔØ ÎÁÂÏÒ ÏÔÄÅÌØÎÙÈ ËÏÍÁÎÄÎÏ-ÓÔÒÏÞÎÙÈ ÕÔÉÌÉÔ, +×ÙÐÏÌÎÑÀÝÉÈ ÏÓÎÏ×ÎÙÅ çéó ÏÐÅÒÁÃÉÉ, ÞÔÏ ÐÏÚ×ÏÌÉÔ ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ ÒÅÛÅÎÉÑ +ËÏÎËÒÅÔÎÙÈ ÚÁÄÁÞ ÕÖÅ ÓÕÝÅÓÔ×ÕÀÝÉÅ ÒÁÚ×ÉÔÙÅ ÓËÒÉÐÔÏ×ÙÅ ÑÚÙËÉ (shell, tcl, perl). + +÷ÙÄÅÌÅÎÉÅ ÜÔÉÈ ÏÐÅÒÁÃÉÊ × ÏÔÄÅÌØÎÙÅ ÐÒÏÇÒÁÍÍÙ ÉÍÅÅÔ ÅÝÅ É ÔÏ ÐÒÅÉÍÕÝÅÓÔ×Ï, +ÞÔÏ ÜÔÉ ÏÐÅÒÁÃÉÉ, ÏÂÙÞÎÏ ÚÁÎÉÍÁÀÝÉÅ ÍÎÏÇÏ ×ÒÅÍÅÎÉ, ÍÏÇÕÔ ÂÙÔØ ÚÁÐÕÝÅÎÙ +ËÁË ÐÁÒÁÌÌÅÌØÎÙÅ ÐÒÏÃÅÓÓÙ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÐÏÄÄÅÒÖÉ×ÁÀÔÓÑ ÌÉ ÏÐÅÒÁÃÉÏÎÎÏÊ +ÓÉÓÔÅÍÏÊ ÍÎÏÇÏÎÉÔÅ×ÙÅ ÐÒÏÇÒÁÍÍÙ. + +õÔÉÌÉÔÙ ÒÁÚÒÁÂÁÔÙ×ÁÌÉÓØ Ó ÕÞÅÔÏÍ ÔÒÅÂÏ×ÁÎÉÑ ÍÁËÓÉÍÁÌØÎÏÊ ÐÅÒÅÎÏÓÉÍÏÓÔÉ, +É ÔÅÏÒÅÔÉÞÅÓËÉ ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØÓÑ É ×ÙÐÏÌÎÑÔØÓÑ ÎÁ ÌÀÂÏÊ 32 É ÂÏÌÅÅ +ÒÁÚÒÑÄÎÏÊ ÐÌÁÔÆÏÒÍÅ (DOS DPMI, Windows NT, Unix, VMS). ÷ ÎÁÓÔÏÑÝÅÅ ×ÒÅÍÑ +ÏÎÉ ÂÙÌÉ ÐÒÏÔÅÓÔÉÔÏ×ÁÎÙ ÎÁ ÐÌÁÔÆÏÒÍÁÈ DOS/DOS4GW, Linux i386 É Solaris Sparc, +ÞÔÏ ÐÏÚ×ÏÌÑÅÔ ÕÔ×ÅÒÖÄÁÔØ ÞÔÏ ÏÎÉ ÎÅÚÁ×ÉÓÉÍÙ ÏÔ ÐÏÒÑÄËÁ ÂÁÊÔÏ× × ÐÒÏÃÅÓÓÏÒÅ. +÷ÅÒÏÑÔÎÅÅ ×ÓÅÇÏ, × ÕÔÉÌÉÔÁÈ É ÉÓÐÏÌØÚÕÅÍÙÈ ÂÉÂÌÉÏÔÅËÁÈ ÓÕÝÅÓÔ×ÕÀÔ ÍÅÓÔÁ, +ËÏÔÏÒÙÅ ÐÏÔÏÒÅÂÕÀÔ ÐÒÁ×ËÉ ÐÒÉ ÐÅÒÅÈÏÄÅ Ë 64-ÒÁÚÒÑÄÎÏÊ ÁÒÈÉÔÅËÔÕÒÅ. + +÷ Ó×ÑÚÉ Ó ÔÅÍ, ÞÔÏ EPU ÉÎÔÅÎÓÉ×ÎÏ ÉÓÐÏÌØÚÕÀÔ ÏÐÅÒÁÃÉÉ Ó ÐÌÁ×ÁÀÝÅÊ ÚÁÐÑÔÏÊ, +ÍÙ ÎÅ ÒÅËÏÍÅÎÄÕÅÍ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÉÈ ÐÒÉ ÐÏÍÏÝÉ DJGPP ×ÅÒÓÉÊ 1.x É 2.0x, +ÐÏÓËÏÌØËÕ ÜÔÏÔ ËÏÍÐÉÌÑÔÏÒ ÉÍÅÅÔ ÛÉÒÏËÏ ÉÚ×ÅÓÔÎÙÅ ÐÒÏÂÌÅÍÙ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ +ÓÏÐÒÏÃÅÓÓÏÒÁ. + +\section{ëÏÎÃÅÐÃÉÑ EPU} + +EPU ÒÁÂÏÔÁÀÔ ÐÒÅÉÍÕÝÅÓÔ×ÅÎÎÏ Ó ÒÁÓÔÒÏ×ÙÍÉ ËÁÒÔÁÍÉ. ÷ ÏÔÌÉÞÉÅ ÏÔ ÂÏÌØÛÉÎÓÔ×Á +ÄÒÕÇÉÈ ÒÁÓÔÒÏ×ÙÈ çéó, ÓÞÉÔÁÅÔÓÑ ÞÔÏ ÒÁÓÔÒÏ×ÁÑ ËÁÒÔÁ Ñ×ÌÑÅÔÓÑ ÍÏÄÅÌØÀ ÎÅËÏÊ +ÃÅÌÏÞÉÓÌÅÎÎÏÊ ÉÌÉ ×ÅÝÅÓÔ×ÅÎÎÏÊ ÆÕÎËÃÉÉ ÏÔ ËÏÏÒÄÉÎÁÔ, É ÒÁÚÍÅÒ ÑÞÅÊËÉ ÒÁÓÔÒÁ +ÎÅ Ñ×ÌÑÅÔÓÑ ÓÕÝÅÓÔ×ÅÎÎÙÍ ÄÌÑ ÂÏÌØÛÉÎÓÔ×Á ÏÐÅÒÁÃÉÊ, ÈÏÔÑ ÉÍÅÎÎÏ ÏÎ ÓÌÕÖÉÔ +ÏÓÎÏ×ÎÏÊ ÍÅÒÏÊ ÔÏÞÎÏÓÔÉ. + +ðÏÜÔÏÍÕ, ×ÓÅ ÐÒÏÇÒÁÍÍÙ EPU, ÏÂÒÁÂÁÂÙ×ÁÀÝÉÅ ÎÅÓËÏÌØËÏ ×ÈÏÄÎÙÈ ÆÁÊÌÏ×, ÐÏÚ×ÏÌÑÀÔ +ÉÓÐÏÌØÚÏ×ÁÔØ ÆÁÊÌÙ, ËÏÏÒÄÉÎÁÔÙ ÒÁÍËÉ É ÒÁÚÍÅÒ ÑÞÅÊËÉ ËÏÔÏÒÙÈ ÎÅ ÓÏ×ÐÁÄÁÀÔ% +\footnote{åÓÌÉ ËÁËÁÑ-ÌÉÂÏ ÉÚ ÕÔÉÌÉÔ ÏÔËÁÚÙ×ÁÅÔÓÑ ×ÏÓÐÒÉÎÉÍÁÔØ ÔÁËÉÅ ÆÁÊÌÙ, +ÛÌÉÔÅ bug-report.}. +ðÒÏÓÔÒÁÎÓÔ×ÅÎÎÏÅ ÓÏÏÔ×ÅÔÓÔ×ÉÅ ÍÅÖÄÕ ÆÁÊÌÁÍÉ ÐÒÉ ÜÔÏÍ ÕÓÔÁÎÁ×ÌÉ×ÁÅÔÓÑ ÐÏ +ÍÉÒÏ×ÙÍ ËÏÏÒÄÉÎÁÔÁÍ (ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ ËÏÏÒÄÉÎÁÔÙ × ÔÅÒÍÉÎÏÌÏÇÉÉ EPPL7). + +áÎÁÌÏÇÉÞÎÏ, ÚÎÁÞÅÎÉÅ offsite (ÎÅÔ ÄÁÎÎÙÈ) ÐÒÁËÔÉÞÅÓËÉ ×ÓÅÇÄÁ ÐÒÉÎÉÍÁÅÔÓÑ +×Ï ×ÎÉÍÁÎÉÅ, ÈÏÔÑ ÏÔÄÅÌØÎÙÅ ÕÔÉÌÉÔÙ ÍÏÇÕÔ ÉÍÅÔØ ÓÐÅÃÉÁÌØÎÙÊ ËÌÀÞ, +ÐÏÚ×ÏÌÑÀÝÉÊ ÎÅ ÕÞÉÔÙ×ÁÔØ offsite. + +ëÁÒÔÙ EPPL7 ÍÏÖÎÏ ÒÁÚÄÅÌÉÔØ ÎÁ Ä×Á ËÌÁÓÓÁ~--- ËÁÒÔÙ ËÏÌÉÞÅÓÔ×ÅÎÎÙÈ ×ÅÌÉÞÉÎ +(ÃÉÆÒÏ×ÙÅ ÍÏÄÅÌÉ) É ËÁÒÔÙ ËÌÁÓÓÉÆÉËÁÃÉÊ, ÞÉÓÌÏ×ÙÅ ÚÎÁÞÅÎÉÑ ËÌÁÓÓÏ× ËÏÔÏÒÙÈ +ÎÅ ÉÍÅÀÔ ÄÒÕÇÏÇÏ ÓÍÙÓÌÁ, ËÒÏÍÅ ËÁË ÉÎÄÅËÓÙ ÔÅËÓÔÏ×ÙÈ ÚÎÁÞÅÎÉÊ × ÌÅÇÅÎÄÅ. + +æÏÒÍÁÔ ÆÁÊÌÏ× EPPL7 ÎÅ ÐÏÚ×ÏÌÑÅÔ ×Ï ×ÓÅÈ ÓÌÕÞÁÑÈ ÈÒÁÎÉÔØ ÓÅÍÁÎÔÉÞÅÓËÏÅ +ÚÎÁÞÅÎÉÅ Ó ÔÒÅÂÕÅÍÏÊ ÔÏÞÎÏÓÔØÀ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ × ÆÁÊÌÅ ÄÁÎÎÙÈ, ÐÏÓËÏÌØËÕ +ÄÉÁÐÁÚÏÎ ×ÏÚÍÏÖÎÙÈ ÚÎÁÞÅÎÉÊ ÆÁÊÌÏ× ÏÇÒÁÎÉÞÅÎ ËÏÒÏÔËÉÍ ÂÅÚÚÎÁËÏ×ÙÍ ÃÅÌÙÍ +(0--65535). ðÏÜÔÏÍÕ ÔÅ ÐÒÏÇÒÁÍÍÙ EPU, ËÏÔÏÒÙÅ ×ÙÐÏÌÎÑÀÔ ÍÁÔÅÍÁÔÉÞÅÓËÉÅ ÏÐÅÒÁÃÉÉ +ÎÁÄ ÚÎÁÞÅÎÉÑÍÉ ËÁÒÔÙ, ÐÏÚ×ÏÌÑÀÔ ÚÁÄÁÔØ ÍÁÓÛÔÁÂÎÙÊ ËÏÜÆÆÉÃÉÅÎÔ É ÓÍÅÝÅÎÉÅ +ÎÕÌÅ×ÏÇÏ ËÌÁÓÓÁ. + +÷ÏÚÍÏÖÎÏÓÔÉ EPU ÐÏ ÒÁÂÏÔÅ Ó ×ÅËÔÏÒÎÙÍÉ ÆÁÊÌÁÍÉ EPPL7 ÓÕÝÅÓÔ×ÅÎÎÏ ÏÇÒÁÎÉÞÅÎÙ. +üÔÏ Ó×ÑÚÁÎÏ × ÏÓÎÏ×ÎÏÍ Ó ÔÅÍ, ÞÔÏ ÐÒÅÄÐÏÌÁÇÁÅÔÓÑ × ÄÁÌØÎÅÊÛÅÍ ÐÅÒÅÊÔÉ +ÏÔ ÆÏÒÍÁÔÁ DGT Ë ÂÏÌÅÅ ÇÉÂËÏÍÕ ×ÅËÔÏÒÎÏÍÕ ÆÏÒÍÁÔÕ fGIS. + +ðÏ ×ÏÚÍÏÖÎÏÓÔÉ, ÍÙ ÓÔÁÒÁÌÉÓØ ÏÂßÅÄÉÎÉÔØ ÆÕÎËÃÉÉ ÎÅÓËÏÌØËÉÈ ËÏÍÁÎÄ EPPL7 +× ÅÄÉÎÕÀ ÕÔÉÌÉÔÕ, ÔÁË ËÁË ÜÔÏ ÉÎÏÇÄÁ ÐÏÚ×ÏÌÑÅÔ ÄÏÂÉÔØÓÑ ÎÏ×ÏÇÏ ËÁÞÅÓÔ×Á. + +éÚ ÕÔÉÌÉÔ EPU ÎÁÍÅÒÅÎÎÏ ÉÓËÌÀÞÅÎÁ ×ÓÑËÁÑ ÉÎÔÅÒÁËÔÉ×ÎÏÓÔØ, ÐÏÓËÏÌØËÕ +ÏÎÉ ÏÒÉÅÎÔÉÒÏ×ÁÎÙ ÎÁ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÉÚ ÓËÒÉÐÔÏ×. +\section{õÔÉÌÉÔÙ EPU} +\subsection{border}\label{border} +\obsoletes{BORDER (×ÁÒÉÁÎÔ Ó ÓÏÚÄÁÎÉÅÍ {\tt dgt}-ÆÁÊÌÁ)} +ðÏ ÚÁÄÁÎÎÏÍÕ ÒÁÓÔÒÏ×ÏÍÕ ÆÁÊÌÕ ÓÏÚÄÁÅÔ ×ÅËÔÏÒÎÙÊ ÆÁÊÌ, × ËÏÔÏÒÏÍ ÏÔÒÉÓÏ×Ù×ÁÅÔ +ÇÒÁÎÉÃÙ ÍÅÖÄÕ ËÌÁÓÓÁÍÉ ÉÓÈÏÄÎÏÇÏ ÒÁÓÔÒÁ. ðÏ ÕÍÏÌÞÁÎÉÀ, ÇÒÁÎÉÃÁ ÏÔÒÉÓÏ×Ù×ÁÅÔÓÑ +ÔÏÞÎÏ, × ÒÅÚÕÌØÔÁÔÅ ÞÅÇÏ ÌÉÎÉÑ ÐÒÉ ÂÏÌØÛÏÍ Õ×ÅÌÉÞÅÎÉÉ ×ÙÇÌÑÄÉÔ ËÁË ÓÔÕÐÅÎÞÁÔÁÑ. + +ðÁÒÁÍÅÔÒ tolerance ÐÏÚ×ÏÌÑÅÔ ÕÐÒÁ×ÌÑÔØ ÓÇÌÁÖÉ×ÁÎÉÅÍ ÌÉÎÉÊ. + +ëÁË É ×Ï ×ÓÅÈ ÏÓÔÁÌØÎÙÈ ÕÔÉÌÉÔÁÈ EPU, ÏÂÌÁÓÔØ ÌÅÖÁÛÁÑ ÚÁ ÐÒÅÄÅÌÁÍÉ ÒÁÍËÉ +ËÁÒÔÙ ÓÞÉÔÁÅÔÓÑ offsite. ðÏÜÔÏÍÕ × ÔÅÈ ÍÅÓÔÁÈ ÇÄÅ onsite-ËÌÁÓÓÙ ×ÐÏÌÔÎÕÀ +ÐÒÉÌÅÇÁÀÔ Ë ÒÁÍËÅ, ÏÔÒÉÓÏ×Ù×ÁÅÔÓÑ ÇÒÁÎÉÃÁ. ôÁËÏÅ ÐÏ×ÅÄÅÎÉÅ ÎÅ ×ÓÅÇÄÁ ÖÅÌÁÔÅÌØÎÏ, +ÐÏÜÔÏÍÕ ÅÇÏ ÍÏÖÎÏ ÏÔËÌÀÞÉÔØ. + +{\bf æÏÒÍÁÔ ×ÙÚÏ×Á:} + +{\tt + \bf border \rm\it ËÌÀÞÉ ÉÍÑ ÆÁÊÌÁ\rm +} + +{\bf ëÌÀÞÉ:} +\begin{description} +\item[-\%] ÷ ÐÒÏÃÅÓÓÅ ÒÁÂÏÔÙ ×Ù×ÏÄÉÔØ ÎÁ stdout ÐÒÏÃÅÎÔ ÏÂÒÁÂÏÔÁÎÎÏÊ ËÁÒÔÙ. +\item[-l] óÏÚÄÁÔØ ÍÅÔËÉ ÐÏÌÉÇÏÎÏ×. (ÐÏËÁ ÎÅ ÎÁÐÉÓÁÎÏ) +\item[-m] ðÏÄÁ×ÉÔØ ÒÉÓÏ×ÁÎÉÅ ÇÒÁÎÉà ×ÄÏÌØ ÒÁÍËÉ ËÁÒÔÙ +\item[-o ÉÍÑ ÆÁÊÌÁ] úÁÄÁÔØ ÉÍÑ ×ÙÈÏÄÎÏÇÏ ÆÁÊÌÁ. åÓÌÉ ÎÅ ÚÁÄÁÎÏ, ÉÍÑ ×ÙÈÏÄÎÏÇÏ + ÆÁÊÌÁ ÄÅÌÁÅÔÓÑ ÉÚ ÉÍÅÎÉ ×ÈÏÄÎÏÇÏ ÚÁÍÅÎÏÊ ÒÁÓÛÉÒÅÎÉÑ {\tt .epp} ÎÁ {\tt .dgt} +\item[-t ÞÉÓÌÏ] úÁÄÁÔØ ÚÎÁÞÅÎÉÅ tolerance. üÔÏ ÚÎÁÞÅÎÉÅ ÚÁÄÁÅÔÓÑ × ÑÞÅÊËÁÈ + ÉÓÈÏÄÎÏÇÏ ÒÁÓÔÒÁ É ÉÍÅÅÔ ÓÍÙÓÌ ÍÁËÓÉÍÁÌØÎÏÊ ÄÌÉÎÙ ÏÔÒÅÚËÁ, ÏÂÒÁÂÁÔÙ×ÁÅÍÏÊ +ÁÌÇÏÒÉÔÍÏÍ ÓÇÌÁÖÉ×ÁÎÉÑ. ÷ ÂÏÌØÛÉÎÓÔ×Å ÓÌÕÞÁÅ× ÚÎÁÞÅÎÉÅ 3 ÄÁÅÔ ÕÄÏ×ÌÅÔ×ÏÒÉÔÅÌØÎÙÅ +ÒÅÚÕÌØÔÁÔÙ. +\end{description} + +\subsection{classify}\label{classify} +\obsoletes{RECLASS} +óÏÚÄÁÅÔ ÎÏ×ÕÀ ÒÁÓÔÒÏ×ÕÀ ËÁÒÔÕ ÐÏ ÏÄÎÏÊ ÉÌÉ ÎÅÓËÏÌØËÉÍ ÓÔÁÒÙÍ, ÉÓÐÏÌØÚÕÑ +ÚÁÄÁÎÎÙÊ ÎÁÂÏÒ ÐÒÁ×ÉÌ. ÷ ÏÔÌÉÞÉÅ ÏÔ ËÏÍÁÎÄÙ RECLASS EPPL7 ÏÐÅÒÉÒÕÅÔ ÎÅ +Ó ÞÉÓÌÏ×ÙÍÉ ÚÎÁÞÅÎÉÑÍÉ ËÌÁÓÓÏ×, Á Ó ÔÅËÓÔÁÍÉ ÌÅÇÅÎÄÙ. ðÒÅÄÎÁÚÎÁÞÅÎÁ +× ÏÓÎÏ×ÎÏÍ ÄÌÑ ËÁÒÔ ËÌÁÓÓÉÆÉËÁÃÉÊ, × ÏÔÌÉÞÉÉ ÏÔ evaluate (ÒÁÚÄÅÌ~% +\ref{evaluate}), ÐÒÅÄÎÁÚÎÁÞÅÎÎÏÊ × ÏÓÎÏ×ÎÏÍ ÄÌÑ ÃÉÆÒÏ×ÙÈ ÍÏÄÅÌÅÊ. + +\subsection{cluster}\label{cluster} +\obsoletes{CLUSTER, RASTERIZE} +óÏÚÄÁÅÔ ÎÏ×ÕÀ ËÁÒÔÕ, ÚÎÁÞÅÎÉÑ ËÌÁÓÓÏ× ËÏÔÏÒÏÊ ÐÒÅÄÓÔÁ×ÌÑÀÔ ÓÏÂÏÊ +ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÙÅ ÎÏÍÅÒÁ ÒÅÇÉÏÎÏ× ÉÓÈÏÄÎÏÊ ËÁÒÔÙ. ÷ ÏÔÌÉÞÉÅ ÏÔ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ +ËÏÍÁÎÄÙ EPPL7, ÇÒÁÎÉÃÁÍÉ ÒÅÇÉÏÎÏ× ÍÏÇÕÔ ÂÙÔØ ÎÅ ÔÏÌØËÏ ÌÉÎÉÉ ÏÐÒÅÄÅÌÅÎÎÏÇÏ +ËÌÁÓÓÁ, ÎÏ É ÐÅÒÅÈÏÄÙ ÍÅÖÄÕ ËÌÁÓÓÁÍÉ. üÔÁ ÖÅ ÕÔÉÌÉÔÁ ×ÙÐÏÌÎÑÅÔ ÒÁÓÔÅÒÉÚÁÃÉÀ +×ÅËÔÏÒÎÏÇÏ ÆÁÊÌÁ. + + +\subsection{dgt2gen}\label{dgt2gen} +\obsoletes{EXPORT DGT$\bigarrowleft$ARC Generate} +ëÏÎ×ÅÒÔÉÒÕÅÔ ×ÅËÔÏÒÎÙÊ ÆÁÊÌ EPPL7 × ÆÁÊÌ × ÆÏÒÍÁÔÅ, ÐÒÉÇÏÄÎÏÍ ÄÌÑ +ËÏÍÁÎÄÙ GENERATE ARC/Info. óÏÚÄÁÅÔ Ä×Á ÆÁÊÌÁ Ó ÒÁÓÛÉÒÅÎÉÑÍÉ {\tt .gen} É +{\tt gpn} ÓÏÏÔ×ÅÔÓ×ÅÎÎÏ, ÓÏÄÅÒÖÁÝÉÅ ÌÉÎÉÉ É ÔÏÞËÉ ÉÓÈÏÄÎÏÇÏ ÆÁÊÌÁ. +ðÏ ÕÍÏÌÞÁÎÉÀ ÜÔÉ ÆÁÊÌÙ ÉÍÅÀÔ ÉÍÑ ÓÏ×ÐÁÄÁÀÝÅÅ Ó ÉÍÅÎÅÍ ÉÓÈÏÄÎÏÇÏ ÆÁÊÌÁ É +ËÏÎÃÙ ÓÔÒÏË × ÓÔÉÌÅ UNIX. ëÌÀÞ {\bf -r} ÐÏÚ×ÏÌÑÅÔ ÇÅÎÅÒÉÒÏ×ÁÔØ ËÏÎÃÙ ÓÔÒÏË +× ÓÔÉÌÅ MS-DOS, ÞÔÏ ÎÅÏÂÈÏÄÉÍÏ ÄÌÑ PC ARC/Info ×ÅÒÓÉÊ ÄÏ 3.5. +{\bf ëÌÀÞÉ} +\begin{description} +\item[-v] ÷ ÐÒÏÃÅÓÓÅ ÒÁÂÏÔÙ ÐÏËÁÚÙ×ÁÔØ, ÓËÏÌØËÏ ÌÉÎÉÊ É ÔÏÞÅË ËÏÎ×ÅÒÔÉÒÏ×ÁÎÏ. +\item[-o ÉÍÑ ÆÁÊÌÁ] ÚÁÄÁÔØ ÉÍÑ ÄÌÑ ×ÙÈÏÄÎÙÈ ÆÁÊÌÏ× +\item[-r] çÅÎÅÒÉÒÏ×ÁÔØ ËÏÎÃÙ ÓÔÒÏË × ÓÔÉÌÅ MS-DOS +\end{description} +\subsection{eheader}\label{eheader} + +\obsoletes{HEADER, MAPLIST, ALIGN} +íÏÄÉÆÉÃÉÒÕÅÔ É/ÉÌÉ ÐÏËÁÚÙ×ÁÅÔ ÉÎÆÏÒÍÁÃÉÀ ÉÚ ÚÁÇÏÌÏ×ËÁ ÒÁÓÔÒÏ×ÙÈ É ×ÅËÔÏÒÎÙÈ +ÆÁÊÌÏ× EPPL7. + +\subsection{evaluate}\label{evaluate} +\obsoletes{EVALUATE, MOVING, JUMPING, BORDER, EDGE, NEIGHBOR} +\subsection{extents}\label{extents} +çÅÎÅÒÉÒÕÅÔ ÔÁÂÌÉÃÕ ÐÒÅÄÅÌÏ× ËÏÏÒÄÉÎÁÔ ÄÌÑ ËÁÖÄÏÇÏ ÉÚ ËÌÁÓÓÏ×, ×ÓÔÒÅÞÁÀÝÉÈÓÑ +× ÆÁÊÌÅ. +\subsection{fill}\label{fill} +\obsoletes{FILL} +\subsection{intable}\label{intable} +\obsoletes{INTABLE} +çÅÎÅÒÉÒÕÅÔ ÎÏ×ÙÊ ÆÁÊÌ ÎÁ ÏÓÎÏ×ÁÎÉÉ ÎÅÓËÏÌØËÉÈ ÓÔÁÒÙÈ É ÔÁÂÌÉÃÙ ÓÏÏÔ×ÅÔÓÔ×ÉÑ. +\subsection{mosaic}\label{mosaic} +\obsoletes{MOSAIC}ÍÛÍ +ïÂßÅÄÉÎÑÅÔ ÎÅÓËÏÌØËÏ ËÁÒÔ × ÏÄÎÕ. +\subsection{neighbours}\label{neighbours} +çÅÎÅÒÉÒÕÅÔ ÔÁÂÌÉÃÕ ÓÏÓÅÄÓÔ× ËÌÁÓÓÏ× × ÕËÁÚÁÎÎÏÊ ËÁÒÔÅ. +\subsection{outtable}\label{outtable} +\obsoletes{OUTTABLE} +\subsection{reclass1}\label{reclass1} +\obsoletes{RECLASS (ÏÄÎÏÆÁÊÌÏ×ÙÊ)} +óÏÚÄÁÅÔ ÎÏ×ÕÀ ËÁÒÔÕ ÎÁ ÂÁÚÅ ÎÁÂÏÒÁ ÐÒÁ×ÉÌ Ó ÓÉÎÔÁËÓÉÓÏÍ ÜË×É×ÁÌÅÎÔÙÍ +ËÏÍÁÎÄÅ RECLASS EPPL7. +\subsection{transform}\label{transform} +\obsoletes{RESAMPLE, RESCALE, FILL} +ðÒÅÏÂÒÁÚÕÅÔ ËÁÒÔÕ ÉÚ ÏÄÎÏÊ ËÏÏÒÄÉÎÁÔÎÏÊ ÓÉÓÔÅÍÙ × ÄÒÕÇÕÀ É/ÉÌÉ ÍÅÎÑÅÔ +ÒÁÚÍÅÒ ÑÞÅÊËÉ. +\subsection{window}\label{window} +\obsoletes{window} +÷ÙÒÅÚÁÅÔ ÆÒÁÇÍÅÎÔ ÉÚ ËÁÒÔÙ. +\end{document} diff --git a/doc/layers.doc b/doc/layers.doc new file mode 100644 index 0000000..babf47f --- /dev/null +++ b/doc/layers.doc @@ -0,0 +1,91 @@ +Guidelines to impliment layers + +New types of layer can be defined in fgis using + +layer typedef command + +They should implement following commands + +1. info option + Obligatory + Returns boolean value indicating that certain operation + are supported by this layer. + Required options are + + opaque - layer could be displayed as base layer in planchet + lookable - layer could be inserted in planchet look list + legend - legend of this layer can be drawn by drawlegend command + limits - layer have working limits command + numeric - values of layer are subject of arithmetic operations + dimension - returns 0 if layer defined on the set of point, + 1 on set of lines (i.e. vector file) + 2 on continuous area (i.e. raster) + reclass - if it is raster layer, returns true if counting operation + should use reclass table otherwise can return anything +2. dump + Obligatory + Returns TCL script which can be used to reimplement this layer + using layer load command. + This script would be executed at global level with value of + variable fgisLayerName set to desired name of this layer. + All objects which could be neccessary for existance of layer + (i.e. legends, palettes, pattern sets) should be recreated + by this script. (it is assumed that all neccessary files exist + in same locations) + +3. value x y ?flag? + If lookable is true + Returns value of layer at given point +k + Flag can be one of following + -raw - return value + -list - return two-element list consisting of layer title and value + -titled -return string as you like to appear in look window + presumable results of + [join [$layer value $x $y -list] ": "] + If layer is not defined in given point, this command should return + empty string. + +4.show planchet mode + obligatory + should record information that layer is visible in specified planchet + and optionally create certain items in this planchet which are persistent. + These items should have same tag as layer name (may be among other tags) + mode is either -base or -overlay +5.hide planchet + obligatory + removes information that layer is visible in planchet. It is up to + planchet to remove all related items +6.redraw planchet + obligatory + Do all neccessary things to redraw itself in planchet, including + deletion of items which are no more applicable. + +7.configure option arg ?option arg? + obligatory + changes properties of layer and issues redraw command for all planchets, + where layer is currently visible, if this changes can affect view + +8. legclasses + if [$layer info legend] is true + returns list of classes, which should be drawn by drawlegend +9 sample canvas index x y ?mode? + if [$layer info legend] is true + given index from list returned from legclasses, canvas and coordinates + should draw sample of itself. All items constituting this sample should + have tag $layername$index + mode is either -base or -overlay +10 legtext index + if [$layer info legend] is true + returns text to draw near the sample +11 title +12 subtitle + Returns string to draw as title or subtitle of legend +13 expand list + given list of two-element lists + rasterclass area + return list of two-element lists + value area. +14 delete + Obligatory - destroys itself + diff --git a/doc/levels.eps b/doc/levels.eps new file mode 100644 index 0000000..7840c8e --- /dev/null +++ b/doc/levels.eps @@ -0,0 +1,147 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: levels.fig +%%Creator: fig2dev Version 3.1 Patchlevel 2 +%%CreationDate: Thu Jul 9 23:48:13 1998 +%%For: vitus@wagner (Victor Wagner,,,135-46-61,) +%Magnification: 1.00 +%%Orientation: Landscape +%%BoundingBox: 0 0 277 263 +%%Pages: 0 +%%BeginSetup +%%IncludeFeature: *PageSize Letter +%%EndSetup +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +-57.0 -161.0 translate + 90 rotate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit +n 0 612 m 0 0 l 792 0 l 792 612 l cp clip + 0.06000 0.06000 sc +7.500 slw +% Polyline +n 3900 975 m 5700 975 l 5700 1575 l 3900 1575 l cp gs col-1 s gr +% Polyline +n 5250 2175 m 7050 2175 l 7050 2850 l 5250 2850 l cp gs col-1 s gr +% Polyline +n 2700 2100 m 4500 2100 l 4500 2775 l 2700 2775 l cp gs col-1 s gr +% Polyline +n 2700 3000 m 4500 3000 l 4500 3525 l 2700 3525 l cp gs col-1 s gr +% Polyline +n 3525 3900 m 6300 3900 l 6300 4500 l 3525 4500 l cp gs col-1 s gr +% Polyline +n 3525 4950 m 6300 4950 l 6300 5550 l 3525 5550 l cp gs col-1 s gr +30.000 slw +% Polyline +n 4800 4500 m 4800 4950 l gs col-1 s gr +% Polyline +n 3900 3525 m 3900 3900 l gs col-1 s gr +% Polyline +n 5925 2850 m 5925 3900 l gs col-1 s gr +% Polyline +n 3900 2775 m 3900 3000 l gs col-1 s gr +% Polyline +n 4350 1575 m 4350 2100 l gs col-1 s gr +% Polyline +n 5550 1575 m 5550 2175 l gs col-1 s gr +% Polyline +n 3600 4950 m 3600 4725 l 3375 4725 l 3375 3525 l gs col-1 s gr +7.500 slw +% Polyline + [66.7] 0 sd +n 4500 3375 m 5625 2850 l gs col-1 s gr [] 0 sd +/Times-Roman ff 180.00 scf sf +4725 1350 m +gs 1 -1 sc (Data files) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 180.00 scf sf +6075 2625 m +gs 1 -1 sc (Utilities) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 180.00 scf sf +3600 2550 m +gs 1 -1 sc (Low-level Tcl objects) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 180.00 scf sf +3600 3375 m +gs 1 -1 sc (Layers) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 180.00 scf sf +4800 4350 m +gs 1 -1 sc (User-level Tcl commands) dup sw pop 2 div neg 0 rm col-1 sh gr +/Times-Roman ff 180.00 scf sf +4725 5400 m +gs 1 -1 sc (Graphic user interface) dup sw pop 2 div neg 0 rm col-1 sh gr +$F2psEnd +rs diff --git a/doc/levels.fig b/doc/levels.fig new file mode 100644 index 0000000..c16b10a --- /dev/null +++ b/doc/levels.fig @@ -0,0 +1,56 @@ +#FIG 3.1 +Portrait +Center +Inches +1200 2 +6 2700 2100 4500 2775 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 2700 2100 4500 2100 4500 2775 2700 2775 2700 2100 +4 1 -1 0 0 0 12 0.0000 4 180 1680 3600 2550 Low-level Tcl objects\001 +-6 +6 5250 2175 7050 2850 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 5250 2175 7050 2175 7050 2850 5250 2850 5250 2175 +4 1 -1 0 0 0 12 0.0000 4 135 615 6075 2625 Utilities\001 +-6 +6 2700 3000 4500 3525 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 2700 3000 4500 3000 4500 3525 2700 3525 2700 3000 +4 1 -1 0 0 0 12 0.0000 4 180 525 3600 3375 Layers\001 +-6 +6 3525 3900 6300 4500 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3525 3900 6300 3900 6300 4500 3525 4500 3525 3900 +4 1 -1 0 0 0 12 0.0000 4 135 1980 4800 4350 User-level Tcl commands\001 +-6 +6 3525 4950 6300 5550 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3525 4950 6300 4950 6300 5550 3525 5550 3525 4950 +4 1 -1 0 0 0 12 0.0000 4 180 1695 4725 5400 Graphic user interface\001 +-6 +6 3900 300 5700 900 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3900 300 5700 300 5700 900 3900 900 3900 300 +4 1 -1 0 0 0 12 0.0000 4 135 750 4725 675 Data files\001 +-6 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4800 4500 4800 4950 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3900 3525 3900 3900 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5925 2850 5925 3900 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 3900 2775 3900 3000 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 4 + 3600 4950 3600 4725 3375 4725 3375 3525 +2 1 1 1 -1 7 0 0 -1 4.000 0 0 -1 0 0 2 + 4500 3375 5625 2850 +2 2 0 1 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 + 3900 1200 6225 1200 6225 1800 3900 1800 3900 1200 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4200 1800 4200 2100 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 5775 1800 5775 2175 +2 1 0 3 -1 7 0 0 -1 0.000 0 0 -1 0 0 2 + 4875 900 4875 1200 +4 1 -1 0 0 0 12 0.0000 4 180 1485 5025 1575 Data access library\001 diff --git a/doc/levels.gif b/doc/levels.gif new file mode 100644 index 0000000..c4b1bb7 Binary files /dev/null and b/doc/levels.gif differ diff --git a/doc/levels.pbm b/doc/levels.pbm new file mode 100644 index 0000000..bc95db4 --- /dev/null +++ b/doc/levels.pbm @@ -0,0 +1,3300 @@ +P1 +# CREATOR: XV Version 3.10a Rev: 12/29/94 +311 371 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \ No newline at end of file diff --git a/doc/levels.xbm b/doc/levels.xbm new file mode 100644 index 0000000..c0ce86a --- /dev/null +++ b/doc/levels.xbm @@ -0,0 +1,1209 @@ +#define levels.xbm_width 311 +#define levels.xbm_height 371 +static unsigned char levels.xbm_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x20, 0x0d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, + 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x42, 0x80, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x82, 0xcc, 0x33, 0xb8, 0x89, 0xe1, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x82, 0x92, 0x48, 0x10, 0x49, 0x92, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x82, 0x9c, 0x70, + 0x10, 0xc9, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x42, 0x92, 0x48, 0x10, 0x49, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x62, 0x92, 0x48, 0x10, 0xc9, 0x94, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3f, 0x2c, 0xb3, 0x90, 0x9f, 0x73, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, + 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x20, 0xc8, 0x3c, 0x03, 0x86, 0x61, 0x18, 0x8e, 0x83, 0xe6, + 0x34, 0xd3, 0x33, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0x28, 0x89, 0x04, 0x49, 0x92, 0x24, + 0x49, 0x82, 0x24, 0x99, 0x64, 0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, 0xc8, 0x09, 0x07, + 0x4e, 0x10, 0x3c, 0xc3, 0x80, 0x24, 0x09, 0x27, 0x1a, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x20, + 0x24, 0x89, 0x04, 0x49, 0x10, 0x04, 0x0c, 0x83, 0x24, 0x89, 0x24, 0x0a, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x20, 0x26, 0x89, 0x04, 0x49, 0x92, 0x4c, 0x49, 0x82, 0x24, + 0x89, 0x24, 0x0c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0xf0, 0xc3, 0x32, 0x0b, 0x96, 0x61, 0x38, + 0xc7, 0xc1, 0xef, 0x1c, 0x7b, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xe2, 0x00, 0x00, 0x00, 0x0c, + 0x00, 0x80, 0xe1, 0x0f, 0x0c, 0xc0, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x42, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x21, 0x09, 0x08, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x42, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x01, 0x08, 0x80, + 0x00, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x42, 0xc0, 0xdc, 0x06, 0x88, 0x99, 0x19, 0x01, + 0xc1, 0x08, 0x8c, 0x33, 0x86, 0x79, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x42, 0x20, 0x49, 0x02, 0x48, + 0x92, 0x24, 0x01, 0x21, 0x09, 0x92, 0x24, 0x49, 0x12, 0x09, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x42, 0x20, + 0x59, 0xf3, 0xc9, 0xd3, 0x3c, 0x01, 0x21, 0x08, 0x92, 0x24, 0x4f, 0x10, + 0x03, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, + 0x73, 0xd0, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x42, 0x20, 0x51, 0x01, 0x48, 0x50, 0x04, 0x01, 0x21, 0x08, 0x92, + 0x24, 0x41, 0x10, 0x0c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x21, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x42, 0x24, 0xb1, 0x00, 0xc8, 0x64, 0x4c, 0x01, + 0x21, 0x09, 0x92, 0x24, 0x53, 0x12, 0x09, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x21, 0x81, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xe2, 0xc7, 0x90, 0x00, 0x9c, + 0x23, 0xb8, 0x83, 0xc3, 0x1c, 0x8c, 0x23, 0x8e, 0x61, 0x07, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x9f, 0xf6, + 0x63, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x91, 0x24, 0x92, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x21, 0x91, 0x24, 0xf2, 0x0c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x21, 0x91, 0x24, 0x12, 0x30, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x33, 0x91, 0x24, + 0x32, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0xfe, 0xcf, 0xe7, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0c, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x20, 0x60, 0x66, 0xa6, 0x39, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x20, 0x90, 0x24, + 0xc9, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x20, 0xe0, 0x34, 0x4f, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x90, 0x14, 0x41, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x20, 0x92, 0x18, 0x53, 0x24, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x63, 0x09, + 0xee, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x70, 0x0e, 0x00, 0x00, 0x18, 0x00, 0x00, 0xc3, + 0x1f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x20, 0x04, 0x00, 0x00, 0x10, + 0x00, 0x00, 0x42, 0x12, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x20, 0x04, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x02, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x20, 0xc4, 0x31, 0x0d, 0x10, 0x33, 0x33, 0x02, 0x82, 0x11, 0x18, + 0xa6, 0x4d, 0x1b, 0xa6, 0xe1, 0x38, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x20, 0x24, 0x49, 0x06, 0x90, 0x24, 0x49, 0x02, + 0x42, 0x12, 0x24, 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x20, 0x64, 0x78, 0xe2, 0x93, + 0xa7, 0x79, 0x02, 0x42, 0x10, 0x04, 0x49, 0x92, 0x24, 0x4e, 0x92, 0x0c, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x20, 0x84, + 0x09, 0x02, 0x90, 0xa0, 0x08, 0x02, 0x42, 0x10, 0x04, 0x49, 0x92, 0x24, + 0x49, 0x92, 0x30, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x60, 0x26, 0x99, 0x02, 0x90, 0xc9, 0x98, 0x02, 0x42, 0x12, 0x24, + 0x49, 0x92, 0x24, 0x49, 0x92, 0x24, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0xc0, 0xe3, 0x70, 0x07, 0x38, 0x47, 0x70, 0x07, + 0x87, 0x39, 0x18, 0xe6, 0xf6, 0x6d, 0xf6, 0x66, 0x1d, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x5c, + 0x00, 0x00, 0x06, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x66, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x42, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x9a, 0x79, 0x9c, + 0x31, 0xd8, 0x38, 0xa6, 0xb1, 0xe6, 0x99, 0x3e, 0x86, 0x61, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xe1, + 0x4c, 0x92, 0x24, 0x49, 0x90, 0x24, 0xc9, 0x20, 0x49, 0x24, 0x13, 0x49, + 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x41, 0x84, 0x93, 0x24, 0x09, 0x90, 0x0c, 0x4f, 0x20, 0x49, + 0x3c, 0x11, 0x4e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x42, 0x44, 0x92, 0x24, 0x09, 0x90, 0x30, + 0x41, 0x20, 0x49, 0x04, 0x11, 0x49, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x66, 0x44, 0x92, 0x24, + 0x49, 0x90, 0x24, 0x53, 0x20, 0x49, 0x4c, 0x11, 0x49, 0x32, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x3c, + 0x8e, 0x75, 0xee, 0x33, 0x60, 0x1d, 0xee, 0xf0, 0x9b, 0xb9, 0x13, 0x96, + 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/doc/lib_doc.tex b/doc/lib_doc.tex new file mode 100644 index 0000000..fb4a8b3 --- /dev/null +++ b/doc/lib_doc.tex @@ -0,0 +1,1196 @@ +\documentclass{report} +\usepackage[koi8-r]{inputenc} +\usepackage[russian]{babel} +\newcommand{\function}[1]{\par\smallskip{\raggedright\setlength{\hangindent}{2cm}\noindent\tt #1\par} \smallskip} +\newcommand{\var}[2]{\par\smallskip{\setlength{\hangindent}{1cm}\noindent\tt#1\rm~--- #2\par} \smallskip} +\textwidth=6.3in +\oddsidemargin=0.5in +\title{âÉÂÌÉÏÔÅËÁ ÄÌÑ ÒÁÂÏÔÙ\\ Ó ÆÁÊÌÁÍÉ EPPL7.\\òÕËÏ×ÏÄÓÔ×Ï ÐÒÏÇÒÁÍÍÉÓÔÁ} +\author{÷.â.~÷ÁÇÎÅÒ} +\makeindex +\begin{document} +\maketitle +\tableofcontents +\chapter*{÷×ÅÄÅÎÉÅ}\addcontentsline{toc}{chapter}{÷×ÅÄÅÎÉÅ} + +âÉÂÌÉÏÔÅËÁ ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÄÌÑ ÒÁÂÏÔÙ Ó ×ÅËÔÏÒÎÙÍÉ É ÒÁÓÔÒÏ×ÙÍÉ +ÆÁÊÌÁÍÉ EPPL7 ÉÚ ÐÒÏÇÒÁÍÍ ÎÁ ÑÚÙËÅ C. âÉÂÌÉÏÔÅËÁ ÒÁÓÞÉÔÁÎÁ ÎÁ +ÒÁÂÏÔÕ × 32-ÒÁÚÒÑÄÎÏÊ ÓÒÅÄÅ. ÷ ÐÒÉÎÃÉÐÅ ÎÅÂÏÌØÛÉÅ ÐÒÏÇÒÁÍÍÙ +ÓÐÏÓÏÂÎÙ ÒÁÂÏÔÁÔØ É × 16-ÒÁÚÒÑÄÎÏÊ ÓÒÅÄÅ, ÎÏ ÐÏÓËÏÌØËÕ ÓÐÅÃÉÁÌØÎÙÈ +ÍÅÒ ÄÌÑ ÜÔÏÇÏ ÎÅ ÐÒÉÎÉÍÁÌÏÓØ, ÒÁÂÏÔÁ × ÍÏÄÅÌÑÈ ÐÁÍÑÔÉ Compact, Large +É Huge ÎÅ ÇÁÒÁÎÔÉÒÕÅÔÓÑ. + +÷ ÂÉÂÌÉÏÔÅËÁÈ ÐÒÅÄÕÓÍÏÔÒÅÎ ËÏÄ ÄÌÑ ÒÁÂÏÔÙ ÎÁ ÐÒÏÃÅÓÓÏÒÁÈ Ó +ÐÒÑÍÙÍ ÐÏÒÑÄËÏÍ ÂÁÊÔ (MSB First), ÈÏÔÑ ÏÎ ÐÏËÁ ÎÅ ÏÔÔÅÓÔÉÒÏ×ÁÎ. + +ôÅÍ ÎÅ ÍÅÎÅÅ ÎÅ ÒÅËÏÍÅÎÄÕÅÔÓÑ ÉÓÐÏÌØÚÏ×ÁÔØ ÞÉÔÁÔØ ÆÁÊÌÙ EPPL7 ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ, +ÔÁË ËÁË ÐÒÉ ÜÔÏÍ ÐÒÉÄÅÔÓÑ ÏÂÒÁÝÁÔØ ×ÎÉÍÁÎÉÅ ÎÁ ÐÏÒÑÄÏË ÂÁÊÔÏ× × ÓÌÏ×Å. + +ðÏÓËÏÌØËÕ ÏÒÉÇÉÎÁÌØÎÙÊ ÐÁËÅÔ EPPL7 ÒÁÂÏÔÁÌ ÐÏÄ DOS, ×ÓÅ ÅÇÏ ÆÁÊÌÙ, +ÈÒÁÎÑÝÉÅÓÑ × Ä×ÏÉÞÎÏÍ ÆÏÒÍÁÔÅ ÉÓÐÏÌØÚÕÀÔ ÐÏÒÑÄÏË ÂÁÊÔÏ× ÐÒÏÃÅÓÓÏÒÁ Intel~--- +ÍÌÁÄÛÉÊ ÂÁÊÔ ÐÅÒ×ÙÍ. + + +âÉÂÌÉÏÔÅËÉ ÎÅ ÉÓÐÏÌØÚÕÀÔ ÓÉÓÔÅÍÎÙÈ ×ÙÚÏ×Ï× É ÂÉÂÌÉÏÔÅÞÎÙÈ ÆÕÎËÃÉÊ, +ÓÐÅÃÉÆÉÞÎÙÈ ÄÌÑ UNIX\footnote{úÁ ÉÓËÌÀÞÅÎÉÅÍ ÕÔÉÌÉÔ ÄÌÑ ÒÁÂÏÔÙ Ó ÆÁÊÌÏ×ÏÊ +ÓÉÓÔÅÍÏÊ É ÏÂÒÁÂÏËÉ ÐÒÅÒÙ×ÁÎÉÑ ÐÒÏÇÒÁÍÍÙ. üÔÉ ÆÕÎËÃÉÉ ÌÏËÁÌÉÚÏ×ÁÎÙ +× ÍÏÄÕÌÅ {\tt file\_utils.c} É ÏÐÉÓÁÎÙ × ÇÌÁ×Å \ref{utils}}. + +ðÒÉ ÒÁÚÒÁÂÏÔËÅ ÂÉÂÌÉÏÔÅË ÐÒÅÄÐÏÌÁÇÁÌÏÓØ, ÞÔÏ ÔÉÐ {\tt long int} ÉÍÅÅÔ +ÒÁÚÍÅÒ 32 ÂÉÔÁ, {\tt short int}~--- 16 ÂÉÔ É {\tt double}~--- 64 ÂÉÔÁ, +× ÆÏÒÍÁÔÅ, ÕÄÏ×ÌÅÔ×ÏÒÑÀÝÅÍ ÓÔÁÎÄÁÒÔÕ IEEE. + +\chapter{ìÏÇÉÞÅÓËÁÑ ÍÏÄÅÌØ ÆÁÊÌÏ× ÄÁÎÎÙÈ} +\section{òÁÓÔÒ} + +ôÅÏÒÅÔÉÞÅÓËÉ, ÒÁÓÔÒÏ×ÁÑ ËÁÒÔÁ Ñ×ÌÑÅÔÓÑ ÆÕÎËÃÉÅÊ ÏÔ ËÏÏÒÄÉÎÁÔ, +ÚÎÁÞÅÎÉÑ ËÏÔÏÒÏÊ Ñ×ÌÑÀÔÓÑ ÞÉÓÌÁÍÉ ÉÌÉ ÜÌÅÍÅÎÔÁÍÉ ÎÅËÏÔÏÒÏÇÏ +ËÏÎÅÞÎÏÇÏ ÍÎÏÖÅÓÔ×Á, ÏÐÒÅÄÅÌÅÎÎÏÊ ×ÎÕÔÒÉ ÎÅËÏÔÏÒÏÊ ÇÅÏÍÅÔÒÉÞÅÓËÏÊ +ÆÉÇÕÒÙ ÎÁ ÄÅËÁÒÔÏ×ÏÊ ËÏÏÒÄÉÎÁÔÎÏÊ ÐÌÏÝÁÄÉ. + +ðÒÁËÔÉÞÅÓËÉ ËÁË ÏÂÌÁÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ, ÔÁË É ÏÂÌÁÓÔØ ÚÎÁÞÅÎÉÊ +Ë×ÁÎÔÕÀÔÓÑ, Á ÃÅÌØÀ ÂÉÂÌÉÏÔÅËÉ Ñ×ÌÑÅÔÓÑ ×ÏÚÍÏÖÎÏÓÔØ +ÐÒÏÉÚ×ÏÌØÎÙÍ ÏÂÒÁÚÏÍ ÚÁÄÁ×ÁÔØ ÚÎÁÞÅÎÉÑ ÒÁÓÔÒÁ × ÌÀÂÏÊ ÎÕÖÎÏÊ ÔÏÞËÅ. + + +ðÏÜÔÏÍÕ, ÒÁÓÔÒÏ×ÙÅ ÆÁÊÌÙ EPPL7 (epp) ÒÁÓÓÍÁÔÒÉ×ÁÀÔÓÑ ËÁË ÂÏÌØÛÁÑ ÍÁÔÒÉÃÁ +ËÏÒÏÔËÉÈ (16-ÂÉÔ) ÃÅÌÙÈ. òÁÚÍÅÒÙ ÍÁÔÒÉÃÙ ÍÏÇÕÔ ÄÏÓÔÉÇÁÔØ $30000\times30000$ +Á ÚÎÁÞÅÎÉÑ - ÐÒÉÎÉÍÁÔØ ÌÀÂÏÅ ÚÎÁÞÅÎÉÅ, ÄÏÐÕÓÔÉÍÏÅ ÄÌÑ ÔÉÐÁ +{\tt unsigned short} Ô.Å. 0--65535. + +óÏÏÔ×ÅÔÓÔ×ÉÅ ÍÅÖÄÕ ×ÅÝÅÓÔ×ÅÎÎÙÍÉ ËÁÒÔÏÇÒÁÆÉÞÅÓËÉÍÉ +ËÏÏÒÄÉÎÁÔÁÍÉ É ÃÅÌÏÞÉÓÌÅÎÙÍÉ ÉÎÄÅËÓÁÍÉ × ÍÁÔÒÉÃÅ (ÒÑÄÁÍÉ É ËÏÌÏÎËÁÍÉ) +ÈÒÁÎÉÔÓÑ × ÚÁÇÏÌÏ×ËÅ epp-ÆÁÊÌÁ, É × ÂÉÂÌÉÏÔÅËÅ ÐÒÅÄÕÓÍÏÔÒÅÎÙ ÆÕÎËÃÉÉ +ÄÌÑ ÐÅÒÅÓÞÅÔÁ ÏÄÎÉÈ × ÄÒÕÇÉÅ. + +îÏÍÅÒÁ ÒÑÄÏ×/ËÏÌÏÎÏË × ÆÁÊÌÅ ÎÅ ÏÂÑÚÁÔÅÌØÎÏ ÎÁÞÉÎÁÀÔÓÑ Ó ÅÄÉÎÉÃÙ. +äÌÑ ÎÉÈ ÄÏÐÕÓÔÉÍÙ ÌÀÂÙÅ ÚÎÁÞÅÎÉÑ × ÄÉÁÐÁÚÏÎÅ -32767--+32767. + +üÔÏ ÐÏÚ×ÏÌÑÅÔ × ÆÁÊÌÅ, ÐÏËÒÙ×ÁÀÝÅÍ ÎÅÂÏÌØÛÎÏÊ ÕÞÁÓÔÏË ÔÅÒÒÉÔÏÒÉÉ ÉÍÅÔØ +ÓÏ×ÍÅÓÔÉÍÏÓÔØ Ó Â\`ÏÌØÛÉÍ ÆÁÊÌÏÍ ÎÅ ÔÏÌØËÏ ÐÏ ÁÌØÔÅÒÎÁÔÉ×ÎÙÍ ËÏÏÒÄÉÎÁÔÁÍ, +ÎÏ É ÐÏ ÎÏÍÅÒÁÍ ÒÑÄÏ×/ËÏÌÏÎÏË. + +ïÂÙÞÎÏ ÑÞÅÊËÉ × ÆÁÊÌÅ Ë×ÁÄÒÁÔÎÙÅ, ÈÏÔÑ ×ÓÅ ÐÒÏÃÅÄÕÒÙ ÂÉÂÌÉÏÔÅËÉ +ÂÕÄÕÔ ËÏÒÒÅËÔÎÏ ÒÁÂÏÔÁÔØ Ó ÆÁÊÌÁÍÉ, × ËÏÔÏÒÙÈ ÒÁÚÍÅÒÙ ÑÞÅÊËÉ ÐÏ ×ÅÒÔÉËÁÌÉ +É ÐÏ ÇÏÒÉÚÏÎÔÁÌÉ ÒÁÚÌÉÞÎÙ. + +úÎÁÞÅÎÉÅ ÐÌÏÝÁÄÉ ÑÞÅÊËÉ ×ÍÅÓÔÅ Ó ÒÁÚÍÅÒÎÏÓÔØÀ (Ë×ÁÄÒÁÔÎÙÅ ÍÅÔÒÙ, ÆÕÔÙ, +ÇÅËÔÁÒÙ É ÄÒ.) ÈÒÁÎÉÔÓÑ × ÚÁÇÏÌÏ×ËÅ ÆÁÊÌÁ. ìÉÎÅÊÎÙÅ ÅÄÉÎÉÃÙ ÁÌØÔÅÒÎÔÁÔÉ×ÎÙÈ +ËÏÏÒÄÉÎÁÔ ÎÉÇÄÅ ÎÅ ÏÐÉÓÙ×ÁÀÔÓÑ, ÎÏ ÄÌÑ ÓÏ×ÍÅÓÔÉÍÏÓÔÉ ÎÅ ÒÅËÏÍÅÎÄÕÅÔÓÑ +ÉÓÐÏÌØÚÏ×ÁÔØ ÎÉËÁËÉÈ ÅÄÉÎÉà ËÒÏÍÅ ÍÅÔÒÏ× ÉÌÉ ÇÒÁÄÕÓÏ× (ÅÓÌÉ ÆÁÊÌ ÈÒÁÎÉÔÓÑ +× ÇÅÏÇÒÁÆÉÞÅÓËÉÈ ËÏÏÒÄÉÎÁÔÁÈ). + +ðÒÉ ÜÔÏÍ ÐÌÏÝÁÄØ ÑÞÅÊËÉ ÍÏÖÎÏ ÐÅÒÅ×ÅÓÔÉ × ÄÒÕÇÉÅ ÅÄÉÎÉÃÙ, ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ +ÉÚÍÅÎÉ× ËÏÄ ÒÁÚÍÅÒÎÏÓÔÉ, ÄÌÑ ÔÏÇÏ ÞÔÏÂÙ ÐÏÌÕÞÉÔØ ÂÏÌÅÅ ÕÄÏÂÏÞÉÔÁÅÍÙÅ ÞÉÓÌÁ +ÐÒÉ ÒÁÓÓÞÅÔÅ ÐÌÏÝÁÄÅÊ. + +ðÒÅÏÂÒÁÚÏ×ÁÎÉÅ ÍÎÏÖÅÓÔ×Á ÚÎÁÞÅÎÉÊ ËÁÒÔÙ × ÍÎÏÖÅÓÔ×Ï ÚÎÁÞÅÎÉÊ (ËÌÁÓÓÏ×) +epp-ÆÁÊÌÁ ÔÒÁÄÉÃÉÏÎÎÏ ÓÞÉÔÁÅÔÓÑ ÆÕÎËÃÉÅÊ ÌÅÇÅÎÄÙ, É ÎÁÈÏÄÉÔÓÑ ÚÁ +ÐÒÅÄÅÌÁÍÉ ÆÏÒÍÁÔÁ epp, Á, ÓÌÅÄÏ×ÁÔÅÌØÎÏ É ÄÁÎÎÏÊ ÂÉÂÌÉÏÔÅËÉ. + +ðÏÓËÏÌØËÕ ÍÁÔÒÉÃÁ ×ÓÅÇÄÁ ÐÒÑÍÏÕÇÏÌØÎÁ, Á ÏÂÌÁÓÔØ ÏÐÒÅÄÅÌÅÎÉÑ ËÁÒÔÙ~--- +ÎÅ ×ÓÅÇÄÁ, ÐÒÅÄÕÓÍÏÔÒÅÎÏ ÓÐÅÃÉÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ, ÎÁÚÙ×ÁÅÍÏÅ offsite. + +ðÒÉ ÞÔÅÎÉÉ epp-ÆÁÊÌÁ ÐÒÅÄÐÏÌÁÇÁÅÔÓÑ, ÞÔÏ ÒÁÚÍÅÒÙ ÅÇÏ ÂÅÓËÏÎÅÞÎÙ, ÎÏ +ÐÏÐÙÔËÁ ÐÒÏÞÉÔÁÔØ ÅÇÏ ÜÌÅÍÅÎÔ ÚÁ ÐÒÅÌÁÍÉ ÒÅÁÌØÎÏÇÏ ÆÁÊÌÁ ÐÒÉ×ÏÄÉÔ +Ë ×ÏÚ×ÒÁÔÕ ÚÎÁÞÅÎÉÑ offsite, ËÏÔÏÒÏÅ ÏÚÎÁÞÁÅÔ, ÞÔÏ × ÄÁÎÎÏÊ ÔÏÞËÅ +ÚÎÁÞÅÎÉÅ ÎÅ ÏÐÒÅÄÅÌÅÎÏ. úÎÁÞÅÎÉÅ offsite Ó×ÏÅ ÄÌÑ ËÁÖÄÏÊ ËÁÒÔÙ. ïÎÏ +ÈÒÁÎÉÔÓÑ × ÚÁÇÏÌÏ×ËÅ ÆÁÊÌÁ É × ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÍ ÐÏÌÅ ÓÔÒÕËÔÕÒÙ ÄÁÎÎÙÈ, +ÉÓÐÏÌØÚÕÅÍÏÊ ÄÌÑ ÄÏÓÔÕÐÁ Ë ÆÁÊÌÕ. + +âÏÌØÛÁÑ ÞÁÓÔØ ÁÌÇÏÒÉÔÍÏ×, ÉÓÐÏÌØÚÕÅÍÙÈ ÄÌÑ ÇÅÎÅÒÁÃÉÉ ÒÁÓÔÒÏ×ÙÈ ËÁÒÔ ÉÌÉ +ÄÌÑ ÉÈ ÁÎÁÌÉÚÁ, ÎÅ ÚÁ×ÉÓÉÔ ÏÔ ÐÏÒÑÄËÁ ÏÂÈÏÄÁ ÑÞÅÅË ËÁÒÔÙ, ÈÏÔÑ É ÔÒÅÂÕÅÔ +ÐÏÌÎÏÇÏ ÉÈ ÐÅÒÅÂÏÒÁ. ÷ ÜÔÉÈ ÓÌÕÞÁÑÈ ÒÅËÏÍÅÎÄÕÅÔÓÑ ÉÓÐÏÌØÚÏ×ÁÔØ +{\it ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÙÊ} +ÐÅÒÅÂÏÒ ÐÏ ÓÔÒÏËÁÍ, ËÁË ÓÁÍÙÊ ÜËÏÎÏÍÉÞÎÙÊ ÐÏ ÐÁÍÑÔÉ. + +äÒÕÇÏÊ ÒÁÓÐÒÏÓÔÒÁÎÅÎÎÙÊ ×ÁÒÉÁÎÔ ÄÏÓÔÕÐÁ, ÜÔÏ ËÏÇÄÁ ÐÒÉ ÏÂÒÁÂÏÔËÉ ËÏÎËÒÅÔÎÏÊ +ÑÞÅÊËÉ ÒÁÓÔÒÁ ÔÒÅÂÕÅÔÓÑ ÉÎÆÏÒÍÁÃÉÑ Ï ÚÎÁÞÅÎÉÑÈ, ÓÏÄÅÒÖÁÝÉÈÓÑ × ÓÏÓÅÄÎÉÈ ÑÞÅÊËÁÈ. + +÷ ÜÔÏÍ ÒÅÖÉÍÅ ÄÏÓÔÕÐ Ë ËÁÖÄÏÊ ÓÔÒÏËÅ ÒÁÓÔÒÁ ÔÒÅÂÕÅÔÓÑ ÎÅÓËÏÌØËÏ ÒÁÚ~--- +ÓÎÁÞÁÌÁ ÐÒÉ ÏÂÒÁÂÏÔËÅ ÏÄÎÏÊ ÉÌÉ ÎÅÓËÏÌØËÉÈ ÐÒÅÄÙÄÕÝÉÈ ÓÔÒÏË, ÐÏÔÏÍ ÐÒÉ ÏÂÒÁÂÏÔËÅ +ÓÁÍÏÊ ÜÔÏÊ ÓÔÒÏËÉ, É ÎÁËÏÎÅÃ, ÐÒÉ ÏÂÒÁÂÏÔËÅ ÓÌÅÄÕÀÝÉÈ ÓÔÒÏË. äÌÑ ÔÁËÉÈ ÓÉÔÕÁÃÉÊ +ÒÅÁÌÉÚÏ×ÁÎ {\it ËÜÛÉÒÏ×ÁÎÎÙÊ} ÄÏÓÔÕÐ, ÐÒÉ ËÏÔÏÒÏÍ ÎÅÓËÏÌØËÏ ÓÔÒÏË × +ÒÁÓÐÁËÏ×ÁÎÎÏÍ ×ÉÄÅ ÈÒÁÎÑÔÓÑ × ÐÁÍÑÔÉ. + +é, ÎÁËÏÎÅÃ, ÄÌÑ ÔÁËÉÈ ÐÒÉÌÏÖÅÎÉÊ ËÁË ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÅÄÁËÔÏÒÙ, ÒÅÁÌÉÚÏ×ÁÎ +{\it ÐÒÑÍÏÊ ÄÏÓÔÕÐ ÎÁ ÞÔÅÎÉÅ/ÚÁÐÉÓØ}. üÔÏÔ ÓÐÏÓÏ ÄÏÓÔÕÐÁ ÓÕÝÅÓÔ×ÅÎÎÏ ÍÅÄÌÅÎÎÅÅ, +ÞÅÍ ËÜÛÉÒÏ×ÁÎÎÙÊ, ÐÏÓËÏÌØËÕ ÓÔÒÏËÉ epp-ÆÁÊÌÁ ÈÒÁÎÑÔÓÑ × ÐÁÍÑÔÉ × +ÕÐÁËÏ×ÁÎÎÏÍ ×ÉÄÅ. + +äÌÑ ÕÐÒÏÝÅÎÉÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÐÅÒÅÂÏÒÁ ÑÞÅÅË ÓÕÝÅÓÔ×ÕÀÔ ÆÕÎËÃÉÉ-% +{\it ÉÔÅÒÁÔÏÒÙ}, ËÏÔÏÒÙÅ ÐÏÌÕÞÁÀÔ × ËÁÞÅÓÔ×Å ÐÁÒÁÍÅÔÒÁ ÆÕÎËÃÉÀ É +ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏ ÐÒÉÍÅÎÑÀÔ ÅÅ ËÏ ×ÓÅÍ ÑÞÅÊËÁÍ ÆÁÊÌÁ. + + +\section{÷ÅËÔÏÒ} + +÷ÅËÔÏÒÎÙÅ ÆÁÊÌÙ EPPL7 (dgt) ÐÒÅÄÓÔÁ×ÌÑÀÔ ÓÏÂÏÊ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÓÔØ +ÏÂßÅËÔÏ×~--- ÌÉÎÉÊ É ÔÏÞÅË. + +õÓÔÁÎÏ×ÌÅÎÉÅ ÓÏÏÔ×ÅÓÔ×ÉÑ ÍÅÖÄÕ ÏÂßÅËÔÏÍ É ËÏÏÒÄÉÎÁÔÁÍÉ ÐÒÅÄÓÔÁ×ÌÑÅÔ +ÄÌÑ ÎÉÈ ÓÕÝÅÓÔ×ÅÎÎÏ ÂÏÌÅÅ ÓÌÏÖÎÕÀ ÚÁÄÁÞÕ, ÞÅÍ ÕÓÔÁÎÏ×ÌÅÎÉÅ +ÓÏÏÔ×ÅÔÓÔ×ÉÑ ÍÅÖÄÕ ËÏÏÒÄÉÎÁÔÁÍÉ É ËÌÁÓÓÁÍÉ ÒÁÓÔÒÁ. + +äÌÑ ÂÏÌØÛÉÎÓÔ×Á ÓÐÏÓÏÂÏ× ÏÂÒÁÂÏËÉ ×ÅËÔÏÒÎÙÈ ÆÁÊÌÏ× ÔÏÖÅ ÄÏÓÔÁÔÏÞÎÏ +ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÐÅÒÅÂÏÒÁ ÏÂßÅËÔÏ×. + +÷ ÔÅÈ ÓÌÕÞÁÑÈ, ËÏÇÄÁ ÔÒÅÂÕÅÔÓÑ, ÎÁÐÒÉÍÅÒ, ÐÅÒÅÂÏÒ ×ÓÅÈ ÐÁÒ ÏÂßÅËÔÏ×, +ÍÏÖÎÏ ÚÁÇÒÕÚÉÔØ ×ÅËÔÏÒÎÙÊ ÆÁÊÌ × ÐÁÍÑÔØ. + +äÌÑ ×ÅËÔÏÒÎÙÈ ÆÁÊÌÏ× ÔÏÖÅ ÓÕÝÅÓÔ×ÕÀÔ ÉÔÅÒÁÔÏÒÙ, ÐÏÚ×ÏÌÑÀÝÉÅ ÐÒÉÍÅÎÉÔØ +ÐÅÒÅÄÁÎÎÕÀ ÆÕÎËÃÉÀ ËÏ ×ÓÅÍ ÌÉÎÉÑÍ, ËÏ ×ÓÅÍ ÔÏÞËÁÍ ÉÌÉ ×ÏÏÂÝÅ ËÏ +×ÓÅÍ ÏÂßÅËÔÁÍ × ÆÁÊÌÅ. + +ìÏÇÉÞÅÓËÁÑ ÓÔÒÕËÔÕÒÁ ×ÅËÔÏÒÎÏÇÏ ÆÁÊÌÁ EPPL7 ÔÁËÏ×Á: + +÷ ÅÇÏ ÚÁÇÏÌÏ×ËÅ ÏÐÒÅÄÅÌÑÅÔÓÑ ÐÒÑÍÏÕÇÏÌØÎÁÑ ÏÂÌÁÓÔØ × ËÁÒÔÏÇÒÁÆÉÞÅÓËÉÈ +(ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ) ËÏÏÒÄÉÎÁÔÁÈ, ËÏÔÏÒÕÀ ÐÏËÒÙ×ÁÅÔ ÆÁÊÌ. + +÷ÎÕÔÒÉ ÆÁÊÌÁ ×ÓÅ ËÏÏÒÄÉÎÁÔÙ ÈÒÁÎÑÔÓÑ ×Ï ×ÎÕÔÒÅÎÎÉÈ ÅÄÉÎÉÃÁÈ, ÄÌÑ ËÏÔÏÒÙÈ +×ÓÅÇÄÁ ÎÉÖÎÑÑ É ÌÅ×ÁÑ ÇÒÁÎÉÃÙ ÆÁÊÌÁ ÉÍÅÀÔ ÚÎÁÞÅÎÉÅ $-32767$, Á ×ÅÒÈÎÑÑ +É ÐÒÁ×ÁÑ~--- $+32767$. üÔÏ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÍÁËÓÉÍÁÌØÎÏ ×ÏÚÍÏÖÎÕÀ ÔÏÞÎÏÓÔØ +É ËÏÍÐÁËÔÎÏÓÔØ, ÎÏ ÐÒÉ×ÏÄÉÔ Ë ÐÒÏÂÌÅÍÁÍ ÐÒÉ ÒÁÓÞÅÔÅ ÒÁÓÓÔÏÑÎÉÊ É ÕÇÌÏ×, +É ÐÒÉÍÅÎÅÎÉÉ ÄÒÕÇÉÈ ÆÕÎËÃÉÊ ÁÎÁÌÉÔÉÞÅÓËÏÊ ÇÅÏÍÅÔÒÉÉ, ÐÏÓËÏÌØËÕ ×ÅÌÉÞÉÎÁ +ÅÄÉÎÉÞÎÏÇÏ ÏÔÒÅÚËÁ ÐÏ ÏÓÉ $X$ É ÐÏ ÏÓÉ $Y$ ÎÅ ÓÏ×ÐÁÄÁÀÔ. + +÷ÓÅ ÏÂßÅËÔÙ × ×ÅËÔÏÒÎÏÍ ÆÁÊÌÅ ÉÍÅÀÔ ÃÅÌÏÞÉÓÌÅÎÎÙÊ (32-ÂÉÔÎÙÊ) ÉÄÅÎÔÉÆÉËÁÔÏÒ. +îÅÄÏÐÕÓÔÉÍÙÍ ÚÎÁÞÅÎÉÅÍ ÄÌÑ ÉÄÅÎÔÉÆÉËÁÔÏÒÁ ÏÂßÅËÔÁ Ñ×ÌÑÅÔÓÑ 0, ÐÏÓËÏÌØËÕ +ÔÏÞËÁ Ó ÎÕÌÅ×ÙÍÉ ËÏÏÒÄÉÎÁÔÁÍÉ É ÎÕÌÅ×ÙÍ ÉÄÅÎÔÉÆÉËÁÔÏÒÏÍ ÉÓÐÏÌØÚÕÅÔÓÑ ËÁË +ÐÒÉÚÎÁË ËÏÎÃÁ ÆÁÊÌÁ. + +÷ÅËÔÏÒÎÙÊ ÆÁÊÌ EPPL7 ÍÏÖÅÔ ÈÒÁÎÉÔØ Ä×Á ÔÉÐÁ ÏÂßÅËÔÏ×: ÌÉÎÉÉ É ÔÏÞËÉ. + +ôÏÞËÁ ÉÍÅÅÔ Ä×Å ËÏÏÒÄÉÎÁÔÙ É ÉÄÅÎÔÉÆÉËÁÔÏÒ. + +äÌÑ ÌÉÎÉÉ ÈÒÁÎÉÔÓÑ ÉÄÅÎÔÉÆÉËÁÔÏÒ, ËÏÏÒÄÉÎÁÔÙ ÍÉÎÉÍÁÌØÎÏÇÏ ÐÒÑÍÏÕÇÏÌØÎÉËÁ, +ÚÁËÌÀÞÁÀÝÅÇÏ × ÓÅÂÅ ÌÉÎÉÀ, ÞÉÓÌÏ ÔÏÞÅË É ÎÁÂÏÒ ÐÁÒ ËÏÏÒÄÉÎÁÔ. + +ëÏÌÉÞÅÓÔ×Ï ÔÏÞÅË × ÌÉÎÉÉ ÎÅ ÍÏÖÅÔ ÐÒÅ×ÙÛÁÔØ 500. + +æÕÎËÃÉÉ ÂÉÂÌÉÏÔÅËÉ ÚÁÂÏÔÑÔÓÑ Ï ÔÏÍ, ÞÔÏÂÙ ËÏÏÒÄÉÎÁÔÙ ÏÂßÅÍÌÀÝÅÇÏ +ÐÒÑÍÏÕÇÏÌØÎÉËÁ (ÍÁÓËÉ ÌÉÎÉÉ) ÂÙÌÉ ËÏÒÒÅËÔÎÙÍÉ. + +\chapter{æÕÎËÃÉÉ ÄÏÓÔÕÐÁ Ë epp ÆÁÊÌÁÍ} + +æÕÎËÃÉÉ ÐÅÒÅÍÅÎÎÙÅ, ÎÅÏÂÈÏÄÉÍÙÅ ÄÌÑ ÄÏÓÔÕÐÁ Ë epp-ÆÁÊÌÁÍ +ÏÐÉÓÁÎÙ × ÆÁÊÌÅ {\tt epp.h}. ÷ ÎÅÍ ÏÐÉÓÁÎÁ ÓÔÒÕËÔÕÒÁ ÄÁÎÎÙÈ +{\tt EPP}, ÈÒÁÎÑÝÁÑ ÉÎÆÏÒÍÁÃÉÀ Ï ÏÔËÒÙÔÏÍ epp-ÆÁÊÌÅ. + +÷ÎÕÔÒÅÎÎÅÅ ÕÓÔÒÏÊÓÔ×Ï ÜÔÏÊ ÓÔÒÕËÔÕÒÙ ÏÐÉÓÁÎÏ × ÒÁÚÄÅÌÅ \ref{EPP-internals}. + +ðÒÁËÔÉÞÅÓËÉ ÌÅÚÔØ ×ÎÕÔÒØ ÜÔÏÊ ÓÔÒÕËÔÕÒÙ ÐÒÉ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÉ +ÐÒÉËÌÁÄÎÙÈ ÚÁÄÁÞ ÎÅÔ ÎÅÏÂÈÏÄÉÍÏÓÔÉ. ÷ÓÑ ÒÁÂÏÔÁ Ó ÎÅÊ ÐÒÏÉÚ×ÏÄÉÔÓÑ +Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÊ ÂÉÂÌÉÏÔÅËÉ. + +üÔÁ ÓÔÒÕËÔÕÒÁ ÄÁÎÎÙÈ ÈÒÁÎÉÔ ÎÁÉÂÏÌÅÅ ÓÕÝÅÓÔ×ÅÎÎÕÀ ÉÎÆÏÒÍÁÃÉÀ ÉÚ +ÚÁÇÏÌÏ×ËÁ EPP-ÆÁÊÌÁ. úÎÁÞÅÎÉÑ ÔÅÈ ÐÏÌÅÊ ËÏÔÏÒÙÅ ÎÅ ÈÒÁÎÑÔÓÑ × ÜÔÏÊ +ÓÔÒÕËÔÕÒÅ, ÍÏÖÎÏ ÐÒÏÞÉÔÁÔØ ÉÌÉ ÉÚÍÅÎÉÔØ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÊ, ÏÐÉÓÁÎÎÙÈ +× ÒÁÚÄÅÌÅ \ref{EPPHEADER}. + +\section{ðÏÌÑ ÓÔÒÕËÔÕÒÙ EPP}\index{EPP} +÷ ÜÔÏÍ ÒÁÚÄÅÌÅ ÏÐÉÓÁÎÙ ÔÏÌØËÏ ÔÅ ÐÏÌÑ, ÚÎÁÞÅÎÉÑ ËÏÔÏÒÙÈ ÄÏÓÔÁÔÏÞÎÏ +ÞÁÓÔÏ ÉÓÐÏÌØÚÕÀÔÓÑ ÐÒÉ ÒÅÁÌÉÚÁÃÉÉ ÐÒÉËÌÁÄÎÙÈ ÁÌÇÏÒÉÔÍÏ×. ïÓÔÁÌØÎÙÅ +ÐÏÌÑ É ÐÒÉÎÃÉÐÙ ÒÁÂÏÔÙ Ó ÎÉÍÉ ÏÐÉÓÁÎÙ × ÒÁÚÄÅÌÅ \ref{EPP-internals}. +÷ÓÅ ÐÏÌÑ, ÐÒÏ ËÏÔÏÒÙÅ ÎÅ ÓËÁÚÁÎÏ ÏÂÒÁÔÎÏÇÏ, ÍÏÖÎÏ ÔÏÌØËÏ ÞÉÔÁÔØ. +äÌÑ ÉÈ ÉÚÍÅÎÅÎÉÑ ÉÓÐÏÌØÚÕÊÔÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÆÕÎËÃÉÉ, ÐÏÓËÏÌØËÕ +ÉÚÍÅÎÅÎÉÅ ÚÎÁÞÅÎÉÊ ÎÅËÏÔÏÒÙÈ ÐÏÌÅÊ ÍÏÖÅÔ ÐÏÔÒÅÂÏ×ÁÔØ ÓÏÇÌÁÓÏ×ÁÎÎÏÇÏ +ÉÚÍÅÎÅÎÉÑ ËÁËÉÈ-ÔÏ ÄÒÕÇÉÈ. + +\index{EPP!fc}\index{EPP!lc}\index{EPP!fr}\index{EPP!lr}% +\index{fr}\index{lr}\index{fc}\index{lc}\index{shift_epp}% +\var{int fr,lr,fc,lc}{ îÏÍÅÒÁ ÐÅÒ×ÏÊ ÓÔÒÏËÉ É ËÏÌÏÎËÉ, Á ÔÁËÖÅ ÚÎÁÞÅÎÉÑ +ÎÁ ÅÄÉÎÉÃÕ ÂÏÌØÛÅ ÐÏÓÌÅÄÎÅÊ ÓÔÒÏËÉ É ËÏÌÏÎËÉ. îÁ ÅÄÉÎÉÃÕ ÂÏÌØÛÅ ÏÎÉ +ÐÏÔÏÍÕ, ÞÔÏ × ÜÔÏÍ ÓÌÕÞÁÅ ËÏÎÓÔÒÕËÃÉÉ {\tt lc $-$ fc} É {\tt lr $-$ fr} +ÄÁÀÔ ËÏÌÉÞÅÓÔ×Ï ÓÔÒÏË É ËÏÌÏÎÏË × ÆÁÊÌÅ. äÌÑ ÉÚÍÅÎÅÎÉÑ ÉÓÐÏÌØÚÕÅÔÓÑ ÆÕÎËÃÉÑ +{\tt shift\_epp} } + +\index{EPP!Xleft}\index{EPP!YBottom}\index{EPP!XRight}\index{EPP!YTop} +\index{XLeft!EPP}\index{YBottom!EPP}\index{XRight!EPP}\index{YTop!EPP} +\var{double Xleft,YBottom,XRight,YTop}{ ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ (ËÁÒÏÇÒÁÆÉÞÅÓËÉÅ) +ËÏÏÒÄÉÎÁÔÙ ÇÒÁÎÉà ËÁÒÔÙ.} + +\index{EPP!offsite}\index{offsite}% +\var{int offsite}{ ÚÎÁÞÅÎÉÅ offsite. åÓÌÉ ÆÁÊÌ ÏÔËÒÙÔ ÎÁ ÚÁÐÉÓØ, ÜÔÏ + ÚÎÁÞÅÎÉÅ ÍÏÖÎÏ ÍÅÎÑÔØ.} + +\index{EPP!cell_area}\index{cell_area}% +\var{double cell\_area}{ ÐÌÏÝÁÄØ ÑÞÅÊËÉ × ÅÄÉÎÉÃÁÈ, ÕËÁÚÁÎÎÙÈ × ÚÁÇÏÌÏ×ËÅ +ÆÁÊÌÁ. óÍ. ÒÁÚÄÅÌ \ref{EPPHEADER}.} + +\index{EPP!kind}\index{kind}% +\var{int kind}{ ËÏÌÉÞÅÓÔ×Ï ÂÉÔ ÎÁ ÑÞÅÊËÕ. íÏÖÅÔ ÐÒÉÎÉÍÁÔØ ÚÎÁÞÅÎÉÑ 8 ÉÌÉ 16.} + + +éÎÆÏÒÍÁÃÉÑ ÉÚ ÚÁÇÏÌÏ×ËÁ ÆÁÊÌÁ epp, ËÏÔÏÒÁÑ ÎÅ ÐÏÐÁÌÁ × ×ÙÛÅÐÅÒÅÞÉÓÌÅÎÎÙÊ +ÓÐÉÓÏË ÐÏÌÅÊ, × ÓÔÒÕËÔÕÒÅ EPP ÎÅ ÈÒÁÎÉÔÓÑ. äÌÑ ÒÁÂÏÔÙ Ó ÎÅÊ ÎÕÖÎÏ +ÐÏÌÕÞÉÔØ ÐÏÌÎÕÀ ËÏÐÉÀ ÚÁÇÏÌÏ×ËÁ ÆÁÊÌÁ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ {\tt get\_epp\_header}% +\index{get_epp_header}. + +\index{mode}\index{EPP!mode}\index{MAP_INPUT}\index{MAP_OUTPUT} +\var{int mode}{ ÒÅÖÉÍ, × ËÏÔÏÒÏÍ ÏÔËÒÙÔ ÆÁÊÌ. ëÏÍÂÉÎÁÃÉÑ ËÏÎÓÔÁÎÔ +{\tt MAP\_INPUT} É {\tt MAP\_OUTPUT}.} + + +\section{ïÔËÒÙÔÉÅ ÆÁÊÌÁ É ÒÅÖÉÍÙ ÄÏÓÔÕÐÁ} + +\index{open_epp}% +\function{EPP* open\_epp( char *filename );} + +ïÔËÒÙ×ÁÅÔ ÆÁÊÌ Ó ÉÍÅÎÅÍ {\tt filename} É ×ÏÚ×ÒÁÝÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ +ÓÔÒÕËÔÕÒÕ EPP. æÁÊÌ ÄÏÌÖÅÎ ÓÕÝÅÓÔ×Ï×ÁÔØ. òÅÖÉÍ ÏÔËÒÙÔÉÑ ÕÓÔÁÎÁ×ÌÉ×ÁÅÔÓÑ +× {\tt MAP\_INPUT}. + +\index{fopen_epp}% +\function{EPP* fopen\_epp(FILE *f);} +ïÔËÒÙ×ÁÅÔ ÆÁÊÌ ÁÎÁÌÏÇÉÞÎÏ {\tt open\_epp}, ÎÏ ÐÏÌÕÞÁÅÔ × ËÁÞÅÓÔ×Å +ÐÁÒÁÍÅÒÁ ÎÅ ÉÍÑ, Á ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÒÕËÔÕÒÕ FILE. üÔÏ ÐÏÚ×ÏÌÑÅÔ +ÉÓÐÏÌØÚÏ×ÁÔØ ÄÌÑ ÐÅÒÅÄÁÞÉ ÒÁÓÔÒÏ×ÏÊ ÉÎÆÏÒÍÁÃÉÉ ÎÅ ÔÏÌØËÏ ÉÍÅÎÏ×ÁÎÎÙÅ +ÆÁÊÌÙ ÎÁ ÄÉÓËÅ. äÅÓËÒÉÐÔÏÒ ÆÁÊÌÁ f ÄÏÌÖÅÎ ÄÏÐÕÓËÁÔØ ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÅ. + +\index{creat_epp} +\function{% +EPP *creat\_epp(char *pathname, int first\_col, int first\_row, int last\_col, + int last\_row, double AXLeft,double AYTop, double AXRight, + double AYBottom, int scale, int base, int offsite);} + + +óÏÚÄÁÅÔ ÎÏ×ÙÊ epp-ÆÁÊÌ É ÏÔËÒÙ×ÁÅÔ ÅÇÏ × ÒÅÖÉÍÅ {\tt MAP\_OUTPUT}. + +ðÒÉ ÓÏÚÄÁÎÉÉ ÆÁÊÌÁ ÕËÁÚÙ×ÁÀÔÓÑ ÅÇÏ ÒÁÚÍÅÒÙ, ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ ËÏÏÒÄÉÎÁÔÙ, +ÚÎÁÞÅÎÉÅ offsite É ÚÎÁÞÅÎÉÑ ÐÏÌÅÊ ÚÁÇÏÌÏ×ËÁ {\tt base} É {\tt scale}. + +äÌÑ ÓÏÚÄÁÎÉÑ Åpp ÆÁÊÌÅ × ÕÖÅ ÏÔËÒÙÔÏÍ ÆÁÊÌÅ UNIX ÓÕÝÅÓÔ×ÕÅÔ ÆÕÎËÃÉÑ +{\tt fcreat\_epp}\index{fcreat_epp}, ËÏÔÏÒÏÊ ×ÍÅÓÔÏ ÉÍÅÎÉ ÆÁÊÌÁ ÐÅÒÅÄÁÅÔÓÑ ÕËÁÚÁÔÅÌØ +ÎÁ ÓÔÒÕËÔÕÒÕ {\tt FILE}. + +÷Ï ÍÎÏÇÉÈ ÓÌÕÞÁÑÈ ÎÕÖÎÏ ÓÏÚÄÁÔØ ×ÙÈÏÄÎÏÊ ÆÁÊÌ ÔÏÇÏ ÖÅ ÒÁÚÍÅÒÁ É Ó ÔÏÊ +ÖÅ ËÏÏÒÄÉÎÁÔÎÏÊ ÓÉÓÔÅÍÏÊ, ÞÔÏ É ×ÈÏÄÎÏÊ. äÌÑ ÕÐÒÏÝÅÎÉÑ ÜÔÏÇÏ ÐÒÏÃÅÓÓÁ +ÓÕÝÅÓÔ×ÕÅÔ ÆÕÎËÃÉÑ +\index{creat_epp_as}% +\function{EPP *creat\_epp\_as(char *filename,EPP *pattern);} + +ËÏÔÏÒÁÑ ÓÏÚÄÁÅÔ ÆÁÊÌ, ËÏÐÉÒÕÑ ÂÏÌØÛÕÀ ÞÁÓÔØ ÉÎÆÏÒÍÁÃÉÉ ÚÁÇÏÌÏ×ËÁ ÉÚ +ÕÖÅ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ, ÕËÁÚÁÔÅÌØ ÎÁ ËÏÔÏÒÙÊ ÐÅÒÅÄÁÅÔÓÑ × +ÐÁÒÁÍÅÔÒÅ {\tt pattern}. äÌÑ ÎÅÅ ÔÁËÖÅ ÓÕÝÅÓÔ×ÕÅÔ ÁÎÁÌÏÇ, ÐÏÌÕÞÁÀÝÉÊ +ÎÅ ÉÍÑ, Á ÏÔËÒÙÔÙÊ ÆÁÊÌ. + +÷ÓÅ ÜÔÉ ÆÕÎËÃÉÉ ÐÏ ÕÍÏÌÞÁÎÉÀ ÓÏÚÄÁÀÔ 8-ÂÉÔÎÙÊ epp-ÆÁÊÌ. ôÏÞÎÅÅ, +ËÏÌÉÞÅÓÔ×Ï ÂÉÔ ÏÐÒÅÄÅÌÑÅÔÓÑ ÚÎÁÞÅÎÉÅÍ ÇÌÏÂÁÌØÎÏÊ ÐÅÒÅÍÅÎÎÏÊ +{\tt Create16bit}, ËÏÔÏÒÏÊ ÎÕÖÎÏ ÐÒÉÓ×ÏÉÔØ ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ ÄÌÑ +ÔÏÇÏ, ÞÔÏÂÙ ÓÏÚÄÁ×ÁÌÉÓØ 16-ÂÉÔÎÙÅ ÆÁÊÌÙ + +\section{éÚÍÅÎÅÎÉÅ ÒÅÖÉÍÏ× ÄÏÓÔÕÐÁ} + +ðÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÄÁÎÎÏÊ ÂÉÂÌÉÏÔÅËÉ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ ×ÓÅÇÄÁ ÏÔËÒÙ×ÁÅÔÓÑ +× ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÞÔÅÎÉÑ, Á ÎÏ×ÙÊ~--- × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ +ÚÁÐÉÓÉ. äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÐÏÌÕÞÉÔØ ÄÒÕÇÏÊ ÒÅÖÉÍ ÄÏÓÔÕÐÁ ÎÕÖÎÏ ÍÅÎÑÔØ ÒÅÖÉÍ +ÄÏÓÔÕÐÁ Ñ×ÎÙÍ ÏÂÒÁÚÏÍ. + +\index{reset_epp}% +\function{void reset\_epp(EPP *epp)} + +ðÅÒÅÏËÒÙ×ÁÅÔ ÄÌÑ ÞÔÅÎÉÑ ÆÁÊÌ, ÏÔËÒÙÔÙÊ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ. +÷ÓÅ ÎÅÚÁÐÏÌÎÅÎÎÙÅ ÓÔÒÏËÉ ÚÁÐÏÌÎÑÀÔÓÑ offsite. + +\index{set_epp_cache}% +\function{int set\_epp\_cache(EPP* epp, int lines);} + +óÏÚÄÁÅÔ ËÜÛ ÎÁ {\tt lines} ÓÔÒÏË. åÓÌÉ ËÜÛ ÒÁÎÅÅ ÓÕÝÅÓÔ×Ï×ÁÌ, +ÉÚÍÅÎÑÅÔ ÅÇÏ ÒÁÚÍÅÒ. {\tt set\_epp\_cache(epp,0);} ÏÔÍÅÎÑÅÔ ËÜÛÉÒÏ×ÁÎÉÅ +ÓÏ×ÓÅÍ. + +\index{load_epp} +\function{int load\_epp(EPP* epp);} + +úÁÇÒÕÖÁÅÔ ÆÁÊÌ, ÏÔËÒÙÔÙÊ ÄÌÑ ÞÔÅÎÉÑ × ÐÁÍÑÔØ É ÍÅÎÑÅÔ ÅÇÏ ÒÅÖÉÍ +ÎÁ {\tt MAP\_INPUT\verb!|!MAP\_OUTPUT}\index{MAP_INPUT},\index{MAP_OUTPUT}, Ô.Å. ÐÒÑÍÏÅ ÞÔÅÎÉÅ-ÚÁÐÉÓØ. + +\index{save_epp} +\function{int save\_epp(EPP *epp);} + +ÓÏÈÒÁÎÑÅÔ ÉÚÍÅÎÅÎÉÑ × ÚÁÇÒÕÖÅÎÎÏÍ ÆÁÊÌÅ ÎÁ ÄÉÓË. óÔÁÒÏÅ ÓÏÄÅÒÖÉÍÏÅ +ÐÒÉ ÜÔÏÍ ÔÅÒÑÅÔÓÑ. + +\index{save_epp_as} +\function{int save\_epp\_as(EPP *epp,char *newname);} + +óÏÈÒÁÎÑÅÔ ÆÁÊÌ ÐÏÄ ÎÏ×ÙÍ ÉÍÅÎÅÍ. óÔÁÒÙÊ ÆÁÊÌ ÐÒÉ ÜÔÏÍ ÚÁËÒÙ×ÁÅÔÓÑ. + +\index{fsave_epp_as} +\function{int fsave\_epp\_as(EPP *epp,FILE *f);} +áÎÁÌÏÇÉÞÎÁ {\tt save\_epp\_as}, ÎÏ ÐÏÌÕÞÁÅÔ ÎÅ ÉÍÑ ÆÁÊÌÁ, Á ÕÖÅ ÏÔËÒÙÔÙÊ ÆÁÊÌ. + +æÕÎËÃÉÉ ÓÏÈÒÁÎÅÎÉÑ ÎÅ ÍÅÎÑÀÔ ÒÅÖÉÍÁ ÆÁÊÌÁ. ðÒÏÓÔÏ ÂÏÌØÛÅ ÎÅËÕÄÁ ÂÙÌÏ ÉÈ ÐÏÍÅÓÔÉÔØ. + +÷ÓÅ ÆÕÎËÃÉÉ ÓÏÈÒÁÎÅÎÉÑ É ÆÕÎËÃÉÑ {\tt load\_epp} ÐÏÓÌÅ ÏÂÒÁÂÏÔËÉ ËÁÖÄÏÊ +ÓÔÒÏËÉ ×ÙÚÙ×ÁÀÔ ÆÕÎËÃÉÀ, ÎÁ ËÏÔÏÒÕÀ ÕËÁÚÙ×ÁÅÔ ÇÌÏÂÁÌØÎÁÑ ÐÅÒÅÍÅÎÎÁÑ \index{EndLineProc}% +{\tt EndLineProc} (ÓÍ.~ÒÁÚÄÅÌ \ref{iterators}). åÅ ÒÅÚÕÌØÔÁÔ ÏÎÉ ÉÇÎÏÒÉÒÕÀÔ. + +\index{close_epp} +\function{void close\_epp(EPP *epp);} + +úÁËÒÙ×ÁÅÔ ÆÁÊÌ. åÓÌÉ ÆÁÊÌ ÂÙÌ ÏÔËÒÙÔ ÎÁ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÕÀ ÚÁÐÉÓØ, ×ÓÅ ÉÚÍÅÎÅÎÉÑ +ÓÏÈÒÁÎÑÀÔÓÑ, Á ÎÅÚÁÐÏÌÎÅÎÎÙÅ ÓÔÒÏËÉ ÚÁÐÏÌÎÑÀÔÓÑ offsite. + +åÓÌÉ ÆÁÊÌ ÂÙÌ ÚÁÇÒÕÖÅÎ × ÐÁÍÑÔØ, Á×ÔÏÍÁÔÉÞÅÓËÏÇÏ ÓÏÈÒÁÎÅÎÉÑ {\bf ÎÅ} ÐÒÏÉÚ×ÏÄÉÔÓÑ. +\section{äÏÓÔÕÐ Ë ÑÞÅÊËÁÍ ÆÁÊÌÁ} +ïÓÎÏ×ÎÙÍ ÓÐÏÓÏÂÏÍ ÄÏÓÔÕÐÁ Ë ÑÞÅÊËÁÍ ÆÁÊÌÁ Ñ×ÌÑÀÔÓÑ ÆÕÎËÃÉÉ + +\index{epp_get|textbf}% +\function{int epp\_get(EPP* epp,int x,int y);} + +É + +\index{epp_put|textbf}% +\function{void epp\_put(EPP*epp,int x,int y,int value);} + +æÕÎËÃÉÑ {\tt epp\_get} ×ÏÚ×ÒÁÝÁÅÔ ÚÎÁÞÅÎÉÅ ÑÞÅÊËÉ Ó ÕËÁÚÁÎÎÙÍÉ ËÏÏÒÄÉÎÁÔÁÍÉ +(×Ï ×ÎÕÔÒÅÎÎÉÈ ÅÄÉÎÉÃÁÈ ÆÁÊÌÁ) ÉÌÉ offsite, ÅÓÌÉ ÄÁÎÎÁÑ ÔÏÞËÁ ÎÁÈÏÄÉÔÓÑ +ÚÁ ÐÒÅÄÅÌÁÍÉ ËÁÒÔÙ. + +åÅ ÎÅÌØÚÑ ÐÒÉÍÅÎÉÔØ Ë ÆÁÊÌÕ, ÏÔËÒÙÔÏÍÕ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ, ÐÒÉ +ÜÔÏÍ ×ÏÚÎÉËÁÅÔ ÏÛÉÂËÁ {\tt ME\_INVALID\_MODE}. + +ðÒÉ ÒÁÂÏÔÅ Ó ÆÁÊÌÏÍ ÏÔËÒÙÔÙÍ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÞÔÅÎÉÑ, ÏÐÒÁÛÉ×ÁÔØ +ÑÞÅÊËÉ ÍÏÖÎÏ × ÌÀÂÏÍ ÐÏÒÑÄËÅ, ÎÏ ÏÂÒÁÝÅÎÉÅ Ë ÄÒÕÇÏÊ ÓÔÒÏËÅ +ÔÒÅÂÕÅÔ ÅÅ ÓÞÉÔÙ×ÁÎÉÑ Ó ÄÉÓËÁ É ÒÁÓÐÁËÏ×ËÉ. + +ðÒÉ ÒÁÂÏÔÅ Ó ËÜÛÉÒÏ×ÁÎÎÙÍ ÉÌÉ ÚÁÇÒÕÖÅÎÎÙÍ × ÐÁÍÑÔØ ÆÁÊÌÏÍ, ÔÅÍ ÂÏÌÅÅ +ÍÏÖÎÏ ÏÂÒÁÝÁÔØÓÑ Ë ÅÇÏ ÑÞÅÊËÁÍ × ÐÒÏÉÚ×ÏÌØÎÏÍ ÐÏÒÑÄËÅ. + +æÕÎËÃÉÑ {\tt epp\_put} ÐÒÉ ÐÏÐÙÔËÅ ÉÚÍÅÎÉÔØ ÑÞÅÊËÕ ÚÁ ÐÒÅÄÅÌÁÍÉ +ÆÁÊÌÁ ÇÅÎÅÒÉÒÕÅÔ ÏÛÉÂËÕ {\tt ME\_POINT\_OUTSIDE}. + +÷ ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ ÍÏÖÎÏ ÚÁÐÉÓÙ×ÁÔØ ÔÏÞËÉ ×ÎÕÔÒÉ ÔÅËÕÝÅÊ +ÓÔÒÏËÉ × ÐÒÏÉÚ×ÏÌØÎÏÍ ÐÏÒÑÄËÅ, Á ÐÒÉ ÏÂÒÁÝÅÎÉÉ Ë ÓÔÒÏËÅ Ó ÎÏÍÅÒÏÍ, +ÂÏÌØÛÉÍ ÞÅÍ ÔÅËÕÝÁÑ, ÔÅËÕÝÁÑ ÓÔÒÏËÁ ÓÂÒÁÓÙ×ÁÅÔÓÑ ÎÁ ÄÉÓË, É ÄÁÌØÎÅÊÛÁÑ +ÚÁÐÉÓØ × ÎÅÅ ÎÅ×ÏÚÍÏÖÎÁ. åÓÌÉ ÐÒÏÉÚÏÛÌÁ ÚÁÐÉÓØ × ÓÔÒÏËÕ Ó ÎÏÍÅÒÏÍ $n$, +× ÔÏ ×ÒÅÍÑ ËÁË ÐÒÅÄÙÄÕÝÁÑ ÔÅËÕÝÁÑ ÓÔÒÏËÁ ÉÍÅÌÁ ÎÏÍÅÒ $m$, ÇÄÅ $m$fc} ÐÒÉ×ÏÄÉÔ Ë ÏÛÉÂËÅ +{\tt ME\_POINT\_OUTSIDE}, Á ÆÕÎËÃÉÑ ×ÏÚ×ÒÁÝÁÅÔ {\tt NULL}. + +\section{éÔÅÒÁÔÏÒÙ} +\label{iterators} + +\index{for_each_cell}% +\function{int for\_each\_cell(EPP *epp,EPP\_ITER\_PROC action);} + +÷ÙÐÏÌÎÑÅÔ ÆÕÎËÃÉÀ {\tt action} ÄÌÑ ×ÓÅÈ ÎÅ-offsite ÑÞÅÅË ÓÕÝÅÓÔ×ÕÀÝÅÇÏ +ÆÁÊÌÁ ÉÌÉ ÄÌÑ ×ÓÅÈ ÑÞÅÅË ÆÁÊÌÁ, ÏÔËÒÙÔÏÇÏ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ. +÷ÏÚ×ÒÁÝÁÅÔ 0, ÅÓÌÉ ×ÙÐÏÌÎÅÎÉÅ ÚÁ×ÅÒÛÅÎÏ ÕÓÐÅÛÎÏ, -1 ÅÓÌÉ ×ÙÐÏÌÎÅÎÉÅ +ÐÒÅÒ×ÁÎÏ × ÒÅÚÕÌØÔÁÔÅ ÎÅÎÕÌÅ×ÏÇÏ ÒÅÚÕÌØÔÁÔÁ {\tt EndLineProc}\index{EndLineProc} É -2, +ÅÓÌÉ ×ÙÐÏÌÎÅÎÉÅ ÐÒÅÒ×ÁÎÏ ÓÁÍÏÊ ÆÕÎËÃÉÅÊ {\tt action} + +ôÉÐ {\tt EPP\_ITER\_PROC} ÏÐÒÅÄÅÌÅÎ ËÁË + + +{\tt typedef int (*EPP\_ITER\_PROC)(int col, int row, int value);} + + +ðÁÒÁÍÅÔÒÙ {\tt col} É {\tt row} ÐÅÒÅÄÁÀÔ ËÏÏÒÄÉÎÁÔÙ ÔÅËÕÝÅÊ ÔÏÞËÉ, +ÐÁÒÁÍÅÔÒ {\tt value} ÓÏÄÅÒÖÉÔ ËÌÁÓÓ ÔÏÞËÉ ÄÌÑ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ É +offsite ÄÌÑ ÓÏÚÄÁ×ÁÅÍÏÇÏ. + +÷ÏÚ×ÒÁÝÁÅÍÏÅ ÚÎÁÞÅÎÉÅ × ÓÌÕÞÁÅ ÓÏÚÄÁ×ÁÅÍÏÇÏ ÆÁÊÌÁ ÚÁÐÉÓÙ×ÁÅÔÓÑ × ÑÞÅÊËÕ. + +÷ ÓÌÕÞÁÅ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ ÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ÎÏÒÍÁÌØÎÏÍÕ +ÓÏÓÔÏÑÎÉÀ, Á ÎÅÎÕÌÅ×ÏÅ ÐÒÉ×ÏÄÉÔ Ë ÐÒÅËÒÁÝÅÎÉÀ ÒÁÂÏÔÙ. + +\function{long count\_cells(EPP *epp, EPP\_ITER\_PROC condition);} + +÷ÏÚ×ÒÁÝÁÅÔ ËÏÌÉÞÅÓÔ×Ï ÑÞÅÅË × ÓÕÝÅÓÔ×ÕÀÝÅÍ ÆÁÊÌÅ, ÕÄÏ×ÌÅÔ×ÏÒÑÀÝÉÈ +ÚÁÄÁÎÎÏÍÕ ÕÓÌÏ×ÉÀ. æÕÎËÃÉÑ {\tt condition} ÄÏÌÖÎÁ ×ÏÚ×ÒÁÝÁÔØ 0 ÄÌÑ +ÑÞÅÅË, ËÏÔÏÒÙÅ ÕÓÌÏ×ÉÀ ÎÅ ÕÄÏ×ÌÅÔ×ÏÒÑÀÔ É ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ ÄÌÑ +ÔÅÈ, ËÏÔÏÒÙÅ ÕÄÏ×ÌÅÔ×ÏÒÑÀÔ. ÷ ÓÌÕÞÁÅ ÐÒÅÒÙ×ÁÎÉÑ ÒÁÂÏÔÙ, ×ÏÚ×ÒÁÝÁÅÔ ÔÅ ÖÅ +ËÏÄÙ, ÞÔÏ É {\tt for\_each\_cell} + +ðÁÒÁÍÅÔÒÙ, ÐÅÒÅÄÁ×ÁÅÍÙÅ ÆÕÎËÃÉÉ {\tt condition} ÔÁËÉÅ ÖÅ, ËÁË +Õ {\tt action} × ÓÌÕÞÁÅ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ. + +éÔÅÒÁÔÏÒÙ ×ÙÐÏÌÎÑÀÔÓÑ ÄÏÓÔÁÔÏÞÎÏ ÄÏÌÇÏ, ÐÏÜÔÏÍÕ ÄÌÑ ÎÉÈ ÐÒÅÄÕÓÍÏÔÒÅÎ +ÓÐÏÓÏ ×ÙÄÁÞÉ ÐÒÏÇÒÅÓÓ-ÉÎÄÉËÁÔÏÒÁ. åÓÌÉ ÇÌÏÂÁÌØÎÏÊ ÐÅÒÅÍÅÎÎÏÊ {\tt EndLineProc}% +\index{EndLineProc|textbf} +ÐÒÉÓ×ÏÅÎÏ ÚÎÁÞÅÎÉÅ, ÏÔÌÉÞÎÏÅ ÏÔ {\tt NULL}, ÔÏ ÆÕÎËÃÉÑ, ÎÁ ËÏÔÏÒÕÀ ÏÎÁ +ÕËÁÚÙ×ÁÅÔ, ×ÙÚÙ×ÁÅÔÓÑ ÐÏÓÌÅ ÏËÏÎÞÁÎÉÑ ÏÂÒÁÂÏÔËÉ ËÁÖÄÏÊ ÓÔÒÏËÉ ÆÁÊÌÁ. + +æÕÎËÃÉÑ ÐÏÌÕÞÁÅÔ ÔÒÉ ÃÅÌÙÈ ÐÁÒÁÍÅÔÒÁ: +\var{row}{ ÎÏÍÅÒ ÓÔÒÏËÉ epp-ÆÁÊÌÁ, Ó ÕÞÅÔÏÍ ÚÎÁÞÅÎÉÑ ÐÏÌÑ {\tt fr}} +\var{seqno}{ ÐÏÒÑÄËÏ×ÙÊ ÎÏÍÅÒ ÓÔÒÏËÉ (ÏÔ 1 ÄÏ {\tt lr-fr})} +\var{total}{ ÏÂÝÅÅ ÞÉÓÌÏ ÓÔÒÏË × ÆÁÊÌÅ.} + +åÓÌÉ ÜÔÁ ÆÕÎËÃÉÑ ×ÏÚ×ÒÁÝÁÅÔ ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, ÏÂÒÁÂÏÔËÁ ÆÁÊÌÁ ÐÒÅÒÙ×ÁÅÔÓÑ. + +ôÁËÉÍ ÏÂÒÁÚÏÍ ÐÒÏÓÔÅÊÛÁÑ ÆÕÎËÃÉÑ ÉÎÄÉËÁÃÉÉ ÐÒÏÇÒÅÓÓÁ (ÄÁÀÝÁÑ ÒÅÚÕÌØÔÁÔ, +ÏÞÅÎØ ÐÏÈÏÖÉÊ ÎÁ ÐÏ×ÅÄÅÎÉÅ EPPL7 × ÁÎÁÌÏÇÉÞÎÏÊ ÓÉÔÕÁÃÉÉ), ×ÙÇÌÑÄÉÔ ÔÁË: + +\begin{verbatim} +int show_progress(int row,int seqno,int total) +{ + fprintf(stderr,"\rProcessing row %d of %d",seqno,total); + fflush(stderr); + return 0; +} +\end{verbatim} + +\section{òÁÂÏÔÁ Ó ÚÁÇÏÌÏ×ËÏÍ epp-ÆÁÊÌÁ} +\label{EPPHEADER}\index{EPPHEADER} +úÁÇÏÌÏ×ÏË epp-ÆÁÊÌÁ ÉÍÅÅÔ ÓÌÅÄÕÀÝÕÀ ÓÔÒÕËÔÕÒÕ: +\begin{verbatim} +typedef struct EPPHEADER + { short int fr,lr,fc,lc; + double fry,lry,fcx,lcx; + short int kind; + short int base,scale; + unsigned short int offsite; + double sfact; + long access_ptr; + unsigned short minclass, maxclass; + char area_unit; + char coord_sys; + char Reserved[6]; + char date[16], time[8]; + char comment[32]; + } EPPHEADER; +\end{verbatim} + +óÅÍÁÎÔÉËÁ ÜÔÉÈ ÐÏÌÅÊ ÓÌÅÄÕÀÝÁÑ: +\var{fr,lr,fc,lc}{ ÓÏ×ÐÁÄÁÀÔ Ó ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÍÉ ÐÏÌÑÍÉ ÓÔÒÕËÔÕÒÙ {\tt EPP}} +\var{fry,lry,fcx,lcx}{ ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ ËÏÏÒÄÉÎÁÔÙ} +\var{kind}{ ËÏÌÉÞÅÓÔ×Ï ÂÉÔ ÎÁ ÑÞÅÊËÕ} +\var{base,scale}{ ÔÁÊÎÁ, ÐÏËÒÙÔÁÑ ÍÒÁËÏÍ. ñ ÔÁË É ÎÅ ÓÍÏÇ ÕÑÓÎÉÔØ ÉÚ + ÄÏËÕÍÅÎÔÁÃÉÉ Ë EPPL7, ÞÔÏ ÜÔÉ ÐÏÌÑ ÄÅÌÁÀÔ, É ÎÅ ÚÎÁÀ, ËÁËÉÅ ËÏÍÁÎÄÙ EPPL, + ÎÅ ÓÞÉÔÁÑ {\tt HEADER} Ó ÎÉÍÉ ÒÁÂÏÔÁÀÔ.} +\var{offsite}{ ÈÒÁÎÉÔ ÚÎÁÞÅÎÉÅ offsite.} +\var{sfact}{ ÐÌÏÝÁÄØ ÑÞÅÊËÉ. óÍ. ÔÁËÖÅ ÐÏÌÅ {\tt area\_unit}} +\var{access\_ptr}{ ÓÍÅÝÅÎÉÅ (× 128 ÂÁÊÔÏ×ÙÈ ÂÌÏËÁÈ) ÔÁÂÌÉÃÙ ÄÌÉÎ ÓÔÒÏË × ÆÁÊÌÅ} +\var{minclass,maxclass}{ ÍÉÎÉÍÁÌØÎÙÊ É ÍÁËÓÉÍÁÌØÎÙÊ ËÌÁÓÓ × ÆÁÊÌÅ (ÎÅ ÓÞÉÔÁÑ +offsite} +\var{area\_unit}{ åÄÉÎÉÃÁ ÉÚÍÅÒÅÎÉÑ ÐÌÏÝÁÄÉ.}\index{area_unit} +\var{coord\_sys}{ ÔÉÐ ÐÒÏÅËÃÉÉ}\index{coord_sys}\index{EPPHEADER!coord_sys} +\var{date,time}{ ÄÁÔÁ É ×ÒÅÍÑ ÓÏÚÄÁÎÉÑ ÆÁÊÌÁ × ÔÅËÓÔÏ×ÏÍ ÆÏÒÍÁÔÅ.} +\var{comment}{ ËÒÁÔËÉÊ ËÏÍÍÅÎÔÁÒÉÊ Ë ÆÁÊÌÕ (ÚÁÇÏÌÏ×ÏË ËÁÒÔÙ). úÎÁÞÅÎÉÅ +ÜÔÏÇÏ ÐÏÌÑ EPPL7 ÚÁÐÒÁÛÉ×ÁÅÔ Õ ÐÏÌØÚÏ×ÁÔÅÌÑ ÐÒÉ ÓÏÚÄÁÎÉÉ ËÁÖÄÏÇÏ ÆÁÊÌÁ ËÁË +``Description''} + +÷ÏÚÍÏÖÎÙÅ ÚÎÁÞÅÎÉÑ ÅÄÉÎÉà ÐÌÏÝÁÄÉ É ÔÉÐÏ× ÐÒÏÅËÃÉÉ ÏÐÉÓÁÎÙ ËÁË ËÏÎÓÔÁÎÔÙ × ÆÁÊÌÅ {\tt eppl.h}, +ËÏÔÏÒÙÊ ×ËÌÀÞÁÅÔÓÑ É ÆÁÊÌÏÍ {\tt epp.h} É ÆÁÊÌÏÍ {\tt dgt.h} +\begin{description} +\item[AREA\_NO\_UNIT] ðÌÏÝÁÄØ ÑÞÅÊËÉ ÎÅ ÏÐÒÅÄÅÌÅÎÁ; +\item[AREA\_SQ\_FOOT] ë×ÁÄÒÁÔÎÙÅ ÆÕÔÙ; +\item[AREA\_SQ\_METER] ë×ÁÄÒÁÔÎÙÅ ÍÅÔÒÙ; +\item[AREA\_SQ\_KM] ë×ÁÄÒÁÔÎÙÅ ËÉÌÏÍÅÔÒÙ; +\item[AREA\_SQ\_MILE] ë×ÁÄÒÁÔÎÙÅ ÍÉÌÉ (×ÉÄÉÍÏ, ÉÍÅÀÔÓÑ × ×ÉÄÕ ÁÎÇÌÉÊÓËÉÅ, Á ÎÅ +ÍÏÒÓËÉÅ); +\item[AREA\_HECTARE] çÅËÔÁÒÙ; +\item[AREA\_ACRE] áËÒÙ. +\end{description} + +ëÁË ×ÉÄÉÔÅ, ÍÉÌÌÉÍÅÔÒÙ ÎÅ ÐÒÅÄÕÓÍÏÔÒÅÎÙ. + +ëÏÌÉÞÅÓÔ×Ï ÔÉÐÏ× ÐÒÏÅËÃÉÊ ÏÞÅÎØ ÎÅ×ÅÌÉËÏ É ÐÏËÁÚÙ×ÁÅÔ ÏÒÉÅÎÔÁÃÉÀ EPPL7 ÎÁ +ËÒÕÐÎÏÍÁÓÛÔÁÂÎÏÅ ËÁÒÔÏÇÒÁÆÉÒÏ×ÁÎÉÅ. +\begin{description} +\item[COORD\_NONE] ëÏÏÒÄÉÎÁÔÎÁÑ ÓÉÓÔÅÍÁ ÎÅ ÏÐÒÅÄÅÌÅÎÁ (Ó×ÅÖÅÅ ÓËÁÎÅÒÎÏÅ +ÉÚÏÂÒÁÖÅÎÉÅ); +\item[COORD\_UTM] áÍÅÒÉËÁÎÓËÁÑ ÔÏÐÏÇÒÁÆÉÞÅÓËÁÑ ËÁÒÔÁ. (ÏÔ çÁÕÓÓÁ-ëÒÀÇÅÒÁ +ÏÔÌÉÞÁÅÔÓÑ ÎÁ 0.2\%, ÎÏ ÏÔÌÉÞÁÅÔÓÑ. +\item[COORD\_STPLANE] ðÒÏÅËÃÉÑ State Plane. éÓÐÏÌØÚÕÅÔÓÑ, ÓÕÄÑ ÐÏ ÎÁÚ×ÁÎÉÀ, +ÄÌÑ ËÁÒÔ ÛÔÁÔÏ× óûá. +\item[COORD\_LL] çÅÏÇÒÁÆÉÞÅÓËÉÅ ËÏÏÒÄÉÎÁÔÙ. +\end{description} + +äÌÑ ÒÁÂÏÔÙ Ó ÜÔÏÊ ÉÎÆÏÒÍÁÃÉÅÊ ÐÒÅÄÕÓÍÏÔÒÅÎÙ ÓÌÅÄÕÀÝÉÅ ÆÕÎËÃÉÉ: +\function{void get\_epp\_header(EPP* epp, EPPHEADER *h);}\index{get_epp_header|textbf} +÷ÏÚ×ÒÁÝÁÅÔ ÚÁÇÏÌÏ×ÏË ÆÁÊÌÁ × ×ÉÄÅ ×ÙÛÅÏÐÉÓÁÎÎÏÊ ÓÔÒÕËÔÕÒÙ. éÓÐÏÌØÚÕÅÔÓÑ +ÄÌÑ ÞÔÅÎÉÑ ÐÏÌÅÊ, Ë ËÏÔÏÒÙÍ ÎÅÔ ÂÏÌÅÅ ÕÄÏÂÎÏÇÏ ÄÏÓÔÕÐÁ. + +\function{char *getcomment(EPP *epp);}\index{getcomment} + +÷ÏÚ×ÒÁÝÁÅÔ ËÏÍÍÅÎÔÁÒÉÊ, ÏÂÒÅÚÁÑ ËÏÎÃÅ×ÙÅ ÐÒÏÂÅÌÙ. ÷ÏÚ×ÒÁÝÁÅÔ +ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÁÔÉÞÅÓËÉÊ ÂÕÆÅÒ, ËÏÔÏÒÙÊ ÂÕÄÅÔ ÐÅÒÅÚÁÐÉÓÁÎ ÐÒÉ +ÓÌÅÄÕÀÝÅÍ ÏÂÒÁÝÅÎÉÉ Ë ÜÔÏÊ ÆÕÎËÃÉÉ. + +\function{void change\_epp\_header(EPP* epp,EPPHEADER h);}\index{change_epp_header} + +ëÏÐÉÒÕÅÔ × ÚÁÇÏÌÏ×ÏË ÆÁÊÌÁ ÐÏÌÑ {\tt fcx, lcx, fry, lry, base, scale, offsite, +sfact, coord\_sys, area\_unit, comment} ÉÚ ÐÅÒÅÄÁÎÎÏÊ ÓÔÒÕËÔÕÒÙ. ïÓÔÁÌØÎÙÅ +ÐÏÌÑ ÏÓÔÁ×ÌÑÅÔ ËÁË ÂÙÌÉ. + +\function{void setcomment(EPP *epp,char *comment);}\index{set_comment} + +éÚÍÅÎÑÅÔ ÔÏÌØËÏ ËÏÍÍÅÎÔÁÒÉÊ. ÷ ÏÔÌÉÞÉÅ ÏÔ {\tt change\_epp\_header} ÎÅ +ÔÒÅÂÕÅÔ, ÞÔÏÂÙ ÓÔÒÏËÁ ÂÙÌÁ ÄÏÐÏÌÎÅÎÁ ÐÒÏÂÅÌÁÍÉ ÄÏ 32 ÓÉÍ×ÏÌÏ×. +åÅ ÁÒÕÇÕÍÅÎÔ~--- ÏÂÙÞÎÁÑ NULL-terminated ÓÔÒÏËÁ. + + + +\function{int shift\_epp(EPP* epp, int new\_fr, int new\_fc);}\index{shift_epp} + +éÚÍÅÎÑÅÔ ÚÎÁÞÅÎÉÑ ÐÏÌÅÊ {\tt fr} É {\tt fc}, É ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ {\tt lr} É +{\tt lc}, ÐÏÓËÏÌØËÕ ÞÉÓÌÏ ÓÔÒÏË É ËÏÌÏÎÏË × ÆÁÊÌÅ ÐÏÍÅÎÑÔØ ÎÅÌØÚÑ. + +÷ÏÚ×ÒÁÝÁÅÔ ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ × ÓÌÕÞÁÅ ÕÓÐÅÈÁ ÉÌÉ 0, ÅÓÌÉ ËÁËÉÅ-ÔÏ +ËÏÏÒÄÉÎÁÔÙ ÐÒÉ ÉÚÍÅÎÅÎÉÉ ×ÙÌÅÚÌÉ ÚÁ ÄÏÐÕÓÔÉÍÙÊ ÄÉÁÐÁÚÏÎ. + +\section{ðÅÒÅÓÞÅÔ ËÏÏÒÄÉÎÁÔ} +\function{int epp\_row(EPP *epp,double y);}\index{epp_row} +÷ÏÚ×ÒÁÝÁÅÔ ÎÏÍÅÒ ÓÔÒÏËÉ ÐÏ ÁÌØÔÅÒÎÁÔÉ×ÎÏÍÕ y. +\function{int epp\_col(EPP *epp,double x);}\index{epp_col} +CÏÏÔ×ÅÔÓÔ×ÅÎÎÏ, ÎÏÍÅÒ ËÏÌÏÎËÉ ÐÏ ÁÌØÔÅÒÎÁÔÉ×ÎÏÍÕ x. +\function{double alt\_x(EPP *epp,int col);}\index{alt_x} +÷ÏÚ×ÒÁÝÁÅÔ ÁÌØÔÅÒÔÁÎÔÉ×ÎÙÊ x ÕËÁÚÁÎÎÏÊ ËÏÌÏÎËÉ. +\function{double alt\_y(EPP *epp,int row);}\index{alt_y} +é ÁÌØÔÅÒÎÁÔÉ×ÎÙÊ y ÕËÁÚÁÎÎÏÊ ÓÔÒÏËÉ. + +üÔÉ Ä×Å ÆÕÎËÃÉÉ ×ÏÚ×ÒÁÝÁÀÔ ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ ËÏÏÒÄÉÎÁÔÙ ÐÒÁ×ÏÇÏ ×ÅÒÈÎÅÇÏ +ÕÇÌÁ ÑÞÅÊËÉ. äÌÑ ÐÏÌÕÞÅÎÉÑ ËÏÏÒÄÉÎÁÔ ÃÅÎÔÒÁ ÑÞÅÊËÉ ÐÒÅÄÎÁÚÎÁÞÅÎÙ ÆÕÎËÃÉÉ: + +\function{double alt\_xc(EPP *epp,int col);}\index{alt_xc} +\function{double alt\_yc(EPP *epp,int row);}\index{alt_yc} + + + +\section{îÁÌÏÖÅÎÉÅ ÆÁÊÌÏ×} + +òÁÓÔÒÏ×ÙÅ ÆÁÊÌÙ ÌÅÇËÏ ÎÁËÌÁÄÙ×ÁÔØ ÄÒÕÇ ÎÁ ÄÒÕÇÁ, ÅÓÌÉ Õ ÎÉÈ +ÓÏ×ÐÁÄÁÅÔ ÒÁÚÍÅÒ ÑÞÅÊËÉ É ËÏÏÒÄÉÎÁÔÎÁÑ ÓÉÓÔÅÍÁ. + +äÌÑ ÐÒÏ×ÅÒËÉ ÜÔÉÈ ÕÓÌÏ×ÉÊ × ÂÉÂÌÉÏÔÅËÕ ×ËÌÀÞÅÎÁ ÆÕÎËÃÉÑ + +\function{int compare\_cell\_size(EPP *f1,EPP *f2);}\index{compare_cell_size} + +ÏÎÁ ×ÏÚ×ÒÁÝÁÅÔ 0 ÅÓÌÉ ÒÁÚÍÅÒÙ ÑÞÅÅË ÎÅÓÏ×ÍÅÓÔÉÍÙ É ÎÅÎÕÌÅ×ÏÊ ËÏÄ, +ÅÓÌÉ ÆÁÊÌÙ ÍÏÖÎÏ ÎÁËÌÁÄÙ×ÁÔØ. + +÷ÔÏÒÏÅ ÕÓÌÏ×ÉÅ, ËÏÔÏÒÏÅ ÎÅÏÂÈÏÄÉÍÏ ÐÒÏ×ÅÒÉÔØ~--- ÓÏ×ÐÁÄÁÅÔ ÌÉ +ÐÒÁ×ÉÌÏ ÐÅÒÅÓÞÅÔÁ ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔ × ÒÑÄÙ/ËÏÌÏÎËÉ. + +äÌÑ ÜÔÏÇÏ ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÆÕÎËÃÉÑ +\function {int is\_aligned(EPP *f1,EPP *f2);}\index{is_aligned} + +ïÎÁ ×ÏÚ×ÒÁÝÁÅÔ ÎÅÎÕÌÅ×ÏÊ ËÏÄ, ÅÓÌÉ ÏÂÒÁÝÅÎÉÅ Ë {\tt epp\_get}\index{epp_get} +Ó ÏÄÉÎÁËÏ×ÙÍÉ ÁÒÇÕÍÅÎÔÁÍÉ ÄÌÑ ÏÂÏÉÈ ÆÁÊÌÏ× ×ÏÚ×ÒÁÝÁÅÔ +ÉÎÆÏÒÍÁÃÉÀ Ï ÏÄÎÏÊ É ÔÏÊ ÖÅ ÔÏÞËÅ. + +îÅÓÏ×ÐÁÄÅÎÉÅ ÒÁÍËÉ ÆÁÊÌÏ× ÎÅ ÉÇÒÁÅÔ ÎÉËÁËÏÊ ÒÏÌÉ, ÐÏÓËÏÌØËÕ {\tt epp\_get} +ËÏÒÒÅËÔÎÏ ÏÂÒÁÂÁÔÙ×ÁÅÔ ÏÂÒÁÝÅÎÉÅ Ë ÔÏÞËÅ ÚÁ ÐÒÅÄÅÌÁÍÉ ÆÁÊÌÁ. + +åÓÌÉ {\tt compare\_cell\_size} ×ÏÚ×ÒÁÝÁÅÔ TRUE, Á {\tt is\_aligned}~--- +FALSE, ÔÏ ÆÁÊÌÙ ÍÏÇÕÔ ÂÙÔØ ×ÙÒÁ×ÎÅÎÙ ÐÕÔÅÍ ÉÚÍÅÎÅÎÉÑ ÎÏÍÅÒÁ ÐÅÒ×ÏÊ +ÓÔÒÏËÉ É/ÉÌÉ ËÏÌÏÎËÉ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ {\tt shift\_epp}. + +åÓÌÉ ÖÅ ÎÅÏÂÈÏÄÉÍÏ ÓÏ×ÍÅÓÔÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÆÁÊÌÙ, Õ ËÏÔÏÒÙÈ ÎÅ +ÓÏ×ÐÁÄÁÅÔ ÒÁÚÍÅÒ ÑÞÅÊËÉ, ÔÏ ÎÅÏÂÈÏÄÉÍÏ ÒÁÓÞÉÔÁÔØ É ÉÓÐÏÌØÚÏ×ÁÔØ +ÐÅÒÅÓÞÅÔÎÙÅ ËÏÜÆÆÉÃÉÅÎÔÙ. + +äÌÑ ÜÔÏÇÏ ÉÓÐÏÌØÚÕÀÔÓÑ ÆÕÎËÃÉÉ: + +\function{EPP\_LINK link\_epp(EPP *base,EPP *overlay);}\index{link_epp}\index{EPP_LINK} + +õÓÔÁÎÁ×ÌÉ×ÁÅÔ Ó×ÑÚØ ÍÅÖÄÕ ÆÁÊÌÁÍÉ. ÷ÏÚ×ÒÁÝÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ +ÓÔÒÕËÔÕÒÕ {\tt LINK\_BUFFER}, ÓÏÄÅÒÖÁÝÕÀ ÎÁÂÏÒ ÐÅÒÅÓÞÅÔÎÙÈ +ËÏÜÆÆÉÃÉÅÎÔÏ× ÉÌÉ {\tt NULL}, ÅÓÌÉ Ó×ÑÚØ ÕÓÔÁÎÏ×ÉÔØ ÎÅ×ÏÚÍÏÖÎÏ +(ËÏÏÒÄÉÎÁÔÎÙÅ ÓÉÓÔÅÍÙ Ä×ÕÈ ÆÁÊÌÏ× ÉÍÅÀÔ ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏ ÎÁÐÒÁ×ÌÅÎÎÙÅ +ÏÓÉ). + +æÕÎËÃÉÉ: + +\function{int linked\_row(EPP\_LINK link,int row);}\index{linked_row} +\function{int linked\_col(EPP\_LINK link,int col);}\index{linked_col} + +ÐÅÒÅÓÞÉÔÙ×ÁÀÔ ÒÑÄÙ/ËÏÌÏÎËÉ ÆÁÊÌÁ {\tt base} × ÒÑÄÙ/ËÏÌÏÎËÉ ÆÁÊÌÁ {\tt overlay} + + +\section{ðÒÏÞÅÅ} +÷ ÎÅËÏÔÏÒÙÈ ÓÌÕÞÁÑÈ ÄÏ ÏËÏÎÞÁÎÉÑ ÓÏÚÄÁÎÉÑ ÆÁÊÌÁ ÎÅÌØÚÑ ÏÐÒÅÄÅÌÉÔØ, +ÅÓÔØ ÌÉ × ÎÅÍ ËÌÁÓÓÙ Ó×ÙÛÅ 255. ÷ ÜÔÉÈ ÓÌÕÞÁÑÈ ÐÒÉÈÏÄÉÔÓÑ ×ÓÅÇÄÁ +ÓÏÚÄÁ×ÁÔØ 16-ÂÉÔÎÙÊ ÆÁÊÌ, Á ÐÏ ÏËÏÎÞÁÎÉÉ ÒÁÂÏÔÙ, ÅÓÌÉ $\mbox{max}\le 255$ ËÏÎ×ÅÒÔÉÒÏ×ÁÔØ +ÅÇÏ × ×ÏÓØÍÉÂÉÔÎÙÊ. äÌÑ ÕÐÒÏÝÅÎÉÑ (É ÕÓËÏÒÅÎÉÑ) ÜÔÏÊ ÏÐÅÒÁÃÉÉ, +× ÂÉÂÌÉÏÔÅËÕ ×ËÌÀÞÅÎÁ ÆÕÎËÃÉÑ: + +\function{int fast\_convert\_to\_8bit(EPP *source, char *filename);}% +\index{fast_convert_to_8bit} + +üÔÁ ÆÕÎËÃÉÑ ÐÏÌÕÞÁÅÔ ÏÔËÒÙÔÙÊ ÎÁ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÕÀ ÚÁÐÉÓØ ÆÁÊÌ, +ÐÅÒÅÏÔËÒÙ×ÁÅÔ ÅÇÏ ÎÁ ÞÔÅÎÉÅ É ËÏÐÉÒÕÅÔ × ÎÏ×ÙÊ ÆÁÊÌ, ÕËÁÚÁÎÎÙÊ ËÁË filename. + +æÕÎËÃÉÑ ÒÁÂÏÔÁÅÔ +ÔÁË ÂÙÓÔÒÏ, ËÁË ÔÏÌØËÏ ×ÏÚÍÏÖÎÏ, ÐÏÓËÏÌØËÕ ÉÓÐÏÌØÚÕÅÔ ÎÁÐÒÑÍÕÀ +ÎÅËÏÔÏÒÙÅ ×ÏÚÍÏÖÎÏÓÔÉ ÂÉÂÌÉÏÔÅËÉ, ÎÅ ×ÙÎÅÓÅÎÎÙÅ × ÉÎÔÅÒÆÅÊÓ. + +äÌÑ Ó×ÅÄÅÎÉÑ ÞÉÔÁÔÅÌÅÊ, ÉÍÅÀÝÉÈ ÏÐÙÔ ÒÁÂÏÔÙ Ó epp-ÆÁÊÌÏÍ ÎÁ ÎÉÚËÏÍ +ÕÒÏ×ÎÅ, ÕËÁÖÅÍ, ÞÔÏ ÚÁÐÁËÏ×ËÉ ÏÎÁ ÎÅ ×ÙÐÏÌÎÑÅÔ ×ÏÏÂÝÅ, Á ÒÁÓÐÁËÏ×Ù×ÁÅÔ +ÔÏÌØËÏ ÍÌÁÄÛÉÅ 8 ÂÉÔ 16-ÂÉÔÎÏÇÏ ÆÁÊÌÁ. + +ðÏ ÏËÏÎÞÁÎÉÉ ÒÁÂÏÔÙ ÚÁËÒÙ×ÁÅÔ ÏÂÁ ÆÁÊÌÁ. + +\section{ïÂÒÁÂÏÔËÁ ÏÛÉÂÏË} + +âÏÌØÛÁÑ ÞÁÓÔØ ÆÕÎËÃÉÊ ÂÉÂÌÉÏÔÅËÉ ËÏÒÒÅËÔÎÏ ÏÂÒÁÂÁÔÙ×ÁÅÔ +ÏÛÉÂÏÞÎÙÅ ÓÉÔÕÁÃÉÉ. äÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ ÉÎÄÉËÁÔÏÒÏÍ ÏÛÉÂËÉ ÓÌÕÖÉÔ +ÒÅÚÕÌØÔÁÔ, ×ÏÚ×ÒÁÝÁÅÍÙÊ ÆÕÎËÃÉÅÊ. + +óÕÝÅÓÔ×ÕÅÔ ÇÌÏÂÁÌØÎÁÑ ÐÅÒÅÍÅÎÎÁÑ {\tt map\_error}\index{map_error} × ËÏÔÏÒÕÀ ÐÏÍÅÝÁÅÔÓÑ +ËÏÄ ÏÛÉÂËÉ. ÷ÏÚÍÏÖÎÙÅ ËÏÄÙ ÏÐÒÅÄÅÌÅÎÙ ËÁË ËÏÎÓÔÁÎÔÙ × ÆÁÊÌÅ {\tt epp\_err.h}. + +\var{ME\_OK}{ÏÐÅÒÁÃÉÑ ÚÁ×ÅÒÛÉÌÁÓØ ÕÓÐÅÛÎÏ.} +\var{ME\_POINT\_OUTSIDE}{ðÏÐÙÔËÁ ÓÄÅÌÁÔØ {\tt epp\_put} ÚÁ ÐÒÅÄÅÌÁÍÉ ÆÁÊÌÁ.} +\var{ME\_INVALID\_MODE}{ðÏÐÙÔËÁ ÞÉÔÁÔØ ËÁÒÔÕ, ÏÔËÒÙÔÕÀ × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ +ÚÁÐÉÓÉ, ÉÌÉ ÍÏÄÉÆÉÃÉÒÏ×ÁÔØ ËÁÒÔÕ, ÏÔËÒÙÔÕÀ × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÞÔÅÎÉÑ} +\var{ME\_READ\_ERROR}{ïÛÉÂËÁ ÓÉÓÔÅÍÎÏÇÏ ×ÙÚÏ×Á ÉÌÉ ÂÉÂÌÉÏÔÅÞÎÏÊ ÆÕÎËÃÉÉ ÐÒÉ +ÞÔÅÎÉÉ Ó ÄÉÓËÁ. òÅËÏÍÅÎÄÕÅÔÓÑ ÐÏÓÍÏÔÒÅÔØ ÚÎÁÞÅÎÉÅ ÇÌÏÂÁÌØÎÏÊ ÐÅÒÅÍÎÎÏÊ {\tt errno}.} +\var{ME\_WRITE\_ERROR}{ôÏ ÖÅ ÓÁÍÏÅ, ÎÏ ÐÒÉ ÚÁÐÉÓÉ.} +\var{ME\_INVALID\_PUT}{ðÏÐÙÔËÁ ÉÚÍÅÎÉÔØ ÑÞÅÊËÕ, ÕÖÅ ÚÁÐÉÓÁÎÎÕÀ ÎÁ ÄÉÓË.} +\var{ME\_OUT\_OF\_MEMORY}{îÅ È×ÁÔÉÌÏ ÐÁÍÑÔÉ ÄÌÑ ÒÁÚÍÅÝÅÎÉÑ ÎÅÏÂÈÏÄÉÍÙÈ ÓÔÒÕËÔÕÒ ÄÁÎÎÙÈ} +\var{ME\_ACCESS\_DENIED}{îÅ ÕÄÁÌÏÓØ ÏÔËÒÙÔØ ÆÁÊÌ × ÔÒÅÂÕÅÍÏÍ ÒÅÖÉÍÅ} +\var{ME\_NO\_FILE}{æÁÊÌ Ó ÕËÁÚÁÎÎÙÍ ÉÍÅÎÅÍ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ} +\var{ME\_INVALID\_FILE}{æÁÊÌ ÎÅ Ñ×ÌÑÅÔÓÑ ÐÒÁ×ÉÌØÎÙÍ epp ÉÌÉ dgt ÆÁÊÌÏÍ} +\var{ME\_CREATE\_ERROR}{ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ÆÁÊÌÁ, ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÐÕÔØ ÉÌÉ + ÎÅÄÏÐÕÓÔÉÍÏÅ ÉÍÑ. ðÏÄÒÏÂÎÏÓÔÉ~--- × ÓÉÓÔÅÍÎÏÊ ÐÅÒÅÍÅÎÎÏÊ {\tt errno}.} +åÓÌÉ ÐÒÉ ËÁËÏÊ-ÔÏ ÏÐÅÒÁÃÉÉ {\tt map\_error} ÕÓÔÁÎÏ×ÌÅÎÁ × ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, +ÔÏ ÉÍÅÅÔ ÓÍÙÓÌ ÐÅÒÅÄ ÐÒÏÄÏÌÖÅÎÉÅÍ ÒÁÂÏÔÙ ÅÅ ÏÂÎÕÌÉÔØ. îÅËÏÔÏÒÙÅ ÆÕÎËÃÉÉ +ÂÉÂÌÉÏÔÅËÉ ÐÒÏ×ÅÒÑÀÔ ÅÇÏ ÐÏÓÌÅ ×ÙÚÏ×Á ÄÒÕÇÉÈ ÆÕÎËÃÉÊ, Á ÏÂÎÕÌÅÎÉÅ ÐÏÓÌÅ +ÕÓÐÅÛÎÏÊ ÏÐÅÒÁÃÉÉ ÎÅ ÇÁÒÁÎÔÉÒÏ×ÁÎÏ. + +\chapter{æÕÎËÃÉÉ ÄÏÓÔÕÐÁ Ë ×ÅËÔÏÒÎÙÍ ÆÁÊÌÁÍ} + +æÕÎËÃÉÉ ÄÏÓÔÕÐÁ Ë ×ÅËÔÏÒÎÙÍ ÆÁÊÌÁÍ ÏÐÉÓÁÎÙ × ÚÁÇÏÌÏ×ÏÞÎÏÍ ÆÁÊÌÅ {\tt dgt.h}. +÷ ÎÅÍ ÏÐÒÅÄÅÌÅÎÁ ÓÔÒÕËÔÕÒÁ {\tt DGT}, ÁÎÁÌÏÇÉÞÎÁÑ ÐÏ ÓÍÙÓÌÕ ÓÔÒÕËÔÕÒÅ {\tt EPP}. + +ðÏÓËÏÌØËÕ × ÚÁÇÏÌÏ×ËÅ ×ÅËÔÏÒÎÙÈ ÆÁÊÌÏ× ÎÉËÁËÏÊ ÉÎÆÏÒÍÁÃÉÉ ËÒÏÍÅ ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ +ËÏÏÒÄÉÎÁÔ É ÔÉÐÁ ÐÒÏÅËÃÉÉ ÎÅ ÈÒÁÎÉÔÓÑ, ÓÐÏÓÏÂÏ× ÐÒÑÍÏÊ ÒÁÂÏÔÙ Ó ÚÁÇÏÌÏ×ËÏÍ +ÎÅ ÐÒÅÄÕÓÍÏÔÒÅÎÏ. + +\section{TÉÐÙ ÄÁÎÎÙÈ} + +÷ ÏÔÌÉÞÉÅ ÏÔ ÒÁÓÔÒÏ×ÙÈ ÆÁÊÌÏ×, ÚÎÁÞÅÎÉÅÍ ËÏÔÏÒÙÈ × ÔÏÞËÅ Ñ×ÌÑÅÔÓÑ +ÏÂÙÞÎÏÅ ÃÅÌÏÅ ÞÉÓÌÏ, ×ÅËÔÏÒÎÙÅ ÆÁÊÌÙ ÈÒÁÎÑÔ ÄÏ×ÏÌØÎÏ ÓÌÏÖÎÙÅ ÏÂßÅËÔÙ. + +ðÒÉ×ÅÄÅÍ ÉÈ ÏÐÉÓÁÎÉÑ: +\index{POINT}% +\var{POINT}{óÔÒÕËÔÕÒÁ ÄÌÑ ÈÒÁÎÅÎÉÑ ËÏÏÒÄÉÎÁÔ ÔÏÞËÉ. éÍÅÅÔ Ä×Á ÐÏÌÑ +ÔÉÐÁ {\tt signed short int}~--- {\tt x} É {\tt y}. îÅÓÍÏÔÒÑ ÎÁ ÓÈÏÖÅÓÔØ +ÏÐÉÓÁÎÉÑ ÓÏ ÓÔÒÕËÔÕÒÏÊ {\tt XPoint}, ÐÏÐÙÔËÁ ÐÅÒÅÄÁÔØ ÍÁÓÓÉ× ÔÏÞÅË ÔÉÐÁ +{\tt POINT} × ÆÕÎËÃÉÀ {tt XDrawLine} ÐÏÞÅÍÕ-ÔÏ Ë ÕÓÐÅÈÕ ÎÅ ÐÒÉ×ÏÄÉÔ} +\index{DGT_ITEM} +\var{DGT\_ITEM}{óÔÒÕËÔÕÒÁ ÄÌÑ ÈÒÁÎÅÎÉÑ ÉÎÆÏÒÍÁÃÉÉ Ï ×ÅËÔÏÒÎÏÍ ÏÂßÅËÔÅ~--- +ÐÏÌÉÌÉÎÉÉ ÉÌÉ ÔÏÞËÅ (ÎÅ ÐÕÔÁÔØ ÔÏÞËÕ-ÏÂßÅËÔ Ó ÔÏÞËÏÊ-ÕÚÌÏÍ ÌÉÎÉÉ)). +åÅ ÐÏÌÑ:} +\var{long int ID}{ 32-ÂÉÔÎÙÊ ÉÄÅÎÔÉÆÉËÁÔÏÒ ÏÂßÅËÔÁ.} +\var{short int x1,y1}{ ÌÅ×ÙÊ ÎÉÖÎÉÊ ÕÇÏÌ ÍÁÓËÉ, ÅÓÌÉ ÏÂßÅËÔ~--- ÐÏÌÉÌÉÎÉÑ ÉÌÉ ËÏÏÒÄÉÎÁÔÙ +ÔÏÞËÉ, ÅÓÌÉ ÏÂßÅËÔ~--- ÔÏÞËÁ.} +\var{short int x2,y2}{ ÐÒÁ×ÙÊ ×ÅÒÈÎÉÊ ÕÇÏÌ ÍÁÓËÉ. õ ÔÏÞÅË~--- ÎÅ ÉÓÐÏÌØÚÕÅÔÓÑ.} +\var{shott int npoints}{ ÞÉÓÌÏ ÕÚÌÏ× × ÌÉÎÉÉ. åÓÌÉ 0, ÔÏ ÏÂßÅËÔ~--- ÔÏÞËÁ, +ÏÔ 2 ÄÏ 500~--- ÐÏÌÉÌÉÎÉÑ, ÏÓÔÁÌØÎÙÅ ÚÎÁÞÅÎÉÑ ÎÅÄÏÐÕÓÔÉÍÙ.} +\var{POINT s[500]}{ ÍÁÓÓÉ× ËÏÏÒÄÉÎÁÔ ÔÏÞÅË ÐÏÌÉÌÉÎÉÉ.} + +óÔÒÕËÔÕÒÁ {\tt DGT}\index{DGT|textbf} ÈÒÁÎÉÔ ×ÓÀ ÉÎÆÏÒÍÁÃÉÀ, ÎÅÏÂÈÏÄÉÍÕÀ ÐÒÉ ÒÁÂÏÔÅ Ó ×ÅËÔÏÒÎÙÍ +ÆÁÊÌÏÍ. ðÒÏÇÒÁÍÍÉÓÔÕ ÉÍÅÅÔ ÓÍÙÓÌ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÞÉÔÁÔØ ÓÌÅÄÕÀÝÉÅ ÅÅ ÐÏÌÑ: +\index{DGT!XLeft}\index{DGT!XRight}\index{DGT!YTop}\index{DGT!YBottom}% +\index{XLeft!DGT}\index{XRight!DGT}\index{YTop!DGT}\index{YBottom!DGT}% +\var{double XLeft,YBottom,XRight,YTop}{ ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ ËÏÏÒÄÉÎÁÔÙ ÇÒÁÎÉà +ÆÁÊÌÁ.} +\index{mode!DGT}% +\var{int mode}{ òÅÖÉÍ ÄÏÓÔÕÐÁ. ëÏÍÂÉÎÁÃÉÑ ÔÅÈ ÖÅ ËÏÎÓÔÁÎÔ {\tt MAP\_INPUT} É +{\tt MAP\_OUTPUT}, ÞÔÏ É ÐÏÌÅ {\tt mode} ÓÔÒÕËÔÕÒÙ {\tt EPP}.} +\index{projection!DGT}% +\var{unsigned char projection}{ôÉÐ ËÏÏÒÄÉÎÁÔÎÏÊ ÓÉÓÔÅÍÙ. ÷ÏÚÍÏÖÎÙÅ ÚÎÁÞÅÎÉÑ +ÏÐÉÓÁÎÙ × ÒÁÚÄÅÌÅ \ref{EPPHEADER}.} +\var{DGT\_ITEM *buffer}{ âÕÆÅÒ ÄÌÑ ÈÒÁÎÅÎÉÑ ÔÅËÕÝÅÇÏ ÏÂßÅËÔÁ. ïÂÙÞÎÏ ÄÏÓÔÕÐ +Ë ÜÔÏÊ ÓÔÒÕËÔÕÒÅ ×ÙÐÏÌÎÑÅÔÓÑ Ó ÐÏÍÏÝØÀ ÍÁËÒÏÓÏ×, ÏÐÉÓÁÎÎÙÈ × ÒÁÚÄÅÌÅ \ref{ItemMacros}.} +\var{int eof}{ æÌÁÇ, ×ÙÓÔÁ×ÌÑÅÍÙÊ × ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, ÅÓÌÉ ÐÒÏÞÉÔÁÎ ÐÒÉÚÎÁË +ËÏÎÃÁ ÆÁÊÌÁ.} +\var{int item\_no}{ ðÏÒÑÄËÏ×ÙÊ ÎÏÍÅÒ ÔÅËÕÝÅÇÏ ÏÂßÅËÔÁ} +\section{ïÔËÒÙÔÉÅ ÆÁÊÌÁ} + +\index{open_dgt}% +\function{DGT *open\_dgt(char *filename)} +\index{fopen_dgt}% +\function{DGT *fopen\_dgt(FILE *f)} + +ïÔËÒÙ×ÁÀÔ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÞÔÅÎÉÑ. ÷ÏÚ×ÒÁÝÁÀÔ ÕËÁÚÁÄÅÌØ +ÎÁ ÓÔÒÕËÔÕÒÕ {\tt DGT} ÉÌÉ {\tt NULL}, ÅÓÌÉ ÐÒÏÉÚÏÛÌÁ ÏÛÉÂËÁ. + +\index{creat_dgt}% +\function{DGT *creat\_dgt(char *filename, double x\_left, double y\_bottom, +double x\_right, double y\_top, unsigned char proj)} +\index{fcreat_dgt}% +\function{DGT *fcreat\_dgt(FILE *f, double x\_left, double y\_bottom, +double x\_right, double y\_top, unsigned char proj)} +\index{mcreat_dgt}% +\function{DGT *mcreat\_dgt(double x\_left, double y\_bottom, +double x\_right, double y\_top, unsigned char proj)} + +óÏÚÄÁÀÔ ÆÁÊÌ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ. ðÏÌÕÞÁÀÔ × ËÁÞÅÓÔ×Å ÐÁÒÁÍÅÔÒÏ× +ÐÒÅÄÅÌÙ ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔ É ÔÉÐ ÐÒÏÅËÃÉÉ. + +ïÓÏÂÏÅ ×ÎÉÍÁÎÉÅ ÓÔÏÉÔ ÏÂÒÁÔÉÔØ ÎÁ ÆÕÎËÃÉÀ {\tt mcreat\_dgt}, ËÏÔÏÒÁÑ +ÓÏÚÄÁÅÔ ÐÕÓÔÏÊ ÆÁÊÌ × ÐÁÍÑÔÉ, ÏÔËÒÙÔÙÊ ÎÁ ÞÔÅÎÉÅ-ÚÁÐÉÓØ. ðÏÄÒÏÂÎÅÅ +ÒÁÂÏÔÁ Ó ÆÁÊÌÁÍÉ × ÐÁÍÑÔÉ ÏÐÉÓÁÎÁ × ÒÁÚÄÅÌÅ \ref{dgtInMemory} + +äÌÑ ÏÔËÒÙÔÉÑ ÆÁÊÌÏ× Ó ÐÒÅÄÅÌÁÍÉ É ÐÒÏÅËÃÉÅÊ ÁÎÁÌÏÇÉÞÎÙÍÉ ÕÖÅ ÓÕÝÅÓÔ×ÕÀÝÅÍÕ +ÆÁÊÌÕ, ÓÕÝÅÓÔ×ÕÀÔ ÆÕÎËÃÉÉ: + +\index{creat_dgt_as}% +\function{DGT *creat\_dgt\_as(char *filename,DGT *pattern);} +\index{fcreat_dgt_as}% +\function{DGT *fcreat\_dgt\_as(FILE *f,DGT *pattern);} +\index{mcreat_dgt_as}% +\function{DGT *mcreat\_dgt\_as(DGT *pattern);} + +\section{óÍÅÎÁ ÒÅÖÉÍÁ É ÚÁËÒÙÔÉÅ ÆÁÊÌÁ} + +æÕÎËÃÉÑ +\index{reset_dgt}% +\function{void reset\_dgt(DGT* dgt);} +ÄÅÌÁÅÔ ÔÅËÕÝÉÍ ÏÂßÅËÔÏÍ ÐÅÒ×ÙÊ. åÓÌÉ ÆÁÊÌ ÄÏ ÜÔÏÇÏ ÂÙÌ ÏÔËÒÙÔ × ÒÅÖÉÍÅ +ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ, ÏÎ ÐÅÒÅÏÔËÒÙ×ÁÅÔÓÑ × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ +ÞÔÅÎÉÑ. + +\index{load_dgt}% +\function{int load\_dgt(DGT *dgt);} +úÁÇÒÕÖÁÅÔ ÆÁÊÌ × ÐÁÍÑÔØ, ÄÅÌÁÑ ×ÏÚÍÏÖÎÙÍ ÐÒÑÍÏÊ ÄÏÓÔÕÐ ÎÁ ÞÔÅÎÉÅ-ÚÁÐÉÓØ +É ÍÎÏÇÉÅ ÄÒÕÇÉÅ ×ÏÚÍÏÖÎÏÓÔÉ, ÏÐÉÓÁÎÎÙÅ × ÒÁÚÄÅÌÅ \ref{dgtInMemory} + +\index{close_dgt}% +\function{void close\_dgt(DGT *dgt);} +úÁËÒÙ×ÁÅÔ ÆÁÊÌ, ÏÓ×ÏÂÏÖÄÁÑ ×ÓÀ ×ÙÄÅÌÅÎÎÕÀ ÐÏÄ ÎÅÇÏ ÐÁÍÑÔØ. éÚÍÅÎÅÎÉÑ +× ÐÏÓÌÅÄÎÅÍ ÏÂßÅËÔÅ ÓÏÈÒÁÎÑÀÔÓÑ, ÅÓÌÉ ÆÁÊÌ ÂÙÌ ÏÔËÒÙÔ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ +ÚÁÐÉÓÉ. + +\section{þÔÅÎÉÅ É ÚÁÐÉÓØ ÏÂßÅËÔÏ×} + +ðÏÓÌÅ ÏÔËÒÙÔÉÑ ÓÕÝÅÓÔ×ÕÀÝÅÇÏ ÆÁÊÌÁ, ÐÅÒ×ÙÊ ÏÂßÅËÔ Á×ÔÏÍÁÔÉÞÅÓËÉ ÓÞÉÔÙ×ÁÅÔÓÑ +× ÂÕÆÅÒ, É ÄÏÓÔÕÐÅÎ Ó ÐÏÍÏÝØÀ ÍÁËÒÏÓÏ× ÄÌÑ ÒÁÂÏÔÙ Ó ÂÕÆÅÒÏÍ (ÓÍ. ÒÁÚÄÅÌ +\ref{ItemMacros}). + +äÌÑ ÐÅÒÅÈÏÄÁ Ë ÓÌÅÄÕÀÝÅÍÕ ÏÂßÅËÔÕ ×ÙÚÙ×ÁÅÔÓÑ ÍÁËÒÏÓ +\index{dgt_next}% +\function{void dgt\_next(DGT *dgt);} + +÷ ÎÅËÏÔÏÒÙÈ ÓÌÕÞÁÑÈ ÕÄÏÂÎÏ ÒÁÂÏÔÁÔØ Ó ËÏÐÉÑÍÉ ÏÂßÅËÔÏ×, ÒÁÚÍÅÝÅÎÎÙÈ +× ÄÉÎÁÍÉÞÅÓËÏÊ ÐÁÍÑÔÉ. ÷ ÜÔÏÍ ÓÌÕÞÁÅ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ +ÆÕÎËÃÉÀ + +\index{dgt_get}% +\function{DGT\_ITEM *dgt\_get(DGT *dgt)} + +ëÏÔÏÒÁÑ ÒÁÚÍÅÝÁÅÔ ÔÅËÕÝÉÊ ÏÂßÅËÔ × ÐÁÍÑÔÉ, ÐÅÒÅÍÅÝÁÅÔÓÑ ÎÁ ÓÌÅÄÕÀÝÉÊ +ÏÂßÅËÔ É ×ÏÚ×ÒÁÝÁÅÔ ÕËÁÚÁÔÅÌØ ËÏÐÉÀ ÏÂßÅËÔÁ, ÂÙ×ÛÉÊ ÔÅËÕÝÉÍ ÄÏ ÅÅ ×ÙÚÏ×Á. + +äÌÑ ÚÁÐÉÓÉ × ÆÁÊÌ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÌÉÂÏ ÆÕÎËÃÉÀ + +\index{dgt_put}% +\function{void dgt\_put(DGT *dgt, DGT\_ITEM *item);} +ÌÉÂÏ ÍÏÄÉÆÉÃÉÒÏ×ÁÔØ ÔÅËÕÝÉÊ ÏÂßÅËÔ Ó ÐÏÍÏÝØÀ ÍÁËÒÏÓÏ× É ÆÕÎËÃÉÊ ÄÌÑ +ÒÁÂÏÔÙ Ó ÔÅËÕÝÅÊ ÚÁÐÉÓØÀ É ÚÁÔÅÍ ×ÙÚ×ÁÔØ {\tt dgt\_next} ÄÌÑ ÐÅÒÅÈÏÄÁ +Ë ÎÏ×ÏÍÕ ÏÂßÅËÔÕ. +\section{éÔÅÒÁÔÏÒÙ} +ðÏÓËÏÌØËÕ ×ÅËÔÏÒÎÙÅ ÆÁÊÌÙ ÈÒÁÎÑÔ Ä×Á ÔÉÐÁ ÏÂßÅËÔÏ×~--- ÌÉÎÉÉ É ÔÏÞËÉ, +É ÔÏÌØËÏ ÏÞÅÎØ ÎÅÍÎÏÇÉÅ ÁÌÇÏÒÉÔÍÙ (× ÏÓÎÏ×ÎÏÍ ÔÒÁÎÓÆÏÒÍÁÃÉÑ ËÏÏÒÄÉÎÁÔ) +ÚÁÔÒÁÇÉ×ÁÀÔ É ÔÅ É ÄÒÕÇÉÅ, ÏÐÒÅÄÅÌÅÎÙ ÉÔÅÒÁÔÏÒÙ: +\index{for_each_line}% +\function{for\_each\_line(DGT *dgt,void (*item\_proc)(DGT *dgt), + DGT *outstream);} +\index{for_each_point}% +\function{for\_each\_point(DGT *dgt,void (*item\_proc)(DGT *dgt), +DGT *outstream);} + +ïÎÉ ×ÙÚÙ×ÁÀÔ ÕËÁÚÁÎÎÕÀ ÆÕÎËÃÉÀ ÔÏÌØËÏ ÄÌÑ ÌÉÎÉÊ ÉÌÉ ÔÏÞÅË ÆÁÊÌÁ. +æÕÎËÃÉÉ ÐÅÒÅÄÁÅÔÓÑ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÒÕËÔÕÒÕ {\tt DGT} × ÂÕÆÅÒÅ +ËÏÔÏÒÏÊ ÎÁÈÏÄÉÔÓÑ ÏÂßÅËÔ. + +üÔÉ ÉÔÅÒÁÔÏÒÙ ÍÏÖÎÏ ÐÒÉÍÅÎÑÔØ Ë ÆÁÊÌÁÍ, ÏÔËÒÙÔÙÍ ÄÌÑ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ +ÞÔÅÎÉÑ ÉÌÉ Ë ÆÁÊÌÁÍ ÚÁÇÒÕÖÅÎÎÙÍ × ÐÁÍÑÔØ. + +åÓÌÉ ÐÁÒÁÍÅÔÒ {\tt outstream} ÎÅ {\tt NULL}, ÔÏ × ÆÁÊÌ, ÎÁ ËÏÔÏÒÙÊ +ÏÎ ÕËÁÚÙ×ÁÅÔ, ËÏÐÉÒÕÀÔÓÑ ×ÓÅ ÏÂßÅËÔÙ, ËÏÔÏÒÙÅ ÎÅ ÏÂÒÁÂÁÔÙ×ÁÌÉÓØ É +ÏÂÒÁÂÏÔÁÎÎÙÅ ÏÂßÅËÔÙ. + +ôÏ ÅÓÔØ, ÎÁÐÒÉÍÅÒ, × ÓÌÕÞÁÅ {\tt for\_each\_line} ÔÏÞËÁ ÂÕÄÅÔ ÓËÏÐÉÒÏ×ÁÎÁ +ÂÅÚ ÏÂÒÁÂÏÔËÉ, Á ÌÉÎÉÑ ÚÁÐÉÓÁÎÁ ÐÏÓÌÅ ÔÏÇÏ, ËÁË ÅÅ ÉÚÍÅÎÉÔ {\tt item\_proc}. + +ëÒÏÍÅ ÜÔÏÇÏ, ÓÕÝÅÓÔ×ÕÅÔ ÉÔÅÒÁÔÏÒ +\index{for_each_item} +\function{void for\_each\_item(DGT *dgt,void (*item\_proc)(DGT *dgt));} + +ËÏÔÏÒÙÊ ×ÙÐÏÌÎÑÅÔ ÐÅÒÅÄÁÎÎÕÀ ÆÕÎËÃÉÀ É ÄÌÑ ÌÉÎÉÊ É ÄÌÑ ÔÏÞÅË. +õ ÎÅÇÏ ÎÅÔ ÐÁÒÁÍÅÔÒÁ {\tt outstream}, ÔÁË ÞÔÏ ÅÓÌÉ ÎÕÖÎÏ ÚÁÐÉÓÁÔØ +ÉÚÍÅÎÅÎÎÙÅ ÏÂßÅËÔÙ, {\tt item\_proc} ÄÏÌÖÎÁ Ï ÜÔÏÍ ÐÏÚÁÂÏÔÉÔØÓÑ ÓÁÍÁ. +\section{òÁÂÏÔÁ Ó ÔÅËÕÝÉÍ ÏÂßÅËÔÏÍ} +\label{ItemMacros} +éÔÁË, ÎÕÖÎÁÑ ×ÁÍ ÌÉÎÉÑ (ÔÏÞËÁ) ÎÁÈÏÄÉÔÓÑ × ÂÕÆÅÒÅ ÓÔÒÕËÔÕÒÙ {\tt DGT}. +þÔÏ ÍÏÖÎÏ ÄÅÌÁÔØ Ó ÎÅÊ ÄÁÌØÛÅ? + +÷Ï-ÐÅÒ×ÙÈ, ÎÕÖÎÏ ÕÍÅÔØ ÏÐÒÅÄÅÌÑÔØ, ÌÉÎÉÑ ÜÔÏ ÉÌÉ ÔÏÞËÁ. +äÌÑ ÜÔÏÇÏ ÏÐÒÅÄÅÌÅÎÙ ÍÁËÒÏÓÙ: +\index{dgt_is_line}% +\function{int dgt\_is\_line(DGT *dgt)} +\index{dgt_is_point}% +\function{int dgt\_is\_point(DGT *dgt)} +÷Ï-×ÔÏÒÙÈ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÌÉÎÉÑ ÜÔÏ ÉÌÉ ÔÏÞËÁ, +ÎÁÍ ÍÏÖÅÔ ÐÏÔÒÅÂÏ×ÁÔØÓÑ ÉÄÅÎÔÉÆÉËÁÔÏÒ ÏÂßÅËÔÁ. +\index{dgt_id}% +\function{long int dgt\_id(DGT *dgt)} +÷-ÔÒÅÔØÉÈ, ËÏÏÒÄÉÎÁÔÙ ÔÏÞËÉ: +\index{dgt_pointx}% +\function{short int dgt\_pointx(DGT *dgt)} +\index{dgt_pointy}% +\function{short int dgt\_pointy(DGT *dgt)} +ÉÌÉ ËÏÏÒÄÉÎÁÔÙ ÐÒÑÍÏÕÇÏÌØÎÉËÁ-ÍÁÓËÉ ÌÉÎÉÉ: +\index{dgt_xl}% +\function{short int dgt\_xl(DGT *dgt)} +\index{dgt_yb}% +\function{short int dgt\_yb(DGT *dgt)} +\index{dgt_xr}% +\function{short int dgt\_xr(DGT *dgt)} +\index{dgt_yt}% +\function{short int dgt\_yt(DGT *dgt)} +÷-ÞÅÔ×ÅÒÔÙÈ, ËÏÌÉÞÅÓÔ×Ï ÔÏÞÅËÔ × ÌÉÎÉÉ: +\index{dgt_line_len}% +\function{short int dgt\_line\_len(DGT *dgt)} +é, ÎÁËÏÎÅÃ, ËÏÏÒÄÉÎÁÔÙ $i$-ÔÏÇÏ ÕÚÌÁ ÌÉÎÉÉ: +\index{dgt_nx}% +\function{short int dgt\_nx(DGT *dgt,int i)} +\index{dgt_ny}% +\function{short int dgt\_ny(DGT *dgt,int i)} +ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ, ÞÔÏ ÐÅÒ×ÁÑ ÔÏÞËÁ ÌÉÎÉÉ ÉÍÅÅÔ ÎÏÍÅÒ 0, Á ÐÏÓÌÅÄÎÑÑ~--- +{\tt dgt\_line\_len(dgt)-1}. + +ëÒÏÍÅ ÔÏÇÏ, ÉÎÏÇÄÁ ÕÄÏÂÎÅÅ ÐÏÌÕÞÉÔØ ÓÓÙÌËÕ ÎÁ ÔÏÞËÕ ÉÌÉ ÕÚÅÌ ÌÉÎÉÉ, +ËÁË ÎÁ ÓÔÒÕËÔÕÒÕ {\tt POINT}. äÌÑ ÜÔÏÇÏ ÐÒÅÄÎÁÚÎÁÞÅÎÙ ÍÁËÒÏÓÙ: +\index{dgt_node}% +\function{POINT dgt\_node(DGT *dgt,int i)} +\index{dgt_point}% +\function{POINT dgt\_point(DGT *dgt)} + +åÓÌÉ ×ÁÍ ÐÏ ËÁËÉÍ-ÔÏ ÐÒÉÞÉÎÁÍ ÎÕÖÎÏ ÒÁÂÏÔÁÔØ ÎÅ ÓÏ ÓÔÒÕËÔÕÒÏÊ {\tt DGT}, +Á Ó ÏÔÄÅÌØÎÙÍ ÏÂßÅËÔÏÍ, ÒÁÚÍÅÝÅÎÎÙÍ × ÄÉÎÁÍÉÞÅÓËÏÊ ÐÁÍÑÔÉ, ÔÏ ÚÁÍÅÎÉÔÅ +ÐÒÅÆÉËÓ {\tt dgt\_} ÎÁ ÐÒÅÆÉËÓ {\tt item\_} É × ËÁÞÅÓÔ×Å ÐÅÒ×ÏÇÏ +ÐÁÒÁÍÅÔÒÁ ÕËÁÚÙ×ÁÊÔÅ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÒÕËÔÕÒÕ {\tt DGT\_ITEM}\index{DGT_ITEM}. + +ôÅÐÅÒØ ÍÙ ÍÏÖÅÍ ÐÒÏÞÉÔÁÔØ ÌÀÂÏÊ ÐÁÒÁÍÅÔÒ ÏÂßÅËÔÁ. ÷ÏÐÒÏÓ × ÔÏÍ, ËÁË ÅÇÏ +ÉÚÍÅÎÉÔØ. + +ïÔ×ÅÔ ÐÅÒ×ÙÊ, ÐÁÒÁÄÏËÓÁÌØÎÙÊ: ÌÀÂÏÊ ÉÚ ×ÙÛÅÐÒÉ×ÅÄÅÎÎÙÈ ÍÁËÒÏÓÏ× (ËÒÏÍÅ +{\tt dgt\_is\_line}\index{dgt_is_line} É {\tt dgt\_is\_point})\index{dgt_is_point} ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ × {\bf ÌÅ×ÏÊ} +ÞÁÓÔÉ ÏÐÅÒÁÔÏÒÁ ÐÒÉÓ×ÁÉ×ÁÎÉÑ. + +÷ÅÄØ ÜÔÏ ÎÅ ÆÕÎËÃÉÉ, Á ÍÁËÒÏÓÙ, ÄÁÀÝÉÅ ÄÏÓÔÕÐ Ë ÎÅËÏÔÏÒÙÍ ÐÏÌÑÍ ÓÔÒÕËÔÕÒÙ +{\tt DGT\_ITEM}. + +ïÄÎÁËÏ ÔÁË ÐÏÓÔÕÐÁÔØ ÎÅ ÒÅËÏÍÅÎÄÕÅÔÓÑ. äÅÌÏ × ÔÏÍ, ÞÔÏ × ÔÁËÏÍ ÓÌÕÞÁÅ +ÎÉÇÄÅ ÎÅ ÂÕÄÅÔ ÏÔÍÅÞÅÎÏ, ÞÔÏ ÏÂßÅËÔ ÉÚÍÅÎÅÎ, ÐÏÜÔÏÍÕ ÉÚÍÅÎÅÎÉÑ ÍÏÇÕÔ ÂÙÔØ +ÎÅ ÓÏÈÒÁÎÅÎÙ. åÓÌÉ ÕÖ ÏÞÅÎØ ÈÏÞÅÔÓÑ, ÔÏ ÐÏÓÌÅ ÐÒÑÍÏÇÏ ÉÚÍÅÎÅÎÉÑ ÐÏÌÅÊ +ÏÂßÅËÔÁ, ÉÓÐÏÌØÚÕÊÔÅ ÆÕÎËÃÉÀ + +\function{void dgt\_touch(DGT *dgt)}\index{dgt_touch} +ÞÔÏÂÙ ÐÏÍÅÔÉÔØ ÏÂßÅËÔ ËÁË ÉÚÍÅÎÅÎÎÙÊ. + +îÏ ÌÕÞÛÅ ÐÏÌØÚÏ×ÁÔØÓÑ ÓÌÅÄÕÀÝÉÍÉ ÆÕÎËÃÉÑÍÉ: + +\function{void dgt\_set\_id(DGT *dgt,long int newID);}\index{dgt_set_id} +õÓÔÁÎÁ×ÌÉ×ÁÅÔ ÉÄÅÎÔÉÆÉËÁÔÏÒ ÏÂßÅËÔÁ. +\function{void dgt\_set\_point(DGT *dgt, int x, int y);}\index{dgt_set_point} +úÁÄÁÅÔ ËÏÏÒÄÉÎÁÔÙ ÔÏÞËÉ É ÄÅÌÁÅÔ ÏÂßÅËÔ ÔÏÞËÏÊ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÓÏÈÒÁÎÉÔØ +ÏÄÎÕ ËÏÏÒÄÉÎÁÔÕ, ×ÍÅÓÔÏ ÎÅÅ ÐÅÒÅÄÁÊÔÅ ËÏÎÓÔÁÎÔÕ {\tt KEEP\_OLD\_VALUE}% +\index{KEEP_OLD_VALUE} +\function{int dgt\_add\_node(DGT *dgt,int x,int y);}\index{dgt_add_node} +äÏÂÁ×ÌÑÅÔ ÔÏÞËÕ × ËÏÎÅà ÌÉÎÉÉ (ÉÌÉ ÓÏÚÄÁÅÔ ÐÅÒ×ÕÀ ÔÏÞËÕ É ÐÏÍÅÞÁÅÔ +ÏÂßÅËÔ ËÁË ÌÉÎÉÀ. ÷ÏÚ×ÒÁÝÁÅÔ 0 × ÓÌÕÞÁÅ, ÅÓÌÉ ×ÓÅ × ÐÏÒÑÄËÅ ÉÌÉ +ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, ÅÓÌÉ ÔÏÞËÕ ÄÏÂÁ×ÉÔØ ÎÅ×ÏÚÍÏÖÎÏ (ÕÖÅ ÅÓÔØ 500 ÔÏÞÅË). +\function{int dgt\_ins\_node(DGT *dgt,int index,int x,int y)}\index{dgt_ins_node} +÷ÓÔÁ×ÌÑÅÔ ÔÏÞËÕ × ÌÉÎÉÀ ÐÅÒÅÄ ÕÚÌÏÍ ÎÏÍÅÒ {\tt index}. ÷ÏÚ×ÒÁÝÁÅÔ 0, +ÅÓÌÉ ×ÓÅ × ÐÏÒÑÄËÅ, 1 ÅÓÌÉ ÞÉÓÌÏ ÔÏÞÅË ÐÒÅ×ÙÓÉÔ 500, É 2 ÅÓÌÉ ÕÚÌÁ Ó ÔÁËÉÍ +ÎÏÍÅÒÏÍ ÎÅÔ. +\function{int dgt\_mv\_node(DGT *dgt,int index,int x,int y)}\index{dgt_mv_node} +íÅÎÑÅÔ ËÏÏÒÄÉÎÁÔÙ ÕËÁÚÁÎÎÏËÇÏ ÕÚÌÁ ÎÁ ÚÁÄÁÎÎÙÅ. ÷ÏÚ×ÒÁÝÁÅÔ 0, ÅÓÌÉ +×ÓÅ × ÐÏÒÑÄËÅ É ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, ÅÓÌÉ ÔÁËÏÇÏ ÕÚÌÁ ÎÅÔ. + +åÓÌÉ ×ÁÍ ÎÁÄÏ ÉÚÍÅÎÉÔØ ÔÏÌØËÏ ÏÄÎÕ ËÏÏÒÄÉÎÁÔÕ, ÐÅÒÅÄÁÊÔÅ ×ÍÅÓÔÏ ×ÔÏÒÏÊ +ËÏÎÓÔÁÎÔÕ {\tt KEEP\_OLD\_VALUE}\index{KEEP_OLD_VALUE}. + +\function{int dgt\_rm\_node(DGT *dgt,int index)}\index{dgt_rm_node} +õÄÁÌÑÅÔ ÕËÁÚÁÎÎÙÊ ÕÚÅÌ. ïÛÉÂËÁ ×ÏÚÎÉËÁÅÔ, ÅÓÌÉ ÜÔÏ ÂÙÌ ÐÒÅÄÐÏÓÌÅÄÎÉÊ ÕÚÅÌ +× ÌÉÎÉÉ. (ëÏÒÒÅËÔÎÁÑ ÌÉÎÉÑ ÄÏÌÖÎÁ ÓÏÄÅÒÖÁÔØ ÎÅ ÍÅÎÅÅ Ä×ÕÈ ÕÚÌÏ×). + +é, ÎÁËÏÎÅÃ, ÒÁÚÒÅÚÁÎÉÅ ÌÉÎÉÊ. + +\function{int dgt\_split(DGT *dgt,int index)}\index{dgt_split} +òÁÚÒÅÚÁÅÔ ÌÉÎÉÀ × ÕËÁÚÁÎÎÏÍ ÕÚÌÅ. ðÒÉ ÜÔÏÍ +ÕÚÅÌ ÄÕÂÌÉÒÕÅÔÓÑ É ÐÏÐÁÄÁÅÔ × ÏÂÅ ÐÏÌÏ×ÉÎËÉ. ôÅËÕÝÉÍ ÓÔÁÎÏ×ÉÔÓÑ È×ÏÓÔ ÌÉÎÉÉ, +Á ÎÁÞÁÌÏ, ÅÓÌÉ ÆÁÊÌ ÂÙÌ ÏÔËÒÙÔ × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÊ ÚÁÐÉÓÉ, ÓÂÒÁÓÙ×ÁÅÔÓÑ +ÎÁ ÄÉÓË. üÔÏÊ ÆÕÎËÃÉÅÊ ÎÅÌØÚÑ ÐÏÌØÚÏ×ÁÔØÓÑ ÉÚ ÉÔÅÒÁÔÏÒÁ {\tt for\_each\_line}\index{for_each_line}, +ÅÓÌÉ ÏÎ ÐÒÉÍÅÎÑÅÔÓÑ Ë ÆÁÊÌÕ, ÏÔËÒÙÔÏÍÕ × ÒÅÖÉÍÅ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÇÏ ÞÔÅÎÉÑ. + +\function{int dgt\_cut\_segment(DGT *dgt,int index)}\index{dgt_cut_segment} +òÁÚÒÅÚÁÅÔ ÌÉÎÉÀ, ÕÄÁÌÑÑ ÏÔÒÅÚÏË ÏÔ $n-1$ ÄÏ $n$-ÎÏÇÏ ÕÚÌÁ. ÷ÓÅ ÏÓÔÁÌØÎÏÅ +× ÔÏÞÎÏÓÔÉ ËÁË × ÐÒÅÄÙÄÕÝÅÍ ÓÌÕÞÁÅ. + +ðÒÏÃÅÄÕÒÁ {\tt dgt\_next}\index{dgt_next} ÐÏÚÁÂÏÔÉÔÓÑ Ï ÎÅËÏÔÏÒÙÈ ÉÚ ÏÛÉÂÏË, ËÏÔÏÒÙÅ +ÍÏÖÎÏ ÄÏÐÕÓÔÉÔØ ÐÒÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÉ ÏÂßÅËÔÁ. +\begin{enumerate} +\item íÁÓËÁ ÌÉÎÉÉ ÂÕÄÅÔ ÓËÏÒÒÅËÔÉÒÏ×ÁÎÁ. +\item éÚ Ä×ÕÈ ÓÏÓÅÄÎÉÈ ÕÚÌÏ× Ó ÓÏ×ÐÁÄÁÀÝÉÍÉ ËÏÏÒÄÉÎÁÔÁÍÉ ÂÕÄÅÔ ÏÓÔÁ×ÌÅÎ ÏÄÉÎ. +\item ìÉÎÉÉ ÉÚ ÏÄÎÏÊ ÔÏÞËÉ ÂÕÄÕÔ ×ÙÂÒÏÛÅÎÙ. +\item ôÏÞËÁ Ó ÎÕÌÅ×ÙÍ ÉÄÅÎÔÉÆÉËÁÔÏÒÏÍ ÂÕÄÅÔ ×ÙÂÒÏÛÅÎÁ. +\end{enumerate} + +\section{DGT-ÆÁÊÌÙ × ÐÁÍÑÔÉ} + +\label{dgtInMemory} +÷ÅËÔÏÒÎÙÊ ÆÁÊÌ, ÚÁÇÒÕÖÅÎÎÙÊ × ÐÁÍÑÔØ, ÍÏÖÎÏ ÒÁÓÓÍÁÔÒÉ×ÁÔØ ËÁË ÍÁÓÓÉ× +ÏÂßÅËÔÏ×. ðÏÓÌÅÄÏ×ÁÔÅÌØÎÙÊ ÄÏÓÔÕÐ ÐÒÏÄÏÌÖÁÅÔ ÒÁÂÏÔÁÔØ, ÎÏ ÓÕÝÅÓÔ×ÕÀÔ +ÆÕÎËÃÉÉ, ÐÏÚ×ÏÌÑÀÝÉÅ ÓÄÅÌÁÔØ ÔÅËÕÝÉÍ ÏÂßÅËÔÏÍ ÌÀÂÏÊ, ÎÅÚÁ×ÉÓÉÍÏ +ÏÔ ÐÏÒÑÄËÁ É ÏÂÒÁÝÁÔØÓÑ Ë ÏÂßÅËÔÁÍ, ÎÅ ÄÅÌÁÑ ÉÈ ÔÅËÕÝÉÍÉ. + +ðÏÓÌÅÄÎÉÊ ÓÐÏÓÏ ÉÍÅÅÔ ÓÕÝÅÓÔ×ÅÎÎÙÊ ÎÅÄÏÓÔÁÔÏË~--- ÅÓÌÉ ×Ù ÈÏÔÉÔÅ +ÉÚÍÅÎÉÔØ ÄÌÉÎÕ ÌÉÎÉÉ, ÔÏ ×ÁÍ ÐÒÉÄÅÔÓÑ ÓÁÍÏÍÕ ÐÏÚÁÂÏÔÉÔØÓÑ Ï ×ÙÄÅÌÅÎÉÉ +ÐÁÍÑÔÉ ÐÏÄ ÎÏ×ÕÀ ÌÉÎÉÀ. + +éÔÁË, ÐÒÏÃÅÄÕÒÙ, ÓÐÅÃÉÆÉÞÎÙÅ ÄÌÑ ÆÁÊÌÁ × ÐÁÍÑÔÉ: + +\function{int dgt\_seek(DGT *dgt,int index);}\index{dgt_seek} + +äÅÌÁÅÔ ÔÅËÕÝÉÍ ÏÂßÅËÔ Ó ÕËÁÚÁÎÎÙÍ ÎÏÍÅÒÏÍ. (ÐÏÓÌÅ ÞÅÇÏ ÍÏÖÎÏ +ÓÐÏËÏÊÎÏ ÅÇÏ ÍÅÎÑÔØ Ó ÐÏÍÏÝØÀ ÌÀÂÙÈ ÆÕÎËÃÉÊ É ÍÁËÒÏÓÏ× ÐÒÅÄÙÄÕÝÅÇÏ ÒÁÚÄÅÌÁ.) + +\function{DGT\_ITEM* dgt\_item\_ptr(DGT *dgt,int index);}\index{dgt_item_ptr} +% +÷ÏÚ×ÒÁÝÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ ÏÂßÅËÔ Ó ÕËÁÚÁÎÎÙÍ ÎÏÍÅÒÏÍ. äÌÑ ÄÏÓÔÕÐÁ +Ë ÜÔÏÍÕ ÏÂßÅËÔÕ ÍÏÖÎÏ ÉÓÐÏÌØÚÏ×ÁÔØ ÍÁËÒÏÓÙ {\tt item\_\dots}. + +üÔÏÔ ÓÐÏÓÏ ÄÏÓÔÕÐÁ ÒÅËÏÍÅÎÄÕÅÔÓÑ ÉÓÐÏÌØÚÏ×ÁÔØ ËÁË ÄÏÓÔÕÐ ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ. +÷ ËÒÁÊÎÅÍ ÓÌÕÞÁÅ, ÅÓÌÉ ÎÅÏÂÈÏÄÉÍÏ ÉÚÍÅÎÉÔØ ÎÅ ÔÅËÕÝÕÀ ÌÉÎÉÀ, ×ÏÓÐÏÌØÚÕÊÔÅÓØ +ÆÕÎËÃÉÅÊ: +\function{int dgt\_replace(DGT *dgt,int index,DGT\_ITEM* new\_item);}\index{dgt_replace} + +üÔÁ ÆÕÎËÃÉÑ ÐÏÌÕÞÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ ÄÉÎÁÍÉÞÅÓËÉ ÒÁÚÍÅÝÅÎÎÙÊ ÏÂßÅËÔ +É ÐÏÍÅÝÁÅÔ ÅÇÏ × ÆÁÊÌ. äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÓÜËÏÎÏÍÉÔØ ÐÁÍÑÔØ, +ÒÁÚÍÅÝÁÊÔÅ ÏÂßÅËÔ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ +\function{DGT\_ITEM *alloc\_item(DGT\_ITEM *item);}\index{alloc_item} +üÔÁ ÆÕÎËÃÉÑ ÐÏÌÕÞÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ ÏÂßÅËÔ, ×ÙÄÅÌÑÅÔ ÐÁÍÑÔÉ ÒÏ×ÎÏ ÓÔÏÌØËÏ, +ÓËÏÌØËÏ ÎÕÖÎÏ, ÞÔÏÂÙ ÒÁÚÍÅÓÔÉÔØ ÜÔÏÔ ÏÂßÅËÔ, É ËÏÐÉÒÕÅÔ ÅÇÏ ÔÕÄÁ. + +æÕÎËÃÉÉ ×ÓÔÁ×ËÉ ÏÂßÅËÔÁ × ÕËÁÚÁÎÎÏÍ ÍÅÓÔÅ × ÂÉÂÌÉÏÔÅËÅ ÎÅÔ. +ðÒÉ ÄÏÂÁ×ÌÅÎÉÉ ÏÂßÅËÔÁ Ó ÐÏÍÏÝØÀ {\tt dgt\_put}\index{dgt_put} ÅÇÏ ÍÅÓÔÏ ÏÐÒÅÄÅÌÑÅÔÓÑ +× ÓÏÏÔ×ÅÔÓÔ×ÉÉ Ó ÔÅËÕÝÉÍ ÐÏÒÑÄËÏÍ ÓÏÒÔÉÒÏ×ËÉ. åÓÌÉ ÐÏÒÑÄÏË ÓÏÒÔÉÒÏ×ËÉ +×ÏÏÂÝÅ ÎÅ ÚÁÄÁ×ÁÌÓÑ, ÔÏ ÜÔÏ ÂÕÄÅÔ ÓÌÅÄÕÀÝÉÊ ÏÂßÅËÔ ÐÏÓÌÅ ÔÅËÕÝÅÇÏ, +É ÏÎ ÓÔÁÎÅÔ ÔÅËÕÝÉÍ. + +ðÏÒÑÄÏË ÓÏÒÔÉÒÏ×ËÉ dgt ÆÁÊÌÁ × ÐÁÍÑÔÉ ÍÏÖÎÏ ÉÚÍÅÎÉÔØ ÐÒÉ +ÐÏÍÏÝÉ ÆÕÎËÃÉÉ +\function{void dgt\_sort(DGT *dgt,int (*compare\_func)(DGT\_ITEM* i1, DGT\_ITEM * i2));}\index{dgt_sort} + +æÕÎËÃÉÑ {\tt compare\_func} ÄÏÌÖÎÁ ×ÏÚ×ÒÁÝÁÔØ 1, ÅÓÌÉ i1 ÎÁÄÏ ÒÁÚÍÅÓÔÉÔØ +ÐÏÚÖÅ, ÞÅÍ i2, -1 ÅÓÌÉ ÎÁÏÂÏÒÏÔ, É 0, ÅÓÌÉ ÐÏ ÄÁÎÎÏÍÕ ËÒÉÔÅÒÉÀ ÓÏÒÔÉÒÏ×ËÉ +ÜÔÉ ÏÂßÅËÔÙ ÒÁ×ÎÙ. + +éÚÍÅÎÅÎÉÅ ËÒÉÔÅÒÉÑ ÓÏÒÔÉÒÏ×ËÉ ÐÒÉ ÕÖÅ ÚÁÇÒÕÖÅÎÎÏÍ ÆÁÊÌÅ ÐÒÉ×ÏÄÉÔ +Ë ÅÇÏ ÐÅÒÅÓÏÒÔÉÒÏ×ËÅ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ {\tt qsort}. + +ðÏÜÔÏÍÕ ÌÕÞÛÅ ×ÙÚÙ×ÁÔØ {\tt dgt\_sort} {\bf ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ ÐÅÒÅÄ}{\tt load\_dgt}. + + +÷ÙÚÏ× {\tt dgt\_sort(dgt,NULL)} ÐÒÉ×ÏÄÉÔ Ë ÏÔÍÅÎÅ ÓÏÒÔÉÒÏ×ËÉ. +ðÏÒÑÄÏË ÒÁÓÐÏÌÏÖÅÎÉÑ ÓÕÝÅÓÔ×ÕÀÝÉÈ ÏÂßÅËÔÏ× ÎÅ ÍÅÎÑÅÔÓÑ, ÎÏ ÎÏ×ÙÅ ÄÏÂÁ×ÌÑÅÍÙÅ +ÏÂßÅËÔÙ ÂÕÄÕÔ ÒÁÓÐÏÌÁÇÁÔØÓÑ ÂÅÚ ÕÞÅÔÁ ÆÕÎËÃÉÉ ÓÏÒÔÉÒÏ×ËÉ. + +\section{òÁÂÏÔÁ Ó ËÏÏÒÄÉÎÁÔÁÍÉ} +äÌÑ ÐÅÒÅÓÞÅÔÁ ËÏÏÒÄÉÎÁÔ ÉÚ ×ÎÕÔÒÅÎÎÅÇÏ ÐÒÅÄÓÔÁ×ÌÅÎÉÑ dgt-ÆÁÊÌÁ × +ÁÌØÔÅÒÎÁÔÉ×ÎÙÅ É ÏÂÒÁÔÎÏ ÐÒÉÍÅÎÑÀÔÓÑ ÆÕÎËÃÉÉ: +\function{int dgt\_x(DGT* dgt,double x);}\index{dgt_x} +\function{int dgt\_y(DGT* dgt,double y);}\index{dgt_y} + +\function{double real\_x(DGT* dgt,int x);}\index{real_x} +\function{double real\_y(DGT* dgt,int y);}\index{real_y} +äÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ ×ÏÚÎÉËÁÅÔ ÚÁÄÁÞÁ ÐÅÒÅÓÞÅÔÁ ÉÎÔÅÒ×ÁÌÏ×, ËÏÔÏÒÁÑ ÍÏÖÅÔ +ÂÙÔØ ×ÙÐÏÌÎÅÎÁ Ó ÍÅÎØÛÉÍ ÞÉÓÌÏÍ ÏÐÅÒÁÃÉÊ, ÞÅÍ ×ÙÞÉÓÌÅÎÉÅ ÓÏÂÓÔ×ÅÎÎÏ +ËÏÏÒÄÉÎÁÔ. +äÌÑ ÜÔÏÇÏ ÏÐÒÅÄÅÌÅÎÙ ÆÕÎËÃÉÉ +\function{double real\_dx(DGT *dgt,int dx);}\index{real_dx} +\function{double real\_dy(DGT *dgt,int dy);}\index{real_dy} +é, ÎÁËÏÎÅÃ, ×ÙÞÉÓÌÅÎÉÅ ÒÁÓÓÔÏÑÎÉÊ. +\function{double dgt\_dist(DGT *dgt, int x1, int y1, int x2, int y2);}\index{dgt_dist} +÷ÙÞÉÓÌÑÅÔ ÒÁÓÓÔÏÑÎÉÅ ÍÅÖÄÕ Ä×ÕÍÑ ÔÏÞËÁÍÉ ÚÁÄÁÎÎÙÍÉ ÐÁÒÁÍÉ ×ÎÕÔÒÅÎÎÉÈ +ËÏÏÒÄÉÎÁÔ × ÅÄÉÎÉÃÁÈ ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔ. + +äÌÑ ×ÙÞÉÓÌÅÎÉÑ ÒÁÓÓÔÏÑÎÉÑ ÍÅÖÄÕ Ä×ÕÍÑ ÕÚÌÁÍÉ ÌÉÎÉÉ ÍÏÖÎÏ +ÉÓÐÏÌØÚÏ×ÁÔØ ÆÕÎËÃÉÀ +\function{double dgt\_pdist(DGT *dgt, POINT p1, POINT p2);}\index{dgt_pdist} + +÷Ï ÍÎÏÇÉÈ ÁÌÇÏÒÉÔÍÁÈ ÒÁÓÓÔÏÑÎÉÑ ÉÓÐÏÌØÚÕÀÔÓÑ ÔÏÌØËÏ ÄÌÑ ÓÒÁ×ÎÅÎÉÑ +ÍÅÖÄÕ ÓÏÂÏÊ (É, ×ÏÚÍÏÖÎÏ, Ó ÎÅËÏÔÏÒÙÍÉ ËÏÎÓÔÁÎÔÁÍÉ). +÷ ÜÔÉÈ ÓÌÕÞÁÑÈ ÍÏÖÎÏ ÉÚÂÅÖÁÔØ ÎÅ ÔÏÌØËÏ ÐÅÒÅ×ÏÄÁ ÒÁÓÓÔÏÑÎÉÑ × ÏÓÍÙÓÌÅÎÎÙÅ +ÅÄÉÎÉÃÙ, ÎÏ É ÉÚ×ÌÅÞÅÎÉÑ ËÏÒÎÑ É Ó×ÅÓÔÉ ×ÓÅ ×ÙÞÉÓÌÅÎÉÑ Ë ÏÐÅÒÁÃÉÑÍ Ó +ÃÅÌÙÍÉ. + +äÌÑ ÜÔÏÇÏ ÐÒÅÄÎÁÚÎÁÞÅÎÙ ÆÕÎËÃÉÉ +\function{long int sq\_dist(DGT *dgt,int x1, int y1, int x2, int y2);}\index{sq_dist} +\function{long int sq\_pdist(DGT *dgt,POINT p1, POINT p2);}\index{sq_pdist} +×ÙÞÉÓÌÑÀÝÉÅ Ë×ÁÄÒÁÔ ÒÁÓÓÔÏÑÎÉÑ ÍÅÖÄÕ ÔÏÞËÁÍÉ × ÎÅËÏÔÏÒÙÈ ÕÓÌÏ×ÎÙÈ ÅÄÉÎÉÃÁÈ. +(ÉÚ×ÅÓÔÎÏ, ÞÔÏ Ë×ÁÄÒÁÔ ÐÒÉ $x>=0$~--- ÆÕÎËÃÉÑ ÍÏÎÏÔÏÎÎÁÑ). + +äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ ÓÒÁ×ÎÉ×ÁÔØ ÒÅÚÕÌØÔÁÔÙ ÆÕÎËÃÉÉ {\tt sq\_dist} +Ó ËÏÎÓÔÁÎÔÁÍÉ, ÚÁÄÁÎÎÙÍÉ ÉÚÎÁÞÁÌØÎÏ ËÁË ÒÁÓÓÔÏÑÎÉÑ × ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔÁÈ, +ÉÓÐÏÌØÚÕÅÔÓÑ ÆÕÎËÃÉÑ +\function{long int sq\_const(DGT *dgt,double dist);}\index{sq_const} +ïÎÁ ÐÅÒÅ×ÏÄÉÔ ÒÁÓÓÔÏÑÎÉÅ, ÚÁÄÁÎÎÏÅ × ÅÄÉÎÉÃÁÈ ÁÌØÔÅÒÎÁÔÉ×ÎÙÈ ËÏÏÒÄÉÎÁÔ, +× ÕÓÌÏ×ÎÏÅ ÚÎÁÞÅÎÉÅ, ÁÎÁÌÏÇÉÞÎÏÅ ×ÏÚ×ÒÁÝÁÅÍÙÍ {\tt sq\_dist} + +ëÒÏÍÅ ÒÁÓÓÔÏÑÎÉÊ, ÎÅÓÏÏÔ×ÅÔÓÔ×ÉÅ ÅÄÉÎÉà ËÏÏÒÄÉÎÁÔ ÐÏ ÏÓÑÍ ×ÌÉÑÅÔ É ÎÁ + ÎÁ ×ÙÞÉÓÌÅÎÉÅ ÕÇÌÏ×. ðÏÜÔÏÍÕ × ÂÉÂÌÉÏÔÅËÕ ×ËÌÀÞÅÎÁ ÆÕÎËÃÉÑ + +\function{double dgt\_atan2(DGT *dgt,int dy, int dx);}\index{dgt_atan2} + +×ÙÞÉÓÌÑÀÝÁÑ ÁÒËÔÁÎÇÅÎÓ ÏÔÎÏÛÅÎÉÑ {$\Delta y\over \Delta x$} Ó ÐÏÐÒÁ×ËÏÊ ÎÁ ËÏÏÒÄÉÎÁÔÎÕÀ +ÓÉÓÔÅÍÕ ÕËÁÚÁÎÎÏÇÏ ÆÁÊÌÁ. ÷ ÏÓÔÁÌØÎÏÍ ÅÅ ÄÅÊÓÔ×ÉÅ ÐÏÌÎÏÓÔØÀ ÜË×É×ÁÌÅÎÔÎÏ +ÂÉÂÌÉÏÔÅÞÎÏÊ ÆÕÎËÃÉÉ {\tt atan2}. + +\chapter{æÕÎËÃÉÉ-ÕÔÉÌÉÔÙ} +\label{utils} +÷ ÂÉÂÌÉÏÔÅËÕ ×ËÌÀÞÅÎ ÒÑÄ ÆÕÎËÃÉÊ, ËÏÔÏÒÙÅ ÎÅ ÒÁÂÏÔÁÀÔ ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏ +Ó ÆÁÊÌÁÍÉ EPPL7, ÎÏ ÐÏÌÅÚÎÙ ÐÒÉ ÎÁÐÉÓÁÎÉÉ ÍÁÌÅÎØËÉÈ ËÏÍÁÎÄÎÏ-ÓÔÒÏÞÎÙÈ +ÐÒÏÇÒÁÍÍ ÄÌÑ ÒÁÂÏÔÙ Ó ÜÔÉÍÉ ÆÁÊÌÁÍÉ. + +÷ ÏÔÌÉÞÉÅ ÏÔ ÏÓÔÁÌØÎÏÊ ÂÉÂÌÉÏÔÅËÉ, ÜÔÉ ÆÕÎËÃÉÉ ÓÉÓÔÅÍÎÏ-ÚÁ×ÉÓÉÍÙ. +ðÒÉ ÐÅÒÅÎÏÓÅ ÂÉÂÌÉÏÔÅËÉ × ÄÒÕÇÕÀ ÏÐÅÒÁÃÉÏÎÎÕÀ ÓÒÅÄÕ ÉÈ ÔÒÅÂÕÅÔÓÑ +ÐÅÒÅÐÉÓÁÔØ ÐÏÌÎÏÓÔØÀ É ÍÏÖÅÔ ÂÙÔØ ÄÁÖÅ ÉÚÍÅÎÉÔØ ÉÈ ÎÁÂÏÒ. + +îÁÐÒÉÍÅÒ, ÓÔÁÎÄÁÒÔÎÙÅ ÂÉÂÌÉÏÔÅËÉ ÂÏÌØÛÉÎÓÔ×Á ËÏÍÐÉÌÑÔÏÒÏ× C ÐÏÄ DOS +É Windows ÎÅ ×ËÌÀÞÁÀÔ ÆÕÎËÃÉÉ {\tt getopt}, ËÏÔÏÒÁÑ ÁËÔÉ×ÎÏ +ÉÓÐÏÌØÚÕÅÔÓÑ × Environmental Planning Utilities. + +æÕÎËÃÉÉ ÜÔÏÊ ÇÒÕÐÐÙ ÏÐÉÓÁÎÙ × ÚÁÇÏÌÏ×ÏÞÎÏÍ ÆÁÊÌÅ {\tt }. + +\section{ïÂÒÁÂÏÔËÁ ÉÍÅÎ ÆÁÊÌÏ×} + +\function{char *default\_ext(const char *name, const char *ext);}% +\index{default_ext} + +ÐÒÏ×ÅÒÑÅÔ, ÏËÁÎÞÉ×ÁÅÔÓÑ ÌÉ ÉÍÑ ÆÁÊÌÁ ÎÁ ÕËÁÚÁÎÎÏÅ ÒÁÓÛÉÒÅÎÉÅ. +åÓÌÉ ÎÅÔ, ÔÏ ÄÏÂÁ×ÌÑÅÔ ÅÇÏ. + +{\small \it ïÞÅ×ÉÄÎÏ, ÞÔÏ × ÆÁÊÌÏ×ÙÈ ÓÉÓÔÅÍÁÈ FAT É HPFS, ÇÄÅ ÎÅÓËÏÌØËÏ +ÒÁÓÛÉÒÅÎÉÊ ÎÅÄÏÐÕÓÔÉÍÙ, ÜÔÁ ÆÕÎËÃÉÑ ÄÏÌÖÎÁ ÐÒÏ×ÅÒÑÔØ ÎÁÌÉÞÉÅ ÎÅ ÄÁÎÎÏÇÏ, +Á ÌÀÂÏÇÏ ÒÁÓÛÉÒÅÎÉÑ.} + +\function{char *force\_ext(const char *name, const char *ext);} +\index{force_ext} + +ÚÁÍÅÎÑÅÔ ÐÏÓÌÅÄÎÅÅ ÒÁÓÛÉÒÅÎÉÅ ÎÁ ÕËÁÚÁÎÎÏÅ, ÉÌÉ ÄÏÂÁ×ÌÑÅÔ ÜÔÏ ÒÁÓÛÉÒÅÎÉÅ, +ÅÓÌÉ ÉÍÑ ÆÁÊÌÁ ÎÅ ÓÏÄÅÒÖÁÌÏ ÔÏÞËÉ. + +\function{char *last\_ext(const char *name);} +\index{last_ext} + ÷ÏÚ×ÒÁÝÁÅÔ ÐÏÓÌÅÄÎÅÅ ÒÁÓÛÉÒÅÎÉÅ ÆÁÊÌÁ ÉÌÉ {\tt NULL}, ÅÓÌÉ Õ ÆÁÊÌÁ +ÎÅÔ ÒÁÓÛÉÒÅÎÉÑ. + +÷ÓÅ ÜÔÉ ÔÒÉ ÆÕÎËÃÉÉ ×ÏÚ×ÒÁÝÁÀÔ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÁÔÉÞÅÓËÉÊ ÂÕÆÅÒ, +ËÏÔÏÒÙÊ ÂÕÄÅÔ ÐÅÒÅÚÁÐÉÓÁÎ ÐÒÉ ÓÌÅÄÕÀÝÅÍ ÏÂÒÁÝÅÎÉÉ Ë ÎÉÍ. + +\function{FILE *lookup\_file(const~char~*name, const~char~*sufux, +const~char~*dir);} +\index{lookup_file} + +éÝÅÔ ÆÁÊÌ Ó ÕËÁÚÁÎÎÙÍÉ ÉÍÅÎÅÍ × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, × ÅÅ ÐÏÄÄÉÒÅËÔÏÒÉÉ +{\tt dir}, ÅÓÌÉ ÔÁËÏ×ÁÑ ÉÍÅÅÔÓÑ É × ÐÏÄÄÉÒÅËÔÏÒÉÉ {\tt dir} +ÓÉÓÔÅÍÎÏÊ ÂÉÂÌÉÏÔÅÞÎÏÊ ÄÉÒÅËÔÏÒÉÉ {\tt /usr/local/lib/fgis}. + +÷ÏÚ×ÒÁÝÁÅÔ ÕËÁÚÁÔÅÌØ ÎÁ ÓÔÒÕËÔÕÒÕ {\tt FILE}. æÁÊÌ ÏÔËÒÙ×ÁÅÔÓÑ +ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ. + +æÕÎËÃÉÑ ÐÒÅÄÎÁÚÎÁÞÅÎÁ ÄÌÑ ÐÏÉÓËÁ ×ÓÐÏÍÏÇÁÔÅÌØÎÙÈ ÆÁÊÌÏ×, ÔÁËÉÈ ËÁË +ÐÁÌÉÔÒÙ É ÛÔÒÉÈÏ×ËÉ. + +\section{ðÒÏÇÒÅÓÓ-ÉÎÄÉËÁÔÏÒ} + +÷ ÂÉÂÌÉÏÔÅËÕ ÔÁËÖÅ ×ËÌÀÞÅÎÁ ÓÔÁÎÄÁÒÔÎÁÑ ÆÕÎËÃÉÑ ×Ù×ÏÄÁ ÓÏÏÂÝÅÎÉÑ +{\tt Processing row ... of ...}. + +\function{int show\_progress(int rowno,int seqno,int nrows);} +\index{show_progress}% +ïÎÁ ×Ù×ÏÄÉÔ ÜÔÏ ÓÁËÒÁÍÅÎÔÁÌØÎÏÅ ÓÏÏÂÝÅÎÉÅ ÎÁ {\tt stderr}. +ëÒÏÍÅ ÜÔÏÇÏ, ÄÁÎÎÁÑ ÆÕÎËÃÉÑ ÏÂÒÁÂÁÔÙ×ÁÅÔ {\tt SIGINT}, +ÐÏÜÔÏÍÕ ÐÒÅÒÙ×ÁÎÉÅ ÐÒÏÇÒÁÍÍÙ ÐÏ Ctrl-C ÐÒÉ×ÏÄÉÔ Ë ËÏÒÒÅËÔÎÏÍÕ +ÅÅ ÚÁ×ÅÒÛÅÎÉÀ. + +ïÎÁ ÉÍÅÅÔ ÁÎÁÌÏÇ + +\function{int show\_percent(int rowno,int seqno,int nrows);}\index{show_percent} +ËÏÔÏÒÙÊ ×Ù×ÏÄÉÔ ÓÏÏÂÝÅÎÉÅ ×ÉÄÁ {\tt 99.9\% completed}. +÷ ÏÔÌÉÞÉÅ ÏÔ {\tt show\_progress} ÜÔÁ ÆÕÎËÃÉÑ ÍÏÖÅÔ +ÉÓÐÏÌØÚÏ×ÁÔØÓÑ É ÄÌÑ dgt-ÆÁÊÌÏ×. ëÒÏÍÅ ÔÏÇÏ, ÎÁ ÂÏÌØÛÉÈ ÆÁÊÌÁÈ +ÏÎÁ ÎÅÓËÏÌØËÏ ÜËÏÎÏÍÉÔ ×ÒÅÍÑ, ÐÏÓËÏÌØËÕ ÐÙÔÁÅÔÓÑ ×ÙÚÙ×ÁÔØ +ÍÅÄÌÅÎÎÙÅ ÏÐÅÒÁÃÉÉ ××ÏÄÁ-×Ù×ÏÄÁ, ÔÏÌØËÏ ÅÓÌÉ ÅÓÔØ ÐÒÏÇÒÅÓÓ +ÐÏ ËÒÁÊÎÅÊ ÍÅÒÅ ÎÁ 0.1\%, ÞÔÏ ÍÏÖÅÔ ÓÏÓÔÁ×ÌÑÔØ ÄÏ 30 ÓÔÒÏË. + +÷ ÔÏ ÖÅ ×ÒÅÍÑ ÄÁÖÅ ÎÁ ÆÁÊÌÁÈ ÍÁËÓÉÍÁÌØÎÏÇÏ ÒÁÚÍÅÒÁ ÂÏÌØÛÁÑ +ÞÁÓÔØ ÏÐÅÒÁÃÉÊ ÂÕÄÅÔ ×ÙÐÏÌÎÑÔØÓÑ Ó ÔÁËÏÊ ÓËÏÒÏÓÔØÀ, ÞÔÏ ÚÁ +0.1\% ×ÒÅÍÅÎÉ ÒÁÂÏÔÙ ÐÏÌØÚÏ×ÁÔÅÌØ ÎÅ ÕÓÐÅÅÔ ÒÅÛÉÔØ, ÞÔÏ ÐÒÏÇÒÁÍÍÁ ÚÁ×ÉÓÌÁ. + + +ëÒÏÍÅ ÔÏÇÏ, ÓÕÝÅÓÔ×ÕÅÔ ÆÕÎËÃÉÑ +\function{int check\_int(int rowno,int seqno,int nrows);} +\index{check_int}% +ËÏÔÏÒÁÑ ÎÉÞÅÇÏ ÎÅ ×Ù×ÏÄÉÔ, Á ÔÏÌØËÏ ÐÒÏ×ÅÒÑÅÔ ÓÉÇÎÁÌ. +òÅËÏÍÅÎÄÕÅÔÓÑ ×ÓÅÇÄÁ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÅ × ËÁÞÅÓÔ×Å +ÁÌØÔÅÒÎÁÔÉ×Ù {\tt show\_percent}, ÎÁÐÒÉÍÅÒ ÄÌÑ ÆÏÎÏ×ÏÇÏ ×ÙÐÏÌÎÅÎÉÑ. + +õÓÔÁÎÁ×ÌÉ×ÁÅÔÓÑ ÏÄÎÁ ÉÚ ÜÔÉÈ ÆÕÎËÃÉÊ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ + +\function{void install\_progress\_indicator(int (*func)(int,int,int));}% +\index{install_progress_indicator} + +æÕÎËÃÉÑ + +\function{int clear\_progress(int result);}\index{clear_progress} +óÔÉÒÁÅÔ ÓÏÏÂÝÅÎÉÅ, ÓÄÅÌÁÎÎÏÅ ÆÕÎËÃÉÅÊ~--- ÐÒÏÇÒÅÓÓ-ÉÎÄÉËÁÔÏÒÏÍ É ×Ù×ÏÄÉÔ +ÓÏÏÂÝÅÎÉÅ {\tt Done}, ÅÓÌÉ {\tt result = 0} ÉÌÉ {\tt Aborted}. + +÷ÏÚ×ÒÁÝÁÅÔ {\tt result}, ÐÏÜÔÏÍÕ ÌÏÇÉÞÎÙÊ ÓÐÏÓÏ ÅÅ ÐÒÉÍÅÎÅÎÉÑ +ÔÁËÏÊ: + +\begin{verbatim} +install_progress_indicator(show_percent); +if ((res=clear_progress(for_each_cell + (infile,my_iterator_func)))) + unlink(out_file_name); +close_epp(infile); +close_epp(outfile); +return res; +\end{verbatim} + +\chapter{÷ÎÕÔÒÅÎÎÅÅ ÕÓÔÒÏÊÓÔ×Ï ÂÉÂÌÉÏÔÅËÉ} +\section{õÓÔÒÏÊÓÔ×Ï ÒÁÓÔÒÏ×ÏÇÏ ÆÁÊÌÁ EPPL7} +\section{òÁÂÏÔÁ ÏÂßÅËÔÁ EPP} +\label{EPP-internals} +\section{÷ÅËÔÏÒÎÙÅ ÏÂßÅËÔÙ} +\section{÷ÅËÔÏÒÎÙÅ ÆÁÊÌÙ × ÐÁÍÑÔÉ} +\catcode`\_=11 +\input lib_doc.ind +\end{document} + + diff --git a/doc/lib_doc.toc b/doc/lib_doc.toc new file mode 100644 index 0000000..c966faa --- /dev/null +++ b/doc/lib_doc.toc @@ -0,0 +1,33 @@ +\select@language {russian} +\contentsline {chapter}{\IeC {\CYRV }\IeC {\cyrv }\IeC {\cyre }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre }}{3} +\contentsline {chapter}{\numberline {1}\IeC {\CYRL }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyri }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrk }\IeC {\cyra }\IeC {\cyrya } \IeC {\cyrm }\IeC {\cyro }\IeC {\cyrd }\IeC {\cyre }\IeC {\cyrl }\IeC {\cyrsftsn } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv } \IeC {\cyrd }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyrh }}{4} +\contentsline {section}{\numberline {1.1}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }}{4} +\contentsline {section}{\numberline {1.2}\IeC {\CYRV }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }}{5} +\contentsline {chapter}{\numberline {2}\IeC {\CYRF }\IeC {\cyru }\IeC {\cyrn }\IeC {\cyrk }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyri } \IeC {\cyrd }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrp }\IeC {\cyra } \IeC {\cyrk } epp \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }}{7} +\contentsline {section}{\numberline {2.1}\IeC {\CYRP }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyrya } \IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyru }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrr }\IeC {\cyrery } EPP}{7} +\contentsline {section}{\numberline {2.2}\IeC {\CYRO }\IeC {\cyrt }\IeC {\cyrk }\IeC {\cyrr }\IeC {\cyrery }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra } \IeC {\cyri } \IeC {\cyrr }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyrery } \IeC {\cyrd }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrp }\IeC {\cyra }}{8} +\contentsline {section}{\numberline {2.3}\IeC {\CYRI }\IeC {\cyrz }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrr }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyro }\IeC {\cyrv } \IeC {\cyrd }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrp }\IeC {\cyra }}{8} +\contentsline {section}{\numberline {2.4}\IeC {\CYRD }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrp } \IeC {\cyrk } \IeC {\cyrya }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrishrt }\IeC {\cyrk }\IeC {\cyra }\IeC {\cyrm } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }}{9} +\contentsline {section}{\numberline {2.5}\IeC {\CYRI }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrery }}{10} +\contentsline {section}{\numberline {2.6}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyra } \IeC {\cyrs } \IeC {\cyrz }\IeC {\cyra }\IeC {\cyrg }\IeC {\cyro }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyrk }\IeC {\cyro }\IeC {\cyrm } epp-\IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }}{11} +\contentsline {section}{\numberline {2.7}\IeC {\CYRP }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyrt } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrd }\IeC {\cyri }\IeC {\cyrn }\IeC {\cyra }\IeC {\cyrt }}{13} +\contentsline {section}{\numberline {2.8}\IeC {\CYRN }\IeC {\cyra }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrzh }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv }}{13} +\contentsline {section}{\numberline {2.9}\IeC {\CYRP }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrch }\IeC {\cyre }\IeC {\cyre }}{14} +\contentsline {section}{\numberline {2.10}\IeC {\CYRO }\IeC {\cyrb }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyrk }\IeC {\cyra } \IeC {\cyro }\IeC {\cyrsh }\IeC {\cyri }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrk }}{14} +\contentsline {chapter}{\numberline {3}\IeC {\CYRF }\IeC {\cyru }\IeC {\cyrn }\IeC {\cyrk }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyri } \IeC {\cyrd }\IeC {\cyro }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyru }\IeC {\cyrp }\IeC {\cyra } \IeC {\cyrk } \IeC {\cyrv }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyrm } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }\IeC {\cyrm }}{16} +\contentsline {section}{\numberline {3.1}T\IeC {\cyri }\IeC {\cyrp }\IeC {\cyrery } \IeC {\cyrd }\IeC {\cyra }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyrh }}{16} +\contentsline {section}{\numberline {3.2}\IeC {\CYRO }\IeC {\cyrt }\IeC {\cyrk }\IeC {\cyrr }\IeC {\cyrery }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }}{17} +\contentsline {section}{\numberline {3.3}\IeC {\CYRS }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyra } \IeC {\cyrr }\IeC {\cyre }\IeC {\cyrzh }\IeC {\cyri }\IeC {\cyrm }\IeC {\cyra } \IeC {\cyri } \IeC {\cyrz }\IeC {\cyra }\IeC {\cyrk }\IeC {\cyrr }\IeC {\cyrery }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyre } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra }}{17} +\contentsline {section}{\numberline {3.4}\IeC {\CYRCH }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyri }\IeC {\cyre } \IeC {\cyri } \IeC {\cyrz }\IeC {\cyra }\IeC {\cyrp }\IeC {\cyri }\IeC {\cyrs }\IeC {\cyrsftsn } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrv }}{18} +\contentsline {section}{\numberline {3.5}\IeC {\CYRI }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrery }}{18} +\contentsline {section}{\numberline {3.6}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyra } \IeC {\cyrs } \IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyru }\IeC {\cyrshch }\IeC {\cyri }\IeC {\cyrm } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrm }}{19} +\contentsline {section}{\numberline {3.7}DGT-\IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyrery } \IeC {\cyrv } \IeC {\cyrp }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrya }\IeC {\cyrt }\IeC {\cyri }}{21} +\contentsline {section}{\numberline {3.8}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyra } \IeC {\cyrs } \IeC {\cyrk }\IeC {\cyro }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrd }\IeC {\cyri }\IeC {\cyrn }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyri }}{21} +\contentsline {chapter}{\numberline {4}\IeC {\CYRF }\IeC {\cyru }\IeC {\cyrn }\IeC {\cyrk }\IeC {\cyrc }\IeC {\cyri }\IeC {\cyri }-\IeC {\cyru }\IeC {\cyrt }\IeC {\cyri }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyrt }\IeC {\cyrery }}{23} +\contentsline {section}{\numberline {4.1}\IeC {\CYRO }\IeC {\cyrb }\IeC {\cyrr }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyrk }\IeC {\cyra } \IeC {\cyri }\IeC {\cyrm }\IeC {\cyre }\IeC {\cyrn } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyro }\IeC {\cyrv }}{23} +\contentsline {section}{\numberline {4.2}\IeC {\CYRP }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrs }\IeC {\cyrs }-\IeC {\cyri }\IeC {\cyrn }\IeC {\cyrd }\IeC {\cyri }\IeC {\cyrk }\IeC {\cyra }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }}{24} +\contentsline {chapter}{\numberline {5}\IeC {\CYRV }\IeC {\cyrn }\IeC {\cyru }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyre }\IeC {\cyrn }\IeC {\cyrn }\IeC {\cyre }\IeC {\cyre } \IeC {\cyru }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrishrt }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrv }\IeC {\cyro } \IeC {\cyrb }\IeC {\cyri }\IeC {\cyrb }\IeC {\cyrl }\IeC {\cyri }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyri }}{25} +\contentsline {section}{\numberline {5.1}\IeC {\CYRU }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrishrt }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrv }\IeC {\cyro } \IeC {\cyrr }\IeC {\cyra }\IeC {\cyrs }\IeC {\cyrt }\IeC {\cyrr }\IeC {\cyro }\IeC {\cyrv }\IeC {\cyro }\IeC {\cyrg }\IeC {\cyro } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyra } EPPL7}{25} +\contentsline {section}{\numberline {5.2}\IeC {\CYRR }\IeC {\cyra }\IeC {\cyrb }\IeC {\cyro }\IeC {\cyrt }\IeC {\cyra } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyra } EPP}{25} +\contentsline {section}{\numberline {5.3}\IeC {\CYRV }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyro }\IeC {\cyrb }\IeC {\cyrhrdsn }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyrery }}{25} +\contentsline {section}{\numberline {5.4}\IeC {\CYRV }\IeC {\cyre }\IeC {\cyrk }\IeC {\cyrt }\IeC {\cyro }\IeC {\cyrr }\IeC {\cyrn }\IeC {\cyrery }\IeC {\cyre } \IeC {\cyrf }\IeC {\cyra }\IeC {\cyrishrt }\IeC {\cyrl }\IeC {\cyrery } \IeC {\cyrv } \IeC {\cyrp }\IeC {\cyra }\IeC {\cyrm }\IeC {\cyrya }\IeC {\cyrt }\IeC {\cyri }}{25} diff --git a/doc/object_concept b/doc/object_concept new file mode 100644 index 0000000..f7c444d --- /dev/null +++ b/doc/object_concept @@ -0,0 +1,218 @@ +îÅËÏÔÏÒÙÅ ÉÄÅÉ + +1. îÕÖÅÎ ÌÉ ÎÁÍ ÇÌÏÂÁÌØÎÙÊ ÍÁÓÓÉ× map_items? Y +îÅ ÐÒÏÝÅ ÌÉ ÄÌÑ ËÁÖÄÏÇÏ mapcanvas ÓÏÚÄÁ×ÁÔØ Ó×ÏÊ ÍÁÓÓÉ×? + +ôÏÇÄÁ ×ÚÁÉÍÏÄÅÊÓÔ×ÉÅ ÓÌÏÑ Ó canvas ÄÏÌÖÎÏ ÂÙÔØ Ä×ÕÈÓÔÏÒÏÎÎÉÍ. +canvas ÄÏÌÖÅÎ ÚÎÁÔØ ×ÓÅ Ó×ÏÉ ÓÌÏÉ, Á ÓÌÏÊ - ×ÓÅ canvas, × ËÏÔÏÒÙÈ ÏÎ ×ÉÄÅÎ +(ÎÅ ÏÂÑÚÁÔÅÌØÎÏ ÔÅ, × ËÏÔÏÒÙÈ ÏÎ lookable - ÄÌÑ ÜÔÏÇÏ ÄÏÓÔÁÔÏÞÎÏ ÚÎÁÔØ +ËÏÏÒÄÉÎÁÔÙ) + +äÌÑ ÔÏÇÏ, ÞÔÏÂÙ ÐÅÒÅÒÉÓÏ×ÁÔØ ÓÌÏÊ (image) ÍÙ ÄÏÌÖÎÙ ÚÎÁÔØ +1. raster +2. palette/symbols +3. border mode +(ÜÔÏ ÚÎÁÅÔ ÓÌÏÊ) + +4. Item ID (ÎÁÈÏÄÉÔÓÑ ÐÏ tag) + +éÔÁË: ÄÌÑ ËÁÖÄÏÇÏ ÓÌÏÑ ÓÕÝÅÓÔ×ÕÅÔ ÐÒÏÃÅÄÕÒÁ redraw_${layer}_${mode} +Ó ÐÁÒÁÍÅÔÒÏÍ canvas +ËÏÔÏÒÁÑ ÐÅÒÅÒÉÓÏ×Ù×ÁÅÔ ÓÌÏÊ + +ÄÌÑ ÒÁÓÔÒÁ ÏÎÁ ÄÏÌÖÎÁ ×ÙÇÌÑÄÅÔØ ËÁË +layer_title $canvas self +raster image $self(raster) $canvas [force_image $canvas self] -palette $self(palette) ?-border ?base?? + +ðÒÉ ÒÅËÏÎÆÉÇÕÒÉÒÏ×ÁÎÉ ÂÏÒÄÅÒÁ ÏÎÁ ÐÅÒÅÓÏÚÄÁÅÔÓÑ. åÓÌÉ ÖÅ ÓÄÅÌÁÔØ +ÏÐÃÉÀ border ×ÏÓÐÒÉÎÉÍÁÀÝÕ ÔÒÉ ÆÌÁÇÁ (yes, no, base) ÔÏ ÐÒÏÃÅÄÕÒÕ +ÐÅÒÅÓÏÚÄÁ×ÁÔØ ÎÅ ÎÁÄÏ. + +ÏÎÁ ÂÕÄÅÔ ×ÙÇÌÑÄÅÔØ ËÁË + +proc __raster_redraw_base {layer canvas} { +upvar #0 $layer self +if [set t [get_title $canvas $layer] { + $canvas itemconf $t -text $self(title) +} else { $canvas create text [expr [winfo width $canvas]/2] 0 -anchor n -text + $self(title) + } +raster image $self(raster) $canvas [force_image $canvas $layer] -palette $self(palette) -border $self(border) -mapmode $self(mapmode) +} + +ôÉÐÙ ÓÌÏÅ× + +I ÒÁÓÔÒÏ×ÙÅ + ËÌÁÓÓÉÆÉËÁÃÉÑ (ÌÅÇÅÎÄÁ ÐÒÉÍÅÎÑÅÔÓÑ Ë ÔÏÍÕ ÖÅ ÒÅËÌÁÓÓÕ, ÞÔÏ É ÐÁÌÉÔÒÁ. + ÌÅÇÅÎÄÁ ÐÒÅÄÓÔÁ×ÌÑÅÔ ÓÏÂÏÊ ÎÁÂÏÒ ÓÔÒÏË (ÏÂßÅËÔ ÌÅÇÅÎÄÙ ÉÌÉ + ËÏÍÁÎÄÕ)) + ËÁÒÔÏÇÒÁÍÍÁ (ÌÅÇÅÎÄÁ ÐÒÉÍÅÎÑÅÔÓÑ Ë ÂÁÚÏ×ÏÍÕ ÓÌÏÀ ÉÌÉ ÏÄÎÏÍÕ ÒÅËÌÁÓÓÕ, + Á ÐÁÌÉÔÒÁ Ë ÄÒÕÇÏÍÕ ÒÅËÌÁÓÓÕ, ÐÒÉÞÅÍ ÐÏÓÌÅÄÎÉÊ£ + ÍÅÎÑÅÔÓÑ ÄÉÎÁÍÉÞÅÓËÉ × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÚÁÄÁÎÎÙÈ ÉÎÔÅÒ×ÁÌÏ× + ÌÅÇÅÎÄÁ ÐÒÅÄÓÔ×ÁÌÑÅÔ ÓÏÂÏÊ ×ÙÒÁÖÅÎÉÅ (Tcl cËÒÉÐÔ) + çÏÌÙÊ ÒÁÓÔÒ - ÐÁÌÉÔÒÁ default, ÌÅÇÅÎÄÙ ÎÅÔ. ÞÔÏÂÙ ÓÄÅÌÁÔØ ÉÚ ÜÔÏÇÏ ÏÓÍÙÓÌÅÎÎÙÊ ÓÌÏÊ, ×ÏÓÐÏÌØÚÕÊÔÅÓÔØ ËÏÍÁÎÄÏÊ new +II ôÜÇÉ + 1. ïÂÙÞÎÙÊ ÔÜÇ - ÎÁÂÏÒ ÓÔÒÏË + ÷ÏÚÍÏÖÎÏÓÔØ ÚÁÄÁÔØ ËÏÍÁÎÄÕ, ×ÏÚ×ÒÁÝÁÀÝÕÀ ÔÉÐ ÍÁÒËÅÒÁ É ÛÒÉÆÔ ÐÏ + ÓÔÒÏËÅ + 2. äÉÁÇÒÁÍÍÁ - ÎÁÂÏÒ ÓÐÉÓËÏ× ÞÉÓÅÌ + ËÏÍÁÎÄÁ ÄÌÑ ÏÔÒÉÓÏ×ËÉ +III ÷ÅËÔÏÒÎÙÅ ÓÌÏÉ + ?? + +CÕÂËÏÍÁÎÄÙ ÄÌÑ ÒÁÓÔÒÏ×ÏÇÏ ÓÌÏÑ + +1. source - ×ÏÚ×ÒÁÝÁÅÔ ÉÍÑ ÆÁÊÌÁ (×ÏÚÍÏÖÎÏ ÞÅÒÅÚ C-ÛÎÙÊ ËÏÄ) +2. show canvas ?mode? - ÄÅÌÁÅÔ ÓÌÏÊ ×ÉÄÉÍÙÍ × ÕËÁÚÁÎÎÏÍ canvas. mode ÐÏ + ÕÍÏÌÞÁÎÉÀ base +3. look canvas {add|remove} +4. configure +5. cget +6. value x y - ×ÏÚ×ÒÁÝÁÅÔ ÚÎÁÞÅÎÉÅ ÐÏ ËÏÏÒÄÉÎÁÔÁÍ +7. classvalue class - ×ÏÚ×ÒÁÝÁÅÔ ÚÎÁÞÅÎÉÅ ÐÏ ËÌÁÓÓÕ (ÄÌÑ ÒÅÁÌÉÚÁÃÉÉ count - + ÐÏÄÏÂÎÙÈ ÏÐÅÒÁÃÉÊ +8. legtext index - ×ÏÚ×ÒÁÝÁÅÔ ÔÅËÓÔ ÌÅÇÅÎÄÙ ÐÏ ÉÎÄÅËÓÕ × ÐÁÌÉÔÒÅ +9. leglist - ×ÏÚ×ÒÁÝÁÅÔ ÓÐÉÓÏË ÐÏÚÉÃÉÊ ÌÅÇÅÎÄÙ +11. color index - ÄÅÌÁÅÔ palette get +13. pattern index - ×ÏÚ×ÒÁÝÁÅÔ ÛÔÒÉÈÏ×ËÕ (ÎÅ ÚÎÁÀ ËÁË) +14. drawopaque canvas - ÐÅÒÅÒÉÓÏ×Ù×ÁÅÔ Ã×ÅÔÏÍ +15. drawtransparent canvas - ÐÅÒÅÒÉÓÏ×Ù×ÁÅÔ ÛÔÒÉÈÏ×ËÏÊ +16. info legend - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÅÓÔØ ÞÅÇÏ ÒÉÓÏ×ÁÔØ × legbox + info lookable - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÅÓÔØ ÞÅÇÏ ×Ù×ÏÄÉÔØ × ÔÏÞËÅ (Ô.Å ×ÓÅÇÄÁ) + info opaque - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÒÁÓÔÒ ÍÏÖÅÔ ÂÙÔØ ×Ù×ÅÄÅÎ ËÁË ÂÁÚÏ×ÙÊ + ÓÌÏÊ, Ô.Å. ×ÓÅÇÄÁ +17 hide canvas - ÕÄÁÌÑÅÔ ÓÌÏÊ ÉÚ canvas +ïÐÃÉÉ configure +-reclass, -table - ÍÏÄÉÆÉÃÉÒÕÀÔ ÂÁÚÏ×ÙÊ reclass. +-legend - ÚÁÄÁÀÔ ÏÂßÅËÔ ÌÅÇÅÎÄÙ ËÏÎÆÌÉËÔÕÅÔ Ó values É intervals. + -legfile - ×ÅÒÓÉÑ ÜÔÏÊ ÏÐÃÉÉ, ËÏÔÏÒÁÑ ÐÏÌÕÞÁÅÔ ÉÍÑ ÆÁÊÌÁ ×ÍÅÓÔÏ + ÇÏÔÏ×ÏÇÏ ÏÂßÅËÔÁ õËÁÚÁÎÉÅ ÜÔÏÊ ÏÐÃÉÉ ÒÁ×ÎÏÚÎÁÞÎÏ ÐÒÉÚÎÁÎÉÀ ËÁÒÔÙ + ÓÌÏÅÍ ËÌÁÓÓÉÆÉËÁÃÉÉ + +-palette - ÚÁÄÁÅÔ ÏÂßÅËÔ ÐÁÌÉÔÒÙ +-palfile - ÇÒÕÚÉÔ ÆÁÊÌ + +-values - ÚÁÄÁÅÔ ÓËÒÉÐÔ ÄÌÑ ÐÅÒÅÓÞÅÔÁ ËÌÁÓÓÁ × ÚÎÁÞÅÎÉÅ. õËÁÚÁÎÉÅ ÜÔÏÊ + ÏÐÃÉÉ ÒÁ×ÎÏÓÉÌØÎÏ ÐÒÉÚÎÁÎÉÀ ÓÌÏÑ ËÁÒÔÏÇÒÁÍÍÏÊ + ÐÏ ÕÍÏÌÞÁÎÉÀ ÒÁ×ÎÏ set +-legendheader ÚÁÄÁÅÔ ÔÏ, ÞÔÏ ÂÕÄÅÔ ×ÏÚ×ÒÁÝÅÎÏ legend title É legend subtitle +-intervals - ÚÁÄÁÅÔ ÓÐÉÓÏË ×ÅÝÅÓÔ×ÅÎÎÙÈ ÞÉÓÅÌ ÏÇÒÁÎÉÞÉ×ÁÀÝÉÊ ×ÉÄÉÍÙÅ ÄÉÁÐÁÚÏÎÙ + ÚÎÁÞÅÎÉÊ. ðÒÉÍÅÎÑÅÔÓÑ Ë ÔÅËÕÝÅÍÕ values +-border {none yes base} - ËÁË ÒÉÓÏ×ÁÔØ ÇÒÁÎÉÃÙ +-bordercolor color + ðÏËÁ undefined +-ovrborder +-ovrcolor +-patterns +-symbols + +ëÏÍÁÎÄÙ ÄÌÑ ÓÌÏÑ tag +title +legend title +legend subtitle +1. source - ×ÏÚ×ÒÁÝÁÅÔ ÉÍÑ ÆÁÊÌÁ ? +2. show canvas ?mode? - ÄÅÌÁÅÔ ÓÌÏÊ ×ÉÄÉÍÙÍ × ÕËÁÚÁÎÎÏÍ canvas. + mode ÍÏÖÅÔ ÂÙÔØ ÔÏÌØËÏ overlay +3. look canvas {add|remove} +4. configure +5. cget +6. value x y - ×ÏÚ×ÒÁÝÁÅÔ ÚÎÁÞÅÎÉÅ ÐÏ ËÏÏÒÄÉÎÁÔÁÍ. ÍÏÖÅÔ É ÎÅ ×ÅÒÎÕÔØ +7. classvalue class - ÎÅ ÏÐÒÅÄÅÌÅÎÁ +8. legtext index - ÎÅ ÏÐÒÅÄÅÌÅÎÁ?? +9. leglist - ×ÏÚ×ÒÁÝÁÅÔ ÓÐÉÓÏË ÐÏÚÉÃÉÊ ÌÅÇÅÎÄÙ (ÓÐÉÓÏË ÍÁÒËÅÒÏ×?) +11. color index - ÎÅ ÏÐÒÅÄÅÌÅÎÁ +13. pattern index - ÎÅ ÏÐÒÅÄÅÌÅÎÁ +14. drawopaque canvas - ÎÅ ÏÐÒÅÄÅÌÅÎÁ +15. drawtransparent canvas - ÐÅÒÅÒÉÓÏ×Ù×ÁÅÔ +16. info legend - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÅÓÔØ ÞÅÇÏ ÒÉÓÏ×ÁÔØ × legbox + info lookable - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÅÓÔØ ÞÅÇÏ ×Ù×ÏÄÉÔØ × ÔÏÞËÅ + info opaque - ×ÏÚ×ÒÁÝÁÅÔ true, ÅÓÌÉ ÒÁÓÔÒ ÍÏÖÅÔ ÂÙÔØ ×Ù×ÅÄÅÎ ËÁË ÂÁÚÏ×ÙÊ + ÓÌÏÊ, Ô.Å. ÎÉËÏÇÄÁ +17 marker ÓÔÒÏËÁ - ×ÏÚ×ÒÁÝÁÅÔ ÉÍÑ ÍÁÒËÅÒÁ ÄÌÑ ÓÔÒÏËÉ +18 font ÓÔÒÏËÁ - ×ÏÚ×ÒÁÝÁÅÔ ÉÍÑ ÓÌÏÑ ÄÌÑ ÓÔÒÏËÉ + +ÍÁÒËÅÒ ÒÉÓÕÅÔÓÑ ËÏÍÍÁÎÄÏÊ +set offset [eval $marker $canvas $x $y] +offset - ÐÒÉÎÉÍÁÅÔ ÚÎÁÞÅÎÉÅ ÄÉÓÔÁÎÃÉÉ × ÐÉËÓÅÌÁÈ, ÎÁ ËÏÔÏÒÕÀ ÎÁÄÏ ÓÍÅÓÔÉÔØ + ÎÁÞÁÌØÎÕÀ ÔÏÞËÕ ÔÅËÓÔÁ. + + planchet widget + +îÁ ÓÁÍÏÍ ÄÅÌÅ ÜÔÏ canvas ÓÏ ×ÓÅÍÉ Ó×ÏÉÍÉ ËÁÎ×ÁÓÎÙÍÉ Ó×ÏÊÓÔ×ÁÍÉ. +îÏ Ó ÎÉÍ ÁÓÓÏÃÉÉÒÏ×ÁÎ ÍÁÓÓÉ× (ÓÏ×ÐÁÄÁÀÝÉÊ ÐÏ ÉÍÅÎÉ) +× ËÏÔÏÒÏÍ ÈÒÁÎÉÔÓÑ ÄÏÐÏÌÎÉÔÅÌØÎÁÑ ÉÎÆÏÒÍÁÃÉÑ +1. limits - ÔÅËÕÝÉÅ ÐÒÅÄÅÌÙ ËÏÏÒÄÉÎÁÔ. åÖÅÌÉ ÏÔÓÕÔÓÔ×ÕÅÔ, ÔÏ ÍÎÏÇÉÅ +ËÏÍÁÎÄÙ ÂÕÄÕÔ ×ÏÚ×ÒÁÝÁÔØ ÏÛÉÂËÕ. +2. zoom - ÔÅËÕÝÉÊ ÓÔÅË Õ×ÅÌÉÞÅÎÉÊ +÷ÓÐÏÍÏÇÁÔÅÌØÎÙÅ ×ÉÄÇÅÔÙ +3. bzoom - ËÎÏÐËÁ Õ×ÅÌÉÞÅÎÉÑ + bunzoom - ÓÐÉÓÏË ËÎÏÐÏË ÕÍÅÎØÛÅÎÉÑ + shifts - ÓÐÉÓÏË ËÎÏÐÏË ÓÄ×ÉÇÁ left down up right + scalelabel - ÍÅÓÔÏ ÇÄÅ ÏÔÏÂÒÁÖÁÅÔÓÑ ÍÁÓÛÔÁ +óÌÏÉ base + overlays - ÓÐÉÓÏË + looks - ÓÐÉÓÏË + +îÏ×ÙÅ ÏÐÃÉÉ × widget command +$w limits ?ÞÅÔÙÒÅ ËÏÏÒÄÉÎÁÔÙ? - ÕÓÔÁÎÁ×ÌÉ×ÁÅÔ ÎÏ×ÙÅ ÐÒÅÄÅÌÙ. åÓÌÉ + ËÏÏÒÄÉÎÁÔÙ ÂÙÌÉ ÎÅ ÏÐÒÅÄÅÌÅÎÙ, ÔÏ ÐÏÒÑÄÏË ÓÞÉÔÁÅÔÓÑ + ÌÅ×Ï ÎÉÚ ÐÒÁ×Ï ×ÅÒÈ, ÉÎÁÞÅ ÎÁÐÒÁ×ÌÅÎÉÅ ÏÓÅÊ ÓÏÈÒÁÎÑÅÔÓÑ. +limits ÂÅÚ ÁÒÇÕÍÅÎÔÏ× ×ÏÚ×ÒÁÝÁÅÔ ÔÅËÕÝÉÅ ÁÒÇÕÍÅÎÔÙ +$w clear - ÏÞÉÝÁÅÔ ×ÓÅ (ÄÌÑ ÓÍÅÎÙ ÒÅÇÉÏÎÁ) +$w zoom - ÐÏÞÔÉ ÔÏ ÖÅ ÓÁÍÏÅ, ÞÔÏ É limits, ÎÏ ÐÏÌÕÞÁÅÔ ËÏÏÒÄÉÎÁÔÙ + × ÅÄÉÎÉÃÁÈ canvas, Á ÎÅ × ÁÌØÔÅÒÎÁÎÉ×ÎÙÈ ÅÄÉÎÉÃÁÈ. óÍ. ÔÁËÖÅ + ÐÒÏÃÅÄÕÒÕ zoom +$w unzoom ?-all? - ÏÔÍÅÎÑÅÔ ÐÏÓÌÅÄÎÅÅ ÉÌÉ ×ÓÅ Õ×ÅÌÉÞÅÎÉÑ +$w shift ÎÁÐÒÁ×ÌÅÎÉÅ - ÓÄ×ÉÇÁÅÔ ÔÅËÕÝÅÅ ÐÏÌÅ ÚÒÅÎÉÑ × ÕËÁÚÁÎÎÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ + +$w layers - ×ÏÚ×ÒÁÝÁÅÔ ÓÐÉÓÏË ×ÓÅÈ ÓÌÏÅ×, ×ËÌÀÞÁÑ ÂÁÚÏ×ÙÊ +$w lookable - ×ÏÚ×ÒÁÝÁÅÔ ÓÐÉÓÏË ×ÓÅ lookable ÓÌÏÅ×. +÷ÎÉÍÁÎÉÅ - ÐÏËÁÚÙ×ÁÀÔÓÑ É ÓËÒÙ×ÁÀÔÓÑ ÓÌÏÉ ËÏÍÁÎÄÁÍÉ ÓÌÏÑ Á ÎÅ ÐÌÁÎÛÅÔÁ +$w scale ?denominator? - ×ÏÚ×ÒÁÝÁÅÔ ÔÅËÕÝÉÊ ÚÎÁÍÅÎÁÔÅÌØ ÍÁÓÛÔÁÂÁ ÉÌÉ + ÕÓÔÁÎÁ×ÌÉ×ÁÅÔ ÍÁÓÛÔÁÂ. ãÅÎÔÒÁÌØÎÁÑ ÔÏÞËÁ ÐÒÉ ÜÔÏÍ + ÏÓÔÁÅÔÓÑ ÎÅÉÚÍÅÎÎÏÊ, +$w ruler {on|off} - ×ËÌÀÞÁÅÔ/×ÙËÌÀÞÁÅÔ ÍÁÓÛÔÁÂÎÕÀ ÌÉÎÅÊËÕ + +$W MApx x +$w mapy y +$w scrx x +$w scry y +$w look x y - ×ÏÚ×ÒÁÝÁÅÔ ÓÐÉÓÏË ÓÌÏÅ× É ÉÈ ÚÎÁÞÅÎÉÊ × ÔÅËÕÝÅÊ ÔÏÞËÅ +$w statustext ÔÅËÓÔ - ×Ù×ÏÄÉÔ ÔÅËÓÔ × ÏËÏÛËÅ ÓÔÁÔÕÓÁ +$w projection type ?options? +- ÚÁÄÁÅÔ ÐÒÏÅËÃÉÀ +$w longitide x y +$w latitide x y +$w fit x y +1, ÅÓÌÉ ÔÏÞËÁ ÐÏÐÁÄÁÅÔ × canvas É 0 ÅÓÌÉ ÎÅÔ +îÏ×ÙÅ ÏÐÃÉÉ configure/cget +1. -legbox +2. -zoombutton +3. -unzoombuttons +4. -shiftbuttons +5. -statusline +6. -rulerpos - ÐÏÚÉÃÉÑ ÎÁÞÁÌÁ ÍÁÓÛÔÁÂÎÏÊ ÌÉÎÅÊËÉ + +îÅÄÏÓÔÕÐÎÙÅ ÏÐÃÉÉ canvas +-borderwidth -bd -highlightthickness -relief + +BINDINGS + - ÐÅÒÅÈ×ÁÔ resize É ÓÏÏÔ×ÅÔÓ×ÔÕÀÝÅÅ ÉÚÍÅÎÅÎÉÅ ÐÒÅÄÅÌÏ× ËÏÏÒÄÉÎÁÔ + - ÔÝÁÔÅÌØÎÏ ÚÁÍÅÔÁÅÔ ×ÓÅ ÓÌÅÄÙ ÔÏÇÏ, ÞÔÏ ÜÔÏ ÎÅ ÎÁÓÔÏÑÝÉÊ + widget, Õ×ÅÄÏÍÌÑÅÔ ×ÓÅ ÓÌÏÉ Ï ÔÏÍ, ÞÔÏ × ÜÔÏÍ ÐÌÁÎÛÅÔÅ ÏÎÉ ÂÏÌØÛÅ + ÎÅ ×ÉÄÎÙ. + - ÌÕËÏÛËÏ Ó ÏËÏÍ (ÏËÏÛËÏ Ó ÌÕËÏÍ) + zoom %W %x %y +(Á binding ÚÁÐÏÍÉÎÁÅÔÓÑ × ÐÒÉ×ÁÔÎÙÈ ÄÁÎÎÙÈ ÐÌÁÎÛÅÔÁ) + - ÅÓÌÉ ÏÐÒÅÄÅÌÅÎ ÓÔÁÔÕÓ, ÏÔÏÂÒÁÖÁÅÔ ËÏÏÒÄÉÎÁÔÙ + +ðÒÏÞÉÅ ÏÂßÅËÔÙ +ðÒÏÅËÃÉÑ - ÜÔÏ ÔÏÖÅ ÏÂßÅËÔ. ðÒÉÞÅÍ ÎÁÐÉÓÁÎÎÙÊ ÞÅÓÔÎÏ ÎÁ C. + +ðÒÏÞÉÅ ËÏÍÁÎÄÙ + +zoom - ÂÙ×ÛÉÊ mapzoom +print - ÂÙ×ÛÉÊ mapprint + +÷ÓÅ ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÒÁÂÏÔÁÀÔ Ó ËÏÏÒÄÉÎÁÔÁÍÉ, ÐÅÒÅÉÍÅÎÏ×Ù×ÁÀÔÓÑ +× __planchet_mapx + __planchet_mapy É Ô.Ä. diff --git a/doc/region.concept b/doc/region.concept new file mode 100644 index 0000000..ce411c6 --- /dev/null +++ b/doc/region.concept @@ -0,0 +1,31 @@ + ëÏÎÃÅÐÃÉÑ ÒÅÇÉÏÎÁ. + +÷ ÏÂÌÁÓÔÉ çéó-ÏÂÒÁÂÏÔËÉ ÐÒÁËÔÉÞÅÓËÉ ÎÉËÏÇÄÁ ÎÅÌØÚÑ ÏÇÒÁÎÉÞÉÔØÓÑ +ÒÁÓÓÍÏÔÒÅÎÉÅÍ ÏÄÎÏÊ ËÁÒÔÙ ÎÁ ÏÐÒÅÄÅÌÅÎÎÕÀ ÔÅÒÒÉÔÏÒÉÀ, ÏÓÏÂÅÎÎÏ +ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ËÏÎÃÅÐÃÉÉ ÆÕÎËÃÉÏÎÁÌØÎÙÈ ËÁÒÔ. + +ëÒÏÍÅ ÔÏÇÏ, ÄÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ ×ÏÚÎÉËÁÅÔ ÚÁÄÁÞÁ ÒÁÂÏÔÙ Ó ÎÅÓËÏÌØËÉÍÉ +ÒÁÚÎÏÍÁÓÛÔÁÂÎÙÍÉ ÕÞÁÓÔËÁÍÉ ÔÅÒÒÉÔÏÒÉÉ. + +ðÏÜÔÏÍÕ × fGIS ××ÅÄÅÎÁ ËÏÎÃÅÐÃÉÑ ÒÅÇÉÏÎÁ. òÅÇÉÏÎ ÜÔÏ ÇÒÕÐÐÁ ËÁÒÔ, +ÏÐÉÓÙ×ÁÀÝÉÈ ÏÄÎÕ É ÔÕ ÖÅ ÔÅÒÒÉÔÏÒÉÀ. ÷ÓÅ ËÁÒÔÙ ÒÅÇÉÏÎÁ ÄÏÌÖÎÙ +ÉÍÅÔØ ÏÄÉÎÁËÏ×ÕÀ ËÏÏÒÄÉÎÁÔÎÕÀ ÓÉÓÔÅÍÕ (ÐÒÏÅËÃÉÀ), ÈÏÔÑ ÎÉËÔÏ ÎÅ +ÍÅÛÁÅÔ ÓÏÚÄÁÔØ ÎÅÓËÏÌØËÏ ÒÅÇÉÏÎÏ× fGIS, ÉÍÅÀÝÉÈ ÒÁÚÎÕÀ ÐÒÏÅËÃÉÀ, +ÄÌÑ ÏÄÎÏÊ É ÔÏÊ ÖÅ ÔÅÒÒÉÔÏÒÉÉ. + +ëÏÐÉÒÏ×ÁÎÉÅ ËÁÒÔÙ ÉÚ ÏÄÎÏÇÏ ÒÅÇÉÏÎÁ × ÄÒÕÇÏÊ (ÅÓÔÅÓÔ×ÅÎÎÏ, ÓÒÅÄÓÔ×ÁÍÉ +fGIS, Á ÎÅ ÓÒÅÄÓÔ×ÁÍÉ ÏÐÅÒÁÃÉÏÎÎÏÊ ÓÉÓÔÅÍÙ) ÐÒÉ×ÏÄÉÔ Ë Á×ÔÏÍÁÔÉÞÅÓËÏÍÕ +ÉÚÍÅÎÅÎÉÀ ÐÒÏÅËÃÉÉ. + +òÅÇÉÏÎÙ ÍÏÇÕÔ ÂÙÔØ ÉÅÒÁÒÈÉÞÅÓËÉ ×ÌÏÖÅÎÙ ÄÒÕÇ × ÄÒÕÇÁ. ðÏÜÔÏÍÕ ÅÝÅ ÏÄÎÉÍ +Ó×ÏÊÓÔ×ÏÍ ÒÅÇÉÏÎÁ Ñ×ÌÑÅÔÓÑ ËÁÒÔÁ ÅÇÏ ÒÁÚÂÉÅÎÉÑ ÎÁ ÓÕÂÒÅÇÉÏÎÙ. +ó ÅÅ ÐÏÍÏÝØÀ ÍÏÖÎÏ ÐÅÒÅÊÔÉ × ÒÅÇÉÏÎ, ÄÁÀÝÉÊ ÂÏÌÅÅ ÄÅÔÁÌØÎÕÀ ÈÁÒÁËÔÅÒÉÓÔÉËÕ +ÐÒÏÓÔÏ ÐÕÔÅÍ ×ÙÂÏÒÁ ÔÏÞËÉ ÎÁ ËÁÒÔÅ. + +÷ÎÕÔÒÉ ÒÅÇÉÏÎÁ ËÁÒÔÙ ÍÏÇÕÔ ÂÙÔØ ÏÂßÅÄÉÎÅÎÙ × ÔÅÍÁÔÉÞÅÓËÉÅ ÇÒÕÐÐÙ, +ÞÔÏ ÏÂÌÅÇÞÁÅÔ ÎÁ×ÉÇÁÃÉÀ ÐÏ ÎÉÍ. + +òÅÇÉÏÎÕ ÓÏÏÔ×ÅÔÓÔ×ÕÅÔ ËÁÔÁÌÏÇ ÆÁÊÌÏ×ÏÊ ÓÉÓÔÅÍÙ OS, Á ÓÕÂÒÅÇÉÏÎÁÍ - +ÐÏÄËÁÔÁÌÏÇÉ ÄÁÎÎÏÇÏ ËÁÔÁÌÏÇÁ. ðÏÜÔÏÍÕ ÐÅÒÅÈÏÄ × ×ÙÛÅÌÅÖÁÝÉÊ ÒÅÇÉÏÎ +×ÓÅÇÄÁ ÏÐÒÅÄÅÌÅÎ ÏÄÎÏÚÎÁÞÎÏ. + diff --git a/doc/visualisagion.concept b/doc/visualisagion.concept new file mode 100644 index 0000000..0bcea71 --- /dev/null +++ b/doc/visualisagion.concept @@ -0,0 +1,18 @@ +ðÒÉÎÃÉÐÙ ×ÉÚÕÁÌÉÚÁÃÉÉ fGIS + +ïÄÎÉÍ ÉÚ ÏÓÎÏ×ÎÙÈ ÎÅÄÏÓÔÁÔËÏ× ÔÒÁÄÉÃÉÏÎÎÙÈ GIS (ARC/Info, Idrisi, EPPL7) +Ñ×ÌÑÅÔÓÑ ÒÁÚÄÅÌÅÎÉÅ ÓÏÂÓÔ×ÅÎÎÏ ÜÌÅËÔÒÏÎÎÙÈ ËÁÒÔ (ÐÏËÒÙÔÉÊ) É ËÁÒÔÏÇÒÁÆÉÞÅÓËÉÈ +ËÏÍÐÏÚÉÃÉÊ, ÐÒÅÄÎÁÚÎÁÞÅÎÎÙÈ ÄÌÑ ÐÒÏÓÍÏÔÒÁ É ÐÅÞÁÔÉ. + +÷ ÜÔÏÍ ÐÏÄÈÏÄÅ ÅÓÔØ Ó×ÏÉ ÐÒÅÉÍÕÝÅÓÔ×Á --- ÐÅÒÅÈÏÄ ÏÔ ËÏÒÒÅËÔÎÏ ÐÏÓÔÒÏÅÎÎÏÊ +ÍÏÄÅÌÉ ÍÅÓÔÎÏÓÔÉ, ËÁËÏ×ÏÊ Ñ×ÌÑÅÔÓÑ ÐÏËÒÙÔÉÅ, Ë ÐÒÏÉÚ×ÅÄÅÎÉÀ ÐÏÌÉÇÒÁÆÉÞÅÓËÏÇÏ +ÉÓËÕÓÓÔ×Á, ËÁËÏ×ÙÍ Ñ×ÌÑÅÔÓÑ ÂÕÍÁÖÎÁÑ ËÁÒÔÁ, ÚÁÄÁÞÁ ÎÅÐÒÏÓÔÁÑ É, ÎÅÓÏÍÎÅÎÎÏ, +ÔÒÅÂÕÀÝÁÑ ÕÞÁÓÔÉÑ ÞÅÌÏ×ÅËÁ. ôÅÍ ÎÅ ÍÅÎÅÅ ÄÌÑ ÂÏÌØÛÉÎÓÔ×Á ÐÏÌØÚÏ×ÁÔÅÌÅÊ +çéó, Ñ×ÌÑÀÝÉÍÉÈÓÑ ÓÐÅÃÉÁÌÉÓÔÁÍÉ × ÐÒÅÄÍÅÔÎÏÊ ÏÂÌÁÓÔÉ, Á ÎÅ ÐÒÏÆÅÓÓÉÏÎÁÌØÎÙÍÉ +ËÁÒÔÏÇÒÁÆÁÍÉ, ÎÅ×ÏÚÍÏÖÎÏÓÔØ ÍÇÎÏ×ÅÎÎÏ Õ×ÉÄÅÔØ ÒÅÚÕÌØÔÁÔ ÐÒÉÍÅÎÅÎÉÑ ÔÏÊ ÉÌÉ +ÉÎÏÊ ÏÐÅÒÁÃÉÉ, Ñ×ÌÑÅÔÓÑ ÓÕÝÅÓÔ×ÅÎÎÏÊ ÐÏÍÅÈÏÊ ÐÒÉ ÐÏÓÔÒÏÅÎÉÉ çéó ÍÏÄÅÌÅÊ. + +ðÏÜÔÏÍÕ × fGIS ÐÁÒÁÍÅÔÒÙ ×ÉÚÕÁÌÉÚÁÃÉÉ, ÔÁËÉÅ ËÁË ÐÁÌÉÔÒÁ, ÛÔÒÉÈÏ×ËÉ ÉÌÉ +ÎÁÂÏÒ ÓÌÏÅ×-ÏÒÉÅÎÔÉÒÏ×, ÏÂÌÅÇÞÁÀÝÉÈ ÞÔÅÎÉÅ ÏÓÎÏ×ÎÏÊ ÔÅÍÁÔÉÞÅÓËÏÊ ÉÎÆÏÒÍÁÃÉÉ, +Ñ×ÌÑÅÔÓÑ ÁÔÒÉÂÕÔÁÍÉ ËÁÒÔÙ É ËÁÖÄÁÑ ËÁÒÔÁ ÍÏÖÅÔ ÂÙÔØ ×ÉÚÕÁÌÉÚÉÒÏ×ÁÎÁ ÉÌÉ +ÎÁÐÅÞÁÔÁÎÁ ÐÒÏÓÔÏ ÐÕÔÅÍ ÕËÁÚÁÎÉÑ ÅÅ ÉÍÅÎÉ. diff --git a/epu/Makefile b/epu/Makefile new file mode 100644 index 0000000..d33ab0e --- /dev/null +++ b/epu/Makefile @@ -0,0 +1,42 @@ +CC=gcc +CFLAGS=-g -Wall -pedantic -O2 -I../lib/gnu_lib -I../include +LDFLAGS=-L../lib +LOADLIBES=-lm -lepp +SRC=\ +RCS/border.c,v\ +RCS/cluster.c,v\ +RCS/dgt2gen.c,v\ +RCS/eheader.c,v\ +RCS/extents.c,v\ +RCS/fill.c,v\ +RCS/intable.c,v\ +RCS/mosaic.c,v\ +RCS/neighbours.c,v\ +RCS/outtab.c,v\ +RCS/reclass1.c,v\ +RCS/window.c,v +ALL=\ +border\ +cluster\ +dgt2gen\ +eheader\ +extents\ +fill\ +intable\ +mosaic\ +neighbours\ +outtable\ +reclass1\ +centers\ +project\ +window +RCS/%,v : % + ci $< +% : %.o + ${CC} $< -o $@ ${LDFLAGS} ${LOADLIBES} +all: ${ALL} +rcs: ${SRC} +project: project.o + ${CC} $< -o $@ ${CFLAGS} ${LDFLAGS} -lproj ${LOADLIBES} +outtable: outtable.o outtable_func.o + gcc outtable.o outtable_func.o ${LDFLAGS} ${LOADLIBES} -o outtable diff --git a/epu/bil2epp b/epu/bil2epp new file mode 100755 index 0000000..3e00b13 Binary files /dev/null and b/epu/bil2epp differ diff --git a/epu/bil2epp.c b/epu/bil2epp.c new file mode 100644 index 0000000..7e38cde --- /dev/null +++ b/epu/bil2epp.c @@ -0,0 +1,137 @@ +#define __USE_GNU +#define __USE_XOPEN +#include +#include +#include +#include +#include +#include +#include +void error(const char * message) +{ + fprintf(stderr,"%s\n",message); + exit(1); +} +void swab(const void *from,void *to,size_t size); +void dcopy(const void *from,void *to,size_t size) +{ + memcpy(to,from,size); +} + +int convert(EPP *epp,FILE *in,void (*copyrow)(const void *,void*,size_t), + int shift) +{ + int bytes=(epp->lc-epp->fc)*2,row,col,i,rows=epp->lr-epp->fr; + short int *buf,*buf2,*p; + buf=malloc(bytes); + buf2=malloc(bytes); + for (row=epp->fr,i=1;rowlr;row++,i++) { + fread(buf,bytes,1,in); + copyrow(buf,buf2,bytes); + for (col=epp->fc,p=buf2;collc;col++,p++) { + epp_put(epp,col,row,(unsigned short)(*p+shift)); + if (EndLineProc) + if (EndLineProc(row,i,rows)) return -1; + } + } + return 0; +} + +EPP *read_header(char *filename,int *swapbytes,int shift) +{ char buf[1024],*p; + int rows=0,cols=0,nodata=32768; + FILE *f=fopen(filename,"r"); + double X1=0,Y1=0,X2=0,Y2=0,DX=0,DY=0; + while (!feof(f)) { + fgets(buf,1024,f); + p=strchr(buf,'\n'); + if (p) *p=0; + p=buf; + while(isalpha(*p)) p++; + *p=0;p++; + if (!strcmp(buf,"BYTEORDER")) { + while(isspace(*p)) p++; + *swapbytes=toupper(*p)=='M'; + } else if (!strcmp(buf,"NROWS")) { + rows=atol(p); + } else if (!strcmp(buf,"NCOLS")) { + cols=atol(p); + } else if (!strcmp(buf,"NBITS")) { + if (atol(p)!=16) { + fprintf(stderr,"Data size in %s is not 16 bit\n",filename); + return NULL; + } + } else if (!strcmp(buf,"NODATA")) { + nodata=atol(p)+shift; + if (nodata<0) nodata+=65536; + } else if (!strcmp(buf,"ULXMAP")) { + X1=strtod(p,NULL); + } else if (!strcmp(buf,"ULYMAP")) { + Y1=strtod(p,NULL); + } else if (!strcmp(buf,"XDIM")) { + DX=strtod(p,NULL); + } else if (!strcmp(buf,"YDIM")) { + DY=strtod(p,NULL); + } + } + fclose(f); + X1-=DX/2; + Y1-=DY/2; + X2=X1+DX*cols; + Y2=Y1+DY*rows; + Create16bit=1; + return creat_epp(force_ext(filename,".epp"),1,1,cols, + rows,X1,Y1,X2,Y2,100,0,nodata); +} +int main(int argc, char **argv) +{ int shift=0; + char headersuffix[100]=".hdr",headername[1024]; + int i,c,verbose=0; + while ((c=getopt(argc,argv,"s:h:%"))!=EOF) { + switch (c) { + case 's': {char *erptr; + shift = strtol(optarg,&erptr,0); + if (!*erptr) { + error("Invalid shift value"); + } + break; + } + case 'h': strcpy(headersuffix, optarg); + break; + case '%': verbose=1; + break; + default: error("Invalid option.\n Usage bil2epp [-h header_suffix]" + " [-s shift_value] [-%] files\n"); + } + } + + install_progress_indicator(verbose?show_percent:check_int); + if (optind==argc) error("No files specified"); + + for (i=optind;i +#include +#include +#include "eppl_ut.h" +#include "epp.h" +#include "dgt.h" +#include +#ifndef __LINUX__ +#include +#endif +#define TRUE 1 +#define FALSE 0 +#define SEG_LEFT 1 +#define SEG_VERT 2 +#define SEG_RIGHT 4 +#define SEG_UP 8 +#define DELTA 16 +typedef struct U_POINT { + unsigned short x,y;} U_POINT; +typedef U_POINT *LINEBUF; +typedef struct INODE { + unsigned short int count; + short int both_ends; + unsigned short int limit; + int x_tail,x_head; + LINEBUF points; + } *LINE_INODE; +typedef struct LINE_END { LINE_INODE buf; + int tail; + } LINE_END; +/* ðÁÒÁÍÅÔÒÙ ËÏÎÆÉÇÕÒÁÃÉÉ */ +int offsite_option=1; +int tolerance=3; +/* ïÓÎÏ×ÎÙÅ ÒÁÂÏÞÉÅ ÓÔÒÕËÔÕÒÙ ÄÁÎÎÙÈ */ +LINE_END *lines; +unsigned short *rp1,*rp2; +EPP* source; +DGT* dest; +/* ïÓÎÏ×ÎÙÅ ÐÒÏÃÅÄÕÒÙ */ +int epp2dgtX(int col); +int epp2dgtY(int row); +void getrow(int row); +void add_segment(LINE_END line,int col,int row); +/* ÄÏÂÁ×ÌÑÅÔ ÓÅÇÍÅÎÔ × ÎÁÞÁÌÏ ÉÌÉ × ËÏÎÅÃ, × ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ + ÐÏÌÑ line->tail, ËÏÎÞÁÀÝÉÊÓÑ × ÔÏÞËÅ col,row */ +void put_line(LINE_INODE buf); +/* çÅÎÅÒÁÌÉÚÕÅÔ ÌÉÎÉÀ É ÚÁÐÉÓÙ×ÁÅÔ ÅÅ. ðÒÉ ÎÅÏÂÈÏÄÉÍÏÓÔÉ ÒÅÖÅÔ + ðÏ ÚÁ×ÅÒÛÅÎÉÉ ÏÐÅÒÁÃÉÉ ÏÓ×ÏÂÏÖÄÁÅÔ ×ÓÀ ÐÁÍÑÔØ, ÚÁÎÑÔÕÀ ÌÉÎÉÅÊ +*/ +int create_header(EPP *epp,char *dgtname); +/* óÏÚÄÁÅÔ ×ÙÈÏÄÎÏÊ ÆÁÊÌ */ +void write_labels(EPP *epp,DGT *dgt); +/* óÏÚÄÁÅÔ ÔÏÞËÉ */ +void end_line(LINE_END line); +/* úÁ×ÅÒÛÁÅÔ ÐÏÐÏÌÎÅÎÉÅ ÌÉÎÉÉ Ó ÕËÁÚÁÎÎÏÇÏ ËÏÎÃÁ. åÓÌÉ Ó ÄÒÕÇÏÇÏ ËÏÎÃÁ + ÏÎÁ ÕÖÅ ÎÅ ÍÏÖÅÔ ÐÏÐÏÌÎÑÔØÓÑ, ÄÅÌÁÅÔ ÅÊ put_line */ +LINEBUF enlarge(LINE_INODE buf); +/* õ×ÅÌÉÞÉ×ÁÅÔ ÄÌÉÎÕ ÌÉÎÉÉ ÎÁ 1. ðÒÉ ÎÅÏÂÈÏÄÉÍÏÓÔÉ ÄÏ×ÙÄÅÌÑÅÔ ÐÁÍÑÔØ */ +int smooth(LINE_INODE line,LINEBUF *buf); +/*óÇÌÁÖÉ×ÁÅÔ ÌÉÎÉÀ + ×ÏÚ×ÒÁÝÁÅÔ ËÏÌÉÞÅÓÔ×Ï ÕÚÌÏ×, ÏÓÔÁ×ÛÉÈÓÑ ÐÏÓÌÅ ÇÅÎÅÒÁÌÉÚÁÃÉÉ*/ +LINE_INODE new_line(int both,int col1,int row1,int col2,int row2); +/* óÏÚÄÁÅÔ ÎÏ×ÕÀ ÌÉÎÉÀ, ÐÏÍÅÝÁÑ × ÎÅÅ ÅÄÉÎÓÔ×ÅÎÎÙÊ ÓÅÇÍÅÎÔ Ó ÚÁÄÁÎÎÙÍÉ +ËÏÏÒÄÉÎÁÔÁÍÉ.*/ +void join_lines(LINE_END line1,LINE_END line2); +/* ïÂßÅÄÉÎÑÅÔ Ä×Å ÌÉÎÉÉ × ÏÄÎÕ. */ +int border_dgt(EPP *epp,char *dgtname,int offs_opt,int tol,int do_labels) +{int nrows=epp->lr-epp->fr+1; + int ncols=epp->lc-epp->fc+2; + unsigned short *left,*right,*up; + int this_node,next_node; + LINE_END hor_line,*vert_line; + int i,j; + offsite_option=offs_opt; + tolerance=tol; + if ((i=create_header(epp,dgtname))) return i; + rp1=calloc(ncols,sizeof(short int)); + rp2=calloc(ncols,sizeof(short int)); + lines=calloc(ncols,sizeof(struct LINE_END)); + for(i=0;ibuf) + this_node|=SEG_UP; +#ifdef DEBUG + if ((this_node&SEG_LEFT)&&(!hor_line.buf)) + fprintf(stderr,"Hor_line exists, where shouldn't x=%d y=%d\n",j,i); + if (!(this_node&SEG_LEFT)&&(hor_line.buf)) + fprintf(stderr,"Hor_line doesn't exist x=%d y=%d\n",j,i); + if (this_node&SEG_UP) + if ((vert_line->tail?vert_line->buf->x_tail:vert_line->buf->x_head)!=j) + fprintf(stderr,"Invalid vertical segment at x=%d y=%d\n",j,i); +#endif + switch(this_node) + {/* ìÉÎÉÉ ÐÒÏÄÏÌÖÁÀÔÓÑ ÐÒÑÍÏ*/ + case 0:/* äÅÌÁÔØ ÚÄÅÓØ ÎÅÞÅÇÏ */ break; + case SEG_UP|SEG_VERT:add_segment(*vert_line,j,i+1); + break; + case SEG_LEFT|SEG_RIGHT:add_segment(hor_line,j+1,i); + break; + /* ìÉÎÉÉ ÐÒÏÄÏÌÖÁÀÔÓÑ Ó ÉÚÇÉÂÏÍ */ + case SEG_LEFT|SEG_VERT:*vert_line=hor_line;hor_line.buf=NULL; + add_segment(*vert_line,j,i+1); + break; + case SEG_UP|SEG_RIGHT:hor_line=*vert_line;vert_line->buf=NULL; + add_segment(hor_line,j+1,i); + break; + /* ìÉÎÉÉ ÓÌÉ×ÁÀÔÓÑ */ + case SEG_UP|SEG_LEFT:join_lines(hor_line,*vert_line); + vert_line->buf=NULL; + hor_line.buf=NULL; + break; + /* ìÉÎÉÑ ÓÁÍÏÚÁÒÏÖÄÁÅÔÓÑ ÎÁ ÐÕÓÔÏÍ ÍÅÓÔÅ */ + case SEG_VERT|SEG_RIGHT:hor_line.buf=new_line(TRUE,j,i,j+1,i); + hor_line.tail=TRUE; + vert_line->buf=hor_line.buf; + vert_line->tail=FALSE; + add_segment(*vert_line,j,i+1); + /* ÓÏÚÄÁÔØ ÔÏÞËÕ */ + break; + /* ìÉÎÉÉ ÒÁÓÓÅËÁÀÔÓÑ - 5 ÓÌÕÞÁÅ× ËÏÇÄÁ × ÔÏÞËÅ 3 É ÂÏÌÅÅ ÌÉÎÉÊ */ + case SEG_VERT|SEG_LEFT|SEG_RIGHT: + /* T ×ÎÉÚ */ + end_line(hor_line); + hor_line.buf=new_line(FALSE,j,i,j+1,i); + hor_line.tail=TRUE; + vert_line->buf=new_line(FALSE,j,i,j,i+1); + vert_line->tail=TRUE; + /* cÏÚÄÁÔØ ÔÏÞËÕ */ + break; + case SEG_UP|SEG_LEFT|SEG_RIGHT: + /* ô ××ÅÒÈ ÎÏÇÁÍÉ */ + /*×ÙÂÒÏÓÉÔØ ÔÏÞËÕ*/ + end_line(hor_line); + end_line(*vert_line); + hor_line.buf=new_line(FALSE,j,i,j+1,i); + hor_line.tail=TRUE; + vert_line->buf=NULL; + break; + case SEG_UP|SEG_LEFT|SEG_VERT: + /* ô È×ÏÓÔÏÍ ×ÌÅ×Ï */ + /* ×ÙÂÒÏÓÉÔØ ÔÏÞËÕ */ + end_line(hor_line); + end_line(*vert_line); + vert_line->buf=new_line(FALSE,j,i,j,i+1); + vert_line->tail=TRUE; + hor_line.buf=NULL; + break; + case SEG_UP|SEG_RIGHT|SEG_VERT: + /* ô È×ÏÓÔÏÍ ×ÐÒÁ×Ï */ + /* ×ÙÂÒÏÓÉÔØ ÔÏÞËÕ */ + end_line(*vert_line); + hor_line.buf=new_line(FALSE,j,i,j+1,i); + hor_line.tail=TRUE; + vert_line->buf=new_line(FALSE,j,i,j,i+1); + vert_line->tail=TRUE; + /* ÓÏÚÄÁÔØ ÔÏÞËÕ */ + break; + case SEG_UP|SEG_RIGHT|SEG_LEFT|SEG_VERT: + /* ËÒÅÓÔ */ + end_line(*vert_line); + end_line(hor_line); + hor_line.buf=new_line(FALSE,j,i,j+1,i); + hor_line.tail=TRUE; + vert_line->buf=new_line(FALSE,j,i,j,i+1); + vert_line->tail=TRUE; + /* ÓÏÚÄÁÔØ ÔÏÞËÕ */ + break; + default: + /* ÷ÉÓÑÞÉÅ ÕÚÌÙ, ËÏÔÏÒÙÈ îå âù÷áåô */ + fprintf(stderr,"Dangling node at x=%d,y=%d\n",j,i); + } + this_node=next_node; + } + } +if (do_labels) write_labels(source,dest); +close_dgt(dest); + +return 0; +} + +void add_segment(LINE_END line,int col,int row) +{ + LINE_INODE l=line.buf; + + LINEBUF points; + if (line.tail) + {points=l->points+l->count-2; + if (points->x==col&&points[1].x==col) {points[1].y=row;return;} + if (points->y==row&&points[1].y==row) {points[1].x=col;l->x_tail=col;return;} + points=enlarge(l); + points+=l->count-1; + points->x=col; + points->y=row; + l->x_tail=col; + } + else + {LINEBUF tmp;int i=l->count; + points=l->points; + if (points->x==col&&points[1].x==col) {points->y=row;return;} + if (points->y==row&&points[1].y==row) {points->x=col;l->x_head=col;return;} + points=enlarge(l); + points+=l->count-1; + tmp=points-1; + for(;i>0;i--,*(points--)=*(tmp--)); + points->x=col; + points->y=row; + l->x_head=col; + } +} + +LINEBUF enlarge(LINE_INODE buf) +{ if (buf->count++==buf->limit) + buf->points=realloc(buf->points,(buf->limit+=DELTA)*sizeof(U_POINT)); + return buf->points; +} +void end_line(LINE_END line) +{ if (line.buf->both_ends) + line.buf->both_ends=FALSE; + else + put_line(line.buf); +} +#ifdef DEBUG +#define DEBUG_CHECK(x1,x2) if (line1.buf->x1!=line2.buf->x2) fprintf(stderr,"Joining lines with separate ends %d %d\n",line1.buf->x1,line2.buf->x2) +#else +#define DEBUG_CHECK(x1,x2) +#endif +#define COPY_DIRECT(l) for(i=l.buf->count,source=l.buf->points;i>0;i--,*(dest++)=*(source++)) +#define COPY_REVERSE(l) for(i=l.buf->count,source=l.buf->points+l.buf->count-1;i>0; i--,*(dest++)=*(source--)) +void join_lines(LINE_END line1,LINE_END line2) +{int i; + LINEBUF source,dest; + LINE_INODE new; + if (line1.buf==line2.buf) + { put_line(line1.buf); + return; + } + new=malloc(sizeof(struct INODE)); + new->count=line1.buf->count+line2.buf->count-1; + new->limit=(new->count+DELTA-1)/DELTA*DELTA; + new->points=malloc(new->limit*sizeof(U_POINT)); + dest=new->points; + + if (line1.tail) + { + new->x_head=line1.buf->x_head; + COPY_DIRECT(line1); + dest--; + + if (line2.tail) + { + DEBUG_CHECK(x_tail,x_tail); + new->x_tail=line2.buf->x_head; + COPY_REVERSE(line2); + } + else + { DEBUG_CHECK(x_tail,x_head); + new->x_tail=line2.buf->x_tail; + COPY_DIRECT(line2); + } + } + else + { + new->x_head=line1.buf->x_tail; + COPY_REVERSE(line1); + dest--; + if (line2.tail) + { DEBUG_CHECK(x_head,x_tail); + new->x_tail=line2.buf->x_head; + COPY_REVERSE(line2); + } + else + { DEBUG_CHECK(x_head,x_head); + new->x_tail=line2.buf->x_tail; + COPY_DIRECT(line2); + } + } + new->both_ends=-1; + if (line1.buf->both_ends) + { new->both_ends++; + lines[new->x_head].buf=new; + lines[new->x_head].tail=FALSE; + } + if (line2.buf->both_ends) + { new->both_ends++; + lines[new->x_tail].buf=new; + lines[new->x_tail].tail=TRUE; + } + if (new->both_ends<0) + put_line(new); + free(line1.buf->points); + free(line2.buf->points); + free(line1.buf); + free(line2.buf); +} +LINE_INODE new_line(int both,int col1,int row1,int col2,int row2) +{LINE_INODE tmp=malloc(sizeof(struct INODE)); + tmp->both_ends=both; + tmp->count=2; + tmp->limit=DELTA; + tmp->points=malloc(DELTA*sizeof(U_POINT)); + tmp->points[0].x=col1; + tmp->points[0].y=row1; + tmp->points[1].x=col2; + tmp->points[1].y=row2; + tmp->x_head=col1; + tmp->x_tail=col2; + return tmp; +} +void getrow(int row) +{ unsigned short int *tmp,*tmp2; + int i; + tmp=rp2; + rp2=rp1; + rp1=tmp; + if(row+source->frlr) + { + epp_get(source,source->fc,source->fr+row); + memcpy(rp1+1,source->row,(source->lc-source->fc)*sizeof(short)); + if (offsite_option) + { rp1[0]=source->offsite; + rp1[source->lc-source->fc+1]=source->offsite; + } + else + { rp1[0]=rp1[1]; + tmp=rp1+source->lc-source->fc; + *(tmp+1)=*tmp; + } + } + else + if (offsite_option) + for(i=source->lc-source->fc,tmp=rp1;i>=0;*(tmp++)=source->offsite,i--); + else + for(i=source->lc-source->fc,tmp=rp1,tmp2=rp2;i>=0;*(tmp++)=*(tmp2++),i--); + if (!row) + if (offsite_option) + for(i=source->lc-source->fc+1,tmp=rp2;i>=0;*(tmp++)=source->offsite,i--); + else + for(i=source->lc-source->fc,tmp=rp2,tmp2=rp1;i>=0;*(tmp++)=*(tmp2++),i--); +} +void put_line(LINE_INODE line) +{static int lineno=1; + int c,n;LINEBUF p;LINEBUF buf;POINT *s; + if (tolerance) c=smooth(line,&buf); + else {c=line->count;buf=line->points;} + p=line->points; + while (c>0) + { if (c>500) {n=500;c-=499;} else {n=c;c=0;} + s=dest->buffer->s; + dest->buffer->npoints=n; + dest->buffer->ID=1; + for(;n>0;p++,n--,s++) + {s->x=epp2dgtX(p->x); + s->y=epp2dgtY(p->y); + } + dgt_touch(dest); + dgt_next(dest); + p--; + } + lineno++; + free(buf); + free(line); +} +int rowfact,colfact; +int create_header(EPP *epp,char *dgtname) +{EPPHEADER h; + get_epp_header(epp,&h); + dest=creat_dgt(dgtname,epp->XLeft,epp->YBottom,epp->XRight,epp->YTop,h.coord_sys); +if (dest==NULL) return errno; +source=epp; +rowfact=epp->lr-epp->fr; +colfact=epp->lc-epp->fc; +if (tolerance) {rowfact*=2;colfact*=2;} +return 0; +} +int epp2dgtX(int col) +{ return (col*(unsigned long)65535/colfact-32768); +} +int epp2dgtY(int row) +{ return (32767-row*(unsigned long)65535/rowfact); + +} +#ifdef __GNUC__ +#define seg_len(a) abs(a->x-a[1].x?:a->y-a[1].y) +#else +#define seg_len(a) abs(a->x-a[1].x?a->x-a[1].x:a->y-a[1].y) +#endif +U_POINT make_middle_point(LINEBUF src1,LINEBUF src2) +{U_POINT tmp; + tmp.x=src1->x+src2->x; + tmp.y=src1->y+src2->y; + return tmp; +} +int smooth(LINE_INODE line,LINEBUF *buf) +{LINEBUF tmp; + LINEBUF dest,src1,src2; + int i,prev_kept=TRUE; + if (line->count==2) + { *buf=line->points; + line->points->x=2*line->points->x; + line->points->y=2*line->points->y; + line->points[1].x=2*line->points[1].x; + line->points[1].y=2*line->points[1].y; + return 2; + } + src1=line->points; + tmp=malloc(((4*line->count)/3+1)*sizeof(U_POINT)); + tmp->x=src1->x*2; + tmp->y=src1->y*2; + dest=tmp+1; + *buf=tmp; + for(i=line->count-2,src2=src1+1;i>=0;i--,src1++,src2++) + { + if (prev_kept) + { if (seg_len(src1)x=src2->x*2; + dest->y=src2->y*2;dest++; + } + } + } + else + { U_POINT tmp=make_middle_point(src1,src2); + dest--; + if (((dest-1)->x-dest->x)*(dest->y-tmp.y)== + ((dest-1)->y-dest->y)*(dest->x-tmp.x)) *dest=tmp; else *(++dest)=tmp; + dest++; + if(seg_len(src1)>tolerance) + { + if(i&&seg_len(src2)>tolerance) + { dest->x=src2->x*2; + dest->y=src2->y*2; + dest++; + prev_kept=TRUE; } + } + } + } + dest->x=src1->x*2; + dest->y=src1->y*2; + dest--; + if(line->count>4) + { + if(seg_len(dest)points); + line->count=dest-tmp+1; + line->points=tmp; + return line->count; +} +void write_labels(EPP *epp,DGT *dgt) +{ +} + +int main(int argc,char **argv) +{ struct option longoptions[]={ + {"tolerance",1,0,'t'}, + {"margin",0,0,'m'}, + {"output-file",1,0,'o'}, + {"labels",0,0,'l'}, + {"verbose",0,0,'%'}, + {"margins",0,0,'m'}, + {"help",0,0,1}, + {"version",0,0,2}, + {NULL,0,0,0}}; + int c,index; + int verbose=0; + int tolerance=0,draw_frame=1,do_labels=0; + char *endptr,outname[1024]=""; + EPP *epp; + while ((c=getopt_long(argc,argv,"t:mo:l%",longoptions,&index))!=-1) + switch(c) + { + case 't':tolerance=strtol(optarg,&endptr,0); + if (*endptr||tolerance<0||tolerance>100) + { fprintf(stderr,"Invalalid tolerance value %s\n",optarg); + exit(1); + } + break; + case 'f':draw_frame=0;break; + case 'l':do_labels=1;break; + case 'm':draw_frame=0;break; + + case '%':verbose=1;break; + case 'o':strcpy(outname,default_ext(optarg,".dgt")); + break; + case 2:show_version("border","$Revision: 1.1 $"); + case 1: + default: + printf ("Usage:border [-%%][-f][-l][-t value][-o file] file.epp\n"); + return (c!=1); + } + if (optind==argc) { fprintf(stderr,"No input file given\n"); + exit(1); + } + if (!*outname) strcpy(outname,force_ext(argv[optind],".dgt")); + epp=open_epp(default_ext(argv[optind],".epp")); + if (!epp) {fprintf(stderr,"Cannot open input file %s\n",argv[optind]); + exit(1); + } + install_progress_indicator(verbose?show_percent:check_int); + if ((c=clear_progress( + border_dgt(epp,outname,draw_frame,tolerance,do_labels)))) + unlink(outname); + return c; +} diff --git a/epu/centers.c b/epu/centers.c new file mode 100644 index 0000000..3cbd386 --- /dev/null +++ b/epu/centers.c @@ -0,0 +1,78 @@ +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +#include +void help(int exitcode) { + printf("Usage centers [-%%] cluster_file radius_file\n"); + printf("Table of coordinates and cluster values is written to stdout\n"); + exit (exitcode); +} +struct center { + int row,col; + int radius; + }; +struct center *table; + EPP *cluster_file,*radius_file; +int check_max_r (int col,int row, int value) { + int r=epp_get(radius_file,col,row); + struct center *rec = table+value; + if (rec->radiusradius=r; + rec->row=row; + rec->col=col; + } + return 0; +} +int main(int argc,char **argv) { + struct option long_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + }; + int c,index,result,i; + int verbose=0; + while ((c=getopt_long(argc,argv,"%",long_options,&index))!=-1) { + switch(c) { + case 2:show_version("centers","$Revision: 1.1 $"); + case '%':verbose=1;break; + case 1: + default: help(c==1?0:1); + } + } + cluster_file = open_epp(default_ext(argv[optind],".epp")); + if (!cluster_file) { + fprintf(stderr,"Cannot open file %s\n", + default_ext(argv[optind],".epp")); + exit (2); + } + optind++; + radius_file = open_epp(default_ext(argv[optind],".epp")); + if (!radius_file) { + fprintf(stderr,"Cannot open file %s\n", + default_ext(argv[optind],".epp")); + exit (2); + } + if (!is_aligned(cluster_file,radius_file)) { + fprintf(stderr,"Files don't have same coordinate system and cell size\n"); + exit(2); + } + table=calloc((cluster_file->max+1),sizeof(struct center)); + if (!table) { + perror("allocating table"); + exit(2); + } + install_progress_indicator(verbose?show_percent:check_int); + result=clear_progress(for_each_cell(cluster_file,check_max_r)); + if (result) { + return abs(result); + } + for (i=0;i<=cluster_file->max;i++) { + if (table[i].radius) { + printf ("%5d,%12g,%12g\n",i,alt_x(cluster_file,table[i].col), + alt_yc(cluster_file,table[i].row)); + } + } + return 0; +} diff --git a/epu/clip.c b/epu/clip.c new file mode 100644 index 0000000..807b883 --- /dev/null +++ b/epu/clip.c @@ -0,0 +1,154 @@ +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +#include +#include +EPP *src,*dest,*mask; +EPP_LINK lnk; + int mask_value=-1; + int row1=32767, row2=-32768, col1=32767, col2=-32768; +void help(int exitcode) +{ + printf("Usage: clip [-%%] [-m number] [-o filename] [--help][--version] file mask_file\n" +"\t--help - displays this message\n" +"\t--version - shows version number\n" +"\t-%% --verbose - shows progress indicator\n" +"\t-m --mask-value - class in mask file, which denotes area to copy.\n" +"\t\t (default - all onsite classes)\n" +"\t-o name --output-file=name - sets name of output file\n"); +exit (exitcode); +} +int mask_offsite(int class) { + return class!=mask->offsite; +} + +int (*mask_func)(int)=mask_offsite; +int mask_class(int class) { + return class==mask_value; +} +int fill_cell(int col, int row, int value) +{ + if (mask_func(epp_get(mask,col,row))) + return epp_get(src,col,row); + else + return value; +} + +int fill_cell_transform(int col, int row, int value) +{ + if (mask_func(epp_get(mask,col,row))) + return epp_get(src,linked_col(lnk,col),linked_row(lnk,row)); + else + return value; +} + +int find_extent(int col, int row, int value) +{ + if (mask_func(value)) { + if (colcol2) col2=col; + if (rowrow2) row2=row; + } + return 0; +} +int main(int argc,char **argv) +{char output_file[1024]="clip.out.epp"; + struct option long_options[]= +{ + {"help",0,0,1}, + {"version",0,0,2}, + {"mask-value",1,0,'m'}, + {"verbose",0,0,'%'}, + {"output-file",1,0,'o'}, + {NULL,0,0,0}}; + int index,c;char *endptr; + int x1=32767,y1=32767,x2=-32767,y2=-32767, + result,verbose=0; + while ((c=getopt_long(argc,argv,"m:%o:",long_options,&index))!=-1) + { switch (c) + { case 2:show_version("mosaic","$Revision: 1.1 $"); + case '%':verbose=1;break; + case 'm':mask_value=strtol(optarg,&endptr,0); + if(*endptr) + { fprintf(stderr,"Invalid mask value %s\n",optarg); return 2; + } + mask_func=mask_class; + break; + case 'o':strcpy(output_file,default_ext(optarg,".epp"));break; + case 1: + case '?': + default: + help(c!=1); + } + } + if (argc-optind!=2) { help(1);} + src=open_epp(argv[optind]); + if (!src) src=open_epp(default_ext(argv[optind],".epp")); + if (!src) { + fprintf(stderr,"Cannot open file %s\n",argv[optind]); + exit(1); + } + mask=open_epp(argv[optind+1]); + if (!mask) mask=open_epp(default_ext(argv[optind+1],".epp")); + if (!mask) { + fprintf(stderr,"Cannot open file %s\n",argv[optind+1]); + exit(1); + } + if (mask_value>0&&(mask_valuemin||mask_value>mask->max)&& + mask_value!=mask->offsite) { + fprintf(stderr,"No cells with value %d in file %s\n",mask_value, + argv[optind+1]); + exit(1); + } + /* determine limits of new file */ + if (verbose) fprintf(stderr,"Determining output extent\n"); + install_progress_indicator(verbose?show_percent:check_int); + if (for_each_cell(mask,find_extent)!=0) exit(1); + fputc('\r',stderr); + x1=epp_col(mask,src->XLeft); + x2=epp_col(mask,src->XRight)+1; + y1=epp_row(mask,src->YTop); + y2=epp_row(mask,src->YBottom)+1; + if (y1>y2) { + int tmp=y1; + y1=y2; + y2=tmp; + } + if (x1>x2) { + int tmp=x1; + x1=x2; + x2=tmp; + } + row1=y1row2?row2:y2; + col1=x1col2?col2:x2; + if (row1>=row2||col1>=col2) { + fprintf(stderr,"No applicable cells found\n"); + exit(1); + } + dest=creat_epp(output_file,col1,row1,col2,row2, + alt_x(mask,col1),alt_y(mask,row1), alt_x(mask,col2+1), + alt_y(mask,row2+1), 100,0, src->offsite); + + + if (!dest) {fprintf(stderr,"Cannot create output file %s\n",output_file); + return 2; + } + if (verbose) fprintf(stderr,"Writing file\n"); + if (is_aligned(mask,src)) + result=clear_progress(for_each_cell(dest,fill_cell)); + else { + lnk=link_epp(mask,src); + result=clear_progress(for_each_cell(dest,fill_cell_transform)); + free(lnk); + } + close_epp(dest); + close_epp(src); + close_epp(mask); + if (result) unlink(output_file); + return result; +} diff --git a/epu/cluster b/epu/cluster new file mode 100755 index 0000000..29577e3 Binary files /dev/null and b/epu/cluster differ diff --git a/epu/cluster.c b/epu/cluster.c new file mode 100644 index 0000000..5d11e28 --- /dev/null +++ b/epu/cluster.c @@ -0,0 +1,841 @@ +#include +#include +#include "epp.h" +#include "dgt.h" +#include +#include +#include "eppl_ut.h" +#include +#include + + +# ifdef __unix +# define EARLY_UNLINK 1 +# endif + +#define LABEL_DELTA 16384 +/* step to increase size of labels array */ +#define LABEL_INIT_SIZE 65536 +/* initial size of label array */ +int *labels, last, limit; +int megabytes=4; +int line_color=0; +EPP *epp;/*global pointer to input file for coordinate info access*/ +int new_label() +{ int tmp; + tmp=last; + labels[last]=0; + if (++last>=limit) + { labels=realloc(labels,(limit+=LABEL_DELTA)*sizeof(int)); + if (!labels) + { fprintf(stderr,"Cannot perform realloc()\n"); + exit(1); + } + } + return tmp; +} +void *check_alloc(size_t size) +{void *tmp; + if (!(tmp=malloc(size))) + { fprintf(stderr,"Cannot perform malloc()\n"); + exit(1); + } + return tmp; +} +unsigned short *alloc_buffer(int width,int *height) +{int i=0,l=0,h=megabytes*524288/width; + unsigned short *buffer; + buffer=malloc(h*width*sizeof(short)); + if (!buffer) + { while (l>1; + buffer=malloc(i*width*sizeof(short)); + if (buffer) + { free(buffer); + l=i+1; + } + else + { h=i-1; } + } + i--; + i=i*3/4; + buffer=malloc(i*width*sizeof(short)); + *height=i; + } + else + *height=h; + return buffer; +} +void alloc_labels() +{ labels=check_alloc(LABEL_INIT_SIZE*sizeof(int)); + limit=LABEL_INIT_SIZE; + labels[0]=1; + last=1; +} +int check_line(int this,int other) +{ + return other==line_color; +} +int check_border(int this,int other) +{ + return other!=this; +} + +int base_color(int color) +{ while (labels[color]<0) color=-labels[color]; + return color; +} +void report_dup(int row,int col,int class1,int class2) +{ static int dup_count=0; + fprintf(stderr,"\r Duplicate label %d:",++dup_count); + fflush(stderr); + printf("%10g %10g %6d %6d\n", + alt_xc(epp,col),alt_yc(epp,row),class1,class2); + +} +int merge_colors(int color1,int color2,int row,int col) +{ color1=base_color(color1); + color2=base_color(color2); + if (labels[color1]&&labels[color2]&&labels[color1]!=labels[color2]) + report_dup(row,col,labels[color1],labels[color2]); + if (color1==color2) + return color1; + if (color1lc-fin->fc; + nrows=fin->lr-fin->fr; +/* Allocating row buffers */ + in_rp1=check_alloc((ncol+2)*sizeof(short int)); + in_rp2=check_alloc((ncol+2)*sizeof(short int)); + out_rp1=check_alloc((ncol+2)*sizeof(long int)); + out_rp2=check_alloc((ncol+2)*sizeof(long int)); +/* initiliazing row buffers */ + for(i=0,cc=out_rp2,inp2=in_rp2;ifr;rowlr;seqrow++,row++) + { /*swap output row buffers*/ + cc=out_rp1;out_rp1=out_rp2;out_rp2=cc; + /* swap input row buffers*/ + inp1=in_rp1; in_rp1=in_rp2; in_rp2=inp1; + /*get input file row */ + memcpy(in_rp2+1,epp_getline(fin,fin->fc,row),ncol*sizeof(short int)); + /* position output files */ + epp_put(temp1,fin->fc,row,1); + epp_put(temp2,fin->fc,row,1); + /* handle progress indicator */ + if (*EndLineProc) + {int exitcode; + if ((exitcode=EndLineProc(row,seqrow,nrows))) + { return exitcode; } + } + /*scan row */ + for(j=epp->fc,col=1,inp1=in_rp1+1,inp2=in_rp2+1,cc=out_rp2+1; + col<=ncol;col++,inp1++,inp2++,cc++,j++) + { if (*inp2==line_color) *cc=0; + else + /*check for labels with id!=0&&id!=line_color */ + { if (do_labels&&*inp2) + { int* lptr=labels+base_color(*inp2); + if (*lptr) report_dup(row,col,*inp2,*lptr); + else *lptr=*inp2; + } + if (is_border(*inp2,*inp1)) color=0; else color= out_rp1[col]; + if (!is_border(*inp2,*(inp2-1))) + if (color) + {if(*(cc-1)) + color=merge_colors(*(cc-1),color,row,j); + } + else color=*(cc-1); + if (eight_way) + { if (!is_border(*inp2,*(inp1-1))) + if (color) color=merge_colors(out_rp1[col-1],color,row,j); + else color=out_rp1[col-1]; + if (!is_border(*inp2,*(inp1+1))) + if (color) color=merge_colors(out_rp1[col+1],color,row,j); + else color=out_rp1[col+1]; + } + if (!color) + { int j; + unsigned short int *this,*next; + /* no color found. Trying to get it from some right cell*/ + for (this=inp2,next=this+1,j=col;j<=ncol&& + is_border(*this,in_rp1[j]) + &&!is_border(*this,*next);this++,next++,j++); + if (j<=ncol&&!is_border(*this,in_rp1[j])) color=out_rp1[j]; + else + { color=new_label();} + } else color=base_color(color); + *cc=color; + } + } /* end of inner loop */ + /* save out_rp2 */ + for (i=0,inp1=temp1->row,inp2=temp2->row,cc=out_rp2+1; + i> 16; + } + } + reset_epp(temp1); + reset_epp(temp2); + close_epp(fin); + free(in_rp1); + free(in_rp2); + free(out_rp1); + free(out_rp2); + last--; + labels[0]=0; + return 0; +} + + +int remap_labels() +/* search array of labels to actual numer of clusters */ +/* case where there are no label points */ +{ long int i,j,c=1; + + for (i=1;i<=last;i++) + { j=base_color(i); + if (!labels[j]) + labels[i]=labels[j]=c++; + else + labels[i]=labels[j]; + } + c--; + if (c>65535) + { fprintf(stderr,"Count of contours exceedes EPPL limit of 65535\n"); + exit(2); + } + Create16bit=c>255; + printf("Temporary numbers used %d\nContours found %ld\n Output file will be %d-bit\n", + last, + c, + c>255?16:8); + return c; +} +int remap_hard_labels() +/* link temporary numbers with actual labels . + mark each temporary contour with no labels by unique number greater than + 65535 + + returns count of classes in resulting file. + Side effects: label[i] contain value to fill temporary contour i; + Create16bit is set appropriate. +*/ +{ long int i,j,c=65536,unlabelled=0,max=0; + for (i=1;imax) max=labels[j]; + } + } + Create16bit=max>255; + printf("Temporary numbers used %d\nMaximal class is %ld\nUnlabelled polygons found %ld\n", + last,max,unlabelled); + return max; +} +int second_pass(EPP *temp1,EPP *temp2,EPP *fout) +/* creates final clusterized file in case, if no fill rules given + file is not from rasterize */ +{int i,row,col,nrows,fc,secondc,exitcode; + unsigned short *src1,*src2,*dest; + nrows=fout->lr-fout->fr; + secondc=(fc=fout->fc)+1; + for (i=1,row=fout->fr;rowlr;i++,row++) + { if (EndLineProc) + if ((exitcode=EndLineProc(row,i,nrows))) return exitcode; + epp_put(fout,fc,row, + labels[epp_get(temp1,fc,row)|(epp_get(temp2,fc,row)<<16)]); + for (col=secondc,src1=epp_getline(temp1,secondc,row), + src2=epp_getline(temp2,secondc,row), + dest=fout->row+1; + collc; + *(dest++)=labels[*(src1++)|(*(src2++)<<16)],col++); + } + close_epp(temp1); + close_epp(temp2); + return 0; +} +void report_unlabelled(int row,int col,int class,int offsite) +{ int i,*lbl; + printf("%g %g unlabelled\n",alt_xc(epp,col),alt_yc(epp,row)); + for (i=1,lbl=labels+1;i<=last;i++,lbl++) + if (*lbl==class) *lbl=offsite; +} +void fill_and_save(EPP *fout,EPP *fill, unsigned short *rp1, + unsigned short *rp2, unsigned short *rp3, int row) +{int col=fout->fc,value; + for (rp1++,rp2++,rp3++;collc;rp1++,rp2++,rp3++,col++) + { value=*rp2; + if (!value) + switch (epp_get(fill,row,col)) + { case 1:value=*rp1;break; + case 2:value=*(rp2+1);break; + case 3:value=*(rp1+1);break; + case 4:value=*(rp3);break; + case 6:value=*(rp3+1);break; + case 8:value=*(rp2-1);break; + case 9:value=*(rp1-1);break; + case 12: value=*(rp3-1);break; + } + epp_put(fout,col,row,value?value:fout->offsite); + } +} +int second_pass_fill(EPP *temp1,EPP *temp2,EPP *fill,EPP *fout) +{unsigned short *rp1,*rp2,*rp3,*rtmp; + int i,row,col,ncols,nrows,fc,secondc,exitcode,value; + unsigned short *src1,*src2,*dest; + nrows=fout->lr-fout->fr; + secondc=(fc=fout->fc)+1; + ncols=fout->lc-fout->fc+2; + /*set global pointer */ + epp=fout; + /* allocate buffers */ + rp1=check_alloc(ncols*sizeof(short int)); + rp2=check_alloc(ncols*sizeof(short int)); + rp3=check_alloc(ncols*sizeof(short int)); + for(i=0,rtmp=rp2;ioffsite); + *rp1=rp1[ncols-1]=*rp3=rp3[ncols-1]=fout->offsite; + for (row=fout->fr,i=1;rowlr;i++,row++) + { if (EndLineProc) + if ((exitcode=EndLineProc(row,i,nrows))) return exitcode; + for (col=fout->fc, + dest=rp3+1, + src1=epp_getline(temp1,fc,row), + src2=epp_getline(temp2,fc,row); + collc; + dest++,src1++,src2++,col++) + {value=labels[*src1|(*src2<<16)]; + if (value>65535) + report_unlabelled(row,col,value,*dest=fout->offsite); + else *dest=value==65534?0:value; + } + if (row>fout->fr) fill_and_save(fout,fill,rp1,rp2,rp3,row-1); + rtmp=rp1; + rp1=rp2; rp2=rp3; rp3=rtmp; + } + fill_and_save(fout,fill,rp1,rp2,rp3,fout->lc-1); + close_epp(temp1); + close_epp(temp2); + close_epp(fill); + return 0; +} +/* rasterize should fill this variables near its beginning */ +int right_border, bottom_border, nrow, ncol,half_vert,half_horiz; +int dgt2col(int x) +{ return (((unsigned long)(x+32767))*ncol)/right_border; +} +int dgt2absrow(int y) +{ + return (((unsigned long)(32767-y))*nrow)/bottom_border+1; +} +int absrow2dgt(int row) +{ + return 32767-((long)((unsigned long)(row-1)*bottom_border/nrow)); +} +#define CELL(buf,row,col) *(buf+row*width+col) +#define row2dgt(row) (absrow2dgt(row+firstrow)) +#define dgt2row(y) (dgt2absrow(y)-firstrow) + +int save_buffer(EPP *epp,unsigned short *buf,int firstrow,int lastrow,int width) +{unsigned short *b; int row; + for (row=firstrow,b=buf;rowoffsite); + memcpy(epp->row,b,width*sizeof(short)); + if (EndLineProc) + { + if ((*EndLineProc)(row,row,nrow)) return -1; + } + + } + return 0; +} + + + +int rasterize(DGT *dgt,EPP *fout,EPP *fill,int modulo,int divisor) +{unsigned short *buf,*fillbuf=NULL; + int width,height,firstrow,lastrow,fry,lry; + width=fout->lc-fout->fc; + ncol=width; + nrow=fout->lr-fout->fr; + right_border=(fout->XRight-fout->XLeft)/(dgt->XRight-dgt->XLeft)*65535; + bottom_border=(fout->YBottom-fout->YTop)/(dgt->YBottom-dgt->YTop)*65535; + half_horiz=right_border>>1; + half_vert=bottom_border>>1; + buf=alloc_buffer(width,&height); + if (fill) + { + height>>=1; + fillbuf=buf+height*width; + } + firstrow=fout->fr; + lastrow=fout->fr+height; + do { + if (lastrow>fout->lc) lastrow=fout->lc; + memset(buf,0,width*height*sizeof(short)); + if (fill) memset(fillbuf,0,width*height*sizeof(short)); + reset_dgt(dgt); + fry=absrow2dgt(firstrow); + lry=absrow2dgt(lastrow); + while (!dgt_eof(dgt)) + { if (dgt_is_point(dgt)) + { int y,id,row,col; + if ((y=dgt_pointy(dgt))=fry)) + { if (divisor) id=(dgt_id(dgt)%modulo)/divisor; + else id=dgt_id(dgt); + if (id>65533) + { fprintf(stderr,"Label ID too large. Use -d or -x options\n"); + return 1; + } + if (!id) id=65534; + row=dgt2row(dgt_pointx(dgt)); + col=dgt2col(y); + if (CELL(buf,row,col)) + { printf("%g %g more than one object in same cell\n",alt_xc(fout,col),alt_yc(fout,row)); + } + CELL(buf,row,col)=id; + } + } + else + { if (dgt_yt(dgt)>lry&&dgt_yb(dgt)65533) + { fprintf(stderr,"Line ID too large. Use -d or -x options\n"); + return 1; + } + if (!id) id=65534; + } + /* Now we can begin an actual drawing */ + for (i=1,start=dgt->buffer->s,end=dgt->buffer->s+1; + iy>lry&&end->yyy>lry)) + { POINT rc1,rc2; + if (start->y>end->y) {p1=*end;p2=*start;} + else + {p1=*start;p2=*end;} + if (p1.yfry) + {int xx=(fry-p1.y)*((int)p2.x-p1.x)/((int)p2.y-p1.y)+p1.x; + p2.x=xx; + p2.y=fry; + } + rc2.x=dgt2col(p1.x); + rc2.y=dgt2row(p1.y); + rc1.x=dgt2col(p2.x); + rc1.y=dgt2row(p2.y); + if(rc2.x==rc1.x&&rc2.y==rc1.y) + { CELL(buf,rc1.y,rc1.x)=id; + if (fill) CELL(buf,rc1.y,rc1.x)|=2; + } + else + if ((unsigned long)abs((int)p1.x-p2.x)*bottom_border>(unsigned long)abs((int)p1.y-p2.y)*right_border) + { /* ïÔÒÅÚÏË ÛÉÒÅ ÞÅÍ ÄÌÉÎÎÅÅ */ + int xn,ndx,dy; + if (rc1.x>rc2.x) + { POINT tmp=rc1; + rc1=rc2; + rc2=tmp; + tmp=p1; + p1=p2; + p2=tmp; + } + xn=((int)p1.x+32767)*ncol-half_horiz; + ndx=((int)p2.x-p1.x)*ncol; + dy=(int)p2.y-p1.y; + for (x=rc1.x;x<=rc2.x;x++) + { unsigned long ybig=(32767UL-((right_border*x-xn)*dy/ndx+p1.y))*nrow; + y=ybig/bottom_border+1-firstrow; + CELL(buf,y,x)=id; + if (fill) + { + CELL(fillbuf,y,x)|=ybig%bottom_border>half_vert?4:1; + } + } + } + else + {int yn,ndy,dx; + yn=(32767-(int)p1.y)*nrow-half_vert; + ndy=((int)p2.y-p1.y)*nrow; + dx=(int)p2.x-p1.x; + for (y=rc1.y;y<=rc2.y;y++) + { unsigned long xbig=(32767UL+((yn-bottom_border* + (y-1+firstrow))*dx /ndy+p1.x))*ncol; + x=xbig/right_border; + CELL(buf,y,x)=id; + if (fill) { + CELL(fillbuf,y,x)|=xbig%right_border>half_horiz?8:2; + } + } + } + } + + + } + } + dgt_next(dgt); + } + if (save_buffer(fout,buf,firstrow,lastrow,width)) {free(buf);return 1;}; + if (fill) + if (save_buffer(fill,fillbuf,firstrow,lastrow,width)) {free(buf);return 1;}; + firstrow+=height; + lastrow+=height; + } while(firstrowlc); + free(buf); + return 0; +} +void extract_digits(int base,char *s,int *divisor,int *modulo) +{char *c; + *divisor=0; + *modulo=0; + for (c=s;*c;c++) + switch(*c) + {case '_':if (*modulo&&!*divisor)*divisor=base; + else + *divisor*=base; + *modulo*=base; + break; + case 'x':if(!*modulo) *modulo=base; + else *modulo*=base; + if (*divisor) {fprintf(stderr,"Digits in -d or -x option must form continous range\n"); + exit(1); + } + break; + default: fprintf(stderr,"Parameter of -d or -x option must consist of ``x''-es\n" +"for each digit to use and ``_'' for each digit to ignore\n"); + exit(1); + } + if (*divisor==0) *divisor=1; + if (*modulo/ *divisor>0x10000) + { fprintf(stderr,"EPP file classes cannot contain more than four digits\n"); + exit(1); + } +} + +# ifndef EARLY_UNLINK + +char __tempnames[4][80]; +char *tempnames[]={__tempnames[0],__tempnames[1],__tempnames[2],__tempnames[3]}; +char **tempptr=tempnames; +void store_temp_name(char *name) +{strcpy(*(tempptr++),name); +} +void remove_temp_files() +{while(--tempptr>=tempnames) + { unlink(*tempptr); + } +} + +# endif +char cluster_help[]= +"Usage: cluster [--help] [-version] [-%%8lu] [-o file] [-c color] file\n"; +char rasterize_help[]= +"Usage: rasterize [--help] [-version] [-o file] [-c color] [-s size]\n" +"\t[-x string] [-d string] [-m megabytes] [-%%pu] file\n"; + +int main(int argc,char **argv) +{struct option cluster_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + {"output-file",1,0,'o'}, + {"line-color",1,0,'c'}, + {"8-way",0,0,'8'}, + {"rasterize",0,0,'R'}, + {"labels",0,0,'l'}, + {"unuque",0,0,'u'}, + {NULL,0,0,0}}, + rasterize_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + {"output-file",1,0,'o'}, + {"cell-size",1,0,'s'}, + {"line-color",1,0,'c'}, + {"line-point",0,0,'p'}, + {"digits",1,0,'d'}, + {"hex-digits",1,0,'x'}, + {"unique",0,0,'u'}, + {"memory",1,0,'m'}, + {NULL,0,0,0}}, + *options=cluster_options; + int c,index,expect_vector=0; + char c_opt[]="%o:c:8Rlu", + r_opt[]="%o:c:s:pudxm:", + *optstring=c_opt; + char *basename; + char tempname[1024],outname[1024]=""; + int verbose=0,eight_way=0,do_labels=0,result,maxclass; + EPP *fin,*ffill=NULL,*ftmp1,*ftmp2,*fout; + int modulo=0,divisor=0; + int (*remap)(void)=remap_labels; + double cell_size=0.0; + + if ((basename=strrchr(argv[0],'/'))) + basename++; else basename=argv[0]; + if (!strcmp(basename,"rasterize")) + { optstring=r_opt; options=rasterize_options; + expect_vector=1; + remap=remap_hard_labels; + do_labels=1; + } + while ((c=getopt_long(argc,argv,optstring,options,&index))!=-1) + switch (c) + { + case '%' :verbose=1;break; + case 2 : show_version("cluster","$Revision: 1.1 $"); + case 'o':strcpy(outname,default_ext(optarg,".epp"));break; + case 'R':optstring=r_opt;options=rasterize_options; + remap=remap_hard_labels; + do_labels=1; + expect_vector=1;break; + case 'c':{char *endptr; + line_color=strtol(optarg,&endptr,0); + if (*endptr||line_color<=0||line_color>65535) + { fprintf(stderr,"Invalid line color %s\n",optarg); + exit(1); + } + break; + } + case 'u':if (!expect_vector) is_border=check_border; + else {remap=remap_labels;do_labels=0;} + break; + case '8':if (expect_vector) + {fprintf(stderr,"option -8 is valid only in cluster mode\n"); + exit(1); + } + eight_way=1; + break; + case 'l':if (expect_vector) + {fprintf(stderr,"option -l is valid only in cluster mode\n"); + exit(1); + } + remap=remap_labels;do_labels=1; + break; + case 's':if (!expect_vector) + {fprintf(stderr,"option -%c is valid only in rasterize mode\n",c); + exit(1); + }else + {char *endptr; + cell_size=strtod(optarg,&endptr); + if (*endptr) + { fprintf(stderr,"Invalid cell size value %s\n",optarg); + exit(1); + } + } + break; + case 'p': if (!expect_vector) + {fprintf(stderr,"option -%c is valid only in rasterize mode\n",c); + exit(1); + } + expect_vector=2; + break; + case 'd':if (!expect_vector) + {fprintf(stderr,"option -%c is valid only in rasterize mode\n",c); + exit(1); + } + extract_digits(10,optarg,&divisor,&modulo); + break; + case 'x':if (!expect_vector) + {fprintf(stderr,"option -%c is valid only in rasterize mode\n",c); + exit(1); + } + extract_digits(16,optarg,&divisor,&modulo); + break; + case 'm':if (!expect_vector) + {fprintf(stderr,"option -%c is valid only in rasterize mode\n",c); + exit(1); + }else + {char *endptr; + megabytes=strtol(optarg,&endptr,0); + if (*endptr) + { fprintf(stderr,"Invalid integer value %s\n",optarg); + + exit(1); + } + } + break; + case 1: + case '?': + default: printf(expect_vector?rasterize_help:cluster_help); + exit(c!=1); + } + /***********************************************************/ + if (argc==optind) + {fprintf(stderr,"No input file name given\n"); + exit(1); + } + strcpy(tempname,default_ext(argv[optind],expect_vector?".dgt":".epp")); + if (!*outname) + if (expect_vector) strcpy(outname,force_ext(tempname,".epp")); + else +# ifdef __unix + strcpy(outname,"cluster.out.epp"); +# else + strcpy(outname,"cluster.epp"); +# endif + install_progress_indicator(verbose?show_percent:check_int); + /*** Zero pass,rasterizing **********************************/ + if (expect_vector) + {DGT *dgt=open_dgt(tempname); + int rows,cols; + double XR,YB; + if (!dgt) { fprintf(stderr,"Cannot open file %s\n",tempname); + exit(1); + } + /*calculating file dimensions*/ + if (cell_size==0.0) + { /*no cell size given, defaulting to 1024 cells/line*/ + cell_size=fabs(dgt->XRight-dgt->XLeft)/1024.0; + } + cols=ceil(fabs(dgt->XRight-dgt->XLeft)/cell_size); + rows=ceil(fabs(dgt->YTop-dgt->YBottom)/cell_size); + XR=cols*cell_size; + if (dgt->XRightXLeft) XR=dgt->XLeft-XR; + else XR+=dgt->XLeft; + YB=rows*cell_size; + if (dgt->YTop>dgt->YBottom) YB=dgt->YTop-YB; + else YB+=dgt->YTop; + fprintf(stderr,"EPP file would be %d rows by %d columns\n",rows,cols); + + /*creating outputfile*/ + Create16bit=1; + if(expect_vector==1) + { /*rasterized file would be temporary */ + line_color=65535; + strcpy(tempname,force_ext(tmpnam(NULL),".epp")); + } else + strcpy(tempname,outname); + fin=creat_epp(tempname,1,1,cols,rows,dgt->XLeft,dgt->YTop,XR,YB, + 100,0,0); + + if (!fin) {fprintf(stderr,"Cannot create file %s\n",tempname); + exit(1); + } + if (expect_vector==1) + { Create16bit=0; +#ifdef EARLY_UNLINK + unlink(tempname); +#else + store_temp_name(tempname); +#endif + strcpy(tempname,force_ext(tmpnam(NULL),".epp")); + ffill=creat_epp(tempname,1,1,cols,rows,dgt->XLeft,dgt->YTop,XR,YB, + 100,0,0); + if (!ffill) {fprintf(stderr,"Cannot create file %s\n",tempname); + exit(1); + } +#ifdef EARLY_UNLINK + unlink(tempname); +#else + store_temp_name(tempname); +#endif + } + if (verbose) fprintf(stderr,"Rasterizing...\n"); + if ((result=rasterize(dgt,fin,ffill,modulo,divisor))) + exit(clear_progress(result)); + close_dgt(dgt); + if (expect_vector==2) + { /* nothing more to do - close and exit */ + if (fin->max<=255) + { + if (verbose) fprintf(stderr,"\rConverting to 8 bit\n"); +#ifdef EARLY_UNLINK + unlink(outname); + fast_convert_to_8bit(fin,outname); +#else + strcpy(tempname,force_ext(outname,".8bi")); + fast_convert_to_8bit(fin,tempname); + unlink(outname); + rename(tempname,outname); +#endif + } else close_epp(fin); + exit(clear_progress(result)); + } + else + { reset_epp(fin); + reset_epp(ffill); + } + } else + if (!(fin=open_epp(tempname))) + { fprintf(stderr,"Cannot open file %s",tempname); + exit(1); + } +/*************** First pass -- counting unique contours ***************/ +if (verbose) fprintf(stderr,"\rAssembling polygons...\n"); + + Create16bit=1; + strcpy(tempname,force_ext(tmpnam(NULL),".epp")); + if(!(ftmp1=creat_epp_as(tempname,fin))) + { fprintf(stderr,"Cannot create file %s\n",tempname); + exit(1); + } +#ifdef EARLY_UNLINK + unlink(tempname); +#else + store_temp_name(tempname); +#endif + strcpy(tempname,default_ext(tmpnam(NULL),".epp")); + if(!(ftmp2=creat_epp_as(tempname,fin))) + { fprintf(stderr,"Cannot create file %s\n",tempname); + exit(1); + } +#ifdef EARLY_UNLINK + unlink(tempname); +#else + store_temp_name(tempname); +#endif + if (!expect_vector&&(is_border==check_border))line_color=fin->offsite; + if((result=first_pass(fin,ftmp1,ftmp2,eight_way,do_labels))) + exit(clear_progress(result)); +/**** creating correspondence table *************/ + if (verbose) {fputc('\r',stderr);fflush(stderr);} + maxclass=remap(); +/************* Second pass -- creating final file *****************/ +fout=creat_epp_as(outname,ftmp1); +if (do_labels) fout->offsite=Create16bit?65535:255; +if (verbose) fprintf(stderr,"\rWriting final file...\n"); +if (ffill) + result=second_pass_fill(ftmp1,ftmp2,ffill,fout); +else + result=second_pass(ftmp1,ftmp2,fout); + fout->max=maxclass; +close_epp(fout); +#ifndef EARLY_UNLINK + remove_temp_files(); +#endif +return(clear_progress(result)); +} diff --git a/epu/dgt2gen b/epu/dgt2gen new file mode 100755 index 0000000..699239d Binary files /dev/null and b/epu/dgt2gen differ diff --git a/epu/dgt2gen.c b/epu/dgt2gen.c new file mode 100644 index 0000000..9329ea5 --- /dev/null +++ b/epu/dgt2gen.c @@ -0,0 +1,128 @@ +#include +#include +#include "dgt.h" +#include "math.h" +#include "eppl_ut.h" +#include +FILE *lines,*points; +long int linecount=0,pointcount=0; +char line_feed[3]="\n"; +void putreal(FILE *f,double x) +{ + if (fabs(x)>1000000000.0||fabs(x)<0.01) + fprintf(f,"%13E",x); + else + if (fabs(x)<10.0) + fprintf(f,"%13.10f",x); + else + if (fabs(x)<1000.0) + fprintf(f,"%13.8f",x); + else if(fabs(x)<1000000.0) + fprintf(f,"%13.5f",x); + else + fprintf(f,"%13.2f",x); +} +void putpoint(FILE *f,DGT *dgt,POINT p) +{ putreal(f,real_x(dgt,p.x)); + fputc(' ',f); + putreal(f,real_y(dgt,p.y)); + fputs(line_feed,f); +} + +void putline(DGT* dgt) +{int i; + fprintf(lines,"%ld%s",dgt_id(dgt),line_feed); + for(i=0;i +/*#define LSB_FIRST 1*/ +#ifdef LSB_FIRST +/* portability issues when reading binary files */ +/* define LSB_FIRST, when your processor uses Intel byte order */ +# define COPY_DOUBLE(x) x +# define COPY_LONG(x) x +# define COPY_SHORT(x) x +#else +# define COPY_DOUBLE(x) swapdouble(x) +# define COPY_LONG(x) swaplong(x) +# define COPY_SHORT(x) swapshort(x) +#endif +#include +#include +#include +#include + +#define DO_XSHIFT 1 +#define DO_YSHIFT 2 +#define DO_SCALE 4 +#define RESCALING 7 +#define SET_X_LEFT 0x10 +#define SET_X_RIGHT 0x20 +#define SET_Y_BOTTOM 0x40 +#define SET_Y_TOP 0x80 +#define SET_PRJ 8 +#define DGT_OPS 0xFF +#define EXPLICIT_COORDS 0xF0 +#define SET_FR 0x100 +#define SET_FC 0x200 +#define EXPLICIT_ROW_COL 0x300 +#define DO_ALIGN 0x400 +#define SET_AREA 0x800 +#define SET_COMMENT 0x1000 +#define SET_UNIT 0x2000 +#define SET_OFFSITE 0x4000 +#define VERBOSE_MODE 0x8000 +#define MAX_PROJECTION 3 +#define MAX_UNIT 5 + +long operations=0;/* Bit mask of operations to apply */ +void usage(int return_code) +{ printf( +"Usage eheader options files\n\ +where options may be:\n\ +These are applicable to both EPP and DGT files:\n\ +-x n - shifts alternative x by n\n\ +-y n - same with alternative y\n\ +-s factor - multiplies all coordinates by factor\n\ +-Xl n - sets alternative x of left border to specified value\n\ +-Xr n - same with right border\n\ +-Yb n, Yt - same with bottom and top y\n\ +-p xxx - set projection type, where projection can be:\n\ +\tnone - cause EPPL ver 3 to say \"No alternate coordinates\"\n\ +\tutm - UTM projection\n\ +\tstplate - state plane\n\ +\tll - geographic coordinates\n\ +Following is applicable to EPP files only:\n\ +-o n - set offsite value\n\ +-fr n - set first row to n\n\ +-fc n - set first column to n\n\ +-A filename - align to specified file\n\ +-a n - set cell area\n\ +-c \"string\" - set description\n\ +-u xxx - set area unit type, where unit type may be:\n\ +\tnone - cause EPPL ver 3 to say \"No alternate coordinates\"\n\ +\tft - square feet\n\ +\tm - square meters\n\ +\tkm - square kilometers\n\ +\tmile - square miles\n\ +\tha - hectares\n\ +\tacre - acres\n"); + exit(return_code); +} + +int get_epp_header(FILE *f,EPPHEADER *hdr); +int put_epp_header(FILE *f,EPPHEADER *hdr); +int get_dgt_header(FILE *f,EPPHEADER *hdr,long *maxline,long *maxpt); +int put_dgt_header(FILE *f,EPPHEADER *hdr); +void main(int argc,char **argv) +{ int i=1; + char *progname; + int option(int *num,char **argv); + void process_file(const char *filename); + void read_align_values(const char *filename); + if (argc==1) usage(0); +progname=strrchr(argv[0],'/'); +if (progname==NULL) progname=argv[0]; +else progname++; + if (!strcmp(progname,"maplist")) + operations|=VERBOSE_MODE; + else + if (!strcmp(progname,"mapalign")) + { operations|=DO_ALIGN; + if (!strcmp(argv[1],"-v")) {operations|=VERBOSE_MODE;i++;} + read_align_values(argv[i++]); + if (!strcmp(argv[i],"-v")) {operations|=VERBOSE_MODE;i++;} + } + else + while (argv[i]&&(argv[i][0]=='-')) + { if (!option(&i,argv)) + { fprintf(stderr,"Unknown option :%s\n",argv[i]); + exit(1); + } + } + for(;i32767) offsite=65536-offsite; + if (offsite<-32768) + { fprintf(stderr,"Invalid offsite value %s\n",argv[*num]); + exit(1); + } + break; + } + case 's' : { check_key(argv[(*num)],DO_SCALE,EXPLICIT_COORDS); + scale_fact=double_value(argv[++(*num)]); + break; + } + case 'f': { switch((argv[(*num)])[2]) + { case 'r':{ check_key(argv[(*num)],SET_FR,DO_ALIGN); + fr=int_value(argv[++(*num)]); + break; + } + case 'c':{ check_key(argv[(*num)],SET_FC,DO_ALIGN); + fc=int_value(argv[++(*num)]); + break; + } + default: { fprintf(stderr,"Invalid option %s\n",argv[(*num)]); + exit(1); + } + break; + } + break; + } + case 'a':{ check_key(argv[(*num)],SET_AREA,RESCALING|EXPLICIT_COORDS); + area_val=double_value(argv[++(*num)]); + break; + } + case 'A':{ check_key(argv[(*num)],DO_ALIGN,EXPLICIT_ROW_COL); + read_align_values(argv[++(*num)]); + break; + } + case 'c':{check_key(argv[(*num)],SET_COMMENT,0); + strncpy(header,argv[++(*num)],32); + break; + } + case 'u':{check_key(argv[(*num)],SET_UNIT,0); + (*num)++; + if (!strcmp(argv[(*num)],"none")) + { unit=0; } + else + if (!strcmp(argv[(*num)],"ft")) + { unit=1; } + else + if (!strcmp(argv[(*num)],"m")) + { unit=2; } + else + if (!strcmp(argv[(*num)],"km")) + { unit=3; } + else + if (!strcmp(argv[(*num)],"mile")) + { unit=4; } + else + if (!strcmp(argv[(*num)],"ha")) + { unit=5; } + else + if (!strcmp(argv[(*num)],"acre")) + { unit=6; } + else + { fprintf(stderr,"Invalid area unit %s\n",argv[(*num)]); + exit(1); + } + break; + } +case 'v': { operations|=VERBOSE_MODE; + break; + } +default: { return 0; + } +} + +(*num)++; +return 1; +} + +int get_epp_header(FILE *f,EPPHEADER *hdr) +{ EPPHEADER buf; + if (fseek(f,0,SEEK_SET)) return 0; + if (!fread(&buf,sizeof(buf),1,f)) return 0; + hdr->kind=COPY_SHORT(buf.kind); + if ((hdr->kind!=8)&&(hdr->kind!=16)) return 0; +hdr->fr = COPY_SHORT(buf.fr); +hdr->lr = COPY_SHORT(buf.lr); +hdr->fc = COPY_SHORT(buf.fc); +hdr->lc = COPY_SHORT(buf.lc); +hdr->fry = COPY_DOUBLE(buf.fry); +hdr->lry = COPY_DOUBLE(buf.lry); +hdr->fcx = COPY_DOUBLE(buf.fcx); +hdr->lcx = COPY_DOUBLE(buf.lcx); +hdr->kind = COPY_SHORT(buf.kind); +hdr->base = COPY_SHORT(buf.base); +hdr->scale = COPY_SHORT(buf.scale); +hdr->offsite = COPY_SHORT(buf.offsite); +hdr->sfact = COPY_DOUBLE(buf.sfact); +hdr->access_ptr = COPY_LONG(buf.access_ptr); +hdr->minclass = COPY_SHORT(buf.minclass); +hdr->maxclass = COPY_SHORT(buf.maxclass); +hdr->area_unit =(buf.area_unit); +hdr->coord_sys =(buf.coord_sys); +memcpy(&(hdr->date),&(buf.date),16+8+32); +return 1; +} +int put_epp_header(FILE *f,EPPHEADER *hdr) +{ EPPHEADER buf; + if (fseek(f,0,SEEK_SET)) return 0; +memset(&buf,0x20,128); +buf.kind=COPY_SHORT(hdr->kind); +buf.fr = COPY_SHORT(hdr->fr); +buf.lr = COPY_SHORT(hdr->lr); +buf.fc = COPY_SHORT(hdr->fc); +buf.lc = COPY_SHORT(hdr->lc); +buf.fry = COPY_DOUBLE(hdr->fry); +buf.lry = COPY_DOUBLE(hdr->lry); +buf.fcx = COPY_DOUBLE(hdr->fcx); +buf.lcx = COPY_DOUBLE(hdr->lcx); +buf.kind = COPY_SHORT(hdr->kind); +buf.base = COPY_SHORT(hdr->base); +buf.scale = COPY_SHORT(hdr->scale); +buf.offsite = COPY_SHORT(hdr->offsite); +buf.sfact = COPY_DOUBLE(hdr->sfact); +buf.access_ptr = COPY_LONG(hdr->access_ptr); +buf.minclass = COPY_SHORT(hdr->minclass); +buf.maxclass = COPY_SHORT(hdr->maxclass); +buf.area_unit =(hdr->area_unit); +buf.coord_sys =(hdr->coord_sys); +memcpy(&(buf.date),&(hdr->date),16+8+32); +{int i; + for(i=strlen(buf.date);i<16;buf.date[i++]=' '); + for(i=strlen(buf.time);i<8;buf.time[i++]=' '); + for(i=strlen(buf.comment);i<32;buf.comment[i++]=' '); +} +return fwrite(&buf,sizeof(buf),1,f); +} +int get_dgt_header(FILE *f,EPPHEADER *hdr,long *maxline,long *maxpt) +{ DGTHEADER buf; + if (fseek(f,0,SEEK_SET)) return 0; + if (!fread(&buf,sizeof(buf),1,f)) return 0; + hdr->fry = COPY_DOUBLE(buf.ytop); + hdr->lry = COPY_DOUBLE(buf.ybottom); + hdr->fcx = COPY_DOUBLE(buf.xleft); + hdr->lcx = COPY_DOUBLE(buf.xright); + hdr->coord_sys =(buf.coord_sys); + *maxline=COPY_LONG(buf.maxline); + *maxpt=COPY_LONG(buf.maxpt); + return 1; +} +int put_dgt_header(FILE *f,EPPHEADER *hdr) +{ DGTHEADER buf; + if (fseek(f,0,SEEK_SET)) return 0; + fread(&buf,sizeof(buf),1,f); + if (fseek(f,0,SEEK_SET)) return 0; + buf.ytop = COPY_DOUBLE(hdr->fry); + buf.ybottom = COPY_DOUBLE(hdr->lry); + buf.xleft = COPY_DOUBLE(hdr->fcx); + buf.xright = COPY_DOUBLE(hdr->lcx); + buf.coord_sys =(hdr->coord_sys); + return fwrite(&buf,sizeof(buf),1,f); +} +char *coord_name[]={"Alternative","UTM","State plane","Geographic"}; +char *unit_name[]={"unknown units","sq.feet","sq.m","sq.km","sq.miles","ha","acres"}; +void print_epp_header(const char *filename,EPPHEADER hdr) +{ char commentstr[33],datestr[17],timestr[9]; + commentstr[32]=datestr[16]=timestr[8]='\0'; + strncpy(datestr,hdr.date,16); + strncpy(timestr,hdr.time,8); + if ((unsigned char)hdr.area_unit>6) hdr.area_unit=0; + if ((unsigned char)hdr.coord_sys>3) hdr.coord_sys=0; + printf("File:%s\n\ +Description:%s\n\ +First row = %6d Last row = %6d\n\ +First column = %6d Last column = %6d\n\ +%s coordinates:\nFirst row = %12g Last row = %12g\n\ +First column = %12g Last column = %12g\n\ +Cell area: %12g %s\n\ +Created: %s %s\n\ +Data size = %d\n\ +Minimum class = %d, Maximum class = %d, Offsite class = %d\n", +filename,strncpy(commentstr,hdr.comment,32), +hdr.fr,hdr.lr,hdr.fc,hdr.lc,coord_name[(int)hdr.coord_sys], +hdr.fry,hdr.lry,hdr.fcx,hdr.lcx,hdr.sfact,unit_name[(int)hdr.area_unit], +datestr,timestr,hdr.kind, +hdr.minclass,hdr.maxclass,hdr.offsite); +} +void print_dgt_header(const char*filename,EPPHEADER hdr,long maxline,long maxpt) +{ printf("File: %s\n\ +%s coordinates:\n\ +Xleft = %12g, XRight = %12g\n\ +Ytop = %12g, YBottom = %12g\n\ +Maximum point id = %ld, Maximum line id = %ld\n", +filename,coord_name[(int)hdr.coord_sys],hdr.fcx,hdr.lcx,hdr.fry,hdr.lry, +maxline,maxpt); +} +void set_row( EPPHEADER *hdr,int row) +{ + hdr->lr=hdr->lr-hdr->fr+row; + hdr->fr=row; +} +void set_column( EPPHEADER *hdr,int column) +{ + hdr->lc=hdr->lc-hdr->fc+column; + hdr->fc=column; +} +int align(EPPHEADER *hdr,const char *name) +{ double cw,sfx,sfy; + int new_row,new_col; + cw=(align_val.XRight-align_val.XLeft)/(align_val.lc-align_val.fc+1); + sfx=cw/((hdr->lcx-hdr->fcx)/(hdr->lc-hdr->fc+1)); + cw=(align_val.YBottom-align_val.YTop)/(align_val.lr-align_val.fr+1); + sfy=cw/((hdr->lry-hdr->fry)/(hdr->lr-hdr->fr+1)); + if (fabs(sfx-1)>(1.0/(hdr->lc-hdr->fc+1))||fabs(sfy-1)>(1.0/(hdr->lr-hdr->fr+1))) + { fprintf(stderr,"Unable to align file %s.\nRescale it with X factor %7.4f and Y factor %7.4f\n", + name,sfx,sfy); + return 0;} + + new_col=(hdr->fcx-align_val.XLeft)/(align_val.XRight-align_val.XLeft)* + (align_val.lc-align_val.fc+1); + new_col+=align_val.fc; + new_row=(hdr->fry-align_val.YTop)/(align_val.YBottom-align_val.YTop)* + (align_val.lr-align_val.fr+1); + new_row+=align_val.fr; + set_row(hdr,new_row); + set_column(hdr,new_col); + return 1; +} +void process_file(const char *filename) +{ FILE *f; + EPPHEADER hdr; + long maxline,maxpt; + int isdgt; + char ext[8]; + int readonly=0; + strncpy(ext,filename+(strlen(filename)-3),4); + #ifdef __MSDOS__ + strlwr(ext);/* dos filenames are not case-sensitive */ + #endif + isdgt=0; + if (!strcmp(ext,"dgt")||!strcmp(ext,"DGT")) + { if (!(operations&(DGT_OPS|VERBOSE_MODE))) + { fprintf(stderr,"No operations to apply to %s\n",filename); + return; + } + isdgt=1; + } + else + if (strcmp(ext,"epp")&&strcmp(ext,"EPP")) + { fprintf(stderr,"File %s has unknown extension\n",filename); + return; + } + f=fopen(filename,"r+b"); + if (NULL==f) + if (NULL==(f=fopen(filename,"rb"))) + { + fprintf(stderr,"Cannot open file %s\n",filename); + return; + } else readonly=1; + if (!(isdgt?get_dgt_header(f,&hdr,&maxline,&maxpt):get_epp_header(f,&hdr))) + { fprintf(stderr,"invalid %s file %s\n",ext,filename); + return; + } + if (hdr.coord_sys>MAX_PROJECTION) + hdr.coord_sys=0; + if (!isdgt) + { if (hdr.area_unit>MAX_UNIT) + hdr.area_unit=0; + if (hdr.kind==8) + { if (hdr.maxclass>255) hdr.maxclass=255; + if (hdr.minclass>hdr.maxclass) hdr.minclass=0; + } + } + /****************** Applying requested operations *****************/ + if (operations & DO_XSHIFT) + { hdr.fcx+=x_shift; + hdr.lcx+=x_shift; + } + if (operations & DO_YSHIFT) + { hdr.fry+=y_shift; + hdr.lry+=y_shift; + } + if (operations & DO_SCALE) + { hdr.fcx*=scale_fact; + hdr.fry*=scale_fact; + hdr.lcx*=scale_fact; + hdr.lry*=scale_fact; + } + if (operations & SET_X_LEFT) hdr.fcx=XLeft; + if (operations & SET_X_RIGHT) hdr.lcx=XRight; + if (operations & SET_Y_BOTTOM) hdr.lry=YBottom; + if (operations & SET_Y_TOP) hdr.fry=YTop; + if (operations & SET_PRJ) hdr.coord_sys=proj; + if (!isdgt &&(operations & SET_FR)) set_row(&hdr,fr); + if (!isdgt &&(operations & SET_FC)) set_column(&hdr,fc); + if (!isdgt &&(operations & DO_ALIGN)) align(&hdr,filename); + if (!isdgt &&(operations & SET_AREA)) hdr.sfact=area_val; + if (!isdgt &&(operations & SET_COMMENT)) + { char *src=header; + char *dest=hdr.comment; + int count=0; + memset(&(hdr.comment),' ',32); + while (*src!='\0'&&count++<32) *(dest++)=*(src++); + } + if (!isdgt &&(operations & SET_UNIT )) hdr.area_unit=unit; + if (!isdgt &&(operations & SET_OFFSITE )) + +if (hdr.kind==16||(offsite<=255&&offsite>=-1))hdr.offsite=offsite; + else + hdr.offsite=-1; + /******************** End of operations ***************************/ + if (operations & VERBOSE_MODE ) + { if (readonly) printf("Read-only "); + if (isdgt) + print_dgt_header(filename,hdr,maxline,maxpt); + else + print_epp_header(filename,hdr); + } +if ((operations& ~VERBOSE_MODE)&& !readonly) + if (!(isdgt?put_dgt_header(f,&hdr):put_epp_header(f,&hdr))) + { fprintf(stderr,"Cannot modify file %s\n",filename); + clearerr(f); + } + fclose(f); +} diff --git a/epu/extents.c b/epu/extents.c new file mode 100644 index 0000000..d23f28f --- /dev/null +++ b/epu/extents.c @@ -0,0 +1,187 @@ +#include +#include +#include "epp.h" +#include "eppl_ut.h" +typedef struct Contour {int Class,XMin,YMin,XMax,YMax,Count;} CONTOUR; +/* ÏÐÉÓÁÎÉÅ ÏÄÎÏÇÏ ËÏÎÔÕÒÁ */ +CONTOUR *a; +EPP *epp; +EPPHEADER *h; +int first_class; /* ÄÌÑ ÐÅÒÅÓÞÅÔÁ */ + +int sort_area(const void *p1, const void *p2) +/* óÒÁ×ÎÅÎÉÅ ÐÏ ÐÌÏÝÁÄÉ */ +{ +int t1,t2; +t1=(((CONTOUR *)p1))->Count; +t2=(((CONTOUR *)p2))->Count; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} + +int sort_y_top(const void *p1, const void *p2) +/* óÒÁ×ÎÅÎÉÅ ÐÏ ×ÅÒÈÎÅÊ ÇÒÁÎÉÃÅ */ +{ +int t1, t2; +t1=((CONTOUR *)p1)->YMin; +t2=((CONTOUR *)p2)->YMin; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} + +int sort_y_bottom(const void *p1, const void *p2) +{ +int t1, t2; +t1=((CONTOUR *)p1)->YMax; +t2=((CONTOUR *)p2)->YMax; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} +int sort_x_right(const void *p1, const void *p2) +{ +int t1, t2; +t1=((CONTOUR *)p1)->XMax; +t2=((CONTOUR *)p2)->XMax; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} +int sort_x_left(const void *p1, const void *p2) +{ +int t1, t2; +t1=((CONTOUR *)p1)->XMin; +t2=((CONTOUR *)p2)->XMin; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} + +int sort_x(const void *p1, const void *p2) +/* óÒÁ×ÎÅÎÉÅ ÐÏ ÓÒÅÄÎÅÍÕ X */ +{ +int t1, t2; +t1=((CONTOUR *)p1)->XMin+((CONTOUR *)p1)->XMax; +t2=((CONTOUR *)p2)->XMin+((CONTOUR *)p2)->XMax; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} + +int sort_y(const void *p1, const void *p2) +/* óÒÁ×ÎÅÎÉÅ ÐÏ ÓÒÅÄÎÅÍÕ Y */ +{ +int t1, t2; +t1=((CONTOUR *)p1)->YMin+((CONTOUR *)p1)->YMax; +t2=((CONTOUR *)p2)->YMin+((CONTOUR *)p2)->YMax; +if (t1>t2) return 1; +if (t1==t2) return 0; +return -1; +} + +/*int sort_s(const void *p1, const void *p2)*/ +/* óÒÁ×ÎÅÎÉÅ ÐÏ ÏÔÎÏÛÅÎÉÀ count/(W*H) */ +/*{ +}*/ + + + +int process_cell(int col,int row, int value) +{ +CONTOUR *b=a+value; +if (b->XMin>col) b->XMin=col; +if (b->XMaxXMax=col; +if (b->YMin>row) b->YMin=row; +if (b->YMaxYMax=row; +b->Count++; +return 0; +} + +int main(int argc,char **argv) +{ +int (*sort_function)(const void *,const void *)=NULL; +/*òÁÚÂÏÒ ÐÁÒÁÍÅÔÒÏ× ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ*/ +struct option longoptions[]={ +{"help",0,0,1}, +{"version",0,0,2}, +{"verbose",0,0,'%'}, +{"alt-coords",0,0,'a'}, +{"sort-left",0,0,'l'}, +{"sort-right",0,0,'r'}, +{"sort-top",0,0,'t'}, +{"sort-bottom",0,0,'b'}, +{"sort-area",0,0,'A'}, +{"sort-x-center",0,0,'x'}, +{"sort-y-center",0,0,'y'}, +{"output-file",1,0,'o'}, +{"header",0,0,'h'}, +{NULL,0,0,0} +}; +int c,index,i; +int verbose=0; +int use_alt=0; +int print_header=0; +CONTOUR *b; +FILE *f=stdout; +while((c=getopt_long(argc,argv,"alrtbxyA%ho:",longoptions,&index))!=-1) + switch(c) + { case 2:show_version("extents","$Revision: 1.1 $"); + case '%': verbose=1; break; + case 'a': use_alt=1;break; + case 'o': if (!(f=fopen(optarg,"w"))) + {fprintf(stderr,"Cannot open file %s\n",optarg); return 2;} + break; + case 'l':sort_function=sort_x_left; break; + case 'r':sort_function=sort_x_right; break; + case 't':sort_function=sort_y_top; break; + case 'b':sort_function=sort_y_bottom; break; + case 'x':sort_function=sort_x; break; + case 'y':sort_function=sort_y; break; + case 'A':sort_function=sort_area; break; + case 'h':print_header=1;break; + case 1: + case '?': + default: printf("Usage: extents [-%%alrtbxtA] [-o file] file.epp\n"); + return c!=1; + } + + +/*ïÔËÒÙÔØ epp-ÛÎÉË, ÐÒÏÞÉÔÁÔØ ÚÁÇÏÌÏ×ÏË, ÓÏÚÄÁÔØ ÍÁÓÓÉ× CONTOUR ÄÌÉÎÙ +*/ +epp=open_epp(default_ext(argv[optind],".epp")); +if(epp==NULL) {fprintf(stderr,"Can not open file %s\n", + default_ext(argv[optind],".epp")); + return 2;} +a=calloc(sizeof(CONTOUR),epp->max+1); +for(i=0,b=a;i<=epp->max;i++,b++) +{ b->XMin=epp->lc; + b->XMax=epp->fc; + b->YMin=epp->lr; + b->YMax=epp->fr; + b->Class=i; +} +install_progress_indicator(verbose?show_percent:check_int); +if (clear_progress(for_each_cell(epp,process_cell))) return 3; +if (sort_function) qsort(a,epp->max+1,sizeof(CONTOUR),sort_function); +if (print_header) + fprintf(f,use_alt? +" Class X Left X Right Y Top Y Bottom Area\n": +" Class Min Col Max Col Min Row Max Row Count\n"); +for(i=0;i<=epp->max;i++) + if (a[i].Count) + { if (use_alt) + fprintf(f,"%6d %13g %13g %13g %13g %14g\n", + a[i].Class,alt_x(epp,a[i].XMin),alt_x(epp,a[i].XMax+1), + alt_y(epp,a[i].YMin),alt_y(epp,a[i].YMax+1), + a[i].Count*epp->cell_area); + else + fprintf(f,"%6d %7d %7d %7d %7d %9d\n", + a[i].Class,a[i].XMin,a[i].XMax,a[i].YMin,a[i].YMax,a[i].Count); + } + +close_epp(epp); +if (f!=stdout) fclose(f); +return 0; +} diff --git a/epu/fill.c b/epu/fill.c new file mode 100644 index 0000000..afa35e0 --- /dev/null +++ b/epu/fill.c @@ -0,0 +1,157 @@ +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +int color_to_fill=0; +int color_to_not_expand=-1;/* 1 in eppl */ +int cells_filled,cells_remain; +int verbose=0; +int gap_size=0; +void add_color(int color,int *col_list,int *col_count,int *list_len) +{ int i; + if(color==color_to_fill||color==color_to_not_expand) return; + for (i=0;i<*list_len;i++,col_list++,col_count++) + if (color==col_list[i]) {col_count[i]++;return;} + *col_list=color;*col_count=1;(*list_len)++; +} +#define addcolor(i) add_color(i,color,count,&cc); +void fillrow(unsigned short *out_row,unsigned short *prev_row, + unsigned short *cur_row,unsigned short *next_row, + int ncols) +{ int i; + for (i=1;i<=ncols;i++) + if (cur_row[i]!=color_to_fill) *(out_row++)=cur_row[i]; + else + { int color[8],count[8],ii,jj,cc=0,cnt=0; + unsigned short *clr_ptr=prev_row+i-1; + addcolor(*(clr_ptr++)); + addcolor(*(clr_ptr++)); + addcolor(*(clr_ptr++)); + addcolor(cur_row[i-1]); + addcolor(cur_row[i+1]); + addcolor(*(clr_ptr=next_row+i-1)); + addcolor(*(++clr_ptr)); + addcolor(*(++clr_ptr)); + for(ii=0,jj=color_to_fill;iicnt) {cnt=count[ii];jj=color[ii];} + if (jj==color_to_fill) + {cells_remain++;*(out_row++)=color_to_fill;} + else + {cells_filled++;*(out_row++)=jj;}; + } +} +int fill(char *in_file_name,char *out_file_name) +{ unsigned short int *prev_row,*cur_row,*next_row,*rptr,*dest; + int i,j,nrows,seqrow,ncols; + EPP *in_file; + EPP *out_file; + + cells_filled=0; + cells_remain=0; + + in_file=open_epp(in_file_name); + if (NULL==in_file) + { fprintf(stderr,"Cannot open file %s\n",in_file_name); + exit(2); + } + Create16bit=in_file->kind==16; + out_file=creat_epp_as(out_file_name,in_file); + if (NULL==out_file) + { fprintf(stderr,"Cannt create file %s\n",out_file_name); + exit(2); + } + ncols=in_file->lc-in_file->fc; + prev_row=malloc(sizeof(short)*(ncols+2)); + cur_row=malloc(sizeof(short)*(ncols+2)); + next_row=malloc(sizeof(short)*(ncols+2)); + for(i=0;i<=ncols+1;prev_row[i++]=color_to_fill); + cur_row[0]=cur_row[ncols+1]=next_row[0]=next_row[ncols+1]=color_to_fill; + rptr=epp_getline(in_file,in_file->fc,in_file->fr); + for(i=1,dest=cur_row+1;i<=ncols;*(dest++)=*(rptr++),i++); + rptr=epp_getline(in_file,in_file->fc,in_file->fr+1); + for(i=1,dest=next_row+1;i<=ncols;*(dest++)=*(rptr++),i++); + nrows=in_file->lr-in_file->fr; + for(seqrow=1,i=in_file->fr+2;seqrow<=nrows;i++,seqrow++) + { + if (EndLineProc) + if ((*EndLineProc)(i,seqrow,nrows)) return 1; + epp_put(out_file,out_file->fc,i-2,out_file->offsite); + fillrow(out_file->row,prev_row,cur_row,next_row,ncols); + {unsigned short int *tmp; + tmp=prev_row; + prev_row=cur_row; + cur_row=next_row; + next_row=tmp; + } + if (ilr) + { rptr=epp_getline(in_file,in_file->fc,i); + for(j=1,dest=next_row+1;j<=ncols;*(dest++)=*(rptr++),j++); + } + else + for(j=1,dest=next_row+1;j<=ncols;*(dest++)=color_to_fill,j++); +} +out_file->max=in_file->max; +out_file->min=in_file->min; +close_epp(out_file); +close_epp(in_file); +return 0; +} +int main(int argc,char **argv) +{ +#ifdef unix + char out_name[256]="fill.out.epp"; +#else + char out_name[256]="fill.epp"; +#endif + struct option long_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + {"gap-size",required_argument,0,'g'}, + {"color-to-fill",required_argument,0,'f'}, + {"exclude-color",required_argument,0,'x'}, + {"output-file",required_argument,0,'o'}, + {NULL,0,0,0} }; + int c; + int index; + while ((c=getopt_long(argc,argv,"%g:c:f:x:o:",long_options,&index))!=-1) + { switch(c) + { + case 2:/*version*/ + show_version("fill","$Revision: 1.1 $"); + + case '%':verbose=1;break; + case 'g':/*gap size is unused now*/ + gap_size=atoi(optarg);break; + case 'c':/*color to fill*/ + color_to_fill=atoi(optarg);break; + case 'x':color_to_not_expand=atoi(optarg);break; + case 'o':strcpy(out_name,optarg);break; + case 1: + case '?': + default: + /*help*/ + printf("Usage %s [--help] [--version] [-v] [-g gap size]\n" + "\t[-c color to fill] [-x color to exclude] [-o output file]\n" + "\tepp file\n",argv[0]); + return c==1?0:2; + } + } + if (argc==optind) + {fprintf(stderr,"No input files specified\n"); + return 2; + } + if (argc>optind+1) + { fprintf(stderr,"Too many input files\n"); + return 2; + } + install_progress_indicator(verbose?show_percent:check_int); + if((c=clear_progress(fill(argv[optind],out_name)))) + {unlink(out_name); + return 2; + } + printf("Cells filled %d\nCells of class %d remain:%d\n", + cells_filled,color_to_fill,cells_remain); + return cells_remain?1:0; +} diff --git a/epu/intable b/epu/intable new file mode 100755 index 0000000..99482a1 Binary files /dev/null and b/epu/intable differ diff --git a/epu/intable.c b/epu/intable.c new file mode 100644 index 0000000..25c1251 --- /dev/null +++ b/epu/intable.c @@ -0,0 +1,252 @@ +#include +#include +#include +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +struct record { + unsigned short int outclass; + unsigned short int classes[32]; + }; +typedef struct record *rec; + +void help(int exitcode) +{ printf("Usage: intable [-%%] [-i] [-o file] [-f file] [-O value] [-u value] files\n"); + exit(exitcode); +} + +short int* table; + +EPP *files[32]; +char skip[32]={0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,}; +int files_count,count,limit,delta; +int skip_count=0; +char delimiter=','; + +int offsite=-1; +int unmatched=-1; + +int compare(struct record *r1, struct record *r2) +{int i; + for (i=0;iclasses[i]>r2->classes[i]) return 1; + else + if (r1->classes[i]classes[i]) return -1; + } + return 0; + +} +int search(struct record *key,int *index) +{int l=0,h=count-1,i,c; + while(l<=h) + { i=(l+h)>>1; + c=compare((struct record *)(table+(1+files_count)*i),key); + if (c<0) l=i+1; + else + { h=i-1; + if (!c) { *index=i;return 1;} + } + } + *index=l; + return 0; +} +void insert(struct record *key,int index) +{ int i;unsigned short int *l; + if (count==limit) + { + table=realloc(table,(limit+=delta)*(1+files_count)*sizeof(short int)); + if (!table) + { fprintf(stderr,"Couldn't realloc table. Table limit is %d\n",limit); + exit(1); + } + } + + for(i=count;i>index;i--) + memcpy(table+(i)*(1+files_count),table+(i-1)*(1+files_count), + (1+files_count)*sizeof(short int)); + l=(unsigned short int *)(table+index*(1+files_count)); + memcpy(l,key,(files_count+1)*sizeof(short int)); + count++; +} +void setvalue(int index,int value) +{ + unsigned short int *l=(unsigned short int *)(table+index*(1+files_count)); + *l=value; +} +int lineno=0; +int add_record(FILE *f) +{ /* ÷ÏÚ×ÒÁÝÁÅÔ 0, ÅÓÌÉ ÔÁËÁÑ ËÏÍÂÉÎÁÃÉÑ ÕÖÅ ÅÓÔØ*/ + struct record tmp; + char *endptr; + char line[256]; + int i,v,j; + endptr=fgets(line,256,f); + if (!endptr) return 1; + lineno++; + for(i=0,j=0;imin||v>files[i]->max)&&v!=files[i]->offsite) */ + if (v<0||v>65535) + { fprintf(stderr,"Illegal value %d in column %d of line %d\n", + v,i+1,lineno); + exit(2); + } + if (!skip[i]) + tmp.classes[j++]=v; + } + v=strtol(endptr,&endptr,0); + while (*endptr==' '||*endptr=='\t')endptr++; + if(*endptr!='\n') + { fprintf(stderr,"Extra data in line %d\n",lineno); + exit(2); + } + if (v<0||v>65535) + { fprintf(stderr,"Illegal value %d in column %d of line %d\n", + v,files_count+1,lineno); + exit(2); + } + tmp.outclass=v; + if (v>255) Create16bit=1; + if (search(&tmp,&i)) + { setvalue(i,v); return 0;} + else + { insert(&tmp,i); return 1;} +} + +int make_cell(int x,int y,int value) +{ struct record tmp; + int i;EPP **epp; + for(i=0,epp=files;i65535) + { fprintf(stderr,"Invalid class value %s\n",s); + exit(2); + } + return tmp; +} + +int main(int argc,char **argv) +{ struct option long_options[]={ +{"help",0,0,1}, +{"version",0,0,2}, +{"verbose",0,0,'%'}, +{"delimiter",1,0,'d'}, +{"input-file",1,0,'f'}, +{"output-file",1,0,'o'}, +{"offsite",1,0,'O'}, +{"unmatched",1,0,'u'}, +{"skip",1,0,3}, +{"ignore-dupes",0,0,'i'}, +{NULL,0,0,0} +}; +char outname[1024]="intable.out.epp"; +int index,c,i; +int ignore_dupes=0,verbose=0; +FILE *f=stdin; +EPP *new_file,**epp; +while ((c=getopt_long(argc,argv,"%iu:d:f:o:O:129456789", + long_options,&index))!=-1) +switch(c) +{case 2:show_version("intable","$Revision: 1.1 $"); + case '%':verbose=1;break; + case 'd':delimiter=optarg[0];break; + case 'f':if (!(f=fopen(optarg,"r"))) + { fprintf(stderr,"Cannot open file %s\n",optarg); + exit(2); + } break; + case 'o':strcpy(outname,default_ext(optarg,".epp"));break; + case 'O':offsite=getclass(optarg); + break; + case 'u':unmatched=getclass(optarg);break; + case 'i':ignore_dupes=1;break; + case '?': + case '1': case '2': case '3': case '4': case '5': case '6': case '7': + case '8': case '9': + skip_count++; + skip[c-'1']=1; + break; + case 3:{char *endptr; + i=strtol(optarg,&endptr,0); + if (*endptr||i<1||i>32) + { fprintf(stderr,"Invalid column number %s\n",optarg); + exit(2); + } + skip_count++; + skip[i]=1; + break; + } + case 1: + default: + help(c==1); + + } + files_count=argc-optind; + table=malloc(65536*sizeof(short)*(files_count+1)); + limit=65536; + delta=1024; + count=0; + epp=files; + for(i=0,index=optind;ioffsite=offsite; + install_progress_indicator(verbose?show_percent:check_int); + if ((i=clear_progress(for_each_cell(new_file,make_cell)))) + unlink(outname); + if (!Create16bit||new_file->max>255) + close_epp(new_file); + else + {unlink(outname); + fast_convert_to_8bit(new_file,outname); + } + +return abs(i); +} diff --git a/epu/mosaic.c b/epu/mosaic.c new file mode 100644 index 0000000..beebeaa --- /dev/null +++ b/epu/mosaic.c @@ -0,0 +1,125 @@ +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +#include +#include +EPP **files; +int count; + +int fill_cell(int col,int row,int value) +{ int i,c; + EPP **epp; + for (i=count,epp=files+count-1;i>0;i--,epp--) + if ((c=epp_get(*epp,col,row))!=(*epp)->offsite) return c; + return value; +} + +void help(int exitcode) +{ + printf("Usage: mosaic [-%%RA] [-O number] [-o filename] [--help][--version]files\n" +"\t--help - displays this message\n" +"\t--version - shows version number\n" +"\t-%% --verbose - shows progress indicator\n" +"\t-R --force-row - process misaligned files using row/col coords\n" +"\t-A --force-alt - process misaligned files using alternative coords\n" +"\t-O number --offsite=number - set offsite value of output file\n" +"\t-o name --output-file=name - sets name of output file\n"); +exit (exitcode); +} + +int main(int argc,char **argv) +{char output_file[1024]="mosaic.out.epp"; + struct option long_options[]= +{ + {"help",0,0,1}, + {"version",0,0,2}, + {"offsite",1,0,'O'}, + {"verbose",0,0,'%'}, + {"force-row",0,0,'R'}, + {"force-alt",0,0,'A'}, + {"output-file",1,0,'o'}, + {NULL,0,0,0}}; + int index,i,c;char *endptr; + int offsite=-1, x1=32767,y1=32767,x2=-32767,y2=-32767, + max=0,min=65535,force=0,use_alt=1,result,verbose=0; + double X1,Y1,X2,Y2; + EPP *out_f; + while ((c=getopt_long(argc,argv,"O:%RAo:",long_options,&index))!=-1) + { switch (c) + { case 2:show_version("mosaic","$Revision: 1.1 $"); + case '%':verbose=1;break; + case 'O':offsite=strtol(optarg,&endptr,0); + if(*endptr||offsite<0||offsite>65535) + { fprintf(stderr,"Invalid offsite value %s\n",optarg); return 2; + } + break; + case 'A':force=1;use_alt=1;break; + case 'R':force=1;use_alt=0;break; + case 'o':strcpy(output_file,default_ext(optarg,".epp"));break; + case 1: + case '?': + default: + help(c!=1); + } + } + count=argc - optind; + if (!count) { fprintf(stderr,"No input files specified\n");return 2;} + files=malloc(count*sizeof(EPP *)); + for (i=optind,index=0;i0&&!compare_cell_size(files[0],files[index])) + { fprintf(stderr,"File %s is incompatible with %s\n",argv[i],argv[optind]); + return 2; + } + if (index>0&&!is_aligned(files[0],files[index])) + { fprintf(stderr,"File %s is misaligned with %s\n",argv[i],argv[optind]); + if (!force) return 2; + if (use_alt) + {if (!shift_epp(files[index],epp_row(files[0],files[index]->YTop), + epp_col(files[0],files[index]->XLeft))) + {fprintf(stderr,"Cannot align file %s\n",argv[i]) ; + return 2; + } + } + else + { files[index]->XLeft=alt_x(files[0],files[index]->fc); + files[index]->XRight=alt_x(files[0],files[index]->lc); + files[index]->YTop=alt_y(files[0],files[index]->fr); + files[index]->YBottom=alt_y(files[0],files[index]->lr); + } + } + if (!index||x1>files[index]->fc){ x1=files[index]->fc;X1=files[index]->XLeft;} + if (!index||x2lc){ x2=files[index]->lc;X2=files[index]->XRight;} + if (!index||y1>files[index]->fr){ y1=files[index]->fr;Y1=files[index]->YTop;} + if (!index||y2lr){ y2=files[index]->lr;Y2=files[index]->YBottom;} + if (maxmax) max=files[index]->max; + if (min>files[index]->min) min=files[index]->min; + if (files[index]->kind==16) Create16bit=1; + + } + x2--; + y2--; + if (offsite<0) + { if (files[0]->offsiteoffsite>max) + offsite=files[0]->offsite; + else + offsite=Create16bit?65535:255; + } + install_progress_indicator(verbose?show_percent:check_int); + out_f=creat_epp(output_file,x1,y1,x2,y2,X1,Y1,X2,Y2, + 100,0,offsite); + if (!out_f) {fprintf(stderr,"Cannot create output file %s\n",output_file); + return 2; + } + result=clear_progress(for_each_cell(out_f,fill_cell)); + close_epp(out_f); + if (result) unlink(output_file); + for (i=0;i +#include +#include +#include "epp.h" +#include "eppl_ut.h" +void help() +{ printf("Usage: neighbours [-%%][-d] file\n"); + exit(0); +} + +short int* table; + +EPP *file; + +int count,limit,delta; +int duplicates=0; + +int compare(unsigned short int *r1, unsigned short int *r2) +{int i; + for (i=0;i<2;i++,r1++,r2++) + { if (*r1>*r2) return 1; + else + if (*r1<*r2) return -1; + } + return 0; + +} +int search(unsigned short *key,int *index) +{int l=0,h=count-1,i,c; + while(l<=h) + { i=(l+h)>>1; + c=compare(table+2*i,key); + if (c<0) l=i+1; + else + { h=i-1; + if (!c) { *index=i;return 1;} + } + } + *index=l; + return 0; +} +void insert(unsigned short *key,int index) +{ int i; + if (count==limit) + { + table=realloc(table,(limit+=delta)*2*sizeof(short int)); + if (!table) + { fprintf(stderr,"Couldn't realloc table. Table limit is %d\n",limit); + exit(1); + } + } + + for(i=count;i>index;i--) + {table[2*i]=table[2*(i-1)]; + table[2*i+1]=table[2*i-1];} + table[2*index]=key[0]; + table[2*index+1]=key[1]; + count++; +} +void delete(int index) +{ int i; + for(i=index+1;ioffsite||v2==file->offsite) return; + if (v1>v2) {key[0]=v2;key[1]=v1;} + else {key[0]=v1;key[1]=v2;} + if (!search(key,&index)) + insert(key,index); +} + +void print_table() +{int i,j;unsigned short int pair[2]; + unsigned short *t=table; + i=0; + while (ilr-file->fr; + install_progress_indicator(verbose?show_percent:check_int); + for(i=file->fr,k=1;ilr;i++,k++) + { if (EndLineProc) + if ((c=(*EndLineProc)(i,k,rows))) + {break;} + for(j=file->fc;jlc;j++) + { add_pair((c=epp_get(file,j,i)),epp_get(file,j+1,i)); + add_pair(c,epp_get(file,j,i+1)); + add_pair(c,epp_get(file,j+1,i+1)); + } + } + if(clear_progress(c)) exit(abs(c)); + print_table(); + free(table); + close_epp(file); + return 0; +} diff --git a/epu/outtab.c b/epu/outtab.c new file mode 100644 index 0000000..4aeb629 --- /dev/null +++ b/epu/outtab.c @@ -0,0 +1,180 @@ +#include +#include +#include +#include "eppl_ut.h" +#include "epp.h" + +/* This structure is used to keep information about + combination of classes. count is count of cells already found, + classes are classes. Really each of these structures occupies + less then sizeof(struct record) bytes, becouse count of files is + usially less than 32 */ +struct record { + long int count; + unsigned short int classes[32]; + }; + + + + +unsigned short int* table; +typedef struct record *rec; + +EPP *files[32]; /* array of pointers to files + +int tuple_size, /* bytes in tuple != files_count*sizeof(short)+sizeof(int) + due to 4-byte alignment of + files_count, /* Count of files */ + count, /* current size of table */ + limit, /* number of records, currently allocated */ + delta; /* Increment of record number to reallocate when reserves + exhausted */ + +/* comparation function. Sorts two records according to classes + of files in order + returns -1 if *r1 <*r2 ,0 if *r1=*r2 1 if *r1>*r2 +*/ +int compare(struct record *r1, struct record *r2) +{int i; + for (i=0;iclasses[i]>r2->classes[i]) return 1; + else + if (r1->classes[i]classes[i]) return -1; + } + return 0; + +} + +/* Searches table for record which contains classes, specified + in record key. if found, returns non-zero and places index of it + into index. If not, returns zero and places index, where to insert + record into index */ +int search(struct record *key,int *index) +{int l=0,h=count-1,i,c; + while(l<=h) + { i=(l+h)>>1; + c=compare((struct record *)(table+(tuple_size)*i),key); + if (c<0) l=i+1; + else + { h=i-1; + if (!c) { *index=i;return 1;} + } + } + *index=l; + return 0; +} +/* Inserts given record into table at position index. + Fills count field of inserted record by 1 + */ +void insert(struct record *key,int index) +{ int i;long int *l; + if (count==limit) + { + table=realloc(table,(limit+=delta)*(tuple_size)*sizeof(short int)); + if (!table) + { fprintf(stderr,"Couldn't realloc table. Table limit is %d\n",limit); + exit(1); + } + } + + for(i=count;i>index;i--) + memcpy(table+(i)*(tuple_size),table+(i-1)*(tuple_size), + (tuple_size)*sizeof(short int)); + l=(long int *)(table+index*(tuple_size)); + *l=1L; + memcpy(table+index*tuple_size+2,key->classes,files_count*sizeof(short int)); + count++; +} +/* + adds pixel into table, i.e. if record with such combination of classes + already exists, increments its count. Otherwise inserts new record. + */ +void add_pixel(struct record *key) +{int index;long int *l; + if (search(key,&index)) + { + l=((long int *)(table+index*(tuple_size))); + (*l)++; + } + else insert(key,index); +} + +void help() +{ printf("Usage: outtab [-%%] files\n"); + exit(0); +} + +/* + Processes cell - forms record and adds it to table + */ +void do_cell(int x,int y) + { int k; + struct record r; + unsigned short int *c=r.classes; + for(k=0;koffsite) return; + add_pixel(&r); + } + +/* + Prints table. + */ +void print_table() +{int i,j; + unsigned short *t; +for(i=0,t=table;iclasses[j]); + printf("%ld\n",((struct record *)t)->count); +} +} +/******************** main ***********************************/ +int main(int argc,char **argv) +{int i=1,j,k,rows; + int verbose=0; + if (!strcmp(argv[1],"-%")) {verbose=1;i++;} + for(j=0;i=32) + { fprintf(stderr,"To many files in command line, 32 max\n"); + exit(1); + } + files[j]=open_epp(argv[i]); + if (!files[j]) files[j]=open_epp(default_ext(argv[i],".epp")); + if (!files[j]) { fprintf(stderr,"Cannot open file %s\n",argv[i]); + exit(1); + } + if(j){ if(files[j]->fr!=files[0]->fr||files[j]->fc!=files[0]->fc|| + files[j]->lr!=files[0]->lr||files[j]->lc!=files[0]->lc) + {fprintf(stderr,"Size of file %s doesn't match.\n",argv[i]); + exit(1); + } + } + } + files_count=j; + if (files_count%2) { + tuple_size=(3+files_count); + } else { + tuple_size=(2+files_count); + } + table=malloc(65536*tuple_size*sizeof(short int)); + if (!table) { fprintf(stderr,"Not enough memory to allocate %d records\n",65536); + exit(1); + } + limit=65536; + delta=1024; + count=0; + rows=files[0]->lr-files[0]->fr; + install_progress_indicator(verbose?show_percent:check_int); + for(i=files[0]->fr,k=1;ilr;i++,k++) + { for(j=files[0]->fc;jlc;j++) + do_cell(j,i); + if (EndLineProc) if ((*EndLineProc)(j,k,rows)) break; + + } + if (verbose) {fprintf(stderr,"\r \rdone\n");} + print_table(); + free(table); + + for(i=0;i +# define __USE_BSD +# include +# include +# include +# include +# include +# include "outtable.h" +int + useOffsite=0, + areaInCells=0, + verbose=0; + int fileCount=0,/* total number of files in record*/ + funcCount=0,/* Number of functions to use */ + openCount=0,/* Number of distinct open files */ + baseFiles=-1;/* number of files which used to find combinations*/ +double zUnit=1.0, + zOffset=0.0, + cellArea=0.0; +char *baseFile=NULL, + delimiter=','; +EPP* fileinfo[MAX_OUTTABLE_FILES]; +EPP_LINK links[MAX_OUTTABLE_FILES]; +unsigned short int *table; +typedef struct record *rec; +int tuple_size, limit, delta, count; +struct FuncItem funcList[MAX_OUTTABLE_FILES]; +struct FileInfo openFiles[MAX_OUTTABLE_FILES]; + +void error(const char *format,...) +{ va_list ap; + va_start(ap,format); + vfprintf(stderr,format,ap); + va_end(format); + exit(1); +} +void help(void) +{ struct FuncInfo *f; + char sep=' '; + printf("Usage: outtable [-%%][-u][-c][-d char][-b file][-z value][-Z value] files.." + "-function file(s)...\n"); + printf("Where function are:\n"); + for(f=funcTable;f->func;f++){ + printf("%c-%s %s",sep,f->name,f->nargs==1?"file":"file file"); + sep=','; + } + printf("\n"); +} +void scanOpt(int *i,int argc, char **argv) +{ + /* parsing options */ + for (*i=1;*iname)&&f->func;f++); + if (f->func) return f; + else return NULL; +} + +void openFile(char *name) { +int i; +struct FileInfo *f; +char Name[1024]; +strcpy(Name,default_ext(name,".epp")); +for (i=0,f=openFiles;iname);i++,f++); + if (i<=openCount) { + fileinfo[fileCount++]=f->epp; + } else { + + f->epp=open_epp(Name); + f->name=strdup(Name); + openCount++; + if (!f->epp) { + error("Couldn't open file %s\n",name); + } + } +} + + +void parseArgs(int i, int argc, char **argv) { + struct FuncInfo *func; + int j; + while (ifunc; + funcList[funcCount].index=fileCount; + funcList[funcCount].data=malloc(func->datasize); + /* Note, that definition of combinations finished */ + if (baseFiles<0) baseFiles=fileCount; + for (j=0;jnargs;j++) { + if (i==argc) error("Not enough args for function -%s\n",func->name); + openFile(argv[i++]); + } + } else { + if (baseFiles>=0) + error("Files to define combinations should precede functions\n"); + openFile(argv[i++]); + } + } +} + +int compare(struct record *r1, struct record *r2) +{int i; + for (i=0;iclasses[i]>r2->classes[i]) return 1; + else + if (r1->classes[i]classes[i]) return -1; + } + return 0; + +} +/* Searches table for record which contains classes, specified + in record key. if found, returns non-zero and places index of it + into index. If not, returns zero and places index, where to insert + record into index */ +int search(struct record *key,int *index) +{int l=0,h=count-1,i,c; + while(l<=h) + { i=(l+h)>>1; + c=compare((struct record *)(table+(tuple_size)*i),key); + if (c<0) l=i+1; + else + { h=i-1; + if (!c) { *index=i;return 1;} + } + } + *index=l; + return 0; +} +/* Inserts given record into table at position index. + Fills count field of inserted record by 1 + */ +void insert(struct record *key,int index) +{ int i;long int *l; + if (count==limit) + { + table=realloc(table,(limit+=delta)*(tuple_size)*sizeof(short int)); + if (!table) + error("Couldn't realloc table. Table limit is %d\n",limit); + + } + + for(i=count;i>index;i--) + memcpy(table+(i)*(tuple_size),table+(i-1)*(tuple_size), + (tuple_size)*sizeof(short int)); + l=(long int *)(table+index*(tuple_size)); + *l=1L; + memcpy(table+index*tuple_size+2,key->classes,fileCount*sizeof(short int)); + count++; +} +/* + adds pixel into table, i.e. if record with such combination of classes + already exists, increments its count. Otherwise inserts new record. + */ +void add_pixel(struct record *key) +{int index;long int *l; + if (search(key,&index)) + { + l=((long int *)(table+index*(tuple_size))); + (*l)++; + } + else insert(key,index); +} + +/* + Processes cell - forms record and adds it to table + */ +void do_cell(int x,int y) +{ int k; + struct record r; + unsigned short int *c=r.classes; + for(k=0;koffsite&&!useOffsite) return; + } + add_pixel(&r); +} +/* + * Print combinations along with cell areas + * + */ + void print_table(void) +{ + int i,j; + unsigned short *t; + for(i=0,t=table;iclasses[j],delimiter); + if (areaInCells) + printf("%ld\n",((struct record *)t)->count); + else + printf("%0.8g\n",((struct record *)t)->count*cellArea); + } +} +/* + * Compute functions and print results + * + * + */ +void init_functions(void) +{ int i; + struct FuncItem *f; + for(i=0,f=funcList;ifunc(FuncInit,f->data,NULL,f->index); + } +} +void print_row(struct record *row) +{ int j; + struct FuncItem *f; + /* first, print away all things defining a combination */ + for(j=0;jclasses[j],delimiter); + /* second, compute all functions and print away results */ + for(j=0,f=funcList;jfunc(FuncResult,f->data,row,f->index), + j==funcCount-1?'\n':delimiter); +} + +void process_table(void) +{ int i,j; + unsigned short *t; + struct record *prev=NULL; + struct FuncItem *f; + /* reset all functions persistend data */ + init_functions(); + fileCount=baseFiles;/* for compare to compare only files, + defining combinations*/ + for(i=0,t=table;ifunc(FuncIterate,f->data,(struct record *)t,f->index); + } + prev=(struct record *)t; + } + print_row(prev); +} +/* + * main program + */ +int main(int argc, char **argv) +{int i,j,k,rows; + EPP *base; + scanOpt(&i, argc, argv); + parseArgs(i, argc, argv); + if (!openCount) { + error("No files specified\n"); + } + /* Find out base file */ + if (!baseFile) { + base=fileinfo[0]; + } else { + int saveCount=fileCount; + openFile(baseFile); + base=fileinfo[saveCount]; + fileCount=saveCount; + } + + /* Determine cell area */ + if (areaInCells) { + cellArea=1.0; + } else { + cellArea=base->cell_area; + } + /* establish coordinate links */ + for (i=0;ilr-base->fr; + install_progress_indicator(verbose?show_percent:check_int); + for(i=base->fr,k=1;base->lr;i++,k++) + { for(j=base->fc;jlc;j++) + do_cell(j,i); + if (EndLineProc) if ((*EndLineProc)(j,k,rows)) { + clear_progress(1); + exit(1); + } + + } + clear_progress(0); + if (funcCount) { + /* there are some functions. Process them */ + process_table(); + } else { + print_table(); + } + free(table); + for(i=0;i + +#define MAX_OUTTABLE_FILES 32 +/* This structure is used to keep information about + combination of classes. count is count of cells already found, + classes are classes. Really each of these structures occupies + less then sizeof(struct record) bytes, becouse count of files is + usially less than 32 */ +struct record { + long int count; + unsigned short int classes[MAX_OUTTABLE_FILES]; + }; +/* data which outtable functions need to keep between calls */ +typedef void* FuncData; + +/* Action which function should take */ +typedef enum { + FuncInit, /* Initialize FuncData */ + FuncIterate,/* Collect data from given record, return non-zero on failure */ + FuncResult /* Return computed value */ +} FuncAction; + +/* Type for all data processing functions */ +typedef double (*OuttableFunc)(FuncAction action,/* what to do */ + FuncData data, /* pointer to persistent data */ + struct record *record, /*record to process */ + int index); /* number of file in record to cope with */ + +/* Type for record in functuon-table */ + +struct FuncInfo { + char name[16]; /* how function is named in command-line */ + OuttableFunc func; /* actual function to perform operation */ + int nargs; /* number of file arguments */ + int datasize; /* How many bytes to allocate for FuncData */ +}; + +struct FuncItem { + OuttableFunc func; + FuncData data; + int index; + }; + +struct FileInfo { + char *name; + EPP *epp; + }; + +extern struct FileInfo openFiles[MAX_OUTTABLE_FILES]; +extern struct FuncInfo funcTable[]; +extern EPP* fileinfo[MAX_OUTTABLE_FILES]; +extern struct FuncItem funcList[MAX_OUTTABLE_FILES]; +extern double cellArea, zUnit, zOffset; +#endif diff --git a/epu/outtable_func.c b/epu/outtable_func.c new file mode 100644 index 0000000..f92872e --- /dev/null +++ b/epu/outtable_func.c @@ -0,0 +1,467 @@ +#include "outtable.h" +#include +#include +/* Data structures for functions */ +typedef struct n_info { + int count; + int value; + } n_info; +/* Sum of the all cells in combination */ +double OuttableSum(FuncAction action, FuncData data, struct record *record, + int index) +{ struct n_info *info=(struct n_info *)data; + switch (action) { + case FuncInit: + info->value=0; + info->count=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + info->value+=record->classes[index]*record->count; + info->count+=record->count; + } + return 0; + case FuncResult: + return zUnit*info->value+zOffset*info->count; + + } + return 0; +} + +/* Count of the non-offsite cells for given file in combination */ +double OuttableCount(FuncAction action, FuncData data, struct record *record, + int index) +{ int *sum=(int *)data; + switch (action) { + case FuncInit: + *sum=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) + *sum+=record->count; + return 0; + case FuncResult: + return *sum*cellArea; + + } + return 0; +} +/* Average of the all cells in combination */ +struct avg_info { + long sum; + int count; + }; +double OuttableAvg(FuncAction action, FuncData data, struct record *record, + int index) +{ struct avg_info *info=(struct avg_info *)data; + switch (action) { + case FuncInit: + info->sum=0; + info->count=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + info->sum+=record->classes[index]*record->count; + info->count+=record->count; + } + return 0; + case FuncResult: + if (info->count) + return (zUnit*info->sum/info->count)+zOffset; + else return 0; + + } + return 0; +} +/* Minimal cell value in combination */ +double OuttableMin(FuncAction action, FuncData data, struct record *record, + int index) +{ int *min=(int *)data; + switch (action) { + case FuncInit: + *min=65536; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->classes[index]<*min) + *min=record->classes[index]; + return 0; + case FuncResult: + return *min*zUnit+zOffset; + + } + return 0; +} + +/* Count of cell with minimal value in combination */ +double OuttableNMin(FuncAction action, FuncData data, struct record *record, + int index) +{ struct n_info *info=(n_info *)data; + switch (action) { + case FuncInit: + info->value=65536; + info->count=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->classes[index]value) { + info->value=record->classes[index]; + info->count=record->count; + } + return 0; + case FuncResult: + return info->count*cellArea; + + } + return 0; +} + +/* Maximal cell value in combination */ +double OuttableMax(FuncAction action, FuncData data, struct record *record, + int index) +{ int *max=(int *)data; + switch (action) { + case FuncInit: + *max=-1; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->classes[index]>*max) + *max=record->classes[index]; + return 0; + case FuncResult: + return *max*zUnit+zOffset; + + } + return 0; +} + +/* Count of cell with maximal value in combination */ +double OuttableNMax(FuncAction action, FuncData data, struct record *record, + int index) +{ struct n_info *info=(n_info *)data; + switch (action) { + case FuncInit: + info->value=-1; + info->count=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->classes[index]>info->value) { + info->value=record->classes[index]; + info->count=record->count; + } + return 0; + case FuncResult: + return info->count*cellArea; + + } + return 0; +} +/* Count of cells with most frequent value in combination */ +double OuttableNMode(FuncAction action, FuncData data, struct record *record, + int index) +{ int *max=(int *)data; + switch (action) { + case FuncInit: + *max=-1; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->count>*max) + *max=record->count; + return 0; + case FuncResult: + return *max*cellArea; + + } + return 0; +} + +/* Most frequent cell value in combination */ +double OuttableMode(FuncAction action, FuncData data, struct record *record, + int index) +{ struct n_info *info=(n_info *)data; + switch (action) { + case FuncInit: + info->value=-1; + info->count=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->count>info->count) { + info->value=record->classes[index]; + info->count=record->count; + } + return 0; + case FuncResult: + return info->value*zUnit+zOffset; + + } + return 0; +} +/* Count of cells with rarest value in combination */ +double OuttableNFewest(FuncAction action, FuncData data, struct record *record, + int index) +{ int *min=(int *)data; + switch (action) { + case FuncInit: + *min=INT_MAX; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->count<*min) + *min=record->count; + return 0; + case FuncResult: + return *min*cellArea; + + } + return 0; +} + +/* Rarest cell value in combination */ +double OuttableFewest(FuncAction action, FuncData data, struct record *record, + int index) +{ struct n_info *info=(n_info *)data; + switch (action) { + case FuncInit: + info->value=0; + info->count=INT_MAX; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite && + record->countcount) { + info->value=record->classes[index]; + info->count=record->count; + } + return 0; + case FuncResult: + return info->value*zUnit+zOffset; + + } + return 0; +} +/* Range of classes in cell */ +typedef struct r_info { + int max,min; + } r_info; +double OuttableRange(FuncAction action, FuncData data, struct record *record, + int index) +{ struct r_info *info=(r_info *)data; + switch (action) { + case FuncInit: + info->max=0; + info->min=INT_MAX; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + if (record->classes[index]min) + info->min=record->classes[index]; + if (record->classes[index]>info->max) + info->max=record->classes[index]; + } + return 0; + case FuncResult: + return (info->max-info->min)*zUnit; + + } + return 0; +} + +/* count of distinct classes. Note that function can be called more than once + for each distinct class (if there are more functions), so we need to + keep track on found classes in bit table */ +#define BIT_TABLE_LENGTH (8192/sizeof(int)) +struct c_info { + int found; + int bittable[BIT_TABLE_LENGTH]; + }; +double OuttableClasses(FuncAction action, FuncData data, struct record *record, + int index) +{ struct c_info *info=(struct c_info*) data; + int i,mask; + switch (action) { + case FuncInit: + info->found=0; + for (i=0;ibittable[i]=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + i=record->classes[index]/(sizeof(int)*8); + mask=1<classes[index]%(sizeof(int)*8); + if (!(info->bittable[i]&mask)) { + info->found++; + info->bittable[i]|=mask; + } + } + return 0; + case FuncResult: + return info->found; + + } + return 0; +} +/* Bitwise OR of all values. Why Pete Olson was so proud of this + function adding it in EPPL ver 2.1? */ +double OuttableOr(FuncAction action, FuncData data, struct record *record, + int index) +{ int *res=(int *)data; + switch (action) { + case FuncInit: + *res=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) + *res|=record->classes[index]; + return 0; + case FuncResult: + return *res; + + } + return 0; +} + +/* Bitwise And of all values in combination */ +double OuttableAnd(FuncAction action, FuncData data, struct record *record, + int index) +{ int *res=(int *)data; + switch (action) { + case FuncInit: + *res=65535; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) + *res&=record->classes[index]; + return 0; + case FuncResult: + return *res; + + } + return 0; +} + +/* Standard deviation of all values in combination, biased */ +struct var_info { + double sum; + double sumsq; + int count; + }; +double OuttableStd(FuncAction action, FuncData data, struct record *record, + int index) +{ struct var_info *info=(struct var_info *)data; + switch (action) { + case FuncInit: + info->count=0; + info->sum=0; + info->sumsq=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + info->count +=record->count; + info->sum +=record->count*record->classes[index]; + info->sumsq +=record->count*record->classes[index]*record-> + classes[index]; + } + return 0; + case FuncResult: + if (info->count<2) return 0; + return sqrt((info->sumsq-(info->sum*info->sum/info->count))/ + (info->count))*zUnit; + + } + return 0; +} +/*Variance of cell values, biased*/ +double OuttableVar(FuncAction action, FuncData data, struct record *record, + int index) +{ struct var_info *info=(struct var_info *)data; + switch (action) { + case FuncInit: + info->count=0; + info->sum=0; + info->sumsq=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite) { + info->count +=record->count; + info->sum +=record->count*record->classes[index]; + info->sumsq +=record->count*record->classes[index]*record-> + classes[index]; + } + return 0; + case FuncResult: + if (info->count<2) return 0; + return ((info->sumsq-(info->sum*info->sum/info->count))/ + (info->count-1))*zUnit*zUnit; + + } + return 0; +} + +/* correlation of cell values in files index and index+1, multiplied by 100 */ +typedef struct cov_info { + double sumx; + double sumy; + double sumxy; + double sumxsq; + double sumysq; + int count; + } cov_info; +double OuttableCorr(FuncAction action, FuncData data, struct record *record, + int index) +{ struct cov_info *info=(struct cov_info *)data; + switch (action) { + case FuncInit: + info->count=0; + info->sumx=0; + info->sumxsq=0; + info->sumy=0; + info->sumysq=0; + info->sumxy=0; + return 0; + case FuncIterate: + if (record->classes[index]!=fileinfo[index]->offsite&& + record->classes[index+1]!=fileinfo[index+1]->offsite) { + info->count +=record->count; + info->sumx +=record->count*record->classes[index]; + info->sumxsq +=record->count*record->classes[index]*record-> + classes[index]; + info->sumy +=record->count*record->classes[index+1]; + info->sumysq +=record->count*record->classes[index+1]*record-> + classes[index+1]; + info->sumxy +=record->count*record->classes[index]* + record->classes[index+1]; + } + return 0; + case FuncResult: + if (info->count<2) return 0; + return (info->sumxy-(info->sumx*info->sumy/info->count))/ + sqrt((info->sumxsq-(info->sumx*info->sumx/info->count))* + (info->sumysq-(info->sumy*info->sumy/info->count))); + + } + return 0; +} + +struct FuncInfo funcTable[]={ +{"sum",OuttableSum,1,sizeof(int)}, +{"cnt",OuttableCount,1,sizeof(int)}, +{"avg",OuttableAvg,1,sizeof(struct avg_info)}, +{"min",OuttableMin,1,sizeof(int)}, +{"nmin",OuttableNMin,1,sizeof(struct n_info)}, +{"max",OuttableMax,1,sizeof(int)}, +{"nmax",OuttableNMax,1,sizeof(struct n_info)}, +{"mode",OuttableMode,1,sizeof(struct n_info)}, +{"nmode",OuttableNMode,1,sizeof(int)}, +{"fewest",OuttableFewest,1,sizeof(struct n_info)}, +{"nfewest",OuttableNFewest,1,sizeof(int)}, +{"range",OuttableRange,1,sizeof(struct r_info)}, +{"classes",OuttableClasses,1,sizeof(struct c_info)}, +{"or",OuttableOr,1,sizeof(int)}, +{"and",OuttableAnd,1,sizeof(int)}, +{"std",OuttableStd,1,sizeof(struct var_info)}, +{"var",OuttableVar,1,sizeof(struct var_info)}, +{"corr",OuttableCorr,2,sizeof(struct cov_info)}, +{"",NULL,0,0}, +}; diff --git a/epu/points.tab b/epu/points.tab new file mode 100644 index 0000000..9b5fe55 --- /dev/null +++ b/epu/points.tab @@ -0,0 +1,262 @@ + 1, 456.8, 0.2 + 2, 1865.6, 1127.4 + 3, 1951.6, 1298.6 + 4, 1784, 1268.6 + 5, 1928.4, 1276.2 + 6, 1892.8, 1268.2 + 7, 1980, 1268.2 + 8, 1980.8, 1267.8 + 9, 1887.2, 1264.2 + 10, 1983.6, 1266.6 + 11, 961.2, 1242.6 + 12, 976, 1229 + 13, 980.8, 1236.2 + 14, 1028, 1228.2 + 15, 1015.2, 1221.4 + 16, 1020.4, 1223.8 + 17, 1006, 1212.6 + 18, 966.8, 1220.2 + 19, 998.4, 1217.8 + 20, 1008.8, 1218.6 + 21, 1023.6, 1217.4 + 22, 1015.6, 1217 + 23, 1044.8, 1213.4 + 24, 990.4, 1213.8 + 25, 967.2, 1213.4 + 26, 982.4, 1211.4 + 27, 1002.4, 1210.2 + 28, 1016, 1212.2 + 29, 1016.8, 1210.6 + 30, 1025.6, 1204.2 + 31, 990.8, 1205 + 32, 1003.2, 1198.2 + 33, 995.2, 1198.6 + 34, 1018.8, 1195.8 + 35, 1040.4, 1191.8 + 36, 998, 1197.4 + 37, 1792.4, 1187.4 + 38, 1004.8, 1185.4 + 39, 1978.4, 1167.8 + 40, 1990.4, 1167.4 + 41, 1990, 1167 + 42, 1928, 1165 + 43, 1111.2, 1160.2 + 44, 1926.4, 1159.8 + 45, 632.8, 1087.4 + 46, 1168.8, 1153.8 + 47, 1188.8, 1135.8 + 48, 1772, 1149 + 49, 1987.6, 1145 + 50, 1988, 1143.8 + 51, 1983.6, 1141.4 + 52, 656, 1138.6 + 53, 1172, 1132.2 + 54, 1179.2, 1129.4 + 55, 1174.4, 1119.4 + 56, 1197.2, 1103 + 57, 1178, 1123 + 58, 1554.8, 1112.2 + 59, 501.6, 1013 + 60, 1203.6, 1117.4 + 61, 1202.4, 1115 + 62, 1200.8, 1113 + 63, 1176.8, 1111 + 64, 1176.8, 1107.8 + 65, 1233.2, 1080.6 + 66, 1486.8, 1074.6 + 67, 1952, 1023 + 68, 1210, 1100.2 + 69, 1519.6, 755.8 + 70, 228, 1064.2 + 71, 840, 1032.2 + 72, 1230.4, 1090.6 + 73, 1230, 1089.8 + 74, 219.2, 1083.8 + 75, 232, 1082.6 + 76, 1739.6, 1078.6 + 77, 590, 1077 + 78, 1995.6, 1075.8 + 79, 1254.8, 1074.2 + 80, 887.2, 1073.4 + 81, 1260, 1071 + 82, 891.6, 1071.8 + 83, 1465.2, 1064.2 + 84, 1180.8, 913.8 + 85, 870.4, 1057 + 86, 891.2, 1057.4 + 87, 891.6, 1057 + 88, 1516.4, 1051 + 89, 582, 1054.2 + 90, 444, 977 + 91, 1531.6, 1044.6 + 92, 668.8, 1051.8 + 93, 667.6, 1050.6 + 94, 1145.6, 1049.8 + 95, 878, 1047.8 + 96, 1140.4, 1045.8 + 97, 416.8, 1045.4 + 98, 416.4, 1045 + 99, 874, 1042.6 + 100, 869.2, 1041.4 + 101, 1189.6, 1039.4 + 102, 1252.8, 1041.4 + 103, 870, 1041 + 104, 1575.6, 1032.6 + 105, 1588.8, 1025.8 + 106, 445.2, 1014.2 + 107, 337.6, 989.4 + 108, 1524, 1032.2 + 109, 1485.2, 1029.8 + 110, 788.8, 921.8 + 111, 573.2, 936.6 + 112, 2006.4, 1025.4 + 113, 1818, 861 + 114, 828.8, 1020.2 + 115, 1082.8, 1011 + 116, 1305.2, 1011.8 + 117, 1172, 1009.4 + 118, 753.2, 999.4 + 119, 1184.8, 1008.2 + 120, 1921.2, 1007.8 + 121, 582, 1006.6 + 122, 1183.6, 1006.6 + 123, 579.2, 1005.4 + 124, 386.4, 971.8 + 125, 978.4, 985.4 + 126, 832.8, 986.6 + 127, 1110.4, 983.4 + 128, 647.2, 982.2 + 129, 966, 749.4 + 130, 1430.4, 981 + 131, 363.2, 979.8 + 132, 1019.6, 975 + 133, 1312.4, 971.4 + 134, 470.4, 930.2 + 135, 1542.8, 969.4 + 136, 846.4, 961.4 + 137, 1005.6, 966.2 + 138, 400.4, 911.4 + 139, 1022, 964.6 + 140, 782, 964.2 + 141, 783.6, 963.8 + 142, 1115.6, 963.8 + 143, 1454, 963.8 + 144, 1365.2, 960.6 + 145, 1515.2, 960.2 + 146, 1516.8, 958.6 + 147, 1041.6, 949 + 148, 313.2, 915.8 + 149, 1026.4, 942.2 + 150, 1992, 941 + 151, 696.8, 841 + 152, 1488.8, 933.4 + 153, 2123.2, 919.4 + 154, 2116, 915.8 + 155, 442.4, 882.6 + 156, 2092.4, 903.4 + 157, 282, 870.6 + 158, 379.6, 868.6 + 159, 2032, 786.6 + 160, 319.6, 869.4 + 161, 492.4, 841.8 + 162, 415.6, 823 + 163, 447.6, 833.4 + 164, 339.6, 831.4 + 165, 302, 835.4 + 166, 550.4, 777.4 + 167, 271.2, 821 + 168, 804.4, 717.4 + 169, 1196.8, 724.2 + 170, 888.8, 822.6 + 171, 379.2, 801.8 + 172, 358.8, 824.2 + 173, 446, 782.2 + 174, 1112.8, 478.2 + 175, 1832.4, 475.4 + 176, 325.2, 791.8 + 177, 272, 780.6 + 178, 992.4, 807.8 + 179, 626.8, 756.2 + 180, 304.8, 750.6 + 181, 353.2, 755 + 182, 408.4, 769 + 183, 503.2, 756.6 + 184, 615.6, 704.2 + 185, 1838.4, 783.8 + 186, 406, 720.2 + 187, 697.2, 663 + 188, 474.8, 751.4 + 189, 569.2, 722.2 + 190, 505.6, 717 + 191, 444.4, 712.6 + 192, 402, 661.4 + 193, 2057.2, 733 + 194, 320, 671 + 195, 236, 669.8 + 196, 183.2, 669.4 + 197, 204.4, 703.8 + 198, 2094.4, 682.2 + 199, 141.6, 698.6 + 200, 142, 698.2 + 201, 2091.6, 695.8 + 202, 462.4, 662.2 + 203, 1284, 463 + 204, 550.4, 635.4 + 205, 436.8, 685.4 + 206, 437.6, 685.4 + 207, 170.8, 639.4 + 208, 492, 614.2 + 209, 2100, 654.2 + 210, 758, 597.8 + 211, 212.8, 604.2 + 212, 638.4, 610.6 + 213, 266.8, 591 + 214, 958.4, 557.4 + 215, 302.4, 558.6 + 216, 151.2, 635.4 + 217, 2105.2, 633.4 + 218, 2106.4, 631 + 219, 683.2, 580.2 + 220, 1936.4, 521.8 + 221, 165.6, 595.4 + 222, 804.8, 520.6 + 223, 1867.6, 606.2 + 224, 1879.6, 599.8 + 225, 1880.8, 598.6 + 226, 1882, 598.6 + 227, 2111.6, 598.2 + 228, 2112.8, 597 + 229, 181.6, 568.6 + 230, 2113.2, 575.4 + 231, 1850.8, 572.6 + 232, 1689.2, 458.6 + 233, 1910, 565 + 234, 213.6, 491 + 235, 1708.8, 559.8 + 236, 188.8, 542.6 + 237, 1501.6, 401.8 + 238, 212.4, 530.2 + 239, 889.6, 483.4 + 240, 281.6, 543.8 + 241, 2104.8, 519 + 242, 1412.4, 445 + 243, 244.4, 509.4 + 244, 2090.4, 478.6 + 245, 1010, 455.8 + 246, 783.2, 483.4 + 247, 1340.4, 377.8 + 248, 1056.8, 391 + 249, 947.6, 387 + 250, 2076, 438.6 + 251, 2003.6, 441 + 252, 1877.2, 347 + 253, 2095.6, 434.6 + 254, 1785.2, 381.8 + 255, 1278.8, 381 + 256, 1143.6, 336.6 + 257, 986, 333 + 258, 1018, 362.2 + 259, 1468.4, 339 + 260, 1288.8, 349 + 261, 1290.8, 346.2 + 262, 1024, 344.6 diff --git a/epu/project b/epu/project new file mode 100755 index 0000000..efd5d60 Binary files /dev/null and b/epu/project differ diff --git a/epu/project.c b/epu/project.c new file mode 100644 index 0000000..d7b662f --- /dev/null +++ b/epu/project.c @@ -0,0 +1,373 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +PJ *in_proj=NULL,*out_proj=NULL; +int positive_west=0;/* Whether to adjust west hemisphere coords to range + 180-360 from range -180-0 */ +EPP *infile,*outfile; +/* This function does perform actual projection conversion + It computes long/lat data from current cell and then computes + cell on input map to get value from */ +int project_cell(int col, int row, int value) { + UV out,ll,in; + int in_row,in_col; + out.u=alt_xc(outfile,col); + out.v=alt_yc(outfile,row); + if (out_proj) { + ll=pj_inv(out,out_proj); + } else { + if (positive_west&&out.u>180) { + out.u-=360.0; + } + ll.u=out.u*DEG_TO_RAD; + ll.v=out.v*DEG_TO_RAD; + + } + if (ll.u == HUGE_VAL || ll.v == HUGE_VAL) { + return value; + } + if (in_proj) { + in=pj_fwd(ll,in_proj); + } else { + in.u=ll.u*RAD_TO_DEG; + if (positive_west && in.u<0) { + in.u+=360.0; + } + in.v=ll.v*RAD_TO_DEG; + } + in_row=epp_row(infile,in.v); + in_col=epp_col(infile,in.u); + return epp_get(infile,in_col,in_row); +} + +void help(exitcode) { + printf("Usage: project [-%%] {-b basefile|-c cellsize -l xl,yb,xr,yt} [-i source_proj]\n\t" + "[-p target_proj] -o outfile -O offsite {-r rows_to_cache|-x [tmpdir]} file\n" + "Projection definition can be either file name or list of comma separated\n" + "name=value pairs. If either input or output projection omitted, it is assumed\n" + "to be geographic coords\n"); + exit(exitcode); +} +PJ* get_projection(const char *source); +void expand_epp(EPP *epp,const char *tempdir,int verbose); +void check_hemisphere(EPP *epp); +int main(int argc,char **argv) { +struct option long_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + {"base-file",1,0,'b'}, + {"cell-size",1,0,'c'}, + {"source-projection",1,0,'i'}, + {"output-file",1,0,'o'}, + {"target-projection",1,0,'p'}, + {"offsite",1,0,'O'}, + {"cache-rows",1,0,'r'}, + {"expand",2,0,'x'}, + {"limits",1,0,'l'} + }; +char outname[1024]="project.out.epp"; +char tmpdir[1024]="/tmp"; +char *basefilename=NULL,*errptr; +int limits_flag=0,result,offsite_flag=0,offsite=0,cache_size=0,expand_flag=0; +double xright=0,xleft=0,ybottom=0,ytop=0,cellsize = 0; +int c,index,verbose=0; + while ((c=getopt_long(argc,argv,"c:i:o:p:O:r:x::l:b:%",long_options,&index)) + !=-1) { + switch (c) { + case 2: show_version("project","$Revision: 1.1 $"); + case '%': verbose = 1; break; + case 'b' : if (cellsize !=0 || limits_flag) { + fprintf(stderr,"basefile cannot be combined with" + "explicit coordinate parameters\n"); + exit(1); + } + if (basefilename) { + fprintf(stderr,"Duplicate basefile specification\n"); + exit(1); + } + basefilename=strdup(default_ext(optarg,".epp")); + break; + case 'c' : if (basefilename) { + fprintf(stderr,"cannot use cell size and" + "basefile at the same time\n"); + exit(1); + } + cellsize=strtod(optarg,&errptr); + if (*errptr || cellsize<=0) { + fprintf(stderr,"invalid cellsize %s\n",optarg); + exit(1); + } + break; + case 'i' : in_proj=get_projection(optarg); + if (!in_proj) exit(1); + break; + case 'l' : if (basefilename) { + fprintf(stderr,"Cannot use both basefile" + "and limits\n"); + exit(1); + } + if (limits_flag) { + fprintf(stderr,"Duplicate limit specification\n"); + exit(1); + } + xleft = strtod(optarg,&errptr); + while (strchr(",;\n \t",*errptr)) errptr++; + if (!*errptr) { + fprintf(stderr,"Invalid limits"); + exit(1); + } + ybottom = strtod(errptr,&errptr); + while (strchr(",;\n \t",*errptr)) errptr++; + if (!*errptr) { + fprintf(stderr,"Invalid limits"); + exit(1); + } + xright = strtod(errptr,&errptr); + while (strchr(",;\n \t",*errptr)) errptr++; + if (!*errptr) { + fprintf(stderr,"Invalid limits"); + exit(1); + } + ytop = strtod(errptr,&errptr); + if (*errptr) { + fprintf(stderr,"Invalid limits"); + exit(1); + } + limits_flag=1; + break; + case 'p' : out_proj=get_projection(optarg); + if (!out_proj) exit(1); + if (!out_proj->inv) { + fprintf (stderr,"Cannot project - inverse " + "transformation for output projection" + "unavailable\n"); + exit(1); + } + break; + case 'o' : strncpy(outname,default_ext(optarg,".epp"),1023); + outname[1023]=0; + break; + case 'O' : offsite = strtol(optarg,&errptr,0); + if (*errptr || offsite<0 || offsite>65535) { + fprintf(stderr,"Invalid offsite value %s\n",optarg); + exit(1); + } + offsite_flag=1; + break; + case 'r' : cache_size = strtol(optarg,&errptr,0); + if (*errptr || cache_size<0 || cache_size>30000) { + fprintf(stderr,"Invalid cache size:%s\n",optarg); + exit(1); + } + break; + case 'x' : expand_flag=1; + if (optarg) { + strncpy(tmpdir,optarg,1023); + tmpdir[1023]=0; + } + break; + default: { + help(c==1?0:1); + } + } + } + if (cache_size && expand_flag) { + fprintf(stderr,"cannot use cache and expanding to temp dir" + "simulateously\n"); + exit(1); + } + if (!in_proj) { + if (!out_proj) { + fprintf(stderr,"Neither input nor output projection specified\n"); + exit(1); + } else { + fprintf(stderr,"input projection is not specified, assuming latlong\n"); + } + } else if (!out_proj) { + fprintf(stderr,"Output projection is not specified, assuming latlong\n"); + } + if (optind>=argc) { + fprintf(stderr,"No input file specified\n"); + exit(1); + } + + infile=open_epp(default_ext(argv[optind],".epp")); + if (!infile) { + perror("open input file"); + exit(2); + } + if (!in_proj) { + check_hemisphere(infile); + } + if (cache_size) { + set_epp_cache(infile,cache_size); + } + if (!offsite_flag) { + offsite = infile->offsite; + } + Create16bit=infile->kind==16; + if (basefilename) { + EPP *basefile; + basefile=open_epp(basefilename); + if (!basefile) { + perror("open base file"); + exit(2); + } + outfile=creat_epp_as(outname,basefile); + if (!outfile) { + perror("opening output file\n"); + exit(1); + } + outfile->offsite=offsite; + close_epp(basefile); + } else { + int rows;int cols; + if (!limits_flag || cellsize==0) { + fprintf(stderr,"output file geometry is not specified\n"); + exit(2); + } + rows=ceil(fabs(ytop-ybottom)/cellsize); + cols=ceil(fabs(xright-xleft)/cellsize); + if (ybottomrow=malloc(1); + munmap(infile->cache,infile->width*(infile->lr-infile->fr)* + sizeof(unsigned short)); + close(infile->cache_size); + } + close_epp(infile); + return(0); +} + +PJ* get_projection(const char *source) { + char *work_area,*token,**args; + int argc,limit=16; + PJ *pj; + if (!strchr(source,'=')) { + FILE *f=fopen(default_ext(source,".prj"),"r"); + int size; + if (!f) { + perror(default_ext(source,".prj")); + exit(2); + } + fseek(f,0,SEEK_END); + size = ftell(f); + fseek(f,0,SEEK_SET); + work_area=malloc(size+1); + if(fread(work_area,1,size,f)!=size) { + perror(default_ext(source,"prj")); + exit(2); + } + work_area[size]=0; + fclose(f); + } else { + work_area = strdup(source); + } + args=calloc(limit,sizeof(char *)); + argc=0; + token=strtok(work_area,",;\n \r\t"); + do { + args[argc++]=token; + if (argc>=limit) { + args=realloc(args,(limit+=16)*(sizeof(char *))); + } + } while ((token = strtok(NULL,",;\n \r\t"))); + pj = pj_init(argc,args); + free(work_area); + free(args); + if (!pj) { fprintf(stderr,"Invalid projection definition: %s\n", + source); + exit(2); + } + return pj; + } + void position_mmap(EPP *epp,int row) { + epp->row=((unsigned short*) epp->cache)+(epp->width)*(row-epp->fr); + epp->currentline=row; +} +void expand_epp(EPP *epp,const char* tmpdir, int verbose) { + int fd,i,k,n,row_size; + char tempname[1048]="/tmp"; + if (tmpdir && *tmpdir) { + strcpy(tempname,tmpdir); + } + strcat(tempname,"/eppXXXXXX"); + /* We use mkstemp rather than POSIX tmpfile here, becouse we need + * to have control over place where file is created. I don't expect + * that everybody have few gigabytes free in /tmp for unpacking large + * map + */ + fd=mkstemp(tempname); + unlink(tempname); + /*file has mode 0666, so it is better to not show it to anyone*/ + if (verbose) { + fprintf(stderr,"unpacking...\n"); + install_progress_indicator(show_percent); + } else { + install_progress_indicator(check_int); + } + n=epp->lr - epp->fr; + row_size=epp->width*sizeof(unsigned short); + for (i=epp->fr,k=1;ilr;i++,k++) { + epp_get(epp,epp->fc,i); + if (write(fd,epp->row,row_size)!=row_size) { + fprintf(stderr,"Not enough space for temporary file\n"); + exit(2); + } + if(EndLineProc(i,k,n)) { + clear_progress(1); + exit(2); + } + } + clear_progress(0); + free(epp->row); + lseek(fd,0,SEEK_SET); + epp->cache=mmap(NULL,row_size*n,PROT_READ,MAP_SHARED,fd,0); + if (epp->cache==MAP_FAILED) { + perror("mmap"); + exit(2); + } + epp->position=position_mmap; + infile->cache_size=fd; +} + +void check_hemisphere(EPP *epp) { + if (epp->XLeft>=0 && epp->XRight>=180) { + fprintf(stderr,"Western hemisphere coords would be adjusted\n"); + positive_west=1; + } +} diff --git a/epu/reclass1.c b/epu/reclass1.c new file mode 100644 index 0000000..d344e7d --- /dev/null +++ b/epu/reclass1.c @@ -0,0 +1,93 @@ +#include +#include +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +#include "reclass.h" +#define required_argument 1 + FILE *input_stream; + short int *table; + EPP *infile; +int reclass_getc() +{ return fgetc(input_stream); +} +int get_cell(int col,int row,int value) +{ return table[epp_get(infile,col,row)]; +} +int main(int argc,char **argv) +{ char outname[256]="reclass.out.epp"; + char filename[256]; + + struct option long_options[]={ + {"help",0,0,1}, + {"version",0,0,2}, + {"verbose",0,0,'%'}, + {"file",required_argument,0,'f'}, + {"output-file",required_argument,0,'o'}, + {NULL,0,0,0} }; + int c; + int index,verbose=0; + EPP *outfile; + input_stream=stdin; + + while ((c=getopt_long(argc,argv,"%f:o:",long_options,&index))!=-1) + { switch(c) + { case 2:/* version */show_version("reclass","$Revision: 1.1 $"); + case '%':verbose=1;break; + case 'o':strcpy(outname,default_ext(optarg,".epp")); + case 'f':if((input_stream=fopen(optarg,"r"))==NULL) + {fprintf(stderr,"Cannot open reclass file %s\n",optarg); + return 1; + } else break; + case 1:/*help*/ + case '?': + default: + printf("Usage %s [--help] [--version] [-v] [-f reclass_file]\n" + "[-o output_file] file_to_reclass\n",argv[0]); + return c==1?0:2; + } + } + if (argc==optind) + { fprintf(stderr,"No input files specified\n"); + return 2; + } + if (argc>=optind+2) + { fprintf(stderr,"Too many input files\n"); + return 2; + } + + infile=open_epp(default_ext(argv[optind],".epp")); + if (!infile) { fprintf(stderr,"Cannot open input file\n"); + return 1; + } + Create16bit=1; + outfile=creat_epp_as(outname,infile); + if (!outfile){ fprintf(stderr,"Cannot create output file\n"); + return 1; + } + if (input_stream==stdin&&isatty(0)) + { + printf("Enter reclass statements. Press ^D to end.\n"); + interactive_parser=1; + } + /* init reclass table */ + if (!(table=make_reclass_table(infile,reclass_getc))) + { unlink(outname);return 1;} + if (table[infile->offsite]!=infile->offsite) + outfile->offsite=table[infile->offsite]; + install_progress_indicator(verbose?show_percent:check_int); + for_each_cell(outfile,get_cell); + + close_epp(infile); + if (outfile->max<255){ + fast_convert_to_8bit(outfile,strcat(strcpy(filename,outname),".8bit")); + unlink(outname); + rename(filename,outname); + } + else + close_epp(outfile); + clear_progress(0); + return 0; +} diff --git a/epu/tag2epp.c b/epu/tag2epp.c new file mode 100644 index 0000000..ee7caf9 --- /dev/null +++ b/epu/tag2epp.c @@ -0,0 +1,32 @@ +/* + * converts tag file to epp file + */ + + + + + +int main(int argc,char **argv) +{char output_file[1024]="clip.out.epp"; + struct option long_options[]= +{ + {"help",0,0,1}, + {"version",0,0,2}, + {"linear",0,0,'l'}, /* óÞÉÔÁÔØ, ÞÔÏ ÔÜÇ ÓÕÔØ ×ÅÝÅÓÔ×ÅÎÎÏÅ ÞÉÓÌÏ É ÉÓÐÏÌØÚÏ×ÁÔØ + ÌÉÎÅÊÎÕÀ ÆÕÎËÃÉÀ ÄÌÑ ÐÒÅÏÂÒÁÚÏ×ÁÎÉÑ ÅÇÏ × ËÌÁÓÓ */ + {"max",1,0,'x'}, /* ÚÁÄÁÔØ ÍÁËÓÉÍÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÔÅËÓÔÁ ÔÜÇÁ Ñ×ÎÏ*/ + {"min",1,0,'m'}, /* ÚÁÄÁÔØ ÍÉÎÉÍÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÔÅËÓÔÁ ÔÜÇÁ Ñ×ÎÏ*/ + {"range",1,0,'r'}, /* õËÁÚÁÔØ ËÏÌÉÞÅÓÔ×Ï ËÌÁÓÓÏ×, ËÏÔÏÒÏÅ ÚÁÄÅÊÓÔ×Ï×ÁÔØ*/ + {"8-but",0,0,'8'}, /* ÜË×É×ÁÌÅÎÔ --range=255 */ + {"offsite",1,0,'O'}. /* ÚÁÄÁÔØ offsite. ðÏ ÕÍÏÌÞÁÎÉÀ 0 */ + {"base",1,0,'b'}, /*æÁÊÌ, ÏÔËÕÄÁ ÓÌÉÚÁÔØ ËÏÏÒÄÉÎÁÔÎÕÀ ÓÉÓÔÅÍÕ É ÒÁÚÍÅÒ ÑÞÅÊËÉ*/ + {"direct",0,0,'D'}, /*óÞÉÔÁÔØ ÞÔÏ ÔÅËÓÔ ÔÜÇÁ ÃÅÌÏÅ ÞÉÓÌÏ É ÐÉÓÁÔØ ÅÇÏ × ÆÁÊÌ*/ + {"delimiter",1,0,d}, /* òÁÚÄÅÌÉÔÅÌØ ÐÏÌÅÊ ×Ï ×ÈÏÄÎÏÍ ÆÁÊÌÅ*/ + {"verbose",0,0,'%'}, + {"cell-size",1,0,'c'} /* òÁÚÍÅÒ ÑÞÅÊËÉ. ïÞÅÎØ ÐÏÌÅÚÅÎ, ÅÓÌÉ -b ÎÅ ÚÁÄÁÎ */ + {"output-file",1,0,'o'}, + {NULL,0,0,0}}; + int index,c;char *endptr; + int x1=32767,y1=32767,x2=-32767,y2=-32767, + result,verbose=0; + while ((c=getopt_long(argc,argv,"m:%o:",long_options,&index))!=-1) diff --git a/epu/window.c b/epu/window.c new file mode 100644 index 0000000..e544139 --- /dev/null +++ b/epu/window.c @@ -0,0 +1,85 @@ +#include +#include +#include +#include +#include +#include "epp.h" +#include "eppl_ut.h" +EPP *old,*new; +int recalc=0; +int copy_cell(int col,int row,int value) +{ return epp_get(old,col,row); +} +void help(int exitcode) +{ printf("Usage window [-a%%] input_file fr lr fc lc [output_file]\n" + "coordinates are given in rows/cols unless -a option specified\n"); + exit(exitcode); +} +void error(char *msg) +{ fprintf(stderr,"%s\n",msg); + exit(1); +} +int get_coord_alt(char *param,int (*convert)(EPP *,double)) +{ double tmp; + char *endptr; + tmp=strtod(param,&endptr); + if (*endptr) error("Invalid coordinate"); + return convert(old,tmp); +} +int get_coord_int(char *param,int (*convert)(EPP *,double)) +{ int tmp; + char *endptr; + tmp=strtol(param,&endptr,0); + if (*endptr) error("Invalid coordinate"); + return tmp; +} + +int main(int argc,char **argv) +{char outname[1024]="window.out.epp"; + int (*get_coord)(char *,int (*)(EPP *,double))=get_coord_int; + int x1,y1,x2,y2; + int c,index,nonopt=1,verbose=0,result; + for(index=1;index=y2) error("Negative number of rows"); + if (!recalc) x2++; + if (x1>=x2) error("Negative number of columns"); + Create16bit=old->kind==16; + if(!(new=creat_epp(outname,x1,y1,x2-1,y2-1, + alt_x(old,x1),alt_y(old,y1),alt_x(old,x2),alt_y(old,y2), + 100,0,old->offsite))) error("Cannot create output file"); + install_progress_indicator(verbose?show_percent:check_int); + result=clear_progress(for_each_cell(new,copy_cell)); + close_epp(old); + + close_epp(new); + if (result) unlink(outname); + return -result; +} diff --git a/fgis.rc b/fgis.rc new file mode 100644 index 0000000..d432c19 --- /dev/null +++ b/fgis.rc @@ -0,0 +1,30 @@ +lappend auto_path $fGIS_HOME/tcl +array set fgis_font { +1 -cronyx-times-medium-r-normal--10-100-75-75-p-54-koi8-r +1b -cronyx-times-bold-r-normal--10-100-75-75-p-54-koi8-r +2 -cronyx-times-medium-r-normal--12-120-75-75-p-64-koi8-r +2b -cronyx-times-bold-r-normal--12-120-75-75-p-64-koi8-r +3 -cronyx-times-medium-r-normal--14-100-100-100-p-54-koi8-r +3b -cronyx-times-bold-r-normal--14-100-100-100-p-54-koi8-r +4 -cronyx-times-medium-r-normal--18-180-75-75-p-94-koi8-r +4b -cronyx-times-bold-r-normal--18-180-75-75-p-94-koi8-r +} +array set fgis_fontmap [list \ +$fgis_font(1) {Times-Roman 10}\ +$fgis_font(2) {Times-Roman 12}\ +$fgis_font(3) {Times-Roman 14}\ +$fgis_font(4) {Times-Roman 18}\ +$fgis_font(1b) {Times-Bold 10}\ +$fgis_font(2b) {Times-Bold 12}\ +$fgis_font(3b) {Times-Bold 14}\ +$fgis_font(4b) {Times-Bold 18}] +array set fgis { +printer lp +printcmd /usr/bin/lpr +orient n +print_colormode color +shift_factor 0.75 +undefined_legend "Not defined" +coordformat "X=%0.8g Y=%0.8g" +} +if [file exists ~/.fgisrc] {source ~/.fgisrc} diff --git a/include/Makefile b/include/Makefile new file mode 100644 index 0000000..2539d3c --- /dev/null +++ b/include/Makefile @@ -0,0 +1,14 @@ +RCS/%,v : % + ci -u $< +SRC=\ +RCS/clr.h,v\ +RCS/defpal.h,v\ +RCS/dgt.h,v\ +RCS/epp.h,v\ +RCS/epp_err.h,v\ +RCS/eppl.h,v\ +RCS/eppl_ut.h,v\ +RCS/reclass.h,v + +rcs: ${SRC} + diff --git a/include/clr.h b/include/clr.h new file mode 100644 index 0000000..a0ee660 --- /dev/null +++ b/include/clr.h @@ -0,0 +1,6 @@ + +typedef int *PALETTE; +PALETTE default_palette; +PALETTE read_palette(FILE *f); +char *ppm_pixel(PALETTE palette,int index); + diff --git a/include/defpal.h b/include/defpal.h new file mode 100644 index 0000000..c677e75 --- /dev/null +++ b/include/defpal.h @@ -0,0 +1,256 @@ +0x000000, +0xff0000, +0x00ff00, +0xa5a5ff, +0xffff00, +0xff00ff, +0x00ffff, +0xa5a5a5, +0xffa500, +0xa55000, +0x00a500, +0x0000ff, +0xa5a500, +0xa500a5, +0x00a5a5, +0xdadada, +0x959595, +0x006060, +0x008989, +0x00adad, +0x00d6d6, +0x00ffff, +0x18cefa, +0x30a9fa, +0x4891fa, +0x6081fa, +0x7d7dff, +0x5d005d, +0x850085, +0xad00ad, +0xd600d6, +0xff00ff, +0xfa18e6, +0xfa30d2, +0xfa48c6, +0xfa60be, +0xff7dbe, +0x000030, +0x000060, +0x000095, +0x0000ca, +0x0000ff, +0x2410ea, +0x4420da, +0x5d34c6, +0x7144b6, +0x5454a1, +0x303000, +0x606000, +0x959500, +0xcaca00, +0xffff00, +0xeaea10, +0xdada20, +0xc6c634, +0xb6b644, +0xa1a154, +0x003000, +0x006000, +0x009500, +0x00ca00, +0x00ff00, +0x10e610, +0x24d224, +0x3cbe3c, +0x4ca94c, +0x649564, +0x300000, +0x600000, +0x950000, +0xca0000, +0xff0000, +0xe61010, +0xd22424, +0xbe3c3c, +0xa94c4c, +0x956464, +0x3cbebe, +0x3ca1be, +0x3c85be, +0x3c69be, +0x3c48be, +0x483cbe, +0x693cbe, +0x853cbe, +0xa13cbe, +0xbe3cbe, +0xbe3ca1, +0xbe3c89, +0xbe3c71, +0xbe3c58, +0xbe3c40, +0xbe543c, +0xbe713c, +0xbe893c, +0xbea13c, +0xbebe3c, +0xa1be3c, +0x69be3c, +0x3cbe48, +0x3cbe81, +0x3cbebe, +0x602800, +0x953c00, +0xca5000, +0xff6900, +0xff8530, +0x141414, +0x303030, +0x484848, +0x646464, +0x7d7d7d, +0x959595, +0xadadad, +0xc6c6c6, +0xe2e2e2, +0xfafafa, +0x007dff, +0x00ffff, +0xbe7d00, +0x00d603, +0xa500a5, +0xb16400, +0xd69548, +0xffa5a5, +0xffca95, +0x00caff, +0x00ffca, +0x606060, +0xff3c3c, +0xffa550, +0x5050ff, +0x0050ff, +0xff5000, +0xbe3c00, +0xbe1414, +0x000000, +0xdaffda, +0xffff00, +0xff00ff, +0xa5a5a5, +0xff7d00, +0xff0000, +0x7dff00, +0x007d00, +0x50b100, +0x0000ff, +0x007dff, +0x00ffff, +0xbe7d00, +0x00d600, +0xa500a5, +0xb16400, +0xd69548, +0xffa5a5, +0xffca95, +0x00caff, +0x00ffca, +0x606060, +0xff3c3c, +0xffa550, +0x5050ff, +0x0050ff, +0xff5000, +0xbe3c03, +0xbe1414, +0x000003, +0xdaeaff, +0xffff00, +0xff00ff, +0xa5a5a5, +0xff7d00, +0xff0000, +0x7dff00, +0x007d00, +0x50b100, +0x0000ff, +0x007dff, +0x00ffff, +0xbe7d00, +0x00d600, +0xa500a5, +0xb16400, +0xd69548, +0xffa5a5, +0xffca95, +0x00caff, +0x00ffca, +0x606060, +0xff3c3c, +0xffa550, +0x5050ff, +0x0050ff, +0xff5000, +0xbe3c03, +0xbe1414, +0x000000, +0xffdada, +0xffff00, +0xff00ff, +0xa5a5a5, +0xff7d00, +0xff0000, +0x7dff00, +0x007d00, +0x50b100, +0x0000ff, +0x007dff, +0x00ffff, +0xbe7d00, +0x00d603, +0xa500a5, +0xb16400, +0xd69548, +0xffa5a5, +0xffca95, +0x00caff, +0x00ffca, +0x606060, +0xff3c3c, +0xffa550, +0x5050ff, +0xbe3c00, +0xbe1414, +0x000000, +0xffdaff, +0xffff00, +0xff00ff, +0xa5a5a5, +0xff7d00, +0xff0000, +0x7dff00, +0x007d00, +0x50b100, +0x0000ff, +0x007dff, +0x00ffff, +0xbe7d00, +0x00d600, +0xa500a5, +0xb16400, +0xd69548, +0xffa5a5, +0xffca95, +0x00caff, +0x00ffca, +0x606060, +0xff3c3c, +0xffa550, +0x5050ff, +0x0050ff, +0xff5000, +0xbe3c00, +0xbe1414, +0x000000, +0xffffff, diff --git a/include/dgt.h b/include/dgt.h new file mode 100644 index 0000000..c7d454a --- /dev/null +++ b/include/dgt.h @@ -0,0 +1,164 @@ +#ifndef DGT_H +#define DGT_H +# include +#ifndef EPPL_H +# include "eppl.h" +#endif +#ifndef EPP_ERR_H +# include "epp_err.h" +#endif +#define MAX_LINE_LEN 500 +typedef struct POINT { short int x,y; } POINT; +typedef struct DGT_ITEM { long int ID; + short int x1,y1,x2,y2; + short int npoints; + POINT s[MAX_LINE_LEN]; + } DGT_ITEM; +struct ITEM_AS_POINT {long int ID; + POINT p; + }; +typedef struct DGT { double XLeft,YBottom,XRight,YTop; + int mode; + int item_no; + unsigned char projection; + DGT_ITEM* buffer; + int limit; + void* F; + int eof; + int modified; + int (*next_item)(struct DGT* buffer); + void (*rewind) (struct DGT *d); + void (*dispose) (void *f); + int (*cmp_item)(DGT_ITEM* i1,DGT_ITEM* i2); + } DGT; +#define KEEP_OLD_VALUE -32768 + +DGT* open_dgt(char *filename); +/*opens existing file, given by name*/ +DGT* fopen_dgt(FILE *f); +/* open existing file given by file variable */ +DGT* creat_dgt(char *filename,double x_left,double y_bottom, + double x_right,double y_top, unsigned char proj); +/* creates file with given limits with given name */ +DGT* fcreat_dgt(FILE *f ,double x_left,double y_bottom, + double x_right,double y_top,unsigned char proj); +/* creates dgt file with given limits in given stream */ +DGT* mcreat_dgt(double x_left,double y_bottom, + double x_right,double y_top, unsigned char proj); +/* creates empty dgt in memory with given limits*/ +DGT* creat_dgt_as(char *filename,DGT* pattern); +DGT* fcreat_dgt_as(FILE *f,DGT *pattern); +DGT* mcreat_dgt_as(DGT *pattern); +/* creates file, with limits as in given file */ + +int load_dgt(DGT* dgt); +/* loads file opened for reading into memory */ +void save_dgt(DGT* dgt,FILE *f); +/* saves loaded file*/ +void close_dgt(DGT* dgt); +/* Destroys DGT object */ +void reset_dgt(DGT* dgt); +/* rewinds dgt file for first item, reopens for reading,if nessecary */ +DGT_ITEM* dgt_get(DGT* dgt); +/* allocates current item in memory and returns pointer to it*/ +void dgt_put(DGT *dgt, DGT_ITEM* item); +/* inserts item in writable file*/ +void dgt_replace(DGT *dgt, int index, DGT_ITEM *item); +/* replaces item number index with given item (memory files only*/ +DGT_ITEM* dgt_item_ptr(DGT *dgt, int index); +/* returns pointer to specified item without copiing it*/ +#define dgt_next(dgt) ((dgt)->next_item(dgt)) +/* flushes current item buffer */ +void dgt_seek(DGT *dgt,int index); +/* makes item with given number current (for memory files only)*/ +void chk_mask(DGT_ITEM* item); +/*set correct values of bounding rectangle*/ +void dgt_sort(DGT *dgt,int (*compare_func)(DGT_ITEM *i1,DGT_ITEM *i2)); + +void for_each_line(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream); +void for_each_point(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream); +/* Applies given item_proc to each item of given type in file. If outstream + not NULL, + copies all items (inclding those, which are not a subject of item_proc + to outstream */ +void for_each_item(DGT *dgt,void (*item_proc)(DGT *dgt)); +/* Applies given item_proc to each item in file. If items to be copied + to other stream, item_proc has to do it itself */ +/* coordinate recalculation */ + + +int dgt_x(DGT* dgt,double x); +int dgt_y(DGT* dgt,double y); + +double real_x(DGT* dgt,int x); +double real_y(DGT* dgt,int y); +double real_dx(DGT* dgt,int dx); +double real_dy(DGT* dgt,int dy); +double dgt_dist(DGT* dgt,int x1,int y1,int x2,int y2); +double dgt_pdist(DGT* dgt,POINT p1,POINT p2); +long int sq_dist(DGT* dgt,int x1,int y1,int x2,int y2); +long int sq_pdist(DGT* dgt,POINT p1,POINT p2); +long int sq_const(DGT* dgt,double dist); +/* item modification */ +#define dgt_touch(x) ((x)->modified=1); +void item_set_id(DGT_ITEM *item,long int newID); +#define dgt_set_id(x,ID) ((x)->modified=1,item_set_id((x)->buffer,ID)) +void dgt_set_point(DGT *dgt,int x,int y); +int dgt_add_node(DGT *dgt,int x,int y); +int dgt_ins_node(DGT *dgt,int index,int x,int y); +int item_mv_node(DGT_ITEM *item,int index,int x,int y); +#define dgt_mv_node(d,index,x,y) ((d)->modified=1,item_mv_node((d)->buffer,index,x,y)) +int dgt_rm_node(DGT *dgt,int index); +int dgt_split(DGT *dgt,int index); +int dgt_cut_segment(DGT *dgt,int index); +/* item utilities */ +DGT_ITEM* alloc_item(DGT_ITEM* item); +/* allocates new copy of item */ +/* Macros for access current item */ +#define dgt_item(x) (((DGT *)(x))->buffer) +/* returns pointer to current item */ +#define dgt_line_len(x) (((DGT *)(x))->buffer->npoints) +/* returns lile length (number of points) in current item*/ + +/* following macros provide a read/write access to current item */ +#define dgt_id(x) (((DGT *)(x))->buffer->ID) +/* ID of current item */ +#define dgt_node(x,i) (((DGT *)(x))->buffer->s[i]) + +/* node #i (0 - (line_len-1)) */ +#define dgt_nx(d,i) (((DGT *)(d))->buffer->s[i].x) +#define dgt_ny(d,i) (((DGT *)(d))->buffer->s[i].y) +#define dgt_xl(x) (((DGT *)(x))->buffer->x1) +/* left limit of bounding rectangle */ +#define dgt_xr(x) (((DGT *)(x))->buffer->x2) +/* right limit of bounding rectangle */ +#define dgt_yb(x) (((DGT *)(x))->buffer->y1) +/* bottom limit of bounding rectangle */ +#define dgt_yt(x) (((DGT *)(x))->buffer->y1) +/* top limit of bounding rectangle */ +#define dgt_pointx(x) (((DGT *)(x))->buffer->x1) +/* X of label point (if current object is label point)*/ +#define dgt_pointy(x) (((DGT *)(x))->buffer->y1) +/* Y of label point (if current object is label point)*/ +#define dgt_is_line(x) (((DGT *)(x))->buffer->npoints) +/* non-zero if current item is line */ +#define dgt_is_point(x) (!(((DGT *)(x))->buffer->npoints)) +/* non-zero if current item is point */ +#define dgt_point(x) (((((struct ITEM_AS_POINT *)(((DGT *)(x))->buffer)))->p)) +#define dgt_eof(x) (((DGT *)(x))->eof) +/*macros for access item, given by pointer*/ +#define item_id(x) ((x)->ID) +#define item_node(x,i) ((x)->s[i]) +#define item_xn(d,i) ((d)->s[i].x) +#define item_yn(d,i) ((d)->s[i].y) +#define item_xl(x) ((x)->x1) +#define item_xr(x) ((x)->x2) +#define item_yb(x) ((x)->y1) +#define item_yt(x) ((x)->y2) +#define point_x(x) ((x)->x1) +#define point_y(x) ((x)->y1) +#define item_len(x) ((x)->npoints) +#define item_point(x) (((struct ITEM_AS_POINT *)(x))->p) + +#endif + diff --git a/include/epp.h b/include/epp.h new file mode 100644 index 0000000..0479d6d --- /dev/null +++ b/include/epp.h @@ -0,0 +1,148 @@ +/* Epp file access definition */ +# ifndef EPP_H +# define EPP_H +# include +#ifndef EPPL_H +# include "eppl.h" +#endif +#ifndef EPP_ERR_H +# include "epp_err.h" +#endif +/* this structure defines internal representation of open EPP file */ +typedef struct EPP { int fr,lr,fc,lc; + double XLeft,YBottom,XRight,YTop; + double cell_area; + int offsite; + int mode; + unsigned short *widthtable, *row; + int kind; + FILE *F; + int min,max; + int width; + int currentline; + long filepos; + int cache_size; + void *cache; + int *counttable; + unsigned char *packed_buffer; + void (*position)(struct EPP* epp,int row); + int modified; + } EPP; +/*this structure used for simulatenouis operations on files with + different cell size*/ +typedef struct { int ax,bx,cx, + ay,by,cy; + } LINK_BUFFER,*EPP_LINK; + +EPP *open_epp(char *pathname); +EPP *fopen_epp(FILE *f); +/* opens existing EPP file */ +EPP *creat_epp(char *pathname,int first_col,int first_row,int last_col, + int last_row, double AXLeft,double AYTop, double AXRight, + double AYBottom, int scale, int base, int offsite); +EPP *fcreat_epp(FILE *f,int first_col,int first_row,int last_col, + int last_row, double AXLeft,double AYTop, double AXRight, + double AYBottom, int scale, int base, int offsite); + +/* creating epp file from scratch. All fields which are not defined as + parameters, are filled by default values. Kind depends of global variable + Create16bit */ +extern int Create16bit; /* if non-zero, all created EPP files would be 16 bit*/ +int set_epp_cache(EPP* epp,int lines); +/* set cache to lines lines. to keep accessed lines in memory. + affects only MAP_INPUT files*/ +EPP* load_epp(char *filename); +/* loads EPP file given by name into memory. Keeps open file for saving*/ +EPP* fload_epp(FILE *f); +/* loads EPP from given file. */ +int load_new_epp(EPP *f); +/* fills write-only file with offsite and reopens it for read-write */ +int save_epp(EPP* epp); +/* flushes file, loaded into memory + If file isn't modified, does nothing. + */ + +#define touch_epp(epp) ((epp)->mode|=MAP_MODIFIED) +/* marks file as modified to ensure that it would be actually written + by save_epp */ + +int save_epp_as(EPP* epp,char *newname); +/* saves loaded epp under new filename, making new stream default for this epp*/ +int fsave_epp_as(EPP* epp,FILE *f); +/* saves loaded epp into new stream, making it default */ +int epp_expand(EPP *epp); +/* converts loaded epp into file with greater depth */ +EPP *creat_epp_as(char *pathname,EPP *pattern); +EPP *fcreat_epp_as(FILE *f,EPP *pattern); +/* creates new epp file, copiing a most header fields from given file */ +void fast_convert_to_8bit(EPP *source,char *filename); +/* given a 16-bit epp file open for writing, writes a 8-bit epp file + containing low bytes from all pixels of source files. Closes both files + after that */ +void get_epp_header(EPP* epp, EPPHEADER *h); +/* reads header of EPP file */ +void change_epp_header(EPP* epp,EPPHEADER h); +/* changes several fields of EPP file */ +void setcomment(EPP *epp,char *comment); +/* change comment of epp file, which was open by creat_epp or creat_epp_as */ + +char *getcomment(EPP *epp); +/* returns comment of EPP file (address of static buffer,which would be + overriden by next call */ +int shift_epp(EPP *epp,int new_fr,int new_fc); +/* shifts row and col numbers to make fr and fc equial to fr and fc. + returns non-zero on success, zero, if some of boundaries hit signed short + limits */ + +typedef int (*EPP_ITER_PROC)(int col,int row,int value); + +int for_each_cell(EPP *epp, EPP_ITER_PROC action); +/* performs given operation for each non-offsite cell of existing EPP file + (terminated if action returns non-zero, + or performs operation for each cell of created EPP file, filling cell + by value, returned by action. value parameter in this case always containt + offsite of epp */ +long count_cells(EPP *epp, EPP_ITER_PROC condition); +/* calls condition for each non-offsite cell in existing epp file, returns + count of cells, for which condition was non-zero */ +extern int (*EndLineProc)(int row,int seqno,int total); +/* if not NULL, this function called from for_each_cell and count_cells + after processing of each line. If it returns non-zero, processing + terminated */ + +void reset_epp(EPP *epp); +/* reopens epp file for reading. if file was in create mode, fills all non-filled +lines by offsite */ + +unsigned short int *epp_getline(EPP *epp,int x,int y); +/* returns pointer to array of integer, which represents line y of raster, + starting from col x. NULL if x is within boundares of epp */ +void close_epp(EPP *epp); +/*********** coordinate recalculation **********/ +int epp_row(EPP *epp,double y);/* returns row by given alternate y */ +int epp_col(EPP *epp,double x);/* returns col for given alternate x */ +double alt_x(EPP *epp,int col);/* returns alternate x for given col */ +double alt_y(EPP *epp,int row);/* returns alternate y for given row */ +double alt_xc(EPP *epp,int col);/* returns alternate x for given col */ +double alt_yc(EPP *epp,int row);/* returns alternate y for given row */ +/**** this was private in pascal version ********/ +void get_row(EPP *epp);/* reads and unpacks row of epp file */ +void put_row(EPP *epp);/* packs and writes row */ +/********* compatibility of files *************/ +int compare_cell_size(EPP *f1,EPP *f2); +int is_aligned(EPP *f1,EPP *f2); +EPP_LINK link_epp(EPP *base,EPP *overlay); +int linked_row(EPP_LINK link,int row); +int linked_col(EPP_LINK link,int col); +# endif diff --git a/include/epp_err.h b/include/epp_err.h new file mode 100644 index 0000000..d53537a --- /dev/null +++ b/include/epp_err.h @@ -0,0 +1,26 @@ +#ifndef EPP_ERR_H +#define EPP_ERR_H +extern int map_error; /* after each operation contains error code */ +# define ME_POINT_OUTSIDE 1 +/* given coorndates are outside given epp file */ +# define ME_INVALID_MODE 2 +/* operation is non allowed for this mode */ +# define ME_READ_ERROR 3 +/* something wrong with reading file */ +# define ME_WRITE_ERROR 4 +/* disk full or something wrong writing file */ +# define ME_INVALID_PUT 5 +/* epp_put above current line */ +# define ME_OUT_OF_MEMORY 6 +# define ME_ACCESS_DENIED 7 +# define ME_NO_FILE 8 +# define ME_INVALID_FILE 9 +# define ME_CREATE_ERROR 10 +/* Return values for dgt item modification function */ +# define DGT_SUCCESS 0 +# define DGT_LINE_TOO_LONG 1 +# define DGT_ZERO_SEGMENT 2 +# define DGT_INVALID_NODE 3 +# define DGT_LINE_TOO_SHORT 4 +# define DGT_BAD_SPLIT_POINT 5 +#endif diff --git a/include/eppl.h b/include/eppl.h new file mode 100644 index 0000000..cd9fbb9 --- /dev/null +++ b/include/eppl.h @@ -0,0 +1,74 @@ +/**********************************************************************/ +/* Common include file for epp and dgt file access */ +/**********************************************************************/ +#ifndef EPPL_H +# define EPPL_H + +/* attempt to make epp.c portable to machines with non-intel CPU */ +# define LSB_FIRST +/* if defined, get_row and put_row thinks, that least significant byte + is first in int variable */ + +/* Area unit definition */ +# define AREA_NO_UNIT 0 +# define AREA_SQ_FOOT 1 +# define AREA_SQ_METER 2 +# define AREA_SQ_KM 3 +# define AREA_SQ_MILE 4 +# define AREA_HECTARE 5 +# define AREA_ACRE 6 + +/* Coordinate system definition */ +# define COORD_NONE 0 +# define COORD_UTM 1 +# define COORD_STPLANE 2 +# define COORD_LL 3 + +/* values for mode field of EPP */ +# define MAP_INPUT 1 +# define MAP_OUTPUT 2 +# define MAP_LOADED 4 +# define MAP_CACHED 8 +# define MAP_MODIFIED 128 +/* this structure defines 128-byte header of EPP file. + it assumes that all numeric types are in Intel format + short - 16-bit, lsb first, + long 32-bit, lsb first + double - 64-bit IEEE conforming */ +typedef struct EPPHEADER { short int fr,lr,fc,lc;/* last and first row/column */ + double fry,lry,fcx,lcx;/*corresponding alternative + coordinates*/ + short int kind;/* 8 or 16 bit file */ + short int base,scale; + unsigned short int offsite; /* blank class */ + double sfact; /* cell area */ + long access_ptr; /* file offset of width table */ + unsigned short minclass, maxclass; /* class limits. unused in + 8-bit files */ + char area_unit; + char coord_sys; + char Reserved[6]; + char date[16], time[8];/* ASCII date and time */ + char comment[32]; } EPPHEADER; +typedef struct DGTHEADER {double xleft,ybottom,xright,ytop; + long maxpt,maxline; + short kind; + char coord_sys; + char reserved[85]; + } DGTHEADER; + +#ifndef LSB_FIRST + + short swapshort(short x); + long swaplong(long x); + double swapdouble(double x); +#else +# define swapshort(x) (x) +# define swaplong(x) (x) +# define swapdouble(x) (x) +#endif + +#endif + +/* Here is the end of this file */ + diff --git a/include/eppl_ut.h b/include/eppl_ut.h new file mode 100644 index 0000000..f5db53e --- /dev/null +++ b/include/eppl_ut.h @@ -0,0 +1,19 @@ +#ifndef EPPL_UT_H +#define EPPL_UT_H +#include +#include +#include +#define LIBDIR "/usr/local/lib/fgis/" +FILE *lookup_file(const char *name,const char *suffix,const char *dir); +/* éÝÅÔ ÆÁÊÌ ÓÎÁÞÁÌÁ × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, ÐÏÔÏÍ × ÄÉÒÅËÔÏÒÉÉ + dir × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, ÐÏÔÏÍ × /usr/local/lib/fgis/$dir */ +char *default_ext(const char *filename,const char *ext); +char *force_ext(const char *filename,const char *ext); +char *last_ext(const char *name); +int show_progress(int row,int seqno,int total); +int check_int(int row,int seqno, int total); +int show_percent(int row,int seqno,int total); +void install_progress_indicator(int (*)(int,int,int)); +int clear_progress(int success); +void show_version(char *name,char *RCS_ID); +#endif diff --git a/include/getopt.h b/include/getopt.h new file mode 100644 index 0000000..d751c6b --- /dev/null +++ b/include/getopt.h @@ -0,0 +1,132 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if __STDC__ +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/include/reclass.h b/include/reclass.h new file mode 100644 index 0000000..4043c87 --- /dev/null +++ b/include/reclass.h @@ -0,0 +1,30 @@ +#ifndef RECLASS_H +#define RECLASS_H + +#include + +typedef unsigned short int * RECLASS; +/* */ +extern int interactive_parser; +RECLASS create_reclass_table(int size); +RECLASS parse_statements(int size,RECLASS src,int (*recl_getc)()); +RECLASS make_reclass_table(EPP *infile,int (*recl_getc)()); +/* óÏÚÄÁÅÔ ÇÌÏÂÁÌØÎÕÀ ÔÁÂÌÉÃÕ ÒÅËÌÁÓÓÁ ÄÌÑ ÆÁÊÌÁ infile. + ïÐÅÒÁÔÏÒÙ ÒÅËÌÁÓÓÁ ÞÉÔÁÀÔÓÑ Ó ÐÏÍÏÝØÀ ÆÕÎËÃÉÉ recl_getc, ËÏÔÏÒÁÑ + ÚÁ ÏÄÉÎ ÒÁÚ ×ÏÚ×ÒÁÝÁÅÔ ÏÄÉÎ ÓÉÍ×ÏÌ. +*/ +RECLASS wrapped_reclass(EPP *infile,int white); + + + +/* óÏÚÄÁÅÔ ÒÅËÌÁÓÓ ÐÏ ÕÍÏÌÞÁÎÉÀ (offsite=white,0=0, ÏÓÔÁÌØÎÙÅ (c-1)%(white-1)+1;*/ +#define epp_table_size(epp) ((epp)->max>(epp)->offsite?(epp)->max:(epp)->offsite) + +#define default_reclass(epp) create_reclass_table(epp_table_size(epp)) + + +/* ÐÒÉÓ×ÏÊÔÅ ÜÔÏÊ ÐÅÒÅÍÅÎÎÏÊ ÎÅÎÕÌÅ×ÏÅ ÚÎÁÞÅÎÉÅ, ÅÓÌÉ ××ÏÄ + ÏÐÅÒÁÔÏÒÏ× reclass ÐÒÏÉÓÈÏÄÉÔ Ó ËÌÁ×ÉÁÔÕÒÙ É ÐÏÌØÚÏ×ÁÔÅÌØ ÍÏÖÅÔ, + ÐÏÌÕÞÉ× ÓÏÏÂÝÅÎÉÅ Ï ÏÛÉÂËÅ ÐÅÒÅ××ÅÓÔÉ ÓÔÒÏËÕ ÚÁÎÏ×Ï*/ + +#endif diff --git a/include/regex.h b/include/regex.h new file mode 100644 index 0000000..a495005 --- /dev/null +++ b/include/regex.h @@ -0,0 +1,490 @@ +/* Definitions for data structures and routines for the regular + expression library, version 0.12. + + Copyright (C) 1985, 89, 90, 91, 92, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef __REGEXP_LIBRARY_H__ +#define __REGEXP_LIBRARY_H__ + +/* POSIX says that must be included (by the caller) before + . */ + +#ifdef VMS +/* VMS doesn't have `size_t' in , even though POSIX says it + should be there. */ +#include +#endif + + +/* The following bits are used to determine the regexp syntax we + recognize. The set/not-set meanings are chosen so that Emacs syntax + remains the value 0. The bits are given in alphabetical order, and + the definitions shifted by one from the previous bit; thus, when we + add or remove a bit, only one other definition need change. */ +typedef unsigned reg_syntax_t; + +/* If this bit is not set, then \ inside a bracket expression is literal. + If set, then such a \ quotes the following character. */ +#define RE_BACKSLASH_ESCAPE_IN_LISTS (1) + +/* If this bit is not set, then + and ? are operators, and \+ and \? are + literals. + If set, then \+ and \? are operators and + and ? are literals. */ +#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) + +/* If this bit is set, then character classes are supported. They are: + [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], + [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. + If not set, then character classes are not supported. */ +#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) + +/* If this bit is set, then ^ and $ are always anchors (outside bracket + expressions, of course). + If this bit is not set, then it depends: + ^ is an anchor if it is at the beginning of a regular + expression or after an open-group or an alternation operator; + $ is an anchor if it is at the end of a regular expression, or + before a close-group or an alternation operator. + + This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because + POSIX draft 11.2 says that * etc. in leading positions is undefined. + We already implemented a previous draft which made those constructs + invalid, though, so we haven't changed the code back. */ +#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) + +/* If this bit is set, then special characters are always special + regardless of where they are in the pattern. + If this bit is not set, then special characters are special only in + some contexts; otherwise they are ordinary. Specifically, + * + ? and intervals are only special when not after the beginning, + open-group, or alternation operator. */ +#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) + +/* If this bit is set, then *, +, ?, and { cannot be first in an re or + immediately after an alternation or begin-group operator. */ +#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) + +/* If this bit is set, then . matches newline. + If not set, then it doesn't. */ +#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) + +/* If this bit is set, then . doesn't match NUL. + If not set, then it does. */ +#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) + +/* If this bit is set, nonmatching lists [^...] do not match newline. + If not set, they do. */ +#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) + +/* If this bit is set, either \{...\} or {...} defines an + interval, depending on RE_NO_BK_BRACES. + If not set, \{, \}, {, and } are literals. */ +#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) + +/* If this bit is set, +, ? and | aren't recognized as operators. + If not set, they are. */ +#define RE_LIMITED_OPS (RE_INTERVALS << 1) + +/* If this bit is set, newline is an alternation operator. + If not set, newline is literal. */ +#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) + +/* If this bit is set, then `{...}' defines an interval, and \{ and \} + are literals. + If not set, then `\{...\}' defines an interval. */ +#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) + +/* If this bit is set, (...) defines a group, and \( and \) are literals. + If not set, \(...\) defines a group, and ( and ) are literals. */ +#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) + +/* If this bit is set, then \ matches . + If not set, then \ is a back-reference. */ +#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) + +/* If this bit is set, then | is an alternation operator, and \| is literal. + If not set, then \| is an alternation operator, and | is literal. */ +#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) + +/* If this bit is set, then an ending range point collating higher + than the starting range point, as in [z-a], is invalid. + If not set, then when ending range point collates higher than the + starting range point, the range is ignored. */ +#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) + +/* If this bit is set, then an unmatched ) is ordinary. + If not set, then an unmatched ) is invalid. */ +#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) + +/* This global variable defines the particular regexp syntax to use (for + some interfaces). When a regexp is compiled, the syntax used is + stored in the pattern buffer, so changing this does not affect + already-compiled regexps. */ +extern reg_syntax_t re_syntax_options; + +/* Define combinations of the above bits for the standard possibilities. + (The [[[ comments delimit what gets put into the Texinfo file, so + don't delete them!) */ +/* [[[begin syntaxes]]] */ +#define RE_SYNTAX_EMACS 0 + +#define RE_SYNTAX_AWK \ + (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ + | RE_UNMATCHED_RIGHT_PAREN_ORD) + +#define RE_SYNTAX_POSIX_AWK \ + (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS) + +#define RE_SYNTAX_GREP \ + (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ + | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ + | RE_NEWLINE_ALT) + +#define RE_SYNTAX_EGREP \ + (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ + | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ + | RE_NO_BK_VBAR) + +#define RE_SYNTAX_POSIX_EGREP \ + (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) + +/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ +#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC + +#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC + +/* Syntax bits common to both basic and extended POSIX regex syntax. */ +#define _RE_SYNTAX_POSIX_COMMON \ + (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ + | RE_INTERVALS | RE_NO_EMPTY_RANGES) + +#define RE_SYNTAX_POSIX_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) + +/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes + RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this + isn't minimal, since other operators, such as \`, aren't disabled. */ +#define RE_SYNTAX_POSIX_MINIMAL_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) + +#define RE_SYNTAX_POSIX_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ + | RE_UNMATCHED_RIGHT_PAREN_ORD) + +/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS + replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ +#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) +/* [[[end syntaxes]]] */ + +/* Maximum number of duplicates an interval can allow. Some systems + (erroneously) define this in other header files, but we want our + value, so remove any previous define. */ +#ifdef RE_DUP_MAX +#undef RE_DUP_MAX +#endif +#define RE_DUP_MAX ((1 << 15) - 1) + + +/* POSIX `cflags' bits (i.e., information for `regcomp'). */ + +/* If this bit is set, then use extended regular expression syntax. + If not set, then use basic regular expression syntax. */ +#define REG_EXTENDED 1 + +/* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ +#define REG_ICASE (REG_EXTENDED << 1) + +/* If this bit is set, then anchors do not match at newline + characters in the string. + If not set, then anchors do match at newlines. */ +#define REG_NEWLINE (REG_ICASE << 1) + +/* If this bit is set, then report only success or fail in regexec. + If not set, then returns differ between not matching and errors. */ +#define REG_NOSUB (REG_NEWLINE << 1) + + +/* POSIX `eflags' bits (i.e., information for regexec). */ + +/* If this bit is set, then the beginning-of-line operator doesn't match + the beginning of the string (presumably because it's not the + beginning of a line). + If not set, then the beginning-of-line operator does match the + beginning of the string. */ +#define REG_NOTBOL 1 + +/* Like REG_NOTBOL, except for the end-of-line. */ +#define REG_NOTEOL (1 << 1) + + +/* If any error codes are removed, changed, or added, update the + `re_error_msg' table in regex.c. */ +typedef enum +{ + REG_NOERROR = 0, /* Success. */ + REG_NOMATCH, /* Didn't find a match (for regexec). */ + + /* POSIX regcomp return error codes. (In the order listed in the + standard.) */ + REG_BADPAT, /* Invalid pattern. */ + REG_ECOLLATE, /* Not implemented. */ + REG_ECTYPE, /* Invalid character class name. */ + REG_EESCAPE, /* Trailing backslash. */ + REG_ESUBREG, /* Invalid back reference. */ + REG_EBRACK, /* Unmatched left bracket. */ + REG_EPAREN, /* Parenthesis imbalance. */ + REG_EBRACE, /* Unmatched \{. */ + REG_BADBR, /* Invalid contents of \{\}. */ + REG_ERANGE, /* Invalid range end. */ + REG_ESPACE, /* Ran out of memory. */ + REG_BADRPT, /* No preceding re for repetition op. */ + + /* Error codes we've added. */ + REG_EEND, /* Premature end. */ + REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ + REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ +} reg_errcode_t; + +/* This data structure represents a compiled pattern. Before calling + the pattern compiler, the fields `buffer', `allocated', `fastmap', + `translate', and `no_sub' can be set. After the pattern has been + compiled, the `re_nsub' field is available. All other fields are + private to the regex routines. */ + +struct re_pattern_buffer +{ +/* [[[begin pattern_buffer]]] */ + /* Space that holds the compiled pattern. It is declared as + `unsigned char *' because its elements are + sometimes used as array indexes. */ + unsigned char *buffer; + + /* Number of bytes to which `buffer' points. */ + unsigned long allocated; + + /* Number of bytes actually used in `buffer'. */ + unsigned long used; + + /* Syntax setting with which the pattern was compiled. */ + reg_syntax_t syntax; + + /* Pointer to a fastmap, if any, otherwise zero. re_search uses + the fastmap, if there is one, to skip over impossible + starting points for matches. */ + char *fastmap; + + /* Either a translate table to apply to all characters before + comparing them, or zero for no translation. The translation + is applied to a pattern when it is compiled and to a string + when it is matched. */ + char *translate; + + /* Number of subexpressions found by the compiler. */ + size_t re_nsub; + + /* Zero if this pattern cannot match the empty string, one else. + Well, in truth it's used only in `re_search_2', to see + whether or not we should use the fastmap, so we don't set + this absolutely perfectly; see `re_compile_fastmap' (the + `duplicate' case). */ + unsigned can_be_null : 1; + + /* If REGS_UNALLOCATED, allocate space in the `regs' structure + for `max (RE_NREGS, re_nsub + 1)' groups. + If REGS_REALLOCATE, reallocate space if necessary. + If REGS_FIXED, use what's there. */ +#define REGS_UNALLOCATED 0 +#define REGS_REALLOCATE 1 +#define REGS_FIXED 2 + unsigned regs_allocated : 2; + + /* Set to zero when `regex_compile' compiles a pattern; set to one + by `re_compile_fastmap' if it updates the fastmap. */ + unsigned fastmap_accurate : 1; + + /* If set, `re_match_2' does not return information about + subexpressions. */ + unsigned no_sub : 1; + + /* If set, a beginning-of-line anchor doesn't match at the + beginning of the string. */ + unsigned not_bol : 1; + + /* Similarly for an end-of-line anchor. */ + unsigned not_eol : 1; + + /* If true, an anchor at a newline matches. */ + unsigned newline_anchor : 1; + +/* [[[end pattern_buffer]]] */ +}; + +typedef struct re_pattern_buffer regex_t; + + +/* search.c (search_buffer) in Emacs needs this one opcode value. It is + defined both in `regex.c' and here. */ +#define RE_EXACTN_VALUE 1 + +/* Type for byte offsets within the string. POSIX mandates this. */ +typedef int regoff_t; + + +/* This is the structure we store register match data in. See + regex.texinfo for a full description of what registers match. */ +struct re_registers +{ + unsigned num_regs; + regoff_t *start; + regoff_t *end; +}; + + +/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, + `re_match_2' returns information about at least this many registers + the first time a `regs' structure is passed. */ +#ifndef RE_NREGS +#define RE_NREGS 30 +#endif + + +/* POSIX specification for registers. Aside from the different names than + `re_registers', POSIX uses an array of structures, instead of a + structure of arrays. */ +typedef struct +{ + regoff_t rm_so; /* Byte offset from string's start to substring's start. */ + regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ +} regmatch_t; + +/* Declarations for routines. */ + +/* To avoid duplicating every routine declaration -- once with a + prototype (if we are ANSI), and once without (if we aren't) -- we + use the following macro to declare argument types. This + unfortunately clutters up the declarations a bit, but I think it's + worth it. */ + +#if __STDC__ + +#define _RE_ARGS(args) args + +#else /* not __STDC__ */ + +#define _RE_ARGS(args) () + +#endif /* not __STDC__ */ + +/* Sets the current default syntax to SYNTAX, and return the old syntax. + You can also simply assign to the `re_syntax_options' variable. */ +extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); + +/* Compile the regular expression PATTERN, with length LENGTH + and syntax given by the global `re_syntax_options', into the buffer + BUFFER. Return NULL if successful, and an error string if not. */ +extern const char *re_compile_pattern + _RE_ARGS ((const char *pattern, int length, + struct re_pattern_buffer *buffer)); + + +/* Compile a fastmap for the compiled pattern in BUFFER; used to + accelerate searches. Return 0 if successful and -2 if was an + internal error. */ +extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); + + +/* Search in the string STRING (with length LENGTH) for the pattern + compiled into BUFFER. Start searching at position START, for RANGE + characters. Return the starting position of the match, -1 for no + match, or -2 for an internal error. Also return register + information in REGS (if REGS and BUFFER->no_sub are nonzero). */ +extern int re_search + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs)); + + +/* Like `re_search', but search in the concatenation of STRING1 and + STRING2. Also, stop searching at index START + STOP. */ +extern int re_search_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, int range, struct re_registers *regs, int stop)); + + +/* Like `re_search', but return how many characters in STRING the regexp + in BUFFER matched, starting at position START. */ +extern int re_match + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs)); + + +/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ +extern int re_match_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, struct re_registers *regs, int stop)); + + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using BUFFER and REGS will use this memory + for recording register information. STARTS and ENDS must be + allocated with malloc, and must each be at least `NUM_REGS * sizeof + (regoff_t)' bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + PATTERN_BUFFER will allocate its own register data, without + freeing the old data. */ +extern void re_set_registers + _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends)); + +/* 4.2 bsd compatibility. */ +extern char *re_comp _RE_ARGS ((const char *)); +extern int re_exec _RE_ARGS ((const char *)); + +/* POSIX compatibility. */ +extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags)); +extern int regexec + _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch, + regmatch_t pmatch[], int eflags)); +extern size_t regerror + _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf, + size_t errbuf_size)); +extern void regfree _RE_ARGS ((regex_t *preg)); + +#endif /* not __REGEXP_LIBRARY_H__ */ + +/* +Local variables: +make-backup-files: t +version-control: t +trim-versions-without-asking: nil +End: +*/ diff --git a/lib/Makefile b/lib/Makefile new file mode 100644 index 0000000..c4d0739 --- /dev/null +++ b/lib/Makefile @@ -0,0 +1,64 @@ +CC=gcc +CFLAGS=-g -fPIC -O2 -Wall -ansi -pedantic -I ../include +LIB_OBJS=\ +byteorder.o\ +dgt_dist.o\ +dgt_input.o\ +dgt_iter.o\ +dgt_output.o\ +epp_cache.o\ +epp_input.o\ +epp_iter.o\ +epp_loaded.o\ +epp_output.o\ +file_utils.o\ +lookup.o\ +overlay.o\ +reclass.tab.o +RCS=\ +RCS/byteorder.c,v\ +RCS/clr.c,v\ +RCS/dgt_dist.c,v\ +RCS/dgt_input.c,v\ +RCS/dgt_iter.c,v\ +RCS/dgt_output.c,v\ +RCS/epp_cache.c,v\ +RCS/epp_input.c,v\ +RCS/epp_iter.c,v\ +RCS/epp_loaded.c,v\ +RCS/epp_output.c,v\ +RCS/file_utils.c,v\ +RCS/lookup.c,v\ +RCS/overlay.c,v\ +RCS/reclass.y,v +SRC=\ +byteorder.c\ +clr.c\ +dgt_dist.c\ +dgt_input.c\ +dgt_iter.c\ +dgt_output.c\ +epp_cache.c\ +epp_input.c\ +epp_iter.c\ +epp_loaded.c\ +epp_output.c\ +file_utils.c\ +lookup.c\ +overlay.c\ +reclass.y +RCS/%,v : % + ci $< +libepp.a:${LIB_OBJS} + ar r libepp.a ${LIB_OBJS} +libepp.so:${LIB_OBJS} + gcc -shared ${LIB_OBJS} -o libepp.so -lm +reclass.tab.c:reclass.y + bison reclass.y +clean: + rm *.o + rm reclass.tab.c +distclean: clean + rm libepp.a +rcs: ${RCS} + diff --git a/lib/TODO.lib b/lib/TODO.lib new file mode 100644 index 0000000..8650f71 --- /dev/null +++ b/lib/TODO.lib @@ -0,0 +1,16 @@ +æÕÎËÃÉÑ epp_expand(epp) - ÐÒÅ×ÒÁÝÁÅÔ ÚÁÇÒÕÖÅÎÎÙÊ × ÐÁÍÑÔØ 8-ÂÉÔÎÙÊ + ÒÁÓÔÒ × 16-ÂÉÔÎÙÊ. + (á ÍÏÖÅÔ ÂÙÔØ ÓÔÏÉÔ ×ÓÅÇÄÁ ËÏÎ×ÅÒÔÉÒÏ×ÁÔØ ÒÁÓÔÒ ÐÒÉ ÚÁÇÒÕÚËÅ + É ×ÏÚÍÏÖÎÏ ÐÒÉ ÓÏÈÒÁÎÅÎÉÉ ËÏÎ×ÅÒÔÉÒÏ×ÁÔØ ÏÂÒÁÔÎÏ) + + õÓÌÏ×ÉÑ ËÏÎ×ÅÒÔÉÒÏ×ÁÎÉÑ + if ((max<=255&&offsite<=255)||(max<255&&offsite==65535)|| + (max<=255&&offsite==65535&&counttable(255)==0)) + +ïÂÒÁÂÁÔÙ×ÁÔØ ÏÛÉÂËÕ, ÅÓÌÉ ÄÌÉÎÁ ÕÐÁËÏ×ÁÎÎÏÊ ÓÔÒÏËÉ >65535 ÂÁÊÔ + +æÕÎËÃÉÑ epp_putline(EPP *epp,int x1,int x2,int y,int value) + +÷×ÅÓÔÉ ÇÌÏÂÁÌØÎÙÊ ÆÌÁÇ ÉÚÍÅÎÅÎÉÑ ÆÁÊÌÁ + +ðÅÒÅÉÍÅÎÏ×ÁÔØ ÐÏÌÅ modified × row_modified ÄÌÑ ÑÓÎÏÓÔÉ. diff --git a/lib/byteorder.c b/lib/byteorder.c new file mode 100644 index 0000000..5e78fc4 --- /dev/null +++ b/lib/byteorder.c @@ -0,0 +1,18 @@ +short swapshort(short x) +{ return (signed short) (((unsigned short) x)>>8)|(((unsigned short) x)<<8); +} +long swaplong(long x) +{ +#define ulx ((unsigned long) x) +return (signed long) (((ulx & 0xFF000000)>>24)|((ulx &0xFF0000)>>8)|((ulx & 0xFF00)<<8)|((ulx & 0xFF)<<24)); +} +union doubleconv {double d; + unsigned char b[8]; + }; +double swapdouble(double x) +{ union doubleconv tmp1,tmp2; + int i,j; + tmp1.d=x; + for (i=0,j=7;i<8;tmp2.b[j--]=tmp1.b[i++]); + return tmp2.d; + } diff --git a/lib/clr.c b/lib/clr.c new file mode 100644 index 0000000..ac92d49 --- /dev/null +++ b/lib/clr.c @@ -0,0 +1,52 @@ +#include +#include +#include "eppl_ut.h" +#include +#include +int defarray[]={ +#include "defpal.h" +}; +PALETTE default_palette=defarray; +PALETTE read_palette(FILE *f) +/* þÉÔÁÅÔ ÐÁÌÉÔÒÕ ÉÚ ÆÁÊÌÁ × ÆÏÒÍÁÔÅ EPPL7 */ +{ PALETTE pal; + int index,r,g,b; + pal=memcpy(malloc(256*sizeof(long int)),default_palette,256*sizeof(long int)); + do { + if (fscanf(f,"%d %d %d %d\n",&index,&r,&g,&b)!=4) break; + if (index>255) continue; + pal[index]=(r*255/1000)<<16|(g*255/1000)<<8|(b*255/1000); + } while (!feof(f)); + return pal; +} + +char *ppm_pixel(PALETTE palette,int index) +{ int value; + static char buffer[24]; + if(index>=0&&index<255) + value=palette[index]; + else value=palette[255]; + sprintf(buffer,"%d %d %d ",value>>16,(value>>8)&0xFF,value & 0xFF); + return buffer; +} + +char *Xcolor_string(PALETTE palette,int index) +{ int value; + static char buffer[24]; + if(index>=0&&index<255) + value=palette[index]; else value=palette[255]; + sprintf(buffer,"#%06x",value); + return buffer; +} +XColor Xcolor_struct(PALETTE palette,int index) +{ int value; + XColor buffer; + if (index>=0&&index<255) + value=palette[index]; else value=palette[255]; + buffer.red=value>>16; + buffer.green=(value>>8)&0xFF; + buffer.blue=value&0xFF; + buffer.flags=DoRed|DoGreen|DoBlue; + return buffer; +} + diff --git a/lib/dgt_dist.c b/lib/dgt_dist.c new file mode 100644 index 0000000..5b955f8 --- /dev/null +++ b/lib/dgt_dist.c @@ -0,0 +1,21 @@ +#include +#include "dgt.h" + +double real_dx(DGT *dgt,int dx) +{ return (dgt->XRight-dgt->XLeft)*dx/65535; +} + +double real_dy(DGT *dgt,int dy) +{ return (dgt->YTop-dgt->YBottom)*dy/65535; +} +double dgt_dist(DGT *dgt,int x1,int y1,int x2,int y2) +{ + return hypot(real_dx(dgt,x1-x2),real_dy(dgt,y1-y2)); +} +double dgt_pdist(DGT *dgt,POINT p1,POINT p2) +{ + return hypot(real_dx(dgt,p1.x-p2.x),real_dy(dgt,p1.y-p2.y)); +} +double dgt_atan2(DGT *dgt,int dx,int dy) +{ return atan2(dy/(dgt->XRight-dgt->XLeft),dx/(dgt->YTop-dgt->YBottom)); +} diff --git a/lib/dgt_input.c b/lib/dgt_input.c new file mode 100644 index 0000000..9528623 --- /dev/null +++ b/lib/dgt_input.c @@ -0,0 +1,112 @@ +#include +#include +#include "dgt.h" +int read_item(DGT* dgt) +/* read next item of dgt file opened for reading */ +{ int to_skip=0; +#ifndef LSB_FIRST + DGT_ITEM tmp; +#endif +#ifdef LSB_FIRST + if(fread(dgt->buffer,1,14,(FILE *)dgt->F)!=14) return 1; +#else + if(fread(&tmp,1,14,(FILE *)(dgt->F))!=14) return 1; + dgt->buffer->ID=swaplong(tmp.ID); + swab(&(tmp.x1),&(dgt->buffer->x1),10); +#endif + if (dgt->buffer->npoints) + { if(dgt->buffer->npoints>MAX_LINE_LEN) {to_skip=(dgt->buffer->npoints-MAX_LINE_LEN)*4; + dgt->buffer->npoints=MAX_LINE_LEN;} +#ifdef LSB_FIRST + if (fread(&(dgt->buffer->s),4,dgt->buffer->npoints, + (FILE *)dgt->F)!=dgt->buffer->npoints) + { map_error = ME_READ_ERROR; return 1;} +#else + if(fread(&(tmp.s),4,dgt->buffer->npoints, + (FILE *)dgt->F)!=dgt->buffer->npoints) + {map_error=ME_READ_ERROR;return 1;} + swab(&(tmp.s),&(dgt->buffer->s),dgt->buffer->npoints*4); +#endif + if (to_skip) fseek((FILE*)dgt->F,to_skip,SEEK_CUR); + } + dgt->item_no++; + return dgt->eof=(dgt->buffer->ID==0&&dgt->buffer->npoints==0); + +} +void go_first(DGT *dgt) +{ + fseek((FILE *)dgt->F,128L,SEEK_SET); + dgt->item_no=0; + dgt->eof=dgt->next_item(dgt); +} + +DGT* open_dgt(char *filename) +/*opens existing file, given by name*/ +{FILE *f; + if (!(f=fopen(filename,"r"))) + return NULL; + return fopen_dgt(f); +} +typedef void (*close_func)(void *f); +DGT* fopen_dgt(FILE *f) +/* open existing file given by file variable */ +{ DGT* tmp; + DGTHEADER h; + if(!(tmp=malloc(sizeof(DGT)))) {map_error=ME_OUT_OF_MEMORY;return NULL;} + if(fread(&h,1,sizeof(h),f)!=sizeof(h)) {map_error=ME_READ_ERROR;free(tmp);return NULL;} + if(!(tmp->buffer=malloc(sizeof(DGT_ITEM)))) {map_error=ME_OUT_OF_MEMORY;free(tmp);return NULL;} + tmp->XLeft=swapdouble(h.xleft); + tmp->XRight=swapdouble(h.xright); + tmp->YTop=swapdouble(h.ytop); + tmp->YBottom=swapdouble(h.ybottom); + tmp->projection=h.coord_sys; + tmp->mode=MAP_INPUT; + tmp->item_no=0; + tmp->next_item=read_item; + tmp->rewind=go_first; + tmp->F=f; + tmp->dispose=(close_func)fclose; + tmp->cmp_item=NULL; + tmp->next_item(tmp); + return tmp; +} +void close_dgt(DGT* dgt) +/* Destroys DGT object */ +{ dgt->rewind(dgt); + dgt->dispose(dgt->F); + free(dgt->buffer); + free(dgt); +} +DGT_ITEM* dgt_get(DGT* dgt) +/* allocates current item in memory and returns pointer to it*/ +{ DGT_ITEM* item; + if (!(dgt->mode&MAP_INPUT)) {map_error=ME_INVALID_MODE;return NULL;} + if (!dgt->eof) {item= alloc_item(dgt->buffer);dgt->next_item(dgt);return item;} + else return NULL; +} +int dgt_x(DGT* dgt,double x) +{ +return ((x-dgt->XLeft)/(dgt->XRight-dgt->XLeft)*65535)-32767; +} +int dgt_y(DGT* dgt,double y) +{ +return ((y-dgt->YBottom)/(dgt->YTop-dgt->YBottom)*65535)-32767; +} +double real_x(DGT* dgt,int x) +{ return (x+32767)/65535.0*(dgt->XRight-dgt->XLeft)+dgt->XLeft; +} +double real_y(DGT* dgt,int y) +{ +return (y+32767)/65535.0*(dgt->YTop-dgt->YBottom)+dgt->YBottom; +} + +DGT_ITEM* alloc_item(DGT_ITEM *item) +{DGT_ITEM* new_item; + new_item=malloc(14+item->npoints*4); + return memcpy(new_item,item,14+item->npoints*4); +} +void reset_dgt(DGT* dgt) +/* rewinds dgt file for first item, reopens for reading,if nessecary */ +{ dgt->rewind(dgt); + dgt->eof=dgt->next_item(dgt); +} diff --git a/lib/dgt_iter.c b/lib/dgt_iter.c new file mode 100644 index 0000000..997e002 --- /dev/null +++ b/lib/dgt_iter.c @@ -0,0 +1,27 @@ +#include "dgt.h" +void for_each_line(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream) +{ reset_dgt(dgt); + while(!dgt_eof(dgt)) + { if (dgt_is_line(dgt)) + item_proc(dgt); + if (outstream) dgt_put(outstream,dgt->buffer); + dgt_next(dgt); + } +} +void for_each_point(DGT *dgt,void (*item_proc)(DGT *dgt),DGT *outstream) +{ reset_dgt(dgt); + while(!dgt_eof(dgt)) + { if (dgt_is_point(dgt)) + item_proc(dgt); + if (outstream) dgt_put(outstream,dgt->buffer); + dgt_next(dgt); + } +} +void for_each_item(DGT *dgt,void (*item_proc)(DGT *dgt)) +{ reset_dgt(dgt); + while(!dgt_eof(dgt)) + { + item_proc(dgt); + dgt_next(dgt); + } +} diff --git a/lib/dgt_output.c b/lib/dgt_output.c new file mode 100644 index 0000000..ffc426f --- /dev/null +++ b/lib/dgt_output.c @@ -0,0 +1,211 @@ +#include +#include +#include +#include "dgt.h" +typedef void (*close_func)(void *f); + + +DGT* creat_dgt(char *filename,double x_left,double y_bottom, + double x_right,double y_top, unsigned char proj) +/* creates file with given limits with given name */ +{FILE *f; + f=fopen(filename,"w+"); + if (!f) return NULL; + return fcreat_dgt(f,x_left,y_bottom,x_right,y_top,proj); +} +int write_header(FILE *f ,double x_left,double y_bottom, + double x_right,double y_top,unsigned char proj) +{ DGTHEADER h; + memset(&h,0,sizeof(h)); + h.xleft=swapdouble(x_left); + h.ybottom=swapdouble(y_bottom); + h.xright=swapdouble(x_right); + h.ytop=swapdouble(y_top); + h.coord_sys=proj; + return ( fwrite(&h,1,128,f)==128); +} +int write_buf(DGT *dgt) +{ +#ifdef LSB_FIRST +chk_mask(dgt->buffer); +dgt->modified=0;dgt->item_no++; +return fwrite(dgt->buffer,1,14+4*dgt->buffer->npoints,(FILE *)dgt->F)== + 14+4*dgt->buffer->npoints; +#else +DGT_ITEM tmp; +chk_mask(dgt->buffer); +tmp.ID=swaplong(dgt->buffer->ID); +swab(&(dgt->buffer->x1),&(tmp.x1),10+4*dgt->buffer->npoints); +dgt->modified=0;dgt->item_no++; +return fwrite(&tmp,14+4*dgt->buffer->npoints,1,(FILE *)dgt->F)== + 14+4*dgt->buffer->npoints; +#endif +} +void write_eof(DGT* dgt) +{short int eof_marker[7]={0,0,0,0,0,0,0}; + if (dgt->modified) write_buf(dgt); + fwrite(&eof_marker,14,1,(FILE *)dgt->F); +} +DGT* fcreat_dgt(FILE *f ,double x_left,double y_bottom, + double x_right,double y_top,unsigned char proj) +/* creates dgt file with given limits in given stream */ +{ DGT* tmp; + if (!write_header(f,x_left,y_bottom,x_right,y_top,proj)) { map_error=ME_WRITE_ERROR; return NULL;} + if (!(tmp=malloc(sizeof(DGT)))) {map_error=ME_OUT_OF_MEMORY;return NULL;} + tmp->XLeft=x_left; + tmp->YBottom=y_bottom; + tmp->XRight=x_right; + tmp->YTop=y_top; + tmp->mode=MAP_OUTPUT; + tmp->item_no=0; + tmp->projection=proj; + tmp->F=f; + tmp->eof=1; + tmp->modified=0; + tmp->next_item=write_buf; + tmp->rewind=write_eof; + tmp->dispose=(close_func) fclose; + tmp->buffer=malloc(sizeof(DGT_ITEM)); + return tmp; +} +DGT* creat_dgt_as(char *filename,DGT* pattern) +{return creat_dgt(filename,pattern->XLeft,pattern->YBottom,pattern->XRight, + pattern->YTop,pattern->projection); +} +DGT* fcreat_dgt_as(FILE *f,DGT *pattern) +{return fcreat_dgt(f,pattern->XLeft,pattern->YBottom,pattern->XRight, + pattern->YTop,pattern->projection); +} +void chk_mask(DGT_ITEM* item) +/*set correct values of bounding rectangle*/ +{int i,x1,y1,x2,y2; + POINT* p; + + if (!item->npoints) return; + x1=32767; + y1=32767; + x2=-32767; + y2=-32767; + for(i=0,p=item->s;inpoints;i++,p++) + { if(p->xx; + if(p->x>x2) x2=p->x; + if(p->yy; + if(p->y>y2) y2=p->y; + } + item->x1=x1; + item->y1=y1; + item->x2=x2; + item->y2=y2; +} +void dgt_put(DGT *dgt, DGT_ITEM* item) +/* inserts item in writable file*/ +{ if (!dgt->mode&MAP_OUTPUT) {map_error=ME_INVALID_MODE;} + if (dgt->modified) dgt->next_item(dgt); + memcpy(dgt->buffer,item,14+4*item->npoints); + dgt->modified=1; + dgt->next_item(dgt); +} +void item_set_id(DGT_ITEM *item,long int newID) +{item->ID=newID?newID:1; +} +void dgt_set_point(DGT *dgt,int x,int y) +{ dgt->modified=1; + dgt->buffer->npoints=0; + if (x!=KEEP_OLD_VALUE) dgt->buffer->x1=x; + if (y!=KEEP_OLD_VALUE) dgt->buffer->y1=y; +} +int dgt_add_node(DGT* dgt,int x,int y) +{ DGT_ITEM *buf=dgt->buffer; + POINT *p=dgt->buffer->s+dgt->buffer->npoints-1; + + if (buf->npoints==MAX_LINE_LEN) return DGT_LINE_TOO_LONG; + if (buf->npoints==0||p->x!=x||p->y!=y) + { p++; + p->x=x;p->y=y; + buf->npoints++; + dgt->modified=1; + return 0; + } else return DGT_ZERO_SEGMENT; +} +int dgt_ins_node(DGT *dgt,int index,int x,int y) +{ DGT_ITEM *buf=dgt->buffer; + if (index<0) return 3; + if (buf->npoints==MAX_LINE_LEN) return DGT_LINE_TOO_LONG; + if (index>=buf->npoints) + if (index==buf->npoints) return dgt_add_node(dgt,x,y); + else return DGT_INVALID_NODE; + if ((index==0||buf->s[index-1].x!=x||buf->s[index-1].y!=y) + &&(buf->s[index].x!=x||buf->s[index].y!=y)) + {int i; POINT *s,*s1; + s=buf->s+buf->npoints; + s1=s-1; + for(i=buf->npoints;i>index;i--,*(s--)=*(s1--)); + s->x=x; + s->y=y; + buf->npoints++; + dgt->modified=1; + return 0; + } + else + return DGT_ZERO_SEGMENT; + +} + +int item_mv_node(DGT_ITEM *item,int index,int x,int y) +{ POINT *s=item->s+index,*s1; + if (index>=item->npoints||index<0) return DGT_INVALID_NODE; + + if (x==KEEP_OLD_VALUE) x=s->x; + if (y==KEEP_OLD_VALUE) y=s->y; + if (index>0) {s1=s-1;if (s1->x==x&&s1->y==y) return DGT_ZERO_SEGMENT;} + if (indexnpoints-1) + { s1=s+1;if (s1->x==x&&s1->y==y) return DGT_ZERO_SEGMENT;} + s->x=x; + s->y=y; + return 0; +} +int dgt_rm_node(DGT *dgt,int index) +{ DGT_ITEM *buf=dgt->buffer;int i;POINT *s,*s1,*s2; + if (buf->npoints==2) return DGT_LINE_TOO_SHORT; + if (index<0||index>=buf->npoints) return DGT_INVALID_NODE; + s=buf->s+index; + s1=s+1;s2=s-1; + if(!index&&indexnpoints-1&&s1->x==s2->x&&s1->y==s2->y) + return DGT_ZERO_SEGMENT; + for(i=index+1;inpoints;i++,*(s++)=*(s1++)); + dgt->modified=1; + return 0; +} +int dgt_split(DGT *dgt,int index) +{DGT_ITEM new_line,*buf=dgt->buffer; + POINT *s,*s1; + int i; + if (index<=0||index>=buf->npoints-1) return DGT_BAD_SPLIT_POINT; + s=buf->s+index; + s1=new_line.s; + for(i=index;inpoints;i++,*(s1++)=*(s++)); + new_line.npoints=buf->npoints-index; + buf->npoints=index+1; + dgt_next(dgt); + memcpy(buf,&new_line,14+4*new_line.npoints); + dgt->modified=1; + return 0; +} + +int dgt_cut_segment(DGT *dgt,int index) +{ POINT *s,*s1; + DGT_ITEM new_line,*buf=dgt->buffer; + int i; + if (index<=1||index>=buf->npoints-1) return DGT_BAD_SPLIT_POINT; + s=buf->s+index; + s1=new_line.s; + for(i=index;inpoints;i++,*(s1++)=*(s++)); + new_line.npoints=buf->npoints-index; + buf->npoints=index; + dgt_next(dgt); + memcpy(buf,&new_line,14+4*new_line.npoints); + dgt->modified=1; + return 0; +} + + diff --git a/lib/epp_cache.c b/lib/epp_cache.c new file mode 100644 index 0000000..fb2c7f6 --- /dev/null +++ b/lib/epp_cache.c @@ -0,0 +1,66 @@ +#include +#include +#include +#include "epp.h" +#define BAD_ROW -32769 +int search_cache(EPP *epp,int row); +void position_input(EPP *epp,int row); +void position_cached(EPP *epp, int row)/* makes given line current */ +{ + if (row==epp->currentline) return; + if (!search_cache(epp,row)) + { position_input(epp,row); + } +} +typedef struct CACHE_REC { int row_no; + unsigned short *row_ptr;} cache_rec; +int search_cache(EPP *epp,int row) +{ cache_rec* c;unsigned short int *rp; + int i; + for(c=epp->cache,i=0;icache_size && c->row_no!=BAD_ROW&&c->row_no!=row; + i++) c++; + if (i==epp->cache_size) { + /* Cache is full and row not found. Discard last row */ + c--; + } + rp=c->row_ptr; + i=epp->currentline; + epp->currentline=c->row_no; + /* move all rows one forward */ + for(;c!=epp->cache;c--) *c=*(c-1); + c=epp->cache;/* may be this is not nessecary*/ + c->row_no=i; + c->row_ptr=epp->row; + epp->row=rp; + return epp->currentline==row; +} +void free_cache(EPP *epp) +{ int i;cache_rec *c; + for (i=0,c=epp->cache;icache_size;i++,c++) + free(c->row_ptr); + if (epp->cache) free(epp->cache); + epp->cache=NULL; + epp->cache_size=0; +} +int set_epp_cache(EPP *epp,int lines) +{ int i; cache_rec* c; + if (!(epp->mode&MAP_INPUT)||(epp->mode&MAP_LOADED)) + { map_error = ME_INVALID_MODE; + return 0; + } + free_cache(epp); + /* this is really assignment inside condition*/ + if (lines) + {if (!(epp->cache=calloc(lines, sizeof(cache_rec)))) + { return 0; } + for (i=0,c=epp->cache;irow_ptr=calloc(epp->width+1,sizeof(short)); + c->row_no=-32768; + } + epp->cache_size=lines; + epp->position=position_cached; + } + else epp->position=position_input; + return 1; +} + diff --git a/lib/epp_input.c b/lib/epp_input.c new file mode 100644 index 0000000..4dee819 --- /dev/null +++ b/lib/epp_input.c @@ -0,0 +1,274 @@ +# include "epp.h" +# include +# include +# include +# include +# include "epp_private.h" +int map_error=0; /* after each operation contains error code */ +EPP *open_epp(char *pathname) +/* opens existing EPP file */ +{ + FILE *f; + f=fopen(pathname,"rb"); + if (f==NULL) {map_error=ME_NO_FILE;return NULL;} + return fopen_epp(f); +} + + + +EPP *fopen_epp(FILE* f) +{ + EPPHEADER h; + EPP *epp; +#ifndef LSB_FIRST + short *file_width_table; +#endif + fseek(f,0,SEEK_SET); + if (fread(&h,1,128,f)<128) {fclose(f);map_error=ME_INVALID_FILE;return NULL;}; + + if ((swapshort(h.kind)!=8)&&(swapshort(h.kind)!=16)) {fclose(f);map_error=ME_INVALID_FILE;return NULL;} + epp=malloc(sizeof(EPP)); + if (NULL==epp) { fclose(f);map_error=ME_OUT_OF_MEMORY;return NULL;} + epp->XLeft=swapdouble(h.fcx); + epp->XRight=swapdouble(h.lcx); + epp->YTop=swapdouble(h.fry); + epp->YBottom=swapdouble(h.lry); + epp->fr=swapshort(h.fr); + epp->fc=swapshort(h.fc); + epp->lc=swapshort(h.lc)+1; + epp->lr=swapshort(h.lr)+1; + epp->min=swapshort(h.minclass); + epp->max=swapshort(h.maxclass); + epp->offsite=swapshort(h.offsite); + epp->kind=swapshort(h.kind); + if (epp->kind==8&&(epp->min>255||epp->max>255||epp->min>epp->max)) + {epp->min=0;epp->max=255;} + epp->mode=MAP_INPUT; + epp->position=position_input; + epp->cell_area=swapdouble(h.sfact); + epp->width=(epp->lc-epp->fc+1); + if ((epp->row=calloc(epp->width+1,sizeof(short)))==NULL) + {fclose(f);free(epp);map_error=ME_OUT_OF_MEMORY;return NULL;} + if(( h.access_ptr!=0)&&(h.access_ptr!=0x20202020)) +#ifdef LSB_FIRST + { if((epp->widthtable = calloc(epp->lr-epp->fr,sizeof(short)))==NULL) + {fclose(f);free(epp);map_error=ME_OUT_OF_MEMORY;return NULL;} + fseek(f,128*h.access_ptr,SEEK_SET); + fread(epp->widthtable,epp->lr-epp->fr,sizeof(short),f); + } +#else + { if((epp->widthtable = calloc(epp->lr-epp->fr,sizeof(short)))==NULL || + ( file_width_table = calloc(epp->lr-epp->fr,sizeof(short)))==NULL ) + {fclose(f);free(epp);map_error=ME_OUT_OF_MEMORY;return NULL;} + fseek(f,128*swaplong(h.access_ptr),SEEK_SET); + fread(file_width_table,epp->lr-epp->fr,sizeof(short),f); + swab(file_width_table,epp->widthtable,(epp->lr-epp->fr)*sizeof(short)); + free(file_width_table); + } +#endif + else epp->widthtable=NULL; + if ((epp->packed_buffer=malloc(epp->width*4/3))==NULL) + { free(epp->row);if (epp->widthtable!=NULL) free(epp->widthtable); + fclose(f);free(epp);map_error=ME_OUT_OF_MEMORY;return NULL;} + epp->F=f; + epp->filepos=128; + fseek(f,128,SEEK_SET); + epp->currentline=epp->fr-1; + epp->cache_size=0; + epp->cache=NULL; + return epp; +} +void get_epp_header(EPP* epp, EPPHEADER *h) +/* reads header of EPP file */ +{ +#ifndef LSB_FIRST + EPPHEADER file_header; +#endif + fseek(epp->F,0L,SEEK_SET); +#ifdef LSB_FIRST + fread(h,1,128,epp->F); +#else + fread(&file_header,1,128,epp->F); + swab(&file_header,h,64); + memcpy(&(h->area_unit),&(file_header.area_unit),64); + h->fry=swapdouble(file_header.fry); + h->lry=swapdouble(file_header.lry); + h->fcx=swapdouble(file_header.fcx); + h->lcx=swapdouble(file_header.lcx); + h->sfact=swapdouble(file_header.sfact); + h->access_ptr=swaplong(file_header.access_ptr); +#endif + fseek(epp->F,epp->filepos,SEEK_SET); +} + +char *getcomment(EPP *epp) +/* returns comment of EPP file (address of static buffer,which would be + overriden by next call */ +{static char cmt[33]; + char *endptr; + EPPHEADER h; + get_epp_header(epp,&h); + strncpy(cmt,h.comment,32); + cmt[32]='\0'; + for(endptr=cmt+31;endptr>=cmt&&*endptr==' ';endptr--); + *(++endptr)='\0'; + return cmt; +} + +unsigned short int *epp_getline(EPP *epp,int x,int y) +/* returns pointer to array of integer, which represents line y of raster, + starting from col x. NULL if xmode&MAP_INPUT)){map_error=ME_INVALID_MODE; return NULL;} + if (epp->currentline!=y) + { epp->position(epp,y); + if (map_error) return NULL; + } + return epp->row+(x-epp->fc); +} + +int epp_get(EPP *epp,int x,int y) +/* returns value of given cell, offsite if cell is outside file boundaries */ +{ map_error=0; + if (!(epp->mode&MAP_INPUT)){map_error=ME_INVALID_MODE; return epp->offsite;} + if (!epp_contains(epp,x,y)) {map_error=ME_POINT_OUTSIDE; return epp->offsite;} + if (epp->currentline!=y) + { + epp->position(epp,y); + if (map_error) return epp->offsite; + } + return epp->row[x-epp->fc]; +} +int epp_contains(EPP *epp,int x,int y) +/* returns non-zero if is within boundares of epp */ +{ + return (xlc)&&(x>=epp->fc)&&(ylr)&&(y>=epp->fr); +} +void close_epp(EPP *epp) +{ + if (epp->mode==MAP_OUTPUT) update_header(epp); + if (epp->mode&MAP_CACHED) free_cache(epp); + if (epp->mode&MAP_LOADED) + { char **row=epp->cache; + int i; + for(i=epp->fr;ilr;i++,row++) free(*row); + free(epp->cache); + } + free(epp->packed_buffer); + fclose(epp->F); + free(epp->row); + if (epp->widthtable!=NULL) free (epp->widthtable); + free(epp); +} +/*********** coordinate recalculation **********/ +int epp_row(EPP *epp,double y)/* returns row by given alternate y */ +{ + return floor((y-epp->YTop)/(epp->YBottom-epp->YTop)*(epp->lr-epp->fr))+epp->fr; + +} +int epp_col(EPP *epp,double x)/* returns col for given alternate x */ +{ +return floor((x-epp->XLeft)/(epp->XRight-epp->XLeft)*(epp->lc-epp->fc))+epp->fc; +} +double alt_x(EPP *epp,int col)/* returns alternate x for given col */ +{ +return (epp->XRight-epp->XLeft)*(col-epp->fc)/(epp->lc-epp->fc)+epp->XLeft; +} +double alt_y(EPP *epp,int row)/* returns alternate y for given row */ +{ +return (epp->YBottom-epp->YTop)*(row-epp->fr)/(epp->lr-epp->fr)+epp->YTop; +} +double alt_xc(EPP *epp,int col)/* returns alternate x for given col */ +{ +return (epp->XRight-epp->XLeft)*(col-epp->fc+0.5)/(epp->lc-epp->fc)+epp->XLeft; +} +double alt_yc(EPP *epp,int row)/* returns alternate y for given row */ +{ +return (epp->YBottom-epp->YTop)*(row-epp->fr+0.5)/(epp->lr-epp->fr)+epp->YTop; +} +/**** this was private in pascal version ********/ +void position_input(EPP *epp,int row) +{ int i,offset; + if (epp->currentline==row) return; + if (epp->currentline+1!=row) + { + if (epp->widthtable==NULL) + { + if (row>epp->currentline) + for(i=epp->currentline+1;i<=row;i++) get_row(epp); + else + { fseek(epp->F,128L,SEEK_SET); + epp->filepos=128; + epp->currentline=epp->fr-1; + for(i=epp->fr;ifr;offset+=epp->widthtable[i++]); + fseek(epp->F,offset,SEEK_SET); + epp->filepos=offset; + epp->currentline=--row; + } + } + get_row(epp); + + } + +void unpack_row(unsigned char *row,int *bufpos,EPP *epp) +{register unsigned char a,c,*r,*src; + int i,k; + i=0; + r=row; + src=epp->packed_buffer+(*bufpos); + do { + c=*(src++); + if (c) + { + a=*(src++); + if (c+i>epp->width) c=epp->width-i+1; + for(k=0;kepp->width) c=epp->width-i+1; + for(k=0;kwidth-1)); + *bufpos=src-(epp->packed_buffer); +} +int unpack_buffer(EPP *epp) +{ unsigned short *r; + int i; + int bufpos=0; + if (epp->kind==8) + for(i=0,r=epp->row;iwidth;*(r++)=0,i++); +#ifdef LSB_FIRST + unpack_row((unsigned char *)epp->row,&bufpos,epp); + if (epp->kind==16) + unpack_row(((unsigned char *)epp->row)+1,&bufpos,epp); +#else + unpack_row(((unsigned char *)epp->row)+1,&bufpos,epp); + if (epp->kind==16) + unpack_row((unsigned char *)epp->row,&bufpos,epp); +#endif + return bufpos; +} +void get_row(EPP *epp)/* reads and unpacks row of epp file */ +{ + + if (!(epp->mode & MAP_INPUT)) {map_error=ME_INVALID_MODE;return; } + epp->currentline++; + fread(epp->packed_buffer,epp->widthtable? + epp->widthtable[epp->currentline-epp->fr]:epp->width*4/3,1,epp->F); + epp->filepos+=unpack_buffer(epp); + if (!epp->widthtable) + { + fseek(epp->F,epp->filepos,SEEK_SET); + } +} diff --git a/lib/epp_iter.c b/lib/epp_iter.c new file mode 100644 index 0000000..5cc769f --- /dev/null +++ b/lib/epp_iter.c @@ -0,0 +1,64 @@ +#include +#include +#include +#include "epp_private.h" +int (*EndLineProc)(int row,int seqno,int total); +int for_each_cell(EPP *epp, EPP_ITER_PROC action) +/* performs given operation for each non-offsite cell of existing EPP file + (terminated if action returns non-zero, + or performs operation for each cell of created EPP file, filling cell + by value, returned by action. value parameter in this case always containt + offsite of epp */ +{ int i,j,k,l,rowcount,offsite; + rowcount=epp->lr-epp->fr; + offsite=epp->offsite; + if (epp->mode&MAP_INPUT) + { reset_epp(epp); + for(i=epp->fr,l=1;ilr;i++,l++) + { epp->position(epp,i); + for(k=0,j=epp->fc;jlc;k++,j++) + if (epp->row[k]!=epp->offsite) if ((*action)(j,i,epp->row[k])) return -2; + if (EndLineProc!=NULL) + { + if ((*EndLineProc)(i,l,rowcount)) return -1; + } + } + } + else + { + if (epp->currentline>epp->fr) {map_error=ME_INVALID_PUT;} + for (i=epp->fr,l=1;ilr;i++,l++) + { for(k=0,j=epp->fc;jlc;k++,j++) + epp_put(epp,j,i,(*action)(j,i,offsite)); + if (EndLineProc!=NULL) + { + if ((*EndLineProc)(i,l,rowcount)) return -1; + } + } + } + return 0; +} +long count_cells(EPP *epp, EPP_ITER_PROC condition) +/* calls condition for each non-offsite cell in existing epp file, returns + count of cells, for which condition was non-zero */ +{ int i,j,k,l,rowcount; + long count=0; + rowcount=epp->lr-epp->fr; + if (epp->mode&MAP_OUTPUT) + {map_error=ME_INVALID_MODE; return 0L;} + reset_epp(epp); + for(i=epp->fr,l=1;ilr;i++,l++) + { get_row(epp); + for(k=0,j=epp->fc;jlc;k++,j++) + if (epp->row[k]!=epp->offsite) + { + if ((*condition)(j,i,epp->row[k])) count++; + } + if (EndLineProc!=NULL) + { + if ((*EndLineProc)(i,l,rowcount)) return -1; + } + } + return count; +} + diff --git a/lib/epp_loaded.c b/lib/epp_loaded.c new file mode 100644 index 0000000..48f3747 --- /dev/null +++ b/lib/epp_loaded.c @@ -0,0 +1,327 @@ +#include +#include +#include +#include +#include "epp_private.h" +#define row_buffer ((unsigned char **)epp->cache) + + + +/* + * Opens file in read-write mode and loads raster into memory + * Returns pointer to newly created structure or NULL on error + */ + +EPP *load_epp(char *filename) +{ + FILE *f; + f=fopen(filename,"rb+"); + if (!f) { + map_error=ME_NO_FILE; + return NULL; + } + return fload_epp(f); +} + +/* + * Reads file from given stream into memory. Returns 0 if Ok, -1 if + * something wrong + */ + +int do_load_epp(EPP *epp) +{ char **row,**rr; + int i,j,k,nrows; + unsigned short *width; + unsigned short *new_widthtable=NULL; /* if we have to create widthtable + on the fly, we would keep it here */ + int *counttab; + unsigned short int *pixel; + int oldpos; + + if(!epp->widthtable) { + new_widthtable=calloc(epp->lr-epp->fr,sizeof(short int)); + + } + /* + If we want to have read-write access, we should have read access + first. Switching from write-only to read-write access requires + reset_epp + */ + if(!(epp->mode&MAP_INPUT)) { + map_error=ME_INVALID_MODE; + return -1; + } + /* + We use pointer where cache is otherwise kept + */ + if (epp->mode&MAP_CACHED) { + free_cache(epp); + } + /* + Create array of pointers to file rows + */ + if ((epp->cache=calloc(epp->lr-epp->fr,sizeof(char *)))==NULL) { + map_error=ME_OUT_OF_MEMORY;return -1; + } + /* + Allocate table of frequencies. + */ + /* Note, count of pixels with value==offsite not stored here! */ + epp->counttable=calloc(1<kind,sizeof(int)); + counttab=epp->counttable; + if (epp->counttable==NULL) { + map_error=ME_OUT_OF_MEMORY; + return -1; + } + /* + Allocate and read + */ + /* We are assuming that file is fresh from fopen_epp or reset_epp */ + nrows=epp->lr-epp->fr; + if (epp->widthtable) { + width=epp->widthtable; + } else { + width=new_widthtable; + } + for(row=epp->cache,i=epp->fr,k=1;ilr;width++,i++,row++,k++) + { if((*row=malloc(*width))==NULL) + { for(rr=epp->cache;rrcache); + free(epp->counttable); + map_error=ME_OUT_OF_MEMORY; + return 0; + } + if (EndLineProc) (*EndLineProc)(i,k,nrows); + oldpos=epp->filepos; + get_row(epp); + if (new_widthtable) { + *width=epp->filepos-oldpos; + } + memcpy(*row,epp->packed_buffer,*width); + for (j=epp->fc,pixel=epp->row;jlc;j++,pixel++) { + counttab[*pixel]++; + } + } + /* find out what is actual maximum minimum of file */ + for (i=(1<kind)-1;i>0&&(counttab[i]==0||i==epp->offsite);i--); + epp->max=i; + for (i=0;imax&&(counttab[i]==0||i==epp->offsite);i++); + epp->min=i; + fseek(epp->F,128L,SEEK_SET); + epp->filepos=128; + epp->currentline=epp->fr-1; + epp->modified=0; + epp->mode=MAP_INPUT|MAP_OUTPUT|MAP_LOADED; + epp->position=position_loaded; + return 0; +} +/* + * Recieves stream and loads epp-file from it + * + */ +EPP *fload_epp(FILE *f) +{ EPP *epp; + epp=fopen_epp(f); + if (!epp) { + fclose(f); + return NULL; + } + /* do_load return non-zero on error */ + if (do_load_epp(epp)) { + close_epp(epp); + return NULL; + } + return epp; +} + +int load_new_epp(EPP *epp) +{ + if (epp->mode!=MAP_OUTPUT) { + map_error=ME_INVALID_MODE; + return -1; + } + reset_epp(epp); + if (do_load_epp(epp)) { + close_epp(epp); + return -1; + } + return 0; +} + +void save_row(EPP *epp) +{ int oldsize,newsize,l=epp->currentline-epp->fr; + + if (!epp->modified) return; + + epp->mode|=MAP_MODIFIED; + oldsize=epp->widthtable[l]; + newsize=pack_buffer(epp); + if (oldsize != newsize) { + free(row_buffer[l]); + row_buffer[l]=malloc(newsize); + epp->widthtable[l]=newsize; + } + memcpy(row_buffer[l],epp->packed_buffer,newsize); + epp->modified=0; +} +/* + * Writes loaded file back. Uses stream stored in F field. + * Returns 0 on success, -1 on failure + * Calls EndLineProc after saving each row. + */ + +int save_epp(EPP *epp) +{ + char **row; + unsigned short *width; + int i,k,nrows; + if (!(epp->mode&MAP_LOADED)) { + map_error=ME_INVALID_MODE; + return -1; + } + save_row(epp); + /* If file wasn't modified, don't save. See touch_epp macro in epp.h */ + if (!(epp->mode&MAP_MODIFIED)) { + map_error=0; + return 0; + } + fseek(epp->F,128L,SEEK_SET); + epp->filepos=128; + nrows=epp->lr-epp->fr; + map_error=ME_WRITE_ERROR; + for(i=epp->fr,row=epp->cache,width=epp->widthtable,k=1; + ilr; row++,width++,i++,k++) { + if (EndLineProc) (*EndLineProc)(i,k,nrows); + if (fwrite(*row,1,*width,epp->F)!=*width) + return -1; + epp->filepos+=*width; + } + epp->currentline=epp->lr; + update_header(epp); + epp->position(epp,epp->fr); + map_error=0; + return 0; +} +/* + * Writes epp file to given stream and makes this stream default + * Copies header by hand and then calls save_epp + * + */ +int fsave_epp_as(EPP *epp,FILE *f) +{ EPPHEADER h; + + fread(&h,128,1,epp->F); + fclose(epp->F); + epp->F=f; + fseek(f,0L,SEEK_SET); + if (fwrite(&h,128,1,f)!=128) return 1; + touch_epp(epp); + return save_epp(epp); +} +/* + * Wrapper around fsave_epp_as, which opens stream to pass there + * + */ + +int save_epp_as(EPP *epp,char *newname) +{FILE *f; + f=fopen(newname,"w+"); + if (!f) return 1; + return fsave_epp_as(epp,f); +} +/* + * position_loaded - sets current line of epp to given row. + * To be stored in position field of EPP structure. + * Takes care of saving row, if modified and unpacks neccesary row + * temporary substituting pointer to it into packed_buffer field. + */ +void position_loaded(EPP *epp,int row) +{ + unsigned char *tmp; /* to keep packed buffer */ + + if (row==epp->currentline) return; + save_row(epp); /* save row does nothing if row isn't modified */ + tmp=epp->packed_buffer; + epp->packed_buffer=row_buffer[row-epp->fr]; + unpack_buffer(epp); + epp->modified=0; + epp->packed_buffer=tmp; + epp->currentline=row; + map_error=0; +} +/* + * epp_expand - converts loaded 8-bit file into 16-bit one + * by appending packed string of zeros to each row + * return 0 on succes -1 of failure. + * errors: + * ME_INVALID_MODE - file is not loaded + * ME_INVALID_FILE - file already have maximum depth + * ME_OUT_OF_MEMORY - no comments + */ + +int epp_expand (EPP *epp) +{ unsigned char *tail; /* here prepaired packed tail is kept*/ + /* ATTENCTION, packtail is VERY poisoneuos fish*/ + int tail_length; + unsigned char *byteptr, + **row;/* pointer to pointer to current packed row */ + int i; + unsigned short *width; /* pointer to current element of widthtable */ + EPPHEADER h; + /* check if passed file is suitable for expanding */ + if (!(epp->mode&MAP_LOADED)) { + map_error=ME_INVALID_MODE; + return -1; + } + if (epp->kind==16) { + /* nowhere to expand */ + map_error=ME_INVALID_FILE; + return -1; + } + + /* any error, which occurs further, should be ME_OUT_OF_MEMORY*/ + map_error=ME_OUT_OF_MEMORY; + + /* prepare packed tail */ + tail_length=((epp->lc-epp->fc+254)/255)*2; + tail=malloc(tail_length); + if (!tail) return -1; + for (i=epp->lc-epp->fc,byteptr=tail;i>0;i-=255) { + int count=i>255?255:i; + *(byteptr++)=count; + *(byteptr++)=0; + } + /* reallocate rows */ + + for (i=epp->fc,width=epp->widthtable,row=row_buffer; + ilc;i++,row++,width++) { + unsigned char *tmp=realloc(*row,*width+tail_length); + if (!tmp) { + /* realloc fails, trying to restore status quo */ + for (i--,width--;i>=epp->fc;i--,width--) + *width-=tail_length; + return -1; + } + /* fill newly allocated memory */ + memcpy(tmp+*width,tail,tail_length); + /* store new row ptr and new width */ + *row=tmp; + *width+=tail_length; + /* Width overflow is not checked, becouse packed string of zeros + couldn't overflow even most lengthly 8-bit row */ + } + /* fix epp->kind value */ + epp->kind+=8; + /* and write it to disk immediately, becouse no one cares about + updating this field in header, but this function */ + fseek(epp->F,0,SEEK_SET); + fread(&h,128,1,epp->F); + /* read errors are not checked, becouse thay are quite improbable */ + h.kind=swapshort(epp->kind); + fseek(epp->F,0,SEEK_SET); + fwrite(&h,128,1,epp->F); + /* Now we are ready to exit successifully */ + map_error=0; + return 0; +} + diff --git a/lib/epp_output.c b/lib/epp_output.c new file mode 100644 index 0000000..f99156a --- /dev/null +++ b/lib/epp_output.c @@ -0,0 +1,525 @@ +# define _POSIX_SOURCE +/* I don't know what it means, but otherwise fileno function is not declared + in stdio.h + */ +#include +#include +#include +# define __USE_MISC +/* Even more strange define. It is neccesary to access ftruncate function */ +#include +# undef __USE_MISC +#include +# include +# include +# include "epp_private.h" +int Create16bit=0; /* if non-zero, all created EPP files would be 16 bit*/ + +EPP *creat_epp(char *pathname,int first_col,int first_row,int last_col, + int last_row, double AXLeft,double AYTop, double AXRight, + double AYBottom, int scale, int base, int offsite) +/* creating epp file from scratch. All fields which are not defined as + parameters, are filled by default values. Kind depends of global variable + Create16bit */ +{ FILE *f; + f=fopen(pathname,"wb+"); + if (f==NULL) {map_error=ME_CREATE_ERROR;return NULL;} + return fcreat_epp(f,first_col,first_row,last_col,last_row,AXLeft,AYTop, + AXRight,AYBottom,scale,base,offsite); +} + + +EPP *fcreat_epp(FILE* f,int first_col,int first_row,int last_col, + int last_row, double AXLeft,double AYTop, double AXRight, + double AYBottom, int scale, int base, int offsite) + +{ EPPHEADER h; + EPP *epp; + int i; + unsigned short int *r; + memset(&h,128,0); + if ((epp=malloc(sizeof(EPP)))==NULL) {fclose(f);map_error=ME_OUT_OF_MEMORY; + return NULL;} + h.fcx=swapdouble(epp->XLeft=AXLeft); + h.lcx=swapdouble(epp->XRight=AXRight); + h.lry=swapdouble(epp->YBottom=AYBottom); + h.fry=swapdouble(epp->YTop=AYTop); + h.fc=swapshort(epp->fc=first_col); + h.fr=swapshort(epp->fr=first_row); + h.lc=swapshort(epp->lc=last_col);epp->lc++; + h.lr=swapshort(epp->lr=last_row);epp->lr++; + h.scale=swapshort(scale==0?100:scale); + h.base=swapshort(base); + h.offsite=swapshort(epp->offsite=offsite); + epp->width=last_col-first_col+2; + if ((epp->row=calloc(epp->width+1,sizeof(short)))==NULL) + {free(epp);fclose(f);map_error=ME_OUT_OF_MEMORY;return NULL;} + epp->min=65535; + epp->max=0; + for(r=epp->row,i=0;i<=epp->width;*(r++)=offsite,i++); + if((epp->widthtable=calloc(epp->lr-epp->fr,sizeof(short)))==NULL) + {free(epp->row);free(epp);fclose(f);map_error=ME_OUT_OF_MEMORY;return NULL;} + if ((epp->packed_buffer=malloc(epp->width*4/3))==NULL) + { free(epp->row);if (epp->widthtable!=NULL) free(epp->widthtable); + fclose(f);free(epp);map_error=ME_OUT_OF_MEMORY;return NULL;} + epp->F=f; + epp->mode=MAP_OUTPUT; + epp->position=position_output; + h.kind=swapshort(epp->kind=Create16bit?16:8); + h.access_ptr=0; + h.sfact=swapdouble(epp->cell_area=fabs(AXRight-AXLeft)/(last_col-first_col+1)* + fabs(AYBottom-AYTop)/(last_row-first_row+1)); + memset(h.comment,32,' '); + fwrite(&h,128,1,f); + epp->filepos=128; + epp->currentline=epp->fr; + epp->cache_size=0; + epp->cache=NULL; + return epp; +} +EPP *creat_epp_as(char *pathname,EPP *pattern) +{ FILE *f; + f=fopen(pathname,"wb+"); + if (f==NULL) {map_error=ME_CREATE_ERROR;return NULL;} + return fcreat_epp_as(f,pattern); +} +EPP *fcreat_epp_as(FILE *f,EPP *pattern) +/* creates new epp file, copiing a most header fields from given file */ +{ EPPHEADER h; + EPP *epp; + get_epp_header(pattern,&h); + epp=fcreat_epp(f,h.fc,h.fr,h.lc,h.lr, + pattern->XLeft,pattern->YTop,pattern->XRight, + pattern->YBottom,h.scale,h.base,h.offsite); + if (epp!=NULL) + { char cmt[33]; + setcomment(epp,strncpy(cmt,h.comment,32)); + } + return epp; +} +void setcomment(EPP *epp,char *comment) +/* change comment of epp file, which was open by creat_epp or creat_epp_as */ +{ EPPHEADER h; + int i; + if((epp->mode & MAP_OUTPUT) == 0) + { map_error=ME_INVALID_MODE; return; } + fseek(epp->F,0L,SEEK_SET); + fread(&h,128,1,epp->F); + strncpy(h.comment,comment,32); + for(i=strlen(comment);i<32;i++) h.comment[i]=' '; + fseek(epp->F,0L,SEEK_SET); + fwrite(&h,128,1,epp->F); + fseek(epp->F,epp->filepos,SEEK_SET); +} +void change_epp_header(EPP *epp,EPPHEADER h) +{ + EPPHEADER fh; + fseek(epp->F,0L,SEEK_SET); + fread(&fh,128,1,epp->F); + fh.fcx=swapdouble(h.fcx); + fh.lcx=swapdouble(h.lcx); + fh.fry=swapdouble(h.fry); + fh.lry=swapdouble(h.lry); + fh.base=swapshort(h.base); + fh.scale=swapshort(h.scale); + fh.offsite=swapshort(epp->offsite=h.offsite); + fh.sfact=swapdouble(h.sfact); + fh.coord_sys=h.coord_sys; + fh.area_unit=h.area_unit; + memcpy(h.comment,fh.comment,32); + fseek(epp->F,0L,SEEK_SET); + fwrite(&fh,128,1,epp->F); + fseek(epp->F,epp->filepos,SEEK_SET); +} + +int shift_epp(EPP *epp,int new_fr,int new_fc) +{int new_lr,new_lc,result; + EPPHEADER h; + new_lr=epp->lr-epp->fr+new_fr; + new_lc=epp->lc-epp->fc+new_fc; + if ((new_fr<-32767)||(new_fc<-32767)||(new_lc>32768)||(new_lc>32768)) + return 0; + if (epp->mode & MAP_OUTPUT) + { + fseek(epp->F,0,SEEK_SET); + fread(&h,128,1,epp->F); + h.fc=swapshort(epp->fc=new_fc); + h.fr=swapshort(epp->fr=new_fr); + h.lr=swapshort((epp->lr=new_lr)-1); + h.lc=swapshort((epp->lc=new_lc)-1); + fseek(epp->F,0,SEEK_SET); + result=(fwrite(&h,128,1,epp->F)==128); + fseek(epp->F,epp->filepos,SEEK_SET); + } + else result=1; + if (result) + { epp->fr=new_fr; + epp->lr=new_lr; + epp->fc=new_fc; + epp->lc=new_lc; + } + return result; +} + + +void reset_epp(EPP *epp) +/* reopens epp file for reading. if file was in create mode, fills all non-filled +lines by offsite */ +{ if (epp->mode==MAP_OUTPUT) + { update_header(epp); + epp->mode=MAP_INPUT; + fseek(epp->F,128L,SEEK_SET); + epp->filepos=128L; + epp->currentline=epp->fr-1; + epp->position=position_input; + } + else (*epp->position)(epp,epp->fr); +} +/* + * update_header - writes changes into header and writes width table. + * for write-only files also fills all unfilled rows by offsite. + * Modifies following field in file header: + * 1. access_ptr (to point to newly written width table) + * 2. maxclass + * 3. minclass + * 4. offsite (so we can play with its value) + * 5. date and time stamp + */ +void update_header(EPP *epp)/* writes changes into header */ +{ + int i; + unsigned short int *r; + struct tm *t; + int table_offset; +#ifndef LSB_FIRST + short *fwt; +#endif + time_t timesec; + EPPHEADER h; + /* For write-only file fill rest of it by offsite */ + if(epp->mode==MAP_OUTPUT) { + put_row(epp); + for (r=epp->row,i=0;iwidth;*(r++)=epp->offsite,i++); + for (i=epp->currentline;ilr;i++){put_row(epp);} + } + memset(&h,128,0); + /* width table should be aligned to 128 byte boundary */ + if((i=(epp->filepos % 128))) fwrite(&h,128-i,1,epp->F); + table_offset=ftell(epp->F); +#ifdef LSB_FIRST + fwrite(epp->widthtable,epp->lr-epp->fr,sizeof(short),epp->F); +#else + fwt=calloc(epp->lr-epp->fr,sizeof(short)); + swab(epp->widthtable,fwt,epp->lr-epp->fr); + fwrite(fwt,epp->lr-epp->fr,sizeof(short),epp->F); + free(fwt); +#endif + if ((i=(ftell(epp->F)%128))) fwrite(&h,128-i,1,epp->F); + /* I don't know how old software would behave if file size is + not multiplication of 128, so write few bytes of junk */ + if ((i=(ftell(epp->F)%128))) fwrite(&h,128-i,1,epp->F); + /* Truncate file here.*/ + ftruncate(fileno(epp->F),ftell(epp->F)); + /* Now we are ready to write header. */ + fseek(epp->F,0,SEEK_SET); + fread(&h,128,1,epp->F); + h.access_ptr=swaplong(table_offset / 128); + h.offsite=swapshort(epp->offsite); + h.maxclass=swapshort(epp->max); + h.minclass=swapshort(epp->min); + /* correct date/time values */ + time(×ec); + t=localtime(×ec); + sprintf(h.date,"%02d/%02d/%02d",t->tm_mon+1,t->tm_mday,t->tm_year); + for(i=strlen(h.date);i<16;h.date[i++]=' '); + sprintf(h.time,"%02d:%02d:%02d",t->tm_hour,t->tm_min,t->tm_sec); + for(i=strlen(h.time);i<8;h.time[i++]=' '); + fseek(epp->F,0L,SEEK_SET); + fwrite(&h,128,1,epp->F); + epp->filepos=128; + epp->currentline=epp->fr-1; +} +/* + * Perform actual eppl packing algoritm. Fetch each second byte from + * source row, so pack_buffer can call it twice for 16-bit files + * row is row buffer to pack (may be pointer to second byte of actual + * row buffer) bufpos - stores offset in epp->packed_buffer, where to + * start packing. On exit it contains offset of next byte after last packed + */ + +void pack_row(unsigned char *row,int *bufpos,EPP *epp) +{ + register unsigned char c, *dest, *i; + register unsigned char *stop; + register unsigned char *j, *k; + stop=row+((epp->width-1)<<1); + dest=epp->packed_buffer+(*bufpos); + for(i=row;i1) + { *(dest++)=c;*(dest++)=*i; + i=j; + } + else + { for(j=i+2;(j1) + { *(dest++)=0;} + *(dest++)=c; + for (k=i;kpacked_buffer); +} +/* + * Stores content of epp->row into epp->packed_buffer by calling + * pack_row epp->kind/8 times. + * Updates width table. + */ +int pack_buffer(EPP *epp) +{int bufpos=0; + if (!(epp->mode & MAP_OUTPUT)) {map_error=ME_INVALID_MODE; return 0;} +#ifdef LSB_FIRST + /* Intel architecture - first byte of short is LSB. store it first */ + pack_row((unsigned char *)epp->row,&bufpos,epp); + if (epp->kind==16) + pack_row(((unsigned char *)epp->row)+1,&bufpos,epp); +#else + /* Sparc architecture - store second byte of short first, first byte last*/ + pack_row(((unsigned char *)epp->row)+1,&bufpos,epp); + if (epp->kind==16) + pack_row(((unsigned char *)epp->row),&bufpos,epp); +#endif + /* update width table */ + epp->widthtable[epp->currentline-epp->fr]=bufpos; + return bufpos; +} +/* + * Packs and writes row + * + */ +void put_row(EPP *epp) +{ int l; + if (!(epp->mode & MAP_OUTPUT)) { + map_error=ME_INVALID_MODE; + return; + } + l=pack_buffer(epp); + if (fwrite(epp->packed_buffer,1,l,epp->F)!=l) { + map_error=ME_WRITE_ERROR; + return; + } + epp->filepos+=l; + epp->currentline++; +} +/* + * Positions write-only file. To be stored in position field of EPP structure. + * If row > current fills all rows between current and given by offsite. + */ +void position_output(EPP *epp,int row) +{ + unsigned short *r; + int i; + + if (row==epp->currentline) + return; + if (!epp_contains(epp,epp->fc,row)) { + map_error=ME_POINT_OUTSIDE; return; + } + if (rowcurrentline) { + map_error=ME_INVALID_PUT; + return; + } + /* store current row */ + map_error=0; + put_row(epp); + if (map_error) return; + /* fill row buffer with offsite */ + for (r=epp->row,i=epp->fc;ilc;i++,r++)*r=epp->offsite; + while (epp->currentlinemode!=MAP_OUTPUT) { + map_error=ME_INVALID_MODE; + return; + } + reset_epp(source); + fseek(source->F,0L,SEEK_SET); + fread(&h,128,1,source->F); + h.kind=swapshort(8); + if (source->offsite>255&&source->offsite!=65535) { + h.offsite=swapshort(source->offsite & 0xff); + } + dest=fopen(filename,"w+"); + if (!dest) { + map_error=ME_WRITE_ERROR; + return; + } + fwrite(&h,128,1,dest); + nrows=source->lr-source->fr; + for(i=source->fr,j=0;ilr;i++,j++) { + if (EndLineProc) + (*EndLineProc)(i,j+1,nrows); + fread(source->packed_buffer,source->widthtable[j],1,source->F); + bufpos=0; + unpack_row((unsigned char *)source->row,&bufpos,source); + source->widthtable[j]=bufpos; + fwrite(source->packed_buffer,bufpos,1,dest); + } + memset(&h,128,0); + /* This is assignment, not condition */ + if((i=ftell(dest) % 128)) fwrite(&h,128-i,1,dest); + access_ptr=ftell(dest)/128; +#ifdef LSB_FIRST + fwrite(source->widthtable,nrows,2,dest); +#else + swapped_bytes=malloc(nrows*2); + swab(source->widthtable,swapped_bytes,nrows*2); + fwrite(swapped_bytes,nrows,2,dest); +#endif + fseek(dest,0L,SEEK_SET); + fread(&h,128,1,dest); + h.access_ptr=swaplong(access_ptr); + fseek(dest,0L,SEEK_SET); + fwrite(&h,128,1,dest); + fclose(dest); + close_epp(source); +} + +/* fills given cell by value. File must be in create mode. if line is not + current, does nothing if line above current or fills all lines between current + and specified by offsite +*/ +void epp_put(EPP *epp,int x,int y,int value) +{ + unsigned short *pixel; + + if (!(epp->mode&MAP_OUTPUT)){ + map_error=ME_INVALID_MODE; return ; + } + + if (!epp_contains(epp,x,y)) { + map_error=ME_POINT_OUTSIDE; return; + } + + if (epp->currentline!=y) { + (*epp->position)(epp,y); + } + if (epp->counttable) { + /* if we are supporting counting of cell values*/ + pixel=epp->row+(x-epp->fc); + /* # maintain table */ + epp->counttable[*pixel]--; + epp->counttable[value]++; + *pixel=value; + /* # check if maximum or minimum changed */ + if (value>epp->max&&value!=epp->offsite) { + epp->max=value; + } else { + while ((epp->max==epp->offsite||!epp->counttable[epp->max])&& + epp->max) + epp->max--; + } + if (valuemin&&value!=epp->offsite) { + epp->min=value; + } else { + while ((epp->min==epp->offsite||!epp->counttable[epp->min])&& + epp->minmax) + epp->min++; + } + } else { + /* we can only change max/min if value is outside them */ + epp->row[x-epp->fc]=value; + if (value!=epp->offsite) { + if ((unsigned)value>epp->max) epp->max=value; + if ((unsigned)valuemin) epp->min=value; + } + } + epp->modified=1; +} +/* fills range of adjanced cells in same row with same value + In create mode complains, if row is above current. + If any point of specified range is outside physical file limits, + complains and does nothing. +*/ +void epp_putline(EPP *epp,int x1,int x2,int y,int value) +{ + unsigned short *pixel; + int i; + if (!(epp->mode&MAP_OUTPUT)){ + map_error=ME_INVALID_MODE; return ; + } + + map_error=0; + /* Positioning to desired row */ + if (epp->currentline!=y) { + (*epp->position)(epp,y); + } + /* return if row is invalid */ + if (map_error) return; + /* if line exceeds file limits, truncate it */ + if (x1fc) x1=epp->fc; + if (x2>=epp->lc) x2=epp->lc-1; + /* if nothing left, return error */ + if (x1>x2) { + map_error=ME_POINT_OUTSIDE; + return; + } + if (epp->counttable) { + /* if we are supporting counting of cell values*/ + for (pixel=epp->row+(x1-epp->fc),i=x1;i<=x2;i++,pixel++) { + /* # maintain table */ + epp->counttable[*pixel]--; + *pixel=value; + } + epp->counttable[value]+=x2-x1+1; + /* # check if maximum or minimum changed */ + if (value>epp->max&&value!=epp->offsite) { + epp->max=value; + } else { + while ((epp->max==epp->offsite||!epp->counttable[epp->max])&& + epp->max) + epp->max--; + } + if (valuemin&&value!=epp->offsite) { + epp->min=value; + } else { + while ((epp->min==epp->offsite||!epp->counttable[epp->min])&& + epp->minmax) + epp->min++; + } + } else { + /* we can only change max/min if value is outside them */ + for (pixel=epp->row+(x1-epp->fc),i=x1;i<=x2;i++,pixel++) { + *pixel=value; + } + if (value!=epp->offsite) { + if ((unsigned)value>epp->max) epp->max=value; + if ((unsigned)valuemin) epp->min=value; + } + } + epp->modified=1; +} diff --git a/lib/epp_private.h b/lib/epp_private.h new file mode 100644 index 0000000..b21248b --- /dev/null +++ b/lib/epp_private.h @@ -0,0 +1,20 @@ +#ifndef EPP_PRIVATE_H +#define EPP_PRIVATE_H +/* decladed in epp_input.c */ +void position_input(EPP* epp,int row); +void unpack_row(unsigned char *row,int *bufpos,EPP *epp); +int unpack_buffer(EPP *epp); + +/* declared in epp_output.c */ +void position_output(EPP* epp,int row); +void update_header(EPP *epp);/* writes changes into header */ +int pack_buffer(EPP *epp); + +/* declared in epp_cached.c */ +extern void free_cache(EPP *epp); +int search_cache(EPP *epp,int row); +void position_cached(EPP* epp,int row); + +/* declared in epp_loaded.c */ +void position_loaded(EPP *epp,int row); +#endif diff --git a/lib/file_utils.c b/lib/file_utils.c new file mode 100644 index 0000000..0312dac --- /dev/null +++ b/lib/file_utils.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include "epp.h" +char* default_ext(const char *name,const char *ext) +{static char buf [1024]; + strcpy(buf,name); + if (strcmp(buf+strlen(buf)-strlen(ext),ext)) { + struct stat statbuf; + strcat(buf,ext); + if (stat(buf,&statbuf)&&!stat(name,&statbuf)) { + strcpy(buf,name); + } + } + return buf; +} + +char *force_ext(const char *name,const char *ext) +{static char buf [1024]; + char *last_ext; + strcpy(buf,name); + if ((last_ext=strrchr(buf,'.'))&&last_ext>strrchr(buf,'/')) *last_ext='\0'; + return strcat(buf,ext); +} +char *last_ext(const char *name) +{static char buf[128]; + char *extptr; + extptr=strrchr(name,'.'); + if(!extptr) return NULL; + if (strchr(extptr,'/')) return NULL; + return strcpy(buf,extptr); +} + +int signal_recieved; +int show_progress(int row,int seqno,int total) +{ fprintf(stderr,"\rProcessing row %d of %d",seqno,total); + fflush(stderr); + return (signal_recieved); +} +int show_percent(int row,int seqno,int total) +{ static int already_done; + int percent=seqno*1000/total; + if (percent!=already_done) + { fprintf(stderr,"\r%3d.%1d%% complete",percent/10,percent%10); + fflush(stderr); + already_done=percent; + } + return signal_recieved; +} + + +int check_int(int row,int seqno,int total) +{ + return (signal_recieved); +} + +void int_handler(int sig_no) +{ signal_recieved=sig_no; + signal(sig_no,int_handler); +} + +void install_progress_indicator(int (*show_progress)(int,int,int)) +{ signal_recieved=0; + signal(SIGINT,int_handler); + EndLineProc=show_progress; +} + +int clear_progress(int success) +{ if (EndLineProc) + { fprintf(stderr,"\r%s \n",success?"Aborted":"Done"); + signal(SIGINT,SIG_DFL); + } + return success; +} +void show_version(char *name,char *RCS_ID) +{ char ver[25],*version=RCS_ID+1; + for(;*version!='$' && *version!=':';version++); + strcpy(ver,version); + version=strrchr(ver,'$'); + if (version) *version=0; + printf("SoftWeyr %c%s. Version %s\n",toupper(name[0]),name+1,ver); + exit(0); + +} diff --git a/lib/gnu_lib/getopt.c b/lib/gnu_lib/getopt.c new file mode 100644 index 0000000..7a4673b --- /dev/null +++ b/lib/gnu_lib/getopt.c @@ -0,0 +1,757 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + +#ifndef __STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +/* This tells Alpha OSF/1 not to define a getopt prototype in . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#endif /* GNU C library. */ + +/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a + long-named option. Because this is not POSIX.2 compliant, it is + being phased out. */ +/* #define GETOPT_COMPAT */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = 0; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. + (Supposedly there are some machines where it might get a warning, + but changing this conditional to __STDC__ is too risky.) */ +#ifdef __GNUC__ +#ifdef IN_GCC +#include "gstddef.h" +#else +#include +#endif +extern size_t strlen (const char *); +#endif + +#endif /* GNU C library. */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int option_index; + + optarg = 0; + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (optind == 0) + { + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + } + + if (nextchar == NULL || *nextchar == '\0') + { + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Now skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + optind++; + last_nonopt = optind; + } + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + if (longopts != NULL + && ((argv[optind][0] == '-' + && (argv[optind][1] == '-' || long_only)) +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + )) + { + const struct option *p; + char *s = nextchar; + int exact = 0; + int ambig = 0; + const struct option *pfound = NULL; + int indfound; + + while (*s && *s != '=') + s++; + + /* Test all options for either exact match or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; + p++, option_index++) + if (!strncmp (p->name, nextchar, s - nextchar)) + { + if (s - nextchar == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*s) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = s + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return '?'; + } + } + + /* Look at and handle the next option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { +#if 0 + if (c < 040 || c >= 0177) + fprintf (stderr, "%s: unrecognized option, character code 0%o\n", + argv[0], c); + else + fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); +#endif + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = 0; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { +#if 0 + fprintf (stderr, "%s: option `-%c' requires an argument\n", + argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/gnu_lib/getopt.h b/lib/gnu_lib/getopt.h new file mode 100644 index 0000000..d751c6b --- /dev/null +++ b/lib/gnu_lib/getopt.h @@ -0,0 +1,132 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + +This file is part of the GNU C Library. + +The GNU C Library is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +The GNU C Library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with the GNU C Library; see the file COPYING.LIB. If +not, write to the Free Software Foundation, Inc., 675 Mass Ave, +Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if __STDC__ +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/lib/gnu_lib/getopt1.c b/lib/gnu_lib/getopt1.c new file mode 100644 index 0000000..f784b57 --- /dev/null +++ b/lib/gnu_lib/getopt1.c @@ -0,0 +1,187 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + +#include "getopt.h" + +#ifndef __STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#else +char *getenv (); +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == EOF) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/lib/gnu_lib/regex.c b/lib/gnu_lib/regex.c new file mode 100644 index 0000000..81b06ff --- /dev/null +++ b/lib/gnu_lib/regex.c @@ -0,0 +1,5171 @@ +/* Extended regular expression matching and search library, + version 0.12. + (Implements POSIX draft P10003.2/D11.2, except for + internationalization features.) + + Copyright (C) 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* AIX requires this to be the first thing in the file. */ +#if defined (_AIX) && !defined (REGEX_MALLOC) + #pragma alloca +#endif + +#define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + +/* We need this for `regex.h', and perhaps for the Emacs include files. */ +#include + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* The `emacs' switch turns on certain matching commands + that make sense only in Emacs. */ +#ifdef emacs + +#include "lisp.h" +#include "buffer.h" +#include "syntax.h" + +/* Emacs uses `NULL' as a predicate. */ +#undef NULL + +#else /* not emacs */ + +#ifdef STDC_HEADERS +#include +#else +char *malloc (); +char *realloc (); +#endif + + +/* We used to test for `BSTRING' here, but only GCC and Emacs define + `BSTRING', as far as I know, and neither of them use this code. */ +#if HAVE_STRING_H || STDC_HEADERS +#include +#ifndef bcmp +#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) +#endif +#ifndef bcopy +#define bcopy(s, d, n) memcpy ((d), (s), (n)) +#endif +#ifndef bzero +#define bzero(s, n) memset ((s), 0, (n)) +#endif +#else +#include +#endif + +/* Define the syntax stuff for \<, \>, etc. */ + +/* This must be nonzero for the wordchar and notwordchar pattern + commands in re_match_2. */ +#ifndef Sword +#define Sword 1 +#endif + +#ifdef SYNTAX_TABLE + +extern char *re_syntax_table; + +#else /* not SYNTAX_TABLE */ + +/* How many characters in the character set. */ +#define CHAR_SET_SIZE 256 + +static char re_syntax_table[CHAR_SET_SIZE]; + +static void +init_syntax_once () +{ + register int c; + static int done = 0; + + if (done) + return; + + bzero (re_syntax_table, sizeof re_syntax_table); + + for (c = 'a'; c <= 'z'; c++) + re_syntax_table[c] = Sword; + + for (c = 'A'; c <= 'Z'; c++) + re_syntax_table[c] = Sword; + + for (c = '0'; c <= '9'; c++) + re_syntax_table[c] = Sword; + + re_syntax_table['_'] = Sword; + + done = 1; +} + +#endif /* not SYNTAX_TABLE */ + +#define SYNTAX(c) re_syntax_table[c] + +#endif /* not emacs */ + +/* Get the interface, including the syntax bits. */ +#include "regex.h" + +/* isalpha etc. are used for the character classes. */ +#include + +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining isascii to 1 should let any compiler worth its salt + eliminate the && through constant folding." */ +#if ! defined (isascii) || defined (STDC_HEADERS) +#undef isascii +#define isascii(c) 1 +#endif + +#ifdef isblank +#define ISBLANK(c) (isascii (c) && isblank (c)) +#else +#define ISBLANK(c) ((c) == ' ' || (c) == '\t') +#endif +#ifdef isgraph +#define ISGRAPH(c) (isascii (c) && isgraph (c)) +#else +#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c)) +#endif + +#define ISPRINT(c) (isascii (c) && isprint (c)) +#define ISDIGIT(c) (isascii (c) && isdigit (c)) +#define ISALNUM(c) (isascii (c) && isalnum (c)) +#define ISALPHA(c) (isascii (c) && isalpha (c)) +#define ISCNTRL(c) (isascii (c) && iscntrl (c)) +#define ISLOWER(c) (isascii (c) && islower (c)) +#define ISPUNCT(c) (isascii (c) && ispunct (c)) +#define ISSPACE(c) (isascii (c) && isspace (c)) +#define ISUPPER(c) (isascii (c) && isupper (c)) +#define ISXDIGIT(c) (isascii (c) && isxdigit (c)) + +#ifndef NULL +#define NULL 0 +#endif + +/* We remove any previous definition of `SIGN_EXTEND_CHAR', + since ours (we hope) works properly with all combinations of + machines, compilers, `char' and `unsigned char' argument types. + (Per Bothner suggested the basic approach.) */ +#undef SIGN_EXTEND_CHAR +#if __STDC__ +#define SIGN_EXTEND_CHAR(c) ((signed char) (c)) +#else /* not __STDC__ */ +/* As in Harbison and Steele. */ +#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) +#endif + +/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we + use `alloca' instead of `malloc'. This is because using malloc in + re_search* or re_match* could cause memory leaks when C-g is used in + Emacs; also, malloc is slower and causes storage fragmentation. On + the other hand, malloc is more portable, and easier to debug. + + Because we sometimes use alloca, some routines have to be macros, + not functions -- `alloca'-allocated space disappears at the end of the + function it is called in. */ + +#ifdef REGEX_MALLOC + +#define REGEX_ALLOCATE malloc +#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize) + +#else /* not REGEX_MALLOC */ + +/* Emacs already defines alloca, sometimes. */ +#ifndef alloca + +/* Make alloca work the best possible way. */ +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if HAVE_ALLOCA_H +#include +#else /* not __GNUC__ or HAVE_ALLOCA_H */ +#ifndef _AIX /* Already did AIX, up at the top. */ +char *alloca (); +#endif /* not _AIX */ +#endif /* not HAVE_ALLOCA_H */ +#endif /* not __GNUC__ */ + +#endif /* not alloca */ + +#define REGEX_ALLOCATE alloca + +/* Assumes a `char *destination' variable. */ +#define REGEX_REALLOCATE(source, osize, nsize) \ + (destination = (char *) alloca (nsize), \ + bcopy (source, destination, osize), \ + destination) + +#endif /* not REGEX_MALLOC */ + + +/* True if `size1' is non-NULL and PTR is pointing anywhere inside + `string1' or just past its end. This works if PTR is NULL, which is + a good thing. */ +#define FIRST_STRING_P(ptr) \ + (size1 && string1 <= (ptr) && (ptr) <= string1 + size1) + +/* (Re)Allocate N items of type T using malloc, or fail. */ +#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t))) +#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t))) +#define RETALLOC_IF(addr, n, t) \ + if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t) +#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t))) + +#define BYTEWIDTH 8 /* In bits. */ + +#define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) + +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +typedef char boolean; +#define false 0 +#define true 1 + +/* These are the command codes that appear in compiled regular + expressions. Some opcodes are followed by argument bytes. A + command code can specify any interpretation whatsoever for its + arguments. Zero bytes may appear in the compiled regular expression. + + The value of `exactn' is needed in search.c (search_buffer) in Emacs. + So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of + `exactn' we use here must also be 1. */ + +typedef enum +{ + no_op = 0, + + /* Followed by one byte giving n, then by n literal bytes. */ + exactn = 1, + + /* Matches any (more or less) character. */ + anychar, + + /* Matches any one char belonging to specified set. First + following byte is number of bitmap bytes. Then come bytes + for a bitmap saying which chars are in. Bits in each byte + are ordered low-bit-first. A character is in the set if its + bit is 1. A character too large to have a bit in the map is + automatically not in the set. */ + charset, + + /* Same parameters as charset, but match any character that is + not one of those specified. */ + charset_not, + + /* Start remembering the text that is matched, for storing in a + register. Followed by one byte with the register number, in + the range 0 to one less than the pattern buffer's re_nsub + field. Then followed by one byte with the number of groups + inner to this one. (This last has to be part of the + start_memory only because we need it in the on_failure_jump + of re_match_2.) */ + start_memory, + + /* Stop remembering the text that is matched and store it in a + memory register. Followed by one byte with the register + number, in the range 0 to one less than `re_nsub' in the + pattern buffer, and one byte with the number of inner groups, + just like `start_memory'. (We need the number of inner + groups here because we don't have any easy way of finding the + corresponding start_memory when we're at a stop_memory.) */ + stop_memory, + + /* Match a duplicate of something remembered. Followed by one + byte containing the register number. */ + duplicate, + + /* Fail unless at beginning of line. */ + begline, + + /* Fail unless at end of line. */ + endline, + + /* Succeeds if at beginning of buffer (if emacs) or at beginning + of string to be matched (if not). */ + begbuf, + + /* Analogously, for end of buffer/string. */ + endbuf, + + /* Followed by two byte relative address to which to jump. */ + jump, + + /* Same as jump, but marks the end of an alternative. */ + jump_past_alt, + + /* Followed by two-byte relative address of place to resume at + in case of failure. */ + on_failure_jump, + + /* Like on_failure_jump, but pushes a placeholder instead of the + current string position when executed. */ + on_failure_keep_string_jump, + + /* Throw away latest failure point and then jump to following + two-byte relative address. */ + pop_failure_jump, + + /* Change to pop_failure_jump if know won't have to backtrack to + match; otherwise change to jump. This is used to jump + back to the beginning of a repeat. If what follows this jump + clearly won't match what the repeat does, such that we can be + sure that there is no use backtracking out of repetitions + already matched, then we change it to a pop_failure_jump. + Followed by two-byte address. */ + maybe_pop_jump, + + /* Jump to following two-byte address, and push a dummy failure + point. This failure point will be thrown away if an attempt + is made to use it for a failure. A `+' construct makes this + before the first repeat. Also used as an intermediary kind + of jump when compiling an alternative. */ + dummy_failure_jump, + + /* Push a dummy failure point and continue. Used at the end of + alternatives. */ + push_dummy_failure, + + /* Followed by two-byte relative address and two-byte number n. + After matching N times, jump to the address upon failure. */ + succeed_n, + + /* Followed by two-byte relative address, and two-byte number n. + Jump to the address N times, then fail. */ + jump_n, + + /* Set the following two-byte relative address to the + subsequent two-byte number. The address *includes* the two + bytes of number. */ + set_number_at, + + wordchar, /* Matches any word-constituent character. */ + notwordchar, /* Matches any char that is not a word-constituent. */ + + wordbeg, /* Succeeds if at word beginning. */ + wordend, /* Succeeds if at word end. */ + + wordbound, /* Succeeds if at a word boundary. */ + notwordbound /* Succeeds if not at a word boundary. */ + +#ifdef emacs + ,before_dot, /* Succeeds if before point. */ + at_dot, /* Succeeds if at point. */ + after_dot, /* Succeeds if after point. */ + + /* Matches any character whose syntax is specified. Followed by + a byte which contains a syntax code, e.g., Sword. */ + syntaxspec, + + /* Matches any character whose syntax is not that specified. */ + notsyntaxspec +#endif /* emacs */ +} re_opcode_t; + +/* Common operations on the compiled pattern. */ + +/* Store NUMBER in two contiguous bytes starting at DESTINATION. */ + +#define STORE_NUMBER(destination, number) \ + do { \ + (destination)[0] = (number) & 0377; \ + (destination)[1] = (number) >> 8; \ + } while (0) + +/* Same as STORE_NUMBER, except increment DESTINATION to + the byte after where the number is stored. Therefore, DESTINATION + must be an lvalue. */ + +#define STORE_NUMBER_AND_INCR(destination, number) \ + do { \ + STORE_NUMBER (destination, number); \ + (destination) += 2; \ + } while (0) + +/* Put into DESTINATION a number stored in two contiguous bytes starting + at SOURCE. */ + +#define EXTRACT_NUMBER(destination, source) \ + do { \ + (destination) = *(source) & 0377; \ + (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \ + } while (0) + +#ifdef DEBUG +static void +extract_number (dest, source) + int *dest; + unsigned char *source; +{ + int temp = SIGN_EXTEND_CHAR (*(source + 1)); + *dest = *source & 0377; + *dest += temp << 8; +} + +#ifndef EXTRACT_MACROS /* To debug the macros. */ +#undef EXTRACT_NUMBER +#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src) +#endif /* not EXTRACT_MACROS */ + +#endif /* DEBUG */ + +/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number. + SOURCE must be an lvalue. */ + +#define EXTRACT_NUMBER_AND_INCR(destination, source) \ + do { \ + EXTRACT_NUMBER (destination, source); \ + (source) += 2; \ + } while (0) + +#ifdef DEBUG +static void +extract_number_and_incr (destination, source) + int *destination; + unsigned char **source; +{ + extract_number (destination, *source); + *source += 2; +} + +#ifndef EXTRACT_MACROS +#undef EXTRACT_NUMBER_AND_INCR +#define EXTRACT_NUMBER_AND_INCR(dest, src) \ + extract_number_and_incr (&dest, &src) +#endif /* not EXTRACT_MACROS */ + +#endif /* DEBUG */ + +/* If DEBUG is defined, Regex prints many voluminous messages about what + it is doing (if the variable `debug' is nonzero). If linked with the + main program in `iregex.c', you can enter patterns and strings + interactively. And if linked with the main program in `main.c' and + the other test files, you can run the already-written tests. */ + +#ifdef DEBUG + +/* We use standard I/O for debugging. */ +#include + +/* It is useful to test things that ``must'' be true when debugging. */ +#include + +static int debug = 0; + +#define DEBUG_STATEMENT(e) e +#define DEBUG_PRINT1(x) if (debug) printf (x) +#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2) +#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3) +#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4) +#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \ + if (debug) print_partial_compiled_pattern (s, e) +#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \ + if (debug) print_double_string (w, s1, sz1, s2, sz2) + + +extern void printchar (); + +/* Print the fastmap in human-readable form. */ + +void +print_fastmap (fastmap) + char *fastmap; +{ + unsigned was_a_range = 0; + unsigned i = 0; + + while (i < (1 << BYTEWIDTH)) + { + if (fastmap[i++]) + { + was_a_range = 0; + printchar (i - 1); + while (i < (1 << BYTEWIDTH) && fastmap[i]) + { + was_a_range = 1; + i++; + } + if (was_a_range) + { + printf ("-"); + printchar (i - 1); + } + } + } + putchar ('\n'); +} + + +/* Print a compiled pattern string in human-readable form, starting at + the START pointer into it and ending just before the pointer END. */ + +void +print_partial_compiled_pattern (start, end) + unsigned char *start; + unsigned char *end; +{ + int mcnt, mcnt2; + unsigned char *p = start; + unsigned char *pend = end; + + if (start == NULL) + { + printf ("(null)\n"); + return; + } + + /* Loop over pattern commands. */ + while (p < pend) + { + printf ("%d:\t", p - start); + + switch ((re_opcode_t) *p++) + { + case no_op: + printf ("/no_op"); + break; + + case exactn: + mcnt = *p++; + printf ("/exactn/%d", mcnt); + do + { + putchar ('/'); + printchar (*p++); + } + while (--mcnt); + break; + + case start_memory: + mcnt = *p++; + printf ("/start_memory/%d/%d", mcnt, *p++); + break; + + case stop_memory: + mcnt = *p++; + printf ("/stop_memory/%d/%d", mcnt, *p++); + break; + + case duplicate: + printf ("/duplicate/%d", *p++); + break; + + case anychar: + printf ("/anychar"); + break; + + case charset: + case charset_not: + { + register int c, last = -100; + register int in_range = 0; + + printf ("/charset [%s", + (re_opcode_t) *(p - 1) == charset_not ? "^" : ""); + + assert (p + *p < pend); + + for (c = 0; c < 256; c++) + if (c / 8 < *p + && (p[1 + (c/8)] & (1 << (c % 8)))) + { + /* Are we starting a range? */ + if (last + 1 == c && ! in_range) + { + putchar ('-'); + in_range = 1; + } + /* Have we broken a range? */ + else if (last + 1 != c && in_range) + { + printchar (last); + in_range = 0; + } + + if (! in_range) + printchar (c); + + last = c; + } + + if (in_range) + printchar (last); + + putchar (']'); + + p += 1 + *p; + } + break; + + case begline: + printf ("/begline"); + break; + + case endline: + printf ("/endline"); + break; + + case on_failure_jump: + extract_number_and_incr (&mcnt, &p); + printf ("/on_failure_jump to %d", p + mcnt - start); + break; + + case on_failure_keep_string_jump: + extract_number_and_incr (&mcnt, &p); + printf ("/on_failure_keep_string_jump to %d", p + mcnt - start); + break; + + case dummy_failure_jump: + extract_number_and_incr (&mcnt, &p); + printf ("/dummy_failure_jump to %d", p + mcnt - start); + break; + + case push_dummy_failure: + printf ("/push_dummy_failure"); + break; + + case maybe_pop_jump: + extract_number_and_incr (&mcnt, &p); + printf ("/maybe_pop_jump to %d", p + mcnt - start); + break; + + case pop_failure_jump: + extract_number_and_incr (&mcnt, &p); + printf ("/pop_failure_jump to %d", p + mcnt - start); + break; + + case jump_past_alt: + extract_number_and_incr (&mcnt, &p); + printf ("/jump_past_alt to %d", p + mcnt - start); + break; + + case jump: + extract_number_and_incr (&mcnt, &p); + printf ("/jump to %d", p + mcnt - start); + break; + + case succeed_n: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2); + break; + + case jump_n: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2); + break; + + case set_number_at: + extract_number_and_incr (&mcnt, &p); + extract_number_and_incr (&mcnt2, &p); + printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2); + break; + + case wordbound: + printf ("/wordbound"); + break; + + case notwordbound: + printf ("/notwordbound"); + break; + + case wordbeg: + printf ("/wordbeg"); + break; + + case wordend: + printf ("/wordend"); + +#ifdef emacs + case before_dot: + printf ("/before_dot"); + break; + + case at_dot: + printf ("/at_dot"); + break; + + case after_dot: + printf ("/after_dot"); + break; + + case syntaxspec: + printf ("/syntaxspec"); + mcnt = *p++; + printf ("/%d", mcnt); + break; + + case notsyntaxspec: + printf ("/notsyntaxspec"); + mcnt = *p++; + printf ("/%d", mcnt); + break; +#endif /* emacs */ + + case wordchar: + printf ("/wordchar"); + break; + + case notwordchar: + printf ("/notwordchar"); + break; + + case begbuf: + printf ("/begbuf"); + break; + + case endbuf: + printf ("/endbuf"); + break; + + default: + printf ("?%d", *(p-1)); + } + + putchar ('\n'); + } + + printf ("%d:\tend of pattern.\n", p - start); +} + + +void +print_compiled_pattern (bufp) + struct re_pattern_buffer *bufp; +{ + unsigned char *buffer = bufp->buffer; + + print_partial_compiled_pattern (buffer, buffer + bufp->used); + printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated); + + if (bufp->fastmap_accurate && bufp->fastmap) + { + printf ("fastmap: "); + print_fastmap (bufp->fastmap); + } + + printf ("re_nsub: %d\t", bufp->re_nsub); + printf ("regs_alloc: %d\t", bufp->regs_allocated); + printf ("can_be_null: %d\t", bufp->can_be_null); + printf ("newline_anchor: %d\n", bufp->newline_anchor); + printf ("no_sub: %d\t", bufp->no_sub); + printf ("not_bol: %d\t", bufp->not_bol); + printf ("not_eol: %d\t", bufp->not_eol); + printf ("syntax: %d\n", bufp->syntax); + /* Perhaps we should print the translate table? */ +} + + +void +print_double_string (where, string1, size1, string2, size2) + const char *where; + const char *string1; + const char *string2; + int size1; + int size2; +{ + unsigned this_char; + + if (where == NULL) + printf ("(null)"); + else + { + if (FIRST_STRING_P (where)) + { + for (this_char = where - string1; this_char < size1; this_char++) + printchar (string1[this_char]); + + where = string2; + } + + for (this_char = where - string2; this_char < size2; this_char++) + printchar (string2[this_char]); + } +} + +#else /* not DEBUG */ + +#undef assert +#define assert(e) + +#define DEBUG_STATEMENT(e) +#define DEBUG_PRINT1(x) +#define DEBUG_PRINT2(x1, x2) +#define DEBUG_PRINT3(x1, x2, x3) +#define DEBUG_PRINT4(x1, x2, x3, x4) +#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) +#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) + +#endif /* not DEBUG */ + +/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can + also be assigned to arbitrarily: each pattern buffer stores its own + syntax, so it can be changed between regex compilations. */ +reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS; + + +/* Specify the precise syntax of regexps for compilation. This provides + for compatibility for various utilities which historically have + different, incompatible syntaxes. + + The argument SYNTAX is a bit mask comprised of the various bits + defined in regex.h. We return the old syntax. */ + +reg_syntax_t +re_set_syntax (syntax) + reg_syntax_t syntax; +{ + reg_syntax_t ret = re_syntax_options; + + re_syntax_options = syntax; + return ret; +} + +/* This table gives an error message for each of the error codes listed + in regex.h. Obviously the order here has to be same as there. */ + +static const char *re_error_msg[] = + { NULL, /* REG_NOERROR */ + "No match", /* REG_NOMATCH */ + "Invalid regular expression", /* REG_BADPAT */ + "Invalid collation character", /* REG_ECOLLATE */ + "Invalid character class name", /* REG_ECTYPE */ + "Trailing backslash", /* REG_EESCAPE */ + "Invalid back reference", /* REG_ESUBREG */ + "Unmatched [ or [^", /* REG_EBRACK */ + "Unmatched ( or \\(", /* REG_EPAREN */ + "Unmatched \\{", /* REG_EBRACE */ + "Invalid content of \\{\\}", /* REG_BADBR */ + "Invalid range end", /* REG_ERANGE */ + "Memory exhausted", /* REG_ESPACE */ + "Invalid preceding regular expression", /* REG_BADRPT */ + "Premature end of regular expression", /* REG_EEND */ + "Regular expression too big", /* REG_ESIZE */ + "Unmatched ) or \\)", /* REG_ERPAREN */ + }; + +/* Avoiding alloca during matching, to placate r_alloc. */ + +/* Define MATCH_MAY_ALLOCATE if we need to make sure that the + searching and matching functions should not call alloca. On some + systems, alloca is implemented in terms of malloc, and if we're + using the relocating allocator routines, then malloc could cause a + relocation, which might (if the strings being searched are in the + ralloc heap) shift the data out from underneath the regexp + routines. + + Here's another reason to avoid allocation: Emacs insists on + processing input from X in a signal handler; processing X input may + call malloc; if input arrives while a matching routine is calling + malloc, then we're scrod. But Emacs can't just block input while + calling matching routines; then we don't notice interrupts when + they come in. So, Emacs blocks input around all regexp calls + except the matching calls, which it leaves unprotected, in the + faith that they will not malloc. */ + +/* Normally, this is fine. */ +#define MATCH_MAY_ALLOCATE + +/* But under some circumstances, it's not. */ +#if defined (emacs) || (defined (REL_ALLOC) && defined (C_ALLOCA)) +#undef MATCH_MAY_ALLOCATE +#endif + + +/* Failure stack declarations and macros; both re_compile_fastmap and + re_match_2 use a failure stack. These have to be macros because of + REGEX_ALLOCATE. */ + + +/* Number of failure points for which to initially allocate space + when matching. If this number is exceeded, we allocate more + space, so it is not a hard limit. */ +#ifndef INIT_FAILURE_ALLOC +#define INIT_FAILURE_ALLOC 5 +#endif + +/* Roughly the maximum number of failure points on the stack. Would be + exactly that if always used MAX_FAILURE_SPACE each time we failed. + This is a variable only so users of regex can assign to it; we never + change it ourselves. */ +int re_max_failures = 2000; + +typedef unsigned char *fail_stack_elt_t; + +typedef struct +{ + fail_stack_elt_t *stack; + unsigned size; + unsigned avail; /* Offset of next open position. */ +} fail_stack_type; + +#define FAIL_STACK_EMPTY() (fail_stack.avail == 0) +#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0) +#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size) +#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail]) + + +/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */ + +#ifdef MATCH_MAY_ALLOCATE +#define INIT_FAIL_STACK() \ + do { \ + fail_stack.stack = (fail_stack_elt_t *) \ + REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \ + \ + if (fail_stack.stack == NULL) \ + return -2; \ + \ + fail_stack.size = INIT_FAILURE_ALLOC; \ + fail_stack.avail = 0; \ + } while (0) +#else +#define INIT_FAIL_STACK() \ + do { \ + fail_stack.avail = 0; \ + } while (0) +#endif + + +/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items. + + Return 1 if succeeds, and 0 if either ran out of memory + allocating space for it or it was already too large. + + REGEX_REALLOCATE requires `destination' be declared. */ + +#define DOUBLE_FAIL_STACK(fail_stack) \ + ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \ + ? 0 \ + : ((fail_stack).stack = (fail_stack_elt_t *) \ + REGEX_REALLOCATE ((fail_stack).stack, \ + (fail_stack).size * sizeof (fail_stack_elt_t), \ + ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \ + \ + (fail_stack).stack == NULL \ + ? 0 \ + : ((fail_stack).size <<= 1, \ + 1))) + + +/* Push PATTERN_OP on FAIL_STACK. + + Return 1 if was able to do so and 0 if ran out of memory allocating + space to do so. */ +#define PUSH_PATTERN_OP(pattern_op, fail_stack) \ + ((FAIL_STACK_FULL () \ + && !DOUBLE_FAIL_STACK (fail_stack)) \ + ? 0 \ + : ((fail_stack).stack[(fail_stack).avail++] = pattern_op, \ + 1)) + +/* This pushes an item onto the failure stack. Must be a four-byte + value. Assumes the variable `fail_stack'. Probably should only + be called from within `PUSH_FAILURE_POINT'. */ +#define PUSH_FAILURE_ITEM(item) \ + fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item + +/* The complement operation. Assumes `fail_stack' is nonempty. */ +#define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail] + +/* Used to omit pushing failure point id's when we're not debugging. */ +#ifdef DEBUG +#define DEBUG_PUSH PUSH_FAILURE_ITEM +#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_ITEM () +#else +#define DEBUG_PUSH(item) +#define DEBUG_POP(item_addr) +#endif + + +/* Push the information about the state we will need + if we ever fail back to it. + + Requires variables fail_stack, regstart, regend, reg_info, and + num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be + declared. + + Does `return FAILURE_CODE' if runs out of memory. */ + +#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \ + do { \ + char *destination; \ + /* Must be int, so when we don't save any registers, the arithmetic \ + of 0 + -1 isn't done as unsigned. */ \ + int this_reg; \ + \ + DEBUG_STATEMENT (failure_id++); \ + DEBUG_STATEMENT (nfailure_points_pushed++); \ + DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \ + DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\ + DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\ + \ + DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \ + DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \ + \ + /* Ensure we have enough space allocated for what we will push. */ \ + while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \ + { \ + if (!DOUBLE_FAIL_STACK (fail_stack)) \ + return failure_code; \ + \ + DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \ + (fail_stack).size); \ + DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\ + } \ + \ + /* Push the info, starting with the registers. */ \ + DEBUG_PRINT1 ("\n"); \ + \ + for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \ + this_reg++) \ + { \ + DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \ + DEBUG_STATEMENT (num_regs_pushed++); \ + \ + DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ + PUSH_FAILURE_ITEM (regstart[this_reg]); \ + \ + DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ + PUSH_FAILURE_ITEM (regend[this_reg]); \ + \ + DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \ + DEBUG_PRINT2 (" match_null=%d", \ + REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \ + DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \ + DEBUG_PRINT2 (" matched_something=%d", \ + MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT2 (" ever_matched=%d", \ + EVER_MATCHED_SOMETHING (reg_info[this_reg])); \ + DEBUG_PRINT1 ("\n"); \ + PUSH_FAILURE_ITEM (reg_info[this_reg].word); \ + } \ + \ + DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\ + PUSH_FAILURE_ITEM (lowest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\ + PUSH_FAILURE_ITEM (highest_active_reg); \ + \ + DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \ + PUSH_FAILURE_ITEM (pattern_place); \ + \ + DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \ + DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \ + size2); \ + DEBUG_PRINT1 ("'\n"); \ + PUSH_FAILURE_ITEM (string_place); \ + \ + DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \ + DEBUG_PUSH (failure_id); \ + } while (0) + +/* This is the number of items that are pushed and popped on the stack + for each register. */ +#define NUM_REG_ITEMS 3 + +/* Individual items aside from the registers. */ +#ifdef DEBUG +#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */ +#else +#define NUM_NONREG_ITEMS 4 +#endif + +/* We push at most this many items on the stack. */ +#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS) + +/* We actually push this many items. */ +#define NUM_FAILURE_ITEMS \ + ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \ + + NUM_NONREG_ITEMS) + +/* How many items can still be added to the stack without overflowing it. */ +#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail) + + +/* Pops what PUSH_FAIL_STACK pushes. + + We restore into the parameters, all of which should be lvalues: + STR -- the saved data position. + PAT -- the saved pattern position. + LOW_REG, HIGH_REG -- the highest and lowest active registers. + REGSTART, REGEND -- arrays of string positions. + REG_INFO -- array of information about each subexpression. + + Also assumes the variables `fail_stack' and (if debugging), `bufp', + `pend', `string1', `size1', `string2', and `size2'. */ + +#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\ +{ \ + DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \ + int this_reg; \ + const unsigned char *string_temp; \ + \ + assert (!FAIL_STACK_EMPTY ()); \ + \ + /* Remove failure points and point to how many regs pushed. */ \ + DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \ + DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \ + DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \ + \ + assert (fail_stack.avail >= NUM_NONREG_ITEMS); \ + \ + DEBUG_POP (&failure_id); \ + DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \ + \ + /* If the saved string location is NULL, it came from an \ + on_failure_keep_string_jump opcode, and we want to throw away the \ + saved NULL, thus retaining our current position in the string. */ \ + string_temp = POP_FAILURE_ITEM (); \ + if (string_temp != NULL) \ + str = (const char *) string_temp; \ + \ + DEBUG_PRINT2 (" Popping string 0x%x: `", str); \ + DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \ + DEBUG_PRINT1 ("'\n"); \ + \ + pat = (unsigned char *) POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \ + DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ + \ + /* Restore register info. */ \ + high_reg = (unsigned) POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ + \ + low_reg = (unsigned) POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ + \ + for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ + { \ + DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \ + \ + reg_info[this_reg].word = POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \ + \ + regend[this_reg] = (const char *) POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \ + \ + regstart[this_reg] = (const char *) POP_FAILURE_ITEM (); \ + DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \ + } \ + \ + DEBUG_STATEMENT (nfailure_points_popped++); \ +} /* POP_FAILURE_POINT */ + + + +/* Structure for per-register (a.k.a. per-group) information. + This must not be longer than one word, because we push this value + onto the failure stack. Other register information, such as the + starting and ending positions (which are addresses), and the list of + inner groups (which is a bits list) are maintained in separate + variables. + + We are making a (strictly speaking) nonportable assumption here: that + the compiler will pack our bit fields into something that fits into + the type of `word', i.e., is something that fits into one item on the + failure stack. */ +typedef union +{ + fail_stack_elt_t word; + struct + { + /* This field is one if this group can match the empty string, + zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */ +#define MATCH_NULL_UNSET_VALUE 3 + unsigned match_null_string_p : 2; + unsigned is_active : 1; + unsigned matched_something : 1; + unsigned ever_matched_something : 1; + } bits; +} register_info_type; + +#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) +#define IS_ACTIVE(R) ((R).bits.is_active) +#define MATCHED_SOMETHING(R) ((R).bits.matched_something) +#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something) + + +/* Call this when have matched a real character; it sets `matched' flags + for the subexpressions which we are currently inside. Also records + that those subexprs have matched. */ +#define SET_REGS_MATCHED() \ + do \ + { \ + unsigned r; \ + for (r = lowest_active_reg; r <= highest_active_reg; r++) \ + { \ + MATCHED_SOMETHING (reg_info[r]) \ + = EVER_MATCHED_SOMETHING (reg_info[r]) \ + = 1; \ + } \ + } \ + while (0) + + +/* Registers are set to a sentinel when they haven't yet matched. */ +#define REG_UNSET_VALUE ((char *) -1) +#define REG_UNSET(e) ((e) == REG_UNSET_VALUE) + + + +/* How do we implement a missing MATCH_MAY_ALLOCATE? + We make the fail stack a global thing, and then grow it to + re_max_failures when we compile. */ +#ifndef MATCH_MAY_ALLOCATE +static fail_stack_type fail_stack; + +static const char ** regstart, ** regend; +static const char ** old_regstart, ** old_regend; +static const char **best_regstart, **best_regend; +static register_info_type *reg_info; +static const char **reg_dummy; +static register_info_type *reg_info_dummy; +#endif + + +/* Subroutine declarations and macros for regex_compile. */ + +static void store_op1 (), store_op2 (); +static void insert_op1 (), insert_op2 (); +static boolean at_begline_loc_p (), at_endline_loc_p (); +static boolean group_in_compile_stack (); +static reg_errcode_t compile_range (); + +/* Fetch the next character in the uncompiled pattern---translating it + if necessary. Also cast from a signed character in the constant + string passed to us by the user to an unsigned char that we can use + as an array index (in, e.g., `translate'). */ +#define PATFETCH(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + if (translate) c = translate[c]; \ + } while (0) + +/* Fetch the next character in the uncompiled pattern, with no + translation. */ +#define PATFETCH_RAW(c) \ + do {if (p == pend) return REG_EEND; \ + c = (unsigned char) *p++; \ + } while (0) + +/* Go backwards one character in the pattern. */ +#define PATUNFETCH p-- + + +/* If `translate' is non-null, return translate[D], else just D. We + cast the subscript to translate because some data is declared as + `char *', to avoid warnings when a string constant is passed. But + when we use a character as a subscript we must make it unsigned. */ +#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d)) + + +/* Macros for outputting the compiled pattern into `buffer'. */ + +/* If the buffer isn't allocated when it comes in, use this. */ +#define INIT_BUF_SIZE 32 + +/* Make sure we have at least N more bytes of space in buffer. */ +#define GET_BUFFER_SPACE(n) \ + while (b - bufp->buffer + (n) > bufp->allocated) \ + EXTEND_BUFFER () + +/* Make sure we have one more byte of buffer space and then add C to it. */ +#define BUF_PUSH(c) \ + do { \ + GET_BUFFER_SPACE (1); \ + *b++ = (unsigned char) (c); \ + } while (0) + + +/* Ensure we have two more bytes of buffer space and then append C1 and C2. */ +#define BUF_PUSH_2(c1, c2) \ + do { \ + GET_BUFFER_SPACE (2); \ + *b++ = (unsigned char) (c1); \ + *b++ = (unsigned char) (c2); \ + } while (0) + + +/* As with BUF_PUSH_2, except for three bytes. */ +#define BUF_PUSH_3(c1, c2, c3) \ + do { \ + GET_BUFFER_SPACE (3); \ + *b++ = (unsigned char) (c1); \ + *b++ = (unsigned char) (c2); \ + *b++ = (unsigned char) (c3); \ + } while (0) + + +/* Store a jump with opcode OP at LOC to location TO. We store a + relative address offset by the three bytes the jump itself occupies. */ +#define STORE_JUMP(op, loc, to) \ + store_op1 (op, loc, (to) - (loc) - 3) + +/* Likewise, for a two-argument jump. */ +#define STORE_JUMP2(op, loc, to, arg) \ + store_op2 (op, loc, (to) - (loc) - 3, arg) + +/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */ +#define INSERT_JUMP(op, loc, to) \ + insert_op1 (op, loc, (to) - (loc) - 3, b) + +/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */ +#define INSERT_JUMP2(op, loc, to, arg) \ + insert_op2 (op, loc, (to) - (loc) - 3, arg, b) + + +/* This is not an arbitrary limit: the arguments which represent offsets + into the pattern are two bytes long. So if 2^16 bytes turns out to + be too small, many things would have to change. */ +#define MAX_BUF_SIZE (1L << 16) + + +/* Extend the buffer by twice its current size via realloc and + reset the pointers that pointed into the old block to point to the + correct places in the new one. If extending the buffer results in it + being larger than MAX_BUF_SIZE, then flag memory exhausted. */ +#define EXTEND_BUFFER() \ + do { \ + unsigned char *old_buffer = bufp->buffer; \ + if (bufp->allocated == MAX_BUF_SIZE) \ + return REG_ESIZE; \ + bufp->allocated <<= 1; \ + if (bufp->allocated > MAX_BUF_SIZE) \ + bufp->allocated = MAX_BUF_SIZE; \ + bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\ + if (bufp->buffer == NULL) \ + return REG_ESPACE; \ + /* If the buffer moved, move all the pointers into it. */ \ + if (old_buffer != bufp->buffer) \ + { \ + b = (b - old_buffer) + bufp->buffer; \ + begalt = (begalt - old_buffer) + bufp->buffer; \ + if (fixup_alt_jump) \ + fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\ + if (laststart) \ + laststart = (laststart - old_buffer) + bufp->buffer; \ + if (pending_exact) \ + pending_exact = (pending_exact - old_buffer) + bufp->buffer; \ + } \ + } while (0) + + +/* Since we have one byte reserved for the register number argument to + {start,stop}_memory, the maximum number of groups we can report + things about is what fits in that byte. */ +#define MAX_REGNUM 255 + +/* But patterns can have more than `MAX_REGNUM' registers. We just + ignore the excess. */ +typedef unsigned regnum_t; + + +/* Macros for the compile stack. */ + +/* Since offsets can go either forwards or backwards, this type needs to + be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */ +typedef int pattern_offset_t; + +typedef struct +{ + pattern_offset_t begalt_offset; + pattern_offset_t fixup_alt_jump; + pattern_offset_t inner_group_offset; + pattern_offset_t laststart_offset; + regnum_t regnum; +} compile_stack_elt_t; + + +typedef struct +{ + compile_stack_elt_t *stack; + unsigned size; + unsigned avail; /* Offset of next open position. */ +} compile_stack_type; + + +#define INIT_COMPILE_STACK_SIZE 32 + +#define COMPILE_STACK_EMPTY (compile_stack.avail == 0) +#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size) + +/* The next available element. */ +#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) + + +/* Set the bit for character C in a list. */ +#define SET_LIST_BIT(c) \ + (b[((unsigned char) (c)) / BYTEWIDTH] \ + |= 1 << (((unsigned char) c) % BYTEWIDTH)) + + +/* Get the next unsigned number in the uncompiled pattern. */ +#define GET_UNSIGNED_NUMBER(num) \ + { if (p != pend) \ + { \ + PATFETCH (c); \ + while (ISDIGIT (c)) \ + { \ + if (num < 0) \ + num = 0; \ + num = num * 10 + c - '0'; \ + if (p == pend) \ + break; \ + PATFETCH (c); \ + } \ + } \ + } + +#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */ + +#define IS_CHAR_CLASS(string) \ + (STREQ (string, "alpha") || STREQ (string, "upper") \ + || STREQ (string, "lower") || STREQ (string, "digit") \ + || STREQ (string, "alnum") || STREQ (string, "xdigit") \ + || STREQ (string, "space") || STREQ (string, "print") \ + || STREQ (string, "punct") || STREQ (string, "graph") \ + || STREQ (string, "cntrl") || STREQ (string, "blank")) + +/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX. + Returns one of error codes defined in `regex.h', or zero for success. + + Assumes the `allocated' (and perhaps `buffer') and `translate' + fields are set in BUFP on entry. + + If it succeeds, results are put in BUFP (if it returns an error, the + contents of BUFP are undefined): + `buffer' is the compiled pattern; + `syntax' is set to SYNTAX; + `used' is set to the length of the compiled pattern; + `fastmap_accurate' is zero; + `re_nsub' is the number of subexpressions in PATTERN; + `not_bol' and `not_eol' are zero; + + The `fastmap' and `newline_anchor' fields are neither + examined nor set. */ + +static reg_errcode_t +regex_compile (pattern, size, syntax, bufp) + const char *pattern; + int size; + reg_syntax_t syntax; + struct re_pattern_buffer *bufp; +{ + /* We fetch characters from PATTERN here. Even though PATTERN is + `char *' (i.e., signed), we declare these variables as unsigned, so + they can be reliably used as array indices. */ + register unsigned char c, c1; + + /* A random tempory spot in PATTERN. */ + const char *p1; + + /* Points to the end of the buffer, where we should append. */ + register unsigned char *b; + + /* Keeps track of unclosed groups. */ + compile_stack_type compile_stack; + + /* Points to the current (ending) position in the pattern. */ + const char *p = pattern; + const char *pend = pattern + size; + + /* How to translate the characters in the pattern. */ + char *translate = bufp->translate; + + /* Address of the count-byte of the most recently inserted `exactn' + command. This makes it possible to tell if a new exact-match + character can be added to that command or if the character requires + a new `exactn' command. */ + unsigned char *pending_exact = 0; + + /* Address of start of the most recently finished expression. + This tells, e.g., postfix * where to find the start of its + operand. Reset at the beginning of groups and alternatives. */ + unsigned char *laststart = 0; + + /* Address of beginning of regexp, or inside of last group. */ + unsigned char *begalt; + + /* Place in the uncompiled pattern (i.e., the {) to + which to go back if the interval is invalid. */ + const char *beg_interval; + + /* Address of the place where a forward jump should go to the end of + the containing expression. Each alternative of an `or' -- except the + last -- ends with a forward jump of this sort. */ + unsigned char *fixup_alt_jump = 0; + + /* Counts open-groups as they are encountered. Remembered for the + matching close-group on the compile stack, so the same register + number is put in the stop_memory as the start_memory. */ + regnum_t regnum = 0; + +#ifdef DEBUG + DEBUG_PRINT1 ("\nCompiling pattern: "); + if (debug) + { + unsigned debug_count; + + for (debug_count = 0; debug_count < size; debug_count++) + printchar (pattern[debug_count]); + putchar ('\n'); + } +#endif /* DEBUG */ + + /* Initialize the compile stack. */ + compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t); + if (compile_stack.stack == NULL) + return REG_ESPACE; + + compile_stack.size = INIT_COMPILE_STACK_SIZE; + compile_stack.avail = 0; + + /* Initialize the pattern buffer. */ + bufp->syntax = syntax; + bufp->fastmap_accurate = 0; + bufp->not_bol = bufp->not_eol = 0; + + /* Set `used' to zero, so that if we return an error, the pattern + printer (for debugging) will think there's no pattern. We reset it + at the end. */ + bufp->used = 0; + + /* Always count groups, whether or not bufp->no_sub is set. */ + bufp->re_nsub = 0; + +#if !defined (emacs) && !defined (SYNTAX_TABLE) + /* Initialize the syntax table. */ + init_syntax_once (); +#endif + + if (bufp->allocated == 0) + { + if (bufp->buffer) + { /* If zero allocated, but buffer is non-null, try to realloc + enough space. This loses if buffer's address is bogus, but + that is the user's responsibility. */ + RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char); + } + else + { /* Caller did not allocate a buffer. Do it for them. */ + bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); + } + if (!bufp->buffer) return REG_ESPACE; + + bufp->allocated = INIT_BUF_SIZE; + } + + begalt = b = bufp->buffer; + + /* Loop through the uncompiled pattern until we're at the end. */ + while (p != pend) + { + PATFETCH (c); + + switch (c) + { + case '^': + { + if ( /* If at start of pattern, it's an operator. */ + p == pattern + 1 + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's come before. */ + || at_begline_loc_p (pattern, p, syntax)) + BUF_PUSH (begline); + else + goto normal_char; + } + break; + + + case '$': + { + if ( /* If at end of pattern, it's an operator. */ + p == pend + /* If context independent, it's an operator. */ + || syntax & RE_CONTEXT_INDEP_ANCHORS + /* Otherwise, depends on what's next. */ + || at_endline_loc_p (p, pend, syntax)) + BUF_PUSH (endline); + else + goto normal_char; + } + break; + + + case '+': + case '?': + if ((syntax & RE_BK_PLUS_QM) + || (syntax & RE_LIMITED_OPS)) + goto normal_char; + handle_plus: + case '*': + /* If there is no previous pattern... */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS) + return REG_BADRPT; + else if (!(syntax & RE_CONTEXT_INDEP_OPS)) + goto normal_char; + } + + { + /* Are we optimizing this jump? */ + boolean keep_string_p = false; + + /* 1 means zero (many) matches is allowed. */ + char zero_times_ok = 0, many_times_ok = 0; + + /* If there is a sequence of repetition chars, collapse it + down to just one (the right one). We can't combine + interval operators with these because of, e.g., `a{2}*', + which should only match an even number of `a's. */ + + for (;;) + { + zero_times_ok |= c != '+'; + many_times_ok |= c != '?'; + + if (p == pend) + break; + + PATFETCH (c); + + if (c == '*' + || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?'))) + ; + + else if (syntax & RE_BK_PLUS_QM && c == '\\') + { + if (p == pend) return REG_EESCAPE; + + PATFETCH (c1); + if (!(c1 == '+' || c1 == '?')) + { + PATUNFETCH; + PATUNFETCH; + break; + } + + c = c1; + } + else + { + PATUNFETCH; + break; + } + + /* If we get here, we found another repeat character. */ + } + + /* Star, etc. applied to an empty pattern is equivalent + to an empty pattern. */ + if (!laststart) + break; + + /* Now we know whether or not zero matches is allowed + and also whether or not two or more matches is allowed. */ + if (many_times_ok) + { /* More than one repetition is allowed, so put in at the + end a backward relative jump from `b' to before the next + jump we're going to put in below (which jumps from + laststart to after this jump). + + But if we are at the `*' in the exact sequence `.*\n', + insert an unconditional jump backwards to the ., + instead of the beginning of the loop. This way we only + push a failure point once, instead of every time + through the loop. */ + assert (p - 1 > pattern); + + /* Allocate the space for the jump. */ + GET_BUFFER_SPACE (3); + + /* We know we are not at the first character of the pattern, + because laststart was nonzero. And we've already + incremented `p', by the way, to be the character after + the `*'. Do we have to do something analogous here + for null bytes, because of RE_DOT_NOT_NULL? */ + if (TRANSLATE (*(p - 2)) == TRANSLATE ('.') + && zero_times_ok + && p < pend && TRANSLATE (*p) == TRANSLATE ('\n') + && !(syntax & RE_DOT_NEWLINE)) + { /* We have .*\n. */ + STORE_JUMP (jump, b, laststart); + keep_string_p = true; + } + else + /* Anything else. */ + STORE_JUMP (maybe_pop_jump, b, laststart - 3); + + /* We've added more stuff to the buffer. */ + b += 3; + } + + /* On failure, jump from laststart to b + 3, which will be the + end of the buffer after this jump is inserted. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump + : on_failure_jump, + laststart, b + 3); + pending_exact = 0; + b += 3; + + if (!zero_times_ok) + { + /* At least one repetition is required, so insert a + `dummy_failure_jump' before the initial + `on_failure_jump' instruction of the loop. This + effects a skip over that instruction the first time + we hit that loop. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6); + b += 3; + } + } + break; + + + case '.': + laststart = b; + BUF_PUSH (anychar); + break; + + + case '[': + { + boolean had_char_class = false; + + if (p == pend) return REG_EBRACK; + + /* Ensure that we have enough space to push a charset: the + opcode, the length count, and the bitset; 34 bytes in all. */ + GET_BUFFER_SPACE (34); + + laststart = b; + + /* We test `*p == '^' twice, instead of using an if + statement, so we only need one BUF_PUSH. */ + BUF_PUSH (*p == '^' ? charset_not : charset); + if (*p == '^') + p++; + + /* Remember the first position in the bracket expression. */ + p1 = p; + + /* Push the number of bytes in the bitmap. */ + BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH); + + /* Clear the whole map. */ + bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH); + + /* charset_not matches newline according to a syntax bit. */ + if ((re_opcode_t) b[-2] == charset_not + && (syntax & RE_HAT_LISTS_NOT_NEWLINE)) + SET_LIST_BIT ('\n'); + + /* Read in characters and ranges, setting map bits. */ + for (;;) + { + if (p == pend) return REG_EBRACK; + + PATFETCH (c); + + /* \ might escape characters inside [...] and [^...]. */ + if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') + { + if (p == pend) return REG_EESCAPE; + + PATFETCH (c1); + SET_LIST_BIT (c1); + continue; + } + + /* Could be the end of the bracket expression. If it's + not (i.e., when the bracket expression is `[]' so + far), the ']' character bit gets set way below. */ + if (c == ']' && p != p1 + 1) + break; + + /* Look ahead to see if it's a range when the last thing + was a character class. */ + if (had_char_class && c == '-' && *p != ']') + return REG_ERANGE; + + /* Look ahead to see if it's a range when the last thing + was a character: if this is a hyphen not at the + beginning or the end of a list, then it's the range + operator. */ + if (c == '-' + && !(p - 2 >= pattern && p[-2] == '[') + && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^') + && *p != ']') + { + reg_errcode_t ret + = compile_range (&p, pend, translate, syntax, b); + if (ret != REG_NOERROR) return ret; + } + + else if (p[0] == '-' && p[1] != ']') + { /* This handles ranges made up of characters only. */ + reg_errcode_t ret; + + /* Move past the `-'. */ + PATFETCH (c1); + + ret = compile_range (&p, pend, translate, syntax, b); + if (ret != REG_NOERROR) return ret; + } + + /* See if we're at the beginning of a possible character + class. */ + + else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':') + { /* Leave room for the null. */ + char str[CHAR_CLASS_MAX_LENGTH + 1]; + + PATFETCH (c); + c1 = 0; + + /* If pattern is `[[:'. */ + if (p == pend) return REG_EBRACK; + + for (;;) + { + PATFETCH (c); + if (c == ':' || c == ']' || p == pend + || c1 == CHAR_CLASS_MAX_LENGTH) + break; + str[c1++] = c; + } + str[c1] = '\0'; + + /* If isn't a word bracketed by `[:' and:`]': + undo the ending character, the letters, and leave + the leading `:' and `[' (but set bits for them). */ + if (c == ':' && *p == ']') + { + int ch; + boolean is_alnum = STREQ (str, "alnum"); + boolean is_alpha = STREQ (str, "alpha"); + boolean is_blank = STREQ (str, "blank"); + boolean is_cntrl = STREQ (str, "cntrl"); + boolean is_digit = STREQ (str, "digit"); + boolean is_graph = STREQ (str, "graph"); + boolean is_lower = STREQ (str, "lower"); + boolean is_print = STREQ (str, "print"); + boolean is_punct = STREQ (str, "punct"); + boolean is_space = STREQ (str, "space"); + boolean is_upper = STREQ (str, "upper"); + boolean is_xdigit = STREQ (str, "xdigit"); + + if (!IS_CHAR_CLASS (str)) return REG_ECTYPE; + + /* Throw away the ] at the end of the character + class. */ + PATFETCH (c); + + if (p == pend) return REG_EBRACK; + + for (ch = 0; ch < 1 << BYTEWIDTH; ch++) + { + if ( (is_alnum && ISALNUM (ch)) + || (is_alpha && ISALPHA (ch)) + || (is_blank && ISBLANK (ch)) + || (is_cntrl && ISCNTRL (ch)) + || (is_digit && ISDIGIT (ch)) + || (is_graph && ISGRAPH (ch)) + || (is_lower && ISLOWER (ch)) + || (is_print && ISPRINT (ch)) + || (is_punct && ISPUNCT (ch)) + || (is_space && ISSPACE (ch)) + || (is_upper && ISUPPER (ch)) + || (is_xdigit && ISXDIGIT (ch))) + SET_LIST_BIT (ch); + } + had_char_class = true; + } + else + { + c1++; + while (c1--) + PATUNFETCH; + SET_LIST_BIT ('['); + SET_LIST_BIT (':'); + had_char_class = false; + } + } + else + { + had_char_class = false; + SET_LIST_BIT (c); + } + } + + /* Discard any (non)matching list bytes that are all 0 at the + end of the map. Decrease the map-length byte too. */ + while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) + b[-1]--; + b += b[-1]; + } + break; + + + case '(': + if (syntax & RE_NO_BK_PARENS) + goto handle_open; + else + goto normal_char; + + + case ')': + if (syntax & RE_NO_BK_PARENS) + goto handle_close; + else + goto normal_char; + + + case '\n': + if (syntax & RE_NEWLINE_ALT) + goto handle_alt; + else + goto normal_char; + + + case '|': + if (syntax & RE_NO_BK_VBAR) + goto handle_alt; + else + goto normal_char; + + + case '{': + if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES) + goto handle_interval; + else + goto normal_char; + + + case '\\': + if (p == pend) return REG_EESCAPE; + + /* Do not translate the character after the \, so that we can + distinguish, e.g., \B from \b, even if we normally would + translate, e.g., B to b. */ + PATFETCH_RAW (c); + + switch (c) + { + case '(': + if (syntax & RE_NO_BK_PARENS) + goto normal_backslash; + + handle_open: + bufp->re_nsub++; + regnum++; + + if (COMPILE_STACK_FULL) + { + RETALLOC (compile_stack.stack, compile_stack.size << 1, + compile_stack_elt_t); + if (compile_stack.stack == NULL) return REG_ESPACE; + + compile_stack.size <<= 1; + } + + /* These are the values to restore when we hit end of this + group. They are all relative offsets, so that if the + whole pattern moves because of realloc, they will still + be valid. */ + COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer; + COMPILE_STACK_TOP.fixup_alt_jump + = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; + COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; + COMPILE_STACK_TOP.regnum = regnum; + + /* We will eventually replace the 0 with the number of + groups inner to this one. But do not push a + start_memory for groups beyond the last one we can + represent in the compiled pattern. */ + if (regnum <= MAX_REGNUM) + { + COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2; + BUF_PUSH_3 (start_memory, regnum, 0); + } + + compile_stack.avail++; + + fixup_alt_jump = 0; + laststart = 0; + begalt = b; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; + break; + + + case ')': + if (syntax & RE_NO_BK_PARENS) goto normal_backslash; + + if (COMPILE_STACK_EMPTY) + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_backslash; + else + return REG_ERPAREN; + + handle_close: + if (fixup_alt_jump) + { /* Push a dummy failure point at the end of the + alternative for a possible future + `pop_failure_jump' to pop. See comments at + `push_dummy_failure' in `re_match_2'. */ + BUF_PUSH (push_dummy_failure); + + /* We allocated space for this jump when we assigned + to `fixup_alt_jump', in the `handle_alt' case below. */ + STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1); + } + + /* See similar code for backslashed left paren above. */ + if (COMPILE_STACK_EMPTY) + if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD) + goto normal_char; + else + return REG_ERPAREN; + + /* Since we just checked for an empty stack above, this + ``can't happen''. */ + assert (compile_stack.avail != 0); + { + /* We don't just want to restore into `regnum', because + later groups should continue to be numbered higher, + as in `(ab)c(de)' -- the second group is #2. */ + regnum_t this_group_regnum; + + compile_stack.avail--; + begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; + fixup_alt_jump + = COMPILE_STACK_TOP.fixup_alt_jump + ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 + : 0; + laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; + this_group_regnum = COMPILE_STACK_TOP.regnum; + /* If we've reached MAX_REGNUM groups, then this open + won't actually generate any code, so we'll have to + clear pending_exact explicitly. */ + pending_exact = 0; + + /* We're at the end of the group, so now we know how many + groups were inside this one. */ + if (this_group_regnum <= MAX_REGNUM) + { + unsigned char *inner_group_loc + = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset; + + *inner_group_loc = regnum - this_group_regnum; + BUF_PUSH_3 (stop_memory, this_group_regnum, + regnum - this_group_regnum); + } + } + break; + + + case '|': /* `\|'. */ + if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR) + goto normal_backslash; + handle_alt: + if (syntax & RE_LIMITED_OPS) + goto normal_char; + + /* Insert before the previous alternative a jump which + jumps to this alternative if the former fails. */ + GET_BUFFER_SPACE (3); + INSERT_JUMP (on_failure_jump, begalt, b + 6); + pending_exact = 0; + b += 3; + + /* The alternative before this one has a jump after it + which gets executed if it gets matched. Adjust that + jump so it will jump to this alternative's analogous + jump (put in below, which in turn will jump to the next + (if any) alternative's such jump, etc.). The last such + jump jumps to the correct final destination. A picture: + _____ _____ + | | | | + | v | v + a | b | c + + If we are at `b', then fixup_alt_jump right now points to a + three-byte space after `a'. We'll put in the jump, set + fixup_alt_jump to right after `b', and leave behind three + bytes which we'll fill in when we get to after `c'. */ + + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + + /* Mark and leave space for a jump after this alternative, + to be filled in later either by next alternative or + when know we're at the end of a series of alternatives. */ + fixup_alt_jump = b; + GET_BUFFER_SPACE (3); + b += 3; + + laststart = 0; + begalt = b; + break; + + + case '{': + /* If \{ is a literal. */ + if (!(syntax & RE_INTERVALS) + /* If we're at `\{' and it's not the open-interval + operator. */ + || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES)) + || (p - 2 == pattern && p == pend)) + goto normal_backslash; + + handle_interval: + { + /* If got here, then the syntax allows intervals. */ + + /* At least (most) this many matches must be made. */ + int lower_bound = -1, upper_bound = -1; + + beg_interval = p - 1; + + if (p == pend) + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + return REG_EBRACE; + } + + GET_UNSIGNED_NUMBER (lower_bound); + + if (c == ',') + { + GET_UNSIGNED_NUMBER (upper_bound); + if (upper_bound < 0) upper_bound = RE_DUP_MAX; + } + else + /* Interval such as `{1}' => match exactly once. */ + upper_bound = lower_bound; + + if (lower_bound < 0 || upper_bound > RE_DUP_MAX + || lower_bound > upper_bound) + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + return REG_BADBR; + } + + if (!(syntax & RE_NO_BK_BRACES)) + { + if (c != '\\') return REG_EBRACE; + + PATFETCH (c); + } + + if (c != '}') + { + if (syntax & RE_NO_BK_BRACES) + goto unfetch_interval; + else + return REG_BADBR; + } + + /* We just parsed a valid interval. */ + + /* If it's invalid to have no preceding re. */ + if (!laststart) + { + if (syntax & RE_CONTEXT_INVALID_OPS) + return REG_BADRPT; + else if (syntax & RE_CONTEXT_INDEP_OPS) + laststart = b; + else + goto unfetch_interval; + } + + /* If the upper bound is zero, don't want to succeed at + all; jump from `laststart' to `b + 3', which will be + the end of the buffer after we insert the jump. */ + if (upper_bound == 0) + { + GET_BUFFER_SPACE (3); + INSERT_JUMP (jump, laststart, b + 3); + b += 3; + } + + /* Otherwise, we have a nontrivial interval. When + we're all done, the pattern will look like: + set_number_at + set_number_at + succeed_n + + jump_n + (The upper bound and `jump_n' are omitted if + `upper_bound' is 1, though.) */ + else + { /* If the upper bound is > 1, we need to insert + more at the end of the loop. */ + unsigned nbytes = 10 + (upper_bound > 1) * 10; + + GET_BUFFER_SPACE (nbytes); + + /* Initialize lower bound of the `succeed_n', even + though it will be set during matching by its + attendant `set_number_at' (inserted next), + because `re_compile_fastmap' needs to know. + Jump to the `jump_n' we might insert below. */ + INSERT_JUMP2 (succeed_n, laststart, + b + 5 + (upper_bound > 1) * 5, + lower_bound); + b += 5; + + /* Code to initialize the lower bound. Insert + before the `succeed_n'. The `5' is the last two + bytes of this `set_number_at', plus 3 bytes of + the following `succeed_n'. */ + insert_op2 (set_number_at, laststart, 5, lower_bound, b); + b += 5; + + if (upper_bound > 1) + { /* More than one repetition is allowed, so + append a backward jump to the `succeed_n' + that starts this interval. + + When we've reached this during matching, + we'll have matched the interval once, so + jump back only `upper_bound - 1' times. */ + STORE_JUMP2 (jump_n, b, laststart + 5, + upper_bound - 1); + b += 5; + + /* The location we want to set is the second + parameter of the `jump_n'; that is `b-2' as + an absolute address. `laststart' will be + the `set_number_at' we're about to insert; + `laststart+3' the number to set, the source + for the relative address. But we are + inserting into the middle of the pattern -- + so everything is getting moved up by 5. + Conclusion: (b - 2) - (laststart + 3) + 5, + i.e., b - laststart. + + We insert this at the beginning of the loop + so that if we fail during matching, we'll + reinitialize the bounds. */ + insert_op2 (set_number_at, laststart, b - laststart, + upper_bound - 1, b); + b += 5; + } + } + pending_exact = 0; + beg_interval = NULL; + } + break; + + unfetch_interval: + /* If an invalid interval, match the characters as literals. */ + assert (beg_interval); + p = beg_interval; + beg_interval = NULL; + + /* normal_char and normal_backslash need `c'. */ + PATFETCH (c); + + if (!(syntax & RE_NO_BK_BRACES)) + { + if (p > pattern && p[-1] == '\\') + goto normal_backslash; + } + goto normal_char; + +#ifdef emacs + /* There is no way to specify the before_dot and after_dot + operators. rms says this is ok. --karl */ + case '=': + BUF_PUSH (at_dot); + break; + + case 's': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]); + break; + + case 'S': + laststart = b; + PATFETCH (c); + BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]); + break; +#endif /* emacs */ + + + case 'w': + laststart = b; + BUF_PUSH (wordchar); + break; + + + case 'W': + laststart = b; + BUF_PUSH (notwordchar); + break; + + + case '<': + BUF_PUSH (wordbeg); + break; + + case '>': + BUF_PUSH (wordend); + break; + + case 'b': + BUF_PUSH (wordbound); + break; + + case 'B': + BUF_PUSH (notwordbound); + break; + + case '`': + BUF_PUSH (begbuf); + break; + + case '\'': + BUF_PUSH (endbuf); + break; + + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + if (syntax & RE_NO_BK_REFS) + goto normal_char; + + c1 = c - '0'; + + if (c1 > regnum) + return REG_ESUBREG; + + /* Can't back reference to a subexpression if inside of it. */ + if (group_in_compile_stack (compile_stack, c1)) + goto normal_char; + + laststart = b; + BUF_PUSH_2 (duplicate, c1); + break; + + + case '+': + case '?': + if (syntax & RE_BK_PLUS_QM) + goto handle_plus; + else + goto normal_backslash; + + default: + normal_backslash: + /* You might think it would be useful for \ to mean + not to translate; but if we don't translate it + it will never match anything. */ + c = TRANSLATE (c); + goto normal_char; + } + break; + + + default: + /* Expects the character in `c'. */ + normal_char: + /* If no exactn currently being built. */ + if (!pending_exact + + /* If last exactn not at current position. */ + || pending_exact + *pending_exact + 1 != b + + /* We have only one byte following the exactn for the count. */ + || *pending_exact == (1 << BYTEWIDTH) - 1 + + /* If followed by a repetition operator. */ + || *p == '*' || *p == '^' + || ((syntax & RE_BK_PLUS_QM) + ? *p == '\\' && (p[1] == '+' || p[1] == '?') + : (*p == '+' || *p == '?')) + || ((syntax & RE_INTERVALS) + && ((syntax & RE_NO_BK_BRACES) + ? *p == '{' + : (p[0] == '\\' && p[1] == '{')))) + { + /* Start building a new exactn. */ + + laststart = b; + + BUF_PUSH_2 (exactn, 0); + pending_exact = b - 1; + } + + BUF_PUSH (c); + (*pending_exact)++; + break; + } /* switch (c) */ + } /* while p != pend */ + + + /* Through the pattern now. */ + + if (fixup_alt_jump) + STORE_JUMP (jump_past_alt, fixup_alt_jump, b); + + if (!COMPILE_STACK_EMPTY) + return REG_EPAREN; + + free (compile_stack.stack); + + /* We have succeeded; set the length of the buffer. */ + bufp->used = b - bufp->buffer; + +#ifdef DEBUG + if (debug) + { + DEBUG_PRINT1 ("\nCompiled pattern: \n"); + print_compiled_pattern (bufp); + } +#endif /* DEBUG */ + +#ifndef MATCH_MAY_ALLOCATE + /* Initialize the failure stack to the largest possible stack. This + isn't necessary unless we're trying to avoid calling alloca in + the search and match routines. */ + { + int num_regs = bufp->re_nsub + 1; + + /* Since DOUBLE_FAIL_STACK refuses to double only if the current size + is strictly greater than re_max_failures, the largest possible stack + is 2 * re_max_failures failure points. */ + fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS); + if (fail_stack.stack) + fail_stack.stack = + (fail_stack_elt_t *) realloc (fail_stack.stack, + (fail_stack.size + * sizeof (fail_stack_elt_t))); + else + fail_stack.stack = + (fail_stack_elt_t *) malloc (fail_stack.size + * sizeof (fail_stack_elt_t)); + + /* Initialize some other variables the matcher uses. */ + RETALLOC_IF (regstart, num_regs, const char *); + RETALLOC_IF (regend, num_regs, const char *); + RETALLOC_IF (old_regstart, num_regs, const char *); + RETALLOC_IF (old_regend, num_regs, const char *); + RETALLOC_IF (best_regstart, num_regs, const char *); + RETALLOC_IF (best_regend, num_regs, const char *); + RETALLOC_IF (reg_info, num_regs, register_info_type); + RETALLOC_IF (reg_dummy, num_regs, const char *); + RETALLOC_IF (reg_info_dummy, num_regs, register_info_type); + } +#endif + + return REG_NOERROR; +} /* regex_compile */ + +/* Subroutines for `regex_compile'. */ + +/* Store OP at LOC followed by two-byte integer parameter ARG. */ + +static void +store_op1 (op, loc, arg) + re_opcode_t op; + unsigned char *loc; + int arg; +{ + *loc = (unsigned char) op; + STORE_NUMBER (loc + 1, arg); +} + + +/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ + +static void +store_op2 (op, loc, arg1, arg2) + re_opcode_t op; + unsigned char *loc; + int arg1, arg2; +{ + *loc = (unsigned char) op; + STORE_NUMBER (loc + 1, arg1); + STORE_NUMBER (loc + 3, arg2); +} + + +/* Copy the bytes from LOC to END to open up three bytes of space at LOC + for OP followed by two-byte integer parameter ARG. */ + +static void +insert_op1 (op, loc, arg, end) + re_opcode_t op; + unsigned char *loc; + int arg; + unsigned char *end; +{ + register unsigned char *pfrom = end; + register unsigned char *pto = end + 3; + + while (pfrom != loc) + *--pto = *--pfrom; + + store_op1 (op, loc, arg); +} + + +/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ + +static void +insert_op2 (op, loc, arg1, arg2, end) + re_opcode_t op; + unsigned char *loc; + int arg1, arg2; + unsigned char *end; +{ + register unsigned char *pfrom = end; + register unsigned char *pto = end + 5; + + while (pfrom != loc) + *--pto = *--pfrom; + + store_op2 (op, loc, arg1, arg2); +} + + +/* P points to just after a ^ in PATTERN. Return true if that ^ comes + after an alternative or a begin-subexpression. We assume there is at + least one character before the ^. */ + +static boolean +at_begline_loc_p (pattern, p, syntax) + const char *pattern, *p; + reg_syntax_t syntax; +{ + const char *prev = p - 2; + boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; + + return + /* After a subexpression? */ + (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash)) + /* After an alternative? */ + || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash)); +} + + +/* The dual of at_begline_loc_p. This one is for $. We assume there is + at least one character after the $, i.e., `P < PEND'. */ + +static boolean +at_endline_loc_p (p, pend, syntax) + const char *p, *pend; + int syntax; +{ + const char *next = p; + boolean next_backslash = *next == '\\'; + const char *next_next = p + 1 < pend ? p + 1 : NULL; + + return + /* Before a subexpression? */ + (syntax & RE_NO_BK_PARENS ? *next == ')' + : next_backslash && next_next && *next_next == ')') + /* Before an alternative? */ + || (syntax & RE_NO_BK_VBAR ? *next == '|' + : next_backslash && next_next && *next_next == '|'); +} + + +/* Returns true if REGNUM is in one of COMPILE_STACK's elements and + false if it's not. */ + +static boolean +group_in_compile_stack (compile_stack, regnum) + compile_stack_type compile_stack; + regnum_t regnum; +{ + int this_element; + + for (this_element = compile_stack.avail - 1; + this_element >= 0; + this_element--) + if (compile_stack.stack[this_element].regnum == regnum) + return true; + + return false; +} + + +/* Read the ending character of a range (in a bracket expression) from the + uncompiled pattern *P_PTR (which ends at PEND). We assume the + starting character is in `P[-2]'. (`P[-1]' is the character `-'.) + Then we set the translation of all bits between the starting and + ending characters (inclusive) in the compiled pattern B. + + Return an error code. + + We use these short variable names so we can use the same macros as + `regex_compile' itself. */ + +static reg_errcode_t +compile_range (p_ptr, pend, translate, syntax, b) + const char **p_ptr, *pend; + char *translate; + reg_syntax_t syntax; + unsigned char *b; +{ + unsigned this_char; + + const char *p = *p_ptr; + int range_start, range_end; + + if (p == pend) + return REG_ERANGE; + + /* Even though the pattern is a signed `char *', we need to fetch + with unsigned char *'s; if the high bit of the pattern character + is set, the range endpoints will be negative if we fetch using a + signed char *. + + We also want to fetch the endpoints without translating them; the + appropriate translation is done in the bit-setting loop below. */ + range_start = ((unsigned char *) p)[-2]; + range_end = ((unsigned char *) p)[0]; + + /* Have to increment the pointer into the pattern string, so the + caller isn't still at the ending character. */ + (*p_ptr)++; + + /* If the start is after the end, the range is empty. */ + if (range_start > range_end) + return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR; + + /* Here we see why `this_char' has to be larger than an `unsigned + char' -- the range is inclusive, so if `range_end' == 0xff + (assuming 8-bit characters), we would otherwise go into an infinite + loop, since all characters <= 0xff. */ + for (this_char = range_start; this_char <= range_end; this_char++) + { + SET_LIST_BIT (TRANSLATE (this_char)); + } + + return REG_NOERROR; +} + +/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in + BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible + characters can start a string that matches the pattern. This fastmap + is used by re_search to skip quickly over impossible starting points. + + The caller must supply the address of a (1 << BYTEWIDTH)-byte data + area as BUFP->fastmap. + + We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in + the pattern buffer. + + Returns 0 if we succeed, -2 if an internal error. */ + +int +re_compile_fastmap (bufp) + struct re_pattern_buffer *bufp; +{ + int j, k; +#ifdef MATCH_MAY_ALLOCATE + fail_stack_type fail_stack; +#endif +#ifndef REGEX_MALLOC + char *destination; +#endif + /* We don't push any register information onto the failure stack. */ + unsigned num_regs = 0; + + register char *fastmap = bufp->fastmap; + unsigned char *pattern = bufp->buffer; + unsigned long size = bufp->used; + unsigned char *p = pattern; + register unsigned char *pend = pattern + size; + + /* Assume that each path through the pattern can be null until + proven otherwise. We set this false at the bottom of switch + statement, to which we get only if a particular path doesn't + match the empty string. */ + boolean path_can_be_null = true; + + /* We aren't doing a `succeed_n' to begin with. */ + boolean succeed_n_p = false; + + assert (fastmap != NULL && p != NULL); + + INIT_FAIL_STACK (); + bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */ + bufp->fastmap_accurate = 1; /* It will be when we're done. */ + bufp->can_be_null = 0; + + while (p != pend || !FAIL_STACK_EMPTY ()) + { + if (p == pend) + { + bufp->can_be_null |= path_can_be_null; + + /* Reset for next path. */ + path_can_be_null = true; + + p = fail_stack.stack[--fail_stack.avail]; + } + + /* We should never be about to go beyond the end of the pattern. */ + assert (p < pend); + +#ifdef SWITCH_ENUM_BUG + switch ((int) ((re_opcode_t) *p++)) +#else + switch ((re_opcode_t) *p++) +#endif + { + + /* I guess the idea here is to simply not bother with a fastmap + if a backreference is used, since it's too hard to figure out + the fastmap for the corresponding group. Setting + `can_be_null' stops `re_search_2' from using the fastmap, so + that is all we do. */ + case duplicate: + bufp->can_be_null = 1; + return 0; + + + /* Following are the cases which match a character. These end + with `break'. */ + + case exactn: + fastmap[p[1]] = 1; + break; + + + case charset: + for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) + if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))) + fastmap[j] = 1; + break; + + + case charset_not: + /* Chars beyond end of map must be allowed. */ + for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++) + fastmap[j] = 1; + + for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--) + if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))) + fastmap[j] = 1; + break; + + + case wordchar: + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) == Sword) + fastmap[j] = 1; + break; + + + case notwordchar: + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) != Sword) + fastmap[j] = 1; + break; + + + case anychar: + /* `.' matches anything ... */ + for (j = 0; j < (1 << BYTEWIDTH); j++) + fastmap[j] = 1; + + /* ... except perhaps newline. */ + if (!(bufp->syntax & RE_DOT_NEWLINE)) + fastmap['\n'] = 0; + + /* Return if we have already set `can_be_null'; if we have, + then the fastmap is irrelevant. Something's wrong here. */ + else if (bufp->can_be_null) + return 0; + + /* Otherwise, have to check alternative paths. */ + break; + + +#ifdef emacs + case syntaxspec: + k = *p++; + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) == (enum syntaxcode) k) + fastmap[j] = 1; + break; + + + case notsyntaxspec: + k = *p++; + for (j = 0; j < (1 << BYTEWIDTH); j++) + if (SYNTAX (j) != (enum syntaxcode) k) + fastmap[j] = 1; + break; + + + /* All cases after this match the empty string. These end with + `continue'. */ + + + case before_dot: + case at_dot: + case after_dot: + continue; +#endif /* not emacs */ + + + case no_op: + case begline: + case endline: + case begbuf: + case endbuf: + case wordbound: + case notwordbound: + case wordbeg: + case wordend: + case push_dummy_failure: + continue; + + + case jump_n: + case pop_failure_jump: + case maybe_pop_jump: + case jump: + case jump_past_alt: + case dummy_failure_jump: + EXTRACT_NUMBER_AND_INCR (j, p); + p += j; + if (j > 0) + continue; + + /* Jump backward implies we just went through the body of a + loop and matched nothing. Opcode jumped to should be + `on_failure_jump' or `succeed_n'. Just treat it like an + ordinary jump. For a * loop, it has pushed its failure + point already; if so, discard that as redundant. */ + if ((re_opcode_t) *p != on_failure_jump + && (re_opcode_t) *p != succeed_n) + continue; + + p++; + EXTRACT_NUMBER_AND_INCR (j, p); + p += j; + + /* If what's on the stack is where we are now, pop it. */ + if (!FAIL_STACK_EMPTY () + && fail_stack.stack[fail_stack.avail - 1] == p) + fail_stack.avail--; + + continue; + + + case on_failure_jump: + case on_failure_keep_string_jump: + handle_on_failure_jump: + EXTRACT_NUMBER_AND_INCR (j, p); + + /* For some patterns, e.g., `(a?)?', `p+j' here points to the + end of the pattern. We don't want to push such a point, + since when we restore it above, entering the switch will + increment `p' past the end of the pattern. We don't need + to push such a point since we obviously won't find any more + fastmap entries beyond `pend'. Such a pattern can match + the null string, though. */ + if (p + j < pend) + { + if (!PUSH_PATTERN_OP (p + j, fail_stack)) + return -2; + } + else + bufp->can_be_null = 1; + + if (succeed_n_p) + { + EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */ + succeed_n_p = false; + } + + continue; + + + case succeed_n: + /* Get to the number of times to succeed. */ + p += 2; + + /* Increment p past the n for when k != 0. */ + EXTRACT_NUMBER_AND_INCR (k, p); + if (k == 0) + { + p -= 4; + succeed_n_p = true; /* Spaghetti code alert. */ + goto handle_on_failure_jump; + } + continue; + + + case set_number_at: + p += 4; + continue; + + + case start_memory: + case stop_memory: + p += 2; + continue; + + + default: + abort (); /* We have listed all the cases. */ + } /* switch *p++ */ + + /* Getting here means we have found the possible starting + characters for one path of the pattern -- and that the empty + string does not match. We need not follow this path further. + Instead, look at the next alternative (remembered on the + stack), or quit if no more. The test at the top of the loop + does these things. */ + path_can_be_null = false; + p = pend; + } /* while p */ + + /* Set `can_be_null' for the last path (also the first path, if the + pattern is empty). */ + bufp->can_be_null |= path_can_be_null; + return 0; +} /* re_compile_fastmap */ + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use + this memory for recording register information. STARTS and ENDS + must be allocated using the malloc library routine, and must each + be at least NUM_REGS * sizeof (regoff_t) bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + PATTERN_BUFFER will allocate its own register data, without + freeing the old data. */ + +void +re_set_registers (bufp, regs, num_regs, starts, ends) + struct re_pattern_buffer *bufp; + struct re_registers *regs; + unsigned num_regs; + regoff_t *starts, *ends; +{ + if (num_regs) + { + bufp->regs_allocated = REGS_REALLOCATE; + regs->num_regs = num_regs; + regs->start = starts; + regs->end = ends; + } + else + { + bufp->regs_allocated = REGS_UNALLOCATED; + regs->num_regs = 0; + regs->start = regs->end = (regoff_t) 0; + } +} + +/* Searching routines. */ + +/* Like re_search_2, below, but only one string is specified, and + doesn't let you say where to stop matching. */ + +int +re_search (bufp, string, size, startpos, range, regs) + struct re_pattern_buffer *bufp; + const char *string; + int size, startpos, range; + struct re_registers *regs; +{ + return re_search_2 (bufp, NULL, 0, string, size, startpos, range, + regs, size); +} + + +/* Using the compiled pattern in BUFP->buffer, first tries to match the + virtual concatenation of STRING1 and STRING2, starting first at index + STARTPOS, then at STARTPOS + 1, and so on. + + STRING1 and STRING2 have length SIZE1 and SIZE2, respectively. + + RANGE is how far to scan while trying to match. RANGE = 0 means try + only at STARTPOS; in general, the last start tried is STARTPOS + + RANGE. + + In REGS, return the indices of the virtual concatenation of STRING1 + and STRING2 that matched the entire BUFP->buffer and its contained + subexpressions. + + Do not consider matching one past the index STOP in the virtual + concatenation of STRING1 and STRING2. + + We return either the position in the strings at which the match was + found, -1 if no match, or -2 if error (such as failure + stack overflow). */ + +int +re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; + int startpos; + int range; + struct re_registers *regs; + int stop; +{ + int val; + register char *fastmap = bufp->fastmap; + register char *translate = bufp->translate; + int total_size = size1 + size2; + int endpos = startpos + range; + + /* Check for out-of-range STARTPOS. */ + if (startpos < 0 || startpos > total_size) + return -1; + + /* Fix up RANGE if it might eventually take us outside + the virtual concatenation of STRING1 and STRING2. */ + if (endpos < -1) + range = -1 - startpos; + else if (endpos > total_size) + range = total_size - startpos; + + /* If the search isn't to be a backwards one, don't waste time in a + search for a pattern that must be anchored. */ + if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0) + { + if (startpos > 0) + return -1; + else + range = 1; + } + + /* Update the fastmap now if not correct already. */ + if (fastmap && !bufp->fastmap_accurate) + if (re_compile_fastmap (bufp) == -2) + return -2; + + /* Loop through the string, looking for a place to start matching. */ + for (;;) + { + /* If a fastmap is supplied, skip quickly over characters that + cannot be the start of a match. If the pattern can match the + null string, however, we don't need to skip characters; we want + the first null string. */ + if (fastmap && startpos < total_size && !bufp->can_be_null) + { + if (range > 0) /* Searching forwards. */ + { + register const char *d; + register int lim = 0; + int irange = range; + + if (startpos < size1 && startpos + range >= size1) + lim = range - (size1 - startpos); + + d = (startpos >= size1 ? string2 - size1 : string1) + startpos; + + /* Written out as an if-else to avoid testing `translate' + inside the loop. */ + if (translate) + while (range > lim + && !fastmap[(unsigned char) + translate[(unsigned char) *d++]]) + range--; + else + while (range > lim && !fastmap[(unsigned char) *d++]) + range--; + + startpos += irange - range; + } + else /* Searching backwards. */ + { + register char c = (size1 == 0 || startpos >= size1 + ? string2[startpos - size1] + : string1[startpos]); + + if (!fastmap[(unsigned char) TRANSLATE (c)]) + goto advance; + } + } + + /* If can't match the null string, and that's all we have left, fail. */ + if (range >= 0 && startpos == total_size && fastmap + && !bufp->can_be_null) + return -1; + + val = re_match_2 (bufp, string1, size1, string2, size2, + startpos, regs, stop); + if (val >= 0) + return startpos; + + if (val == -2) + return -2; + + advance: + if (!range) + break; + else if (range > 0) + { + range--; + startpos++; + } + else + { + range++; + startpos--; + } + } + return -1; +} /* re_search_2 */ + +/* Declarations and macros for re_match_2. */ + +static int bcmp_translate (); +static boolean alt_match_null_string_p (), + common_op_match_null_string_p (), + group_match_null_string_p (); + +/* This converts PTR, a pointer into one of the search strings `string1' + and `string2' into an offset from the beginning of that string. */ +#define POINTER_TO_OFFSET(ptr) \ + (FIRST_STRING_P (ptr) \ + ? ((regoff_t) ((ptr) - string1)) \ + : ((regoff_t) ((ptr) - string2 + size1))) + +/* Macros for dealing with the split strings in re_match_2. */ + +#define MATCHING_IN_FIRST_STRING (dend == end_match_1) + +/* Call before fetching a character with *d. This switches over to + string2 if necessary. */ +#define PREFETCH() \ + while (d == dend) \ + { \ + /* End of string2 => fail. */ \ + if (dend == end_match_2) \ + goto fail; \ + /* End of string1 => advance to string2. */ \ + d = string2; \ + dend = end_match_2; \ + } + + +/* Test if at very beginning or at very end of the virtual concatenation + of `string1' and `string2'. If only one string, it's `string2'. */ +#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2) +#define AT_STRINGS_END(d) ((d) == end2) + + +/* Test if D points to a character which is word-constituent. We have + two special cases to check for: if past the end of string1, look at + the first character in string2; and if before the beginning of + string2, look at the last character in string1. */ +#define WORDCHAR_P(d) \ + (SYNTAX ((d) == end1 ? *string2 \ + : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \ + == Sword) + +/* Test if the character before D and the one at D differ with respect + to being word-constituent. */ +#define AT_WORD_BOUNDARY(d) \ + (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \ + || WORDCHAR_P (d - 1) != WORDCHAR_P (d)) + + +/* Free everything we malloc. */ +#ifdef MATCH_MAY_ALLOCATE +#ifdef REGEX_MALLOC +#define FREE_VAR(var) if (var) free (var); var = NULL +#define FREE_VARIABLES() \ + do { \ + FREE_VAR (fail_stack.stack); \ + FREE_VAR (regstart); \ + FREE_VAR (regend); \ + FREE_VAR (old_regstart); \ + FREE_VAR (old_regend); \ + FREE_VAR (best_regstart); \ + FREE_VAR (best_regend); \ + FREE_VAR (reg_info); \ + FREE_VAR (reg_dummy); \ + FREE_VAR (reg_info_dummy); \ + } while (0) +#else /* not REGEX_MALLOC */ +/* Some MIPS systems (at least) want this to free alloca'd storage. */ +#define FREE_VARIABLES() alloca (0) +#endif /* not REGEX_MALLOC */ +#else +#define FREE_VARIABLES() /* Do nothing! */ +#endif /* not MATCH_MAY_ALLOCATE */ + +/* These values must meet several constraints. They must not be valid + register values; since we have a limit of 255 registers (because + we use only one byte in the pattern for the register number), we can + use numbers larger than 255. They must differ by 1, because of + NUM_FAILURE_ITEMS above. And the value for the lowest register must + be larger than the value for the highest register, so we do not try + to actually save any registers when none are active. */ +#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) +#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) + +/* Matching routines. */ + +#ifndef emacs /* Emacs never uses this. */ +/* re_match is like re_match_2 except it takes only a single string. */ + +int +re_match (bufp, string, size, pos, regs) + struct re_pattern_buffer *bufp; + const char *string; + int size, pos; + struct re_registers *regs; + { + return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size); +} +#endif /* not emacs */ + + +/* re_match_2 matches the compiled pattern in BUFP against the + the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 + and SIZE2, respectively). We start matching at POS, and stop + matching at STOP. + + If REGS is non-null and the `no_sub' field of BUFP is nonzero, we + store offsets for the substring each group matched in REGS. See the + documentation for exactly how many groups we fill. + + We return -1 if no match, -2 if an internal error (such as the + failure stack overflowing). Otherwise, we return the length of the + matched substring. */ + +int +re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) + struct re_pattern_buffer *bufp; + const char *string1, *string2; + int size1, size2; + int pos; + struct re_registers *regs; + int stop; +{ + /* General temporaries. */ + int mcnt; + unsigned char *p1; + + /* Just past the end of the corresponding string. */ + const char *end1, *end2; + + /* Pointers into string1 and string2, just past the last characters in + each to consider matching. */ + const char *end_match_1, *end_match_2; + + /* Where we are in the data, and the end of the current string. */ + const char *d, *dend; + + /* Where we are in the pattern, and the end of the pattern. */ + unsigned char *p = bufp->buffer; + register unsigned char *pend = p + bufp->used; + + /* We use this to map every character in the string. */ + char *translate = bufp->translate; + + /* Failure point stack. Each place that can handle a failure further + down the line pushes a failure point on this stack. It consists of + restart, regend, and reg_info for all registers corresponding to + the subexpressions we're currently inside, plus the number of such + registers, and, finally, two char *'s. The first char * is where + to resume scanning the pattern; the second one is where to resume + scanning the strings. If the latter is zero, the failure point is + a ``dummy''; if a failure happens and the failure point is a dummy, + it gets discarded and the next next one is tried. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ + fail_stack_type fail_stack; +#endif +#ifdef DEBUG + static unsigned failure_id = 0; + unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0; +#endif + + /* We fill all the registers internally, independent of what we + return, for use in backreferences. The number here includes + an element for register zero. */ + unsigned num_regs = bufp->re_nsub + 1; + + /* The currently active registers. */ + unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG; + unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG; + + /* Information on the contents of registers. These are pointers into + the input strings; they record just what was matched (on this + attempt) by a subexpression part of the pattern, that is, the + regnum-th regstart pointer points to where in the pattern we began + matching and the regnum-th regend points to right after where we + stopped matching the regnum-th subexpression. (The zeroth register + keeps track of what the whole pattern matches.) */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const char **regstart, **regend; +#endif + + /* If a group that's operated upon by a repetition operator fails to + match anything, then the register for its start will need to be + restored because it will have been set to wherever in the string we + are when we last see its open-group operator. Similarly for a + register's end. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const char **old_regstart, **old_regend; +#endif + + /* The is_active field of reg_info helps us keep track of which (possibly + nested) subexpressions we are currently in. The matched_something + field of reg_info[reg_num] helps us tell whether or not we have + matched any of the pattern so far this time through the reg_num-th + subexpression. These two fields get reset each time through any + loop their register is in. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global. */ + register_info_type *reg_info; +#endif + + /* The following record the register info as found in the above + variables when we find a match better than any we've seen before. + This happens as we backtrack through the failure points, which in + turn happens only if we have not yet matched the entire string. */ + unsigned best_regs_set = false; +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const char **best_regstart, **best_regend; +#endif + + /* Logically, this is `best_regend[0]'. But we don't want to have to + allocate space for that if we're not allocating space for anything + else (see below). Also, we never need info about register 0 for + any of the other register vectors, and it seems rather a kludge to + treat `best_regend' differently than the rest. So we keep track of + the end of the best match so far in a separate variable. We + initialize this to NULL so that when we backtrack the first time + and need to test it, it's not garbage. */ + const char *match_end = NULL; + + /* Used when we pop values we don't care about. */ +#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global. */ + const char **reg_dummy; + register_info_type *reg_info_dummy; +#endif + +#ifdef DEBUG + /* Counts the total number of registers pushed. */ + unsigned num_regs_pushed = 0; +#endif + + DEBUG_PRINT1 ("\n\nEntering re_match_2.\n"); + + INIT_FAIL_STACK (); + +#ifdef MATCH_MAY_ALLOCATE + /* Do not bother to initialize all the register variables if there are + no groups in the pattern, as it takes a fair amount of time. If + there are groups, we include space for register 0 (the whole + pattern), even though we never use it, since it simplifies the + array indexing. We should fix this. */ + if (bufp->re_nsub) + { + regstart = REGEX_TALLOC (num_regs, const char *); + regend = REGEX_TALLOC (num_regs, const char *); + old_regstart = REGEX_TALLOC (num_regs, const char *); + old_regend = REGEX_TALLOC (num_regs, const char *); + best_regstart = REGEX_TALLOC (num_regs, const char *); + best_regend = REGEX_TALLOC (num_regs, const char *); + reg_info = REGEX_TALLOC (num_regs, register_info_type); + reg_dummy = REGEX_TALLOC (num_regs, const char *); + reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type); + + if (!(regstart && regend && old_regstart && old_regend && reg_info + && best_regstart && best_regend && reg_dummy && reg_info_dummy)) + { + FREE_VARIABLES (); + return -2; + } + } +#if defined (REGEX_MALLOC) + else + { + /* We must initialize all our variables to NULL, so that + `FREE_VARIABLES' doesn't try to free them. */ + regstart = regend = old_regstart = old_regend = best_regstart + = best_regend = reg_dummy = NULL; + reg_info = reg_info_dummy = (register_info_type *) NULL; + } +#endif /* REGEX_MALLOC */ +#endif /* MATCH_MAY_ALLOCATE */ + + /* The starting position is bogus. */ + if (pos < 0 || pos > size1 + size2) + { + FREE_VARIABLES (); + return -1; + } + + /* Initialize subexpression text positions to -1 to mark ones that no + start_memory/stop_memory has been seen for. Also initialize the + register information struct. */ + for (mcnt = 1; mcnt < num_regs; mcnt++) + { + regstart[mcnt] = regend[mcnt] + = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE; + + REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE; + IS_ACTIVE (reg_info[mcnt]) = 0; + MATCHED_SOMETHING (reg_info[mcnt]) = 0; + EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0; + } + + /* We move `string1' into `string2' if the latter's empty -- but not if + `string1' is null. */ + if (size2 == 0 && string1 != NULL) + { + string2 = string1; + size2 = size1; + string1 = 0; + size1 = 0; + } + end1 = string1 + size1; + end2 = string2 + size2; + + /* Compute where to stop matching, within the two strings. */ + if (stop <= size1) + { + end_match_1 = string1 + stop; + end_match_2 = string2; + } + else + { + end_match_1 = end1; + end_match_2 = string2 + stop - size1; + } + + /* `p' scans through the pattern as `d' scans through the data. + `dend' is the end of the input string that `d' points within. `d' + is advanced into the following input string whenever necessary, but + this happens before fetching; therefore, at the beginning of the + loop, `d' can be pointing at the end of a string, but it cannot + equal `string2'. */ + if (size1 > 0 && pos <= size1) + { + d = string1 + pos; + dend = end_match_1; + } + else + { + d = string2 + pos - size1; + dend = end_match_2; + } + + DEBUG_PRINT1 ("The compiled pattern is: "); + DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend); + DEBUG_PRINT1 ("The string to match is: `"); + DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2); + DEBUG_PRINT1 ("'\n"); + + /* This loops over pattern commands. It exits by returning from the + function if the match is complete, or it drops through if the match + fails at this starting point in the input data. */ + for (;;) + { + DEBUG_PRINT2 ("\n0x%x: ", p); + + if (p == pend) + { /* End of pattern means we might have succeeded. */ + DEBUG_PRINT1 ("end of pattern ... "); + + /* If we haven't matched the entire string, and we want the + longest match, try backtracking. */ + if (d != end_match_2) + { + DEBUG_PRINT1 ("backtracking.\n"); + + if (!FAIL_STACK_EMPTY ()) + { /* More failure points to try. */ + boolean same_str_p = (FIRST_STRING_P (match_end) + == MATCHING_IN_FIRST_STRING); + + /* If exceeds best match so far, save it. */ + if (!best_regs_set + || (same_str_p && d > match_end) + || (!same_str_p && !MATCHING_IN_FIRST_STRING)) + { + best_regs_set = true; + match_end = d; + + DEBUG_PRINT1 ("\nSAVING match as best so far.\n"); + + for (mcnt = 1; mcnt < num_regs; mcnt++) + { + best_regstart[mcnt] = regstart[mcnt]; + best_regend[mcnt] = regend[mcnt]; + } + } + goto fail; + } + + /* If no failure points, don't restore garbage. */ + else if (best_regs_set) + { + restore_best_regs: + /* Restore best match. It may happen that `dend == + end_match_1' while the restored d is in string2. + For example, the pattern `x.*y.*z' against the + strings `x-' and `y-z-', if the two strings are + not consecutive in memory. */ + DEBUG_PRINT1 ("Restoring best registers.\n"); + + d = match_end; + dend = ((d >= string1 && d <= end1) + ? end_match_1 : end_match_2); + + for (mcnt = 1; mcnt < num_regs; mcnt++) + { + regstart[mcnt] = best_regstart[mcnt]; + regend[mcnt] = best_regend[mcnt]; + } + } + } /* d != end_match_2 */ + + DEBUG_PRINT1 ("Accepting match.\n"); + + /* If caller wants register contents data back, do it. */ + if (regs && !bufp->no_sub) + { + /* Have the register data arrays been allocated? */ + if (bufp->regs_allocated == REGS_UNALLOCATED) + { /* No. So allocate them with malloc. We need one + extra element beyond `num_regs' for the `-1' marker + GNU code uses. */ + regs->num_regs = MAX (RE_NREGS, num_regs + 1); + regs->start = TALLOC (regs->num_regs, regoff_t); + regs->end = TALLOC (regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + return -2; + bufp->regs_allocated = REGS_REALLOCATE; + } + else if (bufp->regs_allocated == REGS_REALLOCATE) + { /* Yes. If we need more elements than were already + allocated, reallocate them. If we need fewer, just + leave it alone. */ + if (regs->num_regs < num_regs + 1) + { + regs->num_regs = num_regs + 1; + RETALLOC (regs->start, regs->num_regs, regoff_t); + RETALLOC (regs->end, regs->num_regs, regoff_t); + if (regs->start == NULL || regs->end == NULL) + return -2; + } + } + else + { + /* These braces fend off a "empty body in an else-statement" + warning under GCC when assert expands to nothing. */ + assert (bufp->regs_allocated == REGS_FIXED); + } + + /* Convert the pointer data in `regstart' and `regend' to + indices. Register zero has to be set differently, + since we haven't kept track of any info for it. */ + if (regs->num_regs > 0) + { + regs->start[0] = pos; + regs->end[0] = (MATCHING_IN_FIRST_STRING + ? ((regoff_t) (d - string1)) + : ((regoff_t) (d - string2 + size1))); + } + + /* Go through the first `min (num_regs, regs->num_regs)' + registers, since that is all we initialized. */ + for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++) + { + if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt])) + regs->start[mcnt] = regs->end[mcnt] = -1; + else + { + regs->start[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]); + regs->end[mcnt] + = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]); + } + } + + /* If the regs structure we return has more elements than + were in the pattern, set the extra elements to -1. If + we (re)allocated the registers, this is the case, + because we always allocate enough to have at least one + -1 at the end. */ + for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++) + regs->start[mcnt] = regs->end[mcnt] = -1; + } /* regs && !bufp->no_sub */ + + FREE_VARIABLES (); + DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n", + nfailure_points_pushed, nfailure_points_popped, + nfailure_points_pushed - nfailure_points_popped); + DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); + + mcnt = d - pos - (MATCHING_IN_FIRST_STRING + ? string1 + : string2 - size1); + + DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); + + return mcnt; + } + + /* Otherwise match next pattern command. */ +#ifdef SWITCH_ENUM_BUG + switch ((int) ((re_opcode_t) *p++)) +#else + switch ((re_opcode_t) *p++) +#endif + { + /* Ignore these. Used to ignore the n of succeed_n's which + currently have n == 0. */ + case no_op: + DEBUG_PRINT1 ("EXECUTING no_op.\n"); + break; + + + /* Match the next n pattern characters exactly. The following + byte in the pattern defines n, and the n bytes after that + are the characters to match. */ + case exactn: + mcnt = *p++; + DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt); + + /* This is written out as an if-else so we don't waste time + testing `translate' inside the loop. */ + if (translate) + { + do + { + PREFETCH (); + if (translate[(unsigned char) *d++] != (char) *p++) + goto fail; + } + while (--mcnt); + } + else + { + do + { + PREFETCH (); + if (*d++ != (char) *p++) goto fail; + } + while (--mcnt); + } + SET_REGS_MATCHED (); + break; + + + /* Match any character except possibly a newline or a null. */ + case anychar: + DEBUG_PRINT1 ("EXECUTING anychar.\n"); + + PREFETCH (); + + if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n') + || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000')) + goto fail; + + SET_REGS_MATCHED (); + DEBUG_PRINT2 (" Matched `%d'.\n", *d); + d++; + break; + + + case charset: + case charset_not: + { + register unsigned char c; + boolean not = (re_opcode_t) *(p - 1) == charset_not; + + DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); + + PREFETCH (); + c = TRANSLATE (*d); /* The character to match. */ + + /* Cast to `unsigned' instead of `unsigned char' in case the + bit list is a full 32 bytes long. */ + if (c < (unsigned) (*p * BYTEWIDTH) + && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) + not = !not; + + p += 1 + *p; + + if (!not) goto fail; + + SET_REGS_MATCHED (); + d++; + break; + } + + + /* The beginning of a group is represented by start_memory. + The arguments are the register number in the next byte, and the + number of groups inner to this one in the next. The text + matched within the group is recorded (in the internal + registers data structure) under the register number. */ + case start_memory: + DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]); + + /* Find out if this group can match the empty string. */ + p1 = p; /* To send to group_match_null_string_p. */ + + if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[*p]) + = group_match_null_string_p (&p1, pend, reg_info); + + /* Save the position in the string where we were the last time + we were at this open-group operator in case the group is + operated upon by a repetition operator, e.g., with `(a*)*b' + against `ab'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regstart[*p]) ? d : regstart[*p] + : regstart[*p]; + DEBUG_PRINT2 (" old_regstart: %d\n", + POINTER_TO_OFFSET (old_regstart[*p])); + + regstart[*p] = d; + DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p])); + + IS_ACTIVE (reg_info[*p]) = 1; + MATCHED_SOMETHING (reg_info[*p]) = 0; + + /* This is the new highest active register. */ + highest_active_reg = *p; + + /* If nothing was active before, this is the new lowest active + register. */ + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *p; + + /* Move past the register number and inner group count. */ + p += 2; + break; + + + /* The stop_memory opcode represents the end of a group. Its + arguments are the same as start_memory's: the register + number, and the number of inner groups. */ + case stop_memory: + DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]); + + /* We need to save the string position the last time we were at + this close-group operator in case the group is operated + upon by a repetition operator, e.g., with `((a*)*(b*)*)*' + against `aba'; then we want to ignore where we are now in + the string in case this attempt to match fails. */ + old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) + ? REG_UNSET (regend[*p]) ? d : regend[*p] + : regend[*p]; + DEBUG_PRINT2 (" old_regend: %d\n", + POINTER_TO_OFFSET (old_regend[*p])); + + regend[*p] = d; + DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p])); + + /* This register isn't active anymore. */ + IS_ACTIVE (reg_info[*p]) = 0; + + /* If this was the only register active, nothing is active + anymore. */ + if (lowest_active_reg == highest_active_reg) + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + { /* We must scan for the new highest active register, since + it isn't necessarily one less than now: consider + (a(b)c(d(e)f)g). When group 3 ends, after the f), the + new highest active register is 1. */ + unsigned char r = *p - 1; + while (r > 0 && !IS_ACTIVE (reg_info[r])) + r--; + + /* If we end up at register zero, that means that we saved + the registers as the result of an `on_failure_jump', not + a `start_memory', and we jumped to past the innermost + `stop_memory'. For example, in ((.)*) we save + registers 1 and 2 as a result of the *, but when we pop + back to the second ), we are at the stop_memory 1. + Thus, nothing is active. */ + if (r == 0) + { + lowest_active_reg = NO_LOWEST_ACTIVE_REG; + highest_active_reg = NO_HIGHEST_ACTIVE_REG; + } + else + highest_active_reg = r; + } + + /* If just failed to match something this time around with a + group that's operated on by a repetition operator, try to + force exit from the ``loop'', and restore the register + information for this group that we had before trying this + last match. */ + if ((!MATCHED_SOMETHING (reg_info[*p]) + || (re_opcode_t) p[-3] == start_memory) + && (p + 2) < pend) + { + boolean is_a_jump_n = false; + + p1 = p + 2; + mcnt = 0; + switch ((re_opcode_t) *p1++) + { + case jump_n: + is_a_jump_n = true; + case pop_failure_jump: + case maybe_pop_jump: + case jump: + case dummy_failure_jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if (is_a_jump_n) + p1 += 2; + break; + + default: + /* do nothing */ ; + } + p1 += mcnt; + + /* If the next operation is a jump backwards in the pattern + to an on_failure_jump right before the start_memory + corresponding to this stop_memory, exit from the loop + by forcing a failure after pushing on the stack the + on_failure_jump's jump in the pattern, and d. */ + if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump + && (re_opcode_t) p1[3] == start_memory && p1[4] == *p) + { + /* If this group ever matched anything, then restore + what its registers were before trying this last + failed match, e.g., with `(a*)*b' against `ab' for + regstart[1], and, e.g., with `((a*)*(b*)*)*' + against `aba' for regend[3]. + + Also restore the registers for inner groups for, + e.g., `((a*)(b*))*' against `aba' (register 3 would + otherwise get trashed). */ + + if (EVER_MATCHED_SOMETHING (reg_info[*p])) + { + unsigned r; + + EVER_MATCHED_SOMETHING (reg_info[*p]) = 0; + + /* Restore this and inner groups' (if any) registers. */ + for (r = *p; r < *p + *(p + 1); r++) + { + regstart[r] = old_regstart[r]; + + /* xx why this test? */ + if ((int) old_regend[r] >= (int) regstart[r]) + regend[r] = old_regend[r]; + } + } + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + PUSH_FAILURE_POINT (p1 + mcnt, d, -2); + + goto fail; + } + } + + /* Move past the register number and the inner group count. */ + p += 2; + break; + + + /* \ has been turned into a `duplicate' command which is + followed by the numeric value of as the register number. */ + case duplicate: + { + register const char *d2, *dend2; + int regno = *p++; /* Get which register to match against. */ + DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno); + + /* Can't back reference a group which we've never matched. */ + if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno])) + goto fail; + + /* Where in input to try to start matching. */ + d2 = regstart[regno]; + + /* Where to stop matching; if both the place to start and + the place to stop matching are in the same string, then + set to the place to stop, otherwise, for now have to use + the end of the first string. */ + + dend2 = ((FIRST_STRING_P (regstart[regno]) + == FIRST_STRING_P (regend[regno])) + ? regend[regno] : end_match_1); + for (;;) + { + /* If necessary, advance to next segment in register + contents. */ + while (d2 == dend2) + { + if (dend2 == end_match_2) break; + if (dend2 == regend[regno]) break; + + /* End of string1 => advance to string2. */ + d2 = string2; + dend2 = regend[regno]; + } + /* At end of register contents => success */ + if (d2 == dend2) break; + + /* If necessary, advance to next segment in data. */ + PREFETCH (); + + /* How many characters left in this segment to match. */ + mcnt = dend - d; + + /* Want how many consecutive characters we can match in + one shot, so, if necessary, adjust the count. */ + if (mcnt > dend2 - d2) + mcnt = dend2 - d2; + + /* Compare that many; failure if mismatch, else move + past them. */ + if (translate + ? bcmp_translate (d, d2, mcnt, translate) + : bcmp (d, d2, mcnt)) + goto fail; + d += mcnt, d2 += mcnt; + } + } + break; + + + /* begline matches the empty string at the beginning of the string + (unless `not_bol' is set in `bufp'), and, if + `newline_anchor' is set, after newlines. */ + case begline: + DEBUG_PRINT1 ("EXECUTING begline.\n"); + + if (AT_STRINGS_BEG (d)) + { + if (!bufp->not_bol) break; + } + else if (d[-1] == '\n' && bufp->newline_anchor) + { + break; + } + /* In all other cases, we fail. */ + goto fail; + + + /* endline is the dual of begline. */ + case endline: + DEBUG_PRINT1 ("EXECUTING endline.\n"); + + if (AT_STRINGS_END (d)) + { + if (!bufp->not_eol) break; + } + + /* We have to ``prefetch'' the next character. */ + else if ((d == end1 ? *string2 : *d) == '\n' + && bufp->newline_anchor) + { + break; + } + goto fail; + + + /* Match at the very beginning of the data. */ + case begbuf: + DEBUG_PRINT1 ("EXECUTING begbuf.\n"); + if (AT_STRINGS_BEG (d)) + break; + goto fail; + + + /* Match at the very end of the data. */ + case endbuf: + DEBUG_PRINT1 ("EXECUTING endbuf.\n"); + if (AT_STRINGS_END (d)) + break; + goto fail; + + + /* on_failure_keep_string_jump is used to optimize `.*\n'. It + pushes NULL as the value for the string on the stack. Then + `pop_failure_point' will keep the current value for the + string, instead of restoring it. To see why, consider + matching `foo\nbar' against `.*\n'. The .* matches the foo; + then the . fails against the \n. But the next thing we want + to do is match the \n against the \n; if we restored the + string value, we would be back at the foo. + + Because this is used only in specific cases, we don't need to + check all the things that `on_failure_jump' does, to make + sure the right things get saved on the stack. Hence we don't + share its code. The only reason to push anything on the + stack at all is that otherwise we would have to change + `anychar's code to do something besides goto fail in this + case; that seems worse than this. */ + case on_failure_keep_string_jump: + DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt); + + PUSH_FAILURE_POINT (p + mcnt, NULL, -2); + break; + + + /* Uses of on_failure_jump: + + Each alternative starts with an on_failure_jump that points + to the beginning of the next alternative. Each alternative + except the last ends with a jump that in effect jumps past + the rest of the alternatives. (They really jump to the + ending jump of the following alternative, because tensioning + these jumps is a hassle.) + + Repeats start with an on_failure_jump that points past both + the repetition text and either the following jump or + pop_failure_jump back to this on_failure_jump. */ + case on_failure_jump: + on_failure: + DEBUG_PRINT1 ("EXECUTING on_failure_jump"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt); + + /* If this on_failure_jump comes right before a group (i.e., + the original * applied to a group), save the information + for that group and all inner ones, so that if we fail back + to this point, the group's information will be correct. + For example, in \(a*\)*\1, we need the preceding group, + and in \(\(a*\)b*\)\2, we need the inner group. */ + + /* We can't use `p' to check ahead because we push + a failure point to `p + mcnt' after we do this. */ + p1 = p; + + /* We need to skip no_op's before we look for the + start_memory in case this on_failure_jump is happening as + the result of a completed succeed_n, as in \(a\)\{1,3\}b\1 + against aba. */ + while (p1 < pend && (re_opcode_t) *p1 == no_op) + p1++; + + if (p1 < pend && (re_opcode_t) *p1 == start_memory) + { + /* We have a new highest active register now. This will + get reset at the start_memory we are about to get to, + but we will have saved all the registers relevant to + this repetition op, as described above. */ + highest_active_reg = *(p1 + 1) + *(p1 + 2); + if (lowest_active_reg == NO_LOWEST_ACTIVE_REG) + lowest_active_reg = *(p1 + 1); + } + + DEBUG_PRINT1 (":\n"); + PUSH_FAILURE_POINT (p + mcnt, d, -2); + break; + + + /* A smart repeat ends with `maybe_pop_jump'. + We change it to either `pop_failure_jump' or `jump'. */ + case maybe_pop_jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt); + { + register unsigned char *p2 = p; + + /* Compare the beginning of the repeat with what in the + pattern follows its end. If we can establish that there + is nothing that they would both match, i.e., that we + would have to backtrack because of (as in, e.g., `a*a') + then we can change to pop_failure_jump, because we'll + never have to backtrack. + + This is not true in the case of alternatives: in + `(a|ab)*' we do need to backtrack to the `ab' alternative + (e.g., if the string was `ab'). But instead of trying to + detect that here, the alternative has put on a dummy + failure point which is what we will end up popping. */ + + /* Skip over open/close-group commands. + If what follows this loop is a ...+ construct, + look at what begins its body, since we will have to + match at least one of that. */ + while (1) + { + if (p2 + 2 < pend + && ((re_opcode_t) *p2 == stop_memory + || (re_opcode_t) *p2 == start_memory)) + p2 += 3; + else if (p2 + 6 < pend + && (re_opcode_t) *p2 == dummy_failure_jump) + p2 += 6; + else + break; + } + + p1 = p + mcnt; + /* p1[0] ... p1[2] are the `on_failure_jump' corresponding + to the `maybe_finalize_jump' of this case. Examine what + follows. */ + + /* If we're at the end of the pattern, we can change. */ + if (p2 == pend) + { + /* Consider what happens when matching ":\(.*\)" + against ":/". I don't really understand this code + yet. */ + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 + (" End of pattern: change to `pop_failure_jump'.\n"); + } + + else if ((re_opcode_t) *p2 == exactn + || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) + { + register unsigned char c + = *p2 == (unsigned char) endline ? '\n' : p2[2]; + + if ((re_opcode_t) p1[3] == exactn && p1[5] != c) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", + c, p1[5]); + } + + else if ((re_opcode_t) p1[3] == charset + || (re_opcode_t) p1[3] == charset_not) + { + int not = (re_opcode_t) p1[3] == charset_not; + + if (c < (unsigned char) (p1[4] * BYTEWIDTH) + && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH))) + not = !not; + + /* `not' is equal to 1 if c would match, which means + that we can't change to pop_failure_jump. */ + if (!not) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + } + else if ((re_opcode_t) *p2 == charset) + { + register unsigned char c + = *p2 == (unsigned char) endline ? '\n' : p2[2]; + + if ((re_opcode_t) p1[3] == exactn + && ! (p2[1] * BYTEWIDTH > p1[4] + && (p2[1 + p1[4] / BYTEWIDTH] + & (1 << (p1[4] % BYTEWIDTH))))) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n", + c, p1[5]); + } + + else if ((re_opcode_t) p1[3] == charset_not) + { + int idx; + /* We win if the charset_not inside the loop + lists every character listed in the charset after. */ + for (idx = 0; idx < p2[1]; idx++) + if (! (p2[2 + idx] == 0 + || (idx < p1[4] + && ((p2[2 + idx] & ~ p1[5 + idx]) == 0)))) + break; + + if (idx == p2[1]) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + else if ((re_opcode_t) p1[3] == charset) + { + int idx; + /* We win if the charset inside the loop + has no overlap with the one after the loop. */ + for (idx = 0; idx < p2[1] && idx < p1[4]; idx++) + if ((p2[2 + idx] & p1[5 + idx]) != 0) + break; + + if (idx == p2[1] || idx == p1[4]) + { + p[-3] = (unsigned char) pop_failure_jump; + DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); + } + } + } + } + p -= 2; /* Point at relative address again. */ + if ((re_opcode_t) p[-1] != pop_failure_jump) + { + p[-1] = (unsigned char) jump; + DEBUG_PRINT1 (" Match => jump.\n"); + goto unconditional_jump; + } + /* Note fall through. */ + + + /* The end of a simple repeat has a pop_failure_jump back to + its matching on_failure_jump, where the latter will push a + failure point. The pop_failure_jump takes off failure + points put on by this pop_failure_jump's matching + on_failure_jump; we got through the pattern to here from the + matching on_failure_jump, so didn't fail. */ + case pop_failure_jump: + { + /* We need to pass separate storage for the lowest and + highest registers, even though we don't care about the + actual values. Otherwise, we will restore only one + register from the stack, since lowest will == highest in + `pop_failure_point'. */ + unsigned dummy_low_reg, dummy_high_reg; + unsigned char *pdummy; + const char *sdummy; + + DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n"); + POP_FAILURE_POINT (sdummy, pdummy, + dummy_low_reg, dummy_high_reg, + reg_dummy, reg_dummy, reg_info_dummy); + } + /* Note fall through. */ + + + /* Unconditionally jump (without popping any failure points). */ + case jump: + unconditional_jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */ + DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt); + p += mcnt; /* Do the jump. */ + DEBUG_PRINT2 ("(to 0x%x).\n", p); + break; + + + /* We need this opcode so we can detect where alternatives end + in `group_match_null_string_p' et al. */ + case jump_past_alt: + DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n"); + goto unconditional_jump; + + + /* Normally, the on_failure_jump pushes a failure point, which + then gets popped at pop_failure_jump. We will end up at + pop_failure_jump, also, and with a pattern of, say, `a+', we + are skipping over the on_failure_jump, so we have to push + something meaningless for pop_failure_jump to pop. */ + case dummy_failure_jump: + DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n"); + /* It doesn't matter what we push for the string here. What + the code at `fail' tests is the value for the pattern. */ + PUSH_FAILURE_POINT (0, 0, -2); + goto unconditional_jump; + + + /* At the end of an alternative, we need to push a dummy failure + point in case we are followed by a `pop_failure_jump', because + we don't want the failure point for the alternative to be + popped. For example, matching `(a|ab)*' against `aab' + requires that we match the `ab' alternative. */ + case push_dummy_failure: + DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n"); + /* See comments just above at `dummy_failure_jump' about the + two zeroes. */ + PUSH_FAILURE_POINT (0, 0, -2); + break; + + /* Have to succeed matching what follows at least n times. + After that, handle like `on_failure_jump'. */ + case succeed_n: + EXTRACT_NUMBER (mcnt, p + 2); + DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt); + + assert (mcnt >= 0); + /* Originally, this is how many times we HAVE to succeed. */ + if (mcnt > 0) + { + mcnt--; + p += 2; + STORE_NUMBER_AND_INCR (p, mcnt); + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt); + } + else if (mcnt == 0) + { + DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); + p[2] = (unsigned char) no_op; + p[3] = (unsigned char) no_op; + goto on_failure; + } + break; + + case jump_n: + EXTRACT_NUMBER (mcnt, p + 2); + DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt); + + /* Originally, this is how many times we CAN jump. */ + if (mcnt) + { + mcnt--; + STORE_NUMBER (p + 2, mcnt); + goto unconditional_jump; + } + /* If don't have to jump any more, skip over the rest of command. */ + else + p += 4; + break; + + case set_number_at: + { + DEBUG_PRINT1 ("EXECUTING set_number_at.\n"); + + EXTRACT_NUMBER_AND_INCR (mcnt, p); + p1 = p + mcnt; + EXTRACT_NUMBER_AND_INCR (mcnt, p); + DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt); + STORE_NUMBER (p1, mcnt); + break; + } + + case wordbound: + DEBUG_PRINT1 ("EXECUTING wordbound.\n"); + if (AT_WORD_BOUNDARY (d)) + break; + goto fail; + + case notwordbound: + DEBUG_PRINT1 ("EXECUTING notwordbound.\n"); + if (AT_WORD_BOUNDARY (d)) + goto fail; + break; + + case wordbeg: + DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); + if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) + break; + goto fail; + + case wordend: + DEBUG_PRINT1 ("EXECUTING wordend.\n"); + if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) + && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) + break; + goto fail; + +#ifdef emacs +#ifdef emacs19 + case before_dot: + DEBUG_PRINT1 ("EXECUTING before_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) >= point) + goto fail; + break; + + case at_dot: + DEBUG_PRINT1 ("EXECUTING at_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) != point) + goto fail; + break; + + case after_dot: + DEBUG_PRINT1 ("EXECUTING after_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) <= point) + goto fail; + break; +#else /* not emacs19 */ + case at_dot: + DEBUG_PRINT1 ("EXECUTING at_dot.\n"); + if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point) + goto fail; + break; +#endif /* not emacs19 */ + + case syntaxspec: + DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt); + mcnt = *p++; + goto matchsyntax; + + case wordchar: + DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n"); + mcnt = (int) Sword; + matchsyntax: + PREFETCH (); + if (SYNTAX (*d++) != (enum syntaxcode) mcnt) + goto fail; + SET_REGS_MATCHED (); + break; + + case notsyntaxspec: + DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt); + mcnt = *p++; + goto matchnotsyntax; + + case notwordchar: + DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n"); + mcnt = (int) Sword; + matchnotsyntax: + PREFETCH (); + if (SYNTAX (*d++) == (enum syntaxcode) mcnt) + goto fail; + SET_REGS_MATCHED (); + break; + +#else /* not emacs */ + case wordchar: + DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n"); + PREFETCH (); + if (!WORDCHAR_P (d)) + goto fail; + SET_REGS_MATCHED (); + d++; + break; + + case notwordchar: + DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n"); + PREFETCH (); + if (WORDCHAR_P (d)) + goto fail; + SET_REGS_MATCHED (); + d++; + break; +#endif /* not emacs */ + + default: + abort (); + } + continue; /* Successfully executed one pattern command; keep going. */ + + + /* We goto here if a matching operation fails. */ + fail: + if (!FAIL_STACK_EMPTY ()) + { /* A restart point is known. Restore to that state. */ + DEBUG_PRINT1 ("\nFAIL:\n"); + POP_FAILURE_POINT (d, p, + lowest_active_reg, highest_active_reg, + regstart, regend, reg_info); + + /* If this failure point is a dummy, try the next one. */ + if (!p) + goto fail; + + /* If we failed to the end of the pattern, don't examine *p. */ + assert (p <= pend); + if (p < pend) + { + boolean is_a_jump_n = false; + + /* If failed to a backwards jump that's part of a repetition + loop, need to pop this failure point and use the next one. */ + switch ((re_opcode_t) *p) + { + case jump_n: + is_a_jump_n = true; + case maybe_pop_jump: + case pop_failure_jump: + case jump: + p1 = p + 1; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + + if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n) + || (!is_a_jump_n + && (re_opcode_t) *p1 == on_failure_jump)) + goto fail; + break; + default: + /* do nothing */ ; + } + } + + if (d >= string1 && d <= end1) + dend = end_match_1; + } + else + break; /* Matching at this starting point really fails. */ + } /* for (;;) */ + + if (best_regs_set) + goto restore_best_regs; + + FREE_VARIABLES (); + + return -1; /* Failure to match. */ +} /* re_match_2 */ + +/* Subroutine definitions for re_match_2. */ + + +/* We are passed P pointing to a register number after a start_memory. + + Return true if the pattern up to the corresponding stop_memory can + match the empty string, and false otherwise. + + If we find the matching stop_memory, sets P to point to one past its number. + Otherwise, sets P to an undefined byte less than or equal to END. + + We don't handle duplicates properly (yet). */ + +static boolean +group_match_null_string_p (p, end, reg_info) + unsigned char **p, *end; + register_info_type *reg_info; +{ + int mcnt; + /* Point to after the args to the start_memory. */ + unsigned char *p1 = *p + 2; + + while (p1 < end) + { + /* Skip over opcodes that can match nothing, and return true or + false, as appropriate, when we get to one that can't, or to the + matching stop_memory. */ + + switch ((re_opcode_t) *p1) + { + /* Could be either a loop or a series of alternatives. */ + case on_failure_jump: + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + + /* If the next operation is not a jump backwards in the + pattern. */ + + if (mcnt >= 0) + { + /* Go through the on_failure_jumps of the alternatives, + seeing if any of the alternatives cannot match nothing. + The last alternative starts with only a jump, + whereas the rest start with on_failure_jump and end + with a jump, e.g., here is the pattern for `a|b|c': + + /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6 + /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3 + /exactn/1/c + + So, we have to first go through the first (n-1) + alternatives and then deal with the last one separately. */ + + + /* Deal with the first (n-1) alternatives, which start + with an on_failure_jump (see above) that jumps to right + past a jump_past_alt. */ + + while ((re_opcode_t) p1[mcnt-3] == jump_past_alt) + { + /* `mcnt' holds how many bytes long the alternative + is, including the ending `jump_past_alt' and + its number. */ + + if (!alt_match_null_string_p (p1, p1 + mcnt - 3, + reg_info)) + return false; + + /* Move to right after this alternative, including the + jump_past_alt. */ + p1 += mcnt; + + /* Break if it's the beginning of an n-th alternative + that doesn't begin with an on_failure_jump. */ + if ((re_opcode_t) *p1 != on_failure_jump) + break; + + /* Still have to check that it's not an n-th + alternative that starts with an on_failure_jump. */ + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if ((re_opcode_t) p1[mcnt-3] != jump_past_alt) + { + /* Get to the beginning of the n-th alternative. */ + p1 -= 3; + break; + } + } + + /* Deal with the last alternative: go back and get number + of the `jump_past_alt' just before it. `mcnt' contains + the length of the alternative. */ + EXTRACT_NUMBER (mcnt, p1 - 2); + + if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info)) + return false; + + p1 += mcnt; /* Get past the n-th alternative. */ + } /* if mcnt > 0 */ + break; + + + case stop_memory: + assert (p1[1] == **p); + *p = p1 + 2; + return true; + + + default: + if (!common_op_match_null_string_p (&p1, end, reg_info)) + return false; + } + } /* while p1 < end */ + + return false; +} /* group_match_null_string_p */ + + +/* Similar to group_match_null_string_p, but doesn't deal with alternatives: + It expects P to be the first byte of a single alternative and END one + byte past the last. The alternative can contain groups. */ + +static boolean +alt_match_null_string_p (p, end, reg_info) + unsigned char *p, *end; + register_info_type *reg_info; +{ + int mcnt; + unsigned char *p1 = p; + + while (p1 < end) + { + /* Skip over opcodes that can match nothing, and break when we get + to one that can't. */ + + switch ((re_opcode_t) *p1) + { + /* It's a loop. */ + case on_failure_jump: + p1++; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + break; + + default: + if (!common_op_match_null_string_p (&p1, end, reg_info)) + return false; + } + } /* while p1 < end */ + + return true; +} /* alt_match_null_string_p */ + + +/* Deals with the ops common to group_match_null_string_p and + alt_match_null_string_p. + + Sets P to one after the op and its arguments, if any. */ + +static boolean +common_op_match_null_string_p (p, end, reg_info) + unsigned char **p, *end; + register_info_type *reg_info; +{ + int mcnt; + boolean ret; + int reg_no; + unsigned char *p1 = *p; + + switch ((re_opcode_t) *p1++) + { + case no_op: + case begline: + case endline: + case begbuf: + case endbuf: + case wordbeg: + case wordend: + case wordbound: + case notwordbound: +#ifdef emacs + case before_dot: + case at_dot: + case after_dot: +#endif + break; + + case start_memory: + reg_no = *p1; + assert (reg_no > 0 && reg_no <= MAX_REGNUM); + ret = group_match_null_string_p (&p1, end, reg_info); + + /* Have to set this here in case we're checking a group which + contains a group and a back reference to it. */ + + if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; + + if (!ret) + return false; + break; + + /* If this is an optimized succeed_n for zero times, make the jump. */ + case jump: + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + if (mcnt >= 0) + p1 += mcnt; + else + return false; + break; + + case succeed_n: + /* Get to the number of times to succeed. */ + p1 += 2; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + + if (mcnt == 0) + { + p1 -= 4; + EXTRACT_NUMBER_AND_INCR (mcnt, p1); + p1 += mcnt; + } + else + return false; + break; + + case duplicate: + if (!REG_MATCH_NULL_STRING_P (reg_info[*p1])) + return false; + break; + + case set_number_at: + p1 += 4; + + default: + /* All other opcodes mean we cannot match the empty string. */ + return false; + } + + *p = p1; + return true; +} /* common_op_match_null_string_p */ + + +/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN + bytes; nonzero otherwise. */ + +static int +bcmp_translate (s1, s2, len, translate) + unsigned char *s1, *s2; + register int len; + char *translate; +{ + register unsigned char *p1 = s1, *p2 = s2; + while (len) + { + if (translate[*p1++] != translate[*p2++]) return 1; + len--; + } + return 0; +} + +/* Entry points for GNU code. */ + +/* re_compile_pattern is the GNU regular expression compiler: it + compiles PATTERN (of length SIZE) and puts the result in BUFP. + Returns 0 if the pattern was valid, otherwise an error string. + + Assumes the `allocated' (and perhaps `buffer') and `translate' fields + are set in BUFP on entry. + + We call regex_compile to do the actual compilation. */ + +const char * +re_compile_pattern (pattern, length, bufp) + const char *pattern; + int length; + struct re_pattern_buffer *bufp; +{ + reg_errcode_t ret; + + /* GNU code is written to assume at least RE_NREGS registers will be set + (and at least one extra will be -1). */ + bufp->regs_allocated = REGS_UNALLOCATED; + + /* And GNU code determines whether or not to get register information + by passing null for the REGS argument to re_match, etc., not by + setting no_sub. */ + bufp->no_sub = 0; + + /* Match anchors at newline. */ + bufp->newline_anchor = 1; + + ret = regex_compile (pattern, length, re_syntax_options, bufp); + + return re_error_msg[(int) ret]; +} + +/* Entry points compatible with 4.2 BSD regex library. We don't define + them if this is an Emacs or POSIX compilation. */ + +#if !defined (emacs) && !defined (_POSIX_SOURCE) + +/* BSD has one and only one pattern buffer. */ +static struct re_pattern_buffer re_comp_buf; + +char * +re_comp (s) + const char *s; +{ + reg_errcode_t ret; + + if (!s) + { + if (!re_comp_buf.buffer) + return "No previous regular expression"; + return 0; + } + + if (!re_comp_buf.buffer) + { + re_comp_buf.buffer = (unsigned char *) malloc (200); + if (re_comp_buf.buffer == NULL) + return "Memory exhausted"; + re_comp_buf.allocated = 200; + + re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH); + if (re_comp_buf.fastmap == NULL) + return "Memory exhausted"; + } + + /* Since `re_exec' always passes NULL for the `regs' argument, we + don't need to initialize the pattern buffer fields which affect it. */ + + /* Match anchors at newlines. */ + re_comp_buf.newline_anchor = 1; + + ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf); + + /* Yes, we're discarding `const' here. */ + return (char *) re_error_msg[(int) ret]; +} + + +int +re_exec (s) + const char *s; +{ + const int len = strlen (s); + return + 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); +} +#endif /* not emacs and not _POSIX_SOURCE */ + +/* POSIX.2 functions. Don't define these for Emacs. */ + +#ifndef emacs + +/* regcomp takes a regular expression as a string and compiles it. + + PREG is a regex_t *. We do not expect any fields to be initialized, + since POSIX says we shouldn't. Thus, we set + + `buffer' to the compiled pattern; + `used' to the length of the compiled pattern; + `syntax' to RE_SYNTAX_POSIX_EXTENDED if the + REG_EXTENDED bit in CFLAGS is set; otherwise, to + RE_SYNTAX_POSIX_BASIC; + `newline_anchor' to REG_NEWLINE being set in CFLAGS; + `fastmap' and `fastmap_accurate' to zero; + `re_nsub' to the number of subexpressions in PATTERN. + + PATTERN is the address of the pattern string. + + CFLAGS is a series of bits which affect compilation. + + If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we + use POSIX basic syntax. + + If REG_NEWLINE is set, then . and [^...] don't match newline. + Also, regexec will try a match beginning after every newline. + + If REG_ICASE is set, then we considers upper- and lowercase + versions of letters to be equivalent when matching. + + If REG_NOSUB is set, then when PREG is passed to regexec, that + routine will report only success or failure, and nothing about the + registers. + + It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for + the return codes and their meanings.) */ + +int +regcomp (preg, pattern, cflags) + regex_t *preg; + const char *pattern; + int cflags; +{ + reg_errcode_t ret; + unsigned syntax + = (cflags & REG_EXTENDED) ? + RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC; + + /* regex_compile will allocate the space for the compiled pattern. */ + preg->buffer = 0; + preg->allocated = 0; + preg->used = 0; + + /* Don't bother to use a fastmap when searching. This simplifies the + REG_NEWLINE case: if we used a fastmap, we'd have to put all the + characters after newlines into the fastmap. This way, we just try + every character. */ + preg->fastmap = 0; + + if (cflags & REG_ICASE) + { + unsigned i; + + preg->translate = (char *) malloc (CHAR_SET_SIZE); + if (preg->translate == NULL) + return (int) REG_ESPACE; + + /* Map uppercase characters to corresponding lowercase ones. */ + for (i = 0; i < CHAR_SET_SIZE; i++) + preg->translate[i] = ISUPPER (i) ? tolower (i) : i; + } + else + preg->translate = NULL; + + /* If REG_NEWLINE is set, newlines are treated differently. */ + if (cflags & REG_NEWLINE) + { /* REG_NEWLINE implies neither . nor [^...] match newline. */ + syntax &= ~RE_DOT_NEWLINE; + syntax |= RE_HAT_LISTS_NOT_NEWLINE; + /* It also changes the matching behavior. */ + preg->newline_anchor = 1; + } + else + preg->newline_anchor = 0; + + preg->no_sub = !!(cflags & REG_NOSUB); + + /* POSIX says a null character in the pattern terminates it, so we + can use strlen here in compiling the pattern. */ + ret = regex_compile (pattern, strlen (pattern), syntax, preg); + + /* POSIX doesn't distinguish between an unmatched open-group and an + unmatched close-group: both are REG_EPAREN. */ + if (ret == REG_ERPAREN) ret = REG_EPAREN; + + return (int) ret; +} + + +/* regexec searches for a given pattern, specified by PREG, in the + string STRING. + + If NMATCH is zero or REG_NOSUB was set in the cflags argument to + `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at + least NMATCH elements, and we set them to the offsets of the + corresponding matched substrings. + + EFLAGS specifies `execution flags' which affect matching: if + REG_NOTBOL is set, then ^ does not match at the beginning of the + string; if REG_NOTEOL is set, then $ does not match at the end. + + We return 0 if we find a match and REG_NOMATCH if not. */ + +int +regexec (preg, string, nmatch, pmatch, eflags) + const regex_t *preg; + const char *string; + size_t nmatch; + regmatch_t pmatch[]; + int eflags; +{ + int ret; + struct re_registers regs; + regex_t private_preg; + int len = strlen (string); + boolean want_reg_info = !preg->no_sub && nmatch > 0; + + private_preg = *preg; + + private_preg.not_bol = !!(eflags & REG_NOTBOL); + private_preg.not_eol = !!(eflags & REG_NOTEOL); + + /* The user has told us exactly how many registers to return + information about, via `nmatch'. We have to pass that on to the + matching routines. */ + private_preg.regs_allocated = REGS_FIXED; + + if (want_reg_info) + { + regs.num_regs = nmatch; + regs.start = TALLOC (nmatch, regoff_t); + regs.end = TALLOC (nmatch, regoff_t); + if (regs.start == NULL || regs.end == NULL) + return (int) REG_NOMATCH; + } + + /* Perform the searching operation. */ + ret = re_search (&private_preg, string, len, + /* start: */ 0, /* range: */ len, + want_reg_info ? ®s : (struct re_registers *) 0); + + /* Copy the register information to the POSIX structure. */ + if (want_reg_info) + { + if (ret >= 0) + { + unsigned r; + + for (r = 0; r < nmatch; r++) + { + pmatch[r].rm_so = regs.start[r]; + pmatch[r].rm_eo = regs.end[r]; + } + } + + /* If we needed the temporary register info, free the space now. */ + free (regs.start); + free (regs.end); + } + + /* We want zero return to mean success, unlike `re_search'. */ + return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH; +} + + +/* Returns a message corresponding to an error code, ERRCODE, returned + from either regcomp or regexec. We don't use PREG here. */ + +size_t +regerror (errcode, preg, errbuf, errbuf_size) + int errcode; + const regex_t *preg; + char *errbuf; + size_t errbuf_size; +{ + const char *msg; + size_t msg_size; + + if (errcode < 0 + || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0]))) + /* Only error codes returned by the rest of the code should be passed + to this routine. If we are given anything else, or if other regex + code generates an invalid error code, then the program has a bug. + Dump core so we can fix it. */ + abort (); + + msg = re_error_msg[errcode]; + + /* POSIX doesn't require that we do anything in this case, but why + not be nice. */ + if (! msg) + msg = "Success"; + + msg_size = strlen (msg) + 1; /* Includes the null. */ + + if (errbuf_size != 0) + { + if (msg_size > errbuf_size) + { + strncpy (errbuf, msg, errbuf_size - 1); + errbuf[errbuf_size - 1] = 0; + } + else + strcpy (errbuf, msg); + } + + return msg_size; +} + + +/* Free dynamically allocated space used by PREG. */ + +void +regfree (preg) + regex_t *preg; +{ + if (preg->buffer != NULL) + free (preg->buffer); + preg->buffer = NULL; + + preg->allocated = 0; + preg->used = 0; + + if (preg->fastmap != NULL) + free (preg->fastmap); + preg->fastmap = NULL; + preg->fastmap_accurate = 0; + + if (preg->translate != NULL) + free (preg->translate); + preg->translate = NULL; +} + +#endif /* not emacs */ + +/* +Local variables: +make-backup-files: t +version-control: t +trim-versions-without-asking: nil +End: +*/ diff --git a/lib/gnu_lib/regex.h b/lib/gnu_lib/regex.h new file mode 100644 index 0000000..a495005 --- /dev/null +++ b/lib/gnu_lib/regex.h @@ -0,0 +1,490 @@ +/* Definitions for data structures and routines for the regular + expression library, version 0.12. + + Copyright (C) 1985, 89, 90, 91, 92, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef __REGEXP_LIBRARY_H__ +#define __REGEXP_LIBRARY_H__ + +/* POSIX says that must be included (by the caller) before + . */ + +#ifdef VMS +/* VMS doesn't have `size_t' in , even though POSIX says it + should be there. */ +#include +#endif + + +/* The following bits are used to determine the regexp syntax we + recognize. The set/not-set meanings are chosen so that Emacs syntax + remains the value 0. The bits are given in alphabetical order, and + the definitions shifted by one from the previous bit; thus, when we + add or remove a bit, only one other definition need change. */ +typedef unsigned reg_syntax_t; + +/* If this bit is not set, then \ inside a bracket expression is literal. + If set, then such a \ quotes the following character. */ +#define RE_BACKSLASH_ESCAPE_IN_LISTS (1) + +/* If this bit is not set, then + and ? are operators, and \+ and \? are + literals. + If set, then \+ and \? are operators and + and ? are literals. */ +#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1) + +/* If this bit is set, then character classes are supported. They are: + [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:], + [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:]. + If not set, then character classes are not supported. */ +#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1) + +/* If this bit is set, then ^ and $ are always anchors (outside bracket + expressions, of course). + If this bit is not set, then it depends: + ^ is an anchor if it is at the beginning of a regular + expression or after an open-group or an alternation operator; + $ is an anchor if it is at the end of a regular expression, or + before a close-group or an alternation operator. + + This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because + POSIX draft 11.2 says that * etc. in leading positions is undefined. + We already implemented a previous draft which made those constructs + invalid, though, so we haven't changed the code back. */ +#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1) + +/* If this bit is set, then special characters are always special + regardless of where they are in the pattern. + If this bit is not set, then special characters are special only in + some contexts; otherwise they are ordinary. Specifically, + * + ? and intervals are only special when not after the beginning, + open-group, or alternation operator. */ +#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1) + +/* If this bit is set, then *, +, ?, and { cannot be first in an re or + immediately after an alternation or begin-group operator. */ +#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1) + +/* If this bit is set, then . matches newline. + If not set, then it doesn't. */ +#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1) + +/* If this bit is set, then . doesn't match NUL. + If not set, then it does. */ +#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1) + +/* If this bit is set, nonmatching lists [^...] do not match newline. + If not set, they do. */ +#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1) + +/* If this bit is set, either \{...\} or {...} defines an + interval, depending on RE_NO_BK_BRACES. + If not set, \{, \}, {, and } are literals. */ +#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1) + +/* If this bit is set, +, ? and | aren't recognized as operators. + If not set, they are. */ +#define RE_LIMITED_OPS (RE_INTERVALS << 1) + +/* If this bit is set, newline is an alternation operator. + If not set, newline is literal. */ +#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1) + +/* If this bit is set, then `{...}' defines an interval, and \{ and \} + are literals. + If not set, then `\{...\}' defines an interval. */ +#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1) + +/* If this bit is set, (...) defines a group, and \( and \) are literals. + If not set, \(...\) defines a group, and ( and ) are literals. */ +#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1) + +/* If this bit is set, then \ matches . + If not set, then \ is a back-reference. */ +#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1) + +/* If this bit is set, then | is an alternation operator, and \| is literal. + If not set, then \| is an alternation operator, and | is literal. */ +#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1) + +/* If this bit is set, then an ending range point collating higher + than the starting range point, as in [z-a], is invalid. + If not set, then when ending range point collates higher than the + starting range point, the range is ignored. */ +#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1) + +/* If this bit is set, then an unmatched ) is ordinary. + If not set, then an unmatched ) is invalid. */ +#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1) + +/* This global variable defines the particular regexp syntax to use (for + some interfaces). When a regexp is compiled, the syntax used is + stored in the pattern buffer, so changing this does not affect + already-compiled regexps. */ +extern reg_syntax_t re_syntax_options; + +/* Define combinations of the above bits for the standard possibilities. + (The [[[ comments delimit what gets put into the Texinfo file, so + don't delete them!) */ +/* [[[begin syntaxes]]] */ +#define RE_SYNTAX_EMACS 0 + +#define RE_SYNTAX_AWK \ + (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \ + | RE_UNMATCHED_RIGHT_PAREN_ORD) + +#define RE_SYNTAX_POSIX_AWK \ + (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS) + +#define RE_SYNTAX_GREP \ + (RE_BK_PLUS_QM | RE_CHAR_CLASSES \ + | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ + | RE_NEWLINE_ALT) + +#define RE_SYNTAX_EGREP \ + (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ + | RE_NEWLINE_ALT | RE_NO_BK_PARENS \ + | RE_NO_BK_VBAR) + +#define RE_SYNTAX_POSIX_EGREP \ + (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES) + +/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ +#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC + +#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC + +/* Syntax bits common to both basic and extended POSIX regex syntax. */ +#define _RE_SYNTAX_POSIX_COMMON \ + (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ + | RE_INTERVALS | RE_NO_EMPTY_RANGES) + +#define RE_SYNTAX_POSIX_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM) + +/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes + RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this + isn't minimal, since other operators, such as \`, aren't disabled. */ +#define RE_SYNTAX_POSIX_MINIMAL_BASIC \ + (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS) + +#define RE_SYNTAX_POSIX_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_VBAR \ + | RE_UNMATCHED_RIGHT_PAREN_ORD) + +/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS + replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */ +#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \ + (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \ + | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \ + | RE_NO_BK_PARENS | RE_NO_BK_REFS \ + | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD) +/* [[[end syntaxes]]] */ + +/* Maximum number of duplicates an interval can allow. Some systems + (erroneously) define this in other header files, but we want our + value, so remove any previous define. */ +#ifdef RE_DUP_MAX +#undef RE_DUP_MAX +#endif +#define RE_DUP_MAX ((1 << 15) - 1) + + +/* POSIX `cflags' bits (i.e., information for `regcomp'). */ + +/* If this bit is set, then use extended regular expression syntax. + If not set, then use basic regular expression syntax. */ +#define REG_EXTENDED 1 + +/* If this bit is set, then ignore case when matching. + If not set, then case is significant. */ +#define REG_ICASE (REG_EXTENDED << 1) + +/* If this bit is set, then anchors do not match at newline + characters in the string. + If not set, then anchors do match at newlines. */ +#define REG_NEWLINE (REG_ICASE << 1) + +/* If this bit is set, then report only success or fail in regexec. + If not set, then returns differ between not matching and errors. */ +#define REG_NOSUB (REG_NEWLINE << 1) + + +/* POSIX `eflags' bits (i.e., information for regexec). */ + +/* If this bit is set, then the beginning-of-line operator doesn't match + the beginning of the string (presumably because it's not the + beginning of a line). + If not set, then the beginning-of-line operator does match the + beginning of the string. */ +#define REG_NOTBOL 1 + +/* Like REG_NOTBOL, except for the end-of-line. */ +#define REG_NOTEOL (1 << 1) + + +/* If any error codes are removed, changed, or added, update the + `re_error_msg' table in regex.c. */ +typedef enum +{ + REG_NOERROR = 0, /* Success. */ + REG_NOMATCH, /* Didn't find a match (for regexec). */ + + /* POSIX regcomp return error codes. (In the order listed in the + standard.) */ + REG_BADPAT, /* Invalid pattern. */ + REG_ECOLLATE, /* Not implemented. */ + REG_ECTYPE, /* Invalid character class name. */ + REG_EESCAPE, /* Trailing backslash. */ + REG_ESUBREG, /* Invalid back reference. */ + REG_EBRACK, /* Unmatched left bracket. */ + REG_EPAREN, /* Parenthesis imbalance. */ + REG_EBRACE, /* Unmatched \{. */ + REG_BADBR, /* Invalid contents of \{\}. */ + REG_ERANGE, /* Invalid range end. */ + REG_ESPACE, /* Ran out of memory. */ + REG_BADRPT, /* No preceding re for repetition op. */ + + /* Error codes we've added. */ + REG_EEND, /* Premature end. */ + REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ + REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */ +} reg_errcode_t; + +/* This data structure represents a compiled pattern. Before calling + the pattern compiler, the fields `buffer', `allocated', `fastmap', + `translate', and `no_sub' can be set. After the pattern has been + compiled, the `re_nsub' field is available. All other fields are + private to the regex routines. */ + +struct re_pattern_buffer +{ +/* [[[begin pattern_buffer]]] */ + /* Space that holds the compiled pattern. It is declared as + `unsigned char *' because its elements are + sometimes used as array indexes. */ + unsigned char *buffer; + + /* Number of bytes to which `buffer' points. */ + unsigned long allocated; + + /* Number of bytes actually used in `buffer'. */ + unsigned long used; + + /* Syntax setting with which the pattern was compiled. */ + reg_syntax_t syntax; + + /* Pointer to a fastmap, if any, otherwise zero. re_search uses + the fastmap, if there is one, to skip over impossible + starting points for matches. */ + char *fastmap; + + /* Either a translate table to apply to all characters before + comparing them, or zero for no translation. The translation + is applied to a pattern when it is compiled and to a string + when it is matched. */ + char *translate; + + /* Number of subexpressions found by the compiler. */ + size_t re_nsub; + + /* Zero if this pattern cannot match the empty string, one else. + Well, in truth it's used only in `re_search_2', to see + whether or not we should use the fastmap, so we don't set + this absolutely perfectly; see `re_compile_fastmap' (the + `duplicate' case). */ + unsigned can_be_null : 1; + + /* If REGS_UNALLOCATED, allocate space in the `regs' structure + for `max (RE_NREGS, re_nsub + 1)' groups. + If REGS_REALLOCATE, reallocate space if necessary. + If REGS_FIXED, use what's there. */ +#define REGS_UNALLOCATED 0 +#define REGS_REALLOCATE 1 +#define REGS_FIXED 2 + unsigned regs_allocated : 2; + + /* Set to zero when `regex_compile' compiles a pattern; set to one + by `re_compile_fastmap' if it updates the fastmap. */ + unsigned fastmap_accurate : 1; + + /* If set, `re_match_2' does not return information about + subexpressions. */ + unsigned no_sub : 1; + + /* If set, a beginning-of-line anchor doesn't match at the + beginning of the string. */ + unsigned not_bol : 1; + + /* Similarly for an end-of-line anchor. */ + unsigned not_eol : 1; + + /* If true, an anchor at a newline matches. */ + unsigned newline_anchor : 1; + +/* [[[end pattern_buffer]]] */ +}; + +typedef struct re_pattern_buffer regex_t; + + +/* search.c (search_buffer) in Emacs needs this one opcode value. It is + defined both in `regex.c' and here. */ +#define RE_EXACTN_VALUE 1 + +/* Type for byte offsets within the string. POSIX mandates this. */ +typedef int regoff_t; + + +/* This is the structure we store register match data in. See + regex.texinfo for a full description of what registers match. */ +struct re_registers +{ + unsigned num_regs; + regoff_t *start; + regoff_t *end; +}; + + +/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer, + `re_match_2' returns information about at least this many registers + the first time a `regs' structure is passed. */ +#ifndef RE_NREGS +#define RE_NREGS 30 +#endif + + +/* POSIX specification for registers. Aside from the different names than + `re_registers', POSIX uses an array of structures, instead of a + structure of arrays. */ +typedef struct +{ + regoff_t rm_so; /* Byte offset from string's start to substring's start. */ + regoff_t rm_eo; /* Byte offset from string's start to substring's end. */ +} regmatch_t; + +/* Declarations for routines. */ + +/* To avoid duplicating every routine declaration -- once with a + prototype (if we are ANSI), and once without (if we aren't) -- we + use the following macro to declare argument types. This + unfortunately clutters up the declarations a bit, but I think it's + worth it. */ + +#if __STDC__ + +#define _RE_ARGS(args) args + +#else /* not __STDC__ */ + +#define _RE_ARGS(args) () + +#endif /* not __STDC__ */ + +/* Sets the current default syntax to SYNTAX, and return the old syntax. + You can also simply assign to the `re_syntax_options' variable. */ +extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax)); + +/* Compile the regular expression PATTERN, with length LENGTH + and syntax given by the global `re_syntax_options', into the buffer + BUFFER. Return NULL if successful, and an error string if not. */ +extern const char *re_compile_pattern + _RE_ARGS ((const char *pattern, int length, + struct re_pattern_buffer *buffer)); + + +/* Compile a fastmap for the compiled pattern in BUFFER; used to + accelerate searches. Return 0 if successful and -2 if was an + internal error. */ +extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); + + +/* Search in the string STRING (with length LENGTH) for the pattern + compiled into BUFFER. Start searching at position START, for RANGE + characters. Return the starting position of the match, -1 for no + match, or -2 for an internal error. Also return register + information in REGS (if REGS and BUFFER->no_sub are nonzero). */ +extern int re_search + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, int range, struct re_registers *regs)); + + +/* Like `re_search', but search in the concatenation of STRING1 and + STRING2. Also, stop searching at index START + STOP. */ +extern int re_search_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, int range, struct re_registers *regs, int stop)); + + +/* Like `re_search', but return how many characters in STRING the regexp + in BUFFER matched, starting at position START. */ +extern int re_match + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string, + int length, int start, struct re_registers *regs)); + + +/* Relates to `re_match' as `re_search_2' relates to `re_search'. */ +extern int re_match_2 + _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1, + int length1, const char *string2, int length2, + int start, struct re_registers *regs, int stop)); + + +/* Set REGS to hold NUM_REGS registers, storing them in STARTS and + ENDS. Subsequent matches using BUFFER and REGS will use this memory + for recording register information. STARTS and ENDS must be + allocated with malloc, and must each be at least `NUM_REGS * sizeof + (regoff_t)' bytes long. + + If NUM_REGS == 0, then subsequent matches should allocate their own + register data. + + Unless this function is called, the first search or match using + PATTERN_BUFFER will allocate its own register data, without + freeing the old data. */ +extern void re_set_registers + _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs, + unsigned num_regs, regoff_t *starts, regoff_t *ends)); + +/* 4.2 bsd compatibility. */ +extern char *re_comp _RE_ARGS ((const char *)); +extern int re_exec _RE_ARGS ((const char *)); + +/* POSIX compatibility. */ +extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags)); +extern int regexec + _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch, + regmatch_t pmatch[], int eflags)); +extern size_t regerror + _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf, + size_t errbuf_size)); +extern void regfree _RE_ARGS ((regex_t *preg)); + +#endif /* not __REGEXP_LIBRARY_H__ */ + +/* +Local variables: +make-backup-files: t +version-control: t +trim-versions-without-asking: nil +End: +*/ diff --git a/lib/lookup.c b/lib/lookup.c new file mode 100644 index 0000000..e2f00dc --- /dev/null +++ b/lib/lookup.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include "eppl_ut.h" +FILE *lookup_file(const char *name,const char *suffix,const char *dir) +/* éÝÅÔ ÆÁÊÌ ÓÎÁÞÁÌÁ × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, ÐÏÔÏÍ × ÄÉÒÅËÔÏÒÉÉ + dir × ÔÅËÕÝÅÊ ÄÉÒÅËÔÏÒÉÉ, ÐÏÔÏÍ × /usr/local/lib/fgis/$dir */ +{ char namebuf[1024],pathbuf[1024]; + + struct stat buf; + strcpy(namebuf,name); + if (strlen(name) +#include +#include "epp.h" +int compare_cell_size(EPP *f1,EPP *f2) +{ double xsize1=fabs(f1->XRight-f1->XLeft)/(f1->lc-f1->fc); + double xsize2=fabs(f2->XRight-f2->XLeft)/(f2->lc-f2->fc); + double ysize1=fabs(f1->YTop-f1->YBottom)/(f1->lr-f1->fr); + double ysize2=fabs(f2->YTop-f2->YBottom)/(f2->lr-f2->fr); +/* fprintf(stderr,"Xsize ratio %g X tolerance %g\nYsize ratio %g Y tolerance %g\n", + xsize1/xsize2,1.0/(f1->lc-f1->fc),ysize1/ysize2,1.0/(f1->lr-f1->fr)); +*/ return (fabs(xsize1/xsize2-1.0)<1.0/(f1->lc-f1->fc)&& + fabs(ysize1/ysize2-1.0)<1.0/(f1->lr-f1->fr)); +} +int is_aligned(EPP *f1,EPP *f2) +{ if (!compare_cell_size(f1,f2)) return 0; + return (epp_row(f1,alt_yc(f2,f2->fr))==f2->fr&& + epp_col(f1,alt_xc(f2,f2->fc))==f2->fc); +} +EPP_LINK link_epp(EPP *base,EPP *overlay) +{double x1,y1,x2,y2; + EPP_LINK tmp=malloc(sizeof(LINK_BUFFER)); + if (base->XLeftXRight) + {x1=base->XLeftXLeft?base->XLeft:overlay->XLeft; + x2=base->XRight>overlay->XRight?base->XRight:overlay->XRight; + } + else + {x1=base->XLeft>overlay->XLeft?base->XLeft:overlay->XLeft; + x2=base->XRightXRight?base->XRight:overlay->XRight; + } + if (base->YBottomYTop) + {y1=base->YBottomYBottom?base->YBottom:overlay->YBottom; + y2=base->YTop>overlay->YTop?base->YTop:overlay->YTop; + } + else + {y1=base->YBottom>overlay->YBottom?base->YBottom:overlay->YBottom; + y2=base->YTopYTop?base->YTop:overlay->YTop; + } + tmp->ax=epp_col(overlay,x2)-epp_col(overlay,x1); + tmp->cx=epp_col(base,x2)-epp_col(base,x1); + tmp->bx=epp_col(overlay,x1)*tmp->cx-epp_col(base,x1)*tmp->ax; + tmp->ay=epp_row(overlay,y2)-epp_row(overlay,y1); + tmp->cy=epp_row(base,y2)-epp_row(base,y1); + tmp->by=epp_row(overlay,y1)*tmp->cy-epp_row(base,y1)*tmp->ay; + return tmp; +} +int linked_row(EPP_LINK link,int row) +{ return (link->ay*row+link->by)/link->cy; +} +int linked_col(EPP_LINK link,int col) +{ return (link->ax*col+link->bx)/link->cx; +} + + diff --git a/lib/reclass.tab.c b/lib/reclass.tab.c new file mode 100644 index 0000000..13c731f --- /dev/null +++ b/lib/reclass.tab.c @@ -0,0 +1,967 @@ + +/* A Bison parser, made from reclass.y + by GNU Bison version 1.25 + */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define NUMBER 258 + +#line 1 "reclass.y" + +#include +#include +#include "reclass.h" +#include "epp.h" +#define YYSTYPE int +int yylex(); +int yyerror(); + RECLASS table; + int curval,startval,endval,loop_var; + int maxclass; + int interactive_parser=0; +#ifndef YYSTYPE +#define YYSTYPE int +#endif +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 33 +#define YYFLAG -32768 +#define YYNTBASE 10 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 258 ? yytranslate[x] : 18) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, + 2, 2, 9, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, + 7, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, + 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 3 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 6, 7, 10, 12, 14, 17, 24, 26, + 29, 31, 34, 36, 40, 42 +}; + +static const short yyrhs[] = { 11, + 0, 10, 13, 11, 0, 0, 12, 14, 0, 17, + 0, 1, 0, 16, 4, 0, 5, 16, 6, 16, + 7, 4, 0, 8, 0, 9, 8, 0, 15, 0, + 14, 15, 0, 16, 0, 16, 6, 16, 0, 3, + 0, 16, 6, 16, 4, 16, 6, 16, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 17, 19, 22, 23, 24, 25, 31, 32, 34, 35, + 36, 37, 38, 46, 54, 59 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","NUMBER", +"'='","'('","':'","')'","'\\n'","'\\r'","list","statement","dest","eol","range", +"subrange","value","map_statement", NULL +}; +#endif + +static const short yyr1[] = { 0, + 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, + 14, 14, 15, 15, 16, 17 +}; + +static const short yyr2[] = { 0, + 1, 3, 0, 2, 1, 1, 2, 6, 1, 2, + 1, 2, 1, 3, 1, 7 +}; + +static const short yydefact[] = { 0, + 6, 15, 0, 0, 1, 0, 0, 5, 0, 9, + 0, 0, 4, 11, 13, 7, 0, 0, 10, 2, + 12, 0, 0, 0, 14, 0, 0, 0, 8, 0, + 16, 0, 0 +}; + +static const short yydefgoto[] = { 4, + 5, 6, 12, 13, 14, 7, 8 +}; + +static const short yypact[] = { 4, +-32768,-32768, -2, 8,-32768, -2, 14,-32768, -4,-32768, + 3, 4, -2,-32768, 0,-32768, -2, -2,-32768,-32768, +-32768, -2, 17, 15,-32768, -2, 20, 19,-32768, -2, +-32768, 26,-32768 +}; + +static const short yypgoto[] = {-32768, + 16,-32768,-32768,-32768, 18, -3,-32768 +}; + + +#define YYLAST 31 + + +static const short yytable[] = { 9, + 2, 18, 15, -3, 1, 22, 2, 32, 3, 15, + 19, -3, -3, 23, 24, 10, 11, 16, 25, 17, + 26, 27, 28, 29, 30, 33, 31, 20, 0, 0, + 21 +}; + +static const short yycheck[] = { 3, + 3, 6, 6, 0, 1, 6, 3, 0, 5, 13, + 8, 8, 9, 17, 18, 8, 9, 4, 22, 6, + 4, 7, 26, 4, 6, 0, 30, 12, -1, -1, + 13 +}; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/lib/bison.simple" + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +#ifndef alloca +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) +#include +#else /* not sparc */ +#if defined (MSDOS) && !defined (__TURBOC__) +#include +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +#include + #pragma alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ +#endif /* __hpux */ +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT return(0) +#define YYABORT return(1) +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, int count) +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +#line 196 "/usr/lib/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +int +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + int yystacksize = YYINITDEPTH; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + int size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 6: +#line 25 "reclass.y" +{ if (interactive_parser) + yyerrok; + else + YYABORT; + ; + break;} +case 7: +#line 31 "reclass.y" +{ curval=yyvsp[-1]; ; + break;} +case 8: +#line 32 "reclass.y" +{ curval=-1; startval=yyvsp[-4] ; endval = yyvsp[-2]; + loop_var=startval;; + break;} +case 13: +#line 38 "reclass.y" +{ + if (curval>=0) table[yyvsp[0]]=curval; + else {table[yyvsp[0]]=loop_var++; + if (loop_var>endval) + loop_var=startval; + } + ; + break;} +case 14: +#line 46 "reclass.y" +{ int i; for(i=yyvsp[-2];i<=yyvsp[0];i++) + if (curval>=0) table[i]=curval; + else {table[i]=loop_var++; + if (loop_var>endval) + loop_var=startval; + } + ; + break;} +case 15: +#line 54 "reclass.y" +{if (yyvsp[0]>65535) + { yyerror("Class value out of range\n"); + return 1;YYERROR; + } + ; + break;} +case 16: +#line 59 "reclass.y" +{ + int i,start,stop,startv,stopv; + if (yyvsp[-2]>yyvsp[0]) {start=yyvsp[0];startv=yyvsp[-4];stop=yyvsp[-2];stopv=yyvsp[-6];} + else {start=yyvsp[-2];startv=yyvsp[-6];stop=yyvsp[0];stopv=yyvsp[-4];} + for (i=start;i<=stop;i++) + table[i]=(i-start)*(stopv-startv)/(start-stop)+startv; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 498 "/usr/lib/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; +} +#line 68 "reclass.y" + +int (*my_getc)(); +int yylex() +{ int c,numb=0,isnumb=0; + static char unget_buf=0; + while ((c=unget_buf?unget_buf:(*my_getc)())!=EOF) + { unget_buf=0; + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': {isnumb=1; numb=numb*10+c-'0'; break;} + case ' ': + case '\t': {if (isnumb) { yylval=numb; return NUMBER; } break;} + default: if (isnumb) { yylval=numb; unget_buf=c; return NUMBER;} + else return c; + } + } + return 0; +} + +int yyerror(char *s) +{ fprintf(stderr,"%s\n",s); + return 0; +} +RECLASS make_reclass_table(EPP *infile,int (*recl_getc)()) +{ int size=epp_table_size(infile); + + return parse_statements(size,create_reclass_table(size),recl_getc); +} +RECLASS parse_statements(int size,RECLASS src,int (*recl_getc)()) +{ my_getc=recl_getc; + table=src; + if (size>65535)size=65535; + maxclass=size; + if (yyparse()) { free(table);return NULL;} + else return table; +} +RECLASS create_reclass_table(size) +{ RECLASS table; + int i; + if (size<=0) return NULL; + else if (size>65535) size=65535; + table=malloc((size+1)*sizeof(short int)); + for(i=0;i<=size;i++) table[i]=i; + return table; +} +RECLASS wrapped_reclass(EPP *infile,int white) +{ int i,maxclass; + RECLASS table; + maxclass=epp_table_size(infile); + table=malloc(maxclass*sizeof(short int)); + table[0]=0; + for(i=1;i<=maxclass;i++) table[i]=(i-1)%(white-1)+1; + table[infile->offsite]=white; + return table; +} diff --git a/lib/reclass.y b/lib/reclass.y new file mode 100644 index 0000000..8bf9b94 --- /dev/null +++ b/lib/reclass.y @@ -0,0 +1,131 @@ +%{ +#include +#include +#include "reclass.h" +#include "epp.h" +#define YYSTYPE int +int yylex(); +int yyerror(); + RECLASS table; + int curval,startval,endval,loop_var; + int maxclass; + int interactive_parser=0; +%} +%expect 2 +%token NUMBER +%% +list: + statement + | list eol statement + ; + +statement: /* empty */ + | dest range + | map_statement + | error { if (interactive_parser) + yyerrok; + else + YYABORT; + } + +dest: value '=' { curval=$1; } + | '(' value ':' value ')' '=' { curval=-1; startval=$2 ; endval = $4; + loop_var=startval;} +eol: '\n' + | '\r' '\n' +range:subrange + |range subrange +subrange:value { + if (curval>=0) table[$1]=curval; + else {table[$1]=loop_var++; + if (loop_var>endval) + loop_var=startval; + } + } + + | value ':' value { int i; for(i=$1;i<=$3;i++) + if (curval>=0) table[i]=curval; + else {table[i]=loop_var++; + if (loop_var>endval) + loop_var=startval; + } + } + ; +value: NUMBER {if ($1>65535) + { yyerror("Class value out of range\n"); + return 1;YYERROR; + } + } +map_statement: value ':' value '=' value ':' value { + int i,start,stop,startv,stopv; + if ($5>$7) {start=$7;startv=$3;stop=$5;stopv=$1;} + else {start=$5;startv=$1;stop=$7;stopv=$3;} + for (i=start;i<=stop;i++) + table[i]=(i-start)*(stopv-startv)/(start-stop)+startv; + } +; + +%% +int (*my_getc)(); +int yylex() +{ int c,numb=0,isnumb=0; + static char unget_buf=0; + while ((c=unget_buf?unget_buf:(*my_getc)())!=EOF) + { unget_buf=0; + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': {isnumb=1; numb=numb*10+c-'0'; break;} + case ' ': + case '\t': {if (isnumb) { yylval=numb; return NUMBER; } break;} + default: if (isnumb) { yylval=numb; unget_buf=c; return NUMBER;} + else return c; + } + } + return 0; +} + +int yyerror(char *s) +{ fprintf(stderr,"%s\n",s); + return 0; +} +RECLASS make_reclass_table(EPP *infile,int (*recl_getc)()) +{ int size=epp_table_size(infile); + + return parse_statements(size,create_reclass_table(size),recl_getc); +} +RECLASS parse_statements(int size,RECLASS src,int (*recl_getc)()) +{ my_getc=recl_getc; + table=src; + if (size>65535)size=65535; + maxclass=size; + if (yyparse()) { free(table);return NULL;} + else return table; +} +RECLASS create_reclass_table(size) +{ RECLASS table; + int i; + if (size<=0) return NULL; + else if (size>65535) size=65535; + table=malloc((size+1)*sizeof(short int)); + for(i=0;i<=size;i++) table[i]=i; + return table; +} +RECLASS wrapped_reclass(EPP *infile,int white) +{ int i,maxclass; + RECLASS table; + maxclass=epp_table_size(infile); + table=malloc(maxclass*sizeof(short int)); + table[0]=0; + for(i=1;i<=maxclass;i++) table[i]=(i-1)%(white-1)+1; + table[infile->offsite]=white; + return table; +} diff --git a/lib/test/Makefile b/lib/test/Makefile new file mode 100644 index 0000000..ba6b6e6 --- /dev/null +++ b/lib/test/Makefile @@ -0,0 +1,26 @@ +# +# Makefile for test directory +# compilies test programs and performs tests on major functions +# of libepp +# + +# +# which library to link to extended mallock debugging +# +MEM_DEBUG=-lefence +# +# define MEM_DEBUG_LOCATION if your memory debugging library +# lives somewhere in non-standard place +#MEM_DEBUG_LOCATION=/usr/local/lib +# +# We use real compilier flags +# +CFLAGS=-g -O2 -I ../../include +LDFLAGS=-static -L.. ${MEM_DEBUG_LOCATION} +LOADLIBES=-lepp -lm ${MEM_DEBUG} + +test: test_epplib testdata.dat test256.epp run_test.sh + run_test.sh +test_epplib: test_epplib.o ../libepp.a + +test_epplib.o: test_epplib.c diff --git a/lib/test/recltest.c b/lib/test/recltest.c new file mode 100644 index 0000000..5484eae --- /dev/null +++ b/lib/test/recltest.c @@ -0,0 +1,17 @@ +#include +#include +int mygetc() +{ + return getc(stdin); +} +int main(int argc,char **argv) +{ RECLASS src,dest; + int i; + src=create_reclass_table(65536); + dest=parse_statements(65536,src,mygetc); + if (dest) + for (i=0;i<65536;i++) + if (dest[i]!=i) printf("%d reclassed to %d\n",i,dest[i]); + +} + diff --git a/lib/test/test8.epp b/lib/test/test8.epp new file mode 100644 index 0000000..fe8f37d Binary files /dev/null and b/lib/test/test8.epp differ diff --git a/lib/test/test_epplib.c b/lib/test/test_epplib.c new file mode 100644 index 0000000..92e33db --- /dev/null +++ b/lib/test/test_epplib.c @@ -0,0 +1,286 @@ +/* + * Test program for epp library. It reads file, given as argument + * (while not stdin? to simplify running under debugger) + * and performs specified operations + * After each operation some fields of epp structure are printed + * Availiable operations + * read file - open epp file for reading + * create file width height offsite bits - create file (write-only mode) + * load file - opens file for random read-write access + * save - saves loaded file + * reset - resets write-only file to read-only mode + * get col row - return value + * put col row value - change value of pixel + * line col1 col2 row value - change value of several adjanced pixels + * # text - comment + * NOTE: space after hash mark is mandantory + */ +#include +#include +#include +char filename[1024]; /* name of currently used epp-file */ +FILE *f; /*file with test command. */ +char *error_code[]={"OK","ME_POINT_OUTSIDE","ME_INVALID_MODE", + "ME_READ_ERROR","ME_WRITE_ERROR","ME_INVALID_PUT","ME_OUT_OF_MEMORY", + "ME_ACCESS_DENIED","ME_NO_FILE","ME_INVALID_FILE","ME_CREATE_ERROR",NULL}; +/* prints value of global map_error varable. If it is + related with file-system error, also + prints system error description */ +void print_result() +{ + if (map_error>ME_OUT_OF_MEMORY) { + perror(error_code[map_error]); + } else { + printf("%s\n",error_code[map_error]); + } + map_error=0; +} +/* + * Prints verbosely mode field of EPP structure. + * Note: if it prints something hexadecimal, it should be considered + * error in library! + */ +char *epp_flags[]={"MAP_INPUT","MAP_OUTPUT","MAP_LOADED","MAP_CACHED", + NULL,NULL,NULL,"MAP_MODIFIED", + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, +}; +/* + * Prints verbosely mode field of EPP structure. + * Note: if it prints something hexadecimal, it should be considered + * error in library! + */ +void print_flags(EPP *epp) +{ int i, mask; + char separator=':'; + printf("EPP mode"); + for(i=0,mask=1;i<32;i++,mask<<=1) { + if (epp->mode&mask) { + if (!epp_flags[i]) { + printf("%c 0x%X",separator,mask); + } else { + printf("%c %s",separator,epp_flags[i]); + } + separator=','; + } + } + printf("\n"); +} +/*************************************************************************/ +/* individual test procedures begin here */ +/************************************************************************/ + +/* + * testing epp_put + */ +void test_put(EPP *epp) +{ int row,col,value; + if (!epp) { + fprintf(stderr,"Invalid test case - put before open"); + exit(2); + } + if (fscanf(f,"%d %d %d",&col,&row,&value)!=3) { + fprintf(stderr,"Invalid line in input file\n"); + exit(2); + } + printf("epp_put(%d,%d,%d):",col,row,value); + epp_put(epp, col, row, value); + printf("max=%d,min=%d ",epp->max, epp->min); +} +/* + * testing epp_putline + */ +void test_putline(EPP *epp) +{ int row,col,col2,value; + if (!epp) { + fprintf(stderr,"Invalid test case - putline before open"); + exit(2); + } + if (fscanf(f,"%d %d %d %d",&col,&col2,&row,&value)!=4) { + fprintf(stderr,"Invalid line in input file\n"); + exit(2); + } + printf("epp_putline(%d,%d,%d,%d):",col,col2,row,value); + epp_putline(epp,col,col2,row,value); + printf("max=%d,min=%d ",epp->max, epp->min); +} +/* + * testing epp_get + */ +void test_get(EPP *epp) +{ int row,col; + if (!epp) { + fprintf(stderr,"Invalid test case - get before open"); + exit(2); + } + if (fscanf(f,"%d %d",&row,&col)!=2) { + fprintf(stderr,"Invalid line in input file\n"); + exit(2); + } + printf("epp_get(%d,%d)=%d ",col,row,epp_get(epp,col,row)); +} +/* + * Testing save_epp + * + */ +void test_save(EPP* epp) +{ + if (!epp) { + fprintf(stderr,"Invalid test case - save before load"); + exit(2); + } + printf("Saving %s...",filename); + save_epp(epp); + print_result(); + print_flags(epp); +} +/* + * testing open_epp + * + */ + +EPP *test_read(EPP *epp) +{ + if (epp) close_epp(epp); + if (fscanf(f,"%s",filename)!=1) { + fprintf(stderr,"Missing filename for read command\n"); + exit(2); + } + printf("Opening %s in read-only mode..",filename); + epp=open_epp(filename); + print_result(); + if (!epp) { + printf("File wasn't opened.\n"); + return NULL; + } + printf("%s header information:\n bits per cell:%d\n size:%dx%d\n " + "offsite %d\n values from: %d to %d\n ",filename,epp->kind, + epp->lc-epp->fc,epp->lr-epp->fr,epp->offsite,epp->min,epp->max); + print_flags(epp); + return epp; +} +/* + * + * testing load_epp + * + */ +EPP *test_load(EPP *epp) +{ + if (epp) close_epp(epp); + if (fscanf(f,"%s",filename)!=1) { + fprintf(stderr,"Missing filename for load command\n"); + exit(2); + } + printf("Loading %s...",filename); + epp=load_epp(filename); + print_result(); + if (!epp) { + printf("File wasn't loaded.\n"); + return NULL; + } + printf("%s header information:\n bits per cell:%d\n size:%dx%d\n " + "offsite %d\n values from: %d to %d\n ",filename,epp->kind, + epp->lc-epp->fc,epp->lr-epp->fr,epp->offsite,epp->min,epp->max); + print_flags(epp); + return epp; +} +/* + * + * Test reset. Performs reset operation + * + */ +void test_reset(EPP *epp) +{ + if (!epp) { + fprintf(stderr,"Invalid test case - reset before read"); + exit(2); + } + printf("Resetting file.\n Current line was %d\n Flags was:", + epp->currentline); + print_flags(epp); + + reset_epp(epp); + print_result(); + printf("Current line now is:%d\n",epp->currentline); + printf("%s header information:\n bits per cell:%d\n size:%dx%d\n " + "offsite %d\n values from: %d to %d\n ",filename,epp->kind, + epp->lc-epp->fc,epp->lr-epp->fr,epp->offsite,epp->min,epp->max); + print_flags(epp); +} +/* + * testing creat_epp; + * + */ +EPP *test_create(EPP *epp) +{ int width,height,bits,offsite; + if (epp) close_epp(epp); + if (fscanf(f,"%s %d %d %d %d",filename,&width,&height,&offsite,&bits)!=5) { + fprintf(stderr,"Wrong arguments for create command\n"); + exit(2); + } + Create16bit= (bits!=8); + printf("Creating %d-bit file %s...",Create16bit?16:8,filename); + epp=creat_epp(filename,1,1,width,height,0.5,0.5,width+0.5,height+0.5, + 100,0,offsite); + print_result(); + if (!epp) { + fprintf(stderr,"File is not created\n"); + return NULL; + } + printf("%s header information:\n bits per cell:%d\n size:%dx%d\n " + "offsite %d\n values from: %d to %d\n ",filename,epp->kind, + epp->lc-epp->fc,epp->lr-epp->fr,epp->offsite,epp->min,epp->max); + print_flags(epp); + return epp; +} +int main (int argc, char *argv[]) +{ EPP *epp=NULL; + char command[256]; + if (argc!=2) { + fprintf(stderr,"Usage: test_load test-file"); + exit(2); + } + f=fopen(argv[1],"r"); + if (!f) { + perror(argv[0]); + exit(2); + } + while (!feof(f)) { + /* skip empty lines */ + if (fscanf(f,"%s",command)!=1) { + continue; + } + if (!strcmp(command,"put")) { + test_put(epp); + } else if (!strcmp(command,"get")) { + test_get(epp); + } else if (!strcmp(command,"reset")) { + test_reset(epp); + } else if (!strcmp(command,"save")) { + test_save(epp); + } else if (!strcmp(command,"load")) { + epp=test_load(epp); + } else if (!strcmp(command,"read")) { + epp=test_read(epp); + } else if (!strcmp(command,"create")) { + epp=test_create(epp); + } else if (!strcmp(command,"line")) { + test_putline(epp); + } else if (!strcmp(command,"#")) { + char *newline; + fgets(command,255,f); + newline=strchr(command,'\n'); + if (newline) *newline=0; + printf("*** %s ***\n",command); + continue; + } else { + fprintf(stderr,"Unknown command:%s",command); + continue; + } + print_result(); + } + fclose(f); + if (epp) close_epp(epp); + return 0; +} diff --git a/lib/test/testdata.dat b/lib/test/testdata.dat new file mode 100644 index 0000000..205ff89 --- /dev/null +++ b/lib/test/testdata.dat @@ -0,0 +1,57 @@ +# create test file +create test8.epp 100 100 255 8 +put 1 1 20 +put 100 1 29 +# get shouldn't work here +get 1 10 +put 1 40 20 +# testing if we are allowed to change values above current line +put 10 10 20 +line 10 90 80 30 +# This line should produce error +line 10 90 70 22 +# this too +line 10 90 120 22 +# this line should be drawn partially +line 90 120 85 22 +# this line too +line -20 20 86 23 +# and this wouldn't be drawn at all +line 120 180 87 23 +put 1 100 30 +put 100 100 25 +# resetting file in read mode +reset +put 1 1 10 +get 1 1 +get 100 1 +get 1 100 +get 100 100 +get 1 40 +get 1 30 +load test8.epp +# testing if file is loaded correc +# testing decrease of max when value filled with offsite +put 20 20 40 +get 5 10 +put 20 20 255 +line 10 90 80 255 +# testing if we are allowed to change values above current line +put 10 10 20 +# testing minimum support +put 40 40 1 +put 40 40 20 +put 50 50 3 +put 50 50 255 +# testing decrease of max when value filled with another value +put 10 20 50 +put 10 20 20 +# testing what happens if we are trying to work with point outside file +put 101 8 8 +get 101 8 +# do something else +put 8 8 5 +get 1 1 +get 1 100 +get 100 1 +get 100 100 diff --git a/maketar b/maketar new file mode 100755 index 0000000..2fe5885 --- /dev/null +++ b/maketar @@ -0,0 +1,16 @@ +#!/bin/sh +# @(#) maketar - packs all files, neccessary to bring source distribution +# @(#) of fGIS to another machine +# This stuff should go to toplevel Makefile eventually, when I create one + + +# year omitted, becouse file name should fit in msdos file system +tarname=`date +fgis%m%d.tgz` + +# search directories, where something like core files or object files could +# occur +files=`find lib include dll man -type f \! -name core \! -name '*.o' \! -perm +0111 \! -name '*,v' \! -name '*.a'` +tclfiles=`find tcl -type f \! -name core \! -path "*/RCS/*"` +docfiles=`find doc -type f \! -name "*.bak" \! -path "*/RCS/*" \! -name "*.bak"\ + \! -name "*.dvi" \! -name "*.aux" \! -name "*.i??" \! -name "*.log"` +tar czvf $tarname $files fgis.rc $tclfiles $docfiles colors symbols testdata pkgIndex.tcl maketar TODO Makefile diff --git a/man/border.1 b/man/border.1 new file mode 100644 index 0000000..cea9478 --- /dev/null +++ b/man/border.1 @@ -0,0 +1,60 @@ +.TH BORDER 1 "Version 1.0" "EPU" "EPU user manual" +.SH NAME +border \- plots contour boundaries of raster file into vector file +.SH SYNOPSIS +.B border +[-v] [-m] [-l] [-t +.I value +] [-o +.I output_file +] +.SH DESCRIPTION +Creates a +.B dgt +file with lines which delimit different classes in input +.B epp file. +If +.B -l +option given, puts a label point into each closed polygon. +.PP +Default output filename is constructed from name of input file, by +replacing suffix +.I .epp +by +.I .dgt +\. +.PP +Lines can be created "staircase"-like or smooth. Smoothing is controlled +by +.B tolerance +factor, which defines maximum size of line segment, which can be changed. + +.SH OPTIONS +.TP 8 +.B --help +Display brief usage information and exit successifully. +.TP 8 +.B --version +Display version number and exit successifully. +.TP 8 +.B -%, --verbose +Display progress indication. Useful on large files, but significantly +decreases performans on small ones. +.TP 8 +.B -m, --margins +Controls behavouir on file edges. By default +.B border +treats all areas outside file as +.I offsite, +but when this option given, it assumes that all classes at the file edge +are continued outside it. +.TP 8 +.B -t --tolerance +Defines tolerance value. Default is zero -- no smoothing. +.TP 8 +.B -o --output-file +Allows to specify output file name explicitly. + +.SH BUGS +Label creation is unwritten yet + diff --git a/man/clip.1 b/man/clip.1 new file mode 100644 index 0000000..5b9890d --- /dev/null +++ b/man/clip.1 @@ -0,0 +1,43 @@ +.TH CLIP 1 "Version 1.0" "EPU" "EPU user manual" +.SH NAME +clip \- clips a region from old file using mask file +.SH SYNOPSIS +.B clip +[-%] [-m number] [-o filename] [--help][--version] file mask +.SH DESCRIPTION +Clip creates new file, containing part of old file, which corresponds +to given onsite area or specified class of mask file. +.PP +Cell size of new file would be equial to cell size of mask file. +If cell sizes don't match, ``nearest neighbour'' algorithm would be used +for rescaling. + +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B -% +Displays percentage of processed lines in file. +.TP 8 +.BI -o " file " --output-file= file +gives the name for output file. Defaults to +.I mosaic.out.epp +.TP 8 +.BI -m " number" --mask-value= number +Clip region which has class +.I number +in the mask file. Otherwise all onsite area of mask file would be clipped. +.SH SEE ALSO +.BR window(1), mosaic(1), eheader (1) + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +Should deal with different cell sizes. diff --git a/man/cluster.1 b/man/cluster.1 new file mode 100644 index 0000000..aed3b48 --- /dev/null +++ b/man/cluster.1 @@ -0,0 +1,71 @@ +.TH CLUSTER 1 "Version 1.0" "Lessa GIS" "Lessa user manual" +.SH NAME +cluster \- fills each contour on raster map with its own color +.SH SYNOPSIS +.B cluster +[-v] [-f] +.I input_file +[-o +.I output_file +] [-c +.I line_color +] [-T +.I temp_dir] +.SH DESCRIPTION +Paints each area in +.B epp +file, surrounded by color +.I line_color +by unique color from 1 to maximal contour number. Can handle up to 65535 contours in file. +.PP +Requires at least three time more space in temporary directore then input file occupies. +.PP +By default assumes that line color is 0 and output file name +.I cluster.out.epp +.PP +Performs two passes on input file and between them prints to stdout information about +number of contours in output file and temporary numbers assigned when calculating +contours. So, redirect standard output, if start cluster in background mode. +.SH OPTIONS +.TP 8 +.B \-v +Verbose mode. Information about current line in processing is printed to stderr. +.TP 8 +.BI \-c " line_color" +\- Set contour separation color to +.I " line_color". +.TP 8 +.BI \-o " output_file" +\- overrides default name of output file. +.TP 8 +.BI \-f " input_file" +\- Equivalent of simple command-line parameter without option prefix. +.TP 8 +.I "-?" " -h" +\- Print brief help message and exit successifully. +.TP 8 +.BI \-T " directory" +\- Uses +.I directory +instead of +.I /tmp +for storing temporary files + +.SH "SEE ALSO" +.BR lessa (1), +.BR mappaint (1), +.BR mapcopy (1), +.BR eheader (1), +.BR epp (5), +.BR dgt (5) + +.SH BUGS +For some unknown reason reports very strange errors (usially page faults) or +produces very strange results, when compilied under DOS. So use unix versions. +.PP +It seems obvouis, that same program must perform +.B rasterize +operation, but this still not implemented. +.SH AUTHOR +Vitus Wagner, +.B SoftWeyr. diff --git a/man/eheader.1 b/man/eheader.1 new file mode 100644 index 0000000..60c05ee --- /dev/null +++ b/man/eheader.1 @@ -0,0 +1,209 @@ +.TH EHEADER 1 "Version 1.0" "Environmental planning utilities" "EPU user manual" +.SH NAME +eheader \- display and modify headers of EPPL7 data files +.SH SYNOPSIS +.B eheader +options files +.PP +.B maplist +files +.PP +.B mapalign +base_file +.B [-v] +files +.SH DESCRIPTION +Applies given editing commands to list of +.B epp +or +.B dgt + files. +.PP +Several commands are applicable to both file types and several +to +.B epp +(raster) files only. +No warning is issued when +.B dgt +file is processed during section when epp\-specific commands used, +becouse several epp\-files can be processed at same time. +.PP +No warning is issued also when no editing commands given, therefore +this utility can be used just for viewing header information. +.PP +When invoked as +.B maplist, +simply dumps headers of given files. +.PP +when invoked as +.B mapalign +performs same operations as with +.B \-A +key, but only other option accepted is +.B -v. +This option may be given as before, as after base file. + + +.SH UNIVERSAL OPTIONS +This commands can be applied to both +.B dgt +(vector) +and +.B epp +(raster) +files. +.TP 8 +.B \-v +\- dumps file header information +.B after +applying any edit options to +.I stdout. + +.TP 8 +.B \-x increment + \- shifts alternative x by +.B increment. +Increment can be any real number, both positive and negative. +.TP 8 +.B \-y increment + \- same with alternative y +.TP 8 +.B \-s factor +\- multiplies all coordinates by factor +.PP +This commands cannot be used together with explicit settings of some +alternative coordinate limit. +.TP 8 +.BR "\-Xl value" " or " "\-XL value" +\- sets alternative x of left border to specified value +.TP 8 +.BR "\-Xr value" " or " "\-XR value" +\- same with right border +.TP 8 +.BR "\-Yb value" " or " "\-YB value" , "\-Yt value" " or " "\-YT" +\- same with bottom and top y +.TP 8 +.B \-p name + \- set projection type to name. Available projection types ( +.B EPPL7 version 3.0 +) are: +.RS +.TP 8 +.B none +\- cause EPPL ver 3 to say "No alternate coordinates" +.TP 8 +.BR utm " or " UTM +\- UTM projection +.TP 8 +.B stplate +\- state plane (projection for US state maps) +.TP 8 +.B ll +\- latitude and longitude (geographic coordinates) +.RE +.SH "EPP SPECIFIC COMMANDS" +Following is applicable to EPP files only: +.TP 8 +.B \-o n + \- set offsite value to n. Value can be in range \-32768 65535. +Negative values are equivalent to 65536\-abs(n). Values above 255, applied +to +.I 8\-bit +data files are silently translated into \-1 (no offsite) +.TP 8 +.B \-fr n +\- set first row to n and updates last row field respectively. +.TP 8 +.B \-fc n + \- set first column to n and updates last column field. +.TP 8 +.B \-A filename +\- align to specified file, i.e updates row/column coordinates +so row and column with same number have same alternative coordinates. +.TP 8 +.B \-a value +\- set cell area to value. +.TP 8 +.B \-c "string" + \- fills description field of the header. String must be single command line +argument, but not nessecary need quotes. +.TP 8 +.B \-u name +\- set area unit type, where unit type may be: +.RS +.TP 8 +.B none +\- cause EPPL ver 3 to say "No alternate coordinates" +.TP 8 +.B ft + \- square feet +.TP 8 +.B m +\- square meters +.TP 8 +.B km + \- square kilometers +.TP 8 +.B mile \- square miles +.TP 8 +.B ha + \- hectares +.TP 8 +.B acre +\- acres +.PP +This command does not perform any recalculation, it just update +unit name field. Use +.B \-a +command for change cell area value respectively. +.RE +.SH "OPTION COMPATIBILYTY" +Some options of +.B eheader +cannot coexist together in same command line. +there are two groups of options with incompatibilities between subgroup +of each group. + +First, options dealing with alternative coordinates. There are options +.B "-Xl -Xr -Yt -Yb," +which set alternative coordinates explicitely, and options +.B "-x -y -s", +which change coordinates by arithmetic calculations. +Explicit and arithmetic changes of coordinates are not allowed simulateneously, +becouse it is to hard to understand, which kind user want to apply first. + +Second, options dealing with row/column coordinates of +.B epp +files. Here there are options +.BR "-A" " and " "-fr -fc" +which performs directly opposite task. +(usially +.B -fr -lr +are used to set first row and column to one, to process file cutted from +large +.epp +file separately +and +.B -A +to change it back to +.BR mosaic (1) +file into larger one. + +.SH "SEE ALSO" +.BR lessa (1), +.BR mappaint (1), +.BR mapcopy (1) +.BR epp (5), +.BR dgt (5) +.SH BUGS +No check is performed by +.B \-fr +and +.B \-lr +command to ensure that row/column values are in valid range. +.PP +.B \-A +command sometimes miscalculates one cell. (but EPPL ver 2.1 does the same). +.SH AUTHOR +Vitus Wagner, +.B SoftWeyr. diff --git a/man/extents.1 b/man/extents.1 new file mode 100644 index 0000000..583916b --- /dev/null +++ b/man/extents.1 @@ -0,0 +1,71 @@ +.TH EXTENTS 1 "Version 1.0" "EPU" "EPU user manual" +.SH NAME +extents \- displays information about class extents in given EPP file. +.SH SYNOPSIS +.B extents +[-%ahlrtbxtA] [-o file] file.epp +.SH DESCRIPTION + +Extents calculates area extents of all classes in given file and +displays it in tabular form. + +This information includes minimal and maximal coordinates and area of +class. +.PP +By default information is printed to +.I stdout. + +It may be given in row/column and alternative coordinates. +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B -% --verbose +Displays percentage of processed lines in file. +.TP 8 +.BI -o " file " --output-file= file +gives the name for output file, to write results to, instead of standard +output. +.TP 8 +.B -a --alt-coords +display coordinates in alternative system and area in real units, +insted of row/col and cell count. +.TP 8 +.B -h --header +display one-line header above table. +.TP 8 +.B -l --sort-left +sort classes by leftmost coordinate +.TP 8 +.B -r --sort-right +sort classes by rightmost coordinate +.TP 8 +.B -t --sort-top +same for topmost coordinate +.TP 8 +.B -b --sort-bottom +I'm tired with this sort orders +.TP 8 +.B -A --sort-area +Sort classes by count of cells. +.TP 8 +.B -x --sort-x-center +Sort by x-coordinate of center of rectangle, containing all cells of that class. +.B -y --sort-y-center +same, but by y-coordinate + +.SH SEE ALSO +.BR outtable (1) + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +??? + diff --git a/man/fgisRasterColorImage.n b/man/fgisRasterColorImage.n new file mode 100644 index 0000000..0823c20 --- /dev/null +++ b/man/fgisRasterColorImage.n @@ -0,0 +1,94 @@ +.TH palette n 1.0 Fgis "developer Tcl commands" + +.SH NAME +fgisRasterColorImage, fgisRasterBWImage \- render raster object into planchet item + +.SH SYNOPSIS +\fBfgisRasterColorImage\fI raster planchet item\fR ?\fIoption\fR? + +\fBfgisRasterBWImage\fI raster planchet item\fR ?\fIoption\fR? + +.SH DESCRIPTION + +These commands perform visualisation of fGIS raster objects in fGIS planchet +(essentially same as Tk canvas). They work on platform independent manner, +creating visible representation of layer in Tk image object, which should +be previously created. + +User (and even application writer) seldom accesses this commands directly. +Raser layer objects and planchet subcommands should be used to visualize +raster layers. + +These commands controls all attributes of layer appearance, which have no +semantic meaning. I.e. raster file class to palette index correspondence is +part of raster object, becouse it also used for access legend and GIS +operation, while palette itself appear only in call to this command, becouse +it used only to visualisation. + +.SH ARGUMENTS + +.TP 4 +\fIraster\fR - +name of fGIS raster object (see \fBraster\fR(n)). + +.TP 4 +\fIplanchet\fR - +name of fGIS planchet widget. Planchet should be mapped and have coordinate +system already defined. + +.TP 4 +\fIitem\fR - +ID of planchet item to render raster in. It should exist, be of type image +and contain valid image (photo for \fBfgisRasterColorImage\fR and bitmap for +\fBfgisRasterBWImage\fR) in its -image atribute. + +.SH OPTIONS +.TP 4 +\fB-border\fI option\fR - +specifies whether borders between raster object classes or base file classes +(polygon borders) should be drawn. \fIOption\fR can be one of \fBnone\fR, +\fByes\fR, \fBbase\fR. Abbreviations are not allowed (bug?). \fByes\fR means +that borders are drawn only between distinct classes of current raster object, +\fBbase\fR means that borders should be drawn if base file classes are distinct, +even if they are reclassed into same value. Useful for choropleth plots. + +For symbol plots option is ignored. Defaults to \fBnone\fR for color images +and \fByes\fR for BW images. +.TP 4 +\fB-color\fI color\fR +- specifies color to plot borders in color mode or +for entire image in pattern or symbol mode. \fIcolor\fR can be any form +of color specification, acceptable by Tk. Defaults to "black". +.TP 4 +\fB-map\fI option\fR - +specifies how to deal with map classes, which exceed palette or pattern range +(0\-255). Option is one of \fBwrap\fR - use symbol (color) \fIclass%255\fR for +classes which exceeds 255, \fBnone\fR - use symbol (color) 255 for all these +clases and \fInumber\fR - map range 0-\fImax class\fR to range 0-\fInumber\fR. +Defaults to \fBwrap\fR. +.TP 4 +\fB-palette \fIpalettename\fR (color only) - +specifies fGIS palette object to use for coloring of map classes. Defaults +to \fBdefaultpalette\fR. +.TP 4 +\fB-patterns \fIpatternname\fR (BW only) - +sets plotting mode to pattern and specifies pattern set to plot. In pattern +mode patterns are clipped by polygon boundaries, and thus any border modes +are allowed. Defaults to {} (empty pattern). This mode is default for +\fBfgisRasterBWImage\fR +.TP 4 +\fB-symbols \fIpatternname\fR (BW only) - +sets plotting mode to symbol and specifies pattern set to plot. In symbol +mode patterns can be drawn only at whole, so if central point of pattern +belongs to certain class, pattern for this class would be drawn on entire +rectangle. Borders are never plotted in this mode No defaults, becouse this +mode must be turned on explicitely. +.TP 4 +\fB-update \fI{x1 y1 x2 y2}\fR +- Specifies, that only part of image should be replotted. Useful for +raster editing application. Rectangle to update is given in map coordinates. +It is clipped by image boundaries. + +.SH SEE ALSO +.BR raster (n), planchet (n), palette (n), +.BR patterns (n) diff --git a/man/legend.n b/man/legend.n new file mode 100644 index 0000000..6b74d33 --- /dev/null +++ b/man/legend.n @@ -0,0 +1,85 @@ +.TH legend n 1.0 EPTcl "Environmental Planning Tcl extensions" +.SH NAME +legend \- Create and manipulate EPTcl legends + +.SH SYNOPSIS +\fBlegend read\fI filename\fR options + +\fBlegend parse\fI string\fR + +\fBlegend set\fI list\fR + +.SH DESCRIPTION + +\fBlegend\fR creates legend object, which is used to store and manipulate +descriptive information about maps. There are three ways to create legend: +.TP 4 +from file, which shoild be an EPPL7 legend file +.TP 4 +from string, which should hold content of such file +.TP 4 +from Tcl list, simular to one, used for \fBarray set\fR command +.PP +\fBlegend\fR command returns handle for legend which is unique identifier, +used for subsequent references for this legend. It creates new Tcl command +with name of this identifier, that used to manipulate legend. +.PP +Actually, legend object is combination of global array and Tcl procedure, +and legend handle is simply name of both of them. + +.SH OPTIONS +.TP 4 +\fBlegend read\fI filename\fR +Opens and reads text file in EPPL7 format. Each line of this file contain +number and descriptive text, separated by two spaces (originally, there should +be some information concering printing map on line printer (not graphical one) +between this spaces, but this format is no longer used and supported. +Numbers between 0 and 65535 are considered map classes and numbers -2 and -1 +have special meaning - they are considered legend title and subtitle respecitvely. There can be several lines with same classes in legend. They are concatenated. +Note that EPTcl never uses this line separations as line breaks when outputting +legend (may be this should go to BUGS section) +.TP 4 +\fBlegend parse\fI string\fR +Produces legend from string which should be identical to content of EPPL7 +legend file. +.TP 4 +\fBlegend set\fI list\fR +Produces legend from Tcl list. Such list can be obtained by \fBarray get +\fIlegendname\fR command. Differ from \fBarray set\fR in that finds correct +name for legend and defines object command for it. Can be used to create +empty legend for subsequentual filling by \fIlegendname \fBset\fR subcommand. +In this case empty list should be specified. + +.SH OBJECT COMMAND +.TP 4 +\fIlegendName\fB classes\fR +Return sorted list of classes defined in legend +.TP 4 +\fIlegendName\fB delete\fR +Destructor of object. Unsets all data and destroys object command. +.TP 4 +\fIlegendName\fB drawable\fI ?boolean? +if boolean specified, set legend drawmode and return nothing. +Otherwise returns 0 or 1, depending of current settings. +Drawmode controls if legend could be displayed in legend box. +.TP 4 +\fIlegendName\fB get \fI class\fR +Returns value of given class or string "Not defined",such class is not defined. +String could be changed by changing value of element \fBudefined_legend\fR of +global array \fBfgis\fR +.TP 4 +\fIlegendName\fB print\fI +Returns content of legend in form of EPPL7 legend format as string. +.TP 4 +\fIlegendName\fB set \fIclass value\fR +Changes description of given class +.TP 4 +\fIlegendName\fB subtitle\fR ?\fIstring\fR? +If no \fIstring\fR specified, returns current legend subtitle. Otherwise +replaces subtitle by given string +.TP 4 +\fIlegendName\fB title\fR ?\fIstring\fR? +If no \fIstring\fR specified, returns current legend title. Otherwise +replaces title by given string +.SH BUGS +None noticed diff --git a/man/mosaic.1 b/man/mosaic.1 new file mode 100644 index 0000000..fa626e8 --- /dev/null +++ b/man/mosaic.1 @@ -0,0 +1,62 @@ +.TH MOSAIC 1 "Version 1.0" "EPU" "EPU user manual" +.SH NAME +mosaic \- merges several epp files together +.SH SYNOPSIS +.B mosaic +[-%RA] [-O number] [-o filename] [--help][--version]files +.SH DESCRIPTION +Mosaic merges several +.IR epp -files +into one. If some cell has non-offsite value in several files, +value from last files would be used. +.PP +Cell sizes of all old files must be equial. Usially +.B mosaic +deals with properly aligned files, but it can deal with misaligned files, +taking into account row/column or alternative coordinates regarding to +command-line options. +.PP +If +.I offsite +value is not explicitely given in command line, it defaults to +offsite of first (base) file if it is not used as data class in one +of overlay files. In last case offsite would be set to 255 for 8-bit and +to 65535 to 16-bit files. +.SH OPTIONS + +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B -% +Displays percentage of processed lines in file. +.TP 8 +.BI -o " file " --output-file= file +gives the name for output file. Defaults to +.I mosaic.out.epp +.TP 8 +.B -A --force-alt +Do not complain, if files are misaligned. Use alternate coordinates to +reference them. +.TP 8 +.B -R --force-row +Same, but use row/col cordinates. + +.TP 8 +.BI -O " value " --offsite= value +specifies offsite value of new file. + +.SH SEE ALSO +.BR eheader (1), window (1) + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +??? diff --git a/man/neighbours.1 b/man/neighbours.1 new file mode 100644 index 0000000..07165ea --- /dev/null +++ b/man/neighbours.1 @@ -0,0 +1,43 @@ +.TH NEIGHBOURS 1 "Version 1.0" "Environmental planning utilities" "EPU user manual" +.SH NAME +neighbours \- prints list of neighbouring clasees in epp-file +.SH SYNOPSIS +.B neighbours [-%][-d] file +.SH DESCRIPTION +This command searches +.IR epp -file +for all class boundaries and print a table of class pair which +are neighbouring at least in one place. +DO NOT MIX it with EPPL7 NEIGHBOUR command, which is part of +.BR evaluate (1) +in EPU. + +It prints pairs of classes to stdout, one per line separated by commas. + +Each pair of classes can be printed once or twice, first among neighbours +of first class in pair, than neighbours of second. + +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B --verbose -% +Displays percentage of processed lines in file. +.TP 8 +.B -d --double +print each pair twice. + +.SH SEE ALSO +.BR outtable (1), mapcolor (1), evaluate (1), extents (1). + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +??? diff --git a/man/outtable.1 b/man/outtable.1 new file mode 100644 index 0000000..44fcdb1 --- /dev/null +++ b/man/outtable.1 @@ -0,0 +1,153 @@ +.TH OUTTABLE 1 "Version 1.0" "Environmental planning utilities" "EPU user manual" +.SH NAME +outtable \- computes table of statistics from several epp files. +.SH SYNOPSIS +.B outtable +.RI [ options ] +.RI [ function "] file [ [" function "] file ...]" + +.SH DESCRIPTION +.B outtable +takes several +.IR epp -files +counts all possible combinations of classes in them and produces +table of them. +.PP +Some files can be preceded by +.I function +Such files wouldn't be used to define new combination. Instead, corresponding +column of table would contain value of function, computed from this file for +area, defined by combination of classes of all "function-less" files. +.PP +All files, used to define combination, should be specified before first +file with function. +.PP +If no function defined, table would be appended by column, containing area +of each combination. +.PP +If all files have function, table would contain only one row, containing +values of the functions for all area. +.PP +If files have different cell size and limits, limits and coordinate systems +of the first file are used, unless overriden by +.B +--base +option. +.PP +By default, semantic value of classes are considered equial to values of +classes. This can be overridden by specifying parameters of linear mapping +function using + +.BR -z " and " -Z " options." +This option can be specified only once per invocation, becouse usially +.B outtable +is used to calculate statistics for one file in combinations, given by +several other files. +.PP +By default, all area-related values are calculated in alternative coordinate +units. It can be overriden using +.B -c +option. +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B --verbose -% +Displays percentage of processed lines in file. +.TP 8 +.B -u --union +Take into account all cells, where at least one of output files is not offsite. +By default, only cells where all input files are onsite are taken into account. +.TP 8 +.B -c --cells +Output areas in cells. By default map units as specified in file header +are used to compute areas. +.TP 8 +.BI -d "char " --delimiter= char +sets table column separator to +.I char. Defaults to comma. +.TP 8 +.BI -b " file" --base " file" +Specifies epp file, used as reference grid. Cell area and cell size of this +file, as well as its coordinate limits would be used for processing. +Defaults to first file in the command line. +.TP 8 +.BI -z " value" +Specifies multiplier for calculating semantic value from class value. +.TP 8 +.BI -Z " value" +Specifies offset of semantic values, i.e. semantic value of class 0. +.SH FUNCTIONS +.TP 8 +.B -sum +Sum of classes in given file for combination, multiplied by cell area. +.TP 8 +.B -cnt +Count of onsite cells of given file. +.TP 8 +.B -avg +Average cell value +.TP 8 +.B -min +Minimum cell value +.TP 8 +.B -nmin +Area of cells with minimum value + +.TP 8 +.B -max +Maximum cell value +.TP 8 +.B -nmax +Area of cells with maximum value +.TP 8 +.B -mode +Modal value (value of most cells) +.TP 8 +.B -nmode +Area of cells with modal value +.TP 8 +.B -fewest +Class with fewest cells +.TP 8 +.B -nfewest +Area of cells in fewest class +.TP 8 +.B -range +Range of classes (maximum-minimum) +.TP 8 +.B -classes +Number of different classes +.TP 8 +.B -or +Bitwise or of all cells (values of +.BR -z " and " -Z +options are not used) +.TP 8 +.B -and +Bitwise and of all cells (values of +.BR -z " and " -Z +options are not used) +.TP 8 +.B -std +Standard deviation of classes +.TP 8 +.B -var +Variance of classes +.TP 8 +.B -corr +Correlation coefficient between two files. Requires two arguments. +.SH SEE ALSO +.BR intable (1), reclass (1), evaluate (1), resample (1), eheader (1) + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +??? diff --git a/man/palette.n b/man/palette.n new file mode 100644 index 0000000..c67ae7b --- /dev/null +++ b/man/palette.n @@ -0,0 +1,67 @@ +.TH palette n 1.0 Fgis "user Tcl commands" + +.SH NAME +palette \- Create and manipulate color palettes + +.SH SYNOPSIS +\fB palette \fIoption\fR ?\fIarg\fR? + +.SH DESCRIPTION +.PP +This command creates palette object, which is used for map visualisation. Palette is +array of 256 RGB color specifications, indexed by integers from 0 to 255. +Typically palette entry N is used for displaying map class N. +Upon creation of object new Tcl command with same name as object is defined +and can be used for manipulating palette. \fBpalette\fR command returns +name of created object. One palette, named \fBdefaultpalette\fR is created +during initialization of fGIS. In difference of user-created palettes it +cannot be modified. + +.SH OPTIONS +.TP 4 +\fBpalette read \fIfilename\fR +- reads palette from specified file. File should confirm EPPL7 clr file +syntax. +.TP 4 +\fBpalette parse \fIstring\fR +- reads palette from string. String should have same format as EPPL7 clr file. +.TP 4 +\fBpalette set \fIlist\fR +- creates palette from list of color specification. Each element of list +should have format \#rrggbb. Color names are not supported by palettes. +Color specifications are assigned to palette indices in sequentual order. +.TP 4 +\fBpalette blank\fR +- creates new palette with all entries set to white (#ffffff). + +.TP 4 +\fBpalette copy \fIpaletteName\fR +- creates a copy of existing palette. This allows to create modifable copy +of default palette. +.SH OBJECT COMMAND +Palette object names can be used as command names. They support folowing +options: +.TP 4 +\fIpaletteName\fB delete\fR - +destroys palette object. +.TP 4 +\fIpaletteName\fB get\fI index\fR +- return color for given index in palette. Color is returned as \#rrggbb, +and can be used as color specification in Tk commands. +.TP 4 +\fIpaletteName\fB list\fR +- return list of all colors in palette. This list always contains 256 +elements. This list can be used as argument for \fBpalette set\fR command, +to create same palette. +.TP 4 +\fIpaletteName\fB print\fR +- returns string, containing content of valid EPPL7 clr file, which can +be used to reproduce this palette. +.TP 4 +\fIpaletteName\fB set\fI index value\fR +- changes contents of given entry to \fIvalue\fR. Value should be in form +\#rrggbb. Other forms of colors, supported by Tk are not supported by +palettes. +.SH SEE ALSO +.BR patterns (n), fgisRasterColorImage (n). + diff --git a/man/planchet.n b/man/planchet.n new file mode 100644 index 0000000..3b92b8c --- /dev/null +++ b/man/planchet.n @@ -0,0 +1,535 @@ +'\" Stuff below is shamelessly borrowed from canvas(n) manual page, and +'\" therefore shares its copyright +.if t .wh -1.3i ^B +.nr ^l \n(.l +.ad b +'\" # Start an argument description +.de AP +.ie !"\\$4"" .TP \\$4 +.el \{\ +. ie !"\\$2"" .TP \\n()Cu +. el .TP 15 +.\} +.ie !"\\$3"" \{\ +.ta \\n()Au \\n()Bu +\&\\$1 \\fI\\$2\\fP (\\$3) +.\".b +.\} +.el \{\ +.br +.ie !"\\$2"" \{\ +\&\\$1 \\fI\\$2\\fP +.\} +.el \{\ +\&\\fI\\$1\\fP +.\} +.\} +.. +'\" # define tabbing values for .AP +.de AS +.nr )A 10n +.if !"\\$1"" .nr )A \\w'\\$1'u+3n +.nr )B \\n()Au+15n +.\" +.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n +.nr )C \\n()Bu+\\w'(in/out)'u+2n +.. +.AS Tcl_Interp Tcl_CreateInterp in/out +'\" # BS - start boxed text +'\" # ^y = starting y location +'\" # ^b = 1 +.de BS +.br +.mk ^y +.nr ^b 1u +.if n .nf +.if n .ti 0 +.if n \l'\\n(.lu\(ul' +.if n .fi +.. +'\" # BE - end boxed text (draw box now) +.de BE +.nf +.ti 0 +.mk ^t +.ie n \l'\\n(^lu\(ul' +.el \{\ +.\" Draw four-sided box normally, but don't draw top of +.\" box if the box started on an earlier page. +.ie !\\n(^b-1 \{\ +\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.el \}\ +\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' +.\} +.\} +.fi +.br +.nr ^b 0 +.. +'\" # VS - start vertical sidebar +'\" # ^Y = starting y location +'\" # ^v = 1 (for troff; for nroff this doesn't matter) +.de VS +.if !"\\$1"" .br +.mk ^Y +.ie n 'mc \s12\(br\s0 +.el .nr ^v 1u +.. +'\" # VE - end of vertical sidebar +.de VE +.ie n 'mc +.el \{\ +.ev 2 +.nf +.ti 0 +.mk ^t +\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' +.sp -1 +.fi +.ev +.\} +.nr ^v 0 +.. +'\" # Special macro to handle page bottom: finish off current +'\" # box/sidebar if in box/sidebar mode, then invoked standard +'\" # page bottom macro. +.de ^B +.ev 2 +'ti 0 +'nf +.mk ^t +.if \\n(^b \{\ +.\" Draw three-sided box if this is the box's first page, +.\" draw two sides but no top otherwise. +.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c +.\} +.if \\n(^v \{\ +.nr ^x \\n(^tu+1v-\\n(^Yu +\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c +.\} +.bp +'fi +.ev +.if \\n(^b \{\ +.mk ^y +.nr ^b 2 +.\} +.if \\n(^v \{\ +.mk ^Y +.\} +.. +'\" # DS - begin display +.de DS +.RS +.nf +.sp +.. +'\" # DE - end display +.de DE +.fi +.RE +.sp +.. +'\" # SO - start of list of standard options +.de SO +.SH "STANDARD OPTIONS" +.LP +.nf +.ta 4c 8c 12c +.ft B +.. +'\" # SE - end of list of standard options +.de SE +.fi +.ft R +.LP +See the \\fBoptions\\fR manual entry for details on the standard options. +.. +'\" # OP - start of full description for a single option +.de OP +.LP +.nf +.ta 4c +Command-Line Name: \\fB\\$1\\fR +Database Name: \\fB\\$2\\fR +Database Class: \\fB\\$3\\fR +.fi +.IP +.. +'\" # CS - begin code excerpt +.de CS +.RS +.nf +.ta .25i .5i .75i 1i +.. +'\" # CE - end code excerpt +.de CE +.fi +.RE +.. +.de UL +\\$1\l'|0\(ul'\\$2 +.. +.TH planchet n 1.0 Fgis "user Tcl commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +planchet \- Create and manipulate planchet widgets +.SH SYNOPSIS +\fBplanchet\fI \fIpathName \fR?\fIoptions\fR? +.SO +\-background \-insertwidth \-state +\-insertbackground \-relief \-tile +\-cursor \-insertborderwidth \-selectbackground \-takefocus +\-highlightbackground \-insertofftime \-selectborderwidth \-xscrollcommand +\-highlightcolor \-insertontime \-selectforeground \-yscrollcommand +.SE +.PP +\fBNote:\fR Standard optiosn \fb\-highlightthickness\fR and \fB\-bordewidth\fR +are ignored by planchet, and set to 0. Therefore \fB\-relief\fR options have +no effect. +.SH "WIDGET-SPECIFIC OPTIONS" +.OP \-coordformat coordFormat CoordFormat +Specifies format string to display current map coordinates, if no projection +defined. Defaults to "X=%0.8g Y=%0.8g" +.OP \-orient orient Orient +Specifies printing orientation for this planchet. May be either portrait +or landscape. Defaults to landscape +.OP \-lookwidth lookWidth LookWidth +Wraplength of text in popup look window. Defaults to 200. +.OP \-shiftfactor shiftFactor ShiftFactor +Specifies share of window size to move on \fBshift\fR widget command. +Defaults to 0.75 +.OP \-resizable resizable Resizable +Specifies a boolean value that indicates whether or not should planchet +adjust its width/height ratio, when coordinate limits are first defined. +.OP \-rulerpos rulerPos RulerPos +Indicates position of scale ruler in planchet. (its left end). Should be +list of two coordinates in any form, acceptable by Tk. Positive values +are measured from top and left and negative from lower and right side +of planchet +.OP \-scalevar scaleVar Variable +Specifies the name of variable. Current scale of map would be stored in +this variable automatically upon each change of scale in form 1:denominator. +If variable doesn't exist in global scope, it would be created. +.OP \-statusline statusLine none +Specifies name of label widget which would be used for displaying status +information of planchet (i.e. current mouse pointer coordinates). +Widget should exist before creating planchet or before passing it to +planchet configure command. +.OP \-legbox legBox none +Specifies name of canvas widget which would display scrollable legend of +base layer. Note, that scrollable legend is not printed automatically by +print command. All contents of this widget would be erased each time +base layer changed in planchet. +.OP \-zoombutton zoomButton none +Specifies name of button, which is used to initiate zoom operation on +canvas. (usially via \fBzoom\fR) widget command. Planchet controls its +state, disabling it, if coordinate system is not defined. It should +exist before it passed to planchet. +.OP \-unzoombuttons unzoomButtons none +Specifies list of buttons, which are used to perform various unzoom operations +(like \fBunzoom\fR or \fBlimits default\fR widget commands). Planchet +controls their state, disabling them if such operations are impossible. +.OP \-shiftbuttons shiftButtons none +Specifies list of four buttons for perform shift operation on planchet. +Buttons are specified in following order left(west) down(south) up(north) and +right(west), the same way as vi cursor movement keys are situated on keyboard. +.OP \-zoombutton zoomButton none +Specifies name of button, which is used to initiate zoom operation on +canvas. (usially via \fBzoom\fR) widget command. Planchet controls its +state, disabling it, if coordinate system is not defined. It should +exist before it passed to planchet. +.OP \-unzoombuttons unzoomButtons none +Specifies list of buttons, which are used to perform various unzoom operations +(like \fBunzoom\fR or \fBlimits default\fR widget commands). Planchet +controls their state, disabling them if such operations are impossible. +.OP \-shiftbuttons shiftButtons none +Specifies list of four buttons for perform shift operation on planchet. +Buttons are specified in following order left(west) down(south) up(north) and +right(west), the same way as vi cursor movement keys are situated on keyboard. +This buttons should be either all be specified or all be empty, in which case +list of four empty elements should be passed. Planchet not only controls +state of buttons, but also redefines their commands. +.OP \-projection projection none +Specifies Fgis projection object which is used to convert chartographic +coordinates of planchet into geographic (latitude and longitude) and vice versa. + +.PP +In addition to these all options of \fBcanvas\fR widget are supported. +.SH INTRODUCTION +.PP +The \fBplanchet\fR command creates a new window (given by the \fIpathName\fR +argument and makes it into planchet widget. + +Additional options, described above, can be given to control its behavoir. +Currently they could be specified only in command line, not in option database, +but it shoudl change in future. + +\fBplanchet\fR command returns its \fIpathName\fR argument. At the time this +command is invoked, there must not exist a window, named \fIpathName\fR, +but \fIpathName\fR's parent must exist. +\fBplanchet\fR command also creates new Tcl command named \fIpathName\fR +which can be used to control widget. + +.PP + Planchet widget have all behavoir +supported by Tk \fBcanvas\fR widget, but, in addition it could have +chartographic coordinate system and able to visualize and manipulate maps. + +.SH COORDINATE SYSTEM + +Planchet coordinate system is real-world coordinate system. Its coordinates +should be in meters of earth surface, not in pixels, millimeters or other +map sheet or screen-related units. It can be defined either explicitely +via \fBlimits\fR widget command, or implicitely, when first map is shown +in planchet. + +There are special commands which allow to recalculate from map (realword) +coordinates to screen coordinates. Screen coordinate system of planchet is +same as of canvas. +.SH LAYERS +Planchet can visualize maps, which are represented as Fgis layer objects. +There are two ways of display layer - as base layer or as ovelay. +.PP +Base layers are opaque, they are typically raster layers, shown by colors. +There can be only one base layer in plachet in given time. If \fBlegbox\fR +helper widget is defined, and legend for base layer is drawable, it would +be displayed in this widget. +Several layer types couldn't be displayed as base layers. + +.PP +Overlay layers are transparent, although visible. There can be several +overlay layers in planchet at given time. Any layer can be displayed as +overlay. +.PP +When first layer is displayed in planchet, with undefined coordinate system, +coordinate system limits for planchet are got from limits of layer. If +layer cannot provide this information, it causes an error. + +.SH HELPER WIDGETS + +Planchet can be accompanied with several other widgets, which are used +to interact with user. If this widgets are passed to planchet via commandline +options (or via widget \fBconfigure\fR) command, it can control them +automatically and disable them, if corresponding action is impossible. +See \fBOPTIONS ABOVE\fR. + +.SH SCALE INDICATION + +There are two traditional ways of scale indication - numerical and graphical. +As numerical indication, \fB\-scalevar\fR option of planchet widget allows +to specfy Tcl global variable, which would always hold current value of map +scale. +.PP +As graphical representation of scale, +planchet can display scale ruler which shows how some realword distance +is visible in planchet. + +.SH LOOK FEATURE + +Planchet allows to collect information from several layers in given point. +By default it pops up window with this information on right button click. +Set of layers which included in this information is called \fBlook list\fR. + +.SH "WIDGET COMMAND" +.PP + +The \fBplanchet\fR command creates a new Tcl command whose name is +\fIpathName\fR. This command can be used to invoke various operaitons on +the widget. It has following general form: +.CS +\fIpathName option \fR?\fIarg arg ..\fR? +.CE +\fIOption\fR and the \fIarg\fRs +determine the exact behavior of the command. +Planchet supports all widget commands, defined for \fBcanvas\fR widget +and following special commands, specific to planchet: +.TP +\fIpathName \fBclear\fR +Removes all layers from planchet, and from look list and unsets coordinate +system +.TP +\fIpathName \fBcget\fI option\fR +Returns value of specified configuration option. In addition to standard +options and widget specific options, supports all options of canvas widget. +Several internal variables can also be obtained this way, but it is dirty +and undocumented hack. +.TP +\fIpathName \fBconfigure\fI option arg ?option arg ...?\fR +Allows to change value of one or more options. +.TP +\fIpathName \fBfit\fI x y\fR +Returns 1 if point, given in real world coordinates is inside current +planchet limits, and 0 otherwise. +.TP +\fIpathName \fBhide\fI pattern ?pattern...?\fR +Removes all layers which matches pattern from planchet. +.TP +\fIpathName \fBlayers\fR ?\fIpattern\fR? +Return list of all visible layers, either base or overlays, which match given +pattern. By default - all layers. +.TP +\fIpathName \fBlimits\fR +Used to control limits of realword coordinate system. Can have one of +following form +.RS +.TP +\fBlimits\fR +Without any arguments return list of four double values, representing real +world coordinates of window sides. They are given in folowing order: +.CS +\fIXLeft YBottom XRight YTop +.CE +.TP +\fBlimits \fIlist\fR +.TP +\fBlimits \fIxleft ybottom xright ytop\fR +Given list of four double values or four double values as separate arguments, +sets planchet limits for this value. If \fB\-resizable\fR option is true +and no coordinate system was defined before, adjusts width/height ratio +of planchet to reflect this ratio of given limits. Otherwise expands +given limits to have same width/height ratio as widget. + +If directions of axes of given limits doesn't match those of currently +defined coordinate system, silently reverts them. Therefore order +of coordinates in insignificant, once coordinate system is defined. + +If coordinate system was defined, assumes that zooming operation is +performed and stores old limits in zoom stack for subsequent unzoom +operation. If scale of given limits is smaller, then +of some limits in zoom stack, discards all elements with scale larger +than given for unzoom operation shouldn't increase scale. Nevertheless +initial limits are never discarded this way. +.TP +\fBlimits default\fR +Clears zoom stack and restores coordinate limits to their initial values. +.RE + +.TP +\fIpathName \fBlook\fR +Controls \fBLOOK FEATURE\fR of planchet. Can have one of following forms +.RS +.TP +\fBlook add \fIlayer\fR +adds layer to look list. +.TP +\fBlook list \fR?\fIpattern\fR? +Returns list of layers in look list, which match pattern. By default all layers +.TP +\fBlook remove \fIpattern\fR +removes layers which match pattern from look list +.TP +\fBlook remove all\fR +clears look list entirely +.TP +\fBlook \fIx y \fR?\fB-titled|-list|-raw\fR? +return list of information for all layers in look list at given point. +If \fB-titled\fR option is specified, each element in list is formatted +string. Otherwise it is two element list which first element - layer title, +and second - layer value. \fB-raw\fR option returns only values, without +layer title information. + +Length of this list not neccesary matches length of look list, becouse if +some layers are undefined in given point, they do not create list element. +.RE +.TP +\fIpathName \fBmapx \fIx\fR +.TP +\fIpathName \fBmapy\fR +Given screen coordinate in any form, acceptable by Tk, returns realword +coordinate. +.TP +\fIpathName \fBprint\fR ?option arg ...? +Wrapper around \fBpostscript\fR command. Uses default Fgis font mapping and +print system, also widget default orientation. By default, send output +to default Fgis printer using command, defined in fgis configuration file. + +Following options are supported: +.RS +\fB-colormode\fI mode\fR +Same as \fBcolormode\fR option in canvas \fBpostscript\fR command. +.TP +.TP +\fB-file\fI filename\fR +Write postscript representation of planchet into given file, instead of +piping it to print command. +.TP +\fB-fontmap \fIvariable\fR +array used to map screen fonts to postscript fonts. See canvas \fBpostscript\fR +command for more information. +.TP +\fB-printer \fIprintername\fR +Overrides default printer, specified in fgis.rc file. +.RE +.TP +\fIpathName \fBruler\fI ?on|off?\fR +Controls scale ruler. +.TP +\fIpathName \fBscale\fR ?\fIdenominator\fR? +With no arguments returns current scale denominator. If \fIdenominator\fR +is given, adjust coordinate limits so that scale would be as specified and +center point of widget would have same realworld coordinates as before. + +If any other arguments are specified, behaves as \fBcanvas\fR widget \fBscale\fR +command. + +.TP +\fIpathName \fBscrx \fIx\fR +.TP +\fIpathName \fBscry \fIy\fR +Given realworld coordinate, returns screen coordinate in pixels. +.TP +\fIpathName \fBsetstatus\fR +Displays message if \fB\-statusline\fR helper widget, if defined, otherwise +does nothing. Can have one of two form: +.RS +.TP +\fBsetstatus\fI message\fR +displays message as specified +.TP +\fBsetstatus\fI x y\fR +Displays given coordinates. If no projection defined, they would be displayed +using Tcl \fBformat\fR command with value of \fB\-coordformat\fR option as +first argument. Otherwise they would be displayed using \fBformat\fR object +command of current projection. +.RE +.TP +\fIpathName \fBshift \fIdirection\fR +Changes current coordinate limits so that current view shifts in specified +\fIdirection\fR by share of corresponding widget size, specified by +\fB-shiftfactor\fR option. +.TP +\fIpathName \fBshow \fIlayer \fR?\fB-base\fR|\fB-overlay\fR? +Displays specified layer. If neither \fB-base\fR nor \fB-overlay\fR is specifed, +shows layer as base if no base layer currently present and layer can be +displayed as base. Otherwise displays it as overlay. +.TP +\fIpathName \fBunzoom\fR +Pops last coordinate limits from zoom stack +.TP +\fIpathName \fBzoom\fR ?\fI x y\fR? x y\fR?? +Initiates interactive zoom operation. If no coordinates are specified, +prompts user to pick both corners of rectangle to display. If one pair +is specified, prompts only for second pair. With two pairs just converts +values from canvas to realworld coordinates and performs \fBlimits\fR command +on them. +.CS +\fIpathName \fBzoom cancel\fR +.CE +can be used to abort interactive zoom operation currently in progress. +.CS +\fIpathName \fBzoom cancel\fR +.CE +can be used to abort interactive zoom operation currently in progress. +.SH SEE ALSO +.BR layer (n) +.SH BUGS +No care taken to do something useful if interactive zoom operation is +performed on two planchets simulateously. + + + + diff --git a/man/projection.n b/man/projection.n new file mode 100644 index 0000000..1a3b4ba --- /dev/null +++ b/man/projection.n @@ -0,0 +1,85 @@ + +.TH projection n 1.0 Fgis "user Tcl commands" + +.SH NAME +projection \- Create and manipulate projection objects + +.SH SYNOPSIS +\fB projection \fItype\fR ?\fIparameters\fR? +.PP + + +.SH DESCRIPTION +.PP + +This command creates projection object, used to recalculate geographic +coordinates (latitude and longitude) into map projection coodrinates. +.PP +\fBprojection\fR command takes list of options and +returns name of newly created projection object. +Name of object can be used as Tcl command which have several subcommands +(see \fBPROJECTION SUBCOMMANDS\fR below) used for manipulation +of projections. + +.SH PROJECTION TYPES + +Most important property of projection is projection type. fGIS supports +following types of projections: + +\" list should be here + +.SH PROJECTION OPTIONS + +\" list should be here + +.SH PROJECTION SUBCOMMANDS +.TP 8 +\fIprojName \fBforward\fI long lat\fR +recieves two arguments - geographic longitude and latitude as degrees in +decimal format and returs list of two double values representing map +coordinates in meters. + +.TP 8 +\fIprojName \fBbackward\fI X Y \fR +performs backword transformation - given map coordinates in meters +returns longitude and latitude in decimal degrees, +.TP 8 +\fIprojName \fBformat\fI X Y\fR ?\fB-format\fI formatString\fR +Returns formatted representation of latitude and longitude. String +can contain following escapes sequences: +.RS +.TP +\fB%lt\fR +unsigned latitude in DDMMSS format +.TP +\fB%lg\fR +unsigned longitude in DDMMSS format +.TP +\fB%-t\fR \fB%-g\fR +optionally signed latitude and longitude in DDMMSS format +.TP +\fB%+t\fR \fB%+g\fR +explicitely signed latitude and longitude in DDMMSS format +.TP +\fB%lG %lT %-G %-T %+G %+T\fR +same as above, but in decimal fractions of degree +.TP +\fB%dl %dg\fR +direction indicator - letters N and S for latitude and E and W for +longitude (or some other national language values as defined in fgis.rc +file). +.RE +If \fIformatString\fR omitted, default "%lt%dt %lg%dg" is used. +.TP 8 +\fIprojName\fB dump\fR +returns argumets for projection command used to create this projection +object. +.TP 8 +\fIprojName\fB delete\fR +destroys projection object. + +.SH "SEE ALSO" + +.BR proj "(1), " pj_init "(3), " transform (1) + + diff --git a/man/raster.n b/man/raster.n new file mode 100644 index 0000000..353ac51 --- /dev/null +++ b/man/raster.n @@ -0,0 +1,326 @@ +.TH raster n 1.0 Fgis "developer Tcl commands" + +.SH NAME +raster \- Create and manipulate raster object + +.SH SYNOPSIS +\fB raster \fIfilename\fR ?\fIoptions\fR? + +.SH DESCRIPTION +.PP +This command allows to create raster objects. Raster objects are more low-level +concept than fGIS \fBlayers\fR. They directly correspond to raster files +in EPPL7 format. Their values are always unsigned short integer. +They even make cell size visible to user. This command returns name of +raster object which is used for manipulating this object. By default +it requires existing raster file without reclass table. + +Raster files are objects which holds information of certain integer spatial +variable in given rectangular area. Value is stored with certain granulariry. +Minimal square, which can be addressed as separate unit, is named cell. +Of course, you can specify coordinates with any precision, but while they are +in same cell, same value would be returned. Moreover, when you edit raster, +you can change values only on per cell basis. + +Raster file is always rectangular, but spatial variable can be defined on +any arbitrary area. So, special value is reserved for "undefined" areas of +raster. It is named \fBoffsite\fR value. Typically you can read raster it +any coordinates, but if no information is provided for this area, offsite +would be returned. + +There are certain limitation on raster files - file cannot contain more than +32767 cells per row or per column. Possible values of raster should be in +range 0\-65535. Rows and columns of cells can be numbered starting from +any integer, provided that no row or column in file has number out of range +-32767- 32767. fGIS, however never relies on column numbers. They are supported +only for compatibility with EPPL7. + +Raster objects differs from raster files in the way that they include +\fBreclass table\fR. This allows to store information about several +spatial variables in one file, provided that total count of value combination +doesn't exceed raster file limit. Reclass table defines correspondence +between file classes (values) and values, returned by raster object. +It can be defined by two ways - using special syntax like in EPPL7 RECLASS +command (see RECLASS SYNTAX below) or using Tcl list, each element of which +is pair of values, first base, then reclassed. + +When raster objects are accessed or created via GIS operations, user may not +be aware about underlying raster file level. But when objects are created +by interative editing, certain properties of raster (i.e. cell size) should +be specified. + +Raster objects behave like other fGIS objects - layers, legends, palettes etc. +Once object is created, new Tcl command with same name is created. This +command is used to access and modify rasters. + +.SH OPTIONS +.TP 4 +\fB-reclass \fIstatements\fR +-specifies reclass table for created raster object. \fIstatements\fR is +string, containing set of reclass statements. See \fBRECLASS SYNTAX\fR below +for details +.TP 4 +\fB-table \fIlist\fR +-specifies reclass table in form of Tcl list. Each +element of this list should be list of two integers, first of them representing +value in raster file, and second - representing value which would be value +of new raster object. +.TP 4 +\fB-new\fR +- specifies that new raster file should be created instead of +opening old. This option should be specified immediately after file name +and followed by several other options, defining properties of new raster. +All subsequent options are applicable only if \fB-new\fR is specified. +.TP 4 +\fB-like\fI rasterObject\fR +- specifies that all important properties +should be copied from existing raster object. +.TP 4 +\fB-width\fI integer\fR +- specifies how many cells should appear in each +row. Cannot be used together with \fB-like\fR +.TP 4 +\fB-height\fIinteger\fR +- specifies how many cells should be in each column. +.TP 4 +\fB-offsite\fIinteger\fR + - specifies which value would be used as "no data" +value. Default is 65535 for 16-bit files and 255 for 8-bit. Value -1 can +be specified for 8-bit files. It means that all classes are onsite. For +16-bit files it is equivalent to 65535. +.TP 4 +\fB-8bit\fR - specifies that only one byte should be used for storing +values of raster. This limits value range to 0-255, slightly decreases file +size (usially much less than two times) and makes file compatible with +EPPL7 ver. 2.1. +.TP 4 +\fB-limits\fI{x1 y1 x2 y2}\fR +- Allows to specify list of four double values, +determinig map coordinates of file. +.TP 4 +\fB-cell\fI value\fR - specifies size of cell. In conjunction with \fB-limits\fR +it gives more convinient way to create new raster, becouse limits defines +area of interest and cell size - accuracy of map. + +.SH OBJECT COMMAND +\fBraster\fR command creates new Tcl command with same name as raster object, +which can be used to manipulate this object. + +\fIrasterName\fB box\fIvalue x1 y1 x2 y2\fR - +fills rectangular region with given value. Raster should be opened in +read-write mode (either by \fB-new\fI option of object command or by +\fBload\fR object command). Returns list of four double values, specifying +region actually affected by command. (Can be less that specified region, +if it exceeds raster boundary). Value is class of base raster file, not +reclassed value. + +.TP 4 +\fIrasterName\fB bpp\fR - returns size of data in this raster file +(8 for 8-bit and 16 for 16 bit rasters). +.TP 4 +\fIrasterName\fB cache \fR?\fInew size\fR? +- controls size of cache. If raster file is accessed from disk (default +read only mode) setting sufficient cache can improve performance of operations, +which require nonsequentual access, like \fBtransect\fR. +.TP 4 +\fIrasterName \fBcell\fR ?\fB-area\fR? +- returns parameters of cell. By default, returns cell width in map +coordinates, which should be meters, and with \fB-area\fI flag returns +cell area in current units (see \fBunit\fR object command). +.TP 4 +\fIrasterName \fBcelllimit\fR +- returns list of four intergers, representig start and end numbers of cells +in order \fIfirst column\fR, \fIlast row\fR, \fIlast column\fB, \fIfirst row\fR. +(Why this order? X direction of cell numbers is same as of coordinates + (usially), and Y coodinates usially go from bottom to top, while cells - from +top to bottom. So, order of values is same as order of values in \fBlimits\fI +object command. +.TP 4 +\fIrasterName \fBclasses \fIvalue\fR +- returns list of base file classes which are mapped to specified value of +this raster object. +.TP 4 +\fIrasterName \fBcircle\fI value x y radius \fR?\fB-cells\fR? +- fills circulare region in read-write raster with given value. If \fB-cells\fR,flag is given, radius is assumed to be in raster cells. Otherwise it is assumed +to be in coordinate units. Returns list of coordinates, specifying actualy +affected region. +.TP 4 +\fIrasterName \fBcol\fI x\fR +- returns cell number corresponding to given X coordinate. Returns error, if +coordinate is out of file boundaries. +.TP 4 +\fIrasterName \fBcomment\fR ?\fIstring\fR? +- returns (or modifies) comment, stored in file header. Comment length is +limited by 32 symbols. +.TP 4 +\fIrasterName \fBcount\fR ?\fBoptions\fR? +- performs various area-calculating operation +General formats folows: +.TP 8 +\fIrasterName \fBcount\fR ?\fB--\fR? \fI varname \fR?\fIregion specification\fR? +fills dynamic array \fIvarname\fR indexed by raster classes by areas of these +classes in given region. +.TP 8 +\fIrasterName \fBcount -classes \fIlist \fR?\fIregion specification\fR? +returns area of given classes within given region. + +Region specification defaults to whole file. Other possible formats are: +.TP 8 +\fB-box\fI x1 y1 x2 y2\fR +- within given rectangular area +.TP 8 +\fB-polygon\fI x y x y ...\fR +- within polygon, given by set of coordinate pairs +.TP 8 +\fB-radius\fI distance x y ...\fR +within given distance of any of given points. +.TP 8 +\fB-mask\fI rasterObject list\fR +in areas where value of another rasterObject is in given list. + +.TP 4 +\fIrasterName \fBdelete\fR +- destroys raster object. If raster was in readwrite mode, all unsaved changes +are lost. +.TP 4 +\fIrasterName \fBextents\fI value\fR +- returns list of four coordinates, within those all values of given class +are contained. +.TP 4 +\fIrasterName \fBfilename\fR +- returns name of file, corresponding to this raster object. +.TP 4 +\fIrasterName \fBfill\fI value x y \fR?\fB-stop\fR?\fI value\fR +- fills area, starting with given coordinates with value. By default, +stops on encounter of any value other than in given point. If \fB-stop\fR +option is specified, stops only when encountering given value. Returns +list of coordinates, specifying actually affected region. +.TP 4 +\fIrasterName \fBframe\fI value x1 y1 x2 y2\fR ?\fB-width\fI cells\fR? +- a rectangle with given value, not changing inside area. By default +this rectangle is 1 cell wide. +.TP 4 +\fIrasterName \fBget\fI x y \fR?\fB-base\fR? +Returns value of raster in given point. By default returns reclassed value, +but if \fB-base\fR is specified, returns class of raster file. +.TP 4 +\fIrasterName \fBlimits\fR +Returns list of four doubles, specifying physical limits of raster file, in +order \fIXLeft\fR, \fIYBottom\fR, \fIXRight\fR, \fIYTop\fR. +.TP 4 +\fIrasterName \fBline\fI value x y x y .... \fR?\fB-width \fIcells\fR? +draws a line with given value. By default one-cell wide. Returns boundaries +of region affected. +.TP 4 +\fIrasterName \fBload\fR +Loads raster file into memory, changing it from readonly to readwrite mode, +and enabling all editing operation. (\fB-new\fR option of \fBraster\fR command +performs \fBload\fR implicitely). +.TP 4 +\fIrasterName \fBmax\fR +-returns maximal value of raster object. +.TP 4 +\fIrasterName \fBmin\fR +- returns minimal value of raster object. +.TP 4 +\fIrasterName \fBoffsite\fR ?\fIvalue\fR? +- returns offsite value for raster object, or modifies it. +.TP 4 +\fIrasterName \fBpolygon\fI value x y x y ...\fR +- fills given polygon of given value. Returns boundaries of region affected. +.TP 4 +\fIrasterName \fBput\fI value x y\fR +Changes value of individual cell. Returns nothing. +.TP 4 +\fIrasterName \fBreclass\fR ?\fIoption\fR? ?\fIarg\fR? +- manipulates reclass table. Without any options, returns reclass table as +Tcl list. +.TP 8 +\fIrasterName \fBreclass -statements\fR +option returns reclass table in form of reclass statements. (see \fB RECLASS SYNTAX\fR below). +.TP 8 +\fIrasterName \fBreclass -table\fI list\fR +modifies current reclass using given Tcl list. Values for classes given +in this list would be changed as specified, all other remains unchanged. +.TP 8 +\fIrasterName \fBreclass \fIstatements\fR +modifies reclass using specified reclass statements. As \fB-table\fR options, +applies statements to base classes and leaves all nonspecified classes as is. +.TP 8 +\fIrasterName \fBreclass -clear\fR +clears all changes in reclass table and makes reclassed classes equial to +base classes. +.TP 4 +\fIrasterName \fBrow\fI y\fR +return cell number, correspondign to given Y coordinate. Raises error, if +coodinnate is outside file limits. +.TP 4 +\fIrasterName \fBsave\fR ?\fIoptions\fR? +- saves raster file. By default, if raster is in readwrite mode, saves +changes to current filename. +.TP 8 +\fIrasterName \fBsave -as\fI filename\fR +- saves raster, open for editing into other file, and makes this file +current file of this raster object. +.TP 8 +\fB-backup\fR +option can be specified +for both \fBsave\fR and \fBsave -as \fRcommands. It makes raster object to +keep old version of file with suffix \fI.bak\fR appended to name. +.TP 8 +\fIrasterName \fBsave -to\fI filename\fR ?\fB-8bit\fR? +allows to write raster object into raster file. Reclass table is applied +to this operation, so new file would have base classes like classes of +raster object, rather than classes of its base file. + +If \fB-8bit\fR switch is specified, resulting raster will be forced to 8-bit +by discarding high-order byte, even if max value or offsite are outside +0-255 range. (in latter case offsite would be set to 65535). +.TP 4 +\fIrasterName \fBshift \fI dx dy\fR +changes origin of cell (row/column) numbers. This is required for certain +command of DOS version of EPPL7, although fGIS always uses map (alternative) +coordinates) +.TP 4 +\fIrasterName \fBtransect\fR ?\fB-count\fI varname\fR? \fIx y x y ...\fR +by default, return list consisting of pairs {value width} along the given line. +If \fB-count\fR is specified, fills dynamic array \fIvarname\fR, indexed +by classes, by total widthes of given value along this line. +.TP 4 +\fIrasterName \fBunused\fR +returns value which is never encountered in this raster. +.TP 4 +\fIrasterName \fBunit\fR ?\fInew-unit\fR? +- returns (or changes) area unit of this raster Unit can be one of +following: \fBundefined\fR,\fBft\fR.\fBm\fR,\fBkm\fR,\fBmile\fR,\fBha\fR,\fBacre\fR. All subsequent count operations would return result in given units. \fBNote:\fR map coordinates are always in meters. +.TP 4 +\fIrasterName \fBxleft\fR ?\fInew value\fR? +- returns (or modifies) left boundary coordinate.\fBNote:\fR it simply modifies +value, without appropriate changes in other limits or cell area value. +.TP 4 +\fIrasterName \fBxright\fR ?\fInew value\fR? +- returns (or modifies) right boundary coordinate. +.TP 4 +\fIrasterName \fBybottom\fR ?\fInew value\fR? +- returns (or modifies) bottom boundary coordinate. +.TP 4 +\fIrasterName \fBytop\fR ?\fInew value\fR? +- returns (or modifies) left boundary coordinate. +.SH RECLASS SYNTAX + +Syntax of reclass syntax is inherited from EPPL7. General form of reclass +statement is line, terminated by newline (\fBNote:\fR trailing newline is +obligatory), which consist of new value and list of old (base) values. New +value separated from list by equal sign. List of old values can contain +individual values and ranges, which are two values, separated by colon. + +.TP 4 +Example +1=1:10 20 +.PP +means, that all values from one to ten and value 20 should be reclassed into +1. + +Set of statements can contain arbitrary number of lines, same value can occur +on left side of several lines. If some value occur on right side more than +once, last occurence have precedence. diff --git a/man/reclass.1 b/man/reclass.1 new file mode 100644 index 0000000..a07ac59 --- /dev/null +++ b/man/reclass.1 @@ -0,0 +1,92 @@ +.TH RECLASS 1 "Version 1.0" "Environmental planning utilities" "EPU User manual".SH NAME +reclass1 \- Change classes of given EPPL7 data file +.SH SYNOPSIS +.B reclass1 [ +.I-v +] [ +.I-f +reclass_file] [ +.I -o +output_file] file +.SH DESCRIPTION +Applies given set of reclass statements to +.B epp +file. Reclass statements have simular syntax to DOS version of EPPL7 and +may be read from +.I stdin +(both from terminal or pipe) and from file. +.PP +By default, creates file named +.I reclass.out.epp +in current directory, but this behavoir can be overriden by +.I -o +option. +.PP +This version can perform only +.B one-way +reclass. +For multy-file reclass use +.BR intable (1) +instead. +.PP +Output file is created as 16-bit and if after reclass it would contain +only classes less than 255, it would be converted into 8-bit. +.PP +If offsite value of old file appears in right side of any reclass statement, +offsite value of new file would be from left side of this statement. + + + +.SH OPTIONS +.TP 8 +.B --help +\- display brief usage message and exit successifully +.TP 8 +.B --version +\- display version information and exit successifully +.TP 8 +.B -v +\- verbose. Display number of rows processed during reclass. +.TP 8 +.BR -f " reclass_file" +\- read reclass statements from given file, instead of +.B stdin +.TP 8 +.BR -o " output_file" +\- write result into given file, instead of +.B reclass.out.epp. +Suffix .epp would be substituted, if absent. + +.SH RECLASS STATEMENT SYNTAX + +Set of reclass statements consists of zero or more lines, +each of which has following structure: +.PP +new_class +.B = +list of old classes +.PP + +New class is number in range 0-65535. +List of old classes is space separated list of classes (numbers) +and ranges. Range is two numbers, separated by colon. First of them +must be less then second, or this range would have no effect. +.PP +If one old class occurs in several statements, only last occurence +would take effect, so it is possible to write: +.PP +1=1:255 +.PP +2=2 +.PP +3=12 +.PP +to reclass all classes between 1 and 255, exept 2 and 12 to 1 and reclass +12 to 3. + +.SH "SEE ALSO" +.BR eheader (1), cluster (1), rescale (1), outtab (1), intable (1) + +.SH "AUTHOR" + +Victor B. Wagner, SoftWeyr. diff --git a/man/window.1 b/man/window.1 new file mode 100644 index 0000000..2885ea5 --- /dev/null +++ b/man/window.1 @@ -0,0 +1,47 @@ +.TH WINDOW 1 "Version 1.0" "EPU" "EPU user manual" +.SH NAME +window \- cuts a portion of epp file +.SH SYNOPSIS +.B window +[-a%] [-o output_file] input_file fr lr fc lc +.SH DESCRIPTION + +Window creates new +.IR epp -file +with given limits. If new limits exceeds limits of old file, this areas +would be filled by +.I offsite +value. +.PP +By default limits are given in rows/columns, but with +.I -a +option you may use alternate coordinates. +.PP +Output file would always be properly aligned with input. +.SH OPTIONS +.TP 8 +.B --help +displays brief usage information. +.TP 8 +.B --version +displays version number +.TP 8 +.B -% +Displays percentage of processed lines in file. +.TP 8 +.BI -o " file " +gives the name for output file. Defaults to +.I window.out.epp +.TP 8 +.B -a +specifies that limits are given in alternate coordinates. +.SH SEE ALSO +.BR mosaic (1), eheader (1) + +.SH AUTHOR + +Victor B. Wagner + +.SH BUGS + +??? diff --git a/pkgIndex.tcl b/pkgIndex.tcl new file mode 100644 index 0000000..8284669 --- /dev/null +++ b/pkgIndex.tcl @@ -0,0 +1 @@ +package ifneeded Fgis 1.0 "package require Tk; [list load [file join $dir fgis.so] Fgis]" diff --git a/symbols/alpha10.sym b/symbols/alpha10.sym new file mode 100644 index 0000000..2b2cde2 --- /dev/null +++ b/symbols/alpha10.sym @@ -0,0 +1,148 @@ +-10 -10 79/11/07.ALPHANUMERIC NOT MODIFIED WITH TONES + 1 0018003C00660066007E007E006600E700000000 + 2 00FC007E0066007C00660066007E00FC00000000 + 3 003C007E0067006000600067007E003C00000000 + 4 00FC007E0066006600660066007E00FC00000000 + 5 00FE007E0062007800780062007E00FE00000000 + 6 00FE007E0062007800780060006000F000000000 + 7 003C007E00670060006F0066007E003C00000000 + 8 00E700660066007E007E0066006600E700000000 + 9 003C001800180018001800180018003C00000000 + 10 000F00060006000600060066007E003C00000000 + 11 00E70066006C0078007C0066006600E700000000 + 12 00F000600060006000600062007E00FE00000000 + 13 01C700EE00FE00BA00D600C600C601C700000000 + 14 00C700660076007E007E006E006600E300000000 + 15 003C007E0066006600660066007E003C00000000 + 16 00FC007E00660066007E007C006000F000000000 + 17 003C007E006600660066006C007E003600000000 + 18 00FC007E00660066007C007E006600E700000000 + 19 003C007E00620078001E0046007E003C00000000 + 20 00FF00FF00990018001800180018003C00000000 + 21 00E700660066006600660066007E003C00000000 + 22 00E7006600660066003C003C0018001800000000 + 23 01C700C600D600D600FE007C006C006C00000000 + 24 00E700660024001800180024006600E700000000 + 25 00E70066007E003C001800180018003C00000000 + 26 00FE00FE008C00180030006200FE00FE00000000 + 27 0018003C0066006600660066003C001800000000 + 28 0018003800380018001800180018003C00000000 + 29 003C007E00660006003C0060007E007E00000000 + 30 003C007E0066000C000E0066007E003C00000000 + 31 000C001C003C006400E400FC000C001E00000000 + 32 007E007E0060007C00060066007E003C00000000 + 33 003C007E0060007C00660066007E003C00000000 + 34 007E007E0046000C000C000C000C000C00000000 + 35 003C007E0066003C00660066007E003C00000000 + 36 003C007E00660066003E0006007E003C00000000 + 37 000000180018007E007E00180018000000000000 + 38 0000000000000000007E007E0000000000000000 + 39 000000920054003800EE00380054009200000000 + 40 00060006000C0018001800300060006000000000 + 41 000C001C0038003000300038001C000C00000000 + 42 00300038001C000C000C001C0038003000000000 + 43 0008001C002A0028001C000A002A001C00080000 + 44 0000007E007E00000000007E007E000000000000 + 46 00000000000000000000001C0014001C000C0000 + 47 0000000000000000000000000018001800000000 + 48 01FF01FF01FF01FF01FF01FF01FF01FF01FF0000 + 49 007C007C0060006000600060007C007C00000000 + 50 007C007C000C000C000C000C007C007C00000000 + 51 0000001800180000000000180018000000000000 + 52 0004007E007E00080010007E007E002000000000 + 53 00000008000C007E006C00080000000000000000 + 54 000000000000000003FF03FF0000000000000000 + 55 0030003000300030003000300030003000300030 + 56 0008001C003E0008000800080008000000000000 + 57 0008000800080008003E001C0008000000000000 + 58 00000004000C001800300018000C000400000000 + 59 0000002000300018000C00180030002000000000 + 60 0030003000300030003F003F0000000000000000 + 61 003000300030003003F003F00000000000000000 + 62 0000000000000000003F003F0030003000300030 + 63 000000000000000003F003F00030003000300030 + 64 0000000000200050008800440028001000000000 + 65 0000000000780084010201020084007800000000 + 66 0000003000480084010201020084004800300000 + 67 00000030004800B4014A014A00B4004800300000 + 68 0000003000FC00AC01C6018E00D400FC00300000 + 69 000000FC00FC00CC01A6019600CC00FC00FC0000 + 70 000000FC00FC00FC01FE01FE00FC00FC00FC0000 + 71 0000000000100000008000040000002000000000 + 72 0000013200000000013201320000000001320000 + 73 000001FE01FE018601B601B6018601FE01FE0000 + 74 0092016D016D0092016D016D0092016D016D0000 + 75 01FF0000000001FF0000000001FF000000000000 + 76 0000000000440000000000000044000000000000 + 77 01FF01FF018301BB01AB01BB018301FF01FF0000 + 78 01FF01FF0193019301FF0193019301FF01FF0000 + 79 011100AA004400000000011100AA004400000000 + 80 0000000C00E00000000F000000600000001C0000 + 81 01C701C701C700380038003801C701C701C70000 + 82 0018003C0066006600660066003C001800000000 + 83 0000000000000010000000000000000000000000 + 84 0000000000000030004800480030000000000000 + 85 0010000000000028008200280000000000100000 + 86 018300100000003800AA00380000001001830000 + 87 018300100010003800EE00380010001001830000 + 88 019300100000003801FF00380000001001930000 + 89 019301930010003801FF00380010019301930000 + 90 01FF01FF0111013901FF0139011101FF01FF0000 + 91 01FF01FF019301BB01FF01BB019301FF01FF0000 + 92 021F03EF03FF02FF03FE019B03FF03FF02FE01BF + 93 03FF02FD03FF03FF03EF03FF03FF03FF02FD03FF + 94 003F00110011001101FF01FF006000600060007C + 95 0048004800480FFF004800480FFF004800480048 + 96 007800CC01860303023102310303018600CC0078 + 97 00E700A600EC000800100037006500E700000000 + 98 0000000000240000000000240000000000000000 + 99 000000100010003800EE00380010001000000000 +100 0038004400820101010100010082004400380000 +101 0038004400820129010101290082004400380000 +102 003800540082011101AB01110082005400380000 +103 0038004400D601290155012900D6004400380000 +104 0038005400EE015501BB015500EE005400380000 +105 0038007C00FE01FF01FF01FF00FE007C00380000 +106 002C00D200A6004C00D200340030003000780000 +107 00B8007C00F800FC00FE007800B0003000780000 +108 0000000000000000003000300000000000000000 +109 02AA0155015502AA0155015502AA0155015502AA +110 01FF000001FF000001FF000001FF000001FF0000 +111 011100AA004400000000011100AA004400000000 +112 00C1000C00600100001C00C00006017100000000 +113 001000A800C400EE0129012901E9010901FF0000 +114 0000000000440000000000000000000000000000 +115 0101008200440028001000AA01C701EF01C70000 +116 0000008200000028000000280000008200000000 +117 01EF0129012901EF000001EF0129012901EF0000 +118 000002AA00000155000002AA00000155000002AA +119 0092024900920249009202490092024900920249 +120 015502AA015502AA015502AA015502AA015502AA +121 03BB02EE03BB02FE03FB02FE03FB02FE03BB02EE +122 03FF03FF03FF03FF03FF03FF03FF03FF03FF03FF +123 0000010200000000001000000000000001020000 +124 0000000000000020005000A80154000000000000 +125 010000000000000000000000000A000201000000 +126 000000200020002001FE00200020002000200000 +127 0000000000000030007800FC01FE000000000000 +128 0140004000410190000000270002000000400200 +129 00000000000000F800F800F800F800F800000000 +130 000000300030003001FE01FE0030003000300030 +131 0229004A0100000601240025001B011100080002 +132 02010302018600CC00780030007800CC01860303 +133 000001FE01FE003000300030003001FE01FE0000 +134 0053004C034000CB014603040223020202590090 +135 0201013200B4007801FE01FE007800B401320201 +136 00200020002000AA01FE03FE03FE01FC007C007C +137 0293023A00880058037A00EE0382018A00E401A6 +138 01FE02CD034B0387020102010387034B02CD01FE +139 000001FE01FE01FE01CE01CE01FE01FE01FE0000 +140 034A02EB00C103D6013B018C039701E3027A0231 +141 01FE00FD02790333038703CF03870333027900FC +142 03FF03CF03CF03CF0201020103CF03CF03CF03CF +143 01B5019302CF02BD01FC03F7001D03BE034F0361 +144 03FF03FF03FF0307030703070307030703FF03FF +145 03FF03FF0303037B037B037B037B030303FF03FF +146 03EE03DE02BF03BB017F037E021A02FF00F102FF +147 03FF03DF03DF03DF020103DF03DF03DF03DF03FF +148 03FF03FF03FF03DF03AF035702AB03FF03FF03FF diff --git a/symbols/alpha6.sym b/symbols/alpha6.sym new file mode 100644 index 0000000..fdb01e9 --- /dev/null +++ b/symbols/alpha6.sym @@ -0,0 +1,81 @@ +-6 -6 79/11/07.ALPHANUMMERICS (MODIFIED) WITH TONES + 1 00C 012 01E 012 012 000 + 2 01C 012 01C 012 01C 000 + 3 00E 010 010 010 00E 000 + 4 01C 012 012 012 01C 000 + 5 01E 010 01C 010 01E 000 + 6 01E 010 01C 010 010 000 + 7 00E 010 016 012 00E 000 + 8 012 012 01E 012 012 000 + 9 00E 004 004 004 00E 000 + 10 00E 004 004 014 008 000 + 11 012 014 018 014 012 000 + 12 010 010 010 010 01E 000 + 13 011 01B 015 011 011 000 + 14 011 019 015 013 011 000 + 15 00C 012 012 012 00C 000 + 16 01C 012 01C 010 010 000 + 17 00C 012 012 014 00A 000 + 18 01C 012 01C 012 012 000 + 19 00E 010 00C 002 01C 000 + 20 01F 004 004 004 004 000 + 21 012 012 012 012 00C 000 + 22 011 011 011 00A 004 000 + 23 011 011 015 015 00A 000 + 24 011 00A 004 00A 011 000 + 25 011 00A 004 004 004 000 + 26 01F 002 004 008 01F 000 + 27 00E 00A 00A 00A 00E 000 + 28 004 00C 004 004 00E 000 + 29 00C 002 00C 008 00E 000 + 30 00E 002 004 002 00E 000 + 31 00A 00A 00E 002 002 000 + 32 00E 008 00C 002 00C 000 + 33 008 008 00E 00A 00E 000 + 34 00E 002 002 002 002 000 + 35 00E 00A 00E 00A 00E 000 + 36 00E 00A 00E 002 002 000 + 37 004 004 01F 004 004 000 + 38 000 000 01E 000 000 000 + 39 004 00A 004 00A 004 000 + 40 002 002 004 008 008 000 + 41 002 004 004 004 002 000 + 42 008 004 004 004 008 000 + 43 00F 014 00E 005 01E 000 + 44 000 01E 000 01E 000 000 + 46 000 000 000 00C 00C 004 + 47 000 000 000 00C 00C 000 + 48 03F 03F 03F 03F 03F 03F + 49 00E 008 008 008 00E 000 + 50 01C 004 004 004 01C 000 + 51 00C 00C 000 00C 00C 000 + 52 002 01F 004 01F 008 000 + 53 007 007 007 007 007 007 + 54 007 007 00F 00F 007 007 + 55 000 000 004 006 007 007 + 56 004 00E 015 004 004 000 + 57 000 000 000 03F 03F 03F + 58 000 000 000 020 038 03E + 59 038 030 020 000 000 000 + 60 03F 03F 03F 03E 03C 038 + 61 03F 03C 038 030 030 030 + 62 030 030 030 038 03E 03F + 63 020 030 038 03C 03E 03E + 64 00D 013 00A 014 013 000 + 65 00A 00A 00A 00A 000 000 + 66 000 015 00A 000 000 000 + 67 000 003 000 00C 000 000 + 68 011 015 01F 015 011 000 + 69 01F 015 01B 015 01F 000 + 70 000 00A 000 00A 000 000 + 71 01F 011 015 011 01F 000 + 72 01F 01F 01F 01F 01F 000 + 73 000 03F 000 000 03F 000 + 74 012 012 012 012 012 012 + 75 008 010 020 001 002 004 + 76 004 002 001 020 010 008 + 77 03F 03F 03F 03F 03F 03F + 78 02A 015 02A 015 02A 015 + 79 02A 000 015 000 02A 000 + 97 009 002 004 009 000 000 + 98 000 00A 000 00A 000 000 diff --git a/symbols/digit25.sym b/symbols/digit25.sym new file mode 100644 index 0000000..78acbc6 --- /dev/null +++ b/symbols/digit25.sym @@ -0,0 +1,405 @@ +-25 -25 79/11/27. DOUBLE DIGIT NUMBERS IN BOXES + 1 01FFFFFF010000010100000101000001010000010100000101000061010000E1 + 1 010001E1010001E1010000610100006101000061010000610100006101000061 + 1 01000061010001F1010001F10100000101000001010000010100000101000001 + 1 01FFFFFF + 2 01FFFFFF0100000101000001010000010100000101000001010001F9010003FD + 2 0100038D0100030D0100030D0100001D0100003D01000079010001E1010003C1 + 2 01000381010003FD010003FD0100000101000001010000010100000101000001 + 2 01FFFFFF + 3 01FFFFFF0100000101000001010000010100000101000001010001F9010003FD + 3 0100030D0100030D0100001D0100007901000071010000790100001D0100030D + 3 0100030D010003FD010000F90100000101000001010000010100000101000001 + 3 01FFFFFF + 4 01FFFFFF01000001010000010100000101000001010000010100001D0100003D + 4 0100006D010000CD0100018D0100010D010003FD010003FD0100000D0100000D + 4 0100000D0100000D0100000D0100000101000001010000010100000101000001 + 4 01FFFFFF + 5 01FFFFFF0100000101000001010000010100000101000001010003FD010003FD + 5 0100030D0100030101000371010003F90100030D0100000D0100000D0100030D + 5 0100031D010001F9010000F10100000101000001010000010100000101000001 + 5 01FFFFFF + 6 01FFFFFF0100000101000001010000010100000101000001010000F9010001FD + 6 0100038D0100030D0100030101000371010003F90100039D0100030D0100030D + 6 0100030D010003FD010001F90100000101000001010000010100000101000001 + 6 01FFFFFF + 7 01FFFFFF0100000101000001010000010100000101000001010003FD010003FD + 7 0100030D0100001901000019010000310100006101000061010000C1010000C1 + 7 0100018101000181010001810100000101000001010000010100000101000001 + 7 01FFFFFF + 8 01FFFFFF0100000101000001010000010100000101000001010001F9010003FD + 8 0100030D0100030D0100030D010001F9010000F1010001990100030D0100030D + 8 0100030D010003FD010001F90100000101000001010000010100000101000001 + 8 01FFFFFF + 9 01FFFFFF0100000101000001010000010100000101000001010001F9010003FD + 9 0100030D0100030D0100030D0100039D010001FD010000ED0100000D0100000D + 9 0100030D010003F9010001F10100000101000001010000010100000101000001 + 9 01FFFFFF + 10 01FFFFFF0100000101000001010000010100000101000001010300F1010701F9 + 10 010F039D010F030D0103030D0103030D0103030D0103030D0103030D0103030D + 10 0103039D010F81F9010F80F10100000101000001010000010100000101000001 + 10 01FFFFFF + 11 01FFFFFF010000010100000101000001010000010100000101030061010700E1 + 11 010F01E1010F01E1010300610103006101030061010300610103006101030061 + 11 01030061010F81F1010F81F10100000101000001010000010100000101000001 + 11 01FFFFFF + 12 01FFFFFF0100000101000001010000010100000101000001010301F9010703FD + 12 010F038D010F030D0103030D0103001D0103003D01030079010301E1010303C1 + 12 01030381010F83FD010F83FD0100000101000001010000010100000101000001 + 12 01FFFFFF + 13 01FFFFFF0100000101000001010000010100000101000001010301F9010703FD + 13 010F030D010F030D0103001D0103007901030071010300790103001D0103030D + 13 0103030D010F83FD010F80F90100000101000001010000010100000101000001 + 13 01FFFFFF + 14 01FFFFFF01000001010000010100000101000001010000010103001D0107003D + 14 010F006D010F00CD0103018D0103030D010303FD010303FD0103000D0103000D + 14 0103000D010F800D010F800D0100000101000001010000010100000101000001 + 14 01FFFFFF + 15 01FFFFFF0100000101000001010000010100000101000001010303FD010703FD + 15 010F030D010F030101030371010303F90103030D0103000D0103000D0103030D + 15 0103031D010F81F9010F80F10100000101000001010000010100000101000001 + 15 01FFFFFF + 16 01FFFFFF0100000101000001010000010100000101000001010300F9010701FD + 16 010F038D010F030D0103030101030371010303F90103039D0103030D0103030D + 16 0103030D010F83FD010F81F90100000101000001010000010100000101000001 + 16 01FFFFFF + 17 01FFFFFF0100000101000001010000010100000101000001010303FD010703FD + 17 010F030D010F001901030019010300310103006101030061010300C1010300C1 + 17 01030181010F8181010F81810100000101000001010000010100000101000001 + 17 01FFFFFF + 18 01FFFFFF0100000101000001010000010100000101000001010301F9010703FD + 18 010F030D010F030D0103030D010301F9010300F1010301990103030D0103030D + 18 0103030D010F83FD010F81F90100000101000001010000010100000101000001 + 18 01FFFFFF + 19 01FFFFFF0100000101000001010000010100000101000001010301F9010703FD + 19 010F030D010F030D0103030D0103039D010301FD010300ED0103000D0103000D + 19 0103030D010F83F9010F81F10100000101000001010000010100000101000001 + 19 01FFFFFF + 20 01FFFFFF0100000101000001010000010100000101000001010FC0F1011FE1F9 + 20 011C639D0118630D0118630D0100E30D0101E30D0103C30D010F030D011E030D + 20 011C239D011FE1F9011FE0F10100000101000001010000010100000101000001 + 20 01FFFFFF + 21 01FFFFFF0100000101000001010000010100000101000001010FC061011FE0E1 + 21 011C61E1011861E1011860610100E0610101E0610103C061010F0061011E0061 + 21 011C2061011FE1F1011FE1F10100000101000001010000010100000101000001 + 21 01FFFFFF + 22 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 22 011C638D0118630D0118630D0100E01D0101E03D0103C079010F01E1011E03C1 + 22 011C2381011FE3FD011FE3FD0100000101000001010000010100000101000001 + 22 01FFFFFF + 23 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 23 011C630D0118630D0118601D0100E0790101E0710103C079010F001D011E030D + 23 011C230D011FE3FD011FE0F90100000101000001010000010100000101000001 + 23 01FFFFFF + 24 01FFFFFF0100000101000001010000010100000101000001010FC01D011FE03D + 24 011C606D011860CD0118618D0100E30D0101E3FD0103C3FD010F000D011E000D + 24 011C200D011FE00D011FE00D0100000101000001010000010100000101000001 + 24 01FFFFFF + 25 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 25 011C630D01186301011863710100E3F90101E30D0103C00D010F000D011E030D + 25 011C231D011FE1F9011FE0F10100000101000001010000010100000101000001 + 25 01FFFFFF + 26 01FFFFFF0100000101000001010000010100000101000001010FC0F9011FE1FD + 26 011C638D0118630D011863010100E3710101E3F90103C39D010F030D011E030D + 26 011C230D011FE3FD011FE1F90100000101000001010000010100000101000001 + 26 01FFFFFF + 27 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 27 011C630D01186019011860190100E0310101E0610103C061010F00C1011E00C1 + 27 011C2181011FE181011FE1810100000101000001010000010100000101000001 + 27 01FFFFFF + 28 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 28 011C630D0118630D0118630D0100E1F90101E0F10103C199010F030D011E030D + 28 011C230D011FE3FD011FE1F90100000101000001010000010100000101000001 + 28 01FFFFFF + 29 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 29 011C630D0118630D0118630D0100E39D0101E1FD0103C0ED010F000D011E000D + 29 011C230D011FE3F9011FE1F10100000101000001010000010100000101000001 + 29 01FFFFFF + 30 01FFFFFF0100000101000001010000010100000101000001010FC0F1011FE1F9 + 30 0118639D0118630D0100E30D0103C30D0103830D0103C30D0100E30D0118630D + 30 0118639D011FE1F90107C0F10100000101000001010000010100000101000001 + 30 01FFFFFF + 31 01FFFFFF0100000101000001010000010100000101000001010FC061011FE0E1 + 31 011861E1011861E10100E0610103C061010380610103C0610100E06101186061 + 31 01186061011FE1F10107C1F10100000101000001010000010100000101000001 + 31 01FFFFFF + 32 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 32 0118638D0118630D0100E30D0103401D0103803D0103C0790100E1E1011863C1 + 32 01186381011FE3FD0107C3FD0100000101000001010000010100000101000001 + 32 01FFFFFF + 33 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 33 0118630D0118630D0100E01D0103C079010380710103C0790100E01D0118630D + 33 0118630D191FE3FD0107C0F90100000101000001010000010100000101000001 + 33 01FFFFFF + 34 01FFFFFF0100000101000001010000010100000101000001010FC01D011FE03D + 34 0118606D011860CD0100E18D0103C30D010383FD0103C3FD0100E00D0118600D + 34 0118600D011FE00D0107C00D0100000101000001010000010100000101000001 + 34 01FFFFFF + 35 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 35 0118630D011863010100E3710103C3F90103830D0103C00D0100E00D0118630D + 35 0118631D011FE1F90107C0F10100000101000001010000010100000101000001 + 35 01FFFFFF + 36 01FFFFFF0100000101000001010000010100000101000001010FC0F9011FE1FD + 36 0118638D0118630D0100E3010103C371010383F90103C39D0100E30D0118630D + 36 0118630D011FE3FD0107C1F90100000101000001010000010100000101000001 + 36 01FFFFFF + 37 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 37 0118630D011860190100E0190103C031010380610103C0610100E0C1011860C1 + 37 01186181011FE1810107C1810100000101000001010000010100000101000001 + 37 01FFFFFF + 38 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 38 0118630D0118630D0100E30D0103C1F9010380F10103C1990100E30D0118630D + 38 0118630D011FE3FD0107C1F90100000101000001010000010100000101000001 + 38 01FFFFFF + 39 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 39 0118630D0118630D0100E30D0103C39D010381FD0103C0ED0100E00D0118600D + 39 0118630D011FE3F90107C1F10100000101000001010000010100000101000001 + 39 01FFFFFF + 40 01FFFFFF01000001010000010100000101000001010000010100E0F10101E1F9 + 40 0103639D0106630D010C630D0118630D191FE30D011FE30D0100630D0100630D + 40 0100639D010061F9010060F10100000101000001010000010100000101000001 + 40 01FFFFFF + 41 01FFFFFF01000001010000010100000101000001010000010100E0610101E0E1 + 41 010361E1010661E1010C606101186061011FE061011FE0610100606101006061 + 41 01006061010061F1010061F10100000101000001010000010100000101000001 + 41 01FFFFFF + 42 01FFFFFF01000001010000010100000101000001010000010100E1F90101E3FD + 42 0103638D0106630D010C630D0118601D011FE03D011FE079010061E1010063C1 + 42 01006381010063FD010063FD0100000101000001010000010100000101000001 + 42 01FFFFFF + 43 01FFFFFF01000001010000010100000101000001010000010100E1F90101E3FD + 43 0103630D0106630D010C601D01186079011FE071011FE0790100601D0100630D + 43 0100630D010063FD010060F90100000101000001010000010100000101000001 + 43 01FFFFFF + 44 01FFFFFF01000001010000010100000101000001010000010100E01D0101E03D + 44 0103606D010660CD010C618D0118630D011FE3FD011FE3FD0100600D0100600D + 44 0100600D0100600D0100600D0100000101000001010000010100000101000001 + 44 01FFFFFF + 45 01FFFFFF01000001010000010100000101000001010000010100E3FD0101E1FD + 45 0103630D01066301010C6371011863F9011FE30D011FE00D0100600D0100630D + 45 0100631D010061F9010060F10100000101000001010000010100000101000001 + 45 01FFFFFF + 46 01FFFFFF01000001010000010100000101000001010000010100E0F90101E1FD + 46 0103638D0106630D010C630101186371011FE3F9011FE39D0100630D0100630D + 46 0100630D010063FD010061F90100000101000001010000010100000101000001 + 46 01FFFFFF + 47 01FFFFFF01000001010000010100000101000001010000010100E3FD0101E3FD + 47 0103630D01066019010C601901186031011FE061011FE061010060C1010060C1 + 47 0100618101006181010061810100000101000001010000010100000101000001 + 47 01FFFFFF + 48 01FFFFFF01000001010000010100000101000001010000010100E1F90101E3FD + 48 0103630D0106630D010C630D011861F9011FE0F1011FB1990100630D0100630D + 48 0100630D010063FD010061F90100000101000001010000010100000101000001 + 48 01FFFFFF + 49 01FFFFFF01000001010000010100000101000001010000010100E1F90101E3FD + 49 0103630D0106630D010C630D0118639D011FE1FD011FE0ED0100600D0100600D + 49 0100630D010063F9010061F10100000101000001010000010100000101000001 + 49 01FFFFFF + 50 01FFFFFF0100000101000001010000010100000101000001011FE0F1011FE1F9 + 50 0118639D0118030D011B830D011FC30D0118630D0100630D0100630D0118630D + 50 0118E39D010FC1F9010780F10100000101000001010000010100000101000001 + 50 01FFFFFF + 51 01FFFFFF0100000101000001010000010100000101000001011FE061011FE0E1 + 51 011861E1011801E1011B8061011FC06101186061010060610100606101186061 + 51 0118E061010FC1F1010781F10100000101000001010000010100000101000001 + 51 01FFFFFF + 52 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 52 0118638D0118030D011B830D011FC01D0118603D01006079010061E1011863C1 + 52 0118E381010FC3FD010783FD0100000101000001010000010100000101000001 + 52 01FFFFFF + 53 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 53 0118630D0118030D010F801D011FC07901186071010060790100601D0118630D + 53 0118E30D010FC3FD010780F90100000101000001010000010100000101000001 + 53 01FFFFFF + 54 01FFFFFF0100000101000001010000010100000101000001011FE01D011FE03D + 54 0118606D011800CD011B818D011FC30D011863FD010063FD0100600D0118600D + 54 0118E00D010FC00D0107800D0100000101000001010000010100000101000001 + 54 01FFFFFF + 55 01FFFFFF0100000101000001010000010100000101000001011FE3FD011FE3FD + 55 0118630D01180301011B8371011FC3F90118630D0100600D0100600D0118E30D + 55 0118E31D010FC1F9010780F10100000101000001010000010100000101000001 + 55 01FFFFFF + 56 01FFFFFF0100000101000001010000010100000101000001011FE0F9011FE1FD + 56 0118638D0118030D011B8301011FC371011863F90100639D0100630D0118630D + 56 0118E30D010FC3FD010781F90100000001000001010000010100000101000001 + 56 01FFFFFF + 57 01FFFFFF0100000101000001010000010100000101000001011FE3FD011FE3FD + 57 0118630D01180019011B8019011FC0310118606101006061010060C1011860C1 + 57 0118E181010FC181010781810100000101000001010000010100000101000001 + 57 01FFFFFF + 58 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 58 0118630D0118030D011B830D011FC1F9011860F1010061990100630D0118630D + 58 0118E30D010FC3FD010781F90100000101000001010000010100000101000001 + 58 01FFFFFF + 59 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 59 0118630D0118030D011B830D011FC39D011861FD010060ED0100600D0118600D + 59 0118E30D010FC3F9010781F10100000101000001010000010100000101000001 + 59 01FFFFFF + 60 01FFFFFF01000001010000010100000101000001010000010107C0F1010FE1F9 + 60 011C639D0118630D0118030D011B830D011FC30D011CE30D0118630D0118630D + 60 0118639D011FE1F9010FC0F10100000101000001010000010100000101000001 + 60 01FFFFFF + 61 01FFFFFF01000001010000010100000101000001010000010107C061010FE0E1 + 61 011C61E1011861E101180061011B8061011FC061011CE0610118606101186061 + 61 01186061011FE1F1010FC1F10100000101000001010000010100000101000001 + 61 01FFFFFF + 62 01FFFFFF01000001010000010100000101000001010000010107C1F9010FE3FD + 62 011C638D0118630D0118030D011B801D011FC03D011CE079011861E1011863C1 + 62 01186381011FE3FD010FC3FD0100000101000001010000010100000101000001 + 62 01FFFFFF + 63 01FFFFFF01000001010000010100000801000001010000010107C1F9010FE3FD + 63 011C630D0118630D0118001D011B8079011FC071011CE0790118601D0118630D + 63 0118630D011FE3FD010FC0F90100000101000001010000010100000101000001 + 63 01FFFFFF + 64 01FFFFFF01000001010000010100000101000001010000010107C01D010FE03D + 64 011C606D011860CD0118018D010F830D011FC3FD011CE3FD0118600D0118600D + 64 0118600D011FE00D010FC00D0100000101000001010000010100000101000001 + 64 01FFFFFF + 65 01FFFFFF01000001010000010100000101000001010000010107C3FD010FE3FD + 65 011C630D0118630101180371011B83F9011FC30D011CE00D0118600D0118630D + 65 0118631D011FE1F9010FC0F10100000101000001010000010100000101000001 + 65 01FFFFFF + 66 01FFFFFF01000001010000010100000101000001010000010107C0F9010FE1FD + 66 011C638D0118630D01180301011B8371011FC3F9011CE39D0118630D0118630D + 66 0118630D011FE3FD010FC1F90100000101000001010000010100000101000001 + 66 01FFFFFF + 67 01FFFFFF01000001010000010100000101000001010000010107C3FD010FE3FD + 67 011C630D0118601901180019011B8031011FC061011CE061011860C1011860C1 + 67 01186181011FE181010FC1810100000101000001010000010100000101000001 + 67 01FFFFFF + 68 01FFFFFF01000001010000010100000101000001010000010107C1F9010FE3FD + 68 011C630D0118630D0118030D011B81F9011FC0F1011CE1990118630D0118630D + 68 0118630D011FE3FD010FC1F90100000101000001010000010100000101000001 + 68 01FFFFFF + 69 01FFFFFF01000001010000010100000101000001010000010107C1F9010FE3FD + 69 011C630D0118630D0118030D011B839D011FC1FD011CE0ED0118600D0118600D + 69 0118630D011FE3F9010FC1F10100000101000001010000010100000101000001 + 69 01FFFFFF + 70 01FFFFFF0100000101000001010000010100000101000001011FE0F1011FE1F9 + 70 0118639D0100C30D0100C30D0101830D0103030D0103030D0106030D0106030D + 70 010C039D010C01F9010C00F10100000101000001010000010100000101000001 + 70 01FFFFFF + 71 01FFFFFF0100000101000001010000010100000101000001011FE061011FE0E1 + 71 011861E10100C1E10100C0610101806101030061010300610106006101060061 + 71 010C0061010C01F1010C01F10100000101000001010000010100000101000001 + 71 01FFFFFF + 72 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 72 0118638D0100C30D0100C30D0101801D0103003D01030079010601E1010603C1 + 72 010C0381010C03FD010C03FD0100000101000001010000010100000101000001 + 72 01FFFFFF + 73 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 73 0118630D0100C30D0100C01D0101807901030071010300790106001D0106030D + 73 010C030D010C03FD010C00F90100000101000001010000010100000101000001 + 73 01FFFFFF + 74 01FFFFFF0100000101000001010000010100000101000001011FE01D011FE03D + 74 0118606D0100C0CD0100C18D0101830D010303FD010303FD0106000D0106000D + 74 010C000D010C000D010C000D0100000101000001010000010100000101000001 + 74 01FFFFFF + 75 01FFFFFF0100000101000001010000010100000101000001011FE3FD011FE3FD + 75 0118630D0100C3010100C371010183F90103030D0103000D0106000D0106030D + 75 010C031D010C01F9010C00F10100000101000001010000010100000101000001 + 75 01FFFFFF + 76 01FFFFFF0100000101000001010000010100000101000001011FE0F9011FE1FD + 76 0118638D0100C30D0100C30101018371010303F90103039D0106030D0106030D + 76 010C030D010C03FD010C01F90100000101000001010000010100000101000001 + 76 01FFFFFF + 77 01FFFFFF0100000101000001010000010100000101000001011FE3FD011FE3FD + 77 0118630D0100C0190100C019010180310103006101030061010600C1010600C1 + 77 010C0181010C0181010C01810100000101000001010000010100000101000001 + 77 01FFFFFF + 78 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 78 0118630D0100C30D0100C30D010181F9010300F1010301990106030D0106030D + 78 010C030D010C03FD010C01F90100000101000001010000010100000101000001 + 78 01FFFFFF + 79 01FFFFFF0100000101000001010000010100000101000001011FE1F9011FE3FD + 79 0118630D0100C30D0100C30D0101839D010301FD010300ED0106000D0106000D + 79 010C030D010C03F9010C01F10100000101000001010000010100000101000001 + 79 01FFFFFF + 80 01FFFFFF0100000101000001010000010100000101000001010FC0F1011FE1F9 + 80 0118639D0118630D0118630D010FC30D0107830D010CC30D0118630D0118630D + 80 0118639D011FE1F9010FC0F10100000101000001010000010100000101000001 + 80 01FFFFFF + 81 01FFFFFF0100000101000001010000010100000101000001010FC061011FE0E1 + 81 011861E1011861E101186061010FC06101078061010CC0610118606101186061 + 81 01186061011FE1F1010FC1F10100000101000001010000010100000101000001 + 81 01FFFFFF + 82 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 82 0118638D0118630D0118630D010FC01D0107803D010CC079011861E1011863C1 + 82 01186381011FE3FD010FC3FD0100000101000001010000010100000101000001 + 82 01FFFFFF + 83 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 83 0118630D0118630D0118601D010FC07901078071010CC0790118601D0118630D + 83 0118630D011FE3FD010FC0F90100000101000001010000010100000101000001 + 83 01FFFFFF + 84 01FFFFFF0100000101000001010000010100000101000001010FC01D011FE03D + 84 0118606D011860CD0118618D010FC30D010783FD010CC3FD0118600D0118600D + 84 0118600D011FE00D010FC00D0100000101000001010000010100000101000001 + 84 01FFFFFF + 85 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 85 0118630D0118630101186371010FC3F90107830D010CC00D0118600D0118630D + 85 0118631D011FE1F9010FC0F10100000101000001010000010100000101000001 + 85 01FFFFFF + 86 01FFFFFF0100000101000001010000010100000101000001010FC0F9011FE1FD + 86 0118638D0118630D01186301010FC371010783F9010CC39D0118630D0118630D + 86 0118630D011FE3FD010FC1F90100000101000001010000010100000101000001 + 86 01FFFFFF + 87 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 87 0118630D0118601901186019010FC03101078061010CC061011860C1011860C1 + 87 01186181011FE181010FC1810100000101000001010000010100000101000001 + 87 01FFFFFF + 88 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 88 0118630D0118630D0118630D010FC1F9010780F1010CC1990118630D0118630D + 88 0118630D011FE3FD010FC1F90100000101000001010000010100000101000001 + 88 01FFFFFF + 89 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 89 0118630D0118630D0118630D010FC39D010781FD010CC0ED0118600D0118600D + 89 0118630D011FE3F9010FC1F10100000101000001010000010100000101000001 + 89 01FFFFFF + 90 01FFFFFF0100000101000001010000010100000101000001010FC0F1011FE1F9 + 90 0118639D0118630D0118630D011CE30D010FE30D0107630D0100630D0100630D + 90 0118E39D011FC1F9010F80F10100000101000001010000010100000101000001 + 90 01FFFFFF + 91 01FFFFFF0100000101000001010000010100000101000001010FC061011FE0E1 + 91 011861E1011861E101186061011CE061010FE061010760610100606101006061 + 91 0118E061011FC1F1010F81F10100000101000001010000010100000101000001 + 91 01FFFFFF + 92 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FD3FD + 92 0118638D0118630D0118630D011CE01D010FE03D01076079010061E1010063C1 + 92 0118E381011FC3FD010F83FD0100000101000001010000010100000101000001 + 92 01FFFFFF + 93 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 93 0118630D0118330D0118601D011CE079010FE071010760790100601D0100630D + 93 0118E30D011FC3FD010F80F90100000101000001010000010100000101000001 + 93 01FFFFFF + 94 01FFFFFF0100000101000001010000010100000101000001010FC01D011FE03D + 94 0118606D011860CD0118618D011CE30D010FE3FD010763FD0100600D0100600D + 94 0118E00D011FC00D010F800D0100000101000001010000010100000101000001 + 94 01FFFFFF + 95 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 95 0118630D0118630101186371011CE3F9010FE30D0107600D0100600D0100630D + 95 0118E31D011FC1F9010F80F90100000101000001010000010100000101000001 + 95 01FFFFFF + 96 01FFFFFF0100000101000001010000010100000101000001010FC0F9011FE1FD + 96 0118638D0118630D01186301011CE371010FE3F90107639D0100630D0100630D + 96 0118E30D011FC3FD010F81F90100000101000001010000010100000101000001 + 96 01FFFFFF + 97 01FFFFFF0100000101000001010000010100000101000001010FC3FD011FE3FD + 97 0118630D0118601901186019011CE031010FE06101076061010060C1010060C1 + 97 0118E181011FC181010F81810100000101000001010000010100000101000001 + 97 01FFFFFF + 98 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FE3FD + 98 0118630D0118630D0118630D011CE1F9010FE0F1010761990100630D0100630D + 98 0118E30D011FC3FD010F81F90100000101000001010000010100000101000001 + 98 01FFFFFF + 99 01FFFFFF0100000101000001010000010100000101000001010FC1F9011FC3FD + 99 0118630D0118630D0118630D011CE39D010FE1FD010760ED0100600D0100600D + 99 0118E30D011FC3F9010F81F10100000101000001010000010100000101000001 + 99 01FFFFFF +100 0000380000003800000038000000380000003800000038000000380000003800 +100 0000380000003800000038000000380000003800000038000000380000003800 +100 0000380000003800000038000000380000003800000038000000380000003800 +100 00003800 +101 0000000000000000000000000000000000000000000000000000000000000000 +101 0000000000000000000000003FFFFFFF3FFFFFFF3FFFFFFF0000000000000000 +101 0000000000000000000000000000000000000000000000000000000000000000 +101 00000000 diff --git a/symbols/digit6.sym b/symbols/digit6.sym new file mode 100644 index 0000000..b8a5588 --- /dev/null +++ b/symbols/digit6.sym @@ -0,0 +1,22 @@ + -6 -6 79/11/07.OPTICALLY WEIGHTED NUMBERS LIGHT TO DARK + 1 004 004 004 004 004 000 + 2 008 004 008 008 00C 000 + 3 00C 004 008 004 00C 000 + 4 008 00A 00E 002 002 000 + 5 00C 008 00C 002 00E 000 + 6 008 008 00E 00A 00E 000 + 7 00E 006 00C 00C 00C 000 + 8 00E 00A 00E 00A 00C 000 + 9 00E 00A 00E 006 00E 000 + 10 00E 00E 00A 00E 00E 000 + 11 018 01C 01C 01C 01E 000 + 12 01C 01A 01C 01C 01E 000 + 13 01E 01A 01C 01A 01E 000 + 14 01C 01E 01E 01E 01C 000 + 15 01E 01C 01E 01E 01E 000 + 16 01C 01C 01F 01D 01F 000 + 17 01F 01D 01E 01E 01E 000 + 18 01F 01D 01F 01D 01E 000 + 19 01F 01D 01F 01B 01F 000 + 20 01F 01F 01D 01F 01F 000 + 21 01F 01F 01F 01F 01F 000 diff --git a/symbols/fort10.sym b/symbols/fort10.sym new file mode 100644 index 0000000..454c62b --- /dev/null +++ b/symbols/fort10.sym @@ -0,0 +1,12 @@ +-10 -10 79/11/16.FOREST COVER (V23) + 1 001000380038007C007C00FE00FE01FF00380000 + 2 0010001000380054009200380054019300100000 + 3 002C00FE00FE007C00FE00340030003000780000 + 4 002C00D200A6004C00D200340030003000780000 + 5 007C00FE01FF01FF01FF00AA00280028007C0000 + 6 001000A80146010200BC00500010001000380000 + 7 031100AA004400000000031100AA004400000000 + 77 03FF0303028502490231023102490285030303FF + 99 031100AA004400000000031100AA004400000000 +100 03FF03FF03FF03FF03FF03FF03FF03FF03FF03FF + \ No newline at end of file diff --git a/symbols/gray5.sym b/symbols/gray5.sym new file mode 100644 index 0000000..bcf1d01 --- /dev/null +++ b/symbols/gray5.sym @@ -0,0 +1,27 @@ + -5 -5 79/11/07.GRAY SCALE LIGHT TO DARK + 1 000 000 004 000 000 + 2 000 004 000 004 000 + 3 004 000 004 000 004 + 4 000 00A 000 00A 000 + 5 000 00A 004 00A 000 + 6 004 00A 000 00A 004 + 7 004 00A 004 00A 004 + 8 011 004 00A 004 011 + 9 004 00A 015 00A 004 + 10 00A 011 00A 011 00A + 11 011 00A 015 00A 011 + 12 00A 015 00A 015 00A + 13 015 00A 015 00A 015 + 14 00A 015 01B 015 00A + 15 01B 00A 015 00A 01B + 16 01B 015 00A 015 01B + 17 00E 01B 015 01B 00E + 18 01B 015 01B 015 01B + 19 01B 015 01F 015 01B + 20 01F 00E 01B 00E 01F + 21 01F 015 01F 015 01F + 22 01B 01F 01B 01F 01B + 23 01F 01B 01F 01B 01F + 24 01F 01F 01B 01F 01F + 25 01F 01F 01F 01F 01F + 26 00C 012 012 012 00C diff --git a/symbols/luse6.sym b/symbols/luse6.sym new file mode 100644 index 0000000..57bcae3 --- /dev/null +++ b/symbols/luse6.sym @@ -0,0 +1,18 @@ + -6 -6 79/11/07.LAND USE TONES + 7 EXTRA + 1 00D 013 00A 014 013 000 + 2 00A 00A 00A 00A 000 000 + 3 000 015 00A 000 000 000 + 4 000 003 000 00C 000 000 + 5 011 015 01F 015 011 000 + 6 01F 015 01B 015 01F 000 + 7 000 00A 000 00A 000 000 + 8 01F 011 015 011 01F 000 + 9 01F 01F 01F 01F 01F 000 + 10 000 000 004 000 000 000 + 11 000 03F 000 000 03F 000 + 12 012 012 012 012 012 012 + 13 008 010 020 001 002 004 + 14 004 002 001 020 010 008 + 15 03F 03F 03F 03F 03F 03F + 16 02A 015 02A 015 02A 015 + 17 02A 000 015 000 02A 000 diff --git a/symbols/misc14.sym b/symbols/misc14.sym new file mode 100644 index 0000000..d47870d --- /dev/null +++ b/symbols/misc14.sym @@ -0,0 +1,47 @@ + -14 -14 79/11/07.DICOMED SYMBOLS (KENS) + 1 00000000000000000000000000000000000000000000000000000000 + 2 0000000000000000000001E001E001E001E000000000000000000000 + 3 000000000000000000003FFF3FFF3FFF3FFF00000000000000000000 + 4 03F003F003F003F003F003F003F003F003F003F003F003F003F003F0 + 5 000000000FFC0FFC0FFC0FFC0FFC0FFC0FFC0FFC0FFC0FFC00000000 + 6 3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF3FFF + 7 00C000C000C000C000C000C03FFF3FFF00C000C000C000C000C000C0 + 8 01E001E001E001E001E03FFF3FFF3FFF3FFF01E001E001E001E001E0 + 9 3FFF3FFF3FFF380738073807380738073807380738073FFF3FFF3FFF + 10 0007000F001F003E007C00F801F003E007C00F801F003E003C003800 + 11 0000000000D00618040802000130006000C000C00040004000000000 + 12 3FFF3FFF3FFF3FFF3FFF3E1F3E1F3E1F3E1F3FFF3FFF3FFF3FFF3FFF + 13 004000C000E001E001E003F003F007F807F80FFC0040004000400040 + 14 00030007000E001C0038007000E001C0038007000E001C0038003000 + 15 31E331E30E1C0E1C0E1C31E331E331E331E30E1C0E1C0E1C31E331E3 + 16 3FFF3FFF300330033003300330C330C330033003300330033FFF3FFF + 17 3FFF3FFF300330033003300333F333F330033003300330033FFF3FFF + 18 300038001C000E000700038001C000E000700038001C000E00070003 + 19 3F803F803F803F803F803F80007F007F007F007F007F007F007F007F + 20 3F3F3F3F333333333F3F3F3F000000003F3F3F3F333333333F3F3F3F + 21 0000003800383F003F000000003F003F00000F000F00003800380000 + 22 0000000000C001E0033006180C0C0C0C0618033001E000C000000000 + 23 000000C001E0033006180C0C180618060C0C0618033001E000C00000 + 24 00000000000000C000C001E007F807F801E000C000C0000000000000 + 25 07F00FE01FC03F803F013E033C07380F301F203F007F00FE01FC03F8 + 26 0000000000C001E003F007F80FFC0FFC07F803F001E000C000000000 + 27 300338071C0E0E1C073803F00120012003F007380E1C1C0E38073003 + 28 000000C000C000C003F003301E1E1E1E033003F000C000C000C00000 + 29 00000000000007F807F8000000000000000007F807F8000000000000 + 30 000003F003F003F00FFC0FFC0FFC0FFC0FFC0FFC03F003F003F00000 + 31 00000100038006C00C6018300C18060C0306018C00D8007000200000 + 32 0618061806183FFF3FFF06180618061806183FFF3FFF061806180618 + 33 00000000000007F807F8061806180618061807F807F8000000000000 + 34 00001E1E1E1E1E1E1E1E01E001E001E001E01E1E1E1E1E1E1E1E0000 + 35 0018001800380078007800F001E001E003C007800780070006000600 + 36 000000000E1C0E1C0E1C00000000000000000E1C0E1C0E1C00000000 + 37 000001B007200C48088C091C0330074400C800C000C001E003F00000 + 38 00C000C001E003F007F80FFC1FFE00C000C000C000C000C000C00000 + 39 00000000000000C001E003F007F80FFC000000000000000000000000 + 40 00000000000000C000C000C003F003F000C000C000C0000000000000 + 41 06180618061806180618061806180618061806180618061806180618 + 42 000008C009F007E00FE00FFC07FC03F00BE40CC004C000C001E003F0 + 43 00C000C000C000C000C000C000C000C000C000C000C000C000C000C0 + 44 0000000000C000C000C000C000C000C000C000C000C000C000000000 + 46 00000000061806180618061806180618061806180618061800000000 + 47 300338071C0E0E1C073803F001E001E003F007380E1C1C0E38073003 diff --git a/symbols/misc16.sym b/symbols/misc16.sym new file mode 100644 index 0000000..debd1eb --- /dev/null +++ b/symbols/misc16.sym @@ -0,0 +1,236 @@ +-16 -16 16X16 FINAL + 1 0000018003C007E007E00FF00FF01FF81FF83FFC3FFC7FFE7FFE03C003C00000 + 2 000041806186318E318C199819980DB00DB00FF07FFE7FFE000001FE01FE0000 + 3 0000018003C007E00FF01FF83FFC3FFC3FFC3FFC3FFC3FFC3FFC3FFC00000000 + 4 000001801BC01E601C3018183F0C317C314C3F4C304C304C3FFC3FFC00000000 + 5 00000000000000000FF00FF00FF00FF00FF00FF00FF00FF00000000000000000 + 6 00000000000000000000000003C003C003C003C0000000000000000000000000 + 7 00000000018001800180018001803FFC3FFC0180018001800180018000000000 + 8 000000000000C003C003F00F300C3C3C0C300FF003C003C00000000000000000 + 9 00000000300030003C000C000F00030003CC00CC00FC003C00FC00FC00000000 + 10 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 11 0000666666660000000066666666000000006666666600000000666666660000 + 12 00007FFE7FFE000000007FFE7FFE000000007FFE7FFE000000007FFE7FFE0000 + 13 0000000000000000000000003FFC3FFC3FFC3FFC000000000000000000000000 + 14 0842042182104108208410420821841042082104108208418420421021081084 + 15 084314A3A3144308A49418631863A4944308A31414A3084394A46318631894A4 + 16 3333333333333333333333333333333333333333333333333333333333333333 + 17 3333333333333333333333333333333333333333333333333333333333333333 + 18 FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333 + 19 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + 20 4208841008211042208441088210042108421084210842108420084110822104 + 21 630CC6188C31186330C6618CC31886310C6318C6318C6318C6308C6118C33186 + 22 738EE71CCE399C7338E771CEE39CC7398E731CE739CE739CE738CE719CE339C7 + 23 000E001C0038007000E001C0038007000E001C0038007000E000C00180030007 + 24 0180018001800180018001800180FFFFFFFF0180018001800180018001800180 + 25 4208841000000000208441080000000008421084000000008420084100000000 + 26 4208A514000000002084514A00000000084294A40000000084204A5100000000 + 27 4208A514420800002084514A20840000084294A40842000084204A5184200000 + 28 528AA5144208841028A5514A208441088A5214A508421084A5284A5184200841 + 29 738EE71C4208841038E771CE208441088E731CE708421084E738CE7184200841 + 30 FFFFE71C4208FFFFFFFF71CE2084FFFFFFFF9CE70842FFFFFFFFCE718420FFFF + 31 FFFFE71C4208E71CFFFF71CE208471CEFFFF9CE708429CE7FFFFCE718420CE71 + 32 FFFFFFFF4208FFFFFFFFFFFF2084FFFFFFFFFFFF0842FFFFFFFFFFFF0421FFFF + 33 FFFFFFFF4208FFFFFFFFFFFF2084FFFFFFFFFFFF0842FFFFFFFFFFFF0421FFFF + 34 FFFF3333CCCC3333CCCC3333CCCC3333FFFF3333CCCC3333FFFF3333CCCC3333 + 35 FFFF3333FFFF3333CCCC3333FFFF3333FFFF3333FFFF3333FFFF3333FFFF3333 + 36 FFFF3333CCCC3333CCCC3333CCCC3333FFFF3333CCCC3333FFFF3333CCCC3333 + 37 797B3232C4CC0313848423234CCC31307B793232CCC41303B7972323CC4C3031 + 38 797B3232C4CC0313848423234CCC31307B793232CCC41303B7972323CC4C3031 + 39 FFFF3232C4CCFFFF84842323FFFF3130FFFF3232FFFE1303FFFF2323FFFF3031 + 40 ECF33232C4CCFC7F84842323FFFF3130C1E33232FFFE1302FE3F2323FFC73031 + 41 ECF37672E6EEFD7F8C8C6767FFFF3131C9EB7676FFFE1313FEBF6727FFC73131 + 42 ECF7767BE6FEFD7F8CDC67F7FFFF33F1CDEB7F76FFFE3F13FEBFF727FFC7F133 + 43 EEF7F67BEEFFFD7FACDC67FFFFFF33F5CDEB7FF6FFFE3F53FEBFFF67FFC7F533 + 44 FFFFF67BEEFFFD7FACDC67FFFFFF33F5CDEB7FF6FFFEFFFFFEBFFF67FFC7F533 + 45 FFFFF67BEEFFFD7FECDC67FFFFFFFFFFCDEB7FF6FFFEFFFFFEBFFFFFFFFFF533 + 46 000007C00FE01FF03FF83FF81FF00FE00380038003800380038007C000000000 + 47 00000000000007801F80070001000100017801FC00F800700020002000600000 + 48 00000000618073807F806D8061806180000001FC01FC0180018001FC01FC0000 + 49 00000000618073807F806D8061806180000001FC018C018C01FC018C018C01FC + 50 000000003FE03FE0070007000700070007000700000000000000000000000000 + 51 0000000000001F80100010001F80008000801F800000007C00400040007C0000 + 52 000000003F002000200020003F000000000003F8004000400040004000400000 + 53 000000003E00220022003E0028002400220001F00110011001F0014001200110 + 54 000000000000FFFFFFFFFFFFFFFFCCE6FFFFFFFFFFFFFFFF0000000000000000 + 55 000000000000FFFFFFFFFFFFFFFFCCE6FFFFFFFFFFFFFFFF0000000000000000 + 56 0000000021020000000000002102000000000000208400000000000020840000 + 57 4208000000000000208400000000000008420000000000000000000000000000 + 58 C0030000000000000000000003C003C003C003C000000000000000000000C003 + 59 80010000000000000000000003C003C003C003C0000000000000000000008001 + 60 0000000000000FF00FF00C000C000FF00FF0003000300FF00FF0000000000000 + 61 00003F8004000400058005000580000000FE0010001000100016001400160000 + 62 00000E001F003F801F000E0004000438047C043804100E380000000000000000 + 63 000000000400061006180618041804100510069014942C1A24100E3800000000 + 64 300030002600261824D824D0649024907490059014942DDA04100E3800000000 + 65 300030002600261824D824D0249064902490359024942CD824907FFC52240000 + 66 0000000000000000200024D0249064902490359024942CD824907FFC52240000 + 67 0000038003800380011001280148018023225555898801000100010003800000 + 68 000007C001002AA81550010001000100012001500190011001001FF800000000 + 69 00000000202024202420242022201240114011401150095029507FF800001FF0 + 70 00000000100038007C00FE0010001020107010F8102010F87C00000000000000 + 71 000000000300C103C103F38F300C3C3C0C300FF003C003C00000000000000000 + 72 000001C00040C083C103F1CF300C3C3C0C300FF003C003C00000000000000000 + 73 000001C00040C1C3C043F1CF300C3C3C0C300FF003C003C00000000000000000 + 74 000001400140C1C3C043F04F300C3C3C0C300FF003C003C00000000000000000 + 75 000001C00100C1C3C043F1CF300C3C3C0C300FF003C003C00000000000000000 + 76 000001C00100C1C3C143F1CF300C3C3C0C300FF003C003C00000000000000000 + 77 000001C00040C083C083F10F300C3C3C0C300FF003C003C00000000000000000 + 78 000001C00140C1C3C143F1CF300C3C3C0C300FF003C003C00000000000000000 + 79 000001C00140C1C3C043F1CF300C3C3C0C300FF003C003C00000000000000000 + 80 0000666666660000000066666666000000006666666600000000666666660000 + 81 000001801BC01E601C3018183F0C317C314C3F4C304C304C3FFC3FFC00000000 + 82 FFFF2448FFFF244824482448FFFF2448FFFF24482448FFFF2448FFFF24482448 + 83 FFFF2549FFFF2549FFFF2549FFFF2549FFFF25492549FFFF2549FFFF25492549 + 84 00000000231013200B4007803CF807800B401320231003000000000000000000 + 85 00004210222012400A8007007FF807000A801240222042100000000000000000 + 86 00000000102038707CF83870102000000000102038707CF83870102000000000 + 87 FFFF3333CCCC3333CCCC3333CCCC3333FFFF3333CCCC3333FFFF3333CCCC3333 + 88 FFFF3333FFFF3333CCCC3333FFFF3333FFFF3333FFFF3333FFFF3333FFFF3333 + 89 738EE71CCE399C7338E771CEE39CC7398E731CE739CE739CE738CE719CE339C7 + 90 FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333 + 91 3333333333333333333333333333333333333333333333333333333333333333 + 92 0000249200002492000024920000249200002492000024920000249200002492 + 93 00007FFE7FFE000000007FFE7FFE000000007FFE7FFE000000007FFE7FFE0000 + 94 0000000000000000000000003FFC3FFC3FFC3FFC000000000000000000000000 + 95 0000000022221414080814142222000022221414080814142222000000000000 + 96 00000000300030003C000C000F00030003CC00CC00FC003C00FC00FC00000000 + 97 AAAA000055550000AAAA000055550000AAAA000055550000AAAA000055550000 + 98 0000000010202850448828501020000000001020285044882850102000000000 + 99 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +100 B6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DB +101 B6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB +102 7BDF7BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF0000 +103 7BDF4A594A597BDF7BDF00007BDF4A594A597BDF00007BDF4A594A597BDF0000 +104 7BDF4A514A514A517BDF00007BDF4A514A517BDF00007BDF4A514A517BDF0000 +105 7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7F7F7F7F7F7F7F7F7F7F7F7F0000 +106 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +107 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +108 7F7F41415D5D5D5D5D5D41417F7F00007F7F41415D5D5D5D5D5D41417F7F0000 +109 7F7F41415D5D55555D5D41417F7F00007F7F41415D5D55555D5D41417F7F0000 +110 BEBE41415D5D55555D5D4141BEBE8080BEBE41415D5D55555D5D4141BEBE8080 +111 A2A241411C1C14141C1C4141A2A28080A2A241411C1C14141C1C4141A2A28080 +112 A2A241410808141408084141A2A28080A2A241410808141408084141A2A28080 +113 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +114 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +115 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +116 FFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAA +117 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +118 7577AEEEDD5DABBB7757EAEEDDD5BABB7775EEAE5DDDBBAB5777EEEAD5DDBBBA +119 6167A6E6C95989B936566A6E9D949A996761E6A659C9B98956366E6A949D999A +120 EEEE5555BBBB5555EEEE5555BBBB5555EEEE5555BBBB5555EEEE5555BBBB5555 +121 084314A3A3144308A49418631863A4944308A31414A3084394A46318631894A4 +122 0000000021020000000000002102000000000000208400000000000020840000 +123 4208841008211042208441088210042108421084210842108420084110822104 +124 7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7F7F7F7F7F7F7F7F7F7F7F7F0000 +125 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +126 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +127 7F7F41415D5D5D5D5D5D41417F7F00007F7F41415D5D5D5D5D5D41417F7F0000 +128 7F7F41415D5D55555D5D41417F7F00007F7F41415D5D55555D5D41417F7F0000 +129 BEBE41415D5D55555D5D4141BEBE8080BEBE41415D5D55555D5D4141BEBE8080 +130 A2A241411C1C14141C1C4141A2A28080A2A241411C1C14141C1C4141A2A28080 +131 A2A241410808141408084141A2A28080A2A241410808141408084141A2A28080 +132 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +133 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +134 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +135 FFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAA +136 0000666666660000000066666666000000006666666600000000666666660000 +137 000001801BC01E601C3018183F0C317C314C3F4C304C304C3FFC3FFC00000000 +138 FFFF2448FFFF244824482448FFFF2448FFFF24482448FFFF2448FFFF24482448 +139 FFFF2549FFFF2549FFFF2549FFFF2549FFFF25492549FFFF2549FFFF25492549 +140 00000000231013200B4007803CF807800B401320231003000000000000000000 +141 00004210222012400A8007007FF807000A801240222042100000000000000000 +142 00000000102038707CF83870102000000000102038707CF83870102000000000 +143 FFFF3333CCCC3333CCCC3333CCCC3333FFFF3333CCCC3333FFFF3333CCCC3333 +144 FFFF3333FFFF3333CCCC3333FFFF3333FFFF3333FFFF3333FFFF3333FFFF3333 +145 738EE71CCE399C7338E771CEE39CC7398E731CE739CE739CE738CE719CE339C7 +146 FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333 +147 3333333333333333333333333333333333333333333333333333333333333333 +148 0000249200002492000024920000249200002492000024920000249200002492 +149 00007FFE7FFE000000007FFE7FFE000000007FFE7FFE000000007FFE7FFE0000 +150 0000000000000000000000003FFC3FFC3FFC3FFC000000000000000000000000 +151 0000000022221414080814142222000022221414080814142222000000000000 +152 00000000300030003C000C000F00030003CC00CC00FC003C00FC00FC00000000 +153 AAAA000055550000AAAA000055550000AAAA000055550000AAAA000055550000 +154 0000000010202850448828501020000000001020285044882850102000000000 +155 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +156 B6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DB +157 B6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB +158 7BDF7BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF0000 +159 7BDF4A594A597BDF7BDF00007BDF4A594A597BDF00007BDF4A594A597BDF0000 +160 7BDF4A514A514A517BDF00007BDF4A514A517BDF00007BDF4A514A517BDF0000 +161 7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7F7F7F7F7F7F7F7F7F7F7F7F0000 +162 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +163 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +164 7F7F41415D5D5D5D5D5D41417F7F00007F7F41415D5D5D5D5D5D41417F7F0000 +165 7F7F41415D5D55555D5D41417F7F00007F7F41415D5D55555D5D41417F7F0000 +166 BEBE41415D5D55555D5D4141BEBE8080BEBE41415D5D55555D5D4141BEBE8080 +167 A2A241411C1C14141C1C4141A2A28080A2A241411C1C14141C1C4141A2A28080 +168 A2A241410808141408084141A2A28080A2A241410808141408084141A2A28080 +169 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +170 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +171 FFFF00000000FFFF00000000FFFF00000000FFFF00000000FFFF000000000000 +172 8924124924924924924824914922924424894912922424494892912422484490 +173 A9A592496CB3ED34D24A2D95DDA2DA45A5A95B92BB6C34ED4AD2952DA2DC45DB +174 FFFF0000000000000000FFFF0000000000000000FFFF00000000000000000000 +175 FFFF8420842084208420FFFF8420842084208420FFFF84208420842084208420 +176 FFFFA524A524A524A524FFFFA524A524A524A524FFFFA524A524A524A524A524 +177 8220411020881044082204118208410420821041882044102208110408820441 +178 8210042108421084210842108420084110822104420884100821104220844108 +179 8290446128621094290846148622094190826144622894100829144622864109 +180 829044612862109429084694B622094990926144622994900929144622864909 +181 8001400220041008081004200240018001800240042008101008200440028001 +182 9009481224241248899044212242118411882244442289911248242448129009 +183 90094992242412488990442122425184518A2244442289911248242449929009 +184 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +185 7577AEEEDD5DABBB7757EAEEDDD5BABB7775EEAE5DDDBBAB5777EEEAD5DDBBBA +186 6167A6E6C95989B936566A6E9D949A996761E6A659C9B98956366E6A949D999A +187 EEEE5555BBBB5555EEEE5555BBBB5555EEEE5555BBBB5555EEEE5555BBBB5555 +188 084314A3A3144308A49418631863A4944308A31414A3084394A46318631894A4 +189 0000000021020000000000002102000000000000208400000000000020840000 +190 4208841008211042208441088210042108421084210842108420084110822104 +191 0000018003C007E007E00FF00FF01FF81FF83FFC3FFC7FFE7FFE03C003C00000 +192 000041806186318E318C199819980DB00DB00FF07FFE7FFE000001FE01FE0000 +193 000E001C0038007000E001C0038007000E001C0038007000E000C00180030007 +194 0180018001800180018001800180FFFFFFFF0180018001800180018001800180 +195 000007C00FE01FF03FF83FF81FF00FE00380038003800380038007C000000000 +196 00000000202024202420242022201240114011401150095029507FF800001FF0 +197 00000000018001800180018001803FFC3FFC0180018001800180018000000000 +198 0000666666660000000066666666000000006666666600000000666666660000 +199 000001801BC01E601C3018183F0C317C314C3F4C304C304C3FFC3FFC00000000 +200 FFFF2448FFFF244824482448FFFF2448FFFF24482448FFFF2448FFFF24482448 +201 FFFF2549FFFF2549FFFF2549FFFF2549FFFF25492549FFFF2549FFFF25492549 +202 00000000231013200B4007803CF807800B401320231003000000000000000000 +203 00004210222012400A8007007FF807000A801240222042100000000000000000 +204 00000000102038707CF83870102000000000102038707CF83870102000000000 +205 FFFF3333CCCC3333CCCC3333CCCC3333FFFF3333CCCC3333FFFF3333CCCC3333 +206 FFFF3333FFFF3333CCCC3333FFFF3333FFFF3333FFFF3333FFFF3333FFFF3333 +207 738EE71CCE399C7338E771CEE39CC7398E731CE739CE739CE738CE719CE339C7 +208 FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333FFFFFFFF33333333 +209 3333333333333333333333333333333333333333333333333333333333333333 +210 0000249200002492000024920000249200002492000024920000249200002492 +211 00007FFE7FFE000000007FFE7FFE000000007FFE7FFE000000007FFE7FFE0000 +212 0000000000000000000000003FFC3FFC3FFC3FFC000000000000000000000000 +213 0000000022221414080814142222000022221414080814142222000000000000 +214 00000000300030003C000C000F00030003CC00CC00FC003C00FC00FC00000000 +215 AAAA000055550000AAAA000055550000AAAA000055550000AAAA000055550000 +216 0000000010202850448828501020000000001020285044882850102000000000 +217 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +218 B6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DBB6DB +219 B6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB0000B6DBB6DB +220 7BDF7BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF00007BDF7BDF7BDF7BDF0000 +221 7BDF4A594A597BDF7BDF00007BDF4A594A597BDF00007BDF4A594A597BDF0000 +222 7BDF4A514A514A517BDF00007BDF4A514A517BDF00007BDF4A514A517BDF0000 +223 7F7F7F7F7F7F7F7F7F7F7F7F7F7F00007F7F7F7F7F7F7F7F7F7F7F7F7F7F0000 +224 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +225 7F7F414141414141414141417F7F00007F7F414141414141414141417F7F0000 +226 7F7F41415D5D5D5D5D5D41417F7F00007F7F41415D5D5D5D5D5D41417F7F0000 +227 7F7F41415D5D55555D5D41417F7F00007F7F41415D5D55555D5D41417F7F0000 +228 BEBE41415D5D55555D5D4141BEBE8080BEBE41415D5D55555D5D4141BEBE8080 +229 A2A241411C1C14141C1C4141A2A28080A2A241411C1C14141C1C4141A2A28080 +230 A2A241410808141408084141A2A28080A2A241410808141408084141A2A28080 +231 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +232 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +233 FFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAAFFFFAAAAAAAAAAAA +234 FFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAAFFFFAAAA + \ No newline at end of file diff --git a/symbols/misc25.sym b/symbols/misc25.sym new file mode 100644 index 0000000..eb7c4c3 --- /dev/null +++ b/symbols/misc25.sym @@ -0,0 +1,661 @@ + -25 -25 79/11/07.92 TONES ALPHANUMERICS AND PICTURES + 1 00003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C00 + 1 00003C0000003C0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00003C0000003C00 + 1 00003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C00 + 1 00000000 + 2 00181818001818180018181800FFFFFF00FFFFFF001818180018181800181818 + 2 00181818001818180018181800FFFFFF00FFFFFF001818180018181800181818 + 2 00181818001818180018181800FFFFFF00FFFFFF001818180018181800181818 + 2 00000000 + 3 000618600006186000061860000618600006186000FFFFFF00FFFFFF00061860 + 3 00061860000618600006186000FFFFFF00FFFFFF000618600006186000061860 + 3 0006186000FFFFFF00FFFFFF0006186000061860000618600006186000061860 + 3 00000000 + 4 0007C3E00007C3E00007C3E00007C3E00007C3E000FFFFFF00FFFFFF00FFFFFF + 4 00FFFFFF00FFFFFF0007C3E00007C3E00007C3E00007C3E000FFFFFF00FFFFFF + 4 00FFFFFF00FFFFFF00FFFFFF0007C3E00007C3E00007C3E00007C3E00007C3E0 + 4 00000000 + 5 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 5 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 5 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 5 00000000 + 6 0018181800181818001818180018181800181818001818180018181800181818 + 6 0018181800181818001818180018181800181818001818180018181800181818 + 6 0018181800181818001818180018181800181818001818180018181800181818 + 6 00000000 + 7 00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00000000 + 7 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 7 0000000000FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF + 7 00000000 + 8 0086186100861861008618610086186100861861008618610086186100861861 + 8 0086186100861861008618610086186100861861008618610086186100861861 + 8 0086186100861861008618610086186100861861008618610086186100861861 + 8 00000000 + 9 00E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C387 + 9 00E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C387 + 9 00E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C38700E1C387 + 9 00000000 + 10 00FFFFFF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF + 10 00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF + 10 00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF + 10 00000000 + 11 00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D + 11 00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D + 11 00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D00B6DB6D + 11 00000000 + 12 00CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF3 + 12 00CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF3 + 12 00CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF300CF3CF3 + 12 00000000 + 13 0000000000000000000000000000000000000000000000000000000000000000 + 13 000000000000000000003C0000003C0000003C0000003C000000000000000000 + 13 0000000000000000000000000000000000000000000000000000000000000000 + 13 00000000 + 14 0000000000000000000000000000000000000000000000000000000000000000 + 14 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 14 0000000000000000000000000000000000000000000000000000000000000000 + 14 00000000 + 15 00000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FFFF0 + 15 000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0 + 15 000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000000 + 15 00000000 + 16 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 16 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 16 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 16 00000000 + 17 00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF + 17 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 17 00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF + 17 00000000 + 18 00F07C1F00F07C1F00F07C1F00F07C1F00F07C1F000F83E0000F83E0000F83E0 + 18 000F83E0000F83E000F07C1F00F07C1F00F07C1F00F07C1F00F07C1F000F83E0 + 18 000F83E0000F83E0000F83E0000F83E000F07C1F00F07C1F00F07C1F00F07C1F + 18 00000000 + 19 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 19 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 19 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 19 00000000 + 20 00E0000000E000000078000000780000001E0000001E00000007800000078000 + 20 0001E0000001E000000078000000780000001E0000001E000000078000000780 + 20 000001E0000001E000000078000000780000001E0000001E0000000700000007 + 20 00000000 + 21 00F0000000F0000000F0000000F0000000F00000000F8000000F8000000F8000 + 21 000F8000000F800000007C0000007C0000007C0000007C0000007C00000003E0 + 21 000003E0000003E0000003E0000003E00000001F0000001F0000001F0000001F + 21 00000000 + 22 0080200800401004002008020010040100080200000401000002008000010040 + 22 0000802000004010008020080040100400200802001004010008020000040100 + 22 0002008000010040000080200000401000802008004010040020080200100401 + 22 00000000 + 23 00C00C0000E00E000070070000380380001C01C0000E00E00007007000038038 + 23 0001C01C0000E00E000070070080380300C01C0100E00E000070070000380380 + 23 001C01C0000E00E000070070000380380001C01C0000E00E0000700700003003 + 23 00000000 + 24 0080C06000C06030006030180030180C00180C06000C06030006030100030180 + 24 000180C00000C0600080603000C030180060180C00300C0600180603000C0301 + 24 00060180000300C0000180600080C03000C060180060300C0030180600180C03 + 24 00000000 + 25 00E00E0000E00E0000E00E00001C01C0001C01C0001C01C00003803800038038 + 25 0003803800007007000070070000700700E00E0000E00E0000E00E00001C01C0 + 25 001C01C0001C01C0000380380003803800038038000070070000700700007007 + 25 00000000 + 26 00C30C3000C30C300030C30C0030C30C000C30C3000C30C300C30C3000C30C30 + 26 0030C30C0030C30C000C30C3000C30C300C30C3000C30C300030C30C0030C30C + 26 000C30C3000C30C300C30C3000C30C300030C30C0030C30C000C30C3000C30C3 + 26 00000000 + 27 000000000000000F000000FF00000FFF0000FFFF000FFFF000FFFF0000FFF000 + 27 00FF000000F00000000000000000000000000000000000000000000F000000FF + 27 00000FFF0000FFFF000FFFF000FFFF0000FFF00000FF000000F0000000000000 + 27 00000000 + 28 00C0000300C000030030000C0030000C000C0030000C0030000300C0000300C0 + 28 0000C3000000C30000003C0000003C0000003C0000003C000000C3000000C300 + 28 000300C0000300C0000C0030000C00300030000C0030000C00C0000300C00003 + 28 00000000 + 29 00E0000700E0000700E00007001C0038001C0038001C0038000381C0000381C0 + 29 000381C000007E0000007E0000007E0000007E0000007E0000007E00000381C0 + 29 000381C0000381C0001C0038001C0038001C003800E0000700E0000700E00007 + 29 00000000 + 30 0080000600C0000E00E0001C00700038001C0038000E0070000700E0000381C0 + 30 0001C3800000E70000007E0000003C0000003C0000007E000000E7000001C380 + 30 000381C0000700E0000E0070001C00380038001C0070000E00E0000700C00003 + 30 00000000 + 31 00E0000700E000070078001E0078001E001E0078001E0078000781E0000781E0 + 31 0001E7800001E78000007E0000007E0000007E0000007E000001E7800001E780 + 31 000781E0000781E0001E0078001E00780078001E0078001E00E0000700E00007 + 31 00000000 + 32 00F0001F00F0001F00F0001F00F0001F00F0001F000F83E0000F83E0000F83E0 + 32 000F83E0000F83E000007C0000007C0000007C0000007C0000007C00000F83E0 + 32 000F83E0000F83E0000F83E0000F83E000F0001F00F0001F00F0001F00F0001F + 32 00000000 + 33 00C0180300E018070070180E0038181C001C1838000E1870000718E0000399C0 + 33 0001C3800000E70000007E0000FF3CFF00FF3CFF00007E000000E7000001C380 + 33 000399C0000718E0000E1870001C18380038181C0070180E00E0180700C01803 + 33 00000000 + 34 00F0000F00F0000F0078001E0078001E003C003C003C003C001E0078001E0078 + 34 000F00F0000F00F00007FFE00007FFE00007FFE00007FFE0000F00F0000F00F0 + 34 001E0078001E0078003C003C003C003C0078001E0078001E00F0000F00F0000F + 34 00000000 + 35 009024090060180600601806009024090008421000048120000300C0000300C0 + 35 0004812000084210009024090060180600601806009024090008421000048120 + 35 000300C0000300C0000481200008421000902409006018060060180600902409 + 35 00000000 + 36 00C03C0300C03C030030C30C0030C30C000F00F0000F00F0000F00F0000F00F0 + 36 0030C30C0030C30C00C03C0300C03C0300C03C0300C03C030030C30C0030C30C + 36 000F00F0000F00F0000F00F0000F00F00030C30C0030C30C00C03C0300C03C03 + 36 00000000 + 37 0099CCE6003399CC0067379900CE6733009CCE6700399CCE0073399C0099CCE6 + 37 00CCE67300E673390073399C00399CCE009CCE6700CE673300E6733900CCE673 + 37 0099CCE6003399CC0067339900673399003399CC00673399003399CC0099CCE6 + 37 00000000 + 38 0018C3180031818C006318C600C63C63008C66310018C3180031818C006318C6 + 38 00C63C63008C66310018C3180031818C006318C600C63C63008C66310018C318 + 38 0031818C006318C600C63C63008C66310018C3180031818C006318C600C63C63 + 38 00000000 + 39 00C63C63006318C60031818C0018C318008C663100C63C63006318C60031818C + 39 0018C318008C663100C63C63006318C6006318C600C63C63008C66310018C318 + 39 0031818C006318C600C63C63008C66310018C3180031818C006318C600C63C63 + 39 00000000 + 40 00003C0000003C000000C3000000C300000300C0000300C0000C0030000C0030 + 40 0030000C0030000C00C0000300C0000300C0000300C000030030000C0030000C + 40 000C0030000C0030000300C0000300C00000C3000000C30000003C0000003C00 + 40 00000000 + 41 0000180000003C0000003C0000007E0000007E000000FF000000FF000001FF80 + 41 0001FF800003FFC00003FFC00007FFE00007FFE0000FFFF0000FFFF0001FFFF8 + 41 001FFFF8003FFFFC003FFFFC007FFFFE007FFFFE000FFFF0000FFFF0000FFFF0 + 41 00000000 + 42 00FFFFFF00FFFFFF00FFFFFF00FFBDFF00FFBDFF00FF3CFF00FF7EFF00FE7E7F + 42 00FE7E7F00FCFF3F00FCFF3F00F8FF1F00F9FF9F00F1FF8F00F1FF8F00E3FFC7 + 42 00E3FFC700C3FFC300C7FFE30087FFE10087FFE100FFFFFF00FFFFFF00FFFFFF + 42 00000000 + 43 01FFFFFF01000001010000010100000101000001010000010100000101000001 + 43 0100000101000001010000010100000101000001010000010100000101000001 + 43 0100000101000001010000010100000101000001010000010100000101000001 + 43 01FFFFFF + 44 000000000060180600601806000000000000000000000000000300C0000300C0 + 44 0000000000000000000000000060180600601806000000000000000000000000 + 44 000300C0000300C0000000000000000000000000006018060060180600000000 + 44 00000000 + 45 0000000000C30C3000C30C300000000000186186001861860000000000C30C30 + 45 00C30C300000000000186186001861860000000000C30C3000C30C3000000000 + 45 00186186001861860000000000C30C3000C30C30000000000018618600186186 + 45 00000000 + 46 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 46 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 46 00CCCCCC00CCCCCC003333330033333300CCCCCC00CCCCCC0033333300333333 + 46 00000000 + 47 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 47 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 47 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 47 00000000 + 48 00000000000018000000180000C018060060180C003018180018183800181870 + 48 000C1870000C18E0000638E0000638E0000339C0000339C0000339C00001BB80 + 48 0001BB800001BB80003FFFF8003FFFF8000000000000000000000FFE00000FFE + 48 00000000 + 49 00000000000010000000380000007C000000FE000001FF000003FF800007FFC0 + 49 000FFFE0001FFFF0003FFFF8007FFFFC0080000200FFFFFE00FFFFFE00FFFFFE + 49 00FFF1FE00C631C600C631C600FFF1FE00FFF1FE00FFF1FE00FFF1FE00000000 + 49 00000000 + 50 00000000000010000000380000007C000000FE000001FF000003FF800007FFC0 + 50 000FFFE0001FFFF0003FFFF8007FFFFC00FFFFFE00FFFFFE00FFFFFE00FFFFFE + 50 00FFFFFE00FFFFFE00FFFFFE00FFFFFE00FFFFFE00FFFFFE00FFFFFE00000000 + 50 00000000 + 51 00EEEEEE00777777007BBBBB00EEEEEE00777777007BBBFB00EEFFBE007777F7 + 51 007BBFFB00EEEFFE00777FF7007BBFFB00EEFFFE00777FF7007BBFFB00EEEFFE + 51 007777F7007BBBFB00EEEFFE007777F7007BBBFB00EEEEEE00777777007BBBBB + 51 00000000 + 52 0000180000003C0000003C0000007E0000007E000000FF000000FF000001FF80 + 52 0001FF800003FFC00003FFC00007FFE00007FFE0000FFFF0000FFFF0001FFFF8 + 52 001FFFF8003FFFFC003FFFFC007FFFFE007FFFFE000FFFF0000FFFF0000FFFF0 + 52 00000000 + 53 00E0000700E000070078001E0078001E001E0078001E0078000781E0000781E0 + 53 0001E7800001E78000007E0000007E0000007E0000007E000001E7800001E780 + 53 000781E0000781E0001E0078001E00780078001E0078001E00E0000700E00007 + 53 00000000 + 54 000000000100080001801C0101C03E0300C0360300606306006063060070E38E + 54 0039C1DC003FC1FC001F80F800060020000000000100080001801C0101C03E03 + 54 0080360300606306006063060070E38E0039C1DC003FC1FC001F80F800060020 + 54 00000000 + 55 00007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E00 + 55 00007E0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00007E00 + 55 00007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E00 + 55 00000000 + 56 00003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C00 + 56 00003C0000003C0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00003C0000003C00 + 56 00003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C00 + 56 00000000 + 57 00000000000010000000380000006C000000C6000001830000033980000644C0 + 57 000C446000184430003038180070001C00FFFFFE00B0001E00307C1800304418 + 57 0030441800304418003044180030441800304418003FFFF8003FFFF800000000 + 57 00000000 + 58 00000000000000000060000C0060000C00000000000000000000000000000000 + 58 000000000000C6000000C6000000000000000000000000000000C6000000C600 + 58 00000000000000000000000000000000000000000060000C0060000C00000000 + 58 00000000 + 59 0000000000606060006060600000000000000000000606060006060600000000 + 59 0000000000606060006060600000000000000000000606060006060600000000 + 59 0000000000606060006060600000000000000000000606060006060600000000 + 59 00000000 + 60 0088888800000000002222220000000000888888000000000022222200000000 + 60 0088888800000000002222220000000000888888000000000022222200000000 + 60 0088888800000000002222220000000000888888000000000022222200000000 + 60 00000000 + 61 0007C3E00007C3E00007C3E00007C3E00007C3E000FFFFFF00FFFFFF00FFFFFF + 61 00FFFFFF00FFFFFF0007C3E00007C3E00007C3E00007C3E000FFFFFF00FFFFFF + 61 00FFFFFF00FFFFFF00FFFFFF0007C3E00007C3E00007C3E00007C3E00007C3E0 + 61 00000000 + 62 00AAAAAA00000000005555550000000000AAAAAA000000000055555500000000 + 62 00AAAAAA00000000005555550000000000AAAAAA000000000055555500000000 + 62 00AAAAAA00000000005555550000000000AAAAAA000000000055555500000000 + 62 00000000 + 63 00AAAAAA0055555500AAAAAA0055555500AAAAAA0055555500AAAAAA00555555 + 63 00AAAAAA0055555500AAAAAA0055555500AAAAAA0055555500AAAAAA00555555 + 63 00AAAAAA0055555500AAAAAA0055555500AAAAAA0055555500AAAAAA00555555 + 63 00000000 + 64 01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF + 64 01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF + 64 01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF01FFFFFF + 64 01FFFFFF + 65 000000000000000000000000000000000000000000000000000600C0000600C0 + 65 0000000000000000000000000000000000000000000000000000000000000000 + 65 00000000000600C0000600C00000000000000000000000000000000000000000 + 65 00000000 + 66 0000000000000000000000000000000000000000000000000000000000000000 + 66 0000000000000000003FFFF8003FFFF8003FFFF8003FFFF80000000000000000 + 66 0000000000000000000000000000000000000000000000000000000000000000 + 66 00000000 + 67 00F0001F00F0001F00F0001F00F0001F00F0001F000F83E0000F83E0000F83E0 + 67 000F83E0000F83E000007C0000007C0000007C0000007C0000007C00000F83E0 + 67 000F83E0000F83E0000F83E0000F83E000F0001F00F0001F00F0001F00F0001F + 67 00000000 + 68 0000000000000000000000000000000000000000000000000000000000000000 + 68 000000000000000000003C0000003C0000003C0000003C000000000000000000 + 68 0000000000000000000000000000000000000000000000000000000000000000 + 68 00000000 + 69 0000000000000000000000000000000000000000000000000000000000000000 + 69 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00 + 69 0000000000000000000000000000000000000000000000000000000000000000 + 69 00000000 + 70 00000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FFFF0 + 70 000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0 + 70 000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000000 + 70 00000000 + 71 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FC003F00FC003F + 71 00FCFF3F00FCFF3F00FCFF3F00FCFF3F00FCFF3F00FCFF3F00FCFF3F00FCFF3F + 71 00FC003F00FC003F00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF + 71 00000000 + 72 0000000000C0000600E0000E0070001C00380038001C0070000E00E0000701C0 + 72 000383800001C7000000EE0000007C000000380000007C000010EE300039C738 + 72 007F83FC00FF01FE00FF00FE00FF81FE00FFC3FE00FF81FE00FF00FE00FE007E + 72 00000000 + 73 00C0180300E018070070180E0038181C001C1838000E1870000718E0000399C0 + 73 0001C3800000E70000007E0000FF3CFF00FF3CFF00007E000000E7000001C380 + 73 000399C0000718E0000E1870001C18380038181C0070180E00E0180700C01803 + 73 00000000 + 74 0000000000000000000000000000380000006C000000C6000001830000030180 + 74 000600C0000C006000180030003000180060000C0030001800180030000C0060 + 74 000600C000030180000183000000C60000006C00000038000000100000000000 + 74 00000000 + 75 00FFFFFF00FFFFFF00FFC3FF00FFC3FF00FFC3FF00FFC3FF00FFC3FF00FFC3FF + 75 00FFC3FF00FFC3FF00C0000300C0000300C0000300C0000300FFC3FF00FFC3FF + 75 00FFC3FF00FFC3FF00FFC3FF00FFC3FF00FFC3FF00FFC3FF00FFFFFF00FFFFFF + 75 00000000 + 76 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 76 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 76 00000000000000000000000000FFFFFF00FFFFFF000000000000000000000000 + 76 00000000 + 77 00003F8000003F8000003F8000003F8000003F8000003F8000003F80001FFFFF + 77 001FFFFF001FFFFF001FFFFF001FFFFF001FFFFF001FFFFF00003F8000003F80 + 77 00003F8000003F8000003F8000003F8000000000000000000000000000000000 + 77 00000000 + 78 000000000000000000000E0000008E200001CE700003EEF80001FFF00000FFE0 + 78 00007FC00007FFFC0007FFFC0007FFFC00007FC00000FFE00001FFF00003EEF8 + 78 0001CE7000008E2000000E000000000000000000000000000000000000000000 + 78 00000000 + 79 000007E0000007E0000007E0000007E000000FC000000FC000000FC000001F80 + 79 00001F8000001F8000003F0000003F0000003F0000007E0000007E0000007E00 + 79 0000FC000000FC000000FC000001F80000000000000000000000000000000000 + 79 00000000 + 80 0000040000007FC00000FFE00001FFF00003FFF80003F4F80003F4F80003F400 + 80 0003FF800003FFE00001FFF000007FF800000FF80007E5F80007E5F80007F5F8 + 80 0003FFF80003FFF00001FFE000007F8000000000000000000000000000000000 + 80 00000000 + 81 00000000000000000000000000000000001FFFFF001FFFFF001FFFFF001FFFFF + 81 001FFFFF000000000000000000000000001FFFFF001FFFFF001FFFFF001FFFFF + 81 001FFFFF00000000000000000000000000000000000000000000000000000000 + 81 00000000 + 82 0000FFC00000FFC00000FFC00000FFC00000FFC00000F8000000F8000000F800 + 82 0000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800 + 82 0000FFC00000FFC00000FFC00000FFC000000000000000000000000000000000 + 82 00000000 + 83 0000FFC00000FFC00000FFC00000FFC00000FFC0000007C0000007C0000007C0 + 83 000007C0000007C0000007C0000007C0000007C0000007C0000007C0000007C0 + 83 0000FFC00000FFC00000FFC00000FFC000000000000000000000000000000000 + 83 00000000 + 84 0000000000000000000000000000000000001F0000001F0000001F0000001F00 + 84 00001F0000000000000000000000000000001F0000001F0000001F0000001F00 + 84 00001F0000000000000000000000000000000000000000000000000000000000 + 84 00000000 + 85 0000007000000070000000E0000000E0001FFFFF001FFFFF001FFFFF001FFFFF + 85 001FFFFF0000070000000E0000000E00001FFFFF001FFFFF001FFFFF001FFFFF + 85 001FFFFF0000E0000000E0000001C00000000000000000000000000000000000 + 85 00000000 + 86 000000000000000000000000000000000000000000000300000003C00001FFF0 + 86 0001FFF80001FFF00001C3C00001C3000001C0000001C0000001C0000001C000 + 86 0000000000000000000000000000000000000000000000000000000000000000 + 86 00000000 + 87 0000000000000000000000000000000000000000000FC07E0007E0FC0003F1F8 + 87 0001FBF00000FFE000007FC000003F8000001F0000000E000000040000000000 + 87 0000000000000000000000000000000000000000000000000000000000000000 + 87 00000000 + 88 00000000000000000000000000000000000000000000040000000E0000001F00 + 88 00003F8000007FC00000FFE00001FBF00003F1F80007E0FC000FC07E00000000 + 88 0000000000000000000000000000000000000000000000000000000000000000 + 88 00000000 + 89 0000000000000000000000000000040000000E0000000E0000001F0000001F00 + 89 00003F8000003F8000000E0000000E0000000E0000000E0000000E0000000E00 + 89 00000E0000000E00000000000000000000000000000000000000000000000000 + 89 00000000 + 90 00000000000000000000000000000E0000000E0000000E0000000E0000000E00 + 90 00000E0000000E0000000E0000003F8000003F8000001F0000001F0000000E00 + 90 00000E0000000400000000000000000000000000000000000000000000000000 + 90 00000000 + 91 000000000000002000000060000000E0000001E0000003E0000007E000000FC0 + 91 00001F8000003F0000007E0000003F0000001F8000000FC0000007E0000003E0 + 91 000001E0000000E0000000600000002000000000000000000000000000000000 + 91 00000000 + 92 01FFFFFF01000001010000010100000101000001010000010100000101000001 + 92 0100000101000001010000010100000101000001010000010100000101000001 + 92 0100000101000001010000010100000101000001010000010100000101000001 + 92 01FFFFFF + 93 000000000000000000040000000E000000FBE00000F1E0000000000000000000 + 93 0000000000000000000001000000038000003EF800003C780000000000000000 + 93 000000000000000000040000000E000000FBE00000F1E0000000000000000000 + 93 00000000 + 94 0147C011004000220080002401020011000D001E0191DF07002520000022A000 + 94 004420000048407C00218000003E0000000000400007E1A000000220000005BC + 94 00000444000008A400F8090800000580000007C00000000200007C0D00000011 + 94 01C00035 + 95 0000000000000000000000000001800001E683E1001080000010800000228000 + 95 002A80000044BE1F007B000000190000002A0380004C02400048022000400290 + 95 004E0248002002680010014800080138000400A0003E0F94000000C000000100 + 95 00000200 + 96 0000000000080040007F03F80000000000000000000000000000400200307F03 + 96 38000000000000000000000000100040007F03F8000000000000000000000000 + 96 000040020183F81F00000000000000000000000000080040007F03F800000000 + 96 00000000 + 97 0080410200C840960035806C0002000000000000007C1F000000000000000000 + 97 00002C0000005A00003E653E0001C100000100800000C1000001808000009500 + 97 00004200001F1CF8000000000000000000080020003603EC00CC029400A2850A + 97 00804202 + 98 00000000000001F0003160000015C000007880000002E00001083E0F00080000 + 98 000800000000062C00000290001F0F3800000210000002E00000010000316100 + 98 001481000079C1000010800000070000000800000181F0070008000000000000 + 98 00000000 + 99 000000000003E7C0000000000010000000240000002401800018024000100240 + 99 0011F18000100100001001000010010000000100000001000000C00001F1203E + 99 000120000000C00000008000000080000000FC00003E80000000800000000000 + 99 00000000 +100 0000000C007C03E8000000080000400000028A000001240001F12E3E0003B400 +100 000258000004E1000000220001C16E030003B100000268000004300000002000 +100 003E23E00000000000000400000000420000004401E07C290000001800000008 +100 0000000A +101 0003E0A0000800A0001C02C0001C0580001C0080011C3E8F0028008000588080 +101 00094080000A0080000A7C80000A0080002C0080005800000008000000080000 +101 000BE09F000801C0000801C0000801C0000801C0007C025F000805C800000094 +101 00000080 +102 0000000000021F000017000000080004007000080028041000040300000E0320 +102 001200E00001001000008008003E07C800000010000000200000600000088000 +102 01C51F1800020000000180000000800000030000000400F80008000000000000 +102 00000000 +103 0000000000000000003E03E0000000000000000000888888000000000000F81E +103 0000000000222051000000000000000001F0F83E000000000000000000888888 +103 0000000000000000001F03E00000000000000000002222110000000001F0F83E +103 00000000 +104 00000000000F803E0000000000040000000E3E0000040000001F000000040000 +104 003F809F00040080007FC1C0000401C000FFE3E0000403E0000407F0000007F0 +104 0007CFF800000FF800001FFC0000040000000000003E03E00000000000000000 +104 00000000 +105 0000000000038000000863E0000740000030B000004BC8000029500000444800 +105 0012803E00010000000103700001014C007D02E800010E96000113F4000842D0 +105 00008888000004A00007C040000000400000004000000001003E005F00000040 +105 00000001 +106 0000000000080000009441020023A00000265000005480000023201000279000 +106 002D2040001AD0A00009E1500009423000090108001122590009021000090188 +106 00000210000002B000040530000000E000000040000000400040404200000040 +106 00000040 +107 00010060000101F00000020C000005B200204C65000000980000000000040821 +107 00000020000000200000002000000020004180620007C020000A7000000A7000 +107 0025C400001B342000600A000001000000010000000100000041100800010000 +107 00010000 +108 00000000000F810200086000000740000030B000004BC8100029600000444800 +108 0012820200010000000103700041010C000102E800010E96000113F400010A5A +108 00201111000004A0000000400000004000000040004082440000004000000040 +108 00000040 +109 00000000000000000004CC04004D308000366B0000D8CC0000AB2300016DB8C1 +109 00202300005144800088884000049000000221020001C0000000800000208810 +109 0000800000008000000080000002810000008000000080000040A00800008000 +109 00000000 +110 0000000000000000000000000040404000000000000000000004740000019800 +110 0002C600000635000002A4000010CB000001B6000082A90400010D000000FA00 +110 0008820000001000000010000000100000001000004090080000100000000000 +110 00000000 +111 0080450200C840960035806C0010000000000000004040200000000000000000 +111 00002C0000045A02000065000001C100020000800000C100004180A000009500 +111 0000404000001C00010101020000000000080020003603EC00CD829400A2850A +111 00804202 +112 00000000000000000020820400000080000001C000040882000002A0000001C0 +112 00000480000002A0004211C100070490001002A0000A81C00007008000124080 +112 000A80000007040800124000000A900000070000004200800002000000000000 +112 00004004 +113 0000075C004041F00000004000000F5E000003F800020040000A804000470000 +113 00020208001AC000000F800000020000003AE040000F800000020000007AF000 +113 001FC204000200000002004000000150002020E00000004000000358000201F0 +113 00000040 +114 000000000000004000080840000000E0000000E0000001F0004081F1000003F8 +114 000003F8000007FC000207FC01024FFE0007004000070000000F8000000F8000 +114 001FC204001FC000003FE000003FE000007FF020001000000000000000000000 +114 00101008 +115 0000000000040082000000800000014000000140002012200000022000000410 +115 00000410000088080000080800021FFC00020080004500100005000000088000 +115 0008820200104000001040000020200000202020007FF0000002000000000202 +115 00000000 +116 0000000000080000000840200014000000080000001C0000002A0000001C0402 +116 002A0000005D0000003E008000550080008A894200080080000001C0000002A0 +116 000001C0002042A1000005D0000003E00000055000020AA80000008000000000 +116 00402008 +117 000000000000000000FFFFF8009202480012024000020201000202000003FE00 +117 00040100001800800020003000401C08018066060000D2010001820000030200 +117 00020400000204000002080000023000001C4000000880000000900000028000 +117 00018000 +118 000000000000000000000000000000000000000000000018000FFFF800100038 +118 002000580040009A00FFFF390080013900800139009999390099993900999938 +118 0081810000000000000000000000000000000000000000000000000000000000 +118 00000000 +119 0000000000000000000000000000000000000000000000000000000000000000 +119 003FFFF80060000400900002010800010107FFFF010400010105EF790105EF79 +119 00C5EF790031EF790019EF790000000300000003000000000000000000000000 +119 00000000 +120 00000000000000000000000000000000000000000000000000000400000FFFE0 +120 00100050002000880040010400FFFE020080020200BE027200BEDB7200BEDA72 +120 00BEDA0200BE1800000000000000000000000000000000000000000000000000 +120 00000000 +121 000000000000000000000000000000000000FF800001C0E00003003000060030 +121 000C001800181C0C0010220C0010210C0010220C00181C0C0018000C000C000C +121 00060018000300700000FFC000000E0000000000000000000000000000000000 +121 00000000 +122 0000000000000000000000000000000000000000000000000000000000000000 +122 000000000001FF00000701C0001800600018C630001C1838003F7D9C00000000 +122 0000000000000000000000000000000000000000000000000000000000000000 +122 00000000 +123 0000000000000000000000000000000000000000000000000000280000002800 +123 0000280000001000000028000000280000004400000044000000820000008200 +123 0001110000011100000238800002388000047C4000047C40000C7E4000000000 +123 00000000 +124 000000000000000000000000000000000000000000007F800000818000010380 +124 0003FC8000020480000204800002648000026480000204800002048000020480 +124 00020500000206000003FE000000020000000200000002000000020000000200 +124 00000200 +125 000400200044422200248124001500A8000A0050001F00F8000000000003E01F +125 00000000000010010021111100409209008054050100280201807C0700000000 +125 01F00F80000400200044422200248124001500A8000A0050001F00F800000000 +125 00007C03 +126 012492490012492400924924009249240092492401B6DB6D0124924901249249 +126 01249249016DB6DB004924920049249200492492016DB6DB0124924901249249 +126 0124924901B6DB6D00924924009249240092492401B6DB6D0124924901249249 +126 01249249 +127 0000000000FFFFFE040000020080000200800002008000020083FF820083FF82 +127 008301820083018200830182008301820083FF820083FF820083000200830002 +127 0083000200830002008300020083000200830002008000020080000200FFFFFE +127 00000000 +128 0000000000000000000000000000000000000000000000000000000000000000 +128 00000010000000300000005000000090000FFFF000020210000FFFF000020010 +128 0002001000020010000000000000000000000000000000000000000000000000 +128 00000000 +129 00000000000000000000000001FFFFFF00210422004208240084104400880044 +129 0111FC8800120400000404000007FCC000040D200007FE2000040E400007FC81 +129 00040D820007FF02000C0E0400147F8C00600080007FFF000000000000000000 +129 00000000 +130 000000000000000000000000000000000000000000000000000070000000F800 +130 0000F800000000000000FFFC0000FFC00001FC000001FC000001FC000003FE00 +130 0003FE000007FF000007FF000007FF0000000000000000000000000000000000 +130 00000000 +131 002082080071C71C00FBEFBE0071C71C0020820800041041010E38E3019F7DF7 +131 0171C71C000410410061861800F3CF3C00F3CF3C0061861800000000000C30C3 +131 0112492401924924000C30C30022222A00777B77002222220088888801DDDDDD +131 00888888 +132 0022222201777777002222220088888801DDDDDD008888880186186002492491 +132 0049249101861860000000000030C30C0079E79E0079E79E0030C30C01041040 +132 018E38E101DF7DF3018E38E1010410400020820800F1C71C00FBEFBE0071C71C +132 00208208 +133 0000000000000000000000000000000000000000000000000000000000000000 +133 0000000000000000000000000000000000000000000000000000000000000000 +133 00000000000000000155555500AAAAAA00AAAAAA00AAAAAA00AAAAAA00AAAAAA +133 01555555 +134 0104000000F800000104000000F800000104000000F800000104000000F80000 +134 0104000000F800000104000000F800000104000000F800000104000000F80000 +134 0104000000F800000104000000F800000104000000F800000104000000F80000 +134 01040000 +135 015000000098000001240000004A00000193000000A480000049400000326000 +135 001490000009280000064C00000292000002A5000000C9800000524000002480 +135 0000193000000A48000004940000032600000149000000920000006400000029 +135 00000012 +136 000000140000003200000049000000A4000001930000024A0000052400000C98 +136 00001250000029200000648000009280000149000003260000049400000A4800 +136 001930000024A0000052400000C980000125000000920000004C000001280000 +136 00900000 +137 000000060000000900000015000000320000004C000000A80000019000000260 +137 0000054000000C800000130000002A0000006400000098000001500000032000 +137 0004C000000A800000190000002600000054000000C800000230000000B00000 +137 00400000 +138 0040000000A000000130000000C80000005400000026000000190000000A8000 +138 0004C0000003200000015000000098000000640000002A000000130000000C80 +138 000005400000026000000190000000A80000004C000000320000001500000009 +138 00000006 +139 0120000001E000000120000001E000000120000001E000000120000001E00000 +139 0120000001E000000120000001E000000120000001E000000120000001E00000 +139 0120000001E000000120000001E00000012000000120000001E0000001200000 +139 01E00000 +140 0000000000000000000000000000000000000000000000000000000000000000 +140 0000000000000000000000000000000000000000000000000000000000000000 +140 000000000000000000000000000000000000000001FFFFFF00AAAAAA00AAAAAA +140 01FFFFFF +141 0040000000200000011000000088000000400000002000000001000000008000 +141 0004400000022000000100000000800000000400000002000000110000000880 +141 0000040000000200000000100000000800000040000000220000001000000008 +141 00000000 +142 0000000000000008000000100000002200000044000000080000001000000200 +142 0000040000000880000011000000020000000400000080000001000000022000 +142 0004400000008000000100000020000000400000008000000110000000200000 +142 00400000 +143 0000000000000000000000000000000000000000000000000000000000000000 +143 0000000000000000000000000000000000000000000000000000000000000000 +143 000000000000000000000000000000000000000000F8F87C0000000000000000 +143 00F8F87C +144 0000000000000000012000000120000001200000012000000120000000000000 +144 0000000000000000012000000120000001200000012000000120000000000000 +144 0000000000000000000000000120000001200000012000000120000001200000 +144 00000000 +145 0000000400000008000000110000002200000044000000880000011000000220 +145 0000044000000880000011000000220000004400000088000001100000022000 +145 0004400000088000001100000022000000440000008800000110000000200000 +145 00400000 +146 0040000000200000011000000088000000440000002200000011000000088000 +146 0004400000022000000110000000880000004400000022000000110000000880 +146 0000044000000220000001100000008800000044000000220000001100000008 +146 00000004 +147 0120000001200000012000000120000001200000012000000120000001200000 +147 0120000001200000012000000120000001200000012000000120000001200000 +147 0120000001200000012000000120000001200000012000000120000001200000 +147 01200000 +148 0000000000000000000000000000000000000000000000000000000000000000 +148 0000000000000000000000000000000000000000000000000000000000000000 +148 000000000000000000000000000000000000000001FFFFFF0000000000000000 +148 01FFFFFF +149 0080000001C0000000E000000070000000380000001800000000000000000000 +149 000080000001C0000000E0000000700000003800000018000000000000000000 +149 00000080000001C0000000E00000007000000070000000180000000000000000 +149 00000000 +150 00000002000000070000000E0000001C00000038000000300000000000000000 +150 000002000000070000000E0000001C0000003800000030000000000000000000 +150 0002000000070000000E0000001C000000380000003000000000000000000000 +150 00000000 +151 0000000000000000000000000000000000000000000000000000000000000000 +151 0000000000000000000000000000000000000000000000000000000000000000 +151 00000000000000000000000000000000000000000000000001F1F9F000F8F8F8 +151 01F1F1F0 +152 0140000001C0000001C0000001C0000001C00000008000000000000000000000 +152 0140000001C0000001C0000001C0000001C00000008000000000000000000000 +152 0140000001C0000001C0000001C0000001C00000008000000000000000000000 +152 00000000 +153 010000000100000001000000010000000180000000C000000040000000400000 +153 00C000000080000000C0000000C00000004000000040000000C0000000C00000 +153 018000000180000000C0000000C0000000800000008000000180000001000000 +153 00000000 +154 0000000000000000000000000000000000000000000000000000000000000000 +154 0000000000000000000000000000000000000000000000000000000000000000 +154 000000000000000000000000000000000000000000000C0000007E000079C7CC +154 01CF007F +155 0000000100000003000000060000000C00000078000000C00000008000000080 +155 00000180000001000000070000000C00000038000000F0000000800000078000 +155 000C0000001800000010000000300000000000000020000000E0000001800000 +155 01800000 +156 010000000180000000C000000040000000700000001C00000004000000070000 +156 0001800000000000000040000000100000000400000000000000010000000180 +156 00000080000000E00000003800000008000000080000000C0000000400000007 +156 00000001 +157 0180000001800000018000000180000001800000018000000000000000000000 +157 0000000001800000018000000180000001800000018000000000000000000000 +157 0000000001800000018000000180000001800000018000000180000000000000 +157 00000000 +158 0000000000000000000000000000000000000000000000000000000000000000 +158 0000000000000000000000000000000000000000000000000007000000070000 +158 0007000000070000000200000002000000020000000200000002000001FAFC7C +158 01FAFC7C +159 00000000000000000000000C000000180000003000000060000000C000000000 +159 000700000007060000070C000007180000023000000260000002C00000020000 +159 00020000000200000002000000180000003000000060000000C0000001800000 +159 01000000 +160 0000000000000000000000000030000000180000000C00000006000000030000 +160 00000000000000E0000060E0000030E0000010E000000C400000064000000340 +160 00000040000000400000004000000040000000180000000C0000000600000003 +160 00000001 +161 0120000000940000004C00000124000000960000004D00000024800000164000 +161 000D200000049000000648E0000524E0000092E0000049E0000024C000001240 +161 00000960000004D00000024800000B20000000D2000000490000006400000052 +161 00000009 +162 00000009000000520000006400000049000000D20000016400000248000004D0 +162 00000960000E1240000E24C0000E4940000E9200000524000006480000049000 +162 000D20000016400000248000004D00000096000001240000004C000000940000 +162 01200000 +163 0000000000000000000000000000000000000000000000000000000000000000 +163 000000000000000000000000000000000000000000000000000E0000000E0000 +163 000E0000000E00000004004001FFFFFF0004004001FFFFFF0004004001FFFFFF +163 00040040 +164 00A8000000A8000000AC000000A8000000B8000000A8000000E8000000A80000 +164 01A8000000A8000000A8000000A8000000A8000000A8000000A8000000A80000 +164 00AC000000A8000000B8000000A8000000E8000000A8000001A8000000A80000 +164 00A80000 +165 0054076C0039082400154235001382AE009110740081102400A5543501C3B82E +165 008111040089110400AB554401DC3B80008811100088111000889554002AA3B8 +165 001DC11000088111008889550148883B0142AA1100E1DC150140889300408881 +165 0044AAA1 diff --git a/symbols/misc3.sym b/symbols/misc3.sym new file mode 100644 index 0000000..8eafb28 --- /dev/null +++ b/symbols/misc3.sym @@ -0,0 +1,27 @@ +-3 -3 3x3symbol-1 dot on + 1 000000020000 + 2 000500020005 + 3 000400020001 + 4 000100020004 + 5 000500000005 + 6 000500050005 + 7 000700000007 + 8 000600020003 + 9 000300020006 + 10 000700020007 + 11 000500050002 + 12 000200050005 + 13 000200050002 + 14 000700050007 + 15 000700070007 + 16 000000000000 + 17 000200020002 + 18 000000070000 + 19 000700060004 + 20 000700010001 + 21 000400040007 + 22 000600060000 + 23 000200070002 + 24 000500070005 + 25 000700010007 + 26 000700050005 diff --git a/symbols/misc8.sym b/symbols/misc8.sym new file mode 100644 index 0000000..b3af2d2 --- /dev/null +++ b/symbols/misc8.sym @@ -0,0 +1,44 @@ + -8 -8 79/11/07.SYMBOLS AND TONES + 1 081 042 024 018 018 024 042 081 + 2 018 018 018 0FF 0FF 018 018 018 + 3 055 0AA 055 0AA 055 0AA 055 0AA + 4 041 082 004 008 010 020 041 082 + 5 082 041 020 010 008 004 082 041 + 6 082 043 024 05A 05A 024 0C2 041 + 7 000 042 03C 024 024 03C 042 000 + 8 081 0FF 081 091 089 081 0FF 081 + 9 001 00E 038 0E0 001 00E 038 0E0 + 10 080 070 01C 007 080 070 01C 007 + 11 018 024 042 052 04A 042 024 018 + 12 000 03C 000 055 0AA 000 03C 000 + 13 008 010 020 041 082 004 008 010 + 14 008 014 022 041 082 044 028 010 + 15 000 03E 042 042 042 042 07C 000 + 16 0FF 081 0BD 0A5 0A5 0BD 081 0FF + 17 000 066 066 000 000 066 066 000 + 18 000 066 066 018 018 066 066 000 + 19 041 0DA 024 018 018 024 05B 082 + 20 040 0C0 020 010 008 004 003 002 + 21 002 003 004 008 010 020 0C0 040 + 22 081 081 081 0FF 0FF 081 081 081 + 23 0FF 018 018 018 018 018 018 0FF + 24 024 024 0FF 024 024 0FF 024 024 + 25 000 000 000 0FF 0FF 000 000 000 + 26 018 018 018 018 018 018 018 018 + 27 0C3 0FF 000 0DB 0DB 000 0FF 0C3 + 28 0DB 0DB 000 0DB 0DB 000 0DB 0DB + 29 000 000 000 018 018 000 000 000 + 30 0FF 0FF 0FF 0FF 0FF 0FF 0FF 0FF + 31 0FF 000 000 0FF 000 000 000 0FF + 32 089 089 089 089 089 089 089 089 + 33 0FF 000 0FF 000 0FF 000 000 0FF + 34 095 095 095 095 095 095 095 095 + 35 081 042 024 0FF 018 024 042 081 + 36 091 052 034 018 018 034 052 091 + 37 078 078 000 01E 01E 000 078 078 + 38 000 0AA 0AA 0FF 0FF 055 055 000 + 39 000 018 018 0DB 0DB 0C3 0C3 000 + 40 099 099 000 099 099 000 099 099 + 41 0FF 0E7 0E7 099 099 0E7 0E7 0FF + 42 0FF 0FF 0C3 0C3 0C3 0C3 0FF 0FF + 43 000 000 000 018 000 000 000 000 diff --git a/symbols/tone10a.sym b/symbols/tone10a.sym new file mode 100644 index 0000000..e3ebc64 --- /dev/null +++ b/symbols/tone10a.sym @@ -0,0 +1,145 @@ +-10 -10 79/11/07.MLMIS S45 TONE DECK + 1 0038004400820129010101290082004400380000 + 2 019301930010003801FF00380010019301930000 + 3 0000003000480084010201020084004800300000 + 4 000001FE01FE003000300030003001FE01FE0000 + 5 00C1000C00600100001C00C00006017100000000 + 6 0092016D016D0092016D016D0092016D016D0000 + 7 010000000000000000000000000A000201000000 + 8 01EF0129012901EF000001EF0129012901EF0000 + 9 019300100000003801FF00380000001001930000 + 10 0000003000FC00AC01C6018E00D400FC00300000 + 11 0038005400EE015501BB015500EE005400380000 + 12 002C00D200A6004C00D200340030003000780000 + 13 011100AA004400000000011100AA004400000000 + 14 0201013200B4007801FE01FE007800B401320201 + 15 003F00110011001101FF01FF006000600060007C + 16 0000010200000000001000000000000001020000 + 17 0000000000200050008800440028001000000000 + 18 0048004800480FFF004800480FFF004800480048 + 19 007800CC01860303023102310303018600CC0078 + 20 000000FC00FC00CC01A6019600CC00FC00FC0000 + 21 01FE02CD034B0387020102010387034B02CD01FE + 22 0140004000410190000000270002000000400200 + 23 000001FE01FE018601B601B6018601FE01FE0000 + 24 018300100000003800AA00380000001001830000 + 25 00E700A600EC000800100037006500E700000000 + 26 0000000000000030007800FC01FE000000000000 + 27 0000008200000028000000280000008200000000 + 28 01FF0000000001FF0000000001FF000000000000 + 29 01C701C701C700380038003801C701C701C70000 + 30 01FF01FF018301BB01AB01BB018301FF01FF0000 + 31 000000300030003001FE01FE0030003000300030 + 32 003800540082011101AB01110082005400380000 + 33 000002AA00000155000002AA00000155000002AA + 34 0229004A0100000601240025001B011100080002 + 35 0000000000780084010201020084007800000000 + 36 0038007C00FE01FF01FF01FF00FE007C00380000 + 37 03FF03CF03CF03CF0201020103CF03CF03CF03CF + 38 02010302018600CC00780030007800CC01860303 + 39 00B8007C00F800FC00FE007800B0003000780000 + 40 00000030004800B4014A014A00B4004800300000 + 41 018300100010003800EE00380010001001830000 + 42 0092024900920249009202490092024900920249 + 43 000000FC00FC00FC01FE01FE00FC00FC00FC0000 + 44 0038004400D601290155012900D6004400380000 + 45 0000000000000030004800480030000000000000 + 46 01FF01FF0193019301FF0193019301FF01FF0000 + 47 0053004C034000CB014603040223020202590090 + 48 0000000000440000000000000044000000000000 + 49 0000000C00E00000000F000000600000001C0000 + 50 01FE00FD02790333038703CF03870333027900FC + 51 0010000000000028008200280000000000100000 + 52 00000000000000F800F800F800F800F800000000 + 53 000001FE01FE01FE01CE01CE01FE01FE01FE0000 + 54 02AA0155015502AA0155015502AA0155015502AA + 55 0101008200440028001000AA01C701EF01C70000 + 56 0000013200000000013201320000000001320000 + 57 03FF03FF03FF03DF03AF035702AB03FF03FF03FF + 58 001000A800C400EE0129012901E9010901FF0000 + 59 0000000000100000008000040000002000000000 + 60 0293023A00880058037A00EE0382018A00E401A6 + 61 03FF03FF03FF0307030703070307030703FF03FF + 62 000000100010003800EE00380010001000000000 + 63 01FF01FF019301BB01FF01BB019301FF01FF0000 + 64 01FF000001FF000001FF000001FF000001FF0000 + 65 0008001C002A0028001C000A002A001C00080000 + 66 0000000000440000000000000000000000000000 + 67 000000200020002001FE00200020002000200000 + 68 0030003000300030003F003F0000000000000000 + 69 00200020002000AA01FE03FE03FE01FC007C007C + 70 015502AA015502AA015502AA015502AA015502AA + 71 007C007C0060006000600060007C007C00000000 + 72 00000008000C007E006C00080000000000000000 + 73 03FF03DF03DF03DF020103DF03DF03DF03DF03FF + 74 034A02EB00C103D6013B018C039701E3027A0231 + 75 0000007E007E00000000007E007E000000000000 + 76 000000000000000003FF03FF0000000000000000 + 77 0008001C003E0008000800080008000000000000 + 78 00000004000C001800300018000C000400000000 + 79 03EE03DE02BF03BB017F037E021A02FF00F102FF + 80 0000000000000020005000A80154000000000000 + 81 0000000000000000007E007E0000000000000000 + 82 0030003000300030003000300030003000300030 + 83 03FF03FF03FF03FF03FF03FF03FF03FF03FF03FF + 84 000C001C0038003000300038001C000C00000000 + 85 007C007C000C000C000C000C007C007C00000000 + 86 03FF03FF0303037B037B037B037B030303FF03FF + 87 0004007E007E00080010007E007E002000000000 + 88 00060006000C0018001800300060006000000000 + 89 000000920054003800EE00380054009200000000 + 90 0008000800080008003E001C0008000000000000 + 91 0000000000000000003F003F0030003000300030 + 92 03BB02EE03BB02FE03FB02FE03FB02FE03BB02EE + 93 0000001800180000000000180018000000000000 + 94 01B5019302CF02BD01FC03F7001D03BE034F0361 + 95 0000000000000000003000300000000000000000 + 96 01FF01FF01FF01FF01FF01FF01FF01FF01FF0000 + 97 00300038001C000C000C001C0038003000000000 + 98 000000180018007E007E00180018000000000000 + 99 01FF01FF0111013901FF0139011101FF01FF0000 +101 000000000000000003F003F00030003000300030 +102 021F03EF03FF02FF03FE019B03FF03FF02FE01BF +103 0000002000300018000C00180030002000000000 +104 00000000000000000000001C0014001C000C0000 +105 003000300030003003F003F00000000000000000 +106 0000000000000010000000000000000000000000 +107 03FF02FD03FF03FF03EF03FF03FF03FF02FD03FF +108 0038004400820101010100010082004400380000 +109 0000000000240000000000240000000000000000 +110 0018003C0066006600660066003C001800000000 +111 0018003800380018001800180018003C00000000 +112 003C007E00660006003C0060007E007E00000000 +113 003C007E0066000C000E0066007E003C00000000 +114 000C001C003C006400E400FC000C001E00000000 +115 007E007E0060007C00060066007E003C00000000 +116 003C007E0060007C00660066007E003C00000000 +117 007E007E0046000C000C000C000C000C00000000 +118 003C007E0066003C00660066007E003C00000000 +119 003C007E00660066003E0006007E003C00000000 +120 0018003C00660066007E007E006600E700000000 +121 00FC007E0066007C00660066007E00FC00000000 +122 003C007E0067006000600067007E003C00000000 +123 00FC007E0066006600660066007E00FC00000000 +124 00FE007E0062007800780062007E00FE00000000 +125 00FE007E0062007800780060006000F000000000 +126 003C007E00670060006F0066007E003C00000000 +127 00E700660066007E007E0066006600E700000000 +128 003C001800180018001800180018003C00000000 +129 000F00060006000600060066007E003C00000000 +130 00E70066006C0078007C0066006600E700000000 +131 00F000600060006000600062007E00FE00000000 +132 01C700EE00FE00BA00D600C600C601C700000000 +133 00C700660076007E007E006E006600E300000000 +134 003C007E0066006600660066007E003C00000000 +135 00FC007E00660066007E007C006000F000000000 +136 003C007E006600660066006C007E003600000000 +137 00FC007E00660066007C007E006600E700000000 +138 003C007E00620078001E0046007E003C00000000 +139 00FF00FF00990018001800180018003C00000000 +140 00E700660066006600660066007E003C00000000 +141 00E7006600660066003C003C0018001800000000 +142 01C700C600D600D600FE007C006C006C00000000 +143 00E700660024001800180024006600E700000000 +144 00E70066007E003C001800180018003C00000000 +145 00FE00FE008C00180030006200FE00FE00000000 diff --git a/symbols/tone10b.sym b/symbols/tone10b.sym new file mode 100644 index 0000000..b3bec56 --- /dev/null +++ b/symbols/tone10b.sym @@ -0,0 +1,19 @@ +-10 -10 79/11/07.TONES LIGHT TO DARK FOR POPULATION MAPS + 1 0000000000000000000000000018001800000000 + 2 0000000000200050008800440028001000000000 + 3 000000100010003800EE00380010001000000000 + 4 00060006000C0018001800300060006000000000 + 5 000000300030003001FE01FE0030003000300030 + 6 02010302018600CC00780030007800CC01860303 + 7 0048004800480FFF004800480FFF004800480048 + 8 01C701C701C700380038003801C701C701C70000 + 9 01EF0129012901EF000001EF0129012901EF0000 + 10 02AA0155015502AA0155015502AA0155015502AA + 11 01FE02CD034B0387020102010387034B02CD01FE + 12 000000FC00FC00FC01FE01FE00FC00FC00FC0000 + 13 03FF03FF03FF0307030703070307030703FF03FF + 14 03FF03FF0303037B037B037B037B030303FF03FF + 15 03FF03FF03FF03DF03AF035702AB03FF03FF03FF + 16 03FF03FF03FF03FF03FF03FF03FF03FF03FF03FF + 17 0000000000000000001000000000000000000000 + 18 000000000301038300C6007C0038000000000000 diff --git a/symbols/tone10c.sym b/symbols/tone10c.sym new file mode 100644 index 0000000..23c2536 --- /dev/null +++ b/symbols/tone10c.sym @@ -0,0 +1,14 @@ + -10 -10 79/11/07.DOTS LIGHT TO DARK + 1 0000000000000000003000300000000000000000 + 2 0000000000000030004800480030000000000000 + 3 0000000000200050008800440028001000000000 + 4 0000000000780084010201020084007800000000 + 5 0000003000480084010201020084004800300000 + 6 0038004400820129010101290082004400380000 + 7 00000030004800B4014A014A00B4004800300000 + 8 003800540082011101AB01110082005400380000 + 9 0038004400D601290155012900D6004400380000 + 10 0038005400EE015501BB015500EE005400380000 + 11 0000003000FC00AC01C6018E00D400FC00300000 + 12 004000C801860303023102310303018600CC0078 + 13 0038007C00FE01FF01FF01FF00FE007C00380000 diff --git a/symbols/tone10d.sym b/symbols/tone10d.sym new file mode 100644 index 0000000..a063b6d --- /dev/null +++ b/symbols/tone10d.sym @@ -0,0 +1,48 @@ + -10 -10 79/11/07.ASSORTED TONES, SYMBOLS AND PICTURES + 1 0000000000000000007E007E0000000000000000 + 2 0000007E007E00000000007E007E000000000000 + 3 0004007E007E00080010007E007E002000000000 + 4 000001FE01FE003000300030003001FE01FE0000 + 5 01FF0000000001FF0000000001FF000000000000 + 6 01FF000001FF000001FF000001FF000001FF0000 + 7 0000000000000000003000300000000000000000 + 8 0000001800180000000000180018000000000000 + 9 000000180018007E007E00180018000000000000 + 10 000000200020002001FE00200020002000200000 + 11 000000100010003800EE00380010001000000000 + 12 000000300030003001FE01FE0030003000300030 + 13 0201013200B4007801FE01FE007800B401320201 + 14 0048004800480FFF004800480FFF004800480048 + 15 01FE02CD034B0387020102010387034B02CD01FE + 16 03FF03CF03CF03CF0201020103CF03CF03CF03CF + 17 03FF03DF03DF03DF020103DF03DF03DF03DF03FF + 18 0000000000000030004800480030000000000000 + 19 0000003000480084010201020084004800300000 + 20 007800CC01860303023102310303018600CC0078 + 21 003800540082011101AB01110082005400380000 + 22 0000000000000020005000A80154000000000000 + 23 0000000000000030007800FC01FE000000000000 + 24 00000000000000F800F800F800F800F800000000 + 25 0038007C00FE01FF01FF01FF00FE007C00380000 + 26 000000FC00FC00FC01FE01FE00FC00FC00FC0000 + 27 000001FE01FE01FE01CE01CE01FE01FE01FE0000 + 28 03FF03FF03FF0307030703070307030703FF03FF + 29 03FF03FF0303037B037B037B037B030303FF03FF + 30 01FF01FF01FF01FF01FF01FF01FF01FF01FF0000 + 31 034A02EB00C103D6013B018C039701E3027A0231 + 32 02AA0155015502AA0155015502AA0155015502AA + 33 0000000000000000007E007E0000000000000000 + 34 0000000000000000003000300000000000000000 + 35 0000003000480084010201020084004800300000 + 36 0000000000200050008800440028001000000000 + 37 0000000000000020005000A80154000000000000 + 38 00000008000C007E006C00080000000000000000 + 39 0008001C002A0028001C000A002A001C00080000 + 40 0010000000000028008200280000000000100000 + 41 0008001C003E0008000800080008000000000000 + 42 000000100010003800EE00380010001000000000 + 43 003F00110011001101FF01FF006000600060007C + 44 0101008200440028001000AA01C701EF01C70000 + 45 002C00D200A6004C00D200340030003000780000 + 46 001000A800C400EE0129012901E9010901FF0000 + 47 011100AA004400000000011100AA004400000000 diff --git a/symbols/tone5.sym b/symbols/tone5.sym new file mode 100644 index 0000000..e80e955 --- /dev/null +++ b/symbols/tone5.sym @@ -0,0 +1,98 @@ +-5 -5 79/11/07.MODIFIED ALPHANUMERICS WITH TONES + 1 000 006 009 00F 009 + 2 000 00E 00E 009 00E + 3 000 007 008 008 007 + 4 000 00E 009 009 00E + 5 000 00F 00E 008 00F + 6 000 00F 008 00E 008 + 7 000 006 008 009 007 + 8 000 009 009 00F 009 + 9 000 007 002 002 007 + 10 000 007 002 002 00C + 11 000 00A 00C 00A 009 + 12 000 008 008 008 00F + 13 000 00A 015 015 015 + 14 000 009 00D 00B 009 + 15 000 006 009 009 006 + 16 000 00E 009 00E 008 + 17 000 006 009 00A 005 + 18 000 00E 009 00E 009 + 19 000 00E 00C 002 00E + 20 000 00F 004 004 004 + 21 000 009 009 009 006 + 22 000 009 009 00A 004 + 23 000 015 00A 00E 00A + 24 000 009 006 006 009 + 25 000 00A 00A 004 004 + 26 000 00F 002 004 00F + 27 000 00E 00A 00A 00E + 28 000 004 004 004 004 + 29 000 006 001 006 007 + 30 000 00E 006 002 00E + 31 000 00A 00E 002 002 + 32 000 00E 00C 002 00C + 33 000 008 00E 00A 00E + 34 000 00E 002 002 002 + 35 000 00E 00E 00A 00E + 36 000 00E 00A 00E 002 + 37 000 004 00E 004 000 + 38 000 000 00E 000 000 + 39 000 00F 00F 00F 00F + 40 000 001 002 004 008 + 41 000 004 008 008 004 + 42 000 004 002 002 004 + 43 004 00E 00C 006 00E + 44 000 00E 000 00E 000 + 46 000 000 000 00C 004 + 47 000 000 000 000 004 + 48 03F 03F 03F 03F 03F + 49 000 00C 008 008 00C + 50 000 006 002 002 006 + 51 000 004 000 004 000 + 52 002 00F 006 00F 004 + 53 007 007 007 007 007 + 54 007 007 00F 00F 007 + 55 000 000 004 006 007 + 56 004 00E 015 004 004 + 57 000 000 000 03F 03F + 58 000 000 000 020 038 + 59 038 030 020 000 000 + 60 03F 03F 03F 03E 03C + 61 03F 03C 038 030 030 + 62 030 030 030 038 03E + 63 020 030 038 03C 03E + 64 00D 013 00A 014 013 + 65 00A 00A 00A 00A 000 + 66 000 015 00A 000 000 + 67 000 003 000 00C 000 + 68 011 015 01F 015 011 + 69 01F 015 01B 015 01F + 70 000 00A 000 00A 000 + 71 01F 011 015 011 01F + 72 01F 01F 01F 01F 01F + 73 000 000 004 000 000 + 74 000 03F 000 000 03F + 75 012 012 012 012 012 + 76 008 010 020 001 002 + 77 004 002 001 020 010 + 78 03F 03F 03F 03F 03F + 79 02A 015 02A 015 02A + 80 02A 000 015 000 02A + 81 024 012 009 024 012 + 82 009 012 024 009 012 + 83 01C 038 031 023 007 + 84 00E 007 023 031 038 + 85 038 030 020 001 003 + 86 007 003 001 020 030 + 87 030 018 00C 006 003 + 88 003 006 00C 018 030 + 89 008 010 020 001 002 + 90 004 002 001 020 010 + 91 00C 018 030 021 003 + 92 00C 006 003 021 030 + 93 001 002 004 008 010 + 94 020 010 008 004 002 + 95 003 007 00E 01C 038 + 96 030 038 01C 00E 007 + 97 000 009 002 004 009 + 98 000 00A 000 00A 000 diff --git a/symbols/tone6a.sym b/symbols/tone6a.sym new file mode 100644 index 0000000..65aa2d5 --- /dev/null +++ b/symbols/tone6a.sym @@ -0,0 +1,227 @@ + -6 -6 79/11/07.ASSORTED TONES AND SYMBOLS + 1 000 01F 01F 011 01F 01F + 2 000 006 009 009 006 000 + 3 000 015 00A 00E 00E 000 + 4 000 010 00C 00C 002 000 + 5 000 01C 014 008 008 000 + 6 000 00E 00A 00A 00E 000 + 7 000 004 00E 004 000 000 + 8 000 000 01E 01E 000 000 + 9 03F 03F 03F 03F 03F 03F + 10 000 001 002 004 008 000 + 11 000 006 01E 018 01E 006 + 12 000 008 007 007 008 000 + 13 004 00E 00C 006 00E 000 + 14 000 00E 000 00E 000 000 + 15 000 01B 01B 004 01B 01B + 16 000 006 00B 019 00B 006 + 17 000 004 000 004 000 000 + 18 000 002 00F 006 00F 004 + 19 000 002 00F 00A 000 000 + 20 000 000 01F 000 000 000 + 21 000 017 007 012 007 017 + 22 000 004 01F 015 004 004 + 23 000 00A 015 015 00A 000 + 24 000 002 006 008 006 002 + 25 000 008 004 002 004 008 + 26 000 01F 00E 00F 003 000 + 27 000 003 00B 004 01A 019 + 28 000 01F 015 011 015 01F + 29 000 00A 00A 00A 00A 000 + 30 000 015 00A 000 000 000 + 31 000 003 000 00C 000 000 + 32 000 011 015 01F 015 011 + 33 000 01F 015 01B 015 01F + 34 000 01F 011 015 011 01F + 35 000 000 004 000 000 000 + 36 000 01F 000 000 01F 000 + 37 000 012 012 012 012 012 + 38 000 002 005 00A 014 008 + 39 000 008 014 00A 005 002 + 40 000 015 00A 015 00A 015 + 41 000 00B 011 015 01B 00B + 42 000 012 009 004 012 009 + 43 000 012 00C 012 00C 012 + 44 000 00E 01D 01B 017 00E + 45 000 00E 017 01B 01D 00E + 46 000 01D 01D 011 017 017 + 47 000 00E 015 01F 015 00E + 48 000 01A 017 015 015 01D + 49 000 003 006 00C 018 000 + 50 000 018 00C 006 003 000 + 51 000 00E 01B 015 01B 00E + 52 000 00A 000 00A 000 000 + 53 000 004 004 004 004 004 + 54 000 00E 006 00C 00C 00C + 55 000 00E 00A 01B 011 01F + 56 000 00E 01D 003 01D 00E + 57 000 00D 013 00A 014 013 + 58 000 01B 01F 00E 01F 01B + 59 000 004 000 004 000 004 + 60 000 004 00A 004 00A 004 + 61 000 004 00A 015 00A 004 + 62 000 009 002 004 009 000 + 64 000 01A 016 01A 016 01A + 65 000 004 01B 015 01B 004 + 66 000 012 00C 00C 012 01E + 67 000 005 00E 01F 00E 014 + 68 000 01E 002 00B 002 01E + 69 000 008 014 015 014 008 + 70 000 004 002 01D 002 004 + 71 000 004 00E 01B 00E 004 + 72 000 010 01F 013 01F 010 + 73 000 01C 01F 019 01F 01C + 74 000 01F 01F 00A 00A 000 + 75 000 00B 018 01E 018 00B + 76 000 00E 015 011 00A 004 + 77 000 01E 017 011 01F 00F + 78 000 01E 01E 019 007 000 + 79 000 01F 01B 00A 00E 004 + 80 000 018 017 00B 017 018 + 81 000 00E 001 009 006 00C + 82 000 00E 00E 00A 011 01F + 83 000 004 00E 01B 00E 004 + 84 000 00F 018 013 01E 004 + 85 000 01E 00E 00E 012 000 + 86 000 01E 006 01A 03A 030 + 87 000 004 00E 011 015 00A + 88 000 008 018 005 003 007 + 89 000 01C 014 01C 000 000 + 90 000 01F 01F 011 01F 01F + 91 000 004 01B 01B 01B 004 + 92 000 00C 01E 00C 000 000 + 93 000 00E 00E 011 00E 00E + 94 000 01C 016 01F 016 01C + 95 000 008 01F 009 009 00F + 96 000 00E 00A 00A 00A 01E + 97 000 01B 00B 00B 00B 00F + 98 000 01F 011 012 011 01F + 99 000 008 014 01C 008 00F +100 008 014 01C 008 00F 000 +101 03F 021 027 02B 02F 03F +102 03D 006 003 039 029 039 +103 03E 020 02C 024 02C 020 +104 03F 030 02E 02E 02E 021 +105 014 03E 022 03E 014 014 +106 03F 02E 02E 02E 02E 02E +108 000 03E 03A 03E 022 03E +109 020 010 008 007 03D 007 +110 000 00C 012 01B 003 000 +111 020 011 00E 00A 00E 001 +112 034 036 006 01C 01C 018 +113 004 00E 01F 004 00C 000 +114 020 013 00F 00F 01C 01D +115 03E 014 014 014 03E 000 +116 03C 03C 020 038 00C 000 +117 000 00A 015 015 015 00A +118 000 006 009 009 006 000 +119 000 010 00C 00C 002 000 +120 000 01C 014 008 008 000 +121 000 00E 00A 00A 00E 000 +122 000 004 00E 004 000 000 +123 000 000 01E 01E 000 000 +124 000 00F 00F 00F 00F 000 +125 000 001 002 004 008 000 +126 000 006 01E 018 01E 006 +127 000 008 007 007 008 000 +128 004 00E 00C 006 00E 000 +129 000 00E 000 00E 000 000 +130 020 01B 01B 004 01B 01B +131 000 00E 01E 03E 01E 00E +132 000 004 000 004 000 000 +133 002 00F 006 00F 004 000 +134 000 002 00F 00A 000 000 +135 000 000 01F 000 000 000 +136 017 007 012 007 017 000 +137 004 01F 015 004 004 000 +138 000 01C 02A 02A 01C 000 +139 002 006 008 006 002 000 +140 008 004 002 004 008 000 +141 000 03E 016 01E 006 000 +142 000 013 00F 03C 032 000 +143 020 02E 02A 02E 020 03F +144 00A 00A 00A 00A 000 000 +145 000 015 00A 000 000 000 +146 000 003 000 00C 000 000 +147 011 015 01F 015 011 000 +148 01F 015 01B 015 01F 000 +149 01F 011 015 011 01F 000 +150 000 000 004 000 000 000 +151 000 03F 000 000 03F 000 +152 012 012 012 012 012 012 +153 008 010 020 001 002 004 +154 004 002 001 020 010 008 +155 02A 015 02A 015 02A 015 +156 01C 022 02A 036 01C 000 +157 024 012 009 024 012 009 +158 000 012 00C 012 00C 012 +159 01C 038 031 023 007 00E +160 00E 007 023 031 038 01C +161 038 030 020 001 003 007 +162 00E 015 01F 015 00E 000 +163 036 021 02C 00D 02D 021 +164 003 007 00E 01C 038 030 +165 030 038 01C 00E 007 003 +166 000 009 002 004 009 000 +167 000 00A 000 00A 000 000 +168 004 004 004 004 004 000 +169 00E 006 00C 00C 00C 000 +170 01C 014 01C 02A 022 000 +171 01C 01E 01E 01E 01C 000 +172 00D 013 00A 014 013 000 +173 033 03F 01E 01E 03F 033 +174 004 000 004 000 004 000 +175 004 00A 004 00A 004 000 +176 004 00A 015 00A 004 000 +177 00E 01B 015 01B 00E 000 +180 000 01A 016 01A 016 01A +181 000 00C 033 02D 033 00C +182 000 012 00C 00C 012 01E +183 005 00E 01F 00E 014 000 +184 000 03C 004 017 004 03C +185 008 008 014 015 014 008 +186 004 002 01D 01D 002 004 +187 004 00E 01B 01B 00E 004 +188 020 038 028 028 038 020 +189 038 03E 03A 03A 03E 038 +190 03F 03F 03F 012 012 000 +191 017 030 03E 030 017 010 +192 018 02A 022 014 008 000 +193 03F 038 03F 007 03F 000 +194 03C 03C 032 00E 000 000 +195 000 03F 033 012 01E 00C +196 014 016 017 00F 016 010 +197 01C 01E 001 031 00E 00C +198 01C 01C 014 022 03E 03E +199 008 008 01C 037 01C 008 +200 000 02F 018 013 01E 004 +201 007 03F 007 00A 012 022 +202 000 01E 006 01A 03A 030 +203 008 03E 001 009 01D 023 +204 018 038 038 005 003 007 +205 000 01C 014 01C 000 000 +206 03E 03E 022 03E 03E 000 +207 008 008 036 036 036 008 +208 000 00C 01E 00C 000 000 +209 00C 00C 033 033 033 00C +210 01C 016 01F 016 01C 000 +211 008 01F 009 009 00F 000 +212 008 03B 00A 00A 00A 00E +213 01B 00B 00B 00B 00F 000 +214 03F 03F 021 022 021 03F +215 008 014 01C 008 00F 000 +216 03F 021 027 02B 02F 03F +217 03D 006 003 039 029 039 +218 03E 020 02C 024 02C 020 +219 03F 030 02E 02E 02E 021 +220 014 03E 022 03E 014 014 +221 03F 02E 02E 02E 02E 02E +222 000 03E 03A 03E 022 03E +223 020 010 008 007 03D 007 +224 000 00C 012 01B 003 000 +225 020 011 00E 00A 00E 001 +226 034 036 006 01C 01C 018 +227 004 00E 01F 004 00C 000 +228 020 013 00F 00F 01C 01D +229 03E 014 014 014 03E 000 +230 03C 03C 020 038 00C 000 diff --git a/symbols/tone6b.sym b/symbols/tone6b.sym new file mode 100644 index 0000000..6884934 --- /dev/null +++ b/symbols/tone6b.sym @@ -0,0 +1,70 @@ + -6 -6 79/11/07.ASSORTED TONES FOR PLOTTING + 1 00D 013 00A 014 013 000 + 2 00A 00A 00A 00A 000 000 + 3 000 015 00A 000 000 000 + 4 000 003 000 00C 000 000 + 5 011 015 01F 015 011 000 + 6 01F 015 01B 015 01F 000 + 7 000 00A 000 00A 000 000 + 8 01F 011 015 011 01F 000 + 9 01F 01F 01F 01F 01F 000 + 10 000 000 004 000 000 000 + 11 000 03F 000 000 03F 000 + 12 012 012 012 012 012 012 + 13 008 010 020 001 002 004 + 14 004 002 001 020 010 008 + 15 024 012 009 024 012 009 + 16 009 012 024 009 012 024 + 17 01C 038 031 023 007 00E + 18 00E 007 023 031 038 01C + 19 038 030 020 001 003 007 + 20 007 003 001 020 030 038 + 21 021 012 00C 00C 012 021 + 22 033 03F 01E 01E 03F 033 + 23 004 000 004 000 004 000 + 24 000 00A 004 00A 000 000 + 25 004 00A 000 00A 004 000 + 26 004 00A 004 00A 004 000 + 27 004 00A 015 00A 004 000 + 28 00E 01B 015 01B 00E 000 + 29 00C 012 012 012 00C 000 + 30 011 00A 015 00A 011 000 + 31 03F 03F 03F 03F 03F 03F + 32 00D 01B 036 02D 01B 036 + 33 02C 036 01B 02D 036 01B + 34 030 018 00C 006 003 001 + 35 003 006 00C 018 030 008 + 36 00C 018 030 021 003 006 + 37 00C 006 003 021 030 018 + 38 003 007 00E 01C 038 030 + 39 030 038 01C 00E 007 003 + 40 007 00F 01F 03E 03C 038 + 41 038 03C 03E 01F 00F 007 + 42 008 008 01C 01C 03E 008 + 43 02D 012 02D 02D 012 02D + 44 015 02A 015 02A 015 02A + 45 000 000 008 01C 03E 000 + 46 000 03F 000 000 03F 000 + 47 000 000 000 000 03F 000 + 48 03F 000 03F 03F 000 03F + 49 028 002 014 001 028 002 + 50 008 008 03E 008 008 000 + 51 000 002 008 000 004 000 + 52 01F 03B 02F 03E 037 03D + 54 000 01C 01C 01C 000 000 + 55 008 01C 03E 01C 008 000 + 56 020 020 010 001 008 002 + 57 003 003 00C 00C 030 030 + 58 000 01E 01E 01E 01E 000 + 59 03F 03F 021 021 03F 03F + 60 024 00A 011 024 012 029 + 61 001 000 004 000 010 020 + 62 01D 011 013 01F 007 03F + 63 03C 03C 033 033 00F 00C + 64 000 000 03F 03F 000 000 + 65 03F 020 020 020 020 020 + 66 020 020 010 001 008 002 + 67 01D 010 010 01C 000 009 + 68 03F 021 021 021 021 03F + 69 000 000 00C 00C 000 000 + 70 000 03F 000 03F 000 03F diff --git a/tcl/admin.layer b/tcl/admin.layer new file mode 100644 index 0000000..056b847 --- /dev/null +++ b/tcl/admin.layer @@ -0,0 +1,96 @@ +#fGIS Layer file. Layer type: raster +# Layer: áÄÍÉÎÉÓÔÒÁÔÉ×ÎÙÅ ÏÂÌÁÓÔÉ òæ +set _raster_ [raster ../testdata/admin.epp] +set _legend_ [legend parse {-2 áÄÍÉÎÉÓÔÒÁÔÉ×ÎÙÅ ÏÂÌÁÓÔÉ òæ +1 ›òÅÓÐÕÂÌÉËÁ âÁÛËÏÒÔÏÓÔÁÎ +2 ›òÅÓÐÕÂÌÉËÁ âÕÒÑÔÉÑ +3 ›òÅÓÐÕÂÌÉËÁ äÁÇÅÓÔÁÎ +4 ›ëÁÂÁÒÄÉÎÏ-âÁÌËÁÒÓËÁÑ òÅÓÐÕÂÌÉËÁ +5 ›òÅÓÐÕÂÌÉËÁ ëÁÌÍÙËÉÑ-èÁÌØÍÇ ôÁÎÇÞ +6 ›òÅÓÐÕÂÌÉËÁ ëÁÒÅÌÉÑ +7 ›òÅÓÐÕÂÌÉËÁ ëÏÍÉ +8 ›òÅÓÐÕÂÌÉËÁ íÁÒÉÊ üÌ +9 ›íÏÒÄÏ×ÓËÁÑ óóò +10 ›óÅ×ÅÒÏ-ïÓÅÔÉÎÓËÁÑ óóò +11 ›òÅÓÐÕÂÌÉËÁ ôÁÔÁÒÓÔÁÎ +12 ›òÅÓÐÕÂÌÉËÁ ôÕ×Á +13 ›õÄÍÕÒÔÓËÁÑ òÅÓÐÕÂÌÉËÁ +14 ›þÅÞÅÎÓËÁÑ É éÎÇÕÛÓËÁÑ ÒÅÓÐÕÂÌÉËÉ +15 ›þÕ×ÁÛÓËÁÑ òÅÓÐÕÂÌÉËÁ +16 ›òÅÓÐÕÂÌÉËÁ óÁÈÁ (ñËÕÔÉÑ) +17 ›áÌÔÁÊÓËÉÊ ËÒÁÊ +18 ›òÅÓÐÕÂÌÉËÁ áÌÔÁÊ +19 ›ëÒÁÓÎÏÄÁÒÓËÉÊ ËÒÁÊ +20 ›òÅÓÐÕÂÌÉËÁ áÄÙÇÅÑ +21 ›ëÒÁÓÎÏÑÒÓËÉÊ ËÒÁÊ +22 ›òÅÓÐÕÂÌÉËÁ èÁËÁÓÓÉÑ +23 ›ôÁÊÍÙÒÓËÉÊ Á×Ô.ÏËÒÕÇ +24 ›ü×ÅÎËÉÊÓËÉÊ Á×Ô.ÏËÒÕÇ +25 ›ðÒÉÍÏÒÓËÉÊ ËÒÁÊ +26 ›óÔÁ×ÒÏÐÏÌØÓËÉÊ ËÒÁÊ +27 ›ëÁÒÁÞÁÅ×Ï-þÅÒËÅÓÓËÁÑ òÅÓÐÕÂÌÉËÁ +28 ›èÁÂÁÒÏ×ÓËÉÊ ËÒÁÊ +29 ›å×ÒÅÊÓËÁÑ Á×Ô.ÏÂÌÁÓÔØ +30 ›áÍÕÒÓËÁÑ +31 ›áÒÈÁÎÇÅÌØÓËÁÑ +32 ›îÅÎÅÃËÉÊ Á×Ô.ÏËÒÕÇ +33 ›áÓÔÒÁÈÁÎÓËÁÑ +34 ›âÅÌÇÏÒÏÄÓËÁÑ +35 ›âÒÑÎÓËÁÑ +36 ›÷ÌÁÄÉÍÉÒÓËÁÑ +37 ›÷ÏÌÇÏÇÒÁÄÓËÁÑ +38 ›÷ÏÌÏÇÏÄÓËÁÑ +39 ›÷ÏÒÏÎÅÖÓËÁÑ +40 ›îÉÖÅÇÏÒÏÄÓËÁÑ +41 ›é×ÁÎÏ×ÓËÁÑ +42 ›éÒËÕÔÓËÁÑ +43 ›õÓÔØ-ïÒÄÙÎÓËÉÊ âÕÒÑÔÓËÉÊ Á×Ô.ÏËÒ +44 ›ëÁÌÉÎÉÎÇÒÁÄÓËÁÑ +45 ›ô×ÅÒÓËÁÑ +46 ›ëÁÌÕÖÓËÁÑ +47 ›ëÁÍÞÁÔÓËÁÑ +48 ›ëÏÒÑËÓËÉÊ Á×Ô.ÏËÒÕÇ +49 ›ëÅÍÅÒÏ×ÓËÁÑ +50 ›ëÉÒÏ×ÓËÁÑ +51 ›ëÏÓÔÒÏÍÓËÁÑ +52 ›óÁÍÁÒÓËÁÑ +53 ›ëÕÒÇÁÎÓËÁÑ +54 ›ëÕÒÓËÁÑ +55 ›ìÅÎÉÎÇÒÁÄÓËÁÑ +56 ›ìÉÐÅÃËÁÑ +57 ›íÁÇÁÄÁÎÓËÁÑ +58 ›þÕËÏÔÓËÉÊ Á×Ô.ÏËÒÕÇ +59 ›íÏÓËÏ×ÓËÁÑ +60 ›íÕÒÍÁÎÓËÁÑ +61 ›îÏ×ÇÏÒÏÄÓËÁÑ +62 ›îÏ×ÏÓÉÂÉÒÓËÁÑ +63 ›ïÍÓËÁÑ +64 ›ïÒÅÎÂÕÒÇÓËÁÑ +65 ›ïÒÌÏ×ÓËÁÑ +66 ›ðÅÎÚÅÎÓËÁÑ +67 ›ðÅÒÍÓËÁÑ +68 ›ëÏÍÉ-ðÅÒÍÑÃËÉÊ Á×Ô.ÏËÒÕÇ +69 ›ðÓËÏ×ÓËÁÑ +70 ›òÏÓÔÏ×ÓËÁÑ +71 ›òÑÚÁÎÓËÁÑ +72 ›óÁÒÁÔÏ×ÓËÁÑ +73 ›óÁÈÁÌÉÎÓËÁÑ +74 ›åËÁÔÅÒÉÎÂÕÒÇÓËÁÑ +75 ›óÍÏÌÅÎÓËÁÑ +76 ›ôÁÍÂÏ×ÓËÁÑ +77 ›ôÏÍÓËÁÑ +78 ›ôÕÌØÓËÁÑ +79 ›ôÀÍÅÎÓËÁÑ +80 ›èÁÎÔÙ-íÁÎÓÉÊÓËÉÊ Á×Ô.ÏËÒÕÇ +81 ›ñÍÁÌÏ-îÅÎÅÃËÉÊ Á×Ô.ÏËÒÕÇ +82 ›õÌØÑÎÏ×ÓËÁÑ +83 ›þÅÌÑÂÉÎÓËÁÑ +84 ›þÉÔÉÎÓËÁÑ +85 ›áÇÉÎÓËÉÊ âÕÒÑÔÓËÉÊ Á×Ô.ÏËÒÕÇ +86 ›ñÒÏÓÌÁ×ÓËÁÑ +}] +layer create raster -raster $_raster_\ + -border none -ovrborder yes -ovrcolor black\ + -title { áÄÍÉÎÉÓÔÒÁÔÉ×ÎÙÅ ÏÂÌÁÓÔÉ òæ}\ + -legend $_legend_ + diff --git a/tcl/balloonhelp.tcl b/tcl/balloonhelp.tcl new file mode 100644 index 0000000..3f0ce51 --- /dev/null +++ b/tcl/balloonhelp.tcl @@ -0,0 +1,225 @@ +## balloonhelp.tcl +## Balloon Help Routines +## +## Jeffrey Hobbs +## Initiated: 28 October 1996 +## + +##------------------------------------------------------------------------ +## PROCEDURE +## balloonhelp +## +## DESCRIPTION +## Implements a balloon help system +## +## ARGUMENTS +## balloonhelp