apk_print.h 1.03 KB
Newer Older
1
/* apk_print.h - Alpine Package Keeper (APK)
Natanael Copa's avatar
Natanael Copa committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * Copyright (C) 2005-2008 Natanael Copa <n@tanael.org>
 * Copyright (C) 2008 Timo Teräs <timo.teras@iki.fi>
 * 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"

#define apk_error(args...)	do { apk_log("ERROR: ", args); } while (0)
#define apk_warning(args...)	do { if (apk_verbosity > 0) { apk_log("WARNING: ", args); } } while (0)
#define apk_message(args...)	do { if (apk_verbosity > 0) { apk_log(NULL, args); } } while (0)

void apk_log(const char *prefix, const char *format, ...);
const char *apk_error_str(int error);

Timo Teräs's avatar
Timo Teräs committed
24 25
void apk_reset_screen_width(void);
int apk_get_screen_width(void);
Natanael Copa's avatar
Natanael Copa committed
26 27 28 29
int apk_print_indented(struct apk_indent *i, apk_blob_t blob);
void apk_print_indented_words(struct apk_indent *i, const char *text);

#endif