annotate stream/tcp.h @ 35690:f6470f5787b9

Make variables local. A global scope isn't necessary.
author ib
date Fri, 18 Jan 2013 20:29:02 +0000
parents b542cd25f03d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
1 /*
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
2 * network helpers for TCP connections
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
3 * (originally borrowed from network.c,
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
4 * by Bertrand BAUDET <bertrand_baudet@yahoo.com>)
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
5 *
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
6 * Copyright (C) 2001 Bertrand BAUDET, 2006 Benjamin Zores
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
7 *
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
8 * This file is part of MPlayer.
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
9 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
10 * MPlayer is free software; you can redistribute it and/or modify
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
11 * it under the terms of the GNU General Public License as published by
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
13 * (at your option) any later version.
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
14 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
15 * MPlayer is distributed in the hope that it will be useful,
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
18 * GNU General Public License for more details.
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
19 *
26737
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
20 * You should have received a copy of the GNU General Public License along
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
21 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
a26e50cae389 Use standard license headers with standard formatting.
diego
parents: 26029
diff changeset
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
23 */
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
24
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
25 #ifndef MPLAYER_TCP_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
26 #define MPLAYER_TCP_H
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
27
31429
b542cd25f03d Move network_prefer_ipv4/reuse_socket extern declarations to tcp.h/udp.h.
diego
parents: 26737
diff changeset
28 extern int network_prefer_ipv4;
b542cd25f03d Move network_prefer_ipv4/reuse_socket extern declarations to tcp.h/udp.h.
diego
parents: 26737
diff changeset
29
19335
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
30 /* Connect to a server using a TCP connection */
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
31 int connect2Server (char *host, int port, int verb);
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
32
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
33 #define TCP_ERROR_TIMEOUT -3 /* connection timeout */
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
34 #define TCP_ERROR_FATAL -2 /* unable to resolve name */
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
35 #define TCP_ERROR_PORT -1 /* unable to connect to a particular port */
2a9d669e5ff6 isolated tcp socket code from network.c to a dedicated file
ben
parents:
diff changeset
36
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 23689
diff changeset
37 #endif /* MPLAYER_TCP_H */