CWB
|
#include "globals.h"
Data Structures | |
struct | _idbuf |
Underlying structure for the IDList class. More... | |
struct | TCorpus |
Underlying structure for the Corpus class. More... | |
Macros | |
#define | IDList_delete(l) FreeIDList(l) |
#define | IDList_check_member(l, s) memberIDList(s, l) /* parameter order standardised for objects */ |
Typedefs | |
typedef struct _idbuf * | IDList |
The IDList class: entries in linked lists of identifier strings. More... | |
typedef struct _idbuf | IDBuf |
Underlying structure for the IDList class. More... | |
Functions | |
void | FreeIDList (IDList *list) |
Deletes an IDList object, and sets the argument pointer to NULL. More... | |
int | memberIDList (char *s, IDList l) |
Checks whether the specified string occurs in the given IDList. More... | |
void | add_corpus_property (Corpus *corpus, char *property, char *value) |
Adds a property to the list of corpus properties. More... | |
Corpus * | find_corpus (char *registry_dir, char *registry_name) |
Gets a pointer to the Corpus object with the specified CWB-name and registry location. More... | |
void | describe_corpus (Corpus *corpus) |
Prints a description of the corpus to STDOUT. More... | |
Variables | |
char * | cregin_path |
Full path of the registry file currently being parsed (for registry parser error messages) More... | |
char * | cregin_name |
The name of registry file currently being parsed (for registry parser error messages) More... | |
Corpus * | loaded_corpora |
Head of a linked list of loaded corpus handles (for memory manager). More... | |
#define IDList_check_member | ( | l, | |
s | |||
) | memberIDList(s, l) /* parameter order standardised for objects */ |
#define IDList_delete | ( | l | ) | FreeIDList(l) |
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().
void add_corpus_property | ( | Corpus * | corpus, |
char * | property, | ||
char * | value | ||
) |
Adds a property to the list of corpus properties.
Use this function from registry.y only!
If the property is already defined, ignore and warn. If the property is 'charset', corpus charset is set as well.
corpus | Corpus object to add property to. |
property | Name of property to add. |
value | Value of property to add. |
References TCorpus::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 | ) |
Prints a description of the corpus to STDOUT.
TODO might be nice to have this function offer an option of XML-style output. TODO might also be nice to have it return a string, or send to a parameter stream, so that the caller can decide what to do with it: direct UI formatting does not really belong in the low-level CL.
References _Attribute::any, TCorpus::attributes, describe_attribute(), TCorpus::id, TCorpus::info_file, TCorpus::name, TCorpus::path, TCorpus::registry_dir, and TCorpus::registry_name.
Referenced by main().
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.)
registry_dir | The registry directory. |
registry_name | The CWB name of the corpus. |
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.
list | IDList 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.
s | The username, groupname, or hostname to look for. |
l | The IDList to search. |
References _idbuf::next, and _idbuf::string.
Referenced by check_access_conditions().
char* cregin_name |
The name of registry file currently being parsed (for registry parser error messages)
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)
Referenced by add_corpus_property(), and cl_new_corpus().
Corpus* loaded_corpora |
Head of a linked list of loaded corpus handles (for memory manager).
Referenced by cl_delete_corpus(), and cl_new_corpus().