~ubuntu-branches/ubuntu/lucid/gnome-media/lucid

« back to all changes in this revision

Viewing changes to cddb-slave2/tcp.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-07-28 09:49:30 UTC
  • mfrom: (0.1.33 upstream)
  • Revision ID: james.westby@ubuntu.com-20090728094930-2atfxgwqd0wj55ph
Tags: 2.27.5-0ubuntu1
* New upstream release
  - General:
    + vumeter, gnome-cd and cddb-slave have been removed
  - gnome-volume-control
    + Add card and port selection (Bastien Nocera)
    + Excessive CPU usage when trying to reconnect to PulseAudio (Chris Coulson)
    + Many fixes (Bastien Nocera)
  - Updated translations:
    + es (Jorge González)
    + et (Ivar Smolin)
    + fi (Ilkka Tuohela)
    + gu (Sweta Kothari)
    + he (Yaron Shahrabani)
    + hu (Gabor Kelemen)
    + pt_BR (André Gondim)
    + sv (Daniel Nylander)
    + ta (Dr.T.Vasudevan)
    + zh_HK (Chao-Hsiung Liao)
    + zh_TW (Chao-Hsiung Liao)
* debian/rules: Remove configure flags to disable cddb-slave and gnome-cd
* 01_vumeter_nodisplay.patch: Dropped, as vumeter has been removed
* 03_menu_changes.patch: Removed references to gnome-cd and vumeter files
* 99_autoconf.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* GNet - Networking library
2
 
 * Copyright (C) 2000  David Helder
3
 
 * Copyright (C) 2000  Andrew Lanoix
4
 
 *
5
 
 * This library is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU Library 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
 
 * Library General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Library General Public
16
 
 * 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
 
 
22
 
#ifndef _GNET_TCP_H
23
 
#define _GNET_TCP_H
24
 
 
25
 
#include "inetaddr.h"
26
 
 
27
 
#include <glib.h>
28
 
 
29
 
#ifdef __cplusplus
30
 
extern "C" {
31
 
#endif /* __cplusplus */
32
 
 
33
 
/*
34
 
 
35
 
  All fields in GTcpSocket are private and should be accessed only by
36
 
  using the functions below.
37
 
 
38
 
 */
39
 
typedef struct _GTcpSocket GTcpSocket;
40
 
 
41
 
 
42
 
/* **************************************** */
43
 
/* Asyncronous stuff     */
44
 
 
45
 
 
46
 
/**
47
 
 *   GTcpSocketConnectAsyncID:
48
 
 *
49
 
 *   ID of an asynchronous connection started with
50
 
 *   gnet_tcp_socket_connect_async().  The connection can be canceled
51
 
 *   by calling gnet_tcp_socket_connect_async_cancel() with the ID.
52
 
 *
53
 
 **/
54
 
typedef gpointer GTcpSocketConnectAsyncID;
55
 
 
56
 
 
57
 
 
58
 
/**
59
 
 *   GTcpSocketConnectAsyncStatus:
60
 
 *
61
 
 *   Status for connecting via gnet_tcp_socket_connect_async(), passed
62
 
 *   by GTcpSocketConnectAsyncFunc.  More errors may be added in the
63
 
 *   future, so it's best to compare against
64
 
 *   %GTCP_SOCKET_CONNECT_ASYNC_STATUS_OK.
65
 
 *
66
 
 **/
67
 
typedef enum {
68
 
  GTCP_SOCKET_CONNECT_ASYNC_STATUS_OK,
69
 
  GTCP_SOCKET_CONNECT_ASYNC_STATUS_INETADDR_ERROR,
70
 
  GTCP_SOCKET_CONNECT_ASYNC_STATUS_TCP_ERROR
71
 
} GTcpSocketConnectAsyncStatus;
72
 
 
73
 
 
74
 
 
75
 
/**
76
 
 *   GTcpSocketConnectAsyncFunc:
77
 
 *   @socket: TcpSocket that was connecting
78
 
 *   @ia: InetAddr of the TcpSocket
79
 
 *   @status: Status of the connection
80
 
 *   @data: User data
81
 
 *
82
 
 *   Callback for gnet_tcp_socket_connect_async().
83
 
 *
84
 
 **/
85
 
typedef void (*GTcpSocketConnectAsyncFunc)(GTcpSocket* socket,
86
 
                                           GInetAddr* ia,
87
 
                                           GTcpSocketConnectAsyncStatus status,
88
 
                                           gpointer data);
89
 
 
90
 
 
91
 
/**
92
 
 *   GTcpSocketNewAsyncID:
93
 
 *
94
 
 *   ID of an asynchronous tcp socket creation started with
95
 
 *   gnet_tcp_socket_new_async().  The creation can be canceled by
96
 
 *   calling gnet_tcp_socket_new_async_cancel() with the ID.
97
 
 *
98
 
 **/
99
 
typedef gpointer GTcpSocketNewAsyncID;
100
 
 
101
 
 
102
 
 
103
 
/**
104
 
 *   GTcpSocketAsyncStatus:
105
 
 *
106
 
 *   Status for connecting via gnet_tcp_socket_new_async(), passed by
107
 
 *   GTcpSocketNewAsyncFunc.  More errors may be added in the future,
108
 
 *   so it's best to compare against %GTCP_SOCKET_NEW_ASYNC_STATUS_OK.
109
 
 *
110
 
 **/
111
 
typedef enum {
112
 
  GTCP_SOCKET_NEW_ASYNC_STATUS_OK,
113
 
  GTCP_SOCKET_NEW_ASYNC_STATUS_ERROR
114
 
} GTcpSocketNewAsyncStatus;
115
 
 
116
 
 
117
 
 
118
 
/**
119
 
 *   GTcpSocketNewAsyncFunc:
120
 
 *   @socket: Socket that was connecting
121
 
 *   @status: Status of the connection
122
 
 *   @data: User data
123
 
 *
124
 
 *   Callback for gnet_tcp_socket_new_async().
125
 
 *
126
 
 **/
127
 
typedef void (*GTcpSocketNewAsyncFunc)(GTcpSocket* socket,
128
 
                                       GTcpSocketNewAsyncStatus status,
129
 
                                       gpointer data);
130
 
 
131
 
 
132
 
 
133
 
 
134
 
/* ********** */
135
 
 
136
 
 
137
 
/* Quick and easy blocking constructor */
138
 
GTcpSocket* gnet_tcp_socket_connect (const gchar* hostname, gint port);
139
 
 
140
 
/* Quick and easy asynchronous constructor */
141
 
GTcpSocketConnectAsyncID
142
 
gnet_tcp_socket_connect_async (const gchar* hostname, gint port,
143
 
                               GTcpSocketConnectAsyncFunc func,
144
 
                               gpointer data);
145
 
 
146
 
/* Cancel quick and easy asynchronous constructor */
147
 
void gnet_tcp_socket_connect_async_cancel (GTcpSocketConnectAsyncID id);
148
 
 
149
 
/* Blocking constructor */
150
 
GTcpSocket* gnet_tcp_socket_new (const GInetAddr* addr);
151
 
 
152
 
/* Asynchronous constructor */
153
 
GTcpSocketNewAsyncID
154
 
gnet_tcp_socket_new_async (const GInetAddr* addr,
155
 
                           GTcpSocketNewAsyncFunc func,
156
 
                           gpointer data);
157
 
 
158
 
/* Cancel asynchronous constructor */
159
 
void gnet_tcp_socket_new_async_cancel (GTcpSocketNewAsyncID id);
160
 
 
161
 
void gnet_tcp_socket_delete (GTcpSocket* s);
162
 
 
163
 
void gnet_tcp_socket_ref (GTcpSocket* s);
164
 
void gnet_tcp_socket_unref (GTcpSocket* s);
165
 
 
166
 
 
167
 
/* ********** */
168
 
 
169
 
GIOChannel* gnet_tcp_socket_get_iochannel (GTcpSocket* socket);
170
 
GInetAddr*  gnet_tcp_socket_get_inetaddr (const GTcpSocket* socket);
171
 
gint        gnet_tcp_socket_get_port (const GTcpSocket* socket);
172
 
 
173
 
 
174
 
/* ********** */
175
 
 
176
 
typedef enum
177
 
{
178
 
  GNET_TOS_NONE,
179
 
  GNET_TOS_LOWDELAY,
180
 
  GNET_TOS_THROUGHPUT,
181
 
  GNET_TOS_RELIABILITY,
182
 
  GNET_TOS_LOWCOST
183
 
 
184
 
} GNetTOS;
185
 
 
186
 
void gnet_tcp_socket_set_tos (GTcpSocket* socket, GNetTOS tos);
187
 
 
188
 
 
189
 
/* ********** */
190
 
 
191
 
GTcpSocket* gnet_tcp_socket_server_new (gint port);
192
 
GTcpSocket* gnet_tcp_socket_server_new_interface (const GInetAddr* iface);
193
 
 
194
 
GTcpSocket* gnet_tcp_socket_server_accept (const GTcpSocket* socket);
195
 
GTcpSocket* gnet_tcp_socket_server_accept_nonblock (const GTcpSocket* socket);
196
 
 
197
 
 
198
 
#ifdef __cplusplus
199
 
}
200
 
#endif                          /* __cplusplus */
201
 
 
202
 
#endif /* _GNET_TCP_H */