libmpm

morphux C package management library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/libmpm

commit 4892f20865d1914ecbf47b053d491b983fbf81b5
parent ad71bd88b9bcf7da1f57814ea03d616cf6125e58
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon,  6 Mar 2017 19:58:41 +0100

Fix(Comment style): [in,out]

Diffstat:
Minc/category.h | 3++-
Minc/config.h | 8++++----
Minc/database.h | 112++++++++++++++++++++++++++++++++++++++++----------------------------------------
3 files changed, 62 insertions(+), 61 deletions(-)

diff --git a/inc/category.h b/inc/category.h @@ -38,13 +38,14 @@ typedef struct category_s { /*! * \brief Free a category + * \param[in] tmp Pointer to free * \note This function can be used as a list_free callback */ int mpm_category_free(void *tmp); /*! * \brief Initialize a category_t - * \param ptr Structure to initialize + * \param[in,out] ptr Structure to initialize */ void mpm_category_init(category_t *ptr); diff --git a/inc/config.h b/inc/config.h @@ -89,8 +89,8 @@ typedef struct config_s { /*! * \brief Initialize a new config_t structure and read a config file - * \param path Path of the config file. If null, the default PATH is used - * \param ret Return code of the parse function + * \param[in] path Path of the config file. If null, the default PATH is used + * \param[out] ret Return code of the parse function * * This function will open a file, read a configuration in it. * If anything is wrong, the ret variable will be set to the proper error value. @@ -101,13 +101,13 @@ config_t *parse_config(const char *path, u8_t *ret); /*! * \brief Free a config_t pointer - * \param ptr Pointer to free + * \param[in,out] ptr Pointer to free */ void config_free(config_t **ptr); /*! * \brief Get the parsing error string - * \paran[in] ptr Config context + * \param[in] ptr Config context */ void config_get_error_string(config_t *ptr); diff --git a/inc/database.h b/inc/database.h @@ -83,35 +83,35 @@ typedef struct database_s { /*! * \brief Open a connection to a database - * \param ret Return code, if any error - * \param fn Database path - * \return A fresh database_t structure + * \param[out] ret Return code, if any error + * \param[in] fn Database path * * This function will create a new database_t struct, allocate it, and open * a new database connection. In case of any error, the return value will be * NULL, and the ret pointer set to an error code. * If a value is passed to the param fn, the library will use this value as a * database file path. + * \return A fresh database_t structure */ database_t *mpm_database_open(u8_t *ret, const char *fn); /*! * \brief Close a connection to an existing database - * \param ptr An open database - * \return The error code + * \param[in] ptr An open database * * This function will close a database connection and free the passed struct. * On any error, this function will return the error code. + * \return The error code */ u8_t mpm_database_close(database_t *ptr); /*! * \brief Execute a SQL query on an already opened database - * \param ptr Opened database - * \param query SQL Query - * \param cl Query callback - * \param ct First parameter of the callback (Context) - * \param err Pointer on a string, to be filled with a string error. + * \param[in] ptr Opened database + * \param[in] query SQL Query + * \param[in] cl Query callback + * \param[in,out] ct First parameter of the callback (Context) + * \param[out] err Pointer on a string, to be filled with a string error. * * This function will execute an SQL query on an already opened database. * If the ptr or query parameter is NULL, the function will not do anything @@ -127,9 +127,9 @@ u8_t mpm_database_exec(database_t *ptr, const char *query, SQL_CALLBACK_PTR(cl), void *ct, char **err); /*! * \brief Get a package by his Id - * \param ptr Opened Database connection - * \param id ID to search for - * \param pkg Pointer on a list, used to store the results + * \param[in] ptr Opened Database connection + * \param[in] id ID to search for + * \param[out] pkg Pointer on a list, used to store the results * \return Error code * * This function will search in an already opened database a package with a @@ -146,9 +146,9 @@ u8_t mpm_get_package_by_id(database_t *ptr, u64_t id, mlist_t **pkg); /*! * \brief Get a package by his name - * \param ptr Opened Database connection - * \param name Name to search for - * \param pkg Pointer on a list, used to store the results + * \param[in] ptr Opened Database connection + * \param[in] name Name to search for + * \param[out] pkg Pointer on a list, used to store the results * \return Error code * * This function will search in an already opened database package(s) with a @@ -165,9 +165,9 @@ u8_t mpm_get_package_by_name(database_t *ptr, const char *name, mlist_t **pkg); /*! * \brief Fill a package_t structure with a SQL result - * \param ptr Pointer to package_t. Must not be NULL. - * \param name Name of the column - * \param val Value of the column + * \param ptr[in] Pointer to package_t. Must not be NULL. + * \param name[in] Name of the column + * \param val[in] Value of the column * * This function will transform an SQL result, given through an sqlite callback, * and fill a package_t structure with it. @@ -179,7 +179,7 @@ package_t *sql_to_package(package_t *ptr, char *name, char *val); /*! * \brief Init an empty database - * \param ptr Open connection to a database + * \param ptr[in] Open connection to a database * * This function will create tables in an empty database. * Careful, this function do not check if a database is empty before making @@ -193,8 +193,8 @@ u8_t mpm_database_init(database_t *ptr); /*! * \brief Add a package entry in the database - * \param ptr Opened connection to a database - * \param pkg Package to add + * \param ptr[in] Opened connection to a database + * \param pkg[in] Package to add * * This function will add a package entry to an already opened connection. */ @@ -202,10 +202,9 @@ u8_t mpm_database_add_pkg(database_t *ptr, package_t *pkg); /*! * \brief Get a file by his Id - * \param ptr Opened Database connection - * \param id ID to search for - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] id ID to search for + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a file with a * given id. @@ -216,16 +215,16 @@ u8_t mpm_database_add_pkg(database_t *ptr, package_t *pkg); * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_file_by_id(database_t *ptr, u64_t id, mlist_t **files); /*! * \brief Get a file by his path - * \param ptr Opened Database connection - * \param path Path to search for - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] path Path to search for + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a file with a * given path. @@ -236,16 +235,16 @@ u8_t mpm_get_file_by_id(database_t *ptr, u64_t id, * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_file_by_path(database_t *ptr, const char *path, mlist_t **files); /*! * \brief Get a file by his parent id - * \param ptr Opened Database connection - * \param id Parent ID to search for - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] id Parent ID to search for + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a file with a * given parent id. @@ -256,16 +255,16 @@ u8_t mpm_get_file_by_path(database_t *ptr, const char *path, * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_file_by_parent_id(database_t *ptr, u64_t id, mlist_t **files); /*! * \brief Get a file by his parent name - * \param ptr Opened Database connection - * \param name Parent name - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] name Parent name + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a file with a * given parent name. @@ -276,15 +275,16 @@ u8_t mpm_get_file_by_parent_id(database_t *ptr, u64_t id, * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_file_by_parent_name(database_t *ptr, const char *name, mlist_t **files); /*! * \brief Fill a file_t structure with a SQL result - * \param ptr Pointer to file_t. Must not be NULL. - * \param name Name of the column - * \param val Value of the column + * \param[in] ptr Pointer to file_t. Must not be NULL. + * \param[in] name Name of the column + * \param[in] val Value of the column * * This function will transform an SQL result, given through an sqlite callback, * and fill a file_t structure with it. @@ -296,16 +296,16 @@ file_t *sql_to_file(file_t *ptr, char *name, char *val); /*! * \brief Add a file entry to the database - * \param ptr Opened connection to a database - * \param file File to add + * \param[in] ptr Opened connection to a database + * \param[in] file File to add */ u8_t mpm_database_add_file(database_t *ptr, file_t *file); /*! * \brief Fill a category_t structure with a SQL result - * \param ptr Pointer to category_t. Must not be NULL. - * \param name Name of the column - * \param val Value of the column + * \param[in] ptr Pointer to category_t. Must not be NULL. + * \param[in] name Name of the column + * \param[in] val Value of the column * * This function will transform an SQL result, given through an sqlite callback, * and fill a category_t structure with it. @@ -317,10 +317,9 @@ category_t *sql_to_category(category_t *ptr, char *name, char *val); /*! * \brief Get a category by his Id - * \param ptr Opened Database connection - * \param id ID to search for - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] id ID to search for + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a category with a * given id. @@ -331,15 +330,15 @@ category_t *sql_to_category(category_t *ptr, char *name, char *val); * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_categ_by_id(database_t *ptr, u64_t id, mlist_t **cat); /*! * \brief Get a category by his name - * \param ptr Opened Database connection - * \param name Name to search for - * \param files Pointer on a list, used to store the results - * \return Error code + * \param[in] ptr Opened Database connection + * \param[in] name Name to search for + * \param[out] files Pointer on a list, used to store the results * * This function will search in an already opened database a category with a * given name. @@ -350,14 +349,15 @@ u8_t mpm_get_categ_by_id(database_t *ptr, u64_t id, mlist_t **cat); * * \note This function will set files to NULL before filling it with the results. * You should not call this function with an existing files list. + * \return Error code */ u8_t mpm_get_categ_by_name(database_t *ptr, const char *name, mlist_t **cat); /*! * \brief Add a category in the database - * \param ptr Opened connection to a database - * \param cat Category to add + * \param[in] ptr Opened connection to a database + * \param[in] cat Category to add */ u8_t mpm_database_add_categ(database_t *ptr, category_t *cat);