Skip to main content

nitro_parse/
routine.rs

1/// The name of the routine that processes metadata
2pub static METADATA_ROUTINE: &str = "meta";
3/// The name of the routine that processes properties
4pub static PROPERTIES_ROUTINE: &str = "properties";
5/// The name of the routine that does installation
6pub static INSTALL_ROUTINE: &str = "install";
7/// The name of the routine that does uninstallation
8pub static UNINSTALL_ROUTINE: &str = "uninstall";
9
10/// The list of reserved routines
11pub static RESERVED_ROUTINES: [&str; 4] = [
12	METADATA_ROUTINE,
13	PROPERTIES_ROUTINE,
14	INSTALL_ROUTINE,
15	UNINSTALL_ROUTINE,
16];
17
18/// Returns if a routine name is reserved for use by Nitrolaunch
19pub fn is_reserved(routine: &str) -> bool {
20	RESERVED_ROUTINES.contains(&routine)
21}
22
23/// Returns if a routine can call other routines
24pub fn can_call_routines(routine: &str) -> bool {
25	routine != METADATA_ROUTINE && routine != PROPERTIES_ROUTINE
26}