Idź do dokumentacji tego pliku.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __EKG_STUFF_H
00026 #define __EKG_STUFF_H
00027
00028 #include <sys/types.h>
00029 #include <sys/time.h>
00030 #include <time.h>
00031
00032 #include <ctype.h>
00033 #include <stdarg.h>
00034 #include <stdio.h>
00035
00036 #include "plugins.h"
00037 #include "sessions.h"
00038
00039 #define BINDING_FUNCTION(x) void x(const char *arg)
00040
00041 struct binding {
00042 struct binding *next;
00043
00044 char *key;
00045
00046 char *action;
00047 unsigned int internal : 1;
00048 void (*function)(const char *arg);
00049 char *arg;
00050
00051 char *default_action;
00052 void (*default_function)(const char *arg);
00053 char *default_arg;
00054 };
00055
00056 typedef struct binding_added {
00057 struct binding_added *next;
00058
00059 char *sequence;
00060 struct binding *binding;
00061 } binding_added_t;
00062
00063 #define TIMER(x) int x(int type, void *data)
00064
00065 struct timer {
00066 struct timer *next;
00067
00068 char *name;
00069 plugin_t *plugin;
00070 struct timeval ends;
00071 unsigned int period;
00072 int (*function)(int, void *);
00073 void *data;
00074
00075 unsigned int persist : 1;
00076 unsigned int at : 1;
00077
00078 unsigned int is_session : 1;
00079 };
00080
00081 extern char *config_console_charset;
00082 extern char *server_console_charset;
00083 extern int config_use_unicode;
00084 extern int config_use_iso;
00085 extern struct binding *bindings;
00086 extern struct timer *timers;
00087 extern binding_added_t *bindings_added;
00088 extern int config_debug;
00089 extern int config_display_welcome;
00090 extern int config_query_commands;
00091 extern int config_slash_messages;
00092 extern int config_display_color;
00093 extern int config_display_pl_chars;
00094 extern int config_display_crap;
00095 extern int config_default_status_window;
00096 extern char *config_timestamp;
00097 extern int config_timestamp_show;
00098 extern int config_history_savedups;
00099 extern int config_make_window;
00100 extern int config_sort_windows;
00101 extern int config_send_white_lines;
00102
00103 extern char *config_tab_command;
00104 extern int config_save_quit;
00105 extern int config_lastlog_noitems;
00106 extern int config_lastlog_case;
00107 extern int config_lastlog_display_all;
00108 extern char *config_completion_char;
00109
00110 extern int config_changed;
00111
00112 extern int no_mouse;
00113
00114 extern int old_stderr;
00115
00116 extern int in_autoexec;
00117
00118 void binding_free();
00119
00120 void changed_theme(const char *var);
00121
00122 const char *compile_time();
00123
00124 void iso_to_ascii(unsigned char *buf);
00125
00126 #ifdef __GNUC__
00127 char *saprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
00128 #else
00129 char *saprintf(const char *format, ...);
00130 #endif
00131
00132 const char *timestamp(const char *format);
00133 const char *timestamp_time(const char *format, time_t t);
00134
00135 int isalpha_pl(unsigned char c);
00136
00137 #define xisxdigit(c) isxdigit((int) (unsigned char) c)
00138 #define xisdigit(c) isdigit((int) (unsigned char) c)
00139 #define xisalpha(c) isalpha_pl((int) (unsigned char) c)
00140 #define xisalnum(c) isalnum((int) (unsigned char) c)
00141 #define xisspace(c) isspace((int) (unsigned char) c)
00142 #define xtolower(c) tolower((int) (unsigned char) c)
00143 #define xtoupper(c) toupper((int) (unsigned char) c)
00144
00145 struct timer *timer_add(plugin_t *plugin, const char *name, unsigned int period, int persist, int (*function)(int, void *), void *data);
00146 struct timer *timer_add_ms(plugin_t *plugin, const char *name, unsigned int period, int persist, int (*function)(int, void *), void *data);
00147 int timer_remove(plugin_t *plugin, const char *name);
00148 struct timer *timers_removei(struct timer *t);
00149 void timers_destroy();
00150
00151 const char *ekg_status_string(const int status, const int cmd);
00152
00153
00154 void ekg_exit();
00155 void ekg_debug_handler(int level, const char *format, va_list ap);
00156
00157 int ekg_write(int fd, const char *buf, int len);
00158 int remote_request(char *what, ...);
00159
00160 #endif
00161
00162
00163
00164
00165
00166
00167
00168
00169