33 #define PROG_NAME "xapian-progsrv" 34 #define PROG_DESC "Piped server for use with Xapian's remote backend" 39 static const char *
opts =
"t:w";
49 cout <<
"Usage: " PROG_NAME " [OPTIONS] DATABASE_DIRECTORY...\n\n" 51 " --timeout MSECS set timeout\n" 52 " --writable allow updates\n" 53 " --help display this help and exit\n" 54 " --version output version information and exit\n";
57 int main(
int argc,
char **argv)
60 bool writable =
false;
61 bool syntax_error =
false;
74 timeout = atoi(
optarg) * 1e-3;
84 if (syntax_error ||
optind == argc) {
99 RemoteServer server(dbnames, 0, 1, timeout, timeout, writable);
Wrappers to allow GNU getopt to be used cleanly from C++ code.
unsigned timeout
A timeout value in milliseconds.
int gnu_getopt_long(int argc_, char *const *argv_, const char *shortopts_, const struct option *longopts_, int *optind_)
static const char * dbnames
void run()
Repeatedly accept messages from the client and process them.
int main(int argc, char **argv)
Xapian remote backend server base class.
#define required_argument
Remote backend server base class.
static const struct option long_opts[]