# io.c File Reference

`#include <SDL_endian.h>`
`#include <string.h>`
`#include <sys/stat.h>`
`#include <errno.h>`
`#include <dirent.h>`
`#include "struct.h"`
`#include "io.h"`

## Functions
word | endian_magic16 (word x)
dword | endian_magic32 (dword x)
int | read_byte (FILE *Fichier, byte *Dest)
int | write_byte (FILE *Fichier, byte Byte)
int | read_bytes (FILE *Fichier, void *Dest, size_t Taille)
int | write_bytes (FILE *Fichier, void *Src, size_t Taille)
int | read_word_le (FILE *Fichier, word *Dest)
int | write_word_le (FILE *Fichier, word Mot)
int | read_word_be (FILE *Fichier, word *Dest)
int | write_word_be (FILE *Fichier, word Mot)
int | read_dword_le (FILE *Fichier, dword *Dest)
int | write_dword_le (FILE *Fichier, dword Mot)
int | read_dword_be (FILE *Fichier, dword *Dest)
int | write_dword_be (FILE *Fichier, dword Mot)
char * | Position_dernier_slash (const char *Chaine)
void | Extraire_nom_fichier (char *Destination, const char *Source)
void | Extraire_chemin (char *Destination, const char *Source)
int | Fichier_existe (char *Fichier)
int | Repertoire_existe (char *Repertoire)

## Function Documentation

word endian_magic16 | ( | word | x | ) |

Referenced by Interpretation_du_fichier_config().

dword endian_magic32 | ( | dword | x | ) |

int read_byte | ( | FILE * | Fichier,
|  | byte * | Dest |
| ) |  |  |

Referenced by Charger_CFG(), Lire_octet(), Load_GIF(), Load_LBM(), Load_PCX(), Load_PKM(), Test_CEL(), and Test_PCX().

int write_byte | ( | FILE * | Fichier,
|  | byte | Byte |
| ) |  |  |

Referenced by Emergency_backup(), Sauver_CFG(), and Save_GIF().

int read_bytes | ( | FILE * | Fichier,
|  | void * | Dest,
|  | size_t | Taille |
| ) |  |  |

Referenced by Charger_CFG(), Interpretation_du_fichier_config(), Load_BMP(), Load_CEL(), Load_GIF(), Load_IMG(), Load_KCF(), Load_LBM(), Load_PAL(), Load_PC1(), Load_PCX(), Load_PI1(), Load_PKM(), Load_PNG(), Load_RAW_24B(), Load_SCx(), Load_TGA(), Test_BMP(), Test_CEL(), Test_GIF(), Test_IMG(), Test_KCF(), Test_LBM(), Test_PCX(), Test_PKM(), Test_PNG(), Test_SCx(), and Wait_for().

int write_bytes | ( | FILE * | Fichier,
|  | void * | Src,
|  | size_t | Taille |
| ) |  |  |

Referenced by Close_ecriture(), Ecrire_octet(), Emergency_backup(), Enregistrer_config(), Sauver_CFG(), Save_BMP(), Save_CEL(), Save_GIF(), Save_IMG(), Save_KCF(), Save_LBM(), Save_PAL(), Save_PC1(), Save_PCX(), Save_PI1(), Save_PKM(), and Save_SCx().

int read_word_le | ( | FILE * | Fichier,
|  | word * | Dest |
| ) |  |  |

Referenced by Charger_CFG(), Load_BMP(), Load_GIF(), Load_PCX(), Load_PKM(), Test_BMP(), Test_CEL(), Test_PC1(), Test_PCX(), and Test_PI1().

int write_word_le | ( | FILE * | Fichier,
|  | word | Mot |
| ) |  |  |

Referenced by Emergency_backup(), Enregistrer_config(), Sauver_CFG(), and Save_PCX().

int read_word_be | ( | FILE * | Fichier,
|  | word * | Dest |
| ) |  |  |

Referenced by Load_LBM(), and Load_PKM().

int write_word_be | ( | FILE * | Fichier,
|  | word | Mot |
| ) |  |  |

Referenced by Save_LBM().

int read_dword_le | ( | FILE * | Fichier,
|  | dword * | Dest |
| ) |  |  |

Referenced by Charger_CFG(), Load_BMP(), and Test_BMP().

int write_dword_le | ( | FILE * | Fichier,
|  | dword | Mot |
| ) |  |  |

Referenced by Sauver_CFG().

int read_dword_be | ( | FILE * | Fichier,
|  | dword * | Dest |
| ) |  |  |

Referenced by Load_LBM(), Test_LBM(), and Wait_for().

int write_dword_be | ( | FILE * | Fichier,
|  | dword | Mot |
| ) |  |  |

Referenced by Save_LBM().

char* Position_dernier_slash | ( | const char * | Chaine | ) |

References SEPARATEUR_CHEMIN.

Referenced by Ajout_fonte(), Bouton_Load_ou_Save(), Extraire_chemin(), and Extraire_nom_fichier().

void Extraire_nom_fichier | ( | char * | Destination,
|  | const char * | Source |
| ) |  |  |

References Position_dernier_slash().

Referenced by Analyse_de_la_ligne_de_commande().

void Extraire_chemin | ( | char * | Destination,
|  | const char * | Source |
| ) |  |  |

References Position_dernier_slash(), and SEPARATEUR_CHEMIN.

Referenced by Analyse_de_la_ligne_de_commande(), and Set_Program_Directory().

int Fichier_existe | ( | char * | Fichier | ) |

Referenced by Analyse_de_la_ligne_de_commande(), Backup_du_fichier_sauvegarde(), Bouton_Autosave(), Bouton_Load_ou_Save(), Bouton_Quitter_Routine_locale(), main(), Sauver_INI(), Save_picture(), and Set_Config_Directory().

int Repertoire_existe | ( | char * | Repertoire | ) |

References PARENT_DIR.

Referenced by Bouton_Load_ou_Save(), and Set_Config_Directory().