rasdaman complete source
akgnet_common.hh
Go to the documentation of this file.
1 /*
2 * This file is part of rasdaman community.
3 *
4 * Rasdaman community is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * Rasdaman community is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18 rasdaman GmbH.
19 *
20 * For more information please see <http://www.rasdaman.org>
21 * or contact Peter Baumann via <baumann@rasdaman.com>.
22 /
35 #ifndef AKGNET_COMMON_HH
36 #define AKGNET_COMMON_HH
37 
38 #if defined(DECALPHA) || defined(LINUX)
39 #ifndef _XOPEN_SOURCE_EXTENDED
40 #define _XOPEN_SOURCE_EXTENDED // for gethostid
41 #endif //_XOPEN_SOURCE_EXTENDED
42 #endif //DECALPHA || LINUX
43 
44 
45 #include<stdio.h>
46 #include<stdlib.h>
47 #include<errno.h>
48 
49 #if defined(DECALPHA)
50 #include<strings.h>
51 #include <arpa/inet.h>
52 #endif
53 #include<string.h>
54 
55 
56 
57 #include<unistd.h>
58 #include<sys/types.h>
59 #include<sys/socket.h>
60 #include<netinet/in.h>
61 #include<netdb.h>
62 #include <fcntl.h>
63 #include <sys/time.h>
64 #include <time.h>
65 
66 
67 #include <iostream>
68 
69 //##### System dependent data types #############
70 
71 #ifdef X86
72 #define akgSocklen_t socklen_t
73 #endif
74 
75 #ifdef AIX
76 #define akgSocklen_t socklen_t
77 #endif
78 
79 #ifdef SOLARIS
80 #define akgSocklen_t socklen_t
81 #define INADDR_NONE ((uint32_t) 0xffffffff)
82 #endif
83 
84 #ifdef DECALPHA
85 #define akgSocklen_t size_t
86 typedef in_addr_t uint32_t;
87 #endif
88 
89 #ifndef akgSocklen_t
90 #error "What Operating System is this?"
91 #endif
92 //##### Debugging stuff ########################
93 
94 #define DBTALK(a)
95 //#define DBTALK(a) cout<<a<<endl
96 
97 using namespace std;
98 //##############################################
99 
100 #endif