From 8eb4689ab1c6fbe1af66293b33c92f4f8dd2cb6c Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 25 Mar 2022 10:28:35 -0400 Subject: add way to lock portion of plugin buffer for TSR plugins Some things in core that should probably be plugins steal the plugin buffer for their own use, TSR plugins have no way to detect or prevent this lock buffer reserves buffer_size bytes directly after the plugin itself returns the unreserved bytes still available from the plugin buffer Change-Id: I5a7849e209129b09400036a594569ef396b1b85f --- apps/plugin.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index de1077c9b4..2e0ace2e48 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -49,6 +49,7 @@ char* strncpy(char *, const char *, size_t); void* plugin_get_buffer(size_t *buffer_size); +size_t plugin_reserve_buffer(size_t buffer_size); int plugin_open(const char *plugin, const char *parameter); #ifndef __PCTOOL__ @@ -935,6 +936,7 @@ struct plugin_api { void (*onplay_show_playlist_menu)(const char* path, void (*playlist_insert_cb)); void (*queue_remove_from_head)(struct event_queue *q, long id); int (*core_set_keyremap)(struct button_mapping* core_keymap, int count); + size_t (*plugin_reserve_buffer)(size_t buffer_size); }; /* plugin header */ -- cgit v1.2.3