18 #include <sys/types.h>
23 #include <grass/gis.h>
24 #include <grass/dbmi.h>
49 if ((modestr =
getenv(
"GRASS_DB_DRIVER_GISRC_MODE"))) {
54 if (mode == G_GISRC_MODE_MEMORY) {
93 _setmode(_fileno(stdin), _O_BINARY);
94 _setmode(_fileno(stdout), _O_BINARY);
105 sscanf(argv[1],
"%d", &rfd);
106 sscanf(argv[2],
"%d", &wfd);
107 send = fdopen(wfd,
"w");
112 recv = fdopen(rfd,
"r");
126 #ifndef USE_BUFFERED_IO
143 if (procnum == DB_PROC_SHUTDOWN_DRIVER) {
151 for (i = 0; procedure[i].routine; i++)
152 if (procedure[i].procnum == procnum)
159 if ((stat = (*procedure[i].routine) ()) != DB_OK)
169 exit(stat == DB_OK ? 0 : 1);
void db__set_protocol_fds(FILE *send, FILE *recv)
void db_auto_print_protocol_errors(int flag)
void db_auto_print_errors(int flag)
char * G_getenv(const char *name)
Get environment variable.
void db_syserror(const char *s)
void G_set_gisrc_mode(int mode)
Set where to find/store variables.
int db__recv_procnum(int *n)
int db__send_procedure_not_implemented(int n)
void db_clear_error(void)
int db_driver(int argc, char *argv[])
Get driver (?)
int(* db_driver_finish)()
int G_debug(int level, const char *msg,...)
Print debugging message.
int G__setenv(const char *name, const char *value)
Set environment name to value.
int db__send_procedure_ok(int n)
void db__init_driver_state(void)
Initialize driver state.