Cygwin: utils: cygpath: add -r option to emit paths with root-local prefix
[newlib-cygwin.git] / winsup / cygwin / libc / minires.h
blobb1d98c6d45d84ef3ccb35b55fca2e35f47af459f
1 /* minires.h. Stub synchronous resolver for Cygwin.
3 Written by Pierre A. Humblet <Pierre.Humblet@ieee.org>
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
9 details. */
11 #include "winsup.h"
12 #include <string.h>
13 #include <malloc.h>
14 #include <stdlib.h>
15 #include <ctype.h>
16 #include <sys/time.h>
17 #include <sys/socket.h>
18 #include <netinet/in.h>
19 #include <arpa/inet.h>
20 #include <errno.h>
21 #include <fcntl.h>
22 #include <stdio.h>
23 #include <stdarg.h>
24 #include <sys/unistd.h>
25 #define __INSIDE_CYGWIN_NET__
26 #include <netdb.h>
27 #include <arpa/nameser.h>
28 #include <resolv.h>
30 extern in_addr_t cygwin_inet_addr (const char *);
31 extern int cygwin_socket (int, int, int);
32 extern int cygwin_bind (int, const struct sockaddr *, socklen_t);
33 extern int cygwin_connect (int, const struct sockaddr *, socklen_t);
34 extern int cygwin_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
35 extern int cygwin_sendto (int, const void *, size_t, int,
36 const struct sockaddr *, socklen_t);
37 extern int cygwin_recvfrom (int, void *, size_t, int, struct sockaddr *,
38 socklen_t *);
40 /* Number of elements is an array */
41 #define DIM(x) (sizeof(x) / sizeof(*(x)))
43 /* Definitions to parse the messages */
44 #define RD (1<<8) /* Offset in a short */
45 #define RA (1<<7)
46 #define QR (1<<7) /* Offsets in a char */
47 #define TC (1<<1)
48 #define ERR_MASK 0xF
50 /* Type for os specific res_lookup */
51 typedef int (os_query_t) (res_state, const char *, int, int, u_char *, int);
53 /* Special use of state elements */
54 #define sockfd _vcsock
55 #define mypid _flags
56 #define os_query qhook
57 #define use_os pfcode
59 #define DPRINTF(cond, format...) if (cond) minires_dprintf(format)
61 /* Utility functions */
62 void minires_dprintf(const char * format, ...);
63 void minires_get_search(char * string, res_state statp);
64 void get_dns_info(res_state statp);