home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / MISC / BBENCH21.ZIP / SOURCE.ZIP / DB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-11  |  1.5 KB  |  65 lines

  1. /* database and file handling definitions for the byte benchmarks
  2. ** BYTE magazine, spring 1990
  3. ** Include when compiling benchfac.c and dbsubs.c.
  4. */
  5.  
  6. /* type codes */
  7. #define CHARCODE 0
  8. #define INTCODE 1
  9. #define CHARPTRCODE 2
  10. #define FLOATCODE 3
  11.  
  12. #define NAMESPACE 15
  13.  
  14. /* record structure definition */
  15.  
  16.     struct database_record {
  17.         unsigned int currflag;
  18.         unsigned int comp;    /* set for comparisons; 1=1st, 2=sec*/
  19.         unsigned int basenum;    /* set for baselines; 2=286, 3=386 */
  20.         unsigned int proc;
  21.         unsigned int mhz;
  22.         char name[NAMESPACE];
  23.         double sieveres;    /* test results */
  24.         double sortres;
  25.         double imathres;
  26.         double movbres;
  27.         double movwores;
  28.         double movweres;
  29.         double movdores;
  30.         double movderes;
  31.         double fourbangres;
  32.         double forres;
  33.         double fiorres;
  34.         double fiowres;
  35.         double tpres;
  36.         double seekres;
  37.         double txposres;
  38.         double txscrollres;
  39.         double graphres;
  40.         double cpuat;        /* indexes */
  41.         double fpuat;
  42.         double diskat;
  43.         double videoat;
  44.         double cpu386;
  45.         double fpu386;
  46.         double disk386;
  47.         double video386;
  48.         };
  49.  
  50. typedef struct database_record db_rec;
  51.  
  52. /* macros */
  53. #define offset_in_struc(x, y) (unsigned int)(&(((x*)0)->y))
  54.  
  55. /* function prototypes */
  56. char init_db( char, db_rec**, char *);
  57. int dump_db( char, db_rec**, char *);
  58. void free_db( char, db_rec**);
  59. int lin_search_db(char, char, void**,int,char, double);
  60. void sort_db( char, void**,int, char);
  61. void update_db(int, void**, int, char, double);
  62. char add_entry_db(char, char, db_rec**, char*);
  63. void dup_rec( void**, int, int);
  64.  
  65.