47 |
const char *dbpath; |
const char *dbpath; |
48 |
{ |
{ |
49 |
DBOP *dbop; |
DBOP *dbop; |
50 |
char *path; |
const char *path; |
51 |
int n; |
int n; |
52 |
|
|
53 |
assoc = assoc_open('a'); |
assoc = assoc_open('a'); |
56 |
if (dbop == NULL) |
if (dbop == NULL) |
57 |
die("cannot open '%s'.", makepath(dbpath, dbname(GPATH), NULL)); |
die("cannot open '%s'.", makepath(dbpath, dbname(GPATH), NULL)); |
58 |
for (path = dbop_first(dbop, "./", NULL, DBOP_PREFIX | DBOP_KEY); path; path = dbop_next(dbop)) { |
for (path = dbop_first(dbop, "./", NULL, DBOP_PREFIX | DBOP_KEY); path; path = dbop_next(dbop)) { |
59 |
char *no = dbop_lastdat(dbop); |
const char *no = dbop_lastdat(dbop); |
60 |
|
|
61 |
path += 2; /* remove './' */ |
path += 2; /* remove './' */ |
62 |
assoc_put(assoc, path, no); |
assoc_put(assoc, path, no); |
82 |
* i) path path name |
* i) path path name |
83 |
* r) id |
* r) id |
84 |
*/ |
*/ |
85 |
char * |
const char * |
86 |
path2fid(path) |
path2fid(path) |
87 |
const char *path; |
const char *path; |
88 |
{ |
{ |
89 |
static char number[32], *p; |
static char number[32]; |
90 |
|
const char *p; |
91 |
|
|
92 |
if (strlen(path) > MAXPATHLEN) |
if (strlen(path) > MAXPATHLEN) |
93 |
die("path name too long. '%s'", path); |
die("path name too long. '%s'", path); |