annotate sources/headers/os.hpp @ 4:a7051ac7118b

added primary parser implementation renamed some functions to well-formed format bool => false, pointers => NULL removed useless eTime()
author Vlad Glagolev <enqlave@gmail.com>
date Thu, 24 Jan 2008 19:38:34 +0300
parents 19227b0b7cc1
children 9be05a31b7f9
rev   line source
2
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
1 /**
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
2 * os.hpp (2007-03-04)
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
3 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
4 * -- CABAL -- operating system detection
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
5 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
6 * Copyright (c) 2007-2008 Vlad Glagolev <enqlave@gmail.com>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
7 * All rights reserved.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
8 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
9 * Permission to use, copy, modify, and distribute this software for any
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
10 * purpose with or without fee is hereby granted, provided that the above
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
11 * copyright notice and this permission notice appear in all copies.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
12 *
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
20 */
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
21
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
22 #ifndef _OS_HPP_
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
23 #define _OS_HPP_
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
24
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
25 #include "conf.hpp"
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
26
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
27 typedef const char *pchar;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
28
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
29 #if HAVE_FSTREAM
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
30 #include <fstream>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
31 #endif // HAVE_FSTREAM
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
32
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
33 #if HAVE_IOSTREAM
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
34 #include <iostream>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
35 using namespace std;
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
36 #else
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
37 #include <iostream.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
38 #endif // HAVE_IOSTREAM
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
39
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
40 #include <errno.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
41 #include <signal.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
42
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
43 #if HAVE_UNISTD_H
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
44 #include <unistd.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
45 #endif // HAVE_UNISTD_H
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
46
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
47 #if HAVE_STRING
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
48 #include <string.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
49 #endif // HAVE_STRING
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
50
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
51 #include <sys/socket.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
52
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
53 #include <arpa/inet.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
54 #include <netdb.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
55
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
56 #include <netinet/in.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
57
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
58 #if HAVE_NETINET_TCP_H
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
59 #include <netinet/tcp.h>
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
60 #endif // HAVE_NETINET_TCP_H
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
61
19227b0b7cc1 .h => .hpp for the headers
Vlad Glagolev <enqlave@gmail.com>
parents:
diff changeset
62 #endif // _OS_HPP_