

#ifndef _CTF_H_
#define _CTF_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//////////////// macros ////////////////////////////////////



#if __SIZEOF_POINTER__ == 4
    #define ULONG_MAX 0xffffffff
#elif __SIZEOF_POINTER__ == 8
    #define ULONG_MAX 0xffffffffffffffff
#endif
/// MEMROY
#define CTF_ERROR_ALLOC_MEMORY_FAILED 0x00010001
/// FILE
#define CTF_ERROR_OPEN_FILE_ERROR 0x00020001
#define CTF_ERROR_READ_FILE_FAILED 0x00020002
#define CTF_ERROR_WRITE_FILE_FAILED 0x00020003





//////////////// FILE ///////////////////////////////////////

unsigned long ctf_get_file_size(char *fileName);
unsigned long ctf_get_fd_size(FILE *fd);
unsigned char *ctf_read_file(char *fileName, unsigned long readMax);
int ctf_write_file(char *fileName, unsigned char *fileBuffer, unsigned long fileSize);



#endif 