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

Comparing HostStatus/HostStatus.hpp (property svn:eol-style):
Revision 27 by Douglas Thrift, 2003-11-14T11:38:42-08:00 vs.
Revision 52 by Douglas Thrift, 2003-12-12T14:28:04-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 52 by Douglas Thrift, 2003-12-12T14:28:04-08:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines