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) 2022 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
nvpair_remove
void nvpair_remove(struct nvpair *n, const char *name)
Remove a property from an nvpair.
nvpair_lookup_float
double nvpair_lookup_float(struct nvpair *n, const char *name)
Lookup a property in floating point form.
nvpair_first_item
void nvpair_first_item(struct nvpair *nv)
Begin iteration over all items.
nvpair_delete
void nvpair_delete(struct nvpair *n)
Delete an nvpair.
nvpair_parse_stream
int nvpair_parse_stream(struct nvpair *n, FILE *stream)
Load in an nvpair from a standard I/O stream.
nvpair_next_item
int nvpair_next_item(struct nvpair *nv, char **name, char **value)
Continue iteration over all items.
nvpair_lookup_integer
INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name)
Lookup a property in integer form.
nvpair_lookup_string
const char * nvpair_lookup_string(struct nvpair *n, const char *name)
Lookup a property in string form.
nvpair_print_alloc
int nvpair_print_alloc(struct nvpair *n, char **text)
Print an nvpair to ASCII text, allocating the needed buffer.
nvpair_parse
void nvpair_parse(struct nvpair *n, const char *text)
Load in an nvpair from ASCII text.
nvpair_create
struct nvpair * nvpair_create()
Create an empty nvpair.
nvpair_insert_string
void nvpair_insert_string(struct nvpair *n, const char *name, const char *value)
Insert a property in string form.
nvpair_print
int nvpair_print(struct nvpair *n, char *text, int length)
Print an nvpair to ASCII text with a limit.
nvpair_insert_integer
void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value)
Insert a property in integer form.
nvpair_insert_float
void nvpair_insert_float(struct nvpair *n, const char *name, double value)
Insert a property in floating point form.
nvpair_export
void nvpair_export(struct nvpair *nv)
Export all items in the nvpair to the environment with setenv.
nvpair
Definition: nvpair_private.h:15
hash_table.h