|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: b
Length: 2605 (0xa2d)
Names: »bsearch.3c«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./bsd/usr/man/cat3/bsearch.3c«
0x000…020 0a 0a 0a 5f 08 4f 5f 08 6e 5f 08 6c 5f 08 69 5f 08 6e 5f 08 65 20 5f 08 4d 5f 08 61 5f 08 6e 5f ┆ _ O_ n_ l_ i_ n_ e _ M_ a_ n_┆ 0x020…040 08 75 5f 08 61 5f 08 6c 20 20 20 20 20 20 20 20 20 20 20 4c 69 62 72 61 72 79 20 46 75 6e 63 74 ┆ u_ a_ l Library Funct┆ 0x040…060 69 6f 6e 73 20 20 20 20 20 20 20 20 20 20 20 20 20 62 73 65 61 72 63 68 28 33 63 29 0a 0a 0a 0a ┆ions bsearch(3c) ┆ 0x060…080 4e 08 4e 08 4e 08 4e 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 45 08 45 08 45 08 45 0a 20 20 20 ┆N N N NA A A AM M M ME E E E ┆ 0x080…0a0 20 20 62 73 65 61 72 63 68 20 2d 20 62 69 6e 61 72 79 20 73 65 61 72 63 68 0a 0a 53 08 53 08 53 ┆ bsearch - binary search S S S┆ 0x0a0…0c0 08 53 59 08 59 08 59 08 59 4e 08 4e 08 4e 08 4e 54 08 54 08 54 08 54 41 08 41 08 41 08 41 58 08 ┆ SY Y Y YN N N NT T T TA A A AX ┆ 0x0c0…0e0 58 08 58 08 58 0a 20 20 20 20 20 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 ┆X X X c c c ch h h ha a a a┆ 0x0e0…100 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 62 08 62 08 62 08 62 73 08 73 08 73 08 73 65 08 65 ┆r r r r * * * *b b b bs s s se e┆ 0x100…120 08 65 08 65 61 08 61 08 61 08 61 72 08 72 08 72 08 72 63 08 63 08 63 08 63 68 08 68 08 68 08 68 ┆ e ea a a ar r r rc c c ch h h h┆ 0x120…140 20 28 08 28 08 28 08 28 28 08 28 08 28 08 28 63 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 ┆ ( ( ( (( ( ( (c c c ch h h ha a┆ 0x140…160 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 2a 08 2a 29 08 29 08 29 08 29 20 6b 08 6b 08 6b ┆ a ar r r r * * * *) ) ) ) k k k┆ 0x160…180 08 6b 65 08 65 08 65 08 65 79 08 79 08 79 08 79 2c 08 2c 08 2c 08 2c 20 28 08 28 08 28 08 28 63 ┆ ke e e ey y y y, , , , ( ( ( (c┆ 0x180…1a0 08 63 08 63 08 63 68 08 68 08 68 08 68 61 08 61 08 61 08 61 72 08 72 08 72 08 72 20 2a 08 2a 08 ┆ c c ch h h ha a a ar r r r * * ┆ 0x1a0…1c0 2a 08 2a 29 08 29 08 29 08 29 20 62 08 62 08 62 08 62 61 08 61 08 61 08 61 73 08 73 08 73 08 73 ┆* *) ) ) ) b b b ba a a as s s s┆ 0x1c0…1e0 65 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 6e 08 6e 08 6e 08 6e 65 08 65 08 65 08 65 6c 08 6c ┆e e e e, , , , n n n ne e e el l┆ 0x1e0…200 08 6c 08 6c 2c 08 2c 08 2c 08 2c 20 73 08 73 08 73 08 73 69 08 69 08 69 08 69 7a 08 7a 08 7a 08 ┆ l l, , , , s s s si i i iz z z ┆ 0x200…220 7a 65 08 65 08 65 08 65 6f 08 6f 08 6f 08 6f 66 08 66 08 66 08 66 0a 20 20 20 20 20 28 08 28 08 ┆ze e e eo o o of f f f ( ( ┆ 0x220…240 28 08 28 2a 08 2a 08 2a 08 2a 6b 08 6b 08 6b 08 6b 65 08 65 08 65 08 65 79 08 79 08 79 08 79 29 ┆( (* * * *k k k ke e e ey y y y)┆ 0x240…260 08 29 08 29 08 29 2c 08 2c 08 2c 08 2c 20 63 08 63 08 63 08 63 6f 08 6f 08 6f 08 6f 6d 08 6d 08 ┆ ) ) ), , , , c c c co o o om m ┆ 0x260…280 6d 08 6d 70 08 70 08 70 08 70 61 08 61 08 61 08 61 72 08 72 08 72 08 72 29 08 29 08 29 08 29 0a ┆m mp p p pa a a ar r r r) ) ) ) ┆ 0x280…2a0 20 20 20 20 20 75 08 75 08 75 08 75 6e 08 6e 08 6e 08 6e 73 08 73 08 73 08 73 69 08 69 08 69 08 ┆ u u u un n n ns s s si i i ┆ 0x2a0…2c0 69 67 08 67 08 67 08 67 6e 08 6e 08 6e 08 6e 65 08 65 08 65 08 65 64 08 64 08 64 08 64 20 6e 08 ┆ig g g gn n n ne e e ed d d d n ┆ 0x2c0…2e0 6e 08 6e 08 6e 65 08 65 08 65 08 65 6c 08 6c 08 6c 08 6c 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 ┆n n ne e e el l l l; ; ; ; ┆ 0x2e0…300 69 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 20 28 08 28 08 28 08 28 2a 08 2a ┆i i i in n n nt t t t ( ( ( (* *┆ 0x300…320 08 2a 08 2a 63 08 63 08 63 08 63 6f 08 6f 08 6f 08 6f 6d 08 6d 08 6d 08 6d 70 08 70 08 70 08 70 ┆ * *c c c co o o om m m mp p p p┆ 0x320…340 61 08 61 08 61 08 61 72 08 72 08 72 08 72 29 08 29 08 29 08 29 28 08 28 08 28 08 28 20 29 08 29 ┆a a a ar r r r) ) ) )( ( ( ( ) )┆ 0x340…360 08 29 08 29 3b 08 3b 08 3b 08 3b 0a 0a 44 08 44 08 44 08 44 45 08 45 08 45 08 45 53 08 53 08 53 ┆ ) ); ; ; ; D D D DE E E ES S S┆ 0x360…380 08 53 43 08 43 08 43 08 43 52 08 52 08 52 08 52 49 08 49 08 49 08 49 50 08 50 08 50 08 50 54 08 ┆ SC C C CR R R RI I I IP P P PT ┆ 0x380…3a0 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e 08 4e 08 4e 08 4e 0a 20 20 20 20 20 ┆T T TI I I IO O O ON N N N ┆ 0x3a0…3c0 5f 08 62 5f 08 73 5f 08 65 5f 08 61 5f 08 72 5f 08 63 5f 08 68 20 69 73 20 61 20 62 69 6e 61 72 ┆_ b_ s_ e_ a_ r_ c_ h is a binar┆ 0x3c0…3e0 79 20 73 65 61 72 63 68 20 72 6f 75 74 69 6e 65 20 67 65 6e 65 72 61 6c 69 7a 65 64 20 66 72 6f ┆y search routine generalized fro┆ 0x3e0…400 6d 20 4b 6e 75 74 68 0a 20 20 20 20 20 28 36 2e 32 2e 31 29 20 41 6c 67 6f 72 69 74 68 6d 20 42 ┆m Knuth (6.2.1) Algorithm B┆ 0x400…420 2e 20 20 49 74 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 72 20 69 6e 74 6f 20 61 20 74 ┆. It returns a pointer into a t┆ 0x420…440 61 62 6c 65 0a 20 20 20 20 20 69 6e 64 69 63 61 74 69 6e 67 20 77 68 65 72 65 20 61 20 64 61 74 ┆able indicating where a dat┆ 0x440…460 75 6d 20 6d 61 79 20 62 65 20 66 6f 75 6e 64 2e 20 20 54 68 65 20 74 61 62 6c 65 20 6d 75 73 74 ┆um may be found. The table must┆ 0x460…480 20 62 65 0a 20 20 20 20 20 70 72 65 76 69 6f 75 73 6c 79 20 73 6f 72 74 65 64 20 69 6e 20 69 6e ┆ be previously sorted in in┆ 0x480…4a0 63 72 65 61 73 69 6e 67 20 6f 72 64 65 72 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 61 20 70 72 ┆creasing order according to a pr┆ 0x4a0…4c0 6f 2d 0a 20 20 20 20 20 76 69 64 65 64 20 63 6f 6d 70 61 72 69 73 6f 6e 20 66 75 6e 63 74 69 6f ┆o- vided comparison functio┆ 0x4c0…4e0 6e 2e 20 20 5f 08 4b 5f 08 65 5f 08 79 20 70 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 64 61 74 75 ┆n. _ K_ e_ y points to the datu┆ 0x4e0…500 6d 20 74 6f 20 62 65 0a 20 20 20 20 20 73 6f 75 67 68 74 20 69 6e 20 74 68 65 20 74 61 62 6c 65 ┆m to be sought in the table┆ 0x500…520 2e 20 20 5f 08 42 5f 08 61 5f 08 73 5f 08 65 20 70 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 65 6c ┆. _ B_ a_ s_ e points to the el┆ 0x520…540 65 6d 65 6e 74 20 61 74 20 74 68 65 20 62 61 73 65 0a 20 20 20 20 20 6f 66 20 74 68 65 20 74 61 ┆ement at the base of the ta┆ 0x540…560 62 6c 65 2e 20 20 5f 08 4e 5f 08 65 5f 08 6c 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 ┆ble. _ N_ e_ l is the number of┆ 0x560…580 20 65 6c 65 6d 65 6e 74 73 20 69 6e 20 74 68 65 20 74 61 62 6c 65 2e 0a 20 20 20 20 20 5f 08 43 ┆ elements in the table. _ C┆ 0x580…5a0 5f 08 6f 5f 08 6d 5f 08 70 5f 08 61 5f 08 72 20 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 ┆_ o_ m_ p_ a_ r is the name of t┆ 0x5a0…5c0 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 66 75 6e 63 74 69 6f 6e 2c 20 77 68 69 63 68 20 69 73 ┆he comparison function, which is┆ 0x5c0…5e0 0a 20 20 20 20 20 63 61 6c 6c 65 64 20 77 69 74 68 20 74 77 6f 20 61 72 67 75 6d 65 6e 74 73 20 ┆ called with two arguments ┆ 0x5e0…600 74 68 61 74 20 70 6f 69 6e 74 20 74 6f 20 74 68 65 20 65 6c 65 6d 65 6e 74 73 20 62 65 69 6e 67 ┆that point to the elements being┆ 0x600…620 0a 20 20 20 20 20 63 6f 6d 70 61 72 65 64 2e 20 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 6d 75 ┆ compared. The function mu┆ 0x620…640 73 74 20 72 65 74 75 72 6e 20 61 6e 20 69 6e 74 65 67 65 72 20 6c 65 73 73 20 74 68 61 6e 2c 0a ┆st return an integer less than, ┆ 0x640…660 20 20 20 20 20 65 71 75 61 6c 20 74 6f 2c 20 6f 72 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 7a ┆ equal to, or greater than z┆ 0x660…680 65 72 6f 20 61 63 63 6f 72 64 69 6e 67 20 61 73 20 74 68 65 20 66 69 72 73 74 20 61 72 67 75 2d ┆ero according as the first argu-┆ 0x680…6a0 0a 20 20 20 20 20 6d 65 6e 74 20 69 73 20 74 6f 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 6c ┆ ment is to be considered l┆ 0x6a0…6c0 65 73 73 20 74 68 61 6e 2c 20 65 71 75 61 6c 20 74 6f 2c 20 6f 72 20 67 72 65 61 74 65 72 0a 20 ┆ess than, equal to, or greater ┆ 0x6c0…6e0 20 20 20 20 74 68 61 6e 20 74 68 65 20 73 65 63 6f 6e 64 2e 0a 0a 44 08 44 08 44 08 44 49 08 49 ┆ than the second. D D D DI I┆ 0x6e0…700 08 49 08 49 41 08 41 08 41 08 41 47 08 47 08 47 08 47 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f ┆ I IA A A AG G G GN N N NO O O O┆ 0x700…720 53 08 53 08 53 08 53 54 08 54 08 54 08 54 49 08 49 08 49 08 49 43 08 43 08 43 08 43 53 08 53 08 ┆S S S ST T T TI I I IC C C CS S ┆ 0x720…740 53 08 53 0a 20 20 20 20 20 41 20 4e 08 4e 08 4e 08 4e 55 08 55 08 55 08 55 4c 08 4c 08 4c 08 4c ┆S S A N N N NU U U UL L L L┆ 0x740…760 4c 08 4c 08 4c 08 4c 20 70 6f 69 6e 74 65 72 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 66 20 74 ┆L L L L pointer is returned if t┆ 0x760…780 68 65 20 6b 65 79 20 63 61 6e 6e 6f 74 20 62 65 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 0a 20 20 ┆he key cannot be found in the ┆ 0x780…7a0 20 20 20 74 61 62 6c 65 2e 0a 0a 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 54 08 54 08 54 08 54 ┆ table. N N N NO O O OT T T T┆ 0x7a0…7c0 45 08 45 08 45 08 45 53 08 53 08 53 08 53 0a 20 20 20 20 20 54 68 65 20 70 6f 69 6e 74 65 72 73 ┆E E E ES S S S The pointers┆ 0x7c0…7e0 20 74 6f 20 74 68 65 20 6b 65 79 20 61 6e 64 20 74 68 65 20 65 6c 65 6d 65 6e 74 20 61 74 20 74 ┆ to the key and the element at t┆ 0x7e0…800 68 65 20 62 61 73 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 74 61 62 6c 65 20 73 68 6f 75 6c 64 ┆he base of the table should┆ 0x800…820 20 62 65 20 6f 66 20 74 79 70 65 20 70 6f 69 6e 74 65 72 2d 74 6f 2d 65 6c 65 6d 65 6e 74 2c 20 ┆ be of type pointer-to-element, ┆ 0x820…840 61 6e 64 20 63 61 73 74 20 74 6f 20 74 79 70 65 0a 20 20 20 20 20 70 6f 69 6e 74 65 72 2d 74 6f ┆and cast to type pointer-to┆ 0x840…860 2d 63 68 61 72 61 63 74 65 72 2e 0a 20 20 20 20 20 54 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 ┆-character. The comparison ┆ 0x860…880 66 75 6e 63 74 69 6f 6e 20 6e 65 65 64 20 6e 6f 74 20 63 6f 6d 70 61 72 65 20 65 76 65 72 79 20 ┆function need not compare every ┆ 0x880…8a0 62 79 74 65 2c 20 73 6f 0a 20 20 20 20 20 61 72 62 69 74 72 61 72 79 20 64 61 74 61 20 6d 61 79 ┆byte, so arbitrary data may┆ 0x8a0…8c0 20 62 65 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 65 20 65 6c 65 6d 65 6e 74 73 20 69 6e ┆ be contained in the elements in┆ 0x8c0…8e0 20 61 64 64 69 74 69 6f 6e 0a 20 20 20 20 20 74 6f 20 74 68 65 20 76 61 6c 75 65 73 20 62 65 69 ┆ addition to the values bei┆ 0x8e0…900 6e 67 20 63 6f 6d 70 61 72 65 64 2e 0a 20 20 20 20 20 41 6c 74 68 6f 75 67 68 20 64 65 63 6c 61 ┆ng compared. Although decla┆ 0x900…920 72 65 64 20 61 73 20 74 79 70 65 20 70 6f 69 6e 74 65 72 2d 74 6f 2d 63 68 61 72 61 63 74 65 72 ┆red as type pointer-to-character┆ 0x920…940 2c 20 74 68 65 20 76 61 6c 75 65 0a 20 20 20 20 20 72 65 74 75 72 6e 65 64 20 73 68 6f 75 6c 64 ┆, the value returned should┆ 0x940…960 20 62 65 20 63 61 73 74 20 69 6e 74 6f 20 74 79 70 65 20 70 6f 69 6e 74 65 72 2d 74 6f 2d 65 6c ┆ be cast into type pointer-to-el┆ 0x960…980 65 6d 65 6e 74 2e 0a 0a 53 08 53 08 53 08 53 45 08 45 08 45 08 45 45 08 45 08 45 08 45 20 41 08 ┆ement. S S S SE E E EE E E E A ┆ 0x980…9a0 41 08 41 08 41 4c 08 4c 08 4c 08 4c 53 08 53 08 53 08 53 4f 08 4f 08 4f 08 4f 0a 20 20 20 20 20 ┆A A AL L L LS S S SO O O O ┆ 0x9a0…9c0 4c 69 62 72 61 72 79 20 46 75 6e 63 74 69 6f 6e 73 20 28 33 29 3a 20 20 6c 73 65 61 72 63 68 2c ┆Library Functions (3): lsearch,┆ 0x9c0…9e0 20 68 73 65 61 72 63 68 2c 20 71 73 6f 72 74 2c 20 74 73 65 61 72 63 68 0a 0a 4d 61 72 63 68 20 ┆ hsearch, qsort, tsearch March ┆ 0x9e0…a00 31 39 38 39 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ┆1989 ┆ 0xa00…a20 20 20 54 58 20 50 72 6f 67 72 61 6d 6d 65 72 27 73 20 52 65 66 65 72 65 6e 63 65 0a 0a 0a 0a 0a ┆ TX Programmer's Reference ┆ 0xa20…a2d 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ┆ ┆