2000-04-26 08:03:38 +00:00
|
|
|
#ifndef __PRINTTEXT_H
|
|
|
|
|
#define __PRINTTEXT_H
|
|
|
|
|
|
2000-11-17 16:27:14 +00:00
|
|
|
#include "fe-windows.h"
|
2001-07-18 19:03:07 +00:00
|
|
|
#include "formats.h"
|
2000-05-15 08:25:45 +00:00
|
|
|
|
2000-10-28 03:01:11 +00:00
|
|
|
void printformat_module(const char *module, void *server, const char *target, int level, int formatnum, ...);
|
2000-05-15 08:25:45 +00:00
|
|
|
void printformat_module_window(const char *module, WINDOW_REC *window, int level, int formatnum, ...);
|
2002-02-04 04:27:45 +00:00
|
|
|
void printformat_module_dest(const char *module, TEXT_DEST_REC *dest, int formatnum, ...);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2000-10-28 03:01:11 +00:00
|
|
|
void printformat_module_args(const char *module, void *server, const char *target, int level, int formatnum, va_list va);
|
2000-05-15 08:25:45 +00:00
|
|
|
void printformat_module_window_args(const char *module, WINDOW_REC *window, int level, int formatnum, va_list va);
|
2002-02-04 04:27:45 +00:00
|
|
|
void printformat_module_dest_args(const char *module, TEXT_DEST_REC *dest, int formatnum, va_list va);
|
2009-01-10 15:00:06 +00:00
|
|
|
void printformat_module_dest_charargs(const char *module, TEXT_DEST_REC *dest, int formatnum, char **arglist);
|
2000-05-15 08:25:45 +00:00
|
|
|
|
2000-10-28 03:01:11 +00:00
|
|
|
void printtext(void *server, const char *target, int level, const char *text, ...);
|
2001-01-05 08:30:01 +00:00
|
|
|
void printtext_string(void *server, const char *target, int level, const char *text);
|
2001-11-25 15:27:47 +00:00
|
|
|
void printtext_string_window(WINDOW_REC *window, int level, const char *text);
|
2000-05-15 08:25:45 +00:00
|
|
|
void printtext_window(WINDOW_REC *window, int level, const char *text, ...);
|
2000-10-28 03:01:11 +00:00
|
|
|
void printtext_multiline(void *server, const char *target, int level, const char *format, const char *text);
|
2001-07-18 19:03:07 +00:00
|
|
|
void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2001-02-03 19:29:38 +00:00
|
|
|
/* only GUI should call these - used for printing text to somewhere else
|
|
|
|
|
than windows */
|
2001-02-21 04:21:15 +00:00
|
|
|
void printtext_gui(const char *text);
|
2014-11-04 12:08:27 +01:00
|
|
|
void printtext_gui_internal(const char *str);
|
2001-02-03 19:29:38 +00:00
|
|
|
void printformat_module_gui(const char *module, int formatnum, ...);
|
|
|
|
|
void printformat_module_gui_args(const char *module, int formatnum, va_list va);
|
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
void printtext_init(void);
|
|
|
|
|
void printtext_deinit(void);
|
|
|
|
|
|
2000-05-15 08:25:45 +00:00
|
|
|
/* printformat(...) = printformat_format(MODULE_NAME, ...)
|
|
|
|
|
|
|
|
|
|
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 */
|
2000-10-28 03:01:11 +00:00
|
|
|
# define printformat(server, target, level, formatnum...) \
|
|
|
|
|
printformat_module(MODULE_NAME, server, target, level, ##formatnum)
|
2000-05-15 08:25:45 +00:00
|
|
|
# define printformat_window(window, level, formatnum...) \
|
|
|
|
|
printformat_module_window(MODULE_NAME, window, level, ##formatnum)
|
2002-02-04 04:27:45 +00:00
|
|
|
# define printformat_dest(dest, formatnum...) \
|
|
|
|
|
printformat_module_dest(MODULE_NAME, dest, ##formatnum)
|
2001-02-03 19:29:38 +00:00
|
|
|
# define printformat_gui(formatnum...) \
|
|
|
|
|
printformat_module_gui(MODULE_NAME, ##formatnum)
|
2000-05-15 08:25:45 +00:00
|
|
|
#elif defined (_ISOC99_SOURCE)
|
|
|
|
|
/* C99 */
|
2000-10-28 03:01:11 +00:00
|
|
|
# define printformat(server, target, level, formatnum, ...) \
|
|
|
|
|
printformat_module(MODULE_NAME, server, target, level, formatnum, __VA_ARGS__)
|
2000-05-15 08:25:45 +00:00
|
|
|
# define printformat_window(window, level, formatnum, ...) \
|
|
|
|
|
printformat_module_window(MODULE_NAME, window, level, formatnum, __VA_ARGS__)
|
2002-02-04 04:27:45 +00:00
|
|
|
# define printformat_dest(dest, formatnum, ...) \
|
|
|
|
|
printformat_module_dest(MODULE_NAME, dest, formatnum, __VA_ARGS__)
|
2001-02-03 19:29:38 +00:00
|
|
|
# define printformat_gui(formatnum, ...) \
|
|
|
|
|
printformat_module_gui(MODULE_NAME, formatnum, __VA_ARGS__)
|
2000-05-15 08:25:45 +00:00
|
|
|
#else
|
|
|
|
|
/* inline/static */
|
|
|
|
|
#ifdef G_CAN_INLINE
|
2000-10-28 20:14:19 +00:00
|
|
|
G_INLINE_FUNC
|
|
|
|
|
#else
|
|
|
|
|
static
|
2000-05-15 08:25:45 +00:00
|
|
|
#endif
|
2000-10-28 03:01:11 +00:00
|
|
|
void printformat(void *server, const char *target, int level, int formatnum, ...)
|
2000-05-15 08:25:45 +00:00
|
|
|
{
|
|
|
|
|
va_list va;
|
|
|
|
|
|
|
|
|
|
va_start(va, formatnum);
|
2000-10-28 03:01:11 +00:00
|
|
|
printformat_module_args(MODULE_NAME, server, target, level, formatnum, va);
|
2000-05-15 08:25:45 +00:00
|
|
|
va_end(va);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef G_CAN_INLINE
|
2000-10-28 20:14:19 +00:00
|
|
|
G_INLINE_FUNC
|
|
|
|
|
#else
|
|
|
|
|
static
|
2000-05-15 08:25:45 +00:00
|
|
|
#endif
|
|
|
|
|
void printformat_window(WINDOW_REC *window, int level, int formatnum, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list va;
|
|
|
|
|
|
|
|
|
|
va_start(va, formatnum);
|
|
|
|
|
printformat_module_window_args(MODULE_NAME, window, level, formatnum, va);
|
|
|
|
|
va_end(va);
|
|
|
|
|
}
|
2001-02-03 19:29:38 +00:00
|
|
|
|
2002-02-04 04:27:45 +00:00
|
|
|
#ifdef G_CAN_INLINE
|
|
|
|
|
G_INLINE_FUNC
|
|
|
|
|
#else
|
|
|
|
|
static
|
|
|
|
|
#endif
|
|
|
|
|
void printformat_dest(TEXT_DEST_REC *dest, int formatnum, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list va;
|
|
|
|
|
|
|
|
|
|
va_start(va, formatnum);
|
|
|
|
|
printformat_module_dest_args(MODULE_NAME, dest, formatnum, va);
|
|
|
|
|
va_end(va);
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-03 19:29:38 +00:00
|
|
|
#ifdef G_CAN_INLINE
|
|
|
|
|
G_INLINE_FUNC
|
|
|
|
|
#else
|
|
|
|
|
static
|
|
|
|
|
#endif
|
|
|
|
|
void printformat_gui(int formatnum, ...)
|
|
|
|
|
{
|
|
|
|
|
va_list va;
|
|
|
|
|
|
|
|
|
|
va_start(va, formatnum);
|
|
|
|
|
printformat_module_gui_args(MODULE_NAME, formatnum, va);
|
|
|
|
|
va_end(va);
|
|
|
|
|
}
|
2000-05-15 08:25:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
#endif
|