<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqtext">
<Function File="../../src/liblqtext/defaults.c">
<Name>LQT_InitFromArgv</Name>
<Class>Database/Defaults
<Purpose>
<P>This function is called to Initialise the lq-text libraries.
It sets the global variable <var>progname</var> from argv[0],
but does not remove any leading directories;
if you want just the command name to
appear in error messages and other output, you should set progname
in main() before calling LQT_InitFromArgv.</P>
<P>After setting progname, LQT_InitFromArgv handles any lq-text
command-line options.  Currently, each option is turned into either
-z if it does not take an argument, or -Z if it take an argument.
As a result, you should ignore -z and -Z options if they appear,
together with the argument to -Z, and you should not give your
program a -z or -Z option.  This behaviour will change completely
in a future release of lq-text, when improved command-line
argument handling is introduced.</P>
<P>The command line options currently understood include:
<List>
<LI>-d <I>dir</I>, to specify a database directory</LI>
<LI>-m <I>p|h|a</I>, to specify whether to match phrases precisely,
heuristically, or approximately;</LI>
<LI>-t <I>flags</I>, to turn on tracing; the given flags should be
a string of debugging flag names separated by the vertical bar (|).
An example would be -t Trace|Debug, but you will usually need to 
quote the argument to protect it from the shell.
The value List will print a list of available values.</LI>
</List>
<Restrictions>
Must be called before any other liblqtext functions.
<Returns>
A pointer to an object used to represent options; this object should
be passed to LQT_OpenDatabase().
<SeeAlso>
LQT_OpenDatabase
</Function>
<Decl>
API t_lqdbOptions *
LQT_InitFromArgv(argc, argv)
    int argc;
    char **argv;
</Decl>
</Entry>
