#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>
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. |
void add_login | ( | LOGIN * | login, | |
const char * | dr, | |||
const char * | db, | |||
const char * | usr, | |||
const char * | pwd | |||
) |
Definition at line 44 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.
Definition at line 202 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.
Definition at line 153 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 35 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 65 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 113 of file login.c.
References LOGIN::data, DATA::database, DATA::driver, LOGIN::n, DATA::password, and DATA::user.
Referenced by db_set_login().