DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: b

⟦7bb34fa7e⟧

    Length: 3094 (0xc16)
    Names: »bsearch.3c«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/man/cat3/bsearch.3c« 

Default Hex Dump

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 20 73 6f 72 74 65 64   ┆  bsearch - binary search sorted┆
0x0a0…0c0 20 74 61 62 6c 65 0a 0a 53 08 53 08 53 08 53 59 08 59 08 59 08 59 4e 08 4e 08 4e 08 4e 54 08 54   ┆ table  S S S SY Y Y YN N N NT T┆
0x0c0…0e0 08 54 08 54 41 08 41 08 41 08 41 58 08 58 08 58 08 58 0a 20 20 20 20 20 23 08 23 08 23 08 23 69   ┆ T TA A A AX X X X      # # # #i┆
0x0e0…100 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 63 08 63 08 63 08 63 6c 08 6c 08 6c 08 6c 75 08 75 08 75   ┆ i i in n n nc c c cl l l lu u u┆
0x100…120 08 75 64 08 64 08 64 08 64 65 08 65 08 65 08 65 20 3c 08 3c 08 3c 08 3c 73 08 73 08 73 08 73 74   ┆ ud d d de e e e < < < <s s s st┆
0x120…140 08 74 08 74 08 74 64 08 64 08 64 08 64 6c 08 6c 08 6c 08 6c 69 08 69 08 69 08 69 62 08 62 08 62   ┆ t t td d d dl l l li i i ib b b┆
0x140…160 08 62 2e 08 2e 08 2e 08 2e 68 08 68 08 68 08 68 3e 08 3e 08 3e 08 3e 0a 0a 20 20 20 20 20 76 08   ┆ b. . . .h h h h> > > >       v ┆
0x160…180 76 08 76 08 76 6f 08 6f 08 6f 08 6f 69 08 69 08 69 08 69 64 08 64 08 64 08 64 20 2a 08 2a 08 2a   ┆v v vo o o oi i i id d d d * * *┆
0x180…1a0 08 2a 62 08 62 08 62 08 62 73 08 73 08 73 08 73 65 08 65 08 65 08 65 61 08 61 08 61 08 61 72 08   ┆ *b b b bs s s se e e ea a a ar ┆
0x1a0…1c0 72 08 72 08 72 63 08 63 08 63 08 63 68 08 68 08 68 08 68 28 08 28 08 28 08 28 6b 08 6b 08 6b 08   ┆r r rc c c ch h h h( ( ( (k k k ┆
0x1c0…1e0 6b 65 08 65 08 65 08 65 79 08 79 08 79 08 79 2c 08 2c 08 2c 08 2c 20 62 08 62 08 62 08 62 61 08   ┆ke e e ey y y y, , , , b b b ba ┆
0x1e0…200 61 08 61 08 61 73 08 73 08 73 08 73 65 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 6e 08 6e 08 6e   ┆a a as s s se e e e, , , , n n n┆
0x200…220 08 6e 65 08 65 08 65 08 65 6c 08 6c 08 6c 08 6c 2c 08 2c 08 2c 08 2c 20 77 08 77 08 77 08 77 69   ┆ ne e e el l l l, , , , w w w wi┆
0x220…240 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68 08 68 08 68 08 68 2c 08 2c 08 2c   ┆ i i id d d dt t t th h h h, , ,┆
0x240…260 08 2c 20 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 61   ┆ , c c c co o o om m m mp p p pa┆
0x260…280 08 61 08 61 08 61 72 08 72 08 72 08 72 29 08 29 08 29 08 29 0a 20 20 20 20 20 76 08 76 08 76 08   ┆ a a ar r r r) ) ) )      v v v ┆
0x280…2a0 76 6f 08 6f 08 6f 08 6f 69 08 69 08 69 08 69 64 08 64 08 64 08 64 20 2a 08 2a 08 2a 08 2a 6b 08   ┆vo o o oi i i id d d d * * * *k ┆
0x2a0…2c0 6b 08 6b 08 6b 65 08 65 08 65 08 65 79 08 79 08 79 08 79 2c 08 2c 08 2c 08 2c 20 2a 08 2a 08 2a   ┆k k ke e e ey y y y, , , , * * *┆
0x2c0…2e0 08 2a 62 08 62 08 62 08 62 61 08 61 08 61 08 61 73 08 73 08 73 08 73 65 08 65 08 65 08 65 3b 08   ┆ *b b b ba a a as s s se e e e; ┆
0x2e0…300 3b 08 3b 08 3b 0a 20 20 20 20 20 73 08 73 08 73 08 73 69 08 69 08 69 08 69 7a 08 7a 08 7a 08 7a   ┆; ; ;      s s s si i i iz z z z┆
0x300…320 65 08 65 08 65 08 65 5f 08 5f 08 5f 08 5f 74 08 74 08 74 08 74 20 6e 08 6e 08 6e 08 6e 65 08 65   ┆e e e e_ _ _ _t t t t n n n ne e┆
0x320…340 08 65 08 65 6c 08 6c 08 6c 08 6c 2c 08 2c 08 2c 08 2c 20 77 08 77 08 77 08 77 69 08 69 08 69 08   ┆ e el l l l, , , , w w w wi i i ┆
0x340…360 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68 08 68 08 68 08 68 3b 08 3b 08 3b 08 3b 0a 20 20   ┆id d d dt t t th h h h; ; ; ;   ┆
0x360…380 20 20 20 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   ┆   i i i in n n nt t t t ( ( ( (┆
0x380…3a0 2a 08 2a 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   ┆* * * *c c c co o o om m m mp p ┆
0x3a0…3c0 70 08 70 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 29   ┆p pa a a ar r r r) ) ) )( ( ( ()┆
0x3c0…3e0 08 29 08 29 08 29 0a 0a 44 08 44 08 44 08 44 45 08 45 08 45 08 45 53 08 53 08 53 08 53 43 08 43   ┆ ) ) )  D D D DE E E ES S S SC C┆
0x3e0…400 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 54 08 54 08 54   ┆ C CR R R RI I I IP P P PT T T T┆
0x400…420 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 54 68 65 20 5f   ┆I I I IO O O ON N N N      The _┆
0x420…440 08 62 5f 08 73 5f 08 65 5f 08 61 5f 08 72 5f 08 63 5f 08 68 28 29 20 66 75 6e 63 74 69 6f 6e 20   ┆ b_ s_ e_ a_ r_ c_ h() function ┆
0x440…460 69 73 20 61 20 62 69 6e 61 72 79 20 73 65 61 72 63 68 20 72 6f 75 74 69 6e 65 2e 20 49 74 0a 20   ┆is a binary search routine. It  ┆
0x460…480 20 20 20 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 61 62   ┆    returns a pointer into a tab┆
0x480…4a0 6c 65 20 69 6e 64 69 63 61 74 69 6e 67 20 77 68 65 72 65 20 61 6e 20 65 6e 74 72 79 20 6d 61 79   ┆le indicating where an entry may┆
0x4a0…4c0 0a 20 20 20 20 20 62 65 20 66 6f 75 6e 64 2e 20 54 68 65 20 74 61 62 6c 65 20 6d 75 73 74 20 62   ┆      be found. The table must b┆
0x4c0…4e0 65 20 70 72 65 76 69 6f 75 73 6c 79 20 73 6f 72 74 65 64 20 69 6e 20 69 6e 63 72 65 61 73 69 6e   ┆e previously sorted in increasin┆
0x4e0…500 67 0a 20 20 20 20 20 6f 72 64 65 72 20 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 61 20 70 72 6f 76   ┆g      order according to a prov┆
0x500…520 69 64 65 64 20 63 6f 6d 70 61 72 69 73 6f 6e 20 72 6f 75 74 69 6e 65 2c 20 5f 08 63 5f 08 6f 5f   ┆ided comparison routine, _ c_ o_┆
0x520…540 08 6d 5f 08 70 5f 08 61 5f 08 72 2e 0a 20 20 20 20 20 54 68 65 20 5f 08 6b 5f 08 65 5f 08 79 20   ┆ m_ p_ a_ r.      The _ k_ e_ y ┆
0x540…560 61 72 67 75 6d 65 6e 74 20 70 6f 69 6e 74 73 20 74 6f 20 61 6e 20 65 6e 74 72 79 20 69 6e 73 74   ┆argument points to an entry inst┆
0x560…580 61 6e 63 65 20 74 6f 20 62 65 20 73 6f 75 67 68 74 20 69 6e 0a 20 20 20 20 20 74 68 65 20 74 61   ┆ance to be sought in      the ta┆
0x580…5a0 62 6c 65 2e 20 54 68 65 20 5f 08 62 5f 08 61 5f 08 73 5f 08 65 20 61 72 67 75 6d 65 6e 74 20 70   ┆ble. The _ b_ a_ s_ e argument p┆
0x5a0…5c0 6f 69 6e 74 73 20 74 6f 20 74 68 65 20 65 6c 65 6d 65 6e 74 20 61 74 20 74 68 65 0a 20 20 20 20   ┆oints to the element at the     ┆
0x5c0…5e0 20 62 61 73 65 20 6f 66 20 74 68 65 20 74 61 62 6c 65 2e 20 54 68 65 20 5f 08 6e 5f 08 65 5f 08   ┆ base of the table. The _ n_ e_ ┆
0x5e0…600 6c 20 61 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 6c 65 2d   ┆l argument is the number of ele-┆
0x600…620 0a 20 20 20 20 20 6d 65 6e 74 73 20 69 6e 20 74 68 65 20 74 61 62 6c 65 2e 20 54 68 65 20 5f 08   ┆      ments in the table. The _ ┆
0x620…640 77 5f 08 69 5f 08 64 5f 08 74 5f 08 68 20 61 72 67 75 6d 65 6e 74 20 69 73 20 74 68 65 20 73 69   ┆w_ i_ d_ t_ h argument is the si┆
0x640…660 7a 65 20 6f 66 20 61 6e 0a 20 20 20 20 20 65 6c 65 6d 65 6e 74 20 69 6e 20 62 79 74 65 73 2e 20   ┆ze of an      element in bytes. ┆
0x660…680 54 68 65 20 5f 08 63 5f 08 6f 5f 08 6d 5f 08 70 5f 08 61 5f 08 72 20 61 72 67 75 6d 65 6e 74 20   ┆The _ c_ o_ m_ p_ a_ r argument ┆
0x680…6a0 69 73 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 74 68 65 0a 20 20 20 20 20 63 6f 6d 70 61 72 69 73   ┆is the name of the      comparis┆
0x6a0…6c0 6f 6e 20 66 75 6e 63 74 69 6f 6e 2c 20 77 68 69 63 68 20 69 73 20 63 61 6c 6c 65 64 20 77 69 74   ┆on function, which is called wit┆
0x6c0…6e0 68 20 74 77 6f 20 61 72 67 75 6d 65 6e 74 73 20 74 68 61 74 0a 20 20 20 20 20 70 6f 69 6e 74 20   ┆h two arguments that      point ┆
0x6e0…700 74 6f 20 74 68 65 20 65 6c 65 6d 65 6e 74 73 20 62 65 69 6e 67 20 63 6f 6d 70 61 72 65 64 2e 20   ┆to the elements being compared. ┆
0x700…720 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 6d 75 73 74 0a 20 20 20 20 20 72 65 74 75 72 6e 20 61 6e   ┆The function must      return an┆
0x720…740 20 69 6e 74 65 67 65 72 20 6c 65 73 73 20 74 68 61 6e 2c 20 65 71 75 61 6c 20 74 6f 20 6f 72 20   ┆ integer less than, equal to or ┆
0x740…760 67 72 65 61 74 65 72 20 74 68 61 6e 20 7a 65 72 6f 0a 20 20 20 20 20 61 63 63 6f 72 64 69 6e 67   ┆greater than zero      according┆
0x760…780 20 74 6f 20 77 68 65 74 68 65 72 20 74 68 65 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74 20 69   ┆ to whether the first argument i┆
0x780…7a0 73 20 74 6f 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 0a 20 20 20 20 20 6c 65 73 73 20 74 68 61   ┆s to be considered      less tha┆
0x7a0…7c0 6e 2c 20 65 71 75 61 6c 20 74 6f 20 6f 72 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 74 68 65 20   ┆n, equal to or greater than the ┆
0x7c0…7e0 73 65 63 6f 6e 64 2e 0a 0a 52 08 52 08 52 08 52 45 08 45 08 45 08 45 54 08 54 08 54 08 54 55 08   ┆second.  R R R RE E E ET T T TU ┆
0x7e0…800 55 08 55 08 55 52 08 52 08 52 08 52 4e 08 4e 08 4e 08 4e 20 56 08 56 08 56 08 56 41 08 41 08 41   ┆U U UR R R RN N N N V V V VA A A┆
0x800…820 08 41 4c 08 4c 08 4c 08 4c 55 08 55 08 55 08 55 45 08 45 08 45 08 45 0a 20 20 20 20 20 5f 08 62   ┆ AL L L LU U U UE E E E      _ b┆
0x820…840 5f 08 73 5f 08 65 5f 08 61 5f 08 72 5f 08 63 5f 08 68 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69   ┆_ s_ e_ a_ r_ c_ h returns a poi┆
0x840…860 6e 74 65 72 20 74 6f 20 61 20 6d 61 74 63 68 69 6e 67 20 6d 65 6d 65 62 65 72 20 6f 66 20 74 68   ┆nter to a matching memeber of th┆
0x860…880 65 0a 20 20 20 20 20 61 72 72 61 79 2c 20 6f 72 20 61 20 6e 75 6c 6c 20 70 6f 69 6e 74 65 72 20   ┆e      array, or a null pointer ┆
0x880…8a0 69 66 20 6e 6f 20 6d 61 74 63 68 20 69 73 20 66 6f 75 6e 64 2e 20 20 49 66 20 74 77 6f 20 6f 72   ┆if no match is found.  If two or┆
0x8a0…8c0 0a 20 20 20 20 20 6d 6f 72 65 20 6d 65 6d 62 65 72 73 20 63 6f 6d 70 61 72 65 20 65 71 75 61 6c   ┆      more members compare equal┆
0x8c0…8e0 2c 20 77 68 69 63 68 20 6d 65 6d 62 65 72 20 69 73 20 72 65 74 75 72 6e 65 64 20 69 73 0a 20 20   ┆, which member is returned is   ┆
0x8e0…900 20 20 20 75 6e 73 70 65 63 69 66 69 65 64 2e 0a 0a 45 08 45 08 45 08 45 52 08 52 08 52 08 52 52   ┆   unspecified.  E E E ER R R RR┆
0x900…920 08 52 08 52 08 52 4f 08 4f 08 4f 08 4f 52 08 52 08 52 08 52 53 08 53 08 53 08 53 0a 20 20 20 20   ┆ R R RO O O OR R R RS S S S     ┆
0x920…940 20 4e 6f 20 65 72 72 6f 72 73 20 61 72 65 20 64 65 66 69 6e 65 64 2e 0a 0a 41 08 41 08 41 08 41   ┆ No errors are defined.  A A A A┆
0x940…960 50 08 50 08 50 08 50 50 08 50 08 50 08 50 4c 08 4c 08 4c 08 4c 49 08 49 08 49 08 49 43 08 43 08   ┆P P P PP P P PL L L LI I I IC C ┆
0x960…980 43 08 43 41 08 41 08 41 08 41 54 08 54 08 54 08 54 49 08 49 08 49 08 49 4f 08 4f 08 4f 08 4f 4e   ┆C CA A A AT T T TI I I IO O O ON┆
0x980…9a0 08 4e 08 4e 08 4e 20 55 08 55 08 55 08 55 53 08 53 08 53 08 53 41 08 41 08 41 08 41 47 08 47 08   ┆ N N N U U U US S S SA A A AG G ┆
0x9a0…9c0 47 08 47 45 08 45 08 45 08 45 0a 20 20 20 20 20 54 68 65 20 70 6f 69 6e 74 65 72 73 20 74 6f 20   ┆G GE E E E      The pointers to ┆
0x9c0…9e0 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 68 65 20 62   ┆the key and the element at the b┆
0x9e0…a00 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 20 62 65 20   ┆ase of the      table should be ┆
0xa00…a20 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 61 6e 64 20   ┆of type pointer-to-element, and ┆
0xa20…a40 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 2d 76 6f 69   ┆cast to type      pointer-to-voi┆
0xa40…a60 64 2e 0a 0a 20 20 20 20 20 54 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 66 75 6e 63 74 69 6f 6e   ┆d.       The comparison function┆
0xa60…a80 20 6e 65 65 64 20 6e 6f 74 20 63 6f 6d 70 61 72 65 20 65 76 65 72 79 20 62 79 74 65 2c 20 73 6f   ┆ need not compare every byte, so┆
0xa80…aa0 0a 20 20 20 20 20 61 72 62 69 74 72 61 72 79 20 64 61 74 61 20 6d 61 79 20 62 65 20 63 6f 6e 74   ┆      arbitrary data may be cont┆
0xaa0…ac0 61 69 6e 65 64 20 69 6e 20 74 68 65 20 65 6c 65 6d 65 6e 74 73 20 69 6e 20 61 64 64 69 74 69 6f   ┆ained in the elements in additio┆
0xac0…ae0 6e 0a 20 20 20 20 20 74 6f 20 74 68 65 20 76 61 6c 75 65 73 20 62 65 69 6e 67 20 63 6f 6d 70 61   ┆n      to the values being compa┆
0xae0…b00 72 65 64 2e 0a 0a 20 20 20 20 20 41 6c 74 68 6f 75 67 68 20 64 65 63 6c 61 72 65 64 20 61 73 20   ┆red.       Although declared as ┆
0xb00…b20 74 79 70 65 20 70 6f 69 6e 74 65 72 2d 74 6f 2d 76 6f 69 64 2c 20 74 68 65 20 76 61 6c 75 65 0a   ┆type pointer-to-void, the value ┆
0xb20…b40 20 20 20 20 20 72 65 74 75 72 6e 65 64 20 73 68 6f 75 6c 64 20 62 65 20 63 61 73 74 20 69 6e 74   ┆     returned should be cast int┆
0xb40…b60 6f 20 74 79 70 65 20 70 6f 69 6e 74 65 72 2d 74 6f 2d 65 6c 65 6d 65 6e 74 2e 0a 0a 53 08 53 08   ┆o type pointer-to-element.  S S ┆
0xb60…b80 53 08 53 45 08 45 08 45 08 45 45 08 45 08 45 08 45 20 41 08 41 08 41 08 41 4c 08 4c 08 4c 08 4c   ┆S SE E E EE E E E A A A AL L L L┆
0xb80…ba0 53 08 53 08 53 08 53 4f 08 4f 08 4f 08 4f 0a 20 20 20 20 20 4c 69 62 72 61 72 79 20 46 75 6e 63   ┆S S S SO O O O      Library Func┆
0xba0…bc0 74 69 6f 6e 73 20 28 33 29 3a 20 6c 73 65 61 72 63 68 2c 20 68 73 65 61 72 63 68 2c 20 71 73 6f   ┆tions (3): lsearch, hsearch, qso┆
0xbc0…be0 72 74 2c 20 74 73 65 61 72 63 68 0a 0a 44 65 63 65 6d 62 65 72 20 31 39 39 30 20 20 20 20 20 20   ┆rt, tsearch  December 1990      ┆
0xbe0…c00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 54 58 20 50 72 6f 67 72 61 6d 6d   ┆                     TX Programm┆
0xc00…c16 65 72 27 73 20 52 65 66 65 72 65 6e 63 65 0a 0a 0a 0a 0a 0a 0a 0a                                 ┆er's Reference        ┆