# data[].attributes.attachment_link.readable_text
<ddg name="The frozen cave">
        <date>
            <day>01</day>
            <month>09</month>
            <year>2019</year>
        </date>
        <dmname>Pierre</dmname>
        <players>

            <player name="Camille">
              <ac>5</ac>
              <class>Thief</class>
              <cname>Camigolas</cname>
              <hp>4</hp>
              <money>
                  <cp>10</cp>
                  <gp>10</gp>
                  <sp>10</sp>
              </money>
            </player>

            <player name="Jean">
            <ac>4</ac>
            <class>Fighter</class>
            <cname>Jeragorn</cname>
            <hp>8</hp>
            <money>
                <cp>3</cp>
                <gp>1</gp>
                <sp>2</sp>
            </money>
            </player>

            <player name="Paul">
                <ac>5</ac>
                <class>Cleric</class>
                <cname>Paumli</cname>
                <hp>6</hp>
                <money>
                    <cp>9</cp>
                    <gp>5</gp>
                    <sp>9</sp>
                </money>
            </player>

        </players>
</ddg>

# data[].attributes.attachment_link.readable_text
#include "ddg.h"

int main(int argc, const char* argv[]) {

    /* verification du nombre d'arguments en parametres */
    
    return 0;
}

# data[].attributes.attachment_link.readable_text
/**
 * \file ddg.h
*/
#ifndef DDG_H
#define DDG_H

#include "player.h" /* for player_t */
/*
 * A DDG (Dungeons and Dragons Game).
 */
typedef struct {
    int day; /**< The DDG date (day). */
    char *dmname; /**< The dungeon master name. */
    int month; /**< The DDG date (month). */
    char *name; /**< The DDG name. */
    int nplayers; /**< The DDG number of players. */
    player_t **players; /**< The DDG players. */
    int year; /**< The DDG date (year). */
} ddg_t;

/**
 * Add a player to a DDG.
 * \param ddg The DDG.
 * \param player The player.
 * \return -1 on error (i.e., if the memory allocation is a failure), else 0.
 */
int ddg_add_player(ddg_t *ddg, player_t *player);
/**
 * Creates a DDG.
 * \return NULL on error (i.e., if the memory allocation is a failure), else a DDG.
 */
ddg_t *ddg_create();
/**
 * Frees a DDG.
 * \param ddg The DDG.
 */
void ddg_free(ddg_t *ddg);
/**
 * Handles the d command for a DDG.
 * \param ddg The DDG.
 */
void ddg_handle_d(ddg_t ddg);
/**
 * Handles the g command for a DDG.
 * \param ddg The DDG.
 */
void ddg_handle_g(ddg_t ddg);
/**
 * Handles the m command for a DDG.
 * \param ddg The DDG.
 */
void ddg_handle_m(ddg_t ddg);
/**
 * Handles the n command for a DDG.
 * \param ddg The DDG.
 */
void ddg_handle_n(ddg_t ddg);
/**
 * Handles the p command for a DDG.
 * \param ddg The DDG.
 */
void ddg_handle_p(ddg_t ddg);
/**
 * Handles the pa command for all the players of a DDG.
 * \param ddg The DDG.
 * \param ac The player armor class.
 */
 void ddg_handle_pa(ddg_t ddg, int ac);
 /**
  * Handles the page command for all the players of a DDG.
  * \param ddg The DDG.
  * \param ac The player armor class.
  */
 void ddg_handle_page(ddg_t ddg, int ac);
 /**
  * Handles the pagt command for all the players of a DDG.
  * \param ddg The DDG.
  * \param ac The player armor class.
  */
 void ddg_handle_pagt(ddg_t ddg, int ac);
 /**
  * Handles the pale command for all the players of a DDG.
  * \param ddg The DDG.
  * \param ac The player armor class.
  */
 void ddg_handle_pale(ddg_t ddg, int ac);
 /**
  * Handles the palt command for all the players of a DDG.
  * \param ddg The DDG.
  * \param ac The player armor class.
  */
 void ddg_handle_palt(ddg_t ddg, int ac);
 /**
  * Handles the pc command for all the players of a DDG.
  * \param ddg The DDG.
  * \param class The player class.
  */
 void ddg_handle_pc(ddg_t ddg, const char *class);
 /**
  * Handles the pcn command for all the players of a DDG.
  * \param ddg The DDG.
  * \param cname The player character name.
  */
  void ddg_handle_pcn(ddg_t ddg, const char *cname);
 /**
  * Handles the ph command for all the players of a
  * \param ddg The DDG.
  * \param hp The player hit points.
  */
 void ddg_handle_ph(ddg_t ddg, int hp);
 /**
  * Handles the phge command for all
  * \param ddg The DDG.
  * \param hp The player hit points.
  */
 void ddg_handle_phge(ddg_t ddg, int hp);
 /**
  * Handles the phgt command for all
  * \param ddg The DDG.
  * \param hp The player hit points.
  */
 void ddg_handle_phgt(ddg_t ddg, int hp);
 /**
  * Handles the phle command for all
  * \param ddg The DDG.
  * \param hp The player hit points.
  */
 void ddg_handle_phle(ddg_t ddg, int hp);
 /**
  * Handles the phlt command for all
  * \param ddg The DDG.
  * \param hp The player hit points.
  */
 void ddg_handle_phlt(ddg_t ddg, int hp);
 /**
  * Handles the pn command for all the players of a
  * \param ddg The DDG.
  * \param name The DDG name.
  */
 void ddg_handle_pn(ddg_t ddg, const char *name);
 #endif

# data[].attributes.attachment_link.readable_text
/**
 * \file player.h
*/
#ifndef PLAYER_H
#define PLAYER_H
/**
 * A player.
*/
typedef struct {
    int ac; /**< The player armor class. */
    char *class; /**< The player class. */
    char *cname; /**< The player character name. */
    int cp; /**< The player money (copper pieces, 100 CP = 1 GP). */
    int gp; /**< The player money (gold pieces). */
    int hp; /**< The player hit points. */
    char *name; /**< The player name. */
    int sp; /**< The player money (silver pieces, 10 SP = 1 GP). */
} player_t;
/**
 * Creates a player.
 * \return NULL on error (i.e., if the memory allocation is a failure), else a player.
 */
player_t *player_create();
/**
 * Frees a player.
 * \param player The player.
 */
void player_free(player_t *player);
/**
 * Handles the p command for a player.
 * \param player The player.
 */
void player_handle_p(player_t player);
/**
 * Handles the pa command for a player.
 * \param player The player.
 * \param ac The player armor class.
 */
void player_handle_pa(player_t player, int ac);
/**
 * Handles the page command for a player.
 * \param player The player.
 * \param ac The player armor class.
 */
void player_handle_page(player_t player, int ac);
/**
 * Handles the pagt command for a player.
 * \param player The player.
 * \param ac The player armor class.
 */
void player_handle_pagt(player_t player, int ac);
/**
 * Handles the pale command for a player.
 * \param player The player.
 * \param ac The player armor class.
 */
void player_handle_pale(player_t player, int ac);
/**
 * Handles the palt command for a player.
 * \param player The player.
 * \param ac The player armor class.
 */
void player_handle_palt(player_t player, int ac);
/**
 * Handles the pc command for a player.
 * \param player The player.
 * \param class The player class.
 */
void player_handle_pc(player_t player, const char *class);
/**
 * Handles the pcn command for a player.
 * \param player The player.
 * \param cname The player character name.
 */
 void player_handle_pcn(player_t player, const char *cname);
/**
 * Handles the ph command for a player.
 * \param player The player.
 * \param hp The player hit points.
 */
void player_handle_ph(player_t player, int hp);
 /**
 * Handles the phge command for a player.
 * \param player The player.
 * \param hp The player hit points.
 */
void player_handle_phge(player_t player, int hp);
/**
 * Handles the phgt command for a player.
 * \param player The player.
 * \param hp The player hit points.
 */
void player_handle_phgt(player_t player, int hp);
/**
 * Handles the phle command for a player.
 * \param player The player.
 * \param hp The player hit points.
 */
void player_handle_phle(player_t player, int hp);
/**
 * Handles the phlt command for a player.
 * \param player The player.
 * \param hp The player hit points.
 */
void player_handle_phlt(player_t player, int hp);
/**
 * Handles the pn command for a player.
 * \param player The player.
 * \param name The player name.
 */
void player_handle_pn(player_t player, char *name);
#endif