Cleaned up printtext.c, split part of it to formats.c

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@796 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-28 20:14:19 +00:00 committed by cras
commit 4dcbe05c0f
46 changed files with 733 additions and 632 deletions

View file

@ -3,21 +3,6 @@
#include "windows.h"
enum {
FORMAT_STRING,
FORMAT_INT,
FORMAT_LONG,
FORMAT_FLOAT
};
typedef struct {
char *tag;
char *def;
int params;
int paramtypes[10];
} FORMAT_REC;
#define PRINTFLAG_BOLD 0x01
#define PRINTFLAG_REVERSE 0x02
#define PRINTFLAG_UNDERLINE 0x04
@ -26,10 +11,6 @@ typedef struct {
#define PRINTFLAG_MIRC_COLOR 0x20
#define PRINTFLAG_INDENT 0x40
char *output_format_get_text(const char *module, WINDOW_REC *window,
void *server, const char *target,
int formatnum, ...);
void printformat_module(const char *module, void *server, const char *target, int level, int formatnum, ...);
void printformat_module_window(const char *module, WINDOW_REC *window, int level, int formatnum, ...);
@ -67,9 +48,10 @@ void printtext_deinit(void);
printformat_module_window(MODULE_NAME, window, level, formatnum, __VA_ARGS__)
#else
/* inline/static */
static
#ifdef G_CAN_INLINE
inline
G_INLINE_FUNC
#else
static
#endif
void printformat(void *server, const char *target, int level, int formatnum, ...)
{
@ -80,9 +62,10 @@ void printformat(void *server, const char *target, int level, int formatnum, ...
va_end(va);
}
static
#ifdef G_CAN_INLINE
inline
G_INLINE_FUNC
#else
static
#endif
void printformat_window(WINDOW_REC *window, int level, int formatnum, ...)
{
@ -94,18 +77,4 @@ void printformat_window(WINDOW_REC *window, int level, int formatnum, ...)
}
#endif
/* semi-private functions.. */
typedef struct {
WINDOW_REC *window;
void *server;
const char *target;
int level;
} TEXT_DEST_REC;
char *output_format_text_args(TEXT_DEST_REC *dest, FORMAT_REC *format,
const char *text, va_list va);
/* return the "-!- " text at the start of the line */
char *get_line_start_text(TEXT_DEST_REC *dest);
#endif