1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #ifndef _DB_VERS_H_RPCGEN 7 #define _DB_VERS_H_RPCGEN 8 9 #include <rpc/rpc.h> 10 #ifndef _DB_VERS_H 11 #define _DB_VERS_H 12 /* 'vers' is the version identifier. */ 13 14 #include "nisdb_rw.h" 15 16 class vers { 17 unsigned int vers_high; /* major version number, tracks checkpoints */ 18 unsigned int vers_low; /* minor version number, tracks updates. */ 19 unsigned int time_sec; /* time stamp */ 20 unsigned int time_usec; 21 STRUCTRWLOCK(vers); 22 public: 23 /* No argument constructor. All entries initialized to zero. */ 24 vers() { 25 vers_high = vers_low = time_sec = time_usec = 0; 26 INITRW(vers); 27 } 28 29 /* Constructor that makes copy of 'other'. */ 30 vers( vers *other ); 31 32 /* Constructor: create version with specified version numbers */ 33 vers( unsigned int high, unsigned int low) { 34 vers_high = high; vers_low = low; time_sec = time_usec = 0; 35 INITRW(vers); 36 } 37 38 /* Creates new 'vers' with next higher minor version. 39 If minor version exceeds MAXLOW, bump up major version instead. 40 Set timestamp to that of the current time. */ 41 vers* nextminor(); 42 43 /* Creates new 'vers' with next higher major version. 44 Set timestamp to that of the current time. */ 45 vers* nextmajor(); 46 47 /* Set this 'vers' to hold values found in 'others'. */ 48 void assign( vers *other ); 49 50 /* Predicate indicating whether this vers is earlier than 'other' in 51 terms of version numbers. */ 52 bool_t earlier_than( vers *other ); 53 54 /* Print the value of this 'vers' to specified file. */ 55 void print( FILE *file ); 56 57 /* Zero out this vers. */ 58 void zero(); 59 60 /* Predicate indicating whether this vers is equal to 'other'. */ 61 bool_t equal( vers *other); 62 63 /* Locking methods */ 64 65 int acqexcl(void) { 66 return (WLOCK(vers)); 67 } 68 69 int relexcl(void) { 70 return (WULOCK(vers)); 71 } 72 73 int acqnonexcl(void) { 74 return (RLOCK(vers)); 75 } 76 77 int relnonexcl(void) { 78 return (RULOCK(vers)); 79 } 80 }; 81 #endif /* VERS_H */ 82 83 #endif /* !_DB_VERS_H_RPCGEN */ 84