From b958c86149d06b7b592da474579cddf98005f23f Mon Sep 17 00:00:00 2001 From: Mohan Yelugoti Date: Fri, 13 Sep 2024 20:43:33 -0400 Subject: [PATCH] lib/db: Deprecate db_get_login2() in favour of db_get_login(). Signed-off-by: Mohan Yelugoti --- include/grass/defs/dbmi.h | 2 ++ lib/db/dbmi_base/login.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/grass/defs/dbmi.h b/include/grass/defs/dbmi.h index e63b7ae8431..0eca1858489 100644 --- a/include/grass/defs/dbmi.h +++ b/include/grass/defs/dbmi.h @@ -391,6 +391,8 @@ int db_set_login2(const char *, const char *, const char *, const char *, const char *, const char *, int); int db_get_login(const char *, const char *, const char **, const char **, const char **, const char **); +int db_get_login2(const char *, const char *, const char **, const char **, + const char **, const char **); int db_get_login_dump(FILE *); #endif diff --git a/lib/db/dbmi_base/login.c b/lib/db/dbmi_base/login.c index e7800777120..3034aa0ca58 100644 --- a/lib/db/dbmi_base/login.c +++ b/lib/db/dbmi_base/login.c @@ -341,6 +341,29 @@ static int get_login(const char *driver, const char *database, return DB_OK; } +/*! + \brief Get login parameters for driver/database + + If driver/database is not found, output arguments are set to NULL. + + \deprecated Use db_get_login() instead. + + \param driver driver name + \param database database name (can be NULL) + \param[out] user name + \param[out] password string + \param[out] host name + \param[out] port + + \return DB_OK on success + \return DB_FAILED on failure + */ +int db_get_login2(const char *driver, const char *database, const char **user, + const char **password, const char **host, const char **port) +{ + return db_get_login(driver, database, user, password, host, port); +} + /*! \brief Get login parameters for driver/database