home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat3 / bsearch.0 < prev    next >
Text File  |  1993-12-07  |  2KB  |  67 lines

  1.  
  2. BSEARCH(3)                 UNIX Programmer's Manual                 BSEARCH(3)
  3.  
  4. NNAAMMEE
  5.      bbsseeaarrcchh - binary search of a sorted table
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttddlliibb..hh>>
  9.  
  10.      _v_o_i_d _*
  11.      bbsseeaarrcchh(_c_o_n_s_t _v_o_i_d _*_k_e_y, _c_o_n_s_t _v_o_i_d _*_b_a_s_e, _s_i_z_e___t _n_m_e_m_b, _s_i_z_e___t _s_i_z_e,
  12.              _i_n_t _(_*_c_o_m_p_a_r_) _(_c_o_n_s_t _v_o_i_d _*_, _c_o_n_s_t _v_o_i_d _*_))
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      The bbsseeaarrcchh() function searches an array of _n_m_e_m_b objects, the inital
  16.      member of which is pointed to by _b_a_s_e, for a member that matches the ob­
  17.      ject pointed to by _k_e_y. The size of each member of the array is specified
  18.      by _s_i_z_e.
  19.  
  20.      The contents of the array should be in ascending sorted order according
  21.      to the comparison function referenced by _c_o_m_p_a_r. The _c_o_m_p_a_r routine is
  22.      expected to have two two arguments which point to the _k_e_y object and to
  23.      an array member, in that order, and should return an integer less than,
  24.      equal to, or greater than zero if the _k_e_y object is found, respectively,
  25.      to be less than, to match, or be greater than the array member.
  26.  
  27. RREETTUURRNN VVAALLUUEESS
  28.      The bbsseeaarrcchh() function returns a pointer to a matching member of the ar­
  29.      ray, or a null pointer if no match is found.  If two members compare as
  30.      equal, which member is matched is unspecified.
  31.  
  32. SSEEEE AALLSSOO
  33.      db(3),  lsearch(3),  qsort(3),
  34.  
  35. SSTTAANNDDAARRDDSS
  36.      The bbsseeaarrcchh() function conforms to ANSI C3.159­1989 (``ANSI C'').
  37.  
  38. BSD Experimental                 June 29, 1991                               1
  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.