CWB
Data Structures | Defines | Typedefs | Functions | Variables

corpus.h File Reference

#include "globals.h"
#include "storage.h"

Data Structures

Defines

Typedefs

Functions

Variables


Define Documentation

#define IDList_check_member (   l,
 
)    memberIDList(s, l)
#define IDList_delete (   l)    FreeIDList(l)

Typedef Documentation

typedef struct _idbuf IDBuf

Underlying structure for the IDList class.

typedef struct _idbuf* IDList

The IDList class: entries in linked lists of identifier strings.

These identifier strings can be usernames, groupnames or hostnames and are used to restrict access to particular corpora.

Note that IDLists are added to Corpus objects by the registry parser.

NOT to be confused with "idlist" in the sense of cl_idlist2cpos().


Function Documentation

void add_corpus_property ( Corpus corpus,
char *  property,
char *  value 
)

Adds a property to the list of corpus properties.

If the property is already defined, ignore and warn. If the property is 'charset', corpus charset is set as well.

Parameters:
corpusCorpus object to add property to.
propertyName of property to add.
valueValue of property to add.

References TCorpus::charset, charset, cl_charset_from_name(), cl_corpus_property(), cl_malloc(), cregin_name, cregin_path, TCorpusProperty::next, TCorpus::properties, TCorpusProperty::property, and TCorpusProperty::value.

void describe_corpus ( Corpus corpus)
Corpus* find_corpus ( char *  registry_dir,
char *  registry_name 
)

Gets a pointer to the Corpus object with the specified CWB-name and registry location.

(Works by searching the loaded_corpora global linked list.)

Parameters:
registry_dirThe registry directory.
registry_nameThe CWB name of the corpus.
Returns:
The Corpus, or NULL if it wasn't found.

References cl_standard_registry(), TCorpus::next, PATH_SEPARATOR, TCorpus::registry_dir, TCorpus::registry_name, and STREQ.

Referenced by cl_new_corpus().

void FreeIDList ( IDList list)

Deletes an IDList object, and sets the argument pointer to NULL.

Parameters:
listIDList to delete.

References cl_free, _idbuf::next, and _idbuf::string.

Referenced by cl_delete_corpus().

int memberIDList ( char *  s,
IDList  l 
)

Checks whether the specified string occurs in the given IDList.

Parameters:
sThe username, groupname, or hostname to look for.
lThe IDList to search.
Returns:
Boolean: true if s is a member of the list, else false.

References _idbuf::next, and _idbuf::string.

Referenced by check_access_conditions().


Variable Documentation

char* cregin_name

The name of registry file currently being parsed (for registry parser error messages)

See also:
cregparse

Referenced by add_corpus_property(), and cl_new_corpus().

char* cregin_path

Full path of the registry file currently being parsed (for registry parser error messages)

See also:
cregparse

Referenced by add_corpus_property(), and cl_new_corpus().

Head of a linked list of loaded corpus handles (for memory manager).

Referenced by cl_delete_corpus(), and cl_new_corpus().