DungeonCrawl
|
Implements functionality for working with items and database. More...
Go to the source code of this file.
Macros | |
#define | SQL_SELECT_COUNT_POTIONS "SELECT COUNT(*) FROM potion" |
#define | SQL_SELECT_ALL_POTIONS "SELECT PO_TYPE, PO_NAME, PO_VALUE FROM potion" |
#define | SQL_SELECT_COUNT_GEARS "SELECT COUNT(*) FROM gear" |
#define | SQL_SELECT_ALL_GEARS |
Functions | |
potion_init_t * | init_potion_table_from_db (const db_connection_t *db_connection) |
Get the potion table from the database. | |
void | free_potion_table_from_db (potion_init_t *potion_init_table, const db_connection_t *db_connection) |
Clean up the potion table Call this function to free the memory allocated for the potion table. | |
int | count_potions_in_db (const db_connection_t *db_connection) |
Count the number of potions in the database. | |
gear_init_t * | init_gear_table_from_db (const db_connection_t *db_connection) |
Get the gear table from the database. | |
void | free_gear_table_from_db (gear_init_t *gear_init_table, const db_connection_t *db_connection) |
Clean up the gear table Call this function to free the memory allocated for the gear table. | |
int | count_gear_in_db (const db_connection_t *db_connection) |
Count the number of gears in the database. |
Implements functionality for working with items and database.
Definition in file item_database.c.
#define SQL_SELECT_ALL_GEARS |
Definition at line 14 of file item_database.c.
#define SQL_SELECT_ALL_POTIONS "SELECT PO_TYPE, PO_NAME, PO_VALUE FROM potion" |
Definition at line 12 of file item_database.c.
#define SQL_SELECT_COUNT_GEARS "SELECT COUNT(*) FROM gear" |
Definition at line 13 of file item_database.c.
#define SQL_SELECT_COUNT_POTIONS "SELECT COUNT(*) FROM potion" |
Definition at line 11 of file item_database.c.
int count_gear_in_db | ( | const db_connection_t * | db_connection | ) |
Count the number of gears in the database.
db_connection | Pointer to the database connection |
Definition at line 206 of file item_database.c.
int count_potions_in_db | ( | const db_connection_t * | db_connection | ) |
Count the number of potions in the database.
db_connection | Pointer to the database connection |
Definition at line 108 of file item_database.c.
void free_gear_table_from_db | ( | gear_init_t * | gear_init_table, |
const db_connection_t * | db_connection ) |
Clean up the gear table Call this function to free the memory allocated for the gear table.
gear_init_table | Pointer to the gear table |
db_connection | Pointer to the database connection |
Definition at line 196 of file item_database.c.
void free_potion_table_from_db | ( | potion_init_t * | potion_init_table, |
const db_connection_t * | db_connection ) |
Clean up the potion table Call this function to free the memory allocated for the potion table.
potion_init_table | Pointer to the potion table |
db_connection | Pointer to the database connection |
Definition at line 98 of file item_database.c.
gear_init_t * init_gear_table_from_db | ( | const db_connection_t * | db_connection | ) |
Get the gear table from the database.
db_connection | Pointer to the database connection |
Definition at line 139 of file item_database.c.
potion_init_t * init_potion_table_from_db | ( | const db_connection_t * | db_connection | ) |
Get the potion table from the database.
db_connection | Pointer to the database connection |
Definition at line 51 of file item_database.c.