| 356 | // Main DB functions |
| 357 | |
| 358 | static datum _database_fetch(DBM *database, const string &key) |
| 359 | { |
| 360 | datum result; |
| 361 | result.dptr = nullptr; |
| 362 | result.dsize = 0; |
| 363 | datum dbKey; |
| 364 | |
| 365 | dbKey.dptr = (DPTR_COERCE) key.c_str(); |
| 366 | dbKey.dsize = key.length(); |
| 367 | |
| 368 | // Don't use the database if called from "monster". |
| 369 | if (database) |
| 370 | result = dbm_fetch(database, dbKey); |
| 371 | |
| 372 | return result; |
| 373 | } |
| 374 | |
| 375 | static vector<string> _database_find_keys(DBM *database, |
| 376 | const string ®ex, |
no test coverage detected