~ubuntu-branches/ubuntu/lucid/eggdrop/lucid

« back to all changes in this revision

Viewing changes to src/mod/transfer.mod/transfer.h

  • Committer: Bazaar Package Importer
  • Author(s): Guilherme de S. Pastore
  • Date: 2004-06-17 09:15:28 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040617091528-64rrw1sa33lkfhmh
Tags: 1.6.16-2
* Fixed typo on README.Debian
* Fixed hyphens in manual page
* Converted debian/rules to CDBS
* Set path to binary on example config file
* Changed LANGDIR on src/eggdrop.h (Closes: #254824)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * transfer.h -- part of transfer.mod
3
3
 *
4
 
 * $Id: transfer.h,v 1.14 2002/01/02 03:46:40 guppy Exp $
 
4
 * $Id: transfer.h,v 1.22 2004/01/09 05:56:39 wcc Exp $
5
5
 */
6
6
/*
7
7
 * Copyright (C) 1997 Robey Pointer
8
 
 * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
 
8
 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team
9
9
 *
10
10
 * This program is free software; you can redistribute it and/or
11
11
 * modify it under the terms of the GNU General Public License
27
27
 
28
28
enum dccsend_types {
29
29
  DCCSEND_OK = 0,
30
 
  DCCSEND_FULL,         /* DCC table is full                    */
31
 
  DCCSEND_NOSOCK,       /* Can not open a listening socket      */
32
 
  DCCSEND_BADFN,        /* No such file                         */
33
 
  DCCSEND_FEMPTY        /* File is empty                        */
 
30
  DCCSEND_FULL,                 /* DCC table is full                    */
 
31
  DCCSEND_NOSOCK,               /* Can not open a listening socket      */
 
32
  DCCSEND_BADFN,                /* No such file                         */
 
33
  DCCSEND_FEMPTY                /* File is empty                        */
34
34
};
35
35
 
36
 
#ifndef MAKING_TRANSFER
37
 
/* 4 - 7 */
38
 
#define DCC_FORK_SEND (*(struct dcc_table *)(transfer_funcs[4]))
39
 
#define at_limit(a) (((int (*) (char *))transfer_funcs[5])(a))
40
 
#define copy_to_tmp (*(int *)(transfer_funcs[6]))
41
 
#define fileq_cancel(a,b) (((void (*) (int,char *))transfer_funcs[7])(a,b))
42
 
/* 8 - 11 */
43
 
#define queue_file(a,b,c,d) (((void (*)(char *,char *,char *,char *))transfer_funcs[8])(a,b,c,d))
44
 
#define raw_dcc_send(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[9])(a,b,c,d))
45
 
#define show_queued_files(a) (((void (*) (int))transfer_funcs[10])(a))
46
 
#define wild_match_file(a,b) (((int (*)(register char * m, register char * n))transfer_funcs[11])(a,b))
47
 
/* 12 - 15 */
48
 
#define wipe_tmp_filename(a,b) (((void (*) (char *,int))transfer_funcs[12])(a,b))
49
 
#define DCC_GET (*(struct dcc_table *)(transfer_funcs[13]))
50
 
#define H_rcvd (*(p_tcl_bind_list*)(transfer_funcs[14]))
51
 
#define H_sent (*(p_tcl_bind_list*)(transfer_funcs[15]))
52
 
/* 16 - 19 */
53
 
#define USERENTRY_FSTAT (*(struct user_entry_type *)(transfer_funcs[16]))
54
 
#define quiet_reject (*(int *)(transfer_funcs[17]))
55
 
#define raw_dcc_resend(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[18])(a,b,c,d))
56
 
#define H_lost (*(p_tcl_bind_list*)(transfer_funcs[19]))
57
 
/* 20 - 23 */
58
 
#define H_tout (*(p_tcl_bind_list*)(transfer_funcs[20]))
59
 
 
60
 
#else   /* MAKING_TRANSFER */
61
 
 
62
 
static int raw_dcc_resend(char *, char *, char *, char *);
63
 
static int raw_dcc_send(char *, char *, char *, char *);
64
 
 
65
 
#define TRANSFER_REGET_PACKETID 0xfeab
66
 
 
67
 
typedef struct {
68
 
  u_16bit_t packet_id;          /* Identification ID, should be equal
69
 
                                   to TRANSFER_REGET_PACKETID           */
70
 
  u_8bit_t  byte_order;         /* Byte ordering, see byte_order_test() */
71
 
  u_32bit_t byte_offset;        /* Number of bytes to skip relative to
72
 
                                   the file beginning                   */
73
 
} transfer_reget;
74
 
 
75
 
typedef struct zarrf {
76
 
  char *dir;                    /* Absolute dir if it starts with '*',
77
 
                                   otherwise dcc dir.                   */
78
 
  char *file;
79
 
  char nick[NICKLEN];           /* Who queued this file                 */
80
 
  char to[NICKLEN];             /* Who will it be sent to               */
81
 
  struct zarrf *next;
82
 
} fileq_t;
83
 
 
84
 
#endif                          /* MAKING_TRANSFER */
85
 
 
86
 
/* Language file additions */
 
36
/* File matching */
 
37
#define FILEMATCH (match+sofar)
 
38
#define FILEQUOTE '\\'
 
39
#define FILEWILDS '*'
 
40
#define FILEWILDQ '?'
 
41
 
 
42
/* Language data */
87
43
#define TRANSFER_COPY_FAILED        get_language(0xf00)
88
44
#define TRANSFER_FILESYS_BROKEN     get_language(0xf01)
89
45
#define TRANSFER_FILE_ARRIVE        get_language(0xf02)
114
70
#define TRANSFER_THANKS             get_language(0xf1b)
115
71
#define TRANSFER_NOTICE_THANKS      get_language(0xf1c)
116
72
#define TRANSFER_USERFILE_LOST      get_language(0xf1d)
117
 
/* #define TRANSFER_BYE             get_language(0xf1e) */
 
73
/* #define TRANSFER_BYE             get_language(0xf1e) */
118
74
#define TRANSFER_USERFILE_DISCON    get_language(0xf1f)
119
75
#define TRANSFER_LOST_DCCSEND       get_language(0xf20)
120
76
#define TRANSFER_REGET_PACKET       get_language(0xf21)
143
99
#define TRANSFER_RE                 get_language(0xf38)
144
100
#define TRANSFER_DCC_IGNORED        get_language(0xf39)
145
101
#define TRANSFER_UNLOADING          get_language(0xf40)
146
 
#define TRANSFER_STAT_BLOCK         get_language(0xf41)
147
 
#define TRANSFER_STAT_MEMORY        get_language(0xf42)
148
 
/* end of langauge addon */
149
 
 
150
 
#endif                          /* _EGG_MOD_TRANSFER_TRANSFER_H */
 
102
#define TRANSFER_STAT_1             get_language(0xf41)
 
103
#define TRANSFER_STAT_2             get_language(0xf42)
 
104
 
 
105
#ifndef MAKING_TRANSFER
 
106
/* 4 - 7 */
 
107
#define DCC_FORK_SEND (*(struct dcc_table *)(transfer_funcs[4]))
 
108
#define at_limit(a) (((int (*) (char *))transfer_funcs[5])(a))
 
109
/* Was copy_to_tmp (moved to core) <Wcc[01/20/03]>. */
 
110
#define fileq_cancel(a,b) (((void (*) (int,char *))transfer_funcs[7])(a,b))
 
111
/* 8 - 11 */
 
112
#define queue_file(a,b,c,d) (((void (*)(char *,char *,char *,char *))transfer_funcs[8])(a,b,c,d))
 
113
#define raw_dcc_send(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[9])(a,b,c,d))
 
114
#define show_queued_files(a) (((void (*) (int))transfer_funcs[10])(a))
 
115
#define wild_match_file(a,b) (((int (*)(register char *, register char *))transfer_funcs[11])(a,b))
 
116
/* 12 - 15 */
 
117
#define wipe_tmp_filename(a,b) (((void (*) (char *,int))transfer_funcs[12])(a,b))
 
118
#define DCC_GET (*(struct dcc_table *)(transfer_funcs[13]))
 
119
#define H_rcvd (*(p_tcl_bind_list*)(transfer_funcs[14]))
 
120
#define H_sent (*(p_tcl_bind_list*)(transfer_funcs[15]))
 
121
/* 16 - 19 */
 
122
#define USERENTRY_FSTAT (*(struct user_entry_type *)(transfer_funcs[16]))
 
123
/* Was quiet_reject (moved to core) <Wcc[01/20/03]>. */
 
124
#define raw_dcc_resend(a,b,c,d) (((int (*) (char *,char *,char *,char *))transfer_funcs[18])(a,b,c,d))
 
125
#define H_lost (*(p_tcl_bind_list*)(transfer_funcs[19]))
 
126
/* 20 - 23 */
 
127
#define H_tout (*(p_tcl_bind_list*)(transfer_funcs[20]))
 
128
#define DCC_SEND (*(struct dcc_table *)(transfer_funcs[21]))
 
129
#define DCC_GET_PENDING (*(struct dcc_table *)(transfer_funcs[22]))
 
130
 
 
131
#else /* MAKING_TRANSFER */
 
132
 
 
133
static void dcc_fork_send(int, char *, int);
 
134
static void stats_add_dnload(struct userrec *, unsigned long);
 
135
static void stats_add_upload(struct userrec *, unsigned long);
 
136
static void wipe_tmp_filename(char *, int);
 
137
static void dcc_get_pending(int, char *, int);
 
138
static void queue_file(char *, char *, char *, char *);
 
139
static int raw_dcc_resend(char *, char *, char *, char *);
 
140
static int raw_dcc_send(char *, char *, char *, char *);
 
141
static int at_limit(char *);
 
142
static int fstat_gotshare(struct userrec *u, struct user_entry *e, char *par,
 
143
                          int idx);
 
144
static int fstat_dupuser(struct userrec *u, struct userrec *o,
 
145
                         struct user_entry *e);
 
146
static int fstat_tcl_set(Tcl_Interp *irp, struct userrec *u,
 
147
                         struct user_entry *e, int argc, char **argv);
 
148
static void stats_add_dnload(struct userrec *u, unsigned long bytes);
 
149
static void stats_add_upload(struct userrec *u, unsigned long bytes);
 
150
static int wild_match_file(register char *, register char *);
 
151
static int server_transfer_setup(char *);
 
152
 
 
153
#define TRANSFER_REGET_PACKETID 0xfeab
 
154
 
 
155
typedef struct {
 
156
  u_16bit_t packet_id;          /* Identification ID, should be equal
 
157
                                 * to TRANSFER_REGET_PACKETID           */
 
158
  u_8bit_t byte_order;          /* Byte ordering, see byte_order_test() */
 
159
  u_32bit_t byte_offset;        /* Number of bytes to skip relative to
 
160
                                 * the file beginning                   */
 
161
} transfer_reget;
 
162
 
 
163
typedef struct zarrf {
 
164
  char *dir;                    /* Absolute dir if it starts with '*',
 
165
                                 * otherwise dcc dir.                   */
 
166
  char *file;
 
167
  char nick[NICKLEN];           /* Who queued this file                 */
 
168
  char to[NICKLEN];             /* Who will it be sent to               */
 
169
  struct zarrf *next;
 
170
} fileq_t;
 
171
 
 
172
#endif /* MAKING_TRANSFER */
 
173
#endif /* _EGG_MOD_TRANSFER_TRANSFER_H */