-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsentinel_boot.c
More file actions
37 lines (29 loc) · 900 Bytes
/
sentinel_boot.c
File metadata and controls
37 lines (29 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
sentinel_boot.c
PURPOSE:
Implementation of the Sentinel boot engine.
*/
#include "sentinel_boot.h"
SenStatus sentinel_boot_system(SentinelBoot* boot, const char* repo_root) {
if (!boot || !repo_root) return SEN_STATUS_ERROR_INVALID_ARGUMENT;
SenStatus st;
/* Initialize navigation engine */
st = sentinel_boot(&boot->ctx, repo_root);
if (st != SEN_STATUS_OK) return st;
/* Activate robot navigation protocol */
st = sentinel_robot_protocol_activate(&boot->ctx);
if (st != SEN_STATUS_OK) {
sentinel_shutdown(&boot->ctx);
return st;
}
boot->ready = SEN_TRUE;
return SEN_STATUS_OK;
}
void sentinel_shutdown_system(SentinelBoot* boot) {
if (!boot) return;
if (boot->ready) {
sentinel_robot_protocol_shutdown(&boot->ctx);
sentinel_shutdown(&boot->ctx);
boot->ready = SEN_FALSE;
}
}