From the NannyMUD documentation

LAST CHANGE

2001-08-17

NAME

        xmand - The daemon serving the xdoc system.

INCLUDES

        xman.h

DESCRIPTION

	The xmand keeps track of the index files for the xdoc
	system. For example, it checks now and then if the index files
	has changed, and will then re-read them.

FUNCTIONS

QUERY FUNCTIONS

	check_version
	access_checks
	query_syntax_db_exists
	query_syntax
	query_keyword_db_exists
	query_keyword
	query_part_db_exists
	query_part
	query_file_db_exists
	query_file
	query_mortal_db_exists
	query_mortal
	query_prop_db_exists
	query_prop
	query_soundex
	query_typo

FUNCTION


NAME

        check_version - Client and server has the same version?

SYNTAX

int check_version(string version)

DESCRIPTION

        This function allows you to check that your client and the
	daemon has the same version. If the version has changed, the
	API might have changed, and your client should not be using
	the daemon.

FUNCTION


NAME

        access_checks - Check if user is allowed to use the daemon.

SYNTAX

int access_checks(object ob)

DESCRIPTION

        This function is perhaps of little use to other objects than
	the daemon itself. It is used to determine if a user is
	allowed the services of the dameon.

	This function does not offer any real security, but simply
	checks that the user is a wizard.

FUNCTION


NAME

        query_syntax_db_exists - Is the syntax database loaded?

SYNTAX

int query_syntax_db_exists()

DESCRIPTION

        This function can be used to tell if the syntax database has
        been loaded by the daemon.

	It returns one of (as defined in xman.h):
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_syntax - Do a syntax lookup.

SYNTAX

        varargs mixed query_syntax(string pattern,
			           object user,
				   int kind,
				   int which_end,
				   string *own_db)

DESCRIPTION

        This function performs a lookup in the syntax database. The
        arguments are:
	pattern
	  This is the string given by the user.
	  
	user
	  This is the player for which the lookup is done.
	  
	kind
	  This is the kind of matching that will be performed. It is
	  one of (as defined in xman.h):
	  XMAN_USE_REGEXP - Use regexp() for matching.
	  XMAN_USE_GLOB   - Use glob() for matching.
	  XMAN_USE_EXACT  - Use exact matching.
	  

	which_end
	  This parameter is only used if 'kind' is XMAN_USE_REGEXP. It
	  is used to tell if the search is to be anchored, and if so,
	  at the beginning or end of the pattern. It is one of (as
	  defined in xman.h):
	  XMAN_MATCH_AT_HEAD
	  XMAN_MATCH_AT_TAIL

	own_db
	  You can provide your own database for the search by using
	  this argument.

	This function will return an array of hits. This array might
	be empty if there were no hits. The content of the array is
	lines from the syntax index. Look into the index file for the
	format of those lines.

NOTE

        The 'exact' matching is done using regexp(), anchoring the
        search pattern at both ends.

SEE ALSO

        regexp in efun/special/regexp

SEE ALSO

        glob in efun/special/glob

FUNCTION


NAME

        query_keyword_db_exists - Is the keyword database loaded?

SYNTAX

        int query_keyword_db_exists()

DESCRIPTION

        This function can be used to tell if the keyword database has
        been loaded by the daemon.

	It returns one of:
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_keyword - Perform a keyword lookup.

SYNTAX

        varargs mixed query_keyword(string pattern,
			            object user,
			            int kind,
				    int which_end,
				    string *own_db)

DESCRIPTION

        This function uses the arguments in the same way as
	query_syntax() does. It returns similar data, but for
	keywords.

SEE ALSO

        query_syntax in xdoc/xmand

FUNCTION


NAME

        int query_part_db_exists - Is the topic database loaded?

SYNTAX



DESCRIPTION

        This function can be used to tell if the topic database has
        been loaded by the daemon.

	It returns one of:
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_part - Perform a topic lookup.

SYNTAX

        varargs mixed query_part(string pattern,
			         object user,
				 int kind,
				 int which_end,
				 own_db)

DESCRIPTION

        This function uses the arguments in the same way as
	query_syntax() does. It returns similar data, but for the
	topic.

	The use of the name 'part' instead of 'topic' in the function
	name comes from the fact that often a topic is documented as
	part of a large file, documenting a whole object.

SEE ALSO

        query_syntax in xdoc/xmand

FUNCTION


NAME

        query_file_db_exists - Is the file database loaded?

SYNTAX

int query_file_db_exists()

DESCRIPTION

        This function can be used to tell if the file database has
        been loaded by the daemon.

	It returns one of:
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_file - Perform a file lookup.

SYNTAX

        varargs mixed query_file(string pattern,
			         object user,
				 int kind,
				 int which_end,
				 string *own_db)

DESCRIPTION

        This function uses the arguments in the same way as
	query_syntax() does. It returns similar data, but for the file
	index.

SEE ALSO

        query_syntax in xdoc/xmand

FUNCTION


NAME

        query_mortal_db_exists - Is the mortal database loaded?

SYNTAX

int query_mortal_db_exists()

DESCRIPTION

        This function can be used to tell if the mortal database has
        been loaded by the daemon.

	It returns one of:
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_mortal - Perform a mortal lookup.

SYNTAX

        varargs mixed query_mortal(string pattern,
				   object user,
				   int kind,
				   int which_end,
				   string *own_db)

DESCRIPTION

        This function uses the arguments in the same way as
	query_syntax() does. It returns similar data, but for the mortal
	index.

	The index for the help for mortals is built each reset through
	a recursive search of the corresponding help tree. The search
	is not split using call-outs, but is done in one, optimized,
	sweep.

	Those help pages are not in R2R format, but will be processed
	as if they were. This should have no effect on them, costs
	very little, and makes the daemon code less complex.

FUNCTION


NAME

        query_prop_db_exists - Is the prop database loaded?

SYNTAX

int query_prop_db_exists()

DESCRIPTION

        This function can be used to tell if the prop database has
        been loaded by the daemon.

	It returns one of:
	XMAN_NO_DB
	XMAN_EMPTY_DB
	XMAN_DB_OK

FUNCTION


NAME

        query_prop - Perform a prop lookup.

SYNTAX

        varargs mixed query_prop(string pattern,
				   object user,
				   int kind,
				   int which_end,
				   string *own_db)

DESCRIPTION

        This function uses the arguments in the same way as
	query_syntax() does. It returns similar data, but for the prop
	index.

	The index for the help for the properties is built each reset
	by quering the property daemon.

SEE ALSO

        query_syntax in xdoc/xmand

FUNCTION


NAME

        query_soundex - Perform soundex matching.

SYNTAX

        string *soundex(string word)

DESCRIPTION

        This function computes the nannymud-soundex of the argument,
	looks for a match in the soundex database held by the daemon,
	and returns an array of strings that have the same soundex
	value.

SEE ALSO

        query_syntax in xdoc/xmand

SEE ALSO

        query_typo in xdoc/xmand

FUNCTION


NAME

        query_typo - Perform similarity matching.

SYNTAX

        mixed *query_typo(string word)

DESCRIPTION

        This function finds every word in the topic database which is
	one typo away from the word.

SEE ALSO

        query_syntax in xdoc/xmand

SEE ALSO

        query_soundex in xdoc/xmand

SEE ALSO

        typo in obj/typo