mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
client/server: simplify setup packet handling
Instead of writing (and logging errors for) every parameter, one at a time, send all fixed size data in a single struct, followed by all the variable length data.
This commit is contained in:
parent
3640164917
commit
fc81f413c0
4 changed files with 127 additions and 178 deletions
31
client-protocol.h
Normal file
31
client-protocol.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct client_argv {
|
||||
uint16_t len;
|
||||
/* char arg[static len]; */
|
||||
};
|
||||
|
||||
struct client_data {
|
||||
uint8_t maximized:1;
|
||||
uint8_t fullscreen:1;
|
||||
uint8_t hold:1;
|
||||
uint8_t login_shell:1;
|
||||
|
||||
uint16_t cwd_len;
|
||||
uint16_t term_len;
|
||||
uint16_t title_len;
|
||||
uint16_t app_id_len;
|
||||
|
||||
uint16_t argc;
|
||||
|
||||
/* char cwd[stati cwd_len]; */
|
||||
/* char term[static term_len]; */
|
||||
/* char title[static title_len]; */
|
||||
/* char app_id[static app_id_len]; */
|
||||
|
||||
/* struct client_argv argv[static argc]; */
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue