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 #include "int_sizes.h"
13 
27 struct nvpair *nvpair_create();
28 
32 void nvpair_delete(struct nvpair *n);
33 
38 void nvpair_parse(struct nvpair *n, const char *text);
39 
44 int nvpair_parse_stream(struct nvpair *n, FILE * stream);
45 
52 int nvpair_print(struct nvpair *n, char *text, int length);
53 
59 int nvpair_print_alloc(struct nvpair *n, char **text);
60 
66 void nvpair_insert_string(struct nvpair *n, const char *name, const char *value);
67  void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value);
73 
79 const char *nvpair_lookup_string(struct nvpair *n, const char *name);
80 
86 INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name);
87 
88 typedef enum {
89  NVPAIR_MODE_STRING,
90  NVPAIR_MODE_INTEGER,
91  NVPAIR_MODE_URL,
92  NVPAIR_MODE_METRIC
93 } nvpair_mode_t;
94 
95 typedef enum {
96  NVPAIR_ALIGN_LEFT,
97  NVPAIR_ALIGN_RIGHT
98 } nvpair_align_t;
99 
101  const char *name;
102  nvpair_mode_t mode;
103  nvpair_align_t align;
104  int width;
105 };
106 
111 void nvpair_print_text(struct nvpair *n, FILE * stream);
112 
117 void nvpair_print_xml(struct nvpair *n, FILE * stream);
118 
123 void nvpair_print_new_classads(struct nvpair *n, FILE * stream);
124 
129 void nvpair_print_old_classads(struct nvpair *n, FILE * stream);
130 
135 void nvpair_print_html_solo(struct nvpair *n, FILE * stream);
136 
137 void nvpair_print_html_header(FILE * stream, struct nvpair_header *h);
138 void nvpair_print_html(struct nvpair *n, FILE * stream, struct nvpair_header *h);
139 void nvpair_print_html_with_link(struct nvpair *n, FILE * stream, struct nvpair_header *h, const char *linkname, const char *linktext);
140 
141 void nvpair_print_html_footer(FILE * stream, struct nvpair_header *h);
142 
143 void nvpair_print_table_header(FILE * stream, struct nvpair_header *h);
144 void nvpair_print_table(struct nvpair *n, FILE * stream, struct nvpair_header *h);
145 void nvpair_print_table_footer(FILE * stream, struct nvpair_header *h);
146 
147 #endif
Definition: nvpair.h:100
void nvpair_print_xml(struct nvpair *n, FILE *stream)
Print an entire nvpair in XML form.
struct nvpair * nvpair_create()
Create an empty nvpair.
void nvpair_print_old_classads(struct nvpair *n, FILE *stream)
Print an entire nvpair in old ClassAd form.
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.
void nvpair_print_text(struct nvpair *n, FILE *stream)
Print an entire nvpair in text form.
void nvpair_print_html_solo(struct nvpair *n, FILE *stream)
Print an entire nvpair in HTML form.
INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name)
Lookup a property in integer form.
void nvpair_print_new_classads(struct nvpair *n, FILE *stream)
Print an entire nvpair in new ClassAd form.
int nvpair_parse_stream(struct nvpair *n, FILE *stream)
Load in an nvpair from a standard I/O stream.
int nvpair_print(struct nvpair *n, char *text, int length)
Print an nvpair to ASCII text with a limit.
void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value)
Insert a property in integer form.
void nvpair_delete(struct nvpair *n)
Delete an nvpair.