/home/pvrabec/tmp/openscap/openscap-0.1.4/src/CPE/cpedict.c File Reference
Interface to Common Product Enumeration (CPE) Dictionary.
More...
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <libxml/tree.h>
#include "cpedict.h"
Detailed Description
Interface to Common Product Enumeration (CPE) Dictionary.
See more details at http://nvd.nist.gov/cpe.cfm
Define Documentation
#define APPEND_ITEM |
( |
type, |
|
|
item, |
|
|
list, |
|
|
num, |
|
|
alloc, |
|
|
init_alloc |
|
) |
|
Value:
do { \
if ((alloc) < (num) + 1) { \
type* old; \
if ((alloc) <= 0) (alloc) = (init_alloc); \
else (alloc) *= 2; \
old = (list); \
(list) = realloc(old, (alloc) * sizeof(type)); \
if ((list) == NULL) (list) = old; \
} \
(list)[(num)++] = (item); \
} while (0)
Append item to a dynamically allocated list
- Parameters:
-
| type | type of item being appended to a list |
| item | variable holding item itself |
| list | variable representing list itself |
| num | variable representing number of items in list |
| alloc | variable holding info on number of items allocated |
| init_alloc | desired initial allocation in case of list does not exist yet |
Function Documentation
Add item to dictionary dict
- Note:
- item will be deleted as soon as you call cpe_dict_delete on dictionary.
- Parameters:
-
| dict | dictionary to add new item to |
| item | pointer to item to add |
- Returns:
- true on success
Frees CPE dictionary and its contents
- Parameters:
-
| dict | dictionary to be deleted |
Load new CPE dictionary from file
- Parameters:
-
| fname | file name of dictionary to load |
- Returns:
- new dictionary
- Return values:
-
Create new empty CPE dictionary
- Returns:
- new dictionary
- Return values:
-
Load new CPE dictionary from XML node
- Parameters:
-
| node | file name of dictionary to load |
- Returns:
- new dictionary
- Return values:
-
Free dictionary item
- Parameters:
-
Create new empty dictionary item
- Returns:
- new dictionary item
- Return values:
-
New dictionary item from XML
- Parameters:
-
- Returns:
- new dictionary item
- Return values:
-