cctools
nvpair.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
8 #ifndef NVPAIR_H
9 #define NVPAIR_H
10 
11 #include <stdio.h>
12 
13 #include "int_sizes.h"
14 #include "hash_table.h"
15 
36 struct nvpair *nvpair_create();
37 
41 void nvpair_delete(struct nvpair *n);
42 
47 void nvpair_parse(struct nvpair *n, const char *text);
48 
53 int nvpair_parse_stream(struct nvpair *n, FILE * stream);
54 
61 int nvpair_print(struct nvpair *n, char *text, int length);
62 
68 int nvpair_print_alloc(struct nvpair *n, char **text);
69 
74 void nvpair_remove( struct nvpair *n, const char *name );
75 
81 void nvpair_insert_string(struct nvpair *n, const char *name, const char *value);
82  void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value);
88 
94 void nvpair_insert_float(struct nvpair *n, const char *name, double value);
95 
101 const char *nvpair_lookup_string(struct nvpair *n, const char *name);
102 
108 INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name);
109 
115 double nvpair_lookup_float(struct nvpair *n, const char *name);
116 
121 void nvpair_export( struct nvpair *nv );
122 
123 
131 void nvpair_first_item(struct nvpair *nv);
132 
141 int nvpair_next_item(struct nvpair *nv, char **name, char **value);
142 
145 #endif
struct nvpair * nvpair_create()
Create an empty nvpair.
void nvpair_export(struct nvpair *nv)
Export all items in the nvpair to the environment with setenv.
int nvpair_print_alloc(struct nvpair *n, char **text)
Print an nvpair to ASCII text, allocating the needed buffer.
const char * nvpair_lookup_string(struct nvpair *n, const char *name)
Lookup a property in string form.
void nvpair_insert_string(struct nvpair *n, const char *name, const char *value)
Insert a property in string form.
void nvpair_parse(struct nvpair *n, const char *text)
Load in an nvpair from ASCII text.
double nvpair_lookup_float(struct nvpair *n, const char *name)
Lookup a property in floating point form.
void nvpair_first_item(struct nvpair *nv)
Begin iteration over all items.
INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name)
Lookup a property in integer form.
void nvpair_remove(struct nvpair *n, const char *name)
Remove a property from an nvpair.
int nvpair_parse_stream(struct nvpair *n, FILE *stream)
Load in an nvpair from a standard I/O stream.
Definition: nvpair_private.h:15
int nvpair_print(struct nvpair *n, char *text, int length)
Print an nvpair to ASCII text with a limit.
int nvpair_next_item(struct nvpair *nv, char **name, char **value)
Continue iteration over all items.
A general purpose hash table.
void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value)
Insert a property in integer form.
void nvpair_insert_float(struct nvpair *n, const char *name, double value)
Insert a property in floating point form.
void nvpair_delete(struct nvpair *n)
Delete an nvpair.