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