* examples * gphoto2 * libgphoto2 * libgphoto2_port The code (at least in this part of the project) is effectively formated using tabs with a tab-size of 8 as a means for indentation. There have been a few places where spaces were introduced. Some obviously with an indent size of 8 in mind, others with an indent size of 4. This commit tries its best to make the use of tabs consistent again, at least for indenting lines. The "intra line" indentation (white space after the first non-white-space character) is still a bit of a mess. Co-authored-by: axxel <awagger@web.de>
38 lines
961 B
C
38 lines
961 B
C
#include <stdio.h>
|
|
#include "samples.h"
|
|
|
|
static void
|
|
ctx_error_func (GPContext *context, const char *str, void *data)
|
|
{
|
|
fprintf (stderr, "\n*** Contexterror *** \n%s\n",str);
|
|
fflush (stderr);
|
|
}
|
|
|
|
static void
|
|
ctx_status_func (GPContext *context, const char *str, void *data)
|
|
{
|
|
fprintf (stderr, "%s\n", str);
|
|
fflush (stderr);
|
|
}
|
|
|
|
GPContext* sample_create_context() {
|
|
GPContext *context;
|
|
|
|
/* This is the mandatory part */
|
|
context = gp_context_new();
|
|
|
|
/* All the parts below are optional! */
|
|
gp_context_set_error_func (context, ctx_error_func, NULL);
|
|
gp_context_set_status_func (context, ctx_status_func, NULL);
|
|
|
|
/* also:
|
|
gp_context_set_cancel_func (p->context, ctx_cancel_func, p);
|
|
gp_context_set_message_func (p->context, ctx_message_func, p);
|
|
if (isatty (STDOUT_FILENO))
|
|
gp_context_set_progress_funcs (p->context,
|
|
ctx_progress_start_func, ctx_progress_update_func,
|
|
ctx_progress_stop_func, p);
|
|
*/
|
|
return context;
|
|
}
|