mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
standardize format functions
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
ce5ee8a065
commit
ea42d03ea1
@ -1478,7 +1478,7 @@ int select_question(int count)
|
|||||||
|
|
||||||
/* presents a prompt and gets a Y/N answer */
|
/* presents a prompt and gets a Y/N answer */
|
||||||
__attribute__((format(printf, 2, 0)))
|
__attribute__((format(printf, 2, 0)))
|
||||||
static int question(short preset, char *fmt, va_list args)
|
static int question(short preset, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
char response[32];
|
char response[32];
|
||||||
FILE *stream;
|
FILE *stream;
|
||||||
@ -1496,7 +1496,7 @@ static int question(short preset, char *fmt, va_list args)
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
||||||
fprintf(stream, ":: ");
|
fprintf(stream, ":: ");
|
||||||
vfprintf(stream, fmt, args);
|
vfprintf(stream, format, args);
|
||||||
|
|
||||||
if(preset) {
|
if(preset) {
|
||||||
fprintf(stream, " %s ", _("[Y/n]"));
|
fprintf(stream, " %s ", _("[Y/n]"));
|
||||||
@ -1533,25 +1533,25 @@ static int question(short preset, char *fmt, va_list args)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int yesno(char *fmt, ...)
|
int yesno(const char *format, ...)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, format);
|
||||||
ret = question(1, fmt, args);
|
ret = question(1, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int noyes(char *fmt, ...)
|
int noyes(const char *format, ...)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, format);
|
||||||
ret = question(0, fmt, args);
|
ret = question(0, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -72,9 +72,9 @@ void print_packages(const alpm_list_t *packages);
|
|||||||
void select_display(const alpm_list_t *pkglist);
|
void select_display(const alpm_list_t *pkglist);
|
||||||
int select_question(int count);
|
int select_question(int count);
|
||||||
int multiselect_question(char *array, int count);
|
int multiselect_question(char *array, int count);
|
||||||
int colon_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
int colon_printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
int yesno(char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
int yesno(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
int noyes(char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
int noyes(const char *format, ...) __attribute__((format(printf, 1, 2)));
|
||||||
|
|
||||||
int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3)));
|
int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3)));
|
||||||
int pm_asprintf(char **string, const char *format, ...) __attribute__((format(printf,2,3)));
|
int pm_asprintf(char **string, const char *format, ...) __attribute__((format(printf,2,3)));
|
||||||
|
Loading…
Reference in New Issue
Block a user