4 /* functions and structures for generating unique database IDs */
8 #define MAX_DBID_LEN 48
14 typedef char dbid_t[MAX_DBID_LEN];
16 /** generates ID for data in shared memory at address given by data_ptr */
17 void generate_dbid_ptr(dbid_t dst, void *data_ptr);
20 void generate_dbid(dbid_t dst);
23 /* macros for conversion to string representation of DBID
24 * (if dbid becomes structure with binary information
25 * these should be removed and replaced by functions) */
26 #define dbid_strlen(id) strlen(id)
27 #define dbid_strptr(id) ((char*)(id))
29 #define dbid_clear(id) do { (id)[0] = 0; } while (0)
31 #define is_dbid_empty(id) (!(id)[0])
33 /** Copies dbid as string into destination. The destination string
34 * data buffer MUST be allocated in needed size! */
35 #define dbid_strcpy(dst,id,l) do { memcpy((dst)->s,id,l); (dst)->len = l; } while (0)