- Divided the 'Color' tab into three subtabs: Palette, Colors and Pens.
[AROS.git] / arch / all-android / bootstrap / kputc.c
blob6b5dd490822852d67e0225d1ff5bca799da0148a
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <android/log.h>
7 #include <stdarg.h>
8 #include <stdio.h>
10 #include "bootstrap.h"
11 #include "hostlib.h"
13 static int p = 0;
16 * On Android additionally to stderr we output the log to Android's
17 * own buffer. This is better than nothing.
18 * Since Android's debug output is line-oriented, we have to accumulate
19 * the text in the buffer.
22 static void flushLog(void)
24 buf[p] = 0;
25 __android_log_write(ANDROID_LOG_DEBUG, "AROS", buf);
26 p = 0;
29 int KPutC(int chr)
31 int ret;
33 ret = fputc(chr, stderr);
35 if (chr == '\n')
37 fflush(stderr);
38 flushLog();
40 else
42 buf[p++] = chr;
44 if (p == BUFFER_SIZE - 1)
45 flushLog();
48 return ret;