GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
login.c File Reference

DBMI Library (base) - login settings. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for login.c:

Go to the source code of this file.

Functions

int db_set_login2 (const char *driver, const char *database, const char *user, const char *password, const char *host, const char *port, int overwrite)
 Set login parameters for driver/database. More...
 
int db_set_login (const char *driver, const char *database, const char *user, const char *password, const char *host, const char *port, int overwrite)
 Set login parameters for driver/database. More...
 
int db_get_login2 (const char *driver, const char *database, const char **user, const char **password, const char **host, const char **port)
 Get login parameters for driver/database. More...
 
int db_get_login (const char *driver, const char *database, const char **user, const char **password, const char **host, const char **port)
 Get login parameters for driver/database. More...
 
int db_get_login_dump (FILE *fd)
 Print all connection settings to file. More...
 

Detailed Description

DBMI Library (base) - login settings.

(C) 1999-2015 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Joel Jones (CERL/UIUC), Radim Blazek

Definition in file login.c.

Function Documentation

◆ db_get_login()

int db_get_login ( const char *  driver,
const char *  database,
const char **  user,
const char **  password,
const char **  host,
const char **  port 
)

Get login parameters for driver/database.

If driver/database is not found, output arguments are set to NULL.

Parameters
driverdriver name
databasedatabase name (can be NULL)
[out]username
[out]passwordstring
[out]hostname
[out]port
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 381 of file login.c.

Referenced by db_get_connection(), and db_get_login2().

◆ db_get_login2()

int db_get_login2 ( const char *  driver,
const char *  database,
const char **  user,
const char **  password,
const char **  host,
const char **  port 
)

Get login parameters for driver/database.

If driver/database is not found, output arguments are set to NULL.

Parameters
driverdriver name
databasedatabase name (can be NULL)
[out]username
[out]passwordstring
[out]hostname
[out]port
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 360 of file login.c.

References db_get_login().

◆ db_get_login_dump()

int db_get_login_dump ( FILE *  fd)

Print all connection settings to file.

Parameters
fdfile where to print settings
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 395 of file login.c.

References G_debug().

◆ db_set_login()

int db_set_login ( const char *  driver,
const char *  database,
const char *  user,
const char *  password,
const char *  host,
const char *  port,
int  overwrite 
)

Set login parameters for driver/database.

Parameters
driverdriver name
databasedatabase name
useruser name
passwordpassword string
hosthost name
port
overwriteTRUE to overwrite existing connections
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 289 of file login.c.

Referenced by db_set_login2().

◆ db_set_login2()

int db_set_login2 ( const char *  driver,
const char *  database,
const char *  user,
const char *  password,
const char *  host,
const char *  port,
int  overwrite 
)

Set login parameters for driver/database.

Parameters
driverdriver name
databasedatabase name
useruser name
passwordpassword string
hosthost name
port
overwriteTRUE to overwrite existing connections
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 267 of file login.c.

References db_set_login().