1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #ifndef _DB_ITEM_H_RPCGEN 7 #define _DB_ITEM_H_RPCGEN 8 9 #include <rpc/rpc.h> 10 #pragma ident "%Z%%M% %I% %E% SMI" 11 12 /* A 'counted' string. */ 13 14 #ifndef _DB_ITEM_H 15 #define _DB_ITEM_H 16 class item { 17 int len; 18 char *value; 19 public: 20 /* Constructor: creates item using given character sequence and length */ 21 item( char* str, int len); 22 23 /* Constructor: creates item by copying given item */ 24 item( item* ); 25 26 /* Constructor: creates empty item (zero length and null value). */ 27 item() {len = 0; value = NULL;} 28 29 /* Destructor: recover space occupied by characters and delete item. */ 30 ~item() {delete value;} 31 32 /* Equality test. 'casein' TRUE means case insensitive test. */ 33 bool_t equal( item *, bool_t casein = FALSE ); 34 35 /* Equality test. 'casein' TRUE means case insensitive test. */ 36 bool_t equal( char *, int, bool_t casein = FALSE ); 37 38 /* Assignment: update item by setting pointers. No space is allocated. */ 39 void update( char* str, int n) {len = n; value = str;} 40 41 /* Return contents of item. */ 42 void get_value( char** s, int * n ) { *s = value; *n=len;} 43 44 /* Prints contents of item to stdout */ 45 void print(); 46 47 /* Return hash value. 'casein' TRUE means case insensitive test. */ 48 unsigned int get_hashval( bool_t casein = FALSE ); 49 }; 50 #endif /* _DB_ITEM_H */ 51 52 #endif /* !_DB_ITEM_H_RPCGEN */ 53