diff options
| author | Albert Cervin <albert@acervin.com> | 2024-09-17 08:47:03 +0200 |
|---|---|---|
| committer | Albert Cervin <albert@acervin.com> | 2025-11-01 22:11:14 +0100 |
| commit | 4459b8b3aa9d73895391785a99dcc87134e80601 (patch) | |
| tree | a5204f447a0b2b05f63504c7fe958ef9bbf1918a /src/main/frame-hooks.c | |
| parent | 4689f3f38277bb64981fc960e8e384e2d065d659 (diff) | |
| download | dged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.gz dged-4459b8b3aa9d73895391785a99dcc87134e80601.tar.xz dged-4459b8b3aa9d73895391785a99dcc87134e80601.zip | |
More lsp support
This makes the LSP support complete for now:
- Completion
- Diagnostics
- Goto implementation/declaration
- Rename
- Documentation
- Find references
Diffstat (limited to 'src/main/frame-hooks.c')
| -rw-r--r-- | src/main/frame-hooks.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/frame-hooks.c b/src/main/frame-hooks.c new file mode 100644 index 0000000..ae7bc1e --- /dev/null +++ b/src/main/frame-hooks.c @@ -0,0 +1,27 @@ +#include "frame-hooks.h" + +#include "dged/hook.h" + +HOOK_IMPL_NO_REMOVE(next_frame, next_frame_cb); + +static next_frame_hook_vec g_next_frame_hooks; +static uint32_t g_next_frame_hook_id; + +void init_frame_hooks(void) { VEC_INIT(&g_next_frame_hooks, 16); } + +void teardown_frame_hooks(void) { VEC_DESTROY(&g_next_frame_hooks); } + +void run_next_frame(next_frame_cb callback, void *userdata) { + insert_next_frame_hook(&g_next_frame_hooks, &g_next_frame_hook_id, callback, + userdata); +} + +size_t dispatch_next_frame_hooks() { + size_t nhooks = VEC_SIZE(&g_next_frame_hooks); + if (nhooks > 0) { + dispatch_hook_no_args(&g_next_frame_hooks, struct next_frame_hook); + VEC_CLEAR(&g_next_frame_hooks); + } + + return nhooks; +} |
