Commit 4e9a7268 authored by Deucе's avatar Deucе 👌🏾
Browse files

DeuceSSH: replace POSIX ssize_t with C99 int64_t, add extern "C" guards, cap packet size



- Replace all ssize_t with int64_t across the library, removing the
  POSIX <sys/types.h> dependency.  int64_t is standard C99 and always
  large enough for parse return values (up to 4 + UINT32_MAX).
- Remove the pointless _Static_assert (int64_t > uint32_t is true
  by definition).
- Cap max_packet_size at 64 MiB in transport_init.
- Add #ifdef __cplusplus / extern "C" guards to all 14 public headers.

Co-Authored-By: default avatarClaude Opus 4.6 (1M context) <[email protected]>
parent 658a6672
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,14 @@

#include "portable.h"

#ifdef __cplusplus
extern "C" {
#endif

DEUCE_SSH_PUBLIC int register_none_comp(void);

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ static_assert(0, "threads.h support required");
#include <stdbool.h>
#include <threads.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Error codes returned by library functions.  Zero is success;
 * negative values are errors. */
#define DEUCE_SSH_ERROR_NONE           0
@@ -182,4 +186,8 @@ DEUCE_SSH_PUBLIC void deuce_ssh_session_cleanup(deuce_ssh_session sess);
 */
DEUCE_SSH_PUBLIC int deuce_ssh_transport_set_callbacks(deuce_ssh_transport_io_cb tx, deuce_ssh_transport_io_cb rx, deuce_ssh_transport_rxline_cb rx_line, deuce_ssh_transport_extra_line_cb extra_line_cb);

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,14 @@

#include "portable.h"

#ifdef __cplusplus
extern "C" {
#endif

DEUCE_SSH_PUBLIC int register_aes256_ctr(void);

#ifdef __cplusplus
}
#endif

#endif
+7 −0
Original line number Diff line number Diff line
@@ -3,7 +3,14 @@

#include "portable.h"

#ifdef __cplusplus
extern "C" {
#endif

DEUCE_SSH_PUBLIC int register_none_enc(void);

#ifdef __cplusplus
}
#endif

#endif
+8 −0
Original line number Diff line number Diff line
@@ -3,6 +3,14 @@

#include "portable.h"

#ifdef __cplusplus
extern "C" {
#endif

DEUCE_SSH_PUBLIC int register_curve25519_sha256(void);

#ifdef __cplusplus
}
#endif

#endif
Loading