rename/merge functions to match rust side more

This commit is contained in:
Vinzenz Schroeter 2025-04-12 17:38:19 +02:00
parent bbe4000468
commit 63dfecdbf5
7 changed files with 165 additions and 280 deletions

View file

@ -63,11 +63,19 @@ out/example_unstripped: dependencies main.c
$(CCFLAGS) \
-o out/example_unstripped
out/example: out/example_unstripped
strip -s -R .comment -R .gnu.version --strip-unneeded out/example_unstripped -o out/example
#strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag
strip -s --strip-unneeded \
-R .comment -R .gnu.version -R .comment -R .note -R .note.gnu.build-id -R .note.ABI-tag \
out/example_unstripped \
-o out/example
dependencies: FORCE
mkdir -p include || true
# generate servicepoint header and binary to link against
${CARGO} rustc $(CARGOFLAGS) -- $(RUSTFLAGS)
analyze-size: out/example_unstripped
nm --print-size --size-sort --reverse-sort --radix=d --demangle out/example_unstripped \
| awk '{size=$$2+0; print size "\t" $$4}' \
| less
FORCE: ;

View file

@ -2,7 +2,7 @@
#include "servicepoint.h"
int main(void) {
UdpConnection *connection = sp_connection_open_ipv4(127,0,0,1,2342);
UdpConnection *connection = sp_udp_open_ipv4(127, 0, 0, 1, 2342);
if (connection == NULL)
return 1;
@ -12,17 +12,17 @@ int main(void) {
sp_bitmap_fill(pixels, true);
TypedCommand *command = sp_command_bitmap_linear_win(0, 0, pixels, COMPRESSION_CODE_UNCOMPRESSED);
TypedCommand *command = sp_command_bitmap(0, 0, pixels, COMPRESSION_CODE_UNCOMPRESSED);
if (command == NULL)
return 1;
Packet *packet = sp_packet_from_command(command);
Header *header = sp_packet_get_header(packet);
printf("[%d, %d, %d, %d, %d]\n", header->command_code, header->a, header->b, header->c, header->d);
//printf("[%d, %d, %d, %d, %d]\n", header->command_code, header->a, header->b, header->c, header->d);
sp_connection_send_packet(connection, packet);
sp_udp_send_packet(connection, packet);
sp_connection_free(connection);
sp_udp_free(connection);
return 0;
}