GrafX2 2.9.3227
The ultimate 256-color painting program
|
Functions used to read and write from/to files. More...
Functions | |
int | Read_byte (FILE *file, byte *dest) |
Reads a single byte from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Write_byte (FILE *file, byte b) |
Writes a single byte to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_bytes (FILE *file, void *dest, size_t size) |
Reads several bytes from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_byte_line (FILE *file, char *line, size_t size) |
int | Write_bytes (FILE *file, const void *dest, size_t size) |
Writes several bytes to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_word_le (FILE *file, word *dest) |
Reads a 16-bit Low-Endian word from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Write_word_le (FILE *file, word w) |
Writes a 16-bit Low-Endian word to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_dword_le (FILE *file, dword *dest) |
Reads a 32-bit Low-Endian dword from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Write_dword_le (FILE *file, dword dw) |
Writes a 32-bit Low-Endian dword to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_word_be (FILE *file, word *dest) |
Reads a 16-bit Big-Endian word from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Write_word_be (FILE *file, word w) |
Writes a 16-bit Big-Endian word to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Read_dword_be (FILE *file, dword *dest) |
Reads a 32-bit Big-Endian dword from an open file. Returns true if OK, false if a file i/o error occurred. More... | |
int | Write_dword_be (FILE *file, dword dw) |
Writes a 32-bit Big-Endian dword to an open file. Returns true if OK, false if a file i/o error occurred. More... | |
unsigned long | File_length_file (FILE *file) |
Size of an open file, in bytes. More... | |
Functions used to read and write from/to files.
Except for bytes ones, each function is available in Big-Endian and Little-Endian flavour.
int Read_byte | ( | FILE * | file, |
byte * | dest | ||
) |
Reads a single byte from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by Check_MSX_BSAVE_format(), DECB_Check_binary_file(), Depack_CPC_LZW(), GIF_get_next_code(), LBM_Decode(), Load_2GS(), Load_BMP_Pixels(), Load_CA1(), Load_CEL(), Load_CFG(), Load_CM5(), Load_FLI(), Load_GIF(), Load_GOS(), Load_ICO(), Load_IFF(), Load_KCF(), Load_MOTO(), Load_PCX(), Load_PKM(), Load_PPH(), Load_SCR(), Load_SCx(), Load_TNY(), MOTO_Check_binary_file(), PBM_Decode(), Read_INFO_Header(), Read_INFO_ImageHeader(), Read_SGX(), SGX_Load_Picture(), skip_padding(), Test_CEL(), Test_KCF(), Test_PCX(), Test_PKM(), Test_Read_Write_byte(), Test_Read_Write_dword(), Test_Read_Write_word(), Test_SCR(), Test_SCx(), and Test_TNY().
int Write_byte | ( | FILE * | file, |
byte | b | ||
) |
Writes a single byte to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by C64_color_ram_pack(), DECB_BIN_Add_Chunk(), DECB_BIN_Add_End(), Emergency_backup(), PackBits_pack_flush(), PackBytes_pack_flush(), Save_2GS(), Save_C64_multi(), Save_CA1(), Save_CEL(), Save_CFG(), Save_CM5(), Save_GIF(), Save_ICO(), Save_IFF(), Save_KCF(), Save_MSX(), Save_NEO(), Save_PKM(), Save_PRG(), Save_SCR(), Save_SCx(), Save_SGX_Sub(), Save_TNY(), Test_Read_Write_byte(), Test_Read_Write_dword(), and Test_Read_Write_word().
int Read_bytes | ( | FILE * | file, |
void * | dest, | ||
size_t | size | ||
) |
Reads several bytes from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by C64_isBinaryProgram(), CPC_check_AMSDOS(), IFF_Wait_for(), LBM_Decode(), Load_2GS(), Load_BMP(), Load_BMP_Palette(), Load_BMP_Pixels(), Load_C64(), Load_CA1(), Load_CEL(), Load_CFG(), Load_FLI_Header(), Load_GIF(), Load_GOS(), Load_GPX(), Load_GRB(), Load_HGR(), Load_ICO(), Load_IFF(), Load_IMG(), Load_INFO(), Load_KCF(), Load_MOTO(), Load_MSX(), Load_NEO(), Load_PAL(), Load_PC1(), Load_PCX(), Load_PI1(), Load_PKM(), Load_PNG(), Load_Recoil_Image(), Load_SCR(), Load_SCx(), Load_TNY(), MOTO_Check_binary_file(), PBM_Decode(), Read_INFO_String(), Test_2GS(), Test_BMP(), Test_C64(), Test_CA1(), Test_CEL(), Test_GIF(), Test_GPL(), Test_GPX(), Test_GRB(), Test_IFF(), Test_IMG(), Test_KCF(), Test_PAL(), Test_PCX(), Test_PKM(), Test_PNG(), Test_PPH(), Test_Read_Write_bytes(), Test_SCR(), Test_SCx(), Test_SGX(), and Test_TIFF().
int Read_byte_line | ( | FILE * | file, |
char * | line, | ||
size_t | size | ||
) |
References NULL.
Referenced by Load_GPL().
int Write_bytes | ( | FILE * | file, |
const void * | dest, | ||
size_t | size | ||
) |
Writes several bytes to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by CPC_write_AMSDOS_header(), DECB_BIN_Add_Chunk(), Emergency_backup(), GIF_empty_buffer(), PackBits_pack_flush(), PackBytes_pack_flush(), Save_2GS(), Save_BMP(), Save_C64_fli(), Save_C64_fli_monolayer(), Save_C64_hires(), Save_C64_multi(), Save_CA1(), Save_CEL(), Save_CFG(), Save_GIF(), Save_GOS(), Save_HGR(), Save_IFF(), Save_IMG(), Save_KCF(), Save_MSX(), Save_NEO(), Save_PC1(), Save_PCX(), Save_PI1(), Save_PKM(), Save_PRG(), Save_SCR(), Save_SCx(), Save_TNY(), and Test_Read_Write_bytes().
int Read_word_le | ( | FILE * | file, |
word * | dest | ||
) |
Reads a 16-bit Low-Endian word from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by C64_isBinaryProgram(), Check_MSX_BSAVE_format(), Load_2GS(), Load_2GS_Palette(), Load_BMP(), Load_BMP_Pixels(), Load_CEL(), Load_CFG(), Load_FLI(), Load_FLI_Header(), Load_GIF(), Load_GOS(), Load_ICO(), Load_IMG(), Load_KCF(), Load_PAL(), Load_PCX(), Load_PKM(), Load_PPH(), Load_PRG(), Load_SCR(), Load_SCx(), Read_SGX(), Test_BMP(), Test_C64(), Test_CEL(), Test_ICO(), Test_IMG(), Test_KCF(), Test_PCX(), Test_PKM(), Test_PRG(), Test_Read_Write_word(), and Test_SCx().
int Write_word_le | ( | FILE * | file, |
word | w | ||
) |
Writes a 16-bit Low-Endian word to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by Emergency_backup(), Save_2GS(), Save_2GS_Palette_Entry(), Save_BMP(), Save_C64_fli(), Save_C64_fli_monolayer(), Save_C64_hires(), Save_C64_multi(), Save_CEL(), Save_CFG(), Save_GIF(), Save_GOS(), Save_ICO(), Save_IMG(), Save_KCF(), Save_MSX(), Save_PCX(), Save_PKM(), Save_SCx(), Save_SGX_Sub(), and Test_Read_Write_word().
int Read_dword_le | ( | FILE * | file, |
dword * | dest | ||
) |
Reads a 32-bit Low-Endian dword from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by Load_2GS(), Load_BMP(), Load_BMP_Pixels(), Load_FLI(), Load_FLI_Header(), Load_ICO(), Test_2GS(), Test_BMP(), and Test_Read_Write_dword().
int Write_dword_le | ( | FILE * | file, |
dword | dw | ||
) |
Writes a 32-bit Low-Endian dword to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by Save_2GS(), Save_BMP(), Save_ICO(), and Test_Read_Write_dword().
int Read_word_be | ( | FILE * | file, |
word * | dest | ||
) |
Reads a 16-bit Big-Endian word from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by DECB_Check_binary_file(), LBM_Decode(), Load_CA1(), Load_GIF(), Load_IFF(), Load_MOTO(), Load_NEO(), Load_PC1(), Load_PI1(), Load_PKM(), Load_TNY(), MOTO_Check_binary_file(), RAST_chunk_decode(), Read_INFO_Header(), Read_INFO_ImageHeader(), Test_NEO(), Test_PC1(), Test_PI1(), Test_Read_Write_word(), and Test_TNY().
int Write_word_be | ( | FILE * | file, |
word | w | ||
) |
Writes a 16-bit Big-Endian word to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by DECB_BIN_Add_Chunk(), DECB_BIN_Add_End(), Save_CA1(), Save_GIF(), Save_IFF(), Save_NEO(), Save_PC1(), Save_TNY(), and Test_Read_Write_word().
int Read_dword_be | ( | FILE * | file, |
dword * | dest | ||
) |
Reads a 32-bit Big-Endian dword from an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by IFF_Skip_section(), LBM_Decode(), Load_IFF(), Load_INFO(), Read_INFO_Header(), Read_INFO_ImageHeader(), Read_INFO_String(), Test_IFF(), and Test_Read_Write_dword().
int Write_dword_be | ( | FILE * | file, |
dword | dw | ||
) |
Writes a 32-bit Big-Endian dword to an open file. Returns true if OK, false if a file i/o error occurred.
Referenced by Save_IFF(), and Test_Read_Write_dword().
unsigned long File_length_file | ( | FILE * | file | ) |
Size of an open file, in bytes.
file | an open file |
Referenced by Load_2GS(), Load_BMP(), Load_C64(), Load_CA1(), Load_CEL(), Load_CFG(), Load_FLI(), Load_GIF(), Load_GOS(), Load_GPX(), Load_GRB(), Load_HGR(), Load_ICO(), Load_IFF(), Load_IMG(), Load_INFO(), Load_KCF(), Load_MOTO(), Load_MSX(), Load_NEO(), Load_PAL(), Load_PC1(), Load_PCX(), Load_PI1(), Load_PKM(), Load_PNG_Sub(), Load_PPH(), Load_PRG(), Load_Recoil_Image(), Load_SCR(), Load_SCx(), Load_SGX(), Load_TIFF(), Load_TNY(), Test_2GS(), Test_C64(), Test_CEL(), Test_CM5(), Test_GOS(), Test_GPL(), Test_GRB(), Test_HGR(), Test_KCF(), Test_MOTO(), Test_NEO(), Test_PAL(), Test_PC1(), Test_PI1(), Test_PPH(), Test_PRG(), Test_Read_Write_bytes(), Test_SCR(), Test_SGX(), and Test_TNY().