summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-context.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@users.sourceforge.net>2002-01-10 23:06:56 +0000
committerLutz Mueller <lutz@users.sourceforge.net>2002-01-10 23:06:56 +0000
commit0dedb0e1639c480e93fb1b1bc88a681a92492740 (patch)
tree284d72379a31ce09610ed2f76a34259e41d830f7 /libgphoto2/gphoto2-context.c
parent232f43bcb5acde993c540be4f3035532199ffd59 (diff)
downloadlibgphoto2-0dedb0e1639c480e93fb1b1bc88a681a92492740.tar.gz
2002-01-10 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/gphoto2-filesys.[c,h]: Add a GPContext to all functions that potentially access the camera. This makes cancelling of all operations possible and improves error reporting. * tests/test-filesys.c: * libgphoto2/gphoto2-camera.c: * camlibs: Adjust to reflect above changes git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3798 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-context.c')
-rw-r--r--libgphoto2/gphoto2-context.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libgphoto2/gphoto2-context.c b/libgphoto2/gphoto2-context.c
index 6d23b9742..06ddf642d 100644
--- a/libgphoto2/gphoto2-context.c
+++ b/libgphoto2/gphoto2-context.c
@@ -120,6 +120,9 @@ gp_context_unref (GPContext *context)
void
gp_context_idle (GPContext *context)
{
+ if (!context)
+ return;
+
if (context->idle_func)
context->idle_func (context, context->idle_func_data);
}
@@ -127,6 +130,9 @@ gp_context_idle (GPContext *context)
void
gp_context_progress (GPContext *context, float percentage)
{
+ if (!context)
+ return;
+
if (context->progress_func)
context->progress_func (context, percentage,
context->progress_func_data);
@@ -137,6 +143,9 @@ gp_context_error (GPContext *context, const char *format, ...)
{
va_list args;
+ if (!context)
+ return;
+
if (context->error_func) {
va_start (args, format);
context->error_func (context, format, args,
@@ -150,6 +159,9 @@ gp_context_status (GPContext *context, const char *format, ...)
{
va_list args;
+ if (!context)
+ return;
+
if (context->status_func) {
va_start (args, format);
context->status_func (context, format, args,
@@ -174,6 +186,9 @@ gp_context_question (GPContext *context, const char *format, ...)
GPContextFeedback feedback;
va_list args;
+ if (!context)
+ return (GP_CONTEXT_FEEDBACK_OK);
+
if (context->question_func) {
va_start (args, format);
feedback = context->question_func (context, format, args,