Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

nvpair.h

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 a BSD-style license.
00005 See the file COPYING for details.
00006 */
00007 #ifndef NVPAIR_H
00008 #define NVPAIR_H
00009 
00010 #include <stdio.h>
00011 #include "int_sizes.h"
00012 
00013 /*
00014 An nvpair object is a collection of name-value pairs that might
00015 describe a complex object such as a host or a job.  An nvpair object
00016 is a subset of the full generality of an XML document or a ClassAd.
00017 In fact, and nvpair can easily be exported into these and other formats.
00018 We use an nvapir object instead of these other database, because it
00019 has a dramatically simpler implementation that these other complex datatypes
00020 and removes any dependence on external software.
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

Generated on Thu Sep 11 10:01:22 2008 for cctools by  doxygen 1.3.9.1