File: winsocket.h

package info (click to toggle)
gnugo 3.8-13
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,656 kB
  • sloc: ansic: 56,447; perl: 3,771; lisp: 2,804; sh: 722; python: 682; makefile: 653; awk: 113; sed: 22
file content (105 lines) | stat: -rw-r--r-- 3,320 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
 * This is GNU Go, a Go program. Contact gnugo@gnu.org, or see       *
 * http://www.gnu.org/software/gnugo/ for more information.          *
 *                                                                   *
 * Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,   *
 * 2008 and 2009 by the Free Software Foundation.                    *
 *                                                                   *
 * This program is free software; you can redistribute it and/or     *
 * modify it under the terms of the GNU General Public License as    *
 * published by the Free Software Foundation - version 3 or          *
 * (at your option) any later version.                               *
 *                                                                   *
 * This program is distributed in the hope that it will be useful,   *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of    *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     *
 * GNU General Public License in file COPYING for more details.      *
 *                                                                   *
 * You should have received a copy of the GNU General Public         *
 * License along with this program; if not, write to the Free        *
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,       *
 * Boston, MA 02111, USA.                                            *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


#ifndef GNU_GO_WINSOCKET_H
#define GNU_GO_WINSOCKET_H


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif


#define USE_WINDOWS_SOCKET_CLUDGE		\
  ((defined(_WIN32) || defined(_WIN32_WCE))	\
   && defined(ENABLE_SOCKET_SUPPORT))


#if USE_WINDOWS_SOCKET_CLUDGE


#include <stdarg.h>
#include <stdio.h>


#ifndef WINSOCKET_H_INTERNAL_INCLUSION

/* (sic.) Teh cludge. */

/* At least in some versions of `stdio.h' on Windows, feof() is a
 * macro, not a function.
 */
#ifdef feof
#undef feof
#endif

#define setbuf		winsocket_setbuf
#define fflush		winsocket_fflush
#define feof		winsocket_feof
#define fclose		winsocket_fclose

#define fread		winsocket_fread
#define fgets		winsocket_fgets

#define fwrite		winsocket_fwrite
#define fputc		winsocket_fputc
#define fputs		winsocket_fputs
#define fprintf		winsocket_fprintf
#define vfprintf	winsocket_vfprintf

#endif	/* WINSOCKET_H_INTERNAL_INCLUSION */


void		winsocket_activate(int _socket_handle);

void		winsocket_setbuf(FILE *file, char *buffer);
int		winsocket_fflush(FILE *file);
int		winsocket_feof(FILE *file);
int		winsocket_fclose(FILE *file);

size_t		winsocket_fread(void *buffer,
				size_t size, size_t num_items, FILE *file);
char *		winsocket_fgets(char *buffer, int size, FILE *file);

size_t		winsocket_fwrite(const void *buffer,
				 size_t size, size_t num_items, FILE *file);
int		winsocket_fputc(int character, FILE *file);
int		winsocket_fputs(const char *string, FILE *file);
int		winsocket_fprintf(FILE *file, const char *format_string, ...);
int		winsocket_vfprintf(FILE *file, const char *format_string,
				   va_list arguments);


#endif	/* USE_WINDOWS_SOCKET_CLUDGE */


#endif	/* GNU_GO_WINSOCKET_H */


/*
 * Local Variables:
 * tab-width: 8
 * c-basic-offset: 2
 * End:
 */