Go to the first, previous, next, last section, table of contents.


getdb

char *getdb(void)

Return:

(char *)
pointer to the database path string

This function returns the current database path. For example, this code fragment

...
char *oldp, *newp;

oldp = getdb();
if (newp = malloc(strlen("/usr/mydb:") + strlen(oldp) + 1)) {
    sprintf(newp, "/usr/mydb:%s", oldp);
    setdb(newp);
}
...

adds the directory `/usr/mydb' to the beginning of the database path. (To perform a similar operation under MS-DOS, replace the colons by semicolons. The standard `/' directory separator can be used, even under MS-DOS; if you elect to use the alternate `\', remember to quote it within a C string as `\\'.)


Go to the first, previous, next, last section, table of contents.



George B. Moody (george@hstbme.mit.edu)