ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostStatus/HostStatus.hpp
(Generate patch)

Comparing HostStatus/HostStatus.hpp (file contents):
Revision 28 by Douglas Thrift, 2003-11-14T11:45:06-08:00 vs.
Revision 33 by Douglas Thrift, 2003-11-15T00:38:48-08:00

# Line 7 | Line 7
7   #ifndef _HostStatus_hpp_
8   #define _HostStatus_hpp_
9  
10 + #define _BSD_SOURCE
11 +
12   #include <iostream>
13   #include <string>
14   #include <sstream>
# Line 26 | Line 28 | inline string sgetenv(const string& name
28          return value != NULL ? value : "";
29   }
30  
31 < inline int sputenv(const string& name) { return putenv(name.c_str()); }
31 > inline int sputenv(const string& name)
32 > {
33 >        char* value = new char[name.size() + 1];
34 >
35 >        sprintf(value, name.c_str());
36 >        
37 >        int code = putenv(value);
38 >
39 >        return code;
40 > }
41 >
42   inline void sunsetenv(const string& name) { unsetenv(name.c_str()); }
43  
44   class HostStatus
45   {
46   private:
47          multimap<string, string> cgi;
48 <        void parse();
49 <        void mode();
50 <        void display();
48 >        enum Format {page, table};
49 >        Format format;
50 >        void parse(const string& method);
51 >        void display(const string& method);
52   public:
53          HostStatus();
54          ~HostStatus() {}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines