[go: up one dir, main page]

File: tickleProcs.h

package info (click to toggle)
sbnc 1.3.9-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,156 kB
  • ctags: 4,719
  • sloc: ansic: 20,379; cpp: 14,175; sh: 12,783; tcl: 6,025; php: 448; makefile: 430; perl: 46; awk: 25
file content (210 lines) | stat: -rw-r--r-- 7,362 bytes parent folder | download
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
/*******************************************************************************
 * shroudBNC - an object-oriented framework for IRC                            *
 * Copyright (C) 2005-2014 Gunnar Beutner                                      *
 *                                                                             *
 * 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; either version 2              *
 * of the License, 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 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. *
 *******************************************************************************/

#ifdef SWIG
%module bnc
%{
#include "tickleProcs.h"
%}

%rename(rand) ticklerand;

%include "exception.i"
%exception {
	try {
		$function
	} catch (const char *Description) {
		SWIG_exception(SWIG_RuntimeError, const_cast<char *>(Description));
	}
}

%typemap(in) char * (Tcl_DString ds_, bool ds_use_ = false) {
	ds_use_ = true;
	$1 = Tcl_UtfToExternalDString(g_Encoding, Tcl_GetString($input), -1, &ds_);
}

%typemap(freearg) char * {
	if (ds_use_$argnum)
		Tcl_DStringFree(&ds_$argnum);
}

%typemap(in) const char * = char *;

%typemap(ret) char * {
	Tcl_DString ds_ret;
	Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_ExternalToUtfDString(g_Encoding, $1, -1, &ds_ret),-1));

	Tcl_DStringFree(&ds_ret);
}

%typemap(freearg) const char * = char *;

%header %{
extern Tcl_Encoding g_Encoding;
%}

struct CTclSocket;
struct CTclClientSocket;

#else /* SWIG */
int Tcl_ProcInit(Tcl_Interp* interp);

class CTclSocket;
class CTclClientSocket;
#endif /*SWIG */

// exported procs, which are accessible via tcl

int putclient(const char* text);
const char *simul(const char* User, const char* Command);

int internalbind(const char* type, const char* proc, const char* pattern = 0, const char* user = 0);
int internalunbind(const char* type, const char* proc, const char* pattern = 0, const char* user = 0);

void setctx(const char* ctx);
const char* getctx(int ts = 0);

const char* bncuserlist(void);
const char* getbncuser(const char* User, const char* Type, const char* Parameter2 = 0);
int setbncuser(const char* User, const char* Type, const char* Value = 0, const char* Parameter2 = 0);
void addbncuser(const char* User, const char* Password);
void delbncuser(const char* User);
bool bnccheckpassword(const char* User, const char* Password);

const char* internalchanlist(const char* Channel);

const char* bncversion(void);
const char* bncnumversion(void);
int bncuptime(void);

int floodcontrol(const char* Function);

const char* getisupport(const char* Feature);
void setisupport(const char *Feature, const char *Value);
int requiresparam(char Mode);
bool isprefixmode(char Mode);
const char* getchanprefix(const char* Channel, const char* Nick);

const char* internalchannels(void);
const char* bncmodules(void);

int bncsettag(const char* channel, const char* nick, const char* tag, const char* value);
const char* bncgettag(const char* channel, const char* nick, const char* tag);
void haltoutput(void);

const char* bnccommand(const char* Cmd, const char* Parameters);

const char* md5(const char* String, const char *Salt = NULL);

void debugout(const char* String);

int internalgetchanidle(const char* Nick, const char* Channel);

void bncreply(const char* Text);

int trafficstats(const char* User, const char* ConnectionType = NULL, const char* Type = NULL);
void bncjoinchans(const char* User);

int internalvalidsocket(int Socket);
int internallisten(unsigned short Port, const char* Type, const char* Options = 0,
	const char* Flag = 0, bool SSL = false, const char *BindIp = NULL);
void internalsocketwriteln(int Socket, const char* Line);
int internalconnect(const char* Host, unsigned short Port, bool SSL = false);
const char *internalgetipforsocket(int Socket);
void internalclosesocket(int Socket);

int internaltimer(int Interval, bool Repeat, const char* Proc, const char* Parameter = 0);
int internalkilltimer(const char* Proc, const char* Parameter = 0);
char *internaltimers(void);

void bncdisconnect(const char* Reason);
void bnckill(const char* Reason);

const char* getcurrentnick(void);

const char* internalbinds(void);

const char* bncgetmotd(void);
void bncsetmotd(const char* Motd);
const char* bncgetgvhost(void);
void bncsetgvhost(const char* GVHost);

bool bncisipblocked(const char* Ip);
void bnclogbadlogin(const char* Ip);

bool bncvalidusername(const char *Name);
bool bncvaliduser(const char *Name);

int bncgetsendq(void);
void bncsetsendq(int NewSize);

void bncaddcommand(const char *Name, const char *Category, const char *Description, const char *HelpText = 0);
void bncdeletecommand(const char *Name);

bool synthwho(const char *Channel, bool Simulate);
const char* getchanrealname(const char* Nick, const char* Channel = 0);

const char *impulse(int imp);

void bncsetglobaltag(const char *Tag, const char *Value = 0);
const char *bncgetglobaltag(const char *Tag);
const char *bncgetglobaltags(void);

const char *getusermodes(void);

int hijacksocket(void);

void putmainlog(const char *Text);

int bncgetreslimit(const char *Resource, const char *User = 0);
void bncsetreslimit(const char *Resource, int NewLimit, const char *User = 0);

void setchannelsortvalue(int Value);

int internaldnslookup(const char *host, const char *tclproc, int reverse = 0, int ipv6 = 0, const char *param = 0);

// eggdrop compat
bool onchan(const char* Nick, const char* Channel = 0);
const char* topic(const char* Channel);
const char* topicnick(const char* Channel);
int topicstamp(const char* Channel);
const char* getchanmode(const char* Channel);
bool isop(const char* Nick, const char* Channel = 0);
bool isvoice(const char* Nick, const char* Channel = 0);
bool ishalfop(const char* Nick, const char* Channel = 0);
const char* getchanhost(const char* Nick, const char* Channel = 0);
void jump(const char *Server = 0, unsigned int Port = 0, const char *Password = 0);
void rehash(void);
void die(void);
int putserv(const char* text, const char *option = 0);
int getchanjoin(const char* Nick, const char* Channel);
int ticklerand(int limit);
int clearqueue(const char* Queue);
int queuesize(const char* Queue);
int puthelp(const char* text, const char *option = 0);
int putquick(const char* text, const char *option = 0);
void putlog(const char* Text);
char* chanbans(const char* Channel);

void control(int Socket, const char* Proc);

const char *bncconfigdir(void);
const char *bncmoduledir(void);
const char *bncshareddir(void);
const char *bncexedir(void);