-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,83 @@ | ||
#ifndef _CLIMBLIB_GRADE_FONT_H_ | ||
#define _CLIMBLIB_GRADE_FONT_H_ | ||
|
||
/** | ||
* @file grade_font.h | ||
* | ||
* @brief Header that defines structures and methods for the Fontainebleau | ||
* grading system. | ||
*/ | ||
|
||
#include <stddef.h> | ||
|
||
/** | ||
* @brief Divisions that granulate difficulty within a grade | ||
*/ | ||
typedef enum { | ||
/** | ||
* @brief The "A" division | ||
*/ | ||
GRADE_FONT_DIVISION_A, | ||
|
||
/** | ||
* @brief The "B" division | ||
*/ | ||
GRADE_FONT_DIVISION_B, | ||
|
||
/** | ||
* @brief The "C" division | ||
*/ | ||
GRADE_FONT_DIVISION_C, | ||
} GradeFontainebleauDivision; | ||
|
||
/** | ||
* @brief Modifier that indicates increased difficulty within a grade | ||
*/ | ||
typedef enum { | ||
/** | ||
* @brief No modifier present | ||
*/ | ||
GRADE_FONT_MODIFIER_NONE, | ||
|
||
/** | ||
* @brief The "+" modifier | ||
*/ | ||
GRADE_FONT_MODIFIER_PLUS, | ||
} GradeFontainebleauModifier; | ||
|
||
/** | ||
* @brief A Fontainebleau grade. | ||
*/ | ||
typedef struct { | ||
/** | ||
* @brief The value of the grade. | ||
*/ | ||
unsigned int grade; | ||
|
||
/** | ||
* @brief The division of the grade. | ||
*/ | ||
GradeFontainebleauDivision division; | ||
|
||
/** | ||
* @brief The modifier of the grade. | ||
*/ | ||
GradeFontainebleauModifier modifier; | ||
} GradeFontainebleau; | ||
|
||
/** | ||
* @brief Compares two @ref GradeFontainebleau instances. | ||
*/ | ||
int GradeFontainebleau_cmp(const GradeFontainebleau, const GradeFontainebleau); | ||
|
||
/** | ||
* @brief Produces a string representing the Fontainebleau grade. | ||
*/ | ||
int GradeFontainebleau_str(const GradeFontainebleau, char *, size_t); | ||
|
||
/** | ||
* @brief Populates a @ref GradeFontainebleau from a representative string. | ||
*/ | ||
int GradeFontainebleau_fromstr(const char *, GradeFontainebleau *); | ||
|
||
#endif |