GRASS Programmer's Manual 6.4.1(2011)
login.c File Reference
#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.

Data Structures

struct  DATA
struct  LOGIN

Functions

void init_login (LOGIN *login)
void add_login (LOGIN *login, const char *dr, const char *db, const char *usr, const char *pwd)
int read_file (LOGIN *login)
int write_file (LOGIN *login)
int db_set_login (const char *driver, const char *database, const char *user, const char *password)
 Set user/password for driver/database.
int db_get_login (const char *driver, const char *database, const char **user, const char **password)
 Get user/password for driver/database if driver/database is not found, user/password are set to NULL.

Function Documentation

void add_login ( LOGIN login,
const char *  dr,
const char *  db,
const char *  usr,
const char *  pwd 
)

Definition at line 45 of file login.c.

References LOGIN::a, LOGIN::data, DATA::database, DATA::driver, LOGIN::n, DATA::password, and DATA::user.

Referenced by db_set_login(), and read_file().

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

Get user/password for driver/database if driver/database is not found, user/password are set to NULL.

Returns:
DB_OK
DB_FAILED

Definition at line 204 of file login.c.

References LOGIN::data, DATA::database, DATA::driver, init_login(), LOGIN::n, DATA::password, read_file(), and DATA::user.

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

Set user/password for driver/database.

Returns:
DB_OK
DB_FAILED

Definition at line 155 of file login.c.

References add_login(), LOGIN::data, DATA::database, DATA::driver, init_login(), LOGIN::n, DATA::password, read_file(), DATA::user, and write_file().

void init_login ( LOGIN login)

Definition at line 36 of file login.c.

References LOGIN::a, LOGIN::data, and LOGIN::n.

Referenced by db_get_login(), and db_set_login().

int read_file ( LOGIN login)

Definition at line 66 of file login.c.

References add_login(), and LOGIN::n.

Referenced by db_get_login(), and db_set_login().

int write_file ( LOGIN login)

Definition at line 115 of file login.c.

References LOGIN::data, DATA::database, DATA::driver, LOGIN::n, DATA::password, and DATA::user.

Referenced by db_set_login().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines