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 27 by Douglas Thrift, 2003-11-14T11:38:42-08:00 vs.
Revision 39 by Douglas Thrift, 2003-11-15T20:46:26-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>
15 + #include <list>
16   #include <map>
17   #include <cstdlib>
18   #include <ctime>
# Line 26 | Line 29 | inline string sgetenv(const string& name
29          return value != NULL ? value : "";
30   }
31  
32 < inline int sputenv(const string& name) { return putenv(name.c_str()); }
32 > inline int sputenv(const string& name)
33 > {
34 >        char* value = new char[name.size() + 1];
35 >
36 >        sprintf(value, name.c_str());
37 >
38 >        int code = putenv(value);
39 >
40 >        return code;
41 > }
42 >
43   inline void sunsetenv(const string& name) { unsetenv(name.c_str()); }
44  
45 + #ifdef __CYGWIN__
46 +
47 + inline time_t timegm(struct tm* time)
48 + {
49 +        string zone = sgetenv("TZ");
50 +
51 +        sputenv("TZ=");
52 +        tzset();
53 +
54 +        time_t when = mktime(time);
55 +
56 +        sputenv("TZ=" + zone);
57 +        tzset();
58 +
59 +        return when;
60 + }
61 +
62 + #endif
63 +
64   class HostStatus
65   {
66   private:
67          multimap<string, string> cgi;
68 <        void parse();
68 >        bool page;
69 >        bool host;
70 >        bool name;
71 >        bool address;
72 >        bool platform;
73 >        bool since;
74 >        void parse(const string& method);
75          void mode();
76 <        void display();
76 >        void display(const string& method);
77 >        void header();
78 >        void footer();
79   public:
80          HostStatus();
81          ~HostStatus() {}

Comparing HostStatus/HostStatus.hpp (property svn:eol-style):
Revision 27 by Douglas Thrift, 2003-11-14T11:38:42-08:00 vs.
Revision 39 by Douglas Thrift, 2003-11-15T20:46:26-08:00

# Line 0 | Line 1
1 + native

Comparing HostStatus/HostStatus.hpp (property svn:keywords):
Revision 27 by Douglas Thrift, 2003-11-14T11:38:42-08:00 vs.
Revision 39 by Douglas Thrift, 2003-11-15T20:46:26-08:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines