aboutsummaryrefslogtreecommitdiff
path: root/harness/include
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-02-16 13:29:17 -0700
committerJosh Rahm <rahm@google.com>2024-02-16 13:29:17 -0700
commitc7a0945ffcb5f17953109a6b4ac77a5c64980f4f (patch)
treeb5a4c26127720045a9a0babc9feff0e01304acfb /harness/include
parentf4ed2dd61b53ea45b05f3e8f4ebcce24188d32bd (diff)
downloadmontis-c7a0945ffcb5f17953109a6b4ac77a5c64980f4f.tar.gz
montis-c7a0945ffcb5f17953109a6b4ac77a5c64980f4f.tar.bz2
montis-c7a0945ffcb5f17953109a6b4ac77a5c64980f4f.zip
Added ability to exit the program via a back-interface.
Diffstat (limited to 'harness/include')
-rw-r--r--harness/include/foreign_intf.h2
-rw-r--r--harness/include/plugin.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/harness/include/foreign_intf.h b/harness/include/foreign_intf.h
index fc079e2..e0d178c 100644
--- a/harness/include/foreign_intf.h
+++ b/harness/include/foreign_intf.h
@@ -21,6 +21,8 @@ typedef struct FOREIGN_INTERFACE {
/* Requests the harness hot reload the current plugin. */
EXPORT(void (*do_log)(ctx_t ctx, const char* str));
+ /* Requestes that the whole system exit. Exits with the given return code. */
+ EXPORT(void (*request_exit)(ctx_t ctx, int rc));
} foreign_interface_t;
#undef EXPORT
diff --git a/harness/include/plugin.h b/harness/include/plugin.h
index 1e4a161..145fe52 100644
--- a/harness/include/plugin.h
+++ b/harness/include/plugin.h
@@ -33,7 +33,11 @@ struct PLUGIN;
typedef struct {
int (*action)(struct PLUGIN *requester, void* arg);
void (*arg_dtor)(void* arg);
- void* arg;
+ union {
+ void* ptr_arg;
+ int int_arg;
+ char* str_arg;
+ };
} requested_action_t;
/*