ekg2
Strona główna
Dodatkowe strony
Moduły
Struktury Danych
Pliki
Lista plików
Globalne
All
Struktury Danych
Pliki
Funkcje
Zmienne
Definicje typów
Wyliczenia
Wartości wyliczeń
Definicje
Grupay
Strony
remote
stuff.h
Idź do dokumentacji tego pliku.
1
/* $Id: stuff.h 4597 2008-09-03 21:10:01Z darkjames $ */
2
3
/*
4
* (C) Copyright 2001-2003 Wojtek Kaniewski <wojtekka@irc.pl>
5
* Robert J. Woźny <speedy@ziew.org>
6
* Paweł Maziarz <drg@go2.pl>
7
* Dawid Jarosz <dawjar@poczta.onet.pl>
8
* Piotr Domagalski <szalik@szalik.net>
9
* Adam Mikuta <adammikuta@poczta.onet.pl>
10
*
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License Version 2 as
13
* published by the Free Software Foundation.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
*/
24
25
#ifndef __EKG_STUFF_H
26
#define __EKG_STUFF_H
27
28
#include <sys/types.h>
29
#include <sys/time.h>
30
#include <time.h>
31
32
#include <ctype.h>
33
#include <stdarg.h>
34
#include <stdio.h>
35
36
#include "
plugins.h
"
37
#include "
sessions.h
"
38
39
#define BINDING_FUNCTION(x) void x(const char *arg)
40
41
struct
binding
{
42
struct
binding
*
next
;
43
44
char
*
key
;
45
46
char
*
action
;
/* akcja */
47
unsigned
int
internal
: 1;
/* czy domyślna kombinacja? */
48
void (*
function
)(
const
char
*
arg
);
/* funkcja obsługująca */
49
char
*
arg
;
/* argument funkcji */
50
51
char
*
default_action
;
/* domyślna akcja */
52
void (*
default_function
)(
const
char
*
arg
);
/* domyślna funkcja */
53
char
*
default_arg
;
/* domyślny argument */
54
};
55
56
typedef
struct
binding_added
{
57
struct
binding_added
*
next
;
58
59
char
*
sequence
;
60
struct
binding
*
binding
;
61
}
binding_added_t
;
62
63
#define TIMER(x) int x(int type, void *data)
64
65
struct
timer
{
66
struct
timer
*
next
;
67
68
char
*
name
;
/* nazwa timera */
69
plugin_t
*
plugin
;
/* wtyczka obsługująca deksryptor */
70
struct
timeval ends;
/* kiedy się kończy? */
71
unsigned
int
period
;
/* ile milisekund ma trwać czekanie */
72
int (*
function
)(int,
void
*);
/* funkcja do wywołania */
73
void
*
data
;
/* dane dla funkcji */
74
75
unsigned
int
persist
: 1;
/* czy ma być na zawsze? */
76
unsigned
int
at
: 1;
/* /at? trzeba się tego jakoś pozbyć
77
* i ujednolicić z /timer */
78
unsigned
int
is_session
: 1;
/* czy sesyjny */
79
};
80
81
extern
char
*
config_console_charset
;
/* */
82
extern
char
*
server_console_charset
;
83
extern
int
config_use_unicode
;
/* for instance in jabber plugin if this is on, than we don't need to make iconv from / to unicode.. */
84
extern
int
config_use_iso
;
/* this for ncurses */
85
extern
struct
binding
*
bindings
;
86
extern
struct
timer
*
timers
;
87
extern
binding_added_t
*
bindings_added
;
88
extern
int
config_debug
;
89
extern
int
config_display_welcome
;
90
extern
int
config_query_commands
;
91
extern
int
config_slash_messages
;
92
extern
int
config_display_color
;
93
extern
int
config_display_pl_chars
;
94
extern
int
config_display_crap
;
95
extern
int
config_default_status_window
;
96
extern
char
*
config_timestamp
;
97
extern
int
config_timestamp_show
;
98
extern
int
config_history_savedups
;
99
extern
int
config_make_window
;
100
extern
int
config_sort_windows
;
101
extern
int
config_send_white_lines
;
102
103
extern
char
*
config_tab_command
;
104
extern
int
config_save_quit
;
105
extern
int
config_lastlog_noitems
;
106
extern
int
config_lastlog_case
;
107
extern
int
config_lastlog_display_all
;
108
extern
char
*
config_completion_char
;
109
110
extern
int
config_changed
;
111
112
extern
int
no_mouse
;
113
114
extern
int
old_stderr
;
115
116
extern
int
in_autoexec
;
117
118
void
binding_free
();
119
120
void
changed_theme
(
const
char
*var);
121
122
const
char
*
compile_time
();
123
124
void
iso_to_ascii
(
unsigned
char
*buf);
125
126
#ifdef __GNUC__
127
char
*
saprintf
(
const
char
*
format
, ...)
__attribute__
((format (printf, 1, 2)));
128
#else
129
char
*
saprintf
(
const
char
*format, ...);
130
#endif
131
132
const
char
*
timestamp
(
const
char
*format);
133
const
char
*
timestamp_time
(
const
char
*format, time_t
t
);
134
135
int
isalpha_pl
(
unsigned
char
c
);
136
/* makra, dzięki którym pozbywamy się warning'ów */
137
#define xisxdigit(c) isxdigit((int) (unsigned char) c)
138
#define xisdigit(c) isdigit((int) (unsigned char) c)
139
#define xisalpha(c) isalpha_pl((int) (unsigned char) c)
140
#define xisalnum(c) isalnum((int) (unsigned char) c)
141
#define xisspace(c) isspace((int) (unsigned char) c)
142
#define xtolower(c) tolower((int) (unsigned char) c)
143
#define xtoupper(c) toupper((int) (unsigned char) c)
144
145
struct
timer
*
timer_add
(
plugin_t
*
plugin
,
const
char
*
name
,
unsigned
int
period
,
int
persist
,
int
(*
function
)(
int
,
void
*),
void
*
data
);
146
struct
timer
*
timer_add_ms
(
plugin_t
*plugin,
const
char
*name,
unsigned
int
period,
int
persist,
int
(*
function
)(
int
,
void
*),
void
*
data
);
147
int
timer_remove
(
plugin_t
*plugin,
const
char
*name);
148
struct
timer
*
timers_removei
(
struct
timer
*
t
);
149
void
timers_destroy
();
150
151
const
char
*
ekg_status_string
(
const
int
status
,
const
int
cmd);
152
153
/* funkcje poza stuff.c */
154
void
ekg_exit
();
155
void
ekg_debug_handler
(
int
level,
const
char
*format, va_list ap);
156
157
int
ekg_write
(
int
fd,
const
char
*buf,
int
len);
158
int
remote_request
(
char
*what, ...);
159
160
#endif
/* __EKG_STUFF_H */
161
162
/*
163
* Local Variables:
164
* mode: c
165
* c-file-style: "k&r"
166
* c-basic-offset: 8
167
* indent-tabs-mode: t
168
* End:
169
*/
Wygenerowano Pn, 15 lip 2013 08:05:25 dla ekg2 programem
1.8.4