1m4_ignore([dnl 2#include <sys/types.h> 3#include <sys/stat.h> 4 5#include <errno.h> 6#include <pthread.h> 7#include <stdarg.h> 8#include <stdlib.h> 9#include <string.h> 10#include <unistd.h> 11 12#include <db.h> 13 14void log_archlist(DB_ENV *); 15 16int 17main() 18{ 19 DB_ENV *dbenv; 20 log_archlist(dbenv); 21 return (0); 22}]) 23m4_indent([dnl 24void 25log_archlist(DB_ENV *dbenv) 26{ 27 int ret; 28 char **begin, **list; 29m4_blank 30 /* Get the list of database files. */ 31 if ((ret = dbenv-__GT__log_archive(dbenv, 32 &list, DB_ARCH_ABS | DB_ARCH_DATA)) != 0) { 33 dbenv-__GT__err(dbenv, ret, "DB_ENV-__GT__log_archive: DB_ARCH_DATA"); 34 exit (1); 35 } 36 if (list != NULL) { 37 for (begin = list; *list != NULL; ++list) 38 printf("database file: %s\n", *list); 39 free (begin); 40 } 41m4_blank 42 /* Get the list of log files. */ 43 if ((ret = dbenv-__GT__log_archive(dbenv, 44 &list, DB_ARCH_ABS | DB_ARCH_LOG)) != 0) { 45 dbenv-__GT__err(dbenv, ret, "DB_ENV-__GT__log_archive: DB_ARCH_LOG"); 46 exit (1); 47 } 48 if (list != NULL) { 49 for (begin = list; *list != NULL; ++list) 50 printf("log file: %s\n", *list); 51 free (begin); 52 } 53}]) 54