~ubuntu-branches/ubuntu/edgy/ggz-client-libs/edgy

« back to all changes in this revision

Viewing changes to ggzcore/net.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut, Josef Spillner, Peter Eisentraut
  • Date: 2006-09-09 13:37:14 UTC
  • mfrom: (2.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20060909133714-q49a9kvjfkc0wcc3
Tags: 0.0.13-3
[ Josef Spillner ]
* Change ggzcore-bin dependency from ggzmod to recommends from ggzcore
  (closes: #384671).

[ Peter Eisentraut ]
* Make package dependencies binNMU-safe through use of ${binary:Version}
  (closes: #386126)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * Author: Brent Hendricks
4
4
 * Project: GGZ Core Client Lib
5
5
 * Date: 9/22/00
6
 
 * $Id: net.h,v 1.37 2003/01/22 13:50:00 dr_maux Exp $
 
6
 * $Id: net.h 7889 2006-03-07 09:57:32Z josef $
7
7
 *
8
8
 * Code for performing network I/O
9
9
 *
10
10
 * Copyright (C) 2000 Brent Hendricks.
11
11
 *
12
 
 * This program is free software; you can redistribute it and/or modify
13
 
 * it under the terms of the GNU General Public License as published by
14
 
 * the Free Software Foundation; either version 2 of the License, or
15
 
 * (at your option) any later version.
16
 
 *
17
 
 * This program is distributed in the hope that it will be useful,
 
12
 * This library is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU Lesser General Public
 
14
 * License as published by the Free Software Foundation; either
 
15
 * version 2.1 of the License, or (at your option) any later version.
 
16
 * 
 
17
 * This library is distributed in the hope that it will be useful,
18
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 * GNU General Public License for more details.
21
 
 *
22
 
 * You should have received a copy of the GNU General Public License
23
 
 * along with this program; if not, write to the Free Software
24
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
 * Lesser General Public License for more details.
 
21
 * 
 
22
 * You should have received a copy of the GNU Lesser General Public
 
23
 * License along with this library; if not, write to the Free Software
 
24
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25
25
 */
26
26
 
27
27
 
32
32
#include "protocol.h"
33
33
#include "table.h"
34
34
 
35
 
struct _GGZNet* _ggzcore_net_new(void);
36
 
void _ggzcore_net_init(struct _GGZNet *net, 
37
 
                       struct _GGZServer *server, 
 
35
typedef struct _GGZNet GGZNet;
 
36
 
 
37
GGZNet *_ggzcore_net_new(void);
 
38
void _ggzcore_net_init(GGZNet * net,
 
39
                       GGZServer * server,
38
40
                       const char *host,
39
 
                       unsigned int port,
40
 
                           unsigned int use_tls);
41
 
 
42
 
int _ggzcore_net_set_dump_file(struct _GGZNet *net, const char* filename);
43
 
void _ggzcore_net_set_fd(struct _GGZNet *net, int fd);
44
 
 
45
 
void _ggzcore_net_free(struct _GGZNet *net);
46
 
 
47
 
const char* _ggzcore_net_get_host(struct _GGZNet *net);
48
 
unsigned int _ggzcore_net_get_port(struct _GGZNet *net);
49
 
int          _ggzcore_net_get_fd(struct _GGZNet *net);
50
 
int          _ggzcore_net_get_tls(struct _GGZNet *net);
51
 
 
52
 
int _ggzcore_net_connect(struct _GGZNet *net);
53
 
 
54
 
void _ggzcore_net_disconnect(struct _GGZNet *net);
 
41
                       unsigned int port, unsigned int use_tls);
 
42
 
 
43
int _ggzcore_net_set_dump_file(GGZNet * net, const char *filename);
 
44
void _ggzcore_net_set_fd(GGZNet * net, int fd);
 
45
 
 
46
void _ggzcore_net_free(GGZNet * net);
 
47
 
 
48
const char *_ggzcore_net_get_host(GGZNet * net);
 
49
unsigned int _ggzcore_net_get_port(GGZNet * net);
 
50
int _ggzcore_net_get_fd(GGZNet * net);
 
51
int _ggzcore_net_get_tls(GGZNet * net);
 
52
 
 
53
int _ggzcore_net_connect(GGZNet * net);
 
54
 
 
55
void _ggzcore_net_disconnect(GGZNet * net);
55
56
 
56
57
/* Functions for sending data/requests to server */
57
 
int _ggzcore_net_send_login(struct _GGZNet *net);
58
 
int _ggzcore_net_send_channel(struct _GGZNet *net);
59
 
int _ggzcore_net_send_motd(struct _GGZNet *net);
60
 
int _ggzcore_net_send_list_types(struct _GGZNet *net, 
61
 
                                 const char verbose);
62
 
int _ggzcore_net_send_list_rooms(struct _GGZNet *net,
63
 
                                 const int type,
64
 
                                 const char verbose);
65
 
int _ggzcore_net_send_join_room(struct _GGZNet *net, 
66
 
                                const unsigned int room_num);
67
 
 
68
 
int _ggzcore_net_send_list_players(struct _GGZNet *net);
69
 
int _ggzcore_net_send_list_tables(struct _GGZNet *net, 
70
 
                                  const int type, 
71
 
                                  const char global);
72
 
 
73
 
int _ggzcore_net_send_chat(struct _GGZNet *net, 
 
58
int _ggzcore_net_send_login(GGZNet * net, GGZLoginType login_type,
 
59
                            const char *handle, const char *password, const char *email,
 
60
                            const char *language);
 
61
int _ggzcore_net_send_channel(GGZNet * net, const char *id);
 
62
int _ggzcore_net_send_motd(GGZNet * net);
 
63
int _ggzcore_net_send_list_types(GGZNet * net, const char verbose);
 
64
int _ggzcore_net_send_list_rooms(GGZNet * net,
 
65
                                 const int type, const char verbose);
 
66
int _ggzcore_net_send_join_room(GGZNet * net, const unsigned int room_num);
 
67
 
 
68
int _ggzcore_net_send_list_players(GGZNet * net);
 
69
int _ggzcore_net_send_list_tables(GGZNet * net,
 
70
                                  const int type, const char global);
 
71
 
 
72
int _ggzcore_net_send_chat(GGZNet * net,
74
73
                           const GGZChatType op,
75
 
                           const char* player, 
76
 
                           const char* msg); 
77
 
 
78
 
int _ggzcore_net_send_table_launch(struct _GGZNet *net, struct _GGZTable *table);
79
 
int _ggzcore_net_send_table_join(struct _GGZNet *net, const unsigned int num,
 
74
                           const char *player, const char *msg);
 
75
 
 
76
int _ggzcore_net_send_player_info(GGZNet * net, int seat_num);
 
77
 
 
78
int _ggzcore_net_send_table_launch(GGZNet * net, struct _GGZTable *table);
 
79
int _ggzcore_net_send_table_join(GGZNet * net, const unsigned int num,
80
80
                                 int spectator);
81
 
int _ggzcore_net_send_table_leave(struct _GGZNet *net, int force,
82
 
                                  int spectator);
83
 
int _ggzcore_net_send_table_reseat(GGZNet *net,
84
 
                                   GGZReseatType opcode,
85
 
                                   int seat_num);
86
 
int _ggzcore_net_send_table_seat_update(GGZNet *net, GGZTable *table,
87
 
                                        struct _GGZSeat *seat);
88
 
int _ggzcore_net_send_table_desc_update(GGZNet *net, GGZTable *table,
 
81
int _ggzcore_net_send_table_leave(GGZNet * net, int force, int spectator);
 
82
int _ggzcore_net_send_table_reseat(GGZNet * net,
 
83
                                   GGZReseatType opcode, int seat_num);
 
84
int _ggzcore_net_send_table_seat_update(GGZNet * net, GGZTable * table,
 
85
                                        GGZTableSeat * seat);
 
86
int _ggzcore_net_send_table_desc_update(GGZNet * net, GGZTable * table,
89
87
                                        const char *desc);
90
 
int _ggzcore_net_send_table_boot_update(GGZNet *net, GGZTable *table,
91
 
                                        struct _GGZSeat *seat);
92
 
 
93
 
int _ggzcore_net_send_game_data(struct _GGZNet *net, int size, char *buffer);
94
 
 
95
 
int _ggzcore_net_send_logout(struct _GGZNet *net);
 
88
int _ggzcore_net_send_table_boot_update(GGZNet * net, GGZTable * table,
 
89
                                        GGZTableSeat * seat);
 
90
 
 
91
int _ggzcore_net_send_game_data(GGZNet * net, int size, char *buffer);
 
92
 
 
93
int _ggzcore_net_send_logout(GGZNet * net);
96
94
 
97
95
 
98
96
/* Functions for reading data from server */
99
 
int _ggzcore_net_data_is_pending(struct _GGZNet *net);
100
 
int _ggzcore_net_read_data(struct _GGZNet *net);
 
97
int _ggzcore_net_data_is_pending(GGZNet * net);
 
98
int _ggzcore_net_read_data(GGZNet * net);
101
99
 
102
100
#endif /* __NET_H__ */
103