* frontends/command-line/interface.c: moved status msgs to stderr * libgphoto2/gphoto2-abilities-list.c: don't scan USB for ID 0, better (?) error handling and reporting * libgphoto2_port/libgphoto2_port/gphoto2-port.c: removed report about param that is only passed on * libgphoto2_port/usb/libusb.c: improved error reporting * packaging/usbcam.console: improved chown/chmod handling (race condition removed) * packaging/rpm/package.spec.in: begun support for automatic file lists git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2831 67ed7778-7388-44ab-90cf-0a291f65f57c
49 lines
806 B
C
49 lines
806 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <gphoto2.h>
|
|
|
|
#include "interface.h"
|
|
|
|
extern int glob_stdout;
|
|
extern int glob_quiet;
|
|
|
|
void
|
|
status_func (Camera *camera, const char *status, void *data)
|
|
{
|
|
if (glob_quiet)
|
|
return;
|
|
|
|
if (*status) {
|
|
fprintf (stderr, "Status: %s\n", status);
|
|
fflush(stdout);
|
|
} else {
|
|
/*
|
|
* This is still not very clever -
|
|
* if you know any better, step forward.
|
|
*/
|
|
fprintf (stderr, "Status: OK (i.e. \"\")\n");
|
|
}
|
|
}
|
|
|
|
void
|
|
message_func (Camera *camera, const char *message, void *data)
|
|
{
|
|
if (glob_quiet)
|
|
return;
|
|
|
|
printf ("Message: %s\n", message);
|
|
}
|
|
|
|
void
|
|
progress_func (Camera *camera, float percentage, void *data)
|
|
{
|
|
if (glob_quiet)
|
|
return;
|
|
|
|
if (percentage > 0.) {
|
|
printf ("Percent completed: %02.01f\r", percentage * 100.);
|
|
fflush(stdout);
|
|
}
|
|
}
|