summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-context.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@users.sourceforge.net>2002-01-15 12:29:46 +0000
committerLutz Mueller <lutz@users.sourceforge.net>2002-01-15 12:29:46 +0000
commit603159e7428b1f7bbdab398e7efff531c40e45e3 (patch)
treef5b615838e55daf8413d8ffe517e86e1d29f71a3 /libgphoto2/gphoto2-context.c
parentd7e780db499e9a362d99d8079055e3e155b53458 (diff)
downloadlibgphoto2-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.c30
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;
+}