Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4238 → Rev 4239

/trunk/uspace/app/bdsh/input.c
34,6 → 34,8
#include <string.h>
#include <io/stream.h>
#include <console.h>
#include <kbd/kbd.h>
#include <kbd/keycode.h>
 
#include "config.h"
#include "util.h"
96,17 → 98,20
 
static void read_line(char *buffer, int n)
{
char c;
kbd_event_t ev;
int chars;
 
chars = 0;
while (chars < n - 1) {
c = getchar();
if (c < 0)
fflush(stdout);
if (kbd_get_event(&ev) < 0)
return;
if (c == '\n')
if (ev.type == KE_RELEASE)
continue;
 
if (ev.key == KC_ENTER || ev.key == KC_NENTER)
break;
if (c == '\b') {
if (ev.key == KC_BACKSPACE) {
if (chars > 0) {
putchar('\b');
--chars;
113,9 → 118,10
}
continue;
}
if (c >= ' ') {
putchar(c);
buffer[chars++] = c;
if (ev.c >= ' ') {
//putchar(ev.c);
console_putchar(ev.c);
buffer[chars++] = ev.c;
}
}
putchar('\n');
/trunk/uspace/app/tester/print/print4.c
81,6 → 81,8
printf("Arabic: %ls\n", L"التوزيع الجغرافي للحمل العنقودي");
printf("Russian: %ls\n", L"Леннон познакомился с художницей-авангардисткой");
printf("Armenian: %ls\n", L"Սկսեց հրատարակվել Երուսաղեմի հայկական");
 
printf("Test: [%d] '%lc'\n", L'\x0161', L'\x0161');
}
 
printf("[Press a key]\n");
/trunk/uspace/lib/libc/include/console.h
37,6 → 37,7
 
#include <console/style.h>
#include <console/color.h>
#include <sys/types.h>
#include <bool.h>
 
extern void console_open(bool);
47,7 → 48,7
 
extern void console_clear(void);
extern void console_goto(int, int);
extern void console_putchar(int);
extern void console_putchar(wchar_t);
extern ssize_t console_write(const char *buf, size_t nbyte);
extern void console_putstr(const char *s);
extern void console_flush(void);
/trunk/uspace/lib/libc/Makefile.toolchain
26,7 → 26,10
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
 
CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros $(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration\
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32 -finput-charset=UTF-8\
-Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros\
$(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
AFLAGS =
 
/trunk/uspace/lib/libc/generic/console.c
57,7 → 57,7
static char *cbp = cbuffer;
 
static ssize_t cons_write(const char *buf, size_t nbyte);
static void cons_putchar(int c);
static void cons_putchar(wchar_t c);
 
static void cbuffer_flush(void);
static void cbuffer_drain(void);
119,9 → 119,11
async_msg_2(cons_phone, CONSOLE_GOTO, row, col);
}
 
void console_putchar(int c)
void console_putchar(wchar_t c)
{
cbuffer_putc(c);
// cbuffer_putc(c);
cbuffer_flush();
cons_putchar(c);
}
 
/** Write all data from output buffer to the console. */
162,7 → 164,7
}
 
/** Write one character to the console via IPC. */
static void cons_putchar(int c)
static void cons_putchar(wchar_t c)
{
int cons_phone = console_phone_get(true);
async_msg_1(cons_phone, CONSOLE_PUTCHAR, c);
/trunk/uspace/lib/libc/generic/io/io.c
36,6 → 36,8
#include <unistd.h>
#include <stdio.h>
#include <io/io.h>
#include <string.h>
#include <errno.h>
 
const static char nl = '\n';
 
87,10 → 89,16
 
int putchar(int c)
{
unsigned char ch = c;
if (write_stdout((void *) &ch, 1) == 1)
char buf[STR_BOUNDS(1)];
size_t offs;
 
offs = 0;
if (chr_encode(c, buf, &offs, STR_BOUNDS(1)) != EOK)
return EOF;
 
if (write_stdout((void *) buf, offs) == offs)
return c;
 
return EOF;
}
 
/trunk/uspace/srv/kbd/layout/cz.c
37,18 → 37,18
#include <layout.h>
 
static wchar_t map_lcase[] = {
[KC_2] = 'ě',
[KC_3] = 'š',
[KC_4] = 'č',
[KC_5] = 'ř',
[KC_6] = 'ž',
[KC_7] = 'ý',
[KC_8] = 'á',
[KC_9] = 'í',
[KC_0] = 'é',
[KC_2] = L'ě',
[KC_3] = L'š',
[KC_4] = L'č',
[KC_5] = L'ř',
[KC_6] = L'ž',
[KC_7] = L'ý',
[KC_8] = L'á',
[KC_9] = L'í',
[KC_0] = L'é',
 
[KC_LBRACKET] = 'ú',
[KC_SEMICOLON] = 'ů',
[KC_LBRACKET] = L'ú',
[KC_SEMICOLON] = L'ů',
 
[KC_Q] = 'q',
[KC_W] = 'w',
81,18 → 81,18
};
 
static wchar_t map_ucase[] = {
[KC_2] = 'Ě',
[KC_3] = 'Š',
[KC_4] = 'Č',
[KC_5] = 'Ř',
[KC_6] = 'Ž',
[KC_7] = 'Ý',
[KC_8] = 'Á',
[KC_9] = 'Í',
[KC_0] = 'É',
[KC_2] = L'Ě',
[KC_3] = L'Š',
[KC_4] = L'Č',
[KC_5] = L'Ř',
[KC_6] = L'Ž',
[KC_7] = L'Ý',
[KC_8] = L'Á',
[KC_9] = L'Í',
[KC_0] = L'É',
 
[KC_LBRACKET] = 'Ú',
[KC_SEMICOLON] = 'Ů',
[KC_LBRACKET] = L'Ú',
[KC_SEMICOLON] = L'Ů',
 
[KC_Q] = 'Q',
[KC_W] = 'W',
133,7 → 133,7
 
[KC_RBRACKET] = ')',
 
[KC_QUOTE] = '§',
[KC_QUOTE] = L'§',
 
[KC_COMMA] = ',',
[KC_PERIOD] = '.',