#ifndef __UTILS_H__
#define __UTILS_H__

#include <stdlib.h>

#define SAFEFREE(x)     if ((x) != NULL) { free(x); x = NULL; }
#define SAFEMALLOC(x)   malloc(x);
#define TRUE            1
#define FALSE           0
#define ERROR_FLAG		-1
#define MAX_LINE_LEN		256

#define doError(x,y,z) 	printf("%s @ %s:%d\n", x, y, z);

double randDouble(int range);
void trim(char *string);
void get_filename_from_path(char *path, char *filename);
void get_PDB_name_from_path(char *path, char *pdb_name);
void check_file_readability(char *filename);

#endif
