2010-06-11 07:09:25 +00:00
|
|
|
/* apk_print.h - Alpine Package Keeper (APK)
|
2010-03-05 08:13:25 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
|
2011-09-13 08:53:01 +00:00
|
|
|
* Copyright (C) 2008-2011 Timo Teräs <timo.teras@iki.fi>
|
2010-03-05 08:13:25 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
* by the Free Software Foundation. See http://www.gnu.org/ for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APK_PRINT_H
|
|
|
|
#define APK_PRINT_H
|
|
|
|
|
|
|
|
#include "apk_blob.h"
|
|
|
|
|
2017-04-10 06:47:22 +00:00
|
|
|
#define apk_error(args...) do { apk_log_err("ERROR: ", args); } while (0)
|
|
|
|
#define apk_warning(args...) do { if (apk_verbosity > 0) { apk_log_err("WARNING: ", args); } } while (0)
|
2010-03-05 08:13:25 +00:00
|
|
|
#define apk_message(args...) do { if (apk_verbosity > 0) { apk_log(NULL, args); } } while (0)
|
|
|
|
|
2013-06-17 13:47:49 +00:00
|
|
|
extern int apk_progress_fd;
|
|
|
|
|
2010-03-05 08:13:25 +00:00
|
|
|
void apk_log(const char *prefix, const char *format, ...);
|
2017-04-10 06:47:22 +00:00
|
|
|
void apk_log_err(const char *prefix, const char *format, ...);
|
2010-03-05 08:13:25 +00:00
|
|
|
const char *apk_error_str(int error);
|
|
|
|
|
2011-07-22 09:08:35 +00:00
|
|
|
void apk_reset_screen_width(void);
|
|
|
|
int apk_get_screen_width(void);
|
2018-10-11 11:39:25 +00:00
|
|
|
const char *apk_get_human_size(off_t size, off_t *dest);
|
2011-09-09 17:06:10 +00:00
|
|
|
|
|
|
|
struct apk_indent {
|
|
|
|
int x;
|
|
|
|
int indent;
|
|
|
|
};
|
|
|
|
|
2013-06-19 08:47:09 +00:00
|
|
|
void apk_print_progress(size_t done, size_t total);
|
2013-06-17 13:47:49 +00:00
|
|
|
int apk_print_indented(struct apk_indent *i, apk_blob_t blob);
|
2010-03-05 08:13:25 +00:00
|
|
|
void apk_print_indented_words(struct apk_indent *i, const char *text);
|
2013-06-13 15:20:39 +00:00
|
|
|
void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...);
|
2010-03-05 08:13:25 +00:00
|
|
|
|
|
|
|
#endif
|