00001
00002
00003
00004
00005
00006
00007 #ifndef NVPAIR_H
00008 #define NVPAIR_H
00009
00010 #include <stdio.h>
00011 #include "int_sizes.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 struct nvpair * nvpair_create();
00024 void nvpair_delete( struct nvpair *n );
00025
00026 void nvpair_parse( struct nvpair *n, const char *text );
00027 int nvpair_print( struct nvpair *n, char *text, int length );
00028 int nvpair_print_alloc( struct nvpair *n, char **text );
00029
00030 void nvpair_insert_string( struct nvpair *n, const char *name, const char *value );
00031 void nvpair_insert_integer( struct nvpair *n, const char *name, INT64_T value );
00032 const char * nvpair_lookup_string( struct nvpair *n, const char *name );
00033 INT64_T nvpair_lookup_integer( struct nvpair *n, const char *name );
00034
00035 typedef enum {
00036 NVPAIR_MODE_STRING,
00037 NVPAIR_MODE_INTEGER,
00038 NVPAIR_MODE_URL,
00039 NVPAIR_MODE_METRIC
00040 } nvpair_mode_t;
00041
00042 typedef enum {
00043 NVPAIR_ALIGN_LEFT,
00044 NVPAIR_ALIGN_RIGHT
00045 } nvpair_align_t;
00046
00047 struct nvpair_header {
00048 const char *name;
00049 nvpair_mode_t mode;
00050 nvpair_align_t align;
00051 int width;
00052 };
00053
00054 void nvpair_print_text( struct nvpair *n, FILE *stream );
00055 void nvpair_print_xml( struct nvpair *n, FILE *stream );
00056 void nvpair_print_new_classads( struct nvpair *n, FILE *stream );
00057 void nvpair_print_old_classads( struct nvpair *n, FILE *stream );
00058 void nvpair_print_html_solo( struct nvpair *n, FILE *stream );
00059
00060 void nvpair_print_html_header( FILE *stream, struct nvpair_header *h );
00061 void nvpair_print_html( struct nvpair *n, FILE *stream, struct nvpair_header *h );
00062 void nvpair_print_html_with_link( struct nvpair *n, FILE *stream, struct nvpair_header *h, const char *linkname, const char *linktext );
00063
00064 void nvpair_print_html_footer( FILE *stream, struct nvpair_header *h );
00065
00066 void nvpair_print_table_header( FILE *stream, struct nvpair_header *h );
00067 void nvpair_print_table( struct nvpair *n, FILE *stream, struct nvpair_header *h );
00068 void nvpair_print_table_footer( FILE *stream, struct nvpair_header *h );
00069
00070 #endif