/home/pvrabec/tmp/openscap/openscap-0.3.3/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"

Defines

#define APPEND_ITEM(type, item, list, num, alloc, init_alloc)
 Append item to a dynamically allocated list.

Functions

cpe_dict_tcpe_dict_new_xml (xmlNodePtr node)
 Load new CPE dictionary from XML node.
cpe_dict_item_tcpe_dictitem_new_xml (xmlNodePtr node)
 New dictionary item from XML.
cpe_dict_check_tcpe_dictcheck_new_xml (xmlNode *node)
char * str_trim (char *str)
cpe_dict_tcpe_dict_new (const char *fname)
 Load new CPE dictionary from file.
cpe_dict_tcpe_dict_new_empty ()
 Create new empty CPE dictionary.
bool cpe_dict_add_item (cpe_dict_t *dict, cpe_dict_item_t *item)
 Add item to dictionary dict.
void cpe_dict_delete (cpe_dict_t *dict)
 Frees CPE dictionary and its contents.
cpe_dict_item_tcpe_dictitem_new_empty ()
 Create new empty dictionary item.
void cpe_dictitem_delete (cpe_dict_item_t *item)
 Free dictionary item.
void cpe_dictcheck_delete (cpe_dict_check_t *check)

Variables

const size_t CPE_DICT_CPES_INITIAL_ALLOC = 8


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

cpe_dict_t * cpe_dict_new_xml ( xmlNodePtr  node  ) 

Load new CPE dictionary from XML node.

Parameters:
node file name of dictionary to load
Returns:
new dictionary
Return values:
NULL on failure

cpe_dict_item_t * cpe_dictitem_new_xml ( xmlNodePtr  node  ) 

New dictionary item from XML.

Parameters:
node cpe-item node
Returns:
new dictionary item
Return values:
NULL on failure


Generated on Thu Apr 30 13:45:38 2009 for Open SCAP Library by  doxygen 1.5.7.1