Added strucutres and the functions that used it, also modified doxygen to print the code.

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2024-04-26 00:59:41 -03:00
parent 1695e9dc44
commit a5e4be6a09
12 changed files with 480 additions and 15 deletions
+24
View File
@@ -0,0 +1,24 @@
/** @file account.h
* Account structure header file used in the program
*/
#ifndef ACCOUNT_H
#define ACCOUNT_H
#include "subaccount.h"
#include "money.h"
/**
* @struct account
* @brief Struct representing an Account in the the T-Account
*/
typedef struct account {
char *name; ///<Name of the account
char *description; ///< Description of the account
Money *value; ///< Total of the values of the subaccounts
SubAccount *subaccounts; ///< List of subaccounts
int numberOfSubaccounts; ///< Number of subaccounts on the list
} Account;
#endif
+25
View File
@@ -0,0 +1,25 @@
/**
* @file entry.h
* Entry structure header file used in the program
*
* @todo Add the functions prototypes to this header
*/
#ifndef ENTRY_H
#define ENTRY_H
#include "money.h"
/**
* @struct entry
* @brief Struct representing an entry in the the T-Account
*/
typedef struct entry {
char *name; ///< Name of the entry
char *description; ///< Description of the entry
Money *value; ///< Monetary value of the Entry
struct entry *next; ///< Pointer to the next entry in the list of entries
} Entry;
#endif
+1 -1
View File
@@ -19,7 +19,7 @@ typedef struct money {
int cents; ///< The Cents parts of the monetary value
} Money;
Money *InitializeMoney(int full, int cents);
Money *initializeMoney(int full, int cents);
void addMoneyToMoney(Money *dest, Money *src);
void subtractMoneyToMoney(Money *dest, Money *src);
+28
View File
@@ -0,0 +1,28 @@
/**
* @file subaccount.h
* Subaccount strucuture header file used in the program
*/
#ifndef SUBACCOUNT_H
#define SUBACCOUNT_H
#include "money.h"
#include "entry.h"
/**
* @struct subaccount
* @brief Struct representing a subaccount on the T-Account
*
*/
typedef struct subaccount {
char *name; ///< Name of the subaccount
char *description; ///< Description of the subaccount
Money *value; ///< Total of the values of the entries
Entry *entries; ///< List of entries
int numberOfEntries; ///< Counter of entries in the subaccount
struct subaccount *next; ///< Reference to the next subaccount
} SubAccount;
#endif
+22
View File
@@ -0,0 +1,22 @@
/**
* @file taccount.h
* TAccount structure header file used in the program
*/
#ifndef TACCOUNT_H
#define TACCOUNT_H
#include "account.h"
/**
* @struct taccount
* @brief Struct representing an T-Account
*/
typedef struct taccount {
Account *credits; ///< credits account
Account *debits; ///< debits account
} TAccount;
#endif