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_TIME,
94  NVPAIR_MODE_TIMESTAMP
95 } nvpair_mode_t;
96 
97 typedef enum {
98  NVPAIR_ALIGN_LEFT,
99  NVPAIR_ALIGN_RIGHT
100 } nvpair_align_t;
101 
103  const char *name;
104  nvpair_mode_t mode;
105  nvpair_align_t align;
106  int width;
107 };
108 
113 void nvpair_print_text(struct nvpair *n, FILE * stream);
114 
119 void nvpair_print_xml(struct nvpair *n, FILE * stream);
120 
125 void nvpair_print_new_classads(struct nvpair *n, FILE * stream);
126 
131 void nvpair_print_old_classads(struct nvpair *n, FILE * stream);
132 
137 void nvpair_print_html_solo(struct nvpair *n, FILE * stream);
138 
139 void nvpair_print_html_header(FILE * stream, struct nvpair_header *h);
140 void nvpair_print_html(struct nvpair *n, FILE * stream, struct nvpair_header *h);
141 void nvpair_print_html_with_link(struct nvpair *n, FILE * stream, struct nvpair_header *h, const char *linkname, const char *linktext);
142 
143 void nvpair_print_html_footer(FILE * stream, struct nvpair_header *h);
144 
145 void nvpair_print_table_header(FILE * stream, struct nvpair_header *h);
146 void nvpair_print_table(struct nvpair *n, FILE * stream, struct nvpair_header *h);
147 void nvpair_print_table_footer(FILE * stream, struct nvpair_header *h);
148 
149 #endif