aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-08-05 15:26:36 +0200
committerdec05eba <dec05eba@protonmail.com>2026-08-05 15:26:36 +0200
commit3a1ce0e17f209702095aaa86fedeb74400b3d039 (patch)
treed16516e0876361da09c4ff6f05be5f190d0891a1 /include
parentf17157274d02ddf88af7af95ad6353b231983f5a (diff)
ipc: save-replay: add restart-replay option
Diffstat (limited to 'include')
-rw-r--r--include/cli/ipc.h7
-rw-r--r--include/recorder/recorder.h11
2 files changed, 14 insertions, 4 deletions
diff --git a/include/cli/ipc.h b/include/cli/ipc.h
index 6008db9..0c4c076 100644
--- a/include/cli/ipc.h
+++ b/include/cli/ipc.h
@@ -28,8 +28,11 @@ typedef struct {
bool (*toggle_replay_recording)(char *error_message, size_t error_message_size, void *userdata);
bool (*start_replay_recording)(char *error_message, size_t error_message_size, void *userdata);
bool (*stop_replay_recording)(char *error_message, size_t error_message_size, void *userdata);
- /* |seconds| is GSR_SAVE_REPLAY_SECONDS_FULL when the whole replay buffer should be saved */
- bool (*save_replay)(int seconds, char *error_message, size_t error_message_size, void *userdata);
+ /*
+ |seconds| is GSR_SAVE_REPLAY_SECONDS_FULL when the whole replay buffer should be saved.
+ |restart_replay| overrides the -restart-replay-on-save option for this save when |has_restart_replay| is set.
+ */
+ bool (*save_replay)(int seconds, bool has_restart_replay, bool restart_replay, char *error_message, size_t error_message_size, void *userdata);
void *userdata;
} gsr_ipc_handlers;
diff --git a/include/recorder/recorder.h b/include/recorder/recorder.h
index 887b4fe..5721a98 100644
--- a/include/recorder/recorder.h
+++ b/include/recorder/recorder.h
@@ -55,7 +55,14 @@ void gsr_recorder_start_replay_recording(gsr_recorder *self);
/* Does nothing when no recording is running */
void gsr_recorder_stop_replay_recording(gsr_recorder *self);
bool gsr_recorder_is_replay_recording(const gsr_recorder *self);
-/* |seconds| can be GSR_SAVE_REPLAY_SECONDS_FULL to save the whole replay buffer */
-void gsr_recorder_save_replay(gsr_recorder *self, int seconds);
+#define GSR_RESTART_REPLAY_USE_OPTION -1
+#define GSR_RESTART_REPLAY_DISABLE 0
+#define GSR_RESTART_REPLAY_ENABLE 1
+
+/*
+ |seconds| can be GSR_SAVE_REPLAY_SECONDS_FULL to save the whole replay buffer.
+ |restart_replay| overrides the -restart-replay-on-save option for this save when it's not GSR_RESTART_REPLAY_USE_OPTION.
+*/
+void gsr_recorder_save_replay(gsr_recorder *self, int seconds, int restart_replay);
#endif /* GSR_RECORDER_RECORDER_H */