Corewar documentation 1.0.0
Loading...
Searching...
No Matches
fork.c File Reference

The file containing the fork function. More...

Functions

int * fork_register (champion_t *champion, int *new_register)
 Fork the register of a champion.
 
champion_tfork_champion (champion_t *champion)
 Fork a champion.
 
void exec_fork (champion_t *champion, node_t *address)
 The fork function.
 

Detailed Description

The file containing the fork function.

Function Documentation

◆ exec_fork()

void exec_fork ( champion_t * champion,
node_t * address )

The fork function.

Parameters
championThe champion to execute the fork function
addressThe address of the fork function
Returns
void

◆ fork_champion()

champion_t * fork_champion ( champion_t * champion)

Fork a champion.

Parameters
championThe champion to fork
Returns
The forked champion

◆ fork_register()

int * fork_register ( champion_t * champion,
int * new_register )

Fork the register of a champion.

Parameters
championThe champion to fork
new_registerThe new register
Returns
The forked register