cctools
|
An nvpair object is a collection of name-value pairs that might describe a complex object such as a host or a job. More...
#include <stdio.h>
#include "int_sizes.h"
Go to the source code of this file.
Data Structures | |
struct | nvpair_header |
Functions | |
struct nvpair * | nvpair_create () |
Create an empty nvpair. More... | |
void | nvpair_delete (struct nvpair *n) |
Delete an nvpair. More... | |
void | nvpair_parse (struct nvpair *n, const char *text) |
Load in an nvpair from ASCII text. More... | |
int | nvpair_parse_stream (struct nvpair *n, FILE *stream) |
Load in an nvpair from a standard I/O stream. More... | |
int | nvpair_print (struct nvpair *n, char *text, int length) |
Print an nvpair to ASCII text with a limit. More... | |
int | nvpair_print_alloc (struct nvpair *n, char **text) |
Print an nvpair to ASCII text, allocating the needed buffer. More... | |
void | nvpair_insert_string (struct nvpair *n, const char *name, const char *value) |
Insert a property in string form. More... | |
void | nvpair_insert_integer (struct nvpair *n, const char *name, INT64_T value) |
Insert a property in integer form. More... | |
const char * | nvpair_lookup_string (struct nvpair *n, const char *name) |
Lookup a property in string form. More... | |
INT64_T | nvpair_lookup_integer (struct nvpair *n, const char *name) |
Lookup a property in integer form. More... | |
void | nvpair_print_text (struct nvpair *n, FILE *stream) |
Print an entire nvpair in text form. More... | |
void | nvpair_print_xml (struct nvpair *n, FILE *stream) |
Print an entire nvpair in XML form. More... | |
void | nvpair_print_new_classads (struct nvpair *n, FILE *stream) |
Print an entire nvpair in new ClassAd form. More... | |
void | nvpair_print_old_classads (struct nvpair *n, FILE *stream) |
Print an entire nvpair in old ClassAd form. More... | |
void | nvpair_print_html_solo (struct nvpair *n, FILE *stream) |
Print an entire nvpair in HTML form. More... | |
An nvpair object is a collection of name-value pairs that might describe a complex object such as a host or a job.
An nvpair object is a subset of the full generality of an XML document or a ClassAd. In fact, and nvpair can easily be exported into these and other formats. We use an nvapir object instead of these other database, because it has a dramatically simpler implementation that these other complex datatypes and removes any dependence on external software.
struct nvpair* nvpair_create | ( | ) |
Create an empty nvpair.
void nvpair_delete | ( | struct nvpair * | n | ) |
Delete an nvpair.
Also deletes all contained names and values.
n | The nvpair to delete. |
void nvpair_parse | ( | struct nvpair * | n, |
const char * | text | ||
) |
Load in an nvpair from ASCII text.
n | An nvpair from nvpair_create. |
text | The ASCII text to parse. |
int nvpair_parse_stream | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Load in an nvpair from a standard I/O stream.
n | An nvpair from nvpair_create. |
stream | The I/O stream to read. |
int nvpair_print | ( | struct nvpair * | n, |
char * | text, | ||
int | length | ||
) |
Print an nvpair to ASCII text with a limit.
n | The npvair to print. |
text | The buffer to print to. |
length | The length of the buffer in bytes. |
int nvpair_print_alloc | ( | struct nvpair * | n, |
char ** | text | ||
) |
Print an nvpair to ASCII text, allocating the needed buffer.
n | The npvair to print. |
text | A pointer to a buffer pointer that will be allocated to the needed size. |
void nvpair_insert_string | ( | struct nvpair * | n, |
const char * | name, | ||
const char * | value | ||
) |
Insert a property in string form.
n | The nvpair to modify. |
name | The name of the property to insert. |
value | The value of the property to insert. |
void nvpair_insert_integer | ( | struct nvpair * | n, |
const char * | name, | ||
INT64_T | value | ||
) |
Insert a property in integer form.
n | The nvpair to modify. |
name | The name of the property to insert. |
value | The value of the property to insert. |
const char* nvpair_lookup_string | ( | struct nvpair * | n, |
const char * | name | ||
) |
Lookup a property in string form.
n | The nvpair to examine. |
name | The name of the property to return. |
INT64_T nvpair_lookup_integer | ( | struct nvpair * | n, |
const char * | name | ||
) |
Lookup a property in integer form.
n | The nvpair to examine. |
name | The name of the property to return. |
void nvpair_print_text | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Print an entire nvpair in text form.
n | The nvpair to print. |
stream | The stream on which to print. |
void nvpair_print_xml | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Print an entire nvpair in XML form.
n | The nvpair to print. |
stream | The stream on which to print. |
void nvpair_print_new_classads | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Print an entire nvpair in new ClassAd form.
n | The nvpair to print. |
stream | The stream on which to print. |
void nvpair_print_old_classads | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Print an entire nvpair in old ClassAd form.
n | The nvpair to print. |
stream | The stream on which to print. |
void nvpair_print_html_solo | ( | struct nvpair * | n, |
FILE * | stream | ||
) |
Print an entire nvpair in HTML form.
n | The nvpair to print. |
stream | The stream on which to print. |