~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to gio/gnetworking.h.win32

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIO - GLib Input, Output and Streaming Library
 
2
 *
 
3
 * Copyright (C) 2008-2011 Red Hat, Inc.
 
4
 *
 
5
 * This library is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public
 
7
 * License as published by the Free Software Foundation; either
 
8
 * version 2 of the License, or (at your option) any later version.
 
9
 *
 
10
 * This library is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
 * Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General
 
16
 * Public License along with this library; if not, write to the
 
17
 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 
18
 * Boston, MA 02111-1307, USA.
 
19
 */
 
20
 
 
21
#ifndef __G_NETWORKING_H__
 
22
#define __G_NETWORKING_H__
 
23
 
 
24
#include <glib.h>
 
25
 
 
26
#ifdef G_OS_WIN32
 
27
 
 
28
#ifndef _WIN32_WINNT
 
29
#define _WIN32_WINNT 0x0501
 
30
#endif
 
31
#include <winsock2.h>
 
32
#undef interface
 
33
#include <ws2tcpip.h>
 
34
#include <windns.h>
 
35
#include <mswsock.h>
 
36
#include <wspiapi.h>
 
37
 
 
38
#else /* !G_OS_WIN32 */
 
39
 
 
40
#include <sys/types.h>
 
41
 
 
42
#include <netdb.h>
 
43
#include <netinet/in.h>
 
44
#include <netinet/tcp.h>
 
45
#include <resolv.h>
 
46
#include <sys/socket.h>
 
47
#include <sys/un.h>
 
48
#include <net/if.h>
 
49
 
 
50
#include <arpa/inet.h>
 
51
#include <arpa/nameser.h>
 
52
 
 
53
#ifndef T_SRV
 
54
#define T_SRV 33
 
55
#endif
 
56
 
 
57
#ifndef _PATH_RESCONF
 
58
#define _PATH_RESCONF "/etc/resolv.conf"
 
59
#endif
 
60
 
 
61
#ifndef CMSG_LEN
 
62
/* CMSG_LEN and CMSG_SPACE are defined by RFC 2292, but missing on
 
63
 * some older platforms.
 
64
 */
 
65
#define CMSG_LEN(len) ((size_t)CMSG_DATA((struct cmsghdr *)NULL) + (len))
 
66
 
 
67
/* CMSG_SPACE must add at least as much padding as CMSG_NXTHDR()
 
68
 * adds. We overestimate here.
 
69
 */
 
70
#define GLIB_ALIGN_TO_SIZEOF(len, obj) (((len) + sizeof (obj) - 1) & ~(sizeof (obj) - 1))
 
71
#define CMSG_SPACE(len) GLIB_ALIGN_TO_SIZEOF (CMSG_LEN (len), struct cmsghdr)
 
72
#endif
 
73
#endif
 
74
 
 
75
G_BEGIN_DECLS
 
76
 
 
77
GLIB_AVAILABLE_IN_2_36
 
78
void g_networking_init (void);
 
79
 
 
80
G_END_DECLS
 
81
 
 
82
#endif /* __G_NETWORKING_H__ */