From 5ce5310f28f43b3ba997882b941e6d093235bb81 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Wed, 16 Jan 2013 15:56:20 +0000 Subject: [PATCH] Tidied up error handling. Also, const const const const const const const const const const const const const const const const const const const const const const const const const const const const to stop myself doing silly things in future, and avoid some compiler warnings. --- docs/BOSS API Readme.html | 41 ++++++------ src/api.cpp | 129 +++++++++++++++++++++----------------- src/api.h | 33 +++++----- src/error.h | 56 +++++++++++++++++ src/game.cpp | 34 +++++----- src/globals.h | 20 +++--- src/helpers.cpp | 3 +- src/parsers.h | 22 ++++--- src/plugin/ModFormat.cpp | 1 - src/tester.cpp | 5 +- 10 files changed, 214 insertions(+), 130 deletions(-) create mode 100644 src/error.h diff --git a/docs/BOSS API Readme.html b/docs/BOSS API Readme.html index b05fc890..bff43ed7 100644 --- a/docs/BOSS API Readme.html +++ b/docs/BOSS API Readme.html @@ -135,6 +135,7 @@ This documentation is a work in progress, covering an API that is also still a w BOSS_API_ERROR_NO_MEMThe API was unable to allocate the required memory. BOSS_API_ERROR_INVALID_ARGS Invalid arguments were given for the function. BOSS_API_ERROR_NO_TAG_MAPNo Bash Tag map has been generated yet. + BOSS_API_ERROR_PATH_NOT_FOUNDA file or folder path could not be found. BOSS_API_RETURN_MAXMatches the value of the highest-numbered return code.

The following codes are used with boss_create_db to specify the game that the API acts for. @@ -159,7 +160,7 @@ This documentation is a work in progress, covering an API that is also still a w

Error Handling Functions

-unsigned int boss_get_error_message (char ** message); +unsigned int boss_get_error_message (const char ** const message);

Outputs a string detailing the last error encountered.

-unsigned int boss_get_version (unsigned int * versionMajor, - unsigned int * versionMinor, - unsigned int * versionPatch); +unsigned int boss_get_version (unsigned int * const versionMajor, + unsigned int * const versionMinor, + unsigned int * const versionPatch);

Gets the version numbers of the API in use.