GPStatus() { #ifdef HAVE_GPHOTO2 context = gp_context_new(); cancel = false; gp_context_set_cancel_func(context, cancel_func, 0); #ifdef GPHOTO2_DEBUG gp_context_set_progress_funcs(context, start_func, update_func, stop_func, 0); gp_context_set_error_func(context, error_func, 0); gp_context_set_status_func(context, status_func, 0); #endif /* GPHOTO2_DEBUG */ #endif /* HAVE_GPHOTO2 */ }
void gp_glue_context_set_progress_funcs (GPGlueContext *gluecontext, GPGlueContextProgressStartFunc start_func, GPGlueContextProgressUpdateFunc update_func, GPGlueContextProgressStopFunc stop_func, void *data) { gluecontext->start_func = start_func; gluecontext->update_func = update_func; gluecontext->stop_func = stop_func; gluecontext->progress_data = data; gp_context_set_progress_funcs (gluecontext->context, gp_glue_start_func_wrapper, gp_glue_update_func_wrapper, gp_glue_stop_func_wrapper, gluecontext); }
void gp_params_init (GPParams *p, char **envp) { if (!p) return; memset (p, 0, sizeof (GPParams)); p->folder = strdup ("/"); if (!p->folder) { fprintf (stderr, _("Not enough memory.")); fputc ('\n', stderr); exit (1); } gp_camera_new (&p->camera); p->cols = 79; p->flags = FLAGS_RECURSE; /* Create a context. Report progress only if users will see it. */ p->context = gp_context_new (); gp_context_set_cancel_func (p->context, ctx_cancel_func, p); gp_context_set_error_func (p->context, ctx_error_func, p); gp_context_set_status_func (p->context, ctx_status_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); p->_abilities_list = NULL; p->debug_func_id = -1; p->envp = envp; }