2 * RGB2R-C128-Kassenprogramm
3 * © 2007-2009 phil_fry, sECuRE, sur5r
4 * See LICENSE for license information
15 * Liest (maximal 31) Zeichen ein, bis Enter gedrückt wird.
16 * Vorsicht: Es wird ein statischer Buffer benutzt, sodass man
17 * das Ergebnis via strdup() retten muss, bevor man get_input()
24 static char output[32];
27 memset(output, '\0', 32);
36 /* If you are at the left-most position, do nothing */
50 char retry_or_quit() {
53 cprintf("\r\nr)etry or q)uit?\r\n");
55 } while ((*c != 'r') && (*c != 'q'));
59 char *format_euro(char *s, int maxlen, int cent){
61 int len = strlen(",EUR");
62 while ((tmp /= 10) > 0)
66 // workaround to produce a leading zero for cents.. %0.2d won't work
67 sprintf(s, "%3d,%s%dEUR", cent / 100, ((cent%100)<10?"0":""), cent % 100);
71 void c128_perror(BYTE c, char *msg) {
72 cprintf("\r\nError (Code %d) while: %s\r\nOS Error = %d\r\n", c, msg, _oserror);