Skip to content

Commit

Permalink
Add d2gamedata.h to docs generation
Browse files Browse the repository at this point in the history
Some stuff is left out of the docs via @Private
  • Loading branch information
squeek502 committed Feb 12, 2019
1 parent bc0b305 commit 588766a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ INLINE_SIMPLE_STRUCTS = YES
TYPEDEF_HIDES_STRUCT = YES
EXTRACT_ALL = YES
EXTRACT_STATIC = NO
EXTRACT_PRIVATE = NO

# The INPUT tag is used to specify the files and/or directories that contain
# documented source files. You may enter file names like myfile.cpp or
# directories like /usr/src/myproject. Separate the files or directories with
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ../src/d2itemreader.h
INPUT = ../src/d2itemreader.h ../src/d2gamedata.h

GENERATE_HTML = NO
GENERATE_LATEX = NO
Expand Down
22 changes: 16 additions & 6 deletions src/d2gamedata.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ extern "C" {
#include "d2err.h"
#include "d2util.h"

/// @private
/// @{
#define D2DATA_ITEMSTAT_END_ID 0x1ff
#define D2DATA_MAX_ITEMSTATCOST_IDS D2DATA_ITEMSTAT_END_ID

Expand All @@ -21,6 +23,7 @@ extern "C" {
#define D2DATA_INIT_STATE_MISCS (1 << 2)
#define D2DATA_INIT_STATE_ITEMSTATS (1 << 3)
#define D2DATA_INIT_STATE_ALL (D2DATA_INIT_STATE_ARMORS|D2DATA_INIT_STATE_WEAPONS|D2DATA_INIT_STATE_MISCS|D2DATA_INIT_STATE_ITEMSTATS)
/// @}

typedef struct d2gamedata_itemstat {
uint16_t id;
Expand Down Expand Up @@ -61,7 +64,7 @@ typedef struct d2gamedatabufs {
} d2gamedatabufs;

/**
* Load the default data packaged with d2gamedata (should work for un-modded D2 versions >= 1.10)
* Load the default data packaged with d2itemreader (should work for un-modded D2 versions >= 1.10)
*
* @return `D2ERR_OK` on success
*
Expand Down Expand Up @@ -92,20 +95,26 @@ CHECK_RESULT d2err d2gamedata_init_files(d2gamedata* data, d2gamedatafiles files
* @see d2gamedata_init_files(), d2gamedata_init_default(), d2gamedata_destroy()
*/
CHECK_RESULT d2err d2gamedata_init_bufs(d2gamedata* data, d2gamedatabufs bufs);
/**
* Initialize an empty d2gamedata struct
*/
CHECK_RESULT d2err d2gamedata_init(d2gamedata* data);

/**
* Cleanup memory used by d2gamedata.
*
* \attention **IMPORTANT**: d2gamedata_destroy() only needs to be called if the init function returns `D2ERR_OK`
*
* @see d2gamedata_init_default(), d2gamedata_init_files(), d2gamedata_init_bufs(), d2gamedata_init()
* @see d2gamedata_init_default(), d2gamedata_init_files(), d2gamedata_init_bufs()
*/
void d2gamedata_destroy(d2gamedata* data);

/// @private
/// @{
/*
* Initialize an empty d2gamedata struct. Not typically necessary outside of internal library functions
*/
CHECK_RESULT d2err d2gamedata_init(d2gamedata* data);
/// @}

/// @private
/// @{
bool d2gamedata_is_armor(const d2gamedata* data, const char* itemCode);
bool d2gamedata_is_weapon(const d2gamedata* data, const char* itemCode);
bool d2gamedata_is_stackable(const d2gamedata* data, const char* itemCode);
Expand All @@ -119,6 +128,7 @@ CHECK_RESULT d2err d2gamedata_load_miscs(d2gamedata* data, const char* txtdata,
CHECK_RESULT d2err d2gamedata_load_miscs_from_file(d2gamedata* data, const char* filename);
CHECK_RESULT d2err d2gamedata_load_itemstats(d2gamedata* data, const char* txtdata, size_t length);
CHECK_RESULT d2err d2gamedata_load_itemstats_from_file(d2gamedata* data, const char* filename);
/// @}

#ifdef __cplusplus
}
Expand Down

0 comments on commit 588766a

Please sign in to comment.