Corewar documentation 1.0.0
|
The header of the corewar project. More...
Go to the source code of this file.
Data Structures | |
struct | cell_s |
The cell structure. More... | |
struct | champion_s |
The champion structure. More... | |
struct | corewar_s |
The corewar structure. More... | |
Typedefs | |
typedef struct cell_s | cell_t |
The cell structure. | |
typedef struct champion_s | champion_t |
The champion structure. | |
typedef struct corewar_s | corewar_t |
The corewar structure. | |
Functions | |
corewar_t * | get_corewar (void) |
Get the corewar object. | |
void | free_corewar (void) |
Free the corewar structure. | |
int | corewar (void) |
The virtual machine of the corewar. | |
int | parse_args (int argc, char **argv) |
Parse the arguments. | |
int | get_next_champion_number (void) |
Get the next champion number disponible. | |
int | champion_number_exist (int number) |
Check if a champion number exist. | |
int | analyse_champions (void) |
Analyse each champion files and complete the champion structure. | |
char * | read_file (char *filepath, int size, int start) |
Read a file and return the content. | |
int | get_prog_size (char *header) |
Get the program size. | |
int | is_valid_magic (char *header) |
Check if the magic number is valid. | |
void | build_arena (void) |
Build the arena. | |
void | display_arena (void) |
Display the arena. | |
The header of the corewar project.
int analyse_champions | ( | void | ) |
Analyse each champion files and complete the champion structure.
void build_arena | ( | void | ) |
Build the arena.
int champion_number_exist | ( | int | number | ) |
Check if a champion number exist.
number | The champion number |
int corewar | ( | void | ) |
The virtual machine of the corewar.
void display_arena | ( | void | ) |
Display the arena.
void free_corewar | ( | void | ) |
Free the corewar structure.
Free the corewar structure and all the memory allocated.
Free the corewar structure.
corewar_t * get_corewar | ( | void | ) |
Get the corewar object.
Get the corewar structure.
Get the corewar object.
int get_next_champion_number | ( | void | ) |
Get the next champion number disponible.
int get_prog_size | ( | char * | header | ) |
Get the program size.
header | The header of the program |
int is_valid_magic | ( | char * | header | ) |
Check if the magic number is valid.
header | The header of the program |
int parse_args | ( | int | argc, |
char ** | argv ) |
Parse the arguments.
argc | The number of arguments |
argv | The arguments |
char * read_file | ( | char * | filepath, |
int | size, | ||
int | start ) |
Read a file and return the content.
filepath | The file path |
size | The size of the bytes to read |
start | The start of the reading |