/* 
 * util.h,v 1.1 1994/01/28 17:21:59 franktor Exp
 *
 * util.h
 *
 * Various utility functions
 *
*/

#ifndef UTIL_H
#define UTIL_H

#include <sr-api.h>

char *smalloc ( unsigned int size );

#define safe_strlen(xx) (xx && *xx) ? strlen(xx) : 0
char *safe_strdup ( char * );
char *safe_strcpy ( char *, char * );

/* Functions to handle record compositions */
RecordComposition *new_RecordComposition ( Boolean isGeneric, char *genericComposition );
void add_RecCompElem ( RecordComposition *recComp, char *dbName, char *recCompId );
int recCompSize ( RecordComposition *recComp );
Boolean get_RecCompElem ( RecordComposition *recComp, int index, char **dbName, char **recCompId );
char *get_RecCompForDb ( RecordComposition *recComp, char *dbName );

#endif
