|
xapian-core
2.0.0
|
Helper functions for database handling. More...
#include <config.h>#include "databasehelpers.h"#include "backends.h"#include "glass/glass_defs.h"#include "honey/honey_defs.h"#include "io_utils.h"#include "omassert.h"#include "posixy_wrapper.h"#include <algorithm>#include <cstring>#include <string>#include <sys/types.h>#include "safesysstat.h"#include "safeunistd.h"
Include dependency graph for databasehelpers.cc:Go to the source code of this file.
Functions | |
| static int | test_if_single_file_db_ (int fd, off_t pos) |
| int | test_if_single_file_db (int fd) |
| Probe if a file descriptor is a single-file database. More... | |
| int | test_if_single_file_db (const struct stat &sb, const string &path, int *fd_ptr) |
| Probe if a path is a single-file database. More... | |
Helper functions for database handling.
Definition in file databasehelpers.cc.
| int test_if_single_file_db | ( | const struct stat & | sb, |
| const std::string & | path, | ||
| int * | fd_ptr | ||
| ) |
Probe if a path is a single-file database.
| sb | struct statbuf from calling stat() on path |
| path | path to probe |
| fd_ptr | used to return fd open of path (unless BACKEND_UNKNOWN is returned) |
Definition at line 89 of file databasehelpers.cc.
References Assert, BACKEND_UNKNOWN, close(), GLASS_MIN_BLOCKSIZE, HONEY_MIN_DB_SIZE, O_BINARY, posixy_open, S_ISREG, and test_if_single_file_db_().
| int test_if_single_file_db | ( | int | fd | ) |
Probe if a file descriptor is a single-file database.
This function looks for a single-file database at the current file offset of fd, restoring the file offset afterwards.
| fd | The file descriptor to check |
Definition at line 79 of file databasehelpers.cc.
References BACKEND_UNKNOWN, pos, and test_if_single_file_db_().
Referenced by Xapian::Database::check_(), Xapian::Database::Database(), and Xapian::database_factory().
|
static |
Definition at line 45 of file databasehelpers.cc.
References BACKEND_GLASS, BACKEND_HONEY, BACKEND_UNKNOWN, io_read(), and pos.
Referenced by test_if_single_file_db().