forked from netdata-be/libnodave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenSocket.h
67 lines (48 loc) · 1.74 KB
/
openSocket.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Part of Libnodave, a free communication libray for Siemens S7 300/400.
(C) Thomas Hergenhahn ([email protected]) 2002, 2003.2004
Libnodave is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Libnodave is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Libnodave; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef opensocket__
#define opensocket__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef BCCWIN
#ifdef DOEXPORT
#define EXPORTSPEC __declspec (dllexport)
#else
#define EXPORTSPEC __declspec (dllimport)
#endif
EXPORTSPEC HANDLE __stdcall openSocket(const int port, const char * peer);
EXPORTSPEC int __stdcall closeSocket(HANDLE h);
#endif
#ifdef LINUX
#define EXPORTSPEC
int openSocket(const int port, const char * peer);
int closeSocket(int h);
#endif
#ifdef __cplusplus
}
#endif
#endif //opensocket__
/*
Changes:
07/12/03 moved openSocket to it's own file, because it can be reused in other TCP clients
04/07/04 ported C++ version to C
12/17/04 additonal defines for WIN32
04/09/05 removed CYGWIN defines. As there were no more differences against LINUX, it should
work with LINUX defines.
Version 0.8.4.5
07/10/09 Added closeSocket()
*/