nvpair.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under the GNU General Public License.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef NVPAIR_H
00009 #define NVPAIR_H
00010 
00011 #include <stdio.h>
00012 
00013 #include "int_sizes.h"
00014 #include "hash_table.h"
00015 
00029 struct nvpair *nvpair_create();
00030 
00034 void nvpair_delete(struct nvpair *n);
00035 
00040 void nvpair_parse(struct nvpair *n, const char *text);
00041 
00046 int nvpair_parse_stream(struct nvpair *n, FILE * stream);
00047 int nvpair_parse_stream_limited(struct nvpair *n, FILE * stream, char ** attr_list, int attr_len);
00048 
00055 int nvpair_print(struct nvpair *n, char *text, int length);
00056 
00062 int nvpair_print_alloc(struct nvpair *n, char **text);
00063 
00068 void nvpair_remove( struct nvpair *n, const char *name );
00069 
00075 void nvpair_insert_string(struct nvpair *n, const char *name, const char *value);
00076  void nvpair_insert_integer(struct nvpair *n, const char *name, INT64_T value);
00082 
00088 void nvpair_insert_float(struct nvpair *n, const char *name, double value);
00089 
00095 const char *nvpair_lookup_string(struct nvpair *n, const char *name);
00096 
00102 INT64_T nvpair_lookup_integer(struct nvpair *n, const char *name);
00103 
00109 double nvpair_lookup_float(struct nvpair *n, const char *name);
00110 
00111 
00112 typedef enum {
00113         NVPAIR_MODE_STRING,
00114         NVPAIR_MODE_INTEGER,
00115         NVPAIR_MODE_URL,
00116         NVPAIR_MODE_METRIC,
00117         NVPAIR_MODE_TIME,
00118         NVPAIR_MODE_TIMESTAMP
00119 } nvpair_mode_t;
00120 
00121 typedef enum {
00122         NVPAIR_ALIGN_LEFT,
00123         NVPAIR_ALIGN_RIGHT
00124 } nvpair_align_t;
00125 
00126 struct nvpair_header {
00127         const char *name;
00128         const char *title;
00129         nvpair_mode_t mode;
00130         nvpair_align_t align;
00131         int width;
00132 };
00133 
00138 void nvpair_print_text(struct nvpair *n, FILE * stream);
00139 
00144 void nvpair_print_xml(struct nvpair *n, FILE * stream);
00145 
00150 void nvpair_print_json(struct nvpair *n, FILE * stream);
00151 
00156 void nvpair_print_new_classads(struct nvpair *n, FILE * stream);
00157 
00162 void nvpair_print_old_classads(struct nvpair *n, FILE * stream);
00163 
00168 void nvpair_print_html_solo(struct nvpair *n, FILE * stream);
00169 
00170 void nvpair_print_html_header(FILE * stream, struct nvpair_header *h);
00171 void nvpair_print_html(struct nvpair *n, FILE * stream, struct nvpair_header *h);
00172 void nvpair_print_html_with_link(struct nvpair *n, FILE * stream, struct nvpair_header *h, const char *linkname, const char *linktext);
00173 
00174 void nvpair_print_html_footer(FILE * stream, struct nvpair_header *h);
00175 
00176 void nvpair_print_table_header(FILE * stream, struct nvpair_header *h);
00177 void nvpair_print_table(struct nvpair *n, FILE * stream, struct nvpair_header *h);
00178 void nvpair_print_table_footer(FILE * stream, struct nvpair_header *h);
00179 
00180 #endif

Generated on 15 Apr 2015 for cctools by  doxygen 1.4.7