home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / c / cuj9301.zip / 1101082A < prev    next >
Text File  |  1992-11-10  |  1KB  |  55 lines

  1. ////////////
  2. // isam.h //
  3. ////////////
  4.  
  5. #ifndef isam_h
  6. #define isam_h
  7. extern "C" {
  8.     #include <cbtree.h>            // CBTREE header
  9.     #include <btfio.h>            // CBTREE header
  10. }
  11.  
  12. typedef char *(*t_func)(char *);
  13. typedef int (*rel_func)(char *);
  14.  
  15. class Isam
  16. {
  17. private:
  18.     int         elements, fd[2], btr[10], indices, backingout;
  19.     long     *    loc;
  20.     char     **    oldrec, * okey, * nkey, ** inames;
  21.     BTC      *    btc;                        // CBTREE specific
  22.     int    getxxx    (int index, int opt); // CBTREE specific
  23.     void     backout    (int ele, char op, int index = -1,
  24.                     int result = 0);
  25. public:
  26.     char     **    rec;
  27.  
  28.             Isam        (const char *datafilename, int e = 1);
  29.             ~Isam        ();
  30.  
  31.     int    read        (const char *key, int ele_limit = 0,
  32.                             int idx = 0, int ele = 0);
  33.     int    write       ();
  34.     void    clear        ();
  35.     int    getfirst    (int index = 0);
  36.     int    getnext    (int index = 0);
  37.     int    getge        (char *key, int index = 0);
  38.     int    keynum     (const char *btname);
  39.     void    reindex    (rel_func func);
  40. };
  41.  
  42. char *     nospace(const char *arg);
  43. int         eprintf(const char *format, ...);
  44. char *    ToUpper(const char *c);
  45.  
  46. ///////////////////////////////
  47. // catalog utility functions //
  48. ///////////////////////////////
  49.  
  50. int         catalog_number (char *name);
  51. t_func    cataloged_func    (int f     );
  52.  
  53. #endif
  54.  
  55.