diff options
author | Xavier G <xavier.github@kindwolf.org> | 2016-05-13 03:51:48 +0200 |
---|---|---|
committer | Xavier G <xavier.github@kindwolf.org> | 2016-05-13 03:51:48 +0200 |
commit | f1b5b515b9f91866d241ba6dbf5e1db6827ff61a (patch) | |
tree | 5db0b3b88c2ed973c4c384ba9ea7efaf65b35601 | |
parent | 97a4ee78fd08e58fce62c6c0b22de94b625c90f6 (diff) | |
download | irssi-f1b5b515b9f91866d241ba6dbf5e1db6827ff61a.zip |
Make get_alignment() available outside special-vars.c
-rw-r--r-- | src/core/special-vars.c | 6 | ||||
-rw-r--r-- | src/core/special-vars.h | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c index 64011b8e..fe6bbed2 100644 --- a/src/core/special-vars.c +++ b/src/core/special-vars.c @@ -27,10 +27,6 @@ #include "misc.h" #include "utf8.h" -#define ALIGN_RIGHT 0x01 -#define ALIGN_CUT 0x02 -#define ALIGN_PAD 0x04 - #define isvarchar(c) \ (i_isalnum(c) || (c) == '_') @@ -317,7 +313,7 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad) } /* return the aligned text */ -static char *get_alignment(const char *text, int align, int flags, char pad) +char *get_alignment(const char *text, int align, int flags, char pad) { GString *str; char *ret; diff --git a/src/core/special-vars.h b/src/core/special-vars.h index 11262dad..300dae0e 100644 --- a/src/core/special-vars.h +++ b/src/core/special-vars.h @@ -9,9 +9,16 @@ #define PARSE_FLAG_ESCAPE_THEME 0x08 /* if any arguments/variables contain { or } chars, escape them with % */ #define PARSE_FLAG_ONLY_ARGS 0x10 /* expand only arguments ($0 $1 etc.) but no other $variables */ +#define ALIGN_RIGHT 0x01 +#define ALIGN_CUT 0x02 +#define ALIGN_PAD 0x04 + typedef char* (*SPECIAL_HISTORY_FUNC) (const char *text, void *item, int *free_ret); +/* Cut and/or pad text so it takes exactly "align" characters on the screen */ +char *get_alignment(const char *text, int align, int flags, char pad); + /* Parse and expand text after '$' character. return value has to be g_free()'d if `free_ret' is TRUE. */ char *parse_special(char **cmd, SERVER_REC *server, void *item, |