libinput Generic way of gathering user commandline input
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m49s

This commit is contained in:
2026-03-20 18:04:26 +01:00
parent 3e44106752
commit bf1e8e8573
22 changed files with 310 additions and 202 deletions

38
libinput/in_gb.h Normal file
View File

@@ -0,0 +1,38 @@
#ifndef _LIBINPUT_INPUT_GAPBUFFER_H
#define _LIBINPUT_INPUT_GAPBUFFER_H
#include <stddef.h>
struct in_gb {
char* buffer;
size_t size;
size_t gap_start;
size_t gap_end;
};
typedef void* (*in_gb_malloc_func_t) (void*, size_t);
typedef void* (*in_gb_realloc_func_t) (void*, void*, size_t, size_t);
typedef void (*in_gb_free_func_t) (void*, void*);
void in_gb_init (in_gb_malloc_func_t mallocfn, void* ctx, struct in_gb* gb, size_t capacity);
void in_gb_fini (in_gb_free_func_t freefn, void* ctx, struct in_gb* gb);
void in_gb_move (struct in_gb* gb, size_t pos);
void in_gb_insert (in_gb_realloc_func_t reallocfn, void* ctx, struct in_gb* gb, char c);
void in_gb_backspace (struct in_gb* gb);
void in_gb_grow (in_gb_realloc_func_t reallocfn, void* ctx, struct in_gb* gb);
size_t in_gb_length (struct in_gb* gb);
char* in_gb_string_at (in_gb_malloc_func_t mallocfn, void* ctx, struct in_gb* gb, size_t pos);
void in_gb_concat (in_gb_realloc_func_t reallocfn, void* ctx, struct in_gb* dest,
struct in_gb* src);
#endif // _LIBINPUT_INPUT_GAPBUFFER_H