comp20003-project02/common.h

32 lines
499 B
C
Raw Normal View History

#ifndef STDIO_HEADER
#define STDIO_HEADER
#include <stdio.h>
#endif
#ifndef STDLIB_HEADER
#define STDLIB_HEADER
#include <stdlib.h>
#endif
#ifndef STRING_HEADER
#define STRING_HEADER
#include <string.h>
#endif
#ifndef COMMON_HEADER
#define COMMON_HEADER
/* Checks if a pointer assigned through dynamic memory allocation is NULL */
void checkNullPointer(void *ptr);
/* Opens a file and checks if the file is safe to use */
FILE *safeFileOpen(FILE **f, char *fileName, char *mode);
#endif