| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Declare all screen position variables as "unsigned", and all buffer
positions as "size_t". We don't need signed values.
|
|
|
|
|
|
|
|
| |
Use memcpy() even when the cursor is at the end. It copies only the
trailing null terminator in this case.
The constant "length" is declared here in preparation for the "wide
character" patches.
|
|
|
|
|
| |
memmove() handles overlapping buffers well, we can use it to get room
for the inserted character.
|
|
|
|
| |
Remove some clutter from wreadln(), isolate some code into a function.
|
|
|
|
|
|
| |
Since the buffer size is already known at compile time, don't do a
second malloc() for it, declare it statically in struct wreadln. This
way, it is going to be allocated on the stack.
|
|
|
|
|
| |
Don't pass a dozen of parameters to all internal functions; pass a
pointer to the wreadln struct instead.
|
|
|
|
|
|
|
| |
Several internal functions calculate the width of the input field by
subtracting "x0" from "x1", although the width is already being passed
to them. Eliminate the parameter "x1" in all functions, and use
"width" instead.
|
|
|
|
|
| |
Convert wrln_max_line_size and wrln_max_history_length to local
constants. They have no real use outside of wreadln.c.
|
|
|
|
|
| |
Don't use "extern" outside of the headers, include the proper header
instead.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
| |
There are no special cases left for my_wgetch() to handle. We can
remove it and use the original wgetch() instead.
|
|
|
|
|
| |
The wide character version of wreadln() is currently a non-functional
mess. Remove it for now, I will reimplement that later.
|
|
|
|
|
| |
Since we are handling SIGWINCH, we do not need to handle KEY_RESIZE
from ncurses. Remove it.
|
|
|
|
| |
Follow the same code style als MPD itself.
|
|
|
|
|
|
| |
my_strlen() is a bad name for the function, since the return value is
not a length, but a visible width on the screen. Rename it to
utf8_width() and change its return type to "unsigned".
|
|
|
|
|
| |
Move everything which deals with UTF-8 strings and character set
conversion to charset.c, header charset.h.
|
|
|
|
| |
Static variables, pointers vs integers, void function returning, ...
|
|
|
|
|
| |
Adding some GNU readline-style binds. These are ^B/^F to move the cursor
back/forward, and ^N/^P to go to the next/previous line.
|
| |
|
|
|
|
|
|
| |
A header should include all headers which he needs. Move local
includes on top, and let foo.c include foo.h in the first line, to
automatically test its dependencies.
|
|
|
|
|
|
| |
Add missing prototypes, and fix wrong prototypes. Convert lots of
functions to "static" when they are only used within the current
source file.
|
|
|
|
|
| |
Convert pointers to const whenever it is possible. Fixes all those
-Wconst warnings.
|
|
|
|
|
|
|
| |
Follow the same code style als MPD itself. This patch only fixes
parts of the code which are going to be touched in the following bunch
of patches, i.e. there will be more "code style" patches in the
future.
|
|
|
|
| |
Also remove some commented code and unused function parameters.
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6817 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@6811 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4741 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4562 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3957 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3858 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1868 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1864 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1858 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1778 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1612 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1566 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
|
|
| |
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1556 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|
|
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1351 09075e82-0dd4-0310-85a5-a0d7c8717e4f
|