Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/japanese/FreeWnn-server/files/patch-Wnn-include-fake-rfc2553.h
16461 views
1
Index: Wnn/include/fake-rfc2553.h
2
===================================================================
3
RCS file: Wnn/include/fake-rfc2553.h
4
diff -N Wnn/include/fake-rfc2553.h
5
--- /dev/null 1 Jan 1970 00:00:00 -0000
6
+++ Wnn/include/fake-rfc2553.h 2 Jan 2009 21:09:34 -0000 1.1
7
@@ -0,0 +1,173 @@
8
+/* $Id: fake-rfc2553.h,v 1.13 2006/07/24 03:51:52 djm Exp $ */
9
+/* $FreeBSD: /tmp/pcvs/ports/japanese/FreeWnn-server/files/patch-Wnn-include-fake-rfc2553.h,v 1.2 2010-01-02 14:47:19 hrs Exp $ */
10
+
11
+/*
12
+ * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
13
+ * Copyright (C) 1999 WIDE Project. All rights reserved.
14
+ *
15
+ * Redistribution and use in source and binary forms, with or without
16
+ * modification, are permitted provided that the following conditions
17
+ * are met:
18
+ * 1. Redistributions of source code must retain the above copyright
19
+ * notice, this list of conditions and the following disclaimer.
20
+ * 2. Redistributions in binary form must reproduce the above copyright
21
+ * notice, this list of conditions and the following disclaimer in the
22
+ * documentation and/or other materials provided with the distribution.
23
+ * 3. Neither the name of the project nor the names of its contributors
24
+ * may be used to endorse or promote products derived from this software
25
+ * without specific prior written permission.
26
+ *
27
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
28
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
31
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37
+ * SUCH DAMAGE.
38
+ */
39
+
40
+/*
41
+ * Pseudo-implementation of RFC2553 name / address resolution functions
42
+ *
43
+ * But these functions are not implemented correctly. The minimum subset
44
+ * is implemented for ssh use only. For example, this routine assumes
45
+ * that ai_family is AF_INET. Don't use it for another purpose.
46
+ */
47
+
48
+#ifndef _FAKE_RFC2553_H
49
+#define _FAKE_RFC2553_H
50
+
51
+#include "config.h"
52
+
53
+#include <sys/types.h>
54
+#if defined(HAVE_NETDB_H)
55
+# include <netdb.h>
56
+#endif
57
+
58
+/*
59
+ * First, socket and INET6 related definitions
60
+ */
61
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
62
+# define _SS_MAXSIZE 128 /* Implementation specific max size */
63
+# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
64
+struct sockaddr_storage {
65
+ struct sockaddr ss_sa;
66
+ char __ss_pad2[_SS_PADSIZE];
67
+};
68
+# define ss_family ss_sa.sa_family
69
+#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
70
+
71
+#ifndef IN6_IS_ADDR_LOOPBACK
72
+# define IN6_IS_ADDR_LOOPBACK(a) \
73
+ (((u_int32_t *)(a))[0] == 0 && ((u_int32_t *)(a))[1] == 0 && \
74
+ ((u_int32_t *)(a))[2] == 0 && ((u_int32_t *)(a))[3] == htonl(1))
75
+#endif /* !IN6_IS_ADDR_LOOPBACK */
76
+
77
+#ifndef HAVE_STRUCT_IN6_ADDR
78
+struct in6_addr {
79
+ u_int8_t s6_addr[16];
80
+};
81
+#endif /* !HAVE_STRUCT_IN6_ADDR */
82
+
83
+#ifndef HAVE_STRUCT_SOCKADDR_IN6
84
+struct sockaddr_in6 {
85
+ unsigned short sin6_family;
86
+ u_int16_t sin6_port;
87
+ u_int32_t sin6_flowinfo;
88
+ struct in6_addr sin6_addr;
89
+};
90
+#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
91
+
92
+#ifndef AF_INET6
93
+/* Define it to something that should never appear */
94
+#define AF_INET6 AF_MAX
95
+#endif
96
+
97
+/*
98
+ * Next, RFC2553 name / address resolution API
99
+ */
100
+
101
+#ifndef NI_NUMERICHOST
102
+# define NI_NUMERICHOST (1)
103
+#endif
104
+#ifndef NI_NAMEREQD
105
+# define NI_NAMEREQD (1<<1)
106
+#endif
107
+#ifndef NI_NUMERICSERV
108
+# define NI_NUMERICSERV (1<<2)
109
+#endif
110
+
111
+#ifndef AI_PASSIVE
112
+# define AI_PASSIVE (1)
113
+#endif
114
+#ifndef AI_CANONNAME
115
+# define AI_CANONNAME (1<<1)
116
+#endif
117
+#ifndef AI_NUMERICHOST
118
+# define AI_NUMERICHOST (1<<2)
119
+#endif
120
+
121
+#ifndef NI_MAXSERV
122
+# define NI_MAXSERV 32
123
+#endif /* !NI_MAXSERV */
124
+#ifndef NI_MAXHOST
125
+# define NI_MAXHOST 1025
126
+#endif /* !NI_MAXHOST */
127
+
128
+#ifndef EAI_NODATA
129
+# define EAI_NODATA (INT_MAX - 1)
130
+#endif
131
+#ifndef EAI_MEMORY
132
+# define EAI_MEMORY (INT_MAX - 2)
133
+#endif
134
+#ifndef EAI_NONAME
135
+# define EAI_NONAME (INT_MAX - 3)
136
+#endif
137
+#ifndef EAI_SYSTEM
138
+# define EAI_SYSTEM (INT_MAX - 4)
139
+#endif
140
+
141
+#ifndef HAVE_STRUCT_ADDRINFO
142
+struct addrinfo {
143
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
144
+ int ai_family; /* PF_xxx */
145
+ int ai_socktype; /* SOCK_xxx */
146
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
147
+ size_t ai_addrlen; /* length of ai_addr */
148
+ char *ai_canonname; /* canonical name for hostname */
149
+ struct sockaddr *ai_addr; /* binary address */
150
+ struct addrinfo *ai_next; /* next structure in linked list */
151
+};
152
+#endif /* !HAVE_STRUCT_ADDRINFO */
153
+
154
+#ifndef HAVE_GETADDRINFO
155
+#ifdef getaddrinfo
156
+# undef getaddrinfo
157
+#endif
158
+#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))
159
+int getaddrinfo(const char *, const char *,
160
+ const struct addrinfo *, struct addrinfo **);
161
+#endif /* !HAVE_GETADDRINFO */
162
+
163
+#if !defined(HAVE_GAI_STRERROR) && !defined(HAVE_CONST_GAI_STRERROR_PROTO)
164
+#define gai_strerror(a) (ssh_gai_strerror(a))
165
+char *gai_strerror(int);
166
+#endif /* !HAVE_GAI_STRERROR */
167
+
168
+#ifndef HAVE_FREEADDRINFO
169
+#define freeaddrinfo(a) (ssh_freeaddrinfo(a))
170
+void freeaddrinfo(struct addrinfo *);
171
+#endif /* !HAVE_FREEADDRINFO */
172
+
173
+#ifndef HAVE_GETNAMEINFO
174
+#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))
175
+int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
176
+ char *, size_t, int);
177
+#endif /* !HAVE_GETNAMEINFO */
178
+
179
+#endif /* !_FAKE_RFC2553_H */
180
+
181
182