~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/drizzle.h

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

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
 
 * 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
 
 *
 
7
 * Use and distribution licensed under the BSD license.  See
 
8
 * the COPYING.BSD file in the root source directory for full text.
35
9
 */
36
10
 
37
11
/**
42
16
#ifndef __DRIZZLE_H
43
17
#define __DRIZZLE_H
44
18
 
 
19
#if !defined(__cplusplus)
 
20
# include <stdbool.h>
 
21
#endif
45
22
 
46
23
#include <inttypes.h>
47
24
#include <sys/types.h>
48
25
 
49
26
#ifdef _WIN32
50
 
# define WIN32_LEAN_AND_MEAN
51
 
 
52
 
# include <Windows.h>
53
27
# include <winsock2.h>
54
28
# include <ws2tcpip.h>
55
 
# include <io.h>
56
 
 
57
 
# undef close
58
 
# define close _close
 
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
 
59
43
typedef unsigned int in_port_t;
60
 
typedef long ssize_t;
61
 
 
62
 
# define snprintf _snprintf
63
 
# define inline __inline
64
44
 
65
45
struct sockaddr_un
66
46
{
68
48
  char sun_path[108];
69
49
};
70
50
 
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
 
51
 
 
52
#else
85
53
# include <sys/socket.h>
86
54
# include <netinet/in.h>
87
55
# include <arpa/inet.h>
88
56
# include <sys/un.h>
89
57
# include <netdb.h>
90
 
# include <poll.h>
91
58
#endif
92
59
 
93
 
#include <assert.h>
94
 
#include <errno.h>
 
60
#include <poll.h>
95
61
 
96
62
#include <libdrizzle/visibility.h>
97
63
#include <libdrizzle/constants.h>