fix: pr comments

This commit is contained in:
pablo 2026-01-09 11:29:14 +02:00
parent 10b450c043
commit 0359d19e7b
No known key found for this signature in database
GPG Key ID: 78F35FCC60FDC63A
7 changed files with 23 additions and 50 deletions

View File

@ -537,8 +537,8 @@ static void process_input_char(int ch) {
}
break;
case KEY_BACKSPACE:
case 127:
case 8:
case 127: // DEL
case 8: // BS
if (inp->pos > 0) {
memmove(inp->buffer + inp->pos - 1, inp->buffer + inp->pos, inp->len - inp->pos + 1);
inp->pos--;

View File

@ -6,11 +6,11 @@ import chronicles
import chronos
import ffi
import ../../src/chat
import ../../src/chat/proto_types
import ../../src/chat/delivery/waku_client
import ../../src/chat/identity
import ../utils
import src/chat
import src/chat/proto_types
import src/chat/delivery/waku_client
import src/chat/identity
import library/utils
logScope:
topics = "chat ffi client"

View File

@ -7,9 +7,9 @@ import chronos
import ffi
import stew/byteutils
import ../../src/chat
import ../../src/chat/proto_types
import ../utils
import src/chat
import src/chat/proto_types
import library/utils
logScope:
topics = "chat ffi conversation"

View File

@ -7,10 +7,10 @@ import chronos
import ffi
import stew/byteutils
import ../../src/chat
import ../../src/chat/crypto
import ../../src/chat/proto_types
import ../utils
import src/chat
import src/chat/crypto
import src/chat/proto_types
import library/utils
logScope:
topics = "chat ffi identity"

View File

@ -1,5 +1,5 @@
import ffi
import ../src/chat/client
import src/chat/client
declareLibrary("chat")

View File

@ -9,13 +9,13 @@ import chronicles, chronos, ffi
import stew/byteutils
import
../src/chat/client,
../src/chat/conversations,
../src/chat/identity,
../src/chat/delivery/waku_client,
../src/chat/proto_types,
./declare_lib,
./utils
src/chat/client,
src/chat/conversations,
src/chat/identity,
src/chat/delivery/waku_client,
src/chat/proto_types,
library/declare_lib,
library/utils
logScope:
topics = "chat ffi"

View File

@ -1,34 +1,7 @@
## Utility functions for C-bindings
## Provides C-string helpers and JSON event serialization
## Provides JSON event serialization helpers
import std/json
import ffi
# Re-export common FFI types
export ffi
#################################################
# C-String Helpers
#################################################
proc toCString*(s: string): cstring =
## Convert Nim string to C string (caller must manage memory)
result = s.cstring
proc fromCString*(cs: cstring): string =
## Convert C string to Nim string (makes a copy)
if cs.isNil:
result = ""
else:
result = $cs
proc toBytes*(data: ptr byte, len: csize_t): seq[byte] =
## Convert C byte array to Nim seq[byte]
if data.isNil or len == 0:
result = @[]
else:
result = newSeq[byte](len)
copyMem(addr result[0], data, len)
#################################################
# JSON Event Types