* configure.in: -Wmissing-prototypes -Wmissing-declarations
* camlibs/agfa-cl18/commands.c:
* camlibs/agfa-cl18/usb.c:
* frontends/command-line/foreach.c:
* frontends/command-line/interface.c:
* frontends/command-line/main.c:
* frontends/command-line/options.c:
* frontends/command-line/range.c:
* frontends/command-line/shell.h:
* include/gphoto2-file.h:
* libgphoto2/file.c: First step towards a compilation with -Werror
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2017 67ed7778-7388-44ab-90cf-0a291f65f57c
56 lines
1.0 KiB
C
56 lines
1.0 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include <gphoto2.h>
|
|
|
|
#include "interface.h"
|
|
|
|
extern int glob_stdout;
|
|
extern int glob_quiet;
|
|
|
|
int gp_interface_status (Camera *camera, char *status) {
|
|
|
|
if (glob_quiet)
|
|
return (GP_OK);
|
|
|
|
printf("Status: %s\n", status);
|
|
return (GP_OK);
|
|
}
|
|
|
|
int gp_interface_message (Camera *camera, char *message) {
|
|
|
|
if (glob_quiet)
|
|
return (GP_OK);
|
|
|
|
printf("Message: %s\n", message);
|
|
return (GP_OK);
|
|
}
|
|
|
|
int gp_interface_confirm (Camera *camera, char *message) {
|
|
|
|
char c[1024];
|
|
|
|
if (glob_quiet)
|
|
return (GP_CONFIRM_YES); /* dangerous? */
|
|
|
|
do {
|
|
printf("%s [y/n] ", message);
|
|
fflush(stdout);
|
|
fgets(c, 1023, stdin);
|
|
} while ((c[0]!='y')&&(c[0]!='Y')&&(c[0]!='n')&&(c[0]!='N'));
|
|
|
|
return ( ((c[0]=='y') || (c[0]=='Y'))? GP_CONFIRM_YES: GP_CONFIRM_NO);
|
|
}
|
|
|
|
int gp_interface_progress (Camera *camera, CameraFile *file, float percentage) {
|
|
|
|
if (glob_quiet)
|
|
return GP_OK;
|
|
|
|
if (percentage >= 0) {
|
|
printf("Percent completed: %02.01f\r", percentage);
|
|
fflush(stdout);
|
|
}
|
|
return (GP_OK);
|
|
}
|