diff options
author | Grigori Goronzy <greg@blackbox> | 2009-07-12 08:01:23 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2009-07-12 08:02:52 +0200 |
commit | 71fc0fbbf34110050bda200d25eb230b8b044324 (patch) | |
tree | 15cc23637cf7a1c461244cfcc3f2c4bf98ab31ca /test | |
parent | d3cd5b0148d64ae0f6e288e69b09acfe639fdcce (diff) | |
download | libass-71fc0fbbf34110050bda200d25eb230b8b044324.tar.bz2 libass-71fc0fbbf34110050bda200d25eb230b8b044324.tar.xz |
Allow passing user data to callback
It is often useful or necessary to pass custom data to a callback.
Add an argument to the callback registering function to pass a void
pointer object to the callback each time it is called.
Diffstat (limited to 'test')
-rw-r--r-- | test/test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.c b/test/test.c index 47b7f29..8c7b602 100644 --- a/test/test.c +++ b/test/test.c @@ -12,7 +12,7 @@ typedef struct image_s { ass_library_t *ass_library; ass_renderer_t *ass_renderer; -void msg_callback(int level, char *fmt, va_list * va) +void msg_callback(int level, char *fmt, va_list * va, void *data) { if (level > 6) return; @@ -81,7 +81,7 @@ static void init(int frame_w, int frame_h) ass_set_fonts_dir(ass_library, ""); ass_set_extract_fonts(ass_library, 0); ass_set_style_overrides(ass_library, NULL); - ass_set_message_cb(ass_library, msg_callback); + ass_set_message_cb(ass_library, msg_callback, NULL); ass_renderer = ass_renderer_init(ass_library); if (!ass_renderer) { |