diff options
author | Lutz Mueller <lutz@users.sourceforge.net> | 2002-01-15 12:29:46 +0000 |
---|---|---|
committer | Lutz Mueller <lutz@users.sourceforge.net> | 2002-01-15 12:29:46 +0000 |
commit | 603159e7428b1f7bbdab398e7efff531c40e45e3 (patch) | |
tree | f5b615838e55daf8413d8ffe517e86e1d29f71a3 /libgphoto2/gphoto2-context.c | |
parent | d7e780db499e9a362d99d8079055e3e155b53458 (diff) | |
download | libgphoto2-603159e7428b1f7bbdab398e7efff531c40e45e3.tar.gz |
2002-01-15 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
More GPContext changes:
* libgphoto2/gphoto2-context.[c,h]: Add message functionality
* camlibs: Use it.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3886 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-context.c')
-rw-r--r-- | libgphoto2/gphoto2-context.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libgphoto2/gphoto2-context.c b/libgphoto2/gphoto2-context.c index 4bd3fea05..4939c3be9 100644 --- a/libgphoto2/gphoto2-context.c +++ b/libgphoto2/gphoto2-context.c @@ -45,6 +45,9 @@ struct _GPContext GPContextStatusFunc status_func; void *status_func_data; + GPContextMessageFunc message_func; + void *message_func_data; + unsigned int ref_count; }; @@ -204,6 +207,22 @@ gp_context_status (GPContext *context, const char *format, ...) } } +void +gp_context_message (GPContext *context, const char *format, ...) +{ + va_list args; + + if (!context) + return; + + if (context->message_func) { + va_start (args, format); + context->message_func (context, format, args, + context->message_func_data); + va_end (args); + } +} + /** * gp_context_question: * @context: a #GPContext @@ -325,3 +344,14 @@ gp_context_set_cancel_func (GPContext *context, GPContextCancelFunc func, context->cancel_func = func; context->cancel_func_data = data; } + +void +gp_context_set_message_func (GPContext *context, GPContextMessageFunc func, + void *data) +{ + if (!context) + return; + + context->message_func = func; + context->message_func_data = data; +} |