~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5
5
 * All rights reserved.
6
6
 *
7
 
 * Use and distribution licensed under the BSD license.  See
8
 
 * the COPYING.BSD file in the root source directory for full text.
 
7
 * Redistribution and use in source and binary forms, with or without
 
8
 * modification, are permitted provided that the following conditions are
 
9
 * met:
 
10
 *
 
11
 *     * Redistributions of source code must retain the above copyright
 
12
 * notice, this list of conditions and the following disclaimer.
 
13
 *
 
14
 *     * Redistributions in binary form must reproduce the above
 
15
 * copyright notice, this list of conditions and the following disclaimer
 
16
 * in the documentation and/or other materials provided with the
 
17
 * distribution.
 
18
 *
 
19
 *     * The names of its contributors may not be used to endorse or
 
20
 * promote products derived from this software without specific prior
 
21
 * written permission.
 
22
 *
 
23
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
24
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
25
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
26
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
27
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
28
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
29
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
30
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
31
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
32
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
33
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
34
 *
9
35
 */
10
36
 
11
37
/**
16
42
#ifndef __DRIZZLE_H
17
43
#define __DRIZZLE_H
18
44
 
19
 
#if !defined(__cplusplus)
20
 
# include <stdbool.h>
21
 
#endif
22
45
 
23
46
#include <inttypes.h>
24
47
#include <sys/types.h>
25
48
 
26
49
#ifdef _WIN32
 
50
# define WIN32_LEAN_AND_MEAN
 
51
 
 
52
# include <Windows.h>
27
53
# include <winsock2.h>
28
54
# include <ws2tcpip.h>
29
 
 
30
 
# include <errno.h>
31
 
# define EINPROGRESS WSAEINPROGRESS
32
 
# define EALREADY WSAEALREADY
33
 
# define EISCONN WSAEISCONN
34
 
# define ENOBUFS WSAENOBUFS
35
 
# define ECONNREFUSED WSAECONNREFUSED
36
 
# define ENETUNREACH WSAENETUNREACH
37
 
# define ETIMEDOUT WSAETIMEDOUT
38
 
# define ECONNRESET WSAECONNRESET 
39
 
# define EADDRINUSE WSAEADDRINUSE
40
 
# define EOPNOTSUPP WSAEOPNOTSUPP
41
 
# define ENOPROTOOPT WSAENOPROTOOPT
42
 
 
 
55
# include <io.h>
 
56
 
 
57
# undef close
 
58
# define close _close
43
59
typedef unsigned int in_port_t;
 
60
typedef long ssize_t;
 
61
 
 
62
# define snprintf _snprintf
 
63
# define inline __inline
44
64
 
45
65
struct sockaddr_un
46
66
{
48
68
  char sun_path[108];
49
69
};
50
70
 
51
 
 
52
 
#else
 
71
# define poll WSAPoll
 
72
//# define pollfd WSAPOLLFD
 
73
 
 
74
#if defined(__GNUC__)
 
75
# include <stdbool.h>
 
76
#else
 
77
typedef enum { false = 0, true = 1 } _Bool;
 
78
typedef _Bool bool;
 
79
#endif
 
80
 
 
81
#else
 
82
# if !defined(__cplusplus)
 
83
#  include <stdbool.h>
 
84
# endif
53
85
# include <sys/socket.h>
54
86
# include <netinet/in.h>
55
87
# include <arpa/inet.h>
56
88
# include <sys/un.h>
57
89
# include <netdb.h>
 
90
# include <poll.h>
58
91
#endif
59
92
 
60
 
#include <poll.h>
 
93
#include <assert.h>
 
94
#include <errno.h>
61
95
 
62
96
#include <libdrizzle/visibility.h>
63
97
#include <libdrizzle/constants.h>