Go to the source code of this file.
|
struct kb_item ** | kb_new () |
| Allocates memory for an array of kb_items with max length of HASH_MAX. More...
|
|
struct kb_item * | kb_item_get_single (struct kb_item **, char *, int) |
| READ the knowledge base. More...
|
|
char * | kb_item_get_str (struct kb_item **, char *) |
| Get the value of a kb_item with type KB_TYPE_STR and name name. More...
|
|
int | kb_item_get_int (struct kb_item **, char *) |
| Get the value of a kb_item with type KB_TYPE_INT and name name. More...
|
|
struct kb_item * | kb_item_get_all (struct kb_item **, char *) |
| Returns a list of copies of kb_items with name name in a knowledge base. More...
|
|
struct kb_item * | kb_item_get_pattern (struct kb_item **, char *) |
| Returns a list of copies of kb_items that match a pattern. More...
|
|
void | kb_item_get_all_free (struct kb_item *) |
| Frees a list of kb_items. More...
|
|
int | kb_item_add_str (struct kb_item **, char *, char *) |
| Adds a string to the knowledge base. In contrast to kb_item_set_str the item will not be replaced (useful for list creation). More...
|
|
int | kb_item_set_str (struct kb_item **, char *, char *) |
|
int | kb_item_add_int (struct kb_item **, char *, int) |
|
int | kb_item_set_int (struct kb_item **, char *, int) |
|
void | kb_item_rm_all (struct kb_item **, char *) |
|
struct arglist * | plug_get_oldstyle_kb (struct arglist *) |
|
Possible type of a kb_item. The kb_items v should then be interpreted as int.
Possible type of a kb_item. The kb_items v should then be interpreted as char*.
int kb_item_add_int |
( |
struct kb_item ** |
, |
|
|
char * |
, |
|
|
int |
|
|
) |
| |
int kb_item_add_str |
( |
struct kb_item ** |
kb, |
|
|
char * |
name, |
|
|
char * |
value |
|
) |
| |
Adds a string to the knowledge base. In contrast to kb_item_set_str the item will not be replaced (useful for list creation).
- Parameters
-
kb | The knowledge base. |
name | Key of the entry. |
value | Value of the entry. |
Returns a list of copies of kb_items with name name in a knowledge base.
The result has to be freed (kb_item_get_all_free). Use kb_item_get_pattern if you want to get all items matching a pattern, rather than a single name.
- Parameters
-
kb | The knowledge base. |
name | Name of the item(s) of interest. |
- Returns
- A kb_item list (has to be freed) with kb_items of name name.
void kb_item_get_all_free |
( |
struct kb_item * |
items | ) |
|
int kb_item_get_int |
( |
struct kb_item ** |
kb, |
|
|
char * |
name |
|
) |
| |
Get the value of a kb_item with type KB_TYPE_INT and name name.
- Returns
- Value of the kb_item name with type KB_TYPE_INT or -1 if it does not exist.
struct kb_item* kb_item_get_pattern |
( |
struct kb_item ** |
kb, |
|
|
char * |
expr |
|
) |
| |
|
read |
Returns a list of copies of kb_items that match a pattern.
The items have to be freed, e.g. with kb_item_get_all_free.
- Parameters
-
kb | The knowledge base. |
expr | A pattern that can be used with fnmatch (e.g. "www/serv*"). |
- Returns
- A list of kb_items (has to be freed) whose name matches the pattern exp.
struct kb_item* kb_item_get_single |
( |
struct kb_item ** |
kb, |
|
|
char * |
name, |
|
|
int |
type |
|
) |
| |
|
read |
READ the knowledge base.
- Returns
- kb_item in knowledge base with name name and type type or NULL if none found.
char* kb_item_get_str |
( |
struct kb_item ** |
kb, |
|
|
char * |
name |
|
) |
| |
Get the value of a kb_item with type KB_TYPE_STR and name name.
- Returns
- (char*) value of the kb_item name with type KB_TYPE_STR.
void kb_item_rm_all |
( |
struct kb_item ** |
, |
|
|
char * |
|
|
) |
| |
int kb_item_set_int |
( |
struct kb_item ** |
, |
|
|
char * |
, |
|
|
int |
|
|
) |
| |
int kb_item_set_str |
( |
struct kb_item ** |
, |
|
|
char * |
, |
|
|
char * |
|
|
) |
| |
Allocates memory for an array of kb_items with max length of HASH_MAX.
- Returns
- Pointer to first item in knowledge base item array.