Abstract Data
[Utilities]


Function Documentation

struct nl_data* nl_data_alloc ( void *  buf,
size_t  size 
) [read]

Parameters:
buf Data buffer containing the actual data.
size Size of data buffer.
Allocates a new abstract data and copies the specified data buffer into the new handle.

Returns:
Newly allocated data handle or NULL

Definition at line 38 of file data.c.

Referenced by nl_data_clone(), and nla_get_data().

struct nl_data* nl_data_clone ( struct nl_data *  src  )  [read]

Parameters:
src Abstract data object
Returns:
Cloned object or NULL

Definition at line 69 of file data.c.

References nl_data_alloc().

int nl_data_append ( struct nl_data *  data,
void *  buf,
size_t  size 
)

Parameters:
data Abstract data object.
buf Data buffer containing the data to be appended.
size Size of data to be apppended.
Reallocates an abstract data and copies the specified data buffer into the new handle.

Returns:
0 on success or a negative error code

Definition at line 85 of file data.c.

Referenced by rtnl_u32_add_key().

void nl_data_free ( struct nl_data *  data  ) 

Parameters:
data Abstract data object.

Definition at line 110 of file data.c.

void* nl_data_get ( struct nl_data *  data  ) 

Parameters:
data Abstract data object.
Returns:
Data buffer or NULL if empty.

Definition at line 130 of file data.c.

Referenced by nl_data_cmp(), and nla_put_data().

size_t nl_data_get_size ( struct nl_data *  data  ) 

Parameters:
data Abstract data object.
Returns:
Size of data buffer.

Definition at line 140 of file data.c.

Referenced by nl_data_cmp(), and nla_put_data().

int nl_data_cmp ( struct nl_data *  a,
struct nl_data *  b 
)

Parameters:
a Abstract data object.
b Another abstract data object.
Returns:
An integer less than, equal to, or greater than zero if a is found, respectively, to be less than, to match, or be greater than b.

Definition at line 160 of file data.c.

References nl_data_get(), and nl_data_get_size().


Generated on Thu May 28 01:01:27 2009 for libnl by  doxygen 1.5.7.1