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: l

⟦3f7fa102a⟧

    Length: 4829 (0x12dd)
    Names: »lsearch.3c«

Derivation

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

Default Hex Dump

0x0000…0020 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_┆
0x0020…0040 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┆
0x0040…0060 69 6f 6e 73 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 73 65 61 72 63 68 28 33 63 29 0a 0a 0a 0a   ┆ions             lsearch(3c)    ┆
0x0060…0080 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    ┆
0x0080…00a0 20 20 6c 73 65 61 72 63 68 2c 20 6c 66 69 6e 64 20 2d 20 6c 69 6e 65 61 72 20 73 65 61 72 63 68   ┆  lsearch, lfind - linear search┆
0x00a0…00c0 20 61 6e 64 20 75 70 64 61 74 65 0a 0a 53 08 53 08 53 08 53 59 08 59 08 59 08 59 4e 08 4e 08 4e   ┆ and update  S S S SY Y Y YN N N┆
0x00c0…00e0 08 4e 54 08 54 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   ┆ NT T T TA A A AX X X X      # #┆
0x00e0…0100 08 23 08 23 69 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   ┆ # #i i i in n n nc c c cl l l l┆
0x0100…0120 75 08 75 08 75 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   ┆u u u ud d d de e e e < < < <s s┆
0x0120…0140 08 73 08 73 65 08 65 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   ┆ s se e e ea a a ar r r rc c c c┆
0x0140…0160 68 08 68 08 68 08 68 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   ┆h h h h. . . .h h h h> > > >    ┆
0x0160…0180 20 20 20 76 08 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   ┆   v v v vo o o oi i i id d d d ┆
0x0180…01a0 2a 08 2a 08 2a 08 2a 6c 08 6c 08 6c 08 6c 73 08 73 08 73 08 73 65 08 65 08 65 08 65 61 08 61 08   ┆* * * *l l l ls s s se e e ea a ┆
0x01a0…01c0 61 08 61 72 08 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   ┆a ar r r rc c c ch h h h( ( ( (k┆
0x01c0…01e0 08 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 62 08 62 08   ┆ k k ke e e ey y y y, , , , b b ┆
0x01e0…0200 62 08 62 61 08 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   ┆b ba a a as s s se e e e, , , , ┆
0x0200…0220 6e 08 6e 08 6e 08 6e 65 08 65 08 65 08 65 6c 08 6c 08 6c 08 6c 70 08 70 08 70 08 70 2c 08 2c 08   ┆n n n ne e e el l l lp p p p, , ┆
0x0220…0240 2c 08 2c 20 77 08 77 08 77 08 77 69 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74   ┆, , w w w wi i i id d d dt t t t┆
0x0240…0260 68 08 68 08 68 08 68 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   ┆h h h h, , , , c c c co o o om m┆
0x0260…0280 08 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   ┆ m mp p p pa a a ar r r r) ) ) )┆
0x0280…02a0 0a 20 20 20 20 20 76 08 76 08 76 08 76 6f 08 6f 08 6f 08 6f 69 08 69 08 69 08 69 64 08 64 08 64   ┆      v v v vo o o oi i i id d d┆
0x02a0…02c0 08 64 20 2a 08 2a 08 2a 08 2a 62 08 62 08 62 08 62 61 08 61 08 61 08 61 73 08 73 08 73 08 73 65   ┆ d * * * *b b b ba a a as s s se┆
0x02c0…02e0 08 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 2a 08 2a 08 2a 08 2a 6b 08 6b 08 6b 08 6b 65 08 65 08   ┆ e e e, , , , * * * *k k k ke e ┆
0x02e0…0300 65 08 65 79 08 79 08 79 08 79 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 73 08 73 08 73 08 73 69 08   ┆e ey y y y; ; ; ;      s s s si ┆
0x0300…0320 69 08 69 08 69 7a 08 7a 08 7a 08 7a 65 08 65 08 65 08 65 5f 08 5f 08 5f 08 5f 74 08 74 08 74 08   ┆i i iz z z ze e e e_ _ _ _t t t ┆
0x0320…0340 74 20 77 08 77 08 77 08 77 69 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68 08   ┆t w w w wi i i id d d dt t t th ┆
0x0340…0360 68 08 68 08 68 2c 08 2c 08 2c 08 2c 20 2a 08 2a 08 2a 08 2a 6e 08 6e 08 6e 08 6e 65 08 65 08 65   ┆h h h, , , , * * * *n n n ne e e┆
0x0360…0380 08 65 6c 08 6c 08 6c 08 6c 70 08 70 08 70 08 70 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 69 08 69   ┆ el l l lp p p p; ; ; ;      i i┆
0x0380…03a0 08 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 28 08 28 08 28 08 28 2a 08 2a 08 2a 08 2a   ┆ i in n n nt t t t( ( ( (* * * *┆
0x03a0…03c0 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 08 61 08   ┆c c c co o o om m m mp p p pa a ┆
0x03c0…03e0 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 08 29 08 29 08 29 3b   ┆a ar r r r) ) ) )( ( ( () ) ) );┆
0x03e0…0400 08 3b 08 3b 08 3b 0a 0a 20 20 20 20 20 76 08 76 08 76 08 76 6f 08 6f 08 6f 08 6f 69 08 69 08 69   ┆ ; ; ;       v v v vo o o oi i i┆
0x0400…0420 08 69 64 08 64 08 64 08 64 20 2a 08 2a 08 2a 08 2a 6c 08 6c 08 6c 08 6c 66 08 66 08 66 08 66 69   ┆ id d d d * * * *l l l lf f f fi┆
0x0420…0440 08 69 08 69 08 69 6e 08 6e 08 6e 08 6e 64 08 64 08 64 08 64 28 08 28 08 28 08 28 6b 08 6b 08 6b   ┆ i i in n n nd d d d( ( ( (k k k┆
0x0440…0460 08 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   ┆ ke e e ey y y y, , , , b b b ba┆
0x0460…0480 08 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   ┆ a a as s s se e e e, , , , n n ┆
0x0480…04a0 6e 08 6e 65 08 65 08 65 08 65 6c 08 6c 08 6c 08 6c 70 08 70 08 70 08 70 2c 08 2c 08 2c 08 2c 20   ┆n ne e e el l l lp p p p, , , , ┆
0x04a0…04c0 77 08 77 08 77 08 77 69 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68 08 68 08   ┆w w w wi i i id d d dt t t th h ┆
0x04c0…04e0 68 08 68 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 6d 08 6d   ┆h h, , , , c c c co o o om m m m┆
0x04e0…0500 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 20 20 20   ┆p p p pa a a ar r r r) ) ) )    ┆
0x0500…0520 20 20 76 08 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   ┆  v v v vo o o oi i i id d d d *┆
0x0520…0540 08 2a 08 2a 08 2a 6c 08 6c 08 6c 08 6c 73 08 73 08 73 08 73 65 08 65 08 65 08 65 61 08 61 08 61   ┆ * * *l l l ls s s se e e ea a a┆
0x0540…0560 08 61 72 08 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   ┆ ar r r rc c c ch h h h( ( ( (k ┆
0x0560…0580 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 62 08 62 08 62   ┆k k ke e e ey y y y, , , , b b b┆
0x0580…05a0 08 62 61 08 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   ┆ ba a a as s s se e e e, , , , n┆
0x05a0…05c0 08 6e 08 6e 08 6e 65 08 65 08 65 08 65 6c 08 6c 08 6c 08 6c 70 08 70 08 70 08 70 2c 08 2c 08 2c   ┆ n n ne e e el l l lp p p p, , ,┆
0x05c0…05e0 08 2c 20 77 08 77 08 77 08 77 69 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68   ┆ , w w w wi i i id d d dt t t th┆
0x05e0…0600 08 68 08 68 08 68 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   ┆ h h h, , , , c c c co o o om m ┆
0x0600…0620 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) ) ) ) ┆
0x0620…0640 20 20 20 20 20 76 08 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   ┆     v v v vo o o oi i i id d d ┆
0x0640…0660 64 20 2a 08 2a 08 2a 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   ┆d * * * *b b b ba a a as s s se ┆
0x0660…0680 65 08 65 08 65 2c 08 2c 08 2c 08 2c 20 2a 08 2a 08 2a 08 2a 6b 08 6b 08 6b 08 6b 65 08 65 08 65   ┆e e e, , , , * * * *k k k ke e e┆
0x0680…06a0 08 65 79 08 79 08 79 08 79 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 73 08 73 08 73 08 73 69 08 69   ┆ ey y y y; ; ; ;      s s s si i┆
0x06a0…06c0 08 69 08 69 7a 08 7a 08 7a 08 7a 65 08 65 08 65 08 65 5f 08 5f 08 5f 08 5f 74 08 74 08 74 08 74   ┆ i iz z z ze e e e_ _ _ _t t t t┆
0x06c0…06e0 20 77 08 77 08 77 08 77 69 08 69 08 69 08 69 64 08 64 08 64 08 64 74 08 74 08 74 08 74 68 08 68   ┆ w w w wi i i id d d dt t t th h┆
0x06e0…0700 08 68 08 68 2c 08 2c 08 2c 08 2c 20 2a 08 2a 08 2a 08 2a 6e 08 6e 08 6e 08 6e 65 08 65 08 65 08   ┆ h h, , , , * * * *n n n ne e e ┆
0x0700…0720 65 6c 08 6c 08 6c 08 6c 70 08 70 08 70 08 70 3b 08 3b 08 3b 08 3b 0a 20 20 20 20 20 69 08 69 08   ┆el l l lp p p p; ; ; ;      i i ┆
0x0720…0740 69 08 69 6e 08 6e 08 6e 08 6e 74 08 74 08 74 08 74 28 08 28 08 28 08 28 2a 08 2a 08 2a 08 2a 63   ┆i in n n nt t t t( ( ( (* * * *c┆
0x0740…0760 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 08 61 08 61   ┆ c c co o o om m m mp p p pa a a┆
0x0760…0780 08 61 72 08 72 08 72 08 72 29 08 29 08 29 08 29 28 08 28 08 28 08 28 29 08 29 08 29 08 29 3b 08   ┆ ar r r r) ) ) )( ( ( () ) ) ); ┆
0x0780…07a0 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 08 53 43 08 43 08   ┆; ; ;  D D D DE E E ES S S SC C ┆
0x07a0…07c0 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 49   ┆C CR R R RI I I IP P P PT T T TI┆
0x07c0…07e0 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 5f 08 6c 5f 08 73   ┆ I I IO O O ON N N N      _ l_ s┆
0x07e0…0800 5f 08 65 5f 08 61 5f 08 72 5f 08 63 5f 08 68 20 69 73 20 61 20 6c 69 6e 65 61 72 20 73 65 61 72   ┆_ e_ a_ r_ c_ h is a linear sear┆
0x0800…0820 63 68 20 72 6f 75 74 69 6e 65 2e 20 20 49 74 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65   ┆ch routine.  It returns a pointe┆
0x0820…0840 72 0a 20 20 20 20 20 69 6e 74 6f 20 61 20 74 61 62 6c 65 20 69 6e 64 69 63 61 74 69 6e 67 20 77   ┆r      into a table indicating w┆
0x0840…0860 68 65 72 65 20 61 20 64 61 74 75 6d 20 6d 61 79 20 62 65 20 66 6f 75 6e 64 2e 20 20 49 66 20 74   ┆here a datum may be found.  If t┆
0x0860…0880 68 65 0a 20 20 20 20 20 64 61 74 75 6d 20 64 6f 65 73 20 6e 6f 74 20 6f 63 63 75 72 2c 20 69 74   ┆he      datum does not occur, it┆
0x0880…08a0 20 69 73 20 61 64 64 65 64 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 74 61 62 6c   ┆ is added at the end of the tabl┆
0x08a0…08c0 65 2e 0a 20 20 20 20 20 5f 08 6b 5f 08 65 5f 08 79 20 70 6f 69 6e 74 73 20 74 6f 20 74 68 65 20   ┆e.      _ k_ e_ y points to the ┆
0x08c0…08e0 64 61 74 75 6d 20 74 6f 20 62 65 20 73 6f 75 67 68 74 20 69 6e 20 74 68 65 20 74 61 62 6c 65 2e   ┆datum to be sought in the table.┆
0x08e0…0900 20 20 5f 08 62 5f 08 61 5f 08 73 5f 08 65 0a 20 20 20 20 20 70 6f 69 6e 74 73 20 74 6f 20 74 68   ┆  _ b_ a_ s_ e      points to th┆
0x0900…0920 65 20 66 69 72 73 74 20 65 6c 65 6d 65 6e 74 20 69 6e 20 74 68 65 20 74 61 62 6c 65 2e 20 20 5f   ┆e first element in the table.  _┆
0x0920…0940 08 6e 5f 08 65 5f 08 6c 5f 08 70 20 70 6f 69 6e 74 73 20 74 6f 20 61 6e 0a 20 20 20 20 20 69 6e   ┆ n_ e_ l_ p points to an      in┆
0x0940…0960 74 65 67 65 72 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 63 75 72 72 65 6e 74 20 6e 75 6d   ┆teger containing the current num┆
0x0960…0980 62 65 72 20 6f 66 20 65 6c 65 6d 65 6e 74 73 20 69 6e 20 74 68 65 0a 20 20 20 20 20 74 61 62 6c   ┆ber of elements in the      tabl┆
0x0980…09a0 65 2e 20 20 54 68 65 20 69 6e 74 65 67 65 72 20 69 73 20 69 6e 63 72 65 6d 65 6e 74 65 64 20 69   ┆e.  The integer is incremented i┆
0x09a0…09c0 66 20 74 68 65 20 64 61 74 75 6d 20 69 73 20 61 64 64 65 64 20 74 6f 0a 20 20 20 20 20 74 68 65   ┆f the datum is added to      the┆
0x09c0…09e0 20 74 61 62 6c 65 2e 20 20 5f 08 77 5f 08 69 5f 08 64 5f 08 74 5f 08 68 20 69 73 20 74 68 65 20   ┆ table.  _ w_ i_ d_ t_ h is the ┆
0x09e0…0a00 73 69 7a 65 20 6f 66 20 61 6e 20 65 6c 65 6d 65 6e 74 20 69 6e 20 62 79 74 65 73 2e 20 5f 08 63   ┆size of an element in bytes. _ c┆
0x0a00…0a20 5f 08 6f 5f 08 6d 5f 08 70 5f 08 61 5f 08 72 0a 20 20 20 20 20 69 73 20 61 20 70 6f 69 6e 74 65   ┆_ o_ m_ p_ a_ r      is a pointe┆
0x0a20…0a40 72 20 74 6f 20 74 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 74 68 61   ┆r to the comparison function tha┆
0x0a40…0a60 74 20 74 68 65 20 75 73 65 72 20 6d 75 73 74 0a 20 20 20 20 20 73 75 70 70 6c 79 20 28 5f 08 73   ┆t the user must      supply (_ s┆
0x0a60…0a80 5f 08 74 5f 08 72 5f 08 63 5f 08 6d 5f 08 70 2c 20 66 6f 72 20 65 78 61 6d 70 6c 65 29 2e 20 20   ┆_ t_ r_ c_ m_ p, for example).  ┆
0x0a80…0aa0 49 74 20 69 73 20 63 61 6c 6c 65 64 20 77 69 74 68 20 74 77 6f 20 61 72 67 75 2d 0a 20 20 20 20   ┆It is called with two argu-     ┆
0x0aa0…0ac0 20 6d 65 6e 74 73 20 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   ┆ ments that point to the element┆
0x0ac0…0ae0 73 20 62 65 69 6e 67 20 63 6f 6d 70 61 72 65 64 2e 20 20 54 68 65 20 66 75 6e 63 2d 0a 20 20 20   ┆s being compared.  The func-    ┆
0x0ae0…0b00 20 20 74 69 6f 6e 20 6d 75 73 74 20 72 65 74 75 72 6e 20 7a 65 72 6f 20 69 66 20 74 68 65 20 65   ┆  tion must return zero if the e┆
0x0b00…0b20 6c 65 6d 65 6e 74 73 20 61 72 65 20 65 71 75 61 6c 20 61 6e 64 20 6e 6f 6e 2d 7a 65 72 6f 0a 20   ┆lements are equal and non-zero  ┆
0x0b20…0b40 20 20 20 20 6f 74 68 65 72 77 69 73 65 2e 0a 0a 20 20 20 20 20 5f 08 6c 5f 08 66 5f 08 69 5f 08   ┆    otherwise.       _ l_ f_ i_ ┆
0x0b40…0b60 6e 5f 08 64 20 69 73 20 74 68 65 20 73 61 6d 65 20 61 73 20 5f 08 6c 5f 08 73 5f 08 65 5f 08 61   ┆n_ d is the same as _ l_ s_ e_ a┆
0x0b60…0b80 5f 08 72 5f 08 63 5f 08 68 20 65 78 63 65 70 74 20 74 68 61 74 20 69 66 20 74 68 65 20 64 61 74   ┆_ r_ c_ h except that if the dat┆
0x0b80…0ba0 75 6d 20 69 73 20 6e 6f 74 0a 20 20 20 20 20 66 6f 75 6e 64 2c 20 69 74 20 69 73 20 6e 6f 74 20   ┆um is not      found, it is not ┆
0x0ba0…0bc0 61 64 64 65 64 20 74 6f 20 74 68 65 20 74 61 62 6c 65 2e 20 49 6e 73 74 65 61 64 2c 20 61 20 6e   ┆added to the table. Instead, a n┆
0x0bc0…0be0 75 6c 6c 20 70 6f 69 6e 74 65 72 0a 20 20 20 20 20 69 73 20 72 65 74 75 72 6e 65 64 2e 0a 0a 4e   ┆ull pointer      is returned.  N┆
0x0be0…0c00 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 54 08 54 08 54 08 54 45 08 45 08 45 08 45 53 08 53 08 53   ┆ N N NO O O OT T T TE E E ES S S┆
0x0c00…0c20 08 53 0a 20 20 20 20 20 54 68 65 20 70 6f 69 6e 74 65 72 73 20 74 6f 20 74 68 65 20 6b 65 79 20   ┆ S      The pointers to the key ┆
0x0c20…0c40 61 6e 64 20 74 68 65 20 65 6c 65 6d 65 6e 74 20 61 74 20 74 68 65 20 62 61 73 65 20 6f 66 20 74   ┆and the element at the base of t┆
0x0c40…0c60 68 65 0a 20 20 20 20 20 74 61 62 6c 65 20 6d 61 79 20 62 65 20 70 6f 69 6e 74 65 72 73 20 74 6f   ┆he      table may be pointers to┆
0x0c60…0c80 20 61 6e 79 20 74 79 70 65 2e 0a 0a 20 20 20 20 20 54 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20   ┆ any type.       The comparison ┆
0x0c80…0ca0 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 ┆
0x0ca0…0cc0 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┆
0x0cc0…0ce0 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┆
0x0ce0…0d00 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┆
0x0d00…0d20 6e 67 20 63 6f 6d 70 61 72 65 64 2e 0a 0a 20 20 20 20 20 54 68 65 20 76 61 6c 75 65 20 72 65 74   ┆ng compared.       The value ret┆
0x0d20…0d40 75 72 6e 65 64 20 73 68 6f 75 6c 64 20 62 65 20 63 61 73 74 20 69 6e 74 6f 20 74 79 70 65 20 70   ┆urned should be cast into type p┆
0x0d40…0d60 6f 69 6e 74 65 72 2d 74 6f 2d 0a 20 20 20 20 20 65 6c 65 6d 65 6e 74 2e 0a 0a 45 08 45 08 45 08   ┆ointer-to-      element.  E E E ┆
0x0d60…0d80 45 58 08 58 08 58 08 58 41 08 41 08 41 08 41 4d 08 4d 08 4d 08 4d 50 08 50 08 50 08 50 4c 08 4c   ┆EX X X XA A A AM M M MP P P PL L┆
0x0d80…0da0 08 4c 08 4c 45 08 45 08 45 08 45 0a 20 20 20 20 20 54 68 69 73 20 70 72 6f 67 72 61 6d 20 77 69   ┆ L LE E E E      This program wi┆
0x0da0…0dc0 6c 6c 20 72 65 61 64 20 69 6e 20 6c 65 73 73 20 74 68 61 6e 20 54 41 42 53 49 5a 45 20 73 74 72   ┆ll read in less than TABSIZE str┆
0x0dc0…0de0 69 6e 67 73 20 6f 66 0a 20 20 20 20 20 6c 65 6e 67 74 68 20 6c 65 73 73 20 74 68 61 6e 20 45 4c   ┆ings of      length less than EL┆
0x0de0…0e00 53 49 5a 45 20 61 6e 64 20 73 74 6f 72 65 20 74 68 65 6d 20 69 6e 20 61 20 74 61 62 6c 65 2c 20   ┆SIZE and store them in a table, ┆
0x0e00…0e20 65 6c 69 6d 69 6e 61 74 2d 0a 20 20 20 20 20 69 6e 67 20 64 75 70 6c 69 63 61 74 65 73 2c 20 61   ┆eliminat-      ing duplicates, a┆
0x0e20…0e40 6e 64 20 74 68 65 6e 20 77 69 6c 6c 20 70 72 69 6e 74 20 65 61 63 68 20 65 6e 74 72 79 2e 0a 0a   ┆nd then will print each entry.  ┆
0x0e40…0e60 20 20 20 20 20 20 20 20 20 20 23 69 6e 63 6c 75 64 65 20 3c 73 65 61 72 63 68 2e 68 3e 0a 20 20   ┆          #include <search.h>   ┆
0x0e60…0e80 20 20 20 20 20 20 20 20 23 69 6e 63 6c 75 64 65 20 3c 73 74 72 69 6e 67 2e 68 3e 0a 20 20 20 20   ┆        #include <string.h>     ┆
0x0e80…0ea0 20 20 20 20 20 20 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 6f 2e 68 3e 0a 0a 20 20 20 20 20 20   ┆      #include <stdio.h>        ┆
0x0ea0…0ec0 20 20 20 20 23 64 65 66 69 6e 65 20 54 41 42 53 49 5a 45 20 35 30 0a 20 20 20 20 20 20 20 20 20   ┆    #define TABSIZE 50          ┆
0x0ec0…0ee0 20 23 64 65 66 69 6e 65 20 45 4c 53 49 5a 45 20 31 32 30 0a 0a 0a 0a 0a 0a 0a 0a 20 20 20 20 20   ┆ #define ELSIZE 120             ┆
0x0ee0…0f00 20 20 20 20 20 6d 61 69 6e 28 29 0a 20 20 20 20 20 20 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20   ┆     main()           {         ┆
0x0f00…0f20 20 20 20 20 20 20 20 63 68 61 72 20 6c 69 6e 65 5b 45 4c 53 49 5a 45 5d 3b 0a 20 20 20 20 20 20   ┆       char line[ELSIZE];       ┆
0x0f20…0f40 20 20 20 20 20 20 20 20 20 63 68 61 72 20 74 61 62 5b 54 41 42 53 49 5a 45 5d 5b 45 4c 53 49 5a   ┆         char tab[TABSIZE][ELSIZ┆
0x0f40…0f60 45 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 69 7a 65 5f 74 20 6e 65 6c 20 3d 20   ┆E];                size_t nel = ┆
0x0f60…0f80 30 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 6e 74 20 69 3b 0a 0a 20 20 20 20 20 20   ┆0;                int i;        ┆
0x0f80…0fa0 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 66 67 65 74 73 28 6c 69 6e 65 2c 20 45 4c 53 49   ┆         while (fgets(line, ELSI┆
0x0fa0…0fc0 5a 45 2c 20 73 74 64 69 6e 29 20 21 3d 20 4e 55 4c 4c 20 26 26 0a 20 20 20 20 20 20 20 20 20 20   ┆ZE, stdin) != NULL &&           ┆
0x0fc0…0fe0 20 20 20 20 20 20 20 20 20 20 6e 65 6c 20 3c 20 54 41 42 53 49 5a 45 29 0a 20 20 20 20 20 20 20   ┆          nel < TABSIZE)        ┆
0x0fe0…1000 20 20 20 20 20 20 20 20 20 20 20 20 20 28 76 6f 69 64 29 20 6c 73 65 61 72 63 68 28 6c 69 6e 65   ┆             (void) lsearch(line┆
0x1000…1020 2c 20 74 61 62 2c 20 26 6e 65 6c 2c 20 45 4c 53 49 5a 45 2c 20 6d 79 63 6d 70 29 3b 0a 20 20 20   ┆, tab, &nel, ELSIZE, mycmp);    ┆
0x1020…1040 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 28 20 69 20 3d 20 30 3b 20 69 20 3c 20 6e 65 6c 3b   ┆            for( i = 0; i < nel;┆
0x1040…1060 20 69 2b 2b 20 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 76 6f 69 64   ┆ i++ )                     (void┆
0x1060…1080 29 66 70 75 74 73 28 74 61 62 5b 69 5d 2c 20 73 74 64 6f 75 74 29 3b 0a 20 20 20 20 20 20 20 20   ┆)fputs(tab[i], stdout);         ┆
0x1080…10a0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 30 3b 0a 20 20 20 20 20 20 20 20 20 20 7d 0a 0a 53 08   ┆       return 0;           }  S ┆
0x10a0…10c0 53 08 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   ┆S S SE E E EE E E E A A A AL L L┆
0x10c0…10e0 08 4c 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   ┆ LS S S SO O O O      Library Fu┆
0x10e0…1100 6e 63 74 69 6f 6e 20 28 33 29 3a 20 62 73 65 61 72 63 68 2c 20 68 73 65 61 72 63 68 2c 20 74 73   ┆nction (3): bsearch, hsearch, ts┆
0x1100…1120 65 61 72 63 68 0a 0a 4e 08 4e 08 4e 08 4e 4f 08 4f 08 4f 08 4f 54 08 54 08 54 08 54 45 08 45 08   ┆earch  N N N NO O O OT T T TE E ┆
0x1120…1140 45 08 45 53 08 53 08 53 08 53 0a 20 20 20 20 20 49 66 20 74 68 65 20 73 65 61 72 63 68 65 64 2d   ┆E ES S S S      If the searched-┆
0x1140…1160 66 6f 72 20 64 61 74 75 6d 20 69 73 20 66 6f 75 6e 64 2c 20 62 6f 74 68 20 5f 08 6c 5f 08 73 5f   ┆for datum is found, both _ l_ s_┆
0x1160…1180 08 65 5f 08 61 5f 08 72 5f 08 63 5f 08 68 20 61 6e 64 20 5f 08 6c 5f 08 66 5f 08 69 5f 08 6e 5f   ┆ e_ a_ r_ c_ h and _ l_ f_ i_ n_┆
0x1180…11a0 08 64 0a 20 20 20 20 20 72 65 74 75 72 6e 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 69 74 2e 20   ┆ d      return a pointer to it. ┆
0x11a0…11c0 20 4f 74 68 65 72 77 69 73 65 2c 20 5f 08 6c 5f 08 66 5f 08 69 5f 08 6e 5f 08 64 20 72 65 74 75   ┆ Otherwise, _ l_ f_ i_ n_ d retu┆
0x11c0…11e0 72 6e 73 20 4e 55 4c 4c 20 61 6e 64 0a 20 20 20 20 20 5f 08 6c 5f 08 73 5f 08 65 5f 08 61 5f 08   ┆rns NULL and      _ l_ s_ e_ a_ ┆
0x11e0…1200 72 5f 08 63 5f 08 68 20 72 65 74 75 72 6e 73 20 61 20 70 6f 69 6e 74 65 72 20 74 6f 20 74 68 65   ┆r_ c_ h returns a pointer to the┆
0x1200…1220 20 6e 65 77 6c 79 20 61 64 64 65 64 20 65 6c 65 6d 65 6e 74 2e 0a 0a 20 20 20 20 20 55 6e 64 65   ┆ newly added element.       Unde┆
0x1220…1240 66 69 6e 65 64 20 72 65 73 75 6c 74 73 20 63 61 6e 20 6f 63 63 75 72 20 69 66 20 74 68 65 72 65   ┆fined results can occur if there┆
0x1240…1260 20 69 73 20 6e 6f 74 20 65 6e 6f 75 67 68 20 72 6f 6f 6d 20 69 6e 0a 20 20 20 20 20 74 68 65 20   ┆ is not enough room in      the ┆
0x1260…1280 74 61 62 6c 65 20 74 6f 20 61 64 64 20 61 20 6e 65 77 20 69 74 65 6d 2e 0a 0a 44 65 63 65 6d 62   ┆table to add a new item.  Decemb┆
0x1280…12a0 65 72 20 31 39 39 30 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   ┆er 1990                         ┆
0x12a0…12c0 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     ┆
0x12c0…12dd 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a            ┆                             ┆