diff options
author | Grigori Goronzy <greg@blackbox> | 2009-07-11 02:18:51 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-11 02:22:18 +0200 |
commit | 2c412cdab94a7bb27c5a1e04ab902295215de888 (patch) | |
tree | c1372ebf5e6473b287e152a40c88587f3470d237 /libass/ass_utils.h | |
parent | 613a22ab9b96453c10de6d75b43067652ad6d7db (diff) | |
download | libass-2c412cdab94a7bb27c5a1e04ab902295215de888.tar.bz2 libass-2c412cdab94a7bb27c5a1e04ab902295215de888.tar.xz |
Message callback funtionality
Introduce functionality for providing a message callback that is used
for passing messages to the controlling application instead of simply
printing them to standard output. The function pointer to the callback
is stored in the ass_library_t instance. ass_msg needs access to it, so
in many places the library instance needs to be passed around now.
The default behavior is the old one: messages of MSGL_INFO or lower
are printed to the standard output, prefixed with "[ass]".
Diffstat (limited to 'libass/ass_utils.h')
-rw-r--r-- | libass/ass_utils.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libass/ass_utils.h b/libass/ass_utils.h index efcf8834..a906ca57 100644 --- a/libass/ass_utils.h +++ b/libass/ass_utils.h @@ -32,6 +32,8 @@ #include <enca.h> #endif +#include "ass.h" + #define MSGL_FATAL 0 #define MSGL_ERR 1 #define MSGL_WARN 2 @@ -46,12 +48,15 @@ int mystrtoi(char **p, int *res); int mystrtoll(char **p, long long *res); int mystrtou32(char **p, int base, uint32_t *res); int mystrtod(char **p, double *res); -int strtocolor(char **q, uint32_t *res); +int strtocolor(ass_library_t *library, char **q, uint32_t *res); char parse_bool(char *str); unsigned ass_utf8_get_char(char **str); -void ass_msg(int lvl, char *fmt, ...); -void *ass_guess_buffer_cp(unsigned char *buffer, int buflen, - char *preferred_language, char *fallback); +void ass_msg(ass_library_t *priv, int lvl, char *fmt, ...); +#ifdef CONFIG_ENCA +void *ass_guess_buffer_cp(ass_library_t *library, unsigned char *buffer, + int buflen, char *preferred_language, + char *fallback); +#endif static inline int d6_to_int(int x) { |