Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Helpers Namespace Reference

Functions

void fclose_check (FILE *fp, const char *file, int line)
 Closes a file with error checking.
 
void Mila::Helpers::fcloseCheck (FILE *fp)
 Closes a file with error checking.
 
FILE * fopen_check (const char *path, const char *mode, const char *file, int line)
 Opens a file with error checking.
 
FILE * Mila::Helpers::fopenCheck (const char *path, const char *mode)
 Opens a file with error checking.
 
void fread_check (void *ptr, size_t size, size_t nmemb, FILE *stream, const char *file, int line)
 Reads from a file with error checking.
 
void Mila::Helpers::freadCheck (void *ptr, size_t size, size_t nmemb, FILE *stream)
 Reads from a file with error checking.
 
void fseek_check (FILE *stream, long offset, int whence, const char *file, int line)
 Seeks to a position in a file with error checking.
 
void Mila::Helpers::fseekCheck (FILE *stream, long offset, int whence)
 Seeks to a position in a file with error checking.
 
void * malloc_check (size_t size, const char *file, int line)
 Allocates memory with error checking.
 
void * Mila::Helpers::mallocCheck (size_t size)
 Allocates memory with error checking.
 

Function Documentation

◆ fclose_check()

void Mila::Helpers::fclose_check ( FILE *  fp,
const char *  file,
int  line 
)
externinline

Closes a file with error checking.

Parameters
fpPointer to the file to be closed.
fileThe source file name where the function is called.
lineThe line number in the source file where the function is called.
Here is the caller graph for this function:

◆ fcloseCheck()

void Mila::Helpers::fcloseCheck ( FILE *  fp)
export

Closes a file with error checking.

Parameters
fpPointer to the file to be closed.
Here is the call graph for this function:

◆ fopen_check()

FILE * Mila::Helpers::fopen_check ( const char *  path,
const char *  mode,
const char *  file,
int  line 
)
externinline

Opens a file with error checking.

Parameters
pathThe path to the file.
modeThe mode in which to open the file.
fileThe source file name where the function is called.
lineThe line number in the source file where the function is called.
Returns
FILE* Pointer to the opened file.
Here is the caller graph for this function:

◆ fopenCheck()

FILE * Mila::Helpers::fopenCheck ( const char *  path,
const char *  mode 
)
export

Opens a file with error checking.

Parameters
pathThe path to the file.
modeThe mode in which to open the file.
Returns
FILE* Pointer to the opened file.
Here is the call graph for this function:

◆ fread_check()

void Mila::Helpers::fread_check ( void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream,
const char *  file,
int  line 
)
externinline

Reads from a file with error checking.

Parameters
ptrPointer to the buffer where the read data will be stored.
sizeSize of each element to be read.
nmembNumber of elements to be read.
streamPointer to the file stream.
fileThe source file name where the function is called.
lineThe line number in the source file where the function is called.
Here is the caller graph for this function:

◆ freadCheck()

void Mila::Helpers::freadCheck ( void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream 
)
export

Reads from a file with error checking.

Parameters
ptrPointer to the buffer where the read data will be stored.
sizeSize of each element to be read.
nmembNumber of elements to be read.
streamPointer to the file stream.
Here is the call graph for this function:

◆ fseek_check()

void Mila::Helpers::fseek_check ( FILE *  stream,
long  offset,
int  whence,
const char *  file,
int  line 
)
externinline

Seeks to a position in a file with error checking.

Parameters
streamPointer to the file stream.
offsetOffset from the position specified by whence.
whencePosition from where offset is added.
fileThe source file name where the function is called.
lineThe line number in the source file where the function is called.
Here is the caller graph for this function:

◆ fseekCheck()

void Mila::Helpers::fseekCheck ( FILE *  stream,
long  offset,
int  whence 
)
export

Seeks to a position in a file with error checking.

Parameters
streamPointer to the file stream.
offsetOffset from the position specified by whence.
whencePosition from where offset is added.
Here is the call graph for this function:

◆ malloc_check()

void * Mila::Helpers::malloc_check ( size_t  size,
const char *  file,
int  line 
)
externinline

Allocates memory with error checking.

Parameters
sizeThe size of the memory to be allocated.
fileThe source file name where the function is called.
lineThe line number in the source file where the function is called.
Returns
void* Pointer to the allocated memory.
Here is the caller graph for this function:

◆ mallocCheck()

void * Mila::Helpers::mallocCheck ( size_t  size)
export

Allocates memory with error checking.

Parameters
sizeThe size of the memory to be allocated.
Returns
void* Pointer to the allocated memory.
Here is the call graph for this function: