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_t;
00094
00095 typedef enum {
00096 NVPAIR_ALIGN_LEFT,
00097 NVPAIR_ALIGN_RIGHT
00098 } nvpair_align_t;
00099
00100 struct nvpair_header {
00101 const char *name;
00102 nvpair_mode_t mode;
00103 nvpair_align_t align;
00104 int width;
00105 };
00106
00111 void nvpair_print_text( struct nvpair *n, FILE *stream );
00112
00117 void nvpair_print_xml( struct nvpair *n, FILE *stream );
00118
00123 void nvpair_print_new_classads( struct nvpair *n, FILE *stream );
00124
00129 void nvpair_print_old_classads( struct nvpair *n, FILE *stream );
00130
00135 void nvpair_print_html_solo( struct nvpair *n, FILE *stream );
00136
00137 void nvpair_print_html_header( FILE *stream, struct nvpair_header *h );
00138 void nvpair_print_html( struct nvpair *n, FILE *stream, struct nvpair_header *h );
00139 void nvpair_print_html_with_link( struct nvpair *n, FILE *stream, struct nvpair_header *h, const char *linkname, const char *linktext );
00140
00141 void nvpair_print_html_footer( FILE *stream, struct nvpair_header *h );
00142
00143 void nvpair_print_table_header( FILE *stream, struct nvpair_header *h );
00144 void nvpair_print_table( struct nvpair *n, FILE *stream, struct nvpair_header *h );
00145 void nvpair_print_table_footer( FILE *stream, struct nvpair_header *h );
00146
00147 #endif