nvpair.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef NVPAIR_H
00009 #define NVPAIR_H
00010
00011 #include <stdio.h>
00012 #include "int_sizes.h"
00013
00027 struct nvpair *nvpair_create();
00028
00032 void nvpair_delete(struct nvpair *n);
00033
00038 void nvpair_parse(struct nvpair *n, const char *text);
00039
00044 int nvpair_parse_stream(struct nvpair *n, FILE * stream);
00045
00052 int nvpair_print(struct nvpair *n, char *text, int length);
00053
00059 int nvpair_print_alloc(struct nvpair *n, char **text);
00060
00066 void nvpair_insert_string(struct nvpair *n, const char *name, const char *value);
00067 void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value);
00073
00079 const char *nvpair_lookup_string(struct nvpair *n, const char *name);
00080
00086 INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name);
00087
00088 typedef enum {
00089 NVPAIR_MODE_STRING,
00090 NVPAIR_MODE_INTEGER,
00091 NVPAIR_MODE_URL,
00092 NVPAIR_MODE_METRIC,
00093 NVPAIR_MODE_TIME,
00094 NVPAIR_MODE_TIMESTAMP
00095 } nvpair_mode_t;
00096
00097 typedef enum {
00098 NVPAIR_ALIGN_LEFT,
00099 NVPAIR_ALIGN_RIGHT
00100 } nvpair_align_t;
00101
00102 struct nvpair_header {
00103 const char *name;
00104 const char *title;
00105 nvpair_mode_t mode;
00106 nvpair_align_t align;
00107 int width;
00108 };
00109
00114 void nvpair_print_text(struct nvpair *n, FILE * stream);
00115
00120 void nvpair_print_xml(struct nvpair *n, FILE * stream);
00121
00126 void nvpair_print_json(struct nvpair *n, FILE * stream);
00127
00132 void nvpair_print_new_classads(struct nvpair *n, FILE * stream);
00133
00138 void nvpair_print_old_classads(struct nvpair *n, FILE * stream);
00139
00144 void nvpair_print_html_solo(struct nvpair *n, FILE * stream);
00145
00146 void nvpair_print_html_header(FILE * stream, struct nvpair_header *h);
00147 void nvpair_print_html(struct nvpair *n, FILE * stream, struct nvpair_header *h);
00148 void nvpair_print_html_with_link(struct nvpair *n, FILE * stream, struct nvpair_header *h, const char *linkname, const char *linktext);
00149
00150 void nvpair_print_html_footer(FILE * stream, struct nvpair_header *h);
00151
00152 void nvpair_print_table_header(FILE * stream, struct nvpair_header *h);
00153 void nvpair_print_table(struct nvpair *n, FILE * stream, struct nvpair_header *h);
00154 void nvpair_print_table_footer(FILE * stream, struct nvpair_header *h);
00155
00156 #endif