mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
- Compiling fixes
- GNOME version isn't anymore build here so you don't need all that GTK and GNOME crap to compile irssi-text. - Some fixes to compile with -ansi -pedantic git-svn-id: http://svn.irssi.org/repos/irssi/trunk@200 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
90ff30fcd0
commit
93d6032151
34 changed files with 524 additions and 535 deletions
|
|
@ -66,3 +66,5 @@ enum {
|
|||
|
||||
extern FORMAT_REC fecommon_core_formats[];
|
||||
#define MODULE_FORMATS fecommon_core_formats
|
||||
|
||||
#include "printformat.h"
|
||||
|
|
|
|||
25
src/fe-common/core/printformat.h
Normal file
25
src/fe-common/core/printformat.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* printformat(...) = printformat_format(module_formats, ...)
|
||||
|
||||
Could this be any harder? :) With GNU C compiler and C99 compilers,
|
||||
use #define. With others use either inline functions if they are
|
||||
supported or static functions if they are not..
|
||||
*/
|
||||
#if defined (__GNUC__) && !defined (__STRICT_ANSI__)
|
||||
/* GCC */
|
||||
# define printformat(server, channel, level, formatnum...) \
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, ##formatnum)
|
||||
#elif defined (_ISOC99_SOURCE)
|
||||
/* C99 */
|
||||
# define printformat(server, channel, level, formatnum, ...) \
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, formatnum, __VA_ARGS__)
|
||||
#else
|
||||
/* inline/static */
|
||||
static
|
||||
#ifdef G_CAN_INLINE
|
||||
inline
|
||||
#endif
|
||||
void printformat(void *server, const char *channel, int level, int formatnum, ...)
|
||||
{
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, formatnum);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -24,32 +24,6 @@ typedef struct {
|
|||
#define PRINTFLAG_MIRC_COLOR 0x20
|
||||
#define PRINTFLAG_INDENT 0x40
|
||||
|
||||
/* printformat(...) = printformat_format(module_formats, ...)
|
||||
|
||||
Could this be any harder? :) With GNU C compiler and C99 compilers,
|
||||
use #define. With others use either inline functions if they are
|
||||
supported or static functions if they are not..
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
/* GCC */
|
||||
# define printformat(server, channel, level, formatnum...) \
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, ##formatnum)
|
||||
#elif defined (_ISOC99_SOURCE)
|
||||
/* C99 */
|
||||
# define printformat(server, channel, level, formatnum, ...) \
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, formatnum, __VA_ARGS__)
|
||||
#else
|
||||
/* inline/static */
|
||||
#ifdef G_CAN_INLINE
|
||||
inline
|
||||
#else
|
||||
static
|
||||
#endif
|
||||
void printformat(void *server, const char *channel, int level, int formatnum, ...)
|
||||
{
|
||||
printformat_format(MODULE_FORMATS, server, channel, level, ##formatnum);
|
||||
}
|
||||
#endif
|
||||
void printformat_format(FORMAT_REC *formats, void *server, const char *channel, int level, int formatnum, ...);
|
||||
|
||||
void printtext(void *server, const char *channel, int level, const char *str, ...);
|
||||
|
|
|
|||
|
|
@ -181,6 +181,17 @@ void window_set_level(WINDOW_REC *window, int level)
|
|||
signal_emit("window level changed", 1, window);
|
||||
}
|
||||
|
||||
/* return active item's name, or if none is active, window's name */
|
||||
char *window_get_active_name(WINDOW_REC *window)
|
||||
{
|
||||
g_return_val_if_fail(window != NULL, NULL);
|
||||
|
||||
if (window->active != NULL)
|
||||
return window->active->name;
|
||||
|
||||
return window->name;
|
||||
}
|
||||
|
||||
WINDOW_REC *window_find_level(void *server, int level)
|
||||
{
|
||||
WINDOW_REC *match;
|
||||
|
|
|
|||
|
|
@ -58,8 +58,11 @@ void window_change_server(WINDOW_REC *window, void *server);
|
|||
|
||||
void window_set_refnum(WINDOW_REC *window, int refnum);
|
||||
void window_set_name(WINDOW_REC *window, const char *name);
|
||||
|
||||
void window_set_level(WINDOW_REC *window, int level);
|
||||
|
||||
/* return active item's name, or if none is active, window's name */
|
||||
char *window_get_active_name(WINDOW_REC *window);
|
||||
|
||||
WINDOW_REC *window_find_level(void *server, int level);
|
||||
WINDOW_REC *window_find_closest(void *server, const char *name, int level);
|
||||
WINDOW_REC *window_find_refnum(int refnum);
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@ enum {
|
|||
IRCTXT_DCC_CONNECT_ERROR,
|
||||
IRCTXT_DCC_CANT_CREATE,
|
||||
IRCTXT_DCC_REJECTED,
|
||||
IRCTXT_DCC_CLOSE,
|
||||
IRCTXT_DCC_CLOSE
|
||||
};
|
||||
|
||||
extern FORMAT_REC fecommon_irc_dcc_formats[];
|
||||
#define MODULE_FORMATS fecommon_irc_dcc_formats
|
||||
|
||||
#include "printformat.h"
|
||||
|
|
|
|||
|
|
@ -47,17 +47,17 @@ static void ctcp_print(const char *pre, const char *data, IRC_SERVER_REC *server
|
|||
|
||||
static void ctcp_default_msg(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
|
||||
{
|
||||
return ctcp_print("unknown CTCP", data, server, nick, addr, target);
|
||||
ctcp_print("unknown CTCP", data, server, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_ping_msg(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
|
||||
{
|
||||
return ctcp_print("CTCP PING", data, server, nick, addr, target);
|
||||
ctcp_print("CTCP PING", data, server, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_version_msg(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
|
||||
{
|
||||
return ctcp_print("CTCP VERSION", data, server, nick, addr, target);
|
||||
ctcp_print("CTCP VERSION", data, server, nick, addr, target);
|
||||
}
|
||||
|
||||
static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target)
|
||||
|
|
|
|||
|
|
@ -11,3 +11,5 @@ enum {
|
|||
|
||||
extern FORMAT_REC fecommon_irc_flood_formats[];
|
||||
#define MODULE_FORMATS fecommon_irc_flood_formats
|
||||
|
||||
#include "printformat.h"
|
||||
|
|
|
|||
|
|
@ -162,3 +162,5 @@ enum {
|
|||
|
||||
extern FORMAT_REC fecommon_irc_formats[];
|
||||
#define MODULE_FORMATS fecommon_irc_formats
|
||||
|
||||
#include "printformat.h"
|
||||
|
|
|
|||
|
|
@ -17,3 +17,5 @@ enum {
|
|||
|
||||
extern FORMAT_REC fecommon_irc_notifylist_formats[];
|
||||
#define MODULE_FORMATS fecommon_irc_notifylist_formats
|
||||
|
||||
#include "printformat.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue