-
Notifications
You must be signed in to change notification settings - Fork 0
/
validators.h
53 lines (47 loc) · 1.46 KB
/
validators.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef LIBS_VALIDATORS_H_INCLUDED
#define LIBS_VALIDATORS_H_INCLUDED
/**
* @brief Validates a delay.
*
* This function checks if a provided delay is between the minimum number, and the
* maximum number for a delay in milliseconds.
*
* @param delay The delay to be validated.
*
* @return 1 if the delay is valid, 0 otherwise.
*/
unsigned char validateDelay(const char* delay);
/**
* @brief Validates a generation.
*
* This function checks if a provided generation string is between the minimum number, and the
* maximum number for a generation.
*
* @param generation The generation to be validated.
*
* @return 1 if the generation is valid, 0 otherwise.
*/
unsigned char validateGeneration(const char* generation);
/**
* @brief Validates a pattern.
*
* This function checks if a provided pattern matches `glider`, `toad`, `press`, or
* `glider cannon`. The comparison is case insensitive.
*
* @param userInput The pattern to be validated.
*
* @return 1 if the pattern is valid, 0 otherwise.
*/
unsigned char validatePattern(const char* pattern);
/**
* @brief Validates a platform.
*
* This function checks if a provided platform matches `console`, `simple directmedia layer (sdl)`,
* `simple directmedia layer`, or `sdl`. The comparison is case insensitive.
*
* @param platform The platform to be validated.
*
* @return 1 if the platform is valid, 0 otherwise.
*/
unsigned char validatePlatform(const char* platform);
#endif // LIBS_VALIDATORS_H_INCLUDED