-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade_hueco.h
63 lines (52 loc) · 1.12 KB
/
grade_hueco.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
54
55
56
57
58
59
60
61
62
63
#ifndef _CLIMBLIB_GRADE_HUECO_H_
#define _CLIMBLIB_GRADE_HUECO_H_
/**
* @file grade_hueco.h
*
* @brief Header that defines structures and methods for the Hueco grading
* system (V-scale).
*/
#include <stddef.h>
/**
* @brief Modifiers that granulate difficulty within a grade
*/
typedef enum {
/**
* @brief The "-" modifier
*/
GRADE_HUECO_MODIFIER_MINUS,
/**
* @brief No modifier present
*/
GRADE_HUECO_MODIFIER_NONE,
/**
* @brief The "+" modifier
*/
GRADE_HUECO_MODIFIER_PLUS,
} GradeHuecoModifier;
/**
* @brief A Hueco grade.
*/
typedef struct {
/**
* @brief The value of the grade.
*/
unsigned int grade;
/**
* @brief A modifier to refine the grade.
*/
GradeHuecoModifier modifier;
} GradeHueco;
/**
* @brief Compares two @ref GradeHueco instances.
*/
int GradeHueco_cmp(const GradeHueco, const GradeHueco);
/**
* @brief Produces a string representing the Hueco grade.
*/
int GradeHueco_str(const GradeHueco, char *, size_t);
/**
* @brief Populates a @ref GradeHueco from a representative string.
*/
int GradeHueco_fromstr(const char *, GradeHueco *);
#endif