Commit graph

7 commits

Author SHA1 Message Date
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation

in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base

Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-14 23:56:16 -05:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
Thomas Martitz
046cec3aa7 Android: Partly revert r29569 and only call the new getJavaEnvironment() when needed.
The environment is fine to share in general, just not across OS threads, so it's only needed
for functions which are possibly called from multiple OS threads (only 1 currently).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29601 a1c6a512-1295-4272-9138-f99709370657
2011-03-16 14:33:55 +00:00
Maurus Cuelenaere
c2ee32b22a Partly revert "Android: use NewGlobalRef for references that are used globally"
The added complexity wasn't needed for most subsystems, as main() never returns
so local references can't be freed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29570 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 19:23:00 +00:00
Maurus Cuelenaere
66f2a08f8a Android: Don't share the JNI environment across threads, but obtain it the
correct way

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29569 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 18:34:35 +00:00
Maurus Cuelenaere
2e5b7aebde Android: use NewGlobalRef for references that are used globally
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29568 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 18:34:31 +00:00
Maurus Cuelenaere
d833e78fac RaaA: move Android apps-code to separate dir under apps/hosted
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29563 a1c6a512-1295-4272-9138-f99709370657
2011-03-11 15:45:44 +00:00
Renamed from apps/hosted/keyboard.c (Browse further)