From 5e9480f817e08dc0eddaee23321effb24012120d Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Sun, 1 Mar 2026 17:47:44 +0100 Subject: Disable static linking for macos cross-compilation Reformat code like a sane person Signed-off-by: Filip Wandzio --- include/syntax_essentials.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include/syntax_essentials.h') diff --git a/include/syntax_essentials.h b/include/syntax_essentials.h index 181cb99..2327636 100644 --- a/include/syntax_essentials.h +++ b/include/syntax_essentials.h @@ -1,5 +1,19 @@ #pragma once +/** + * + * TASK 0: result codes + * -------------------- + * Idiomatic named return codes instead of raw numbers. + */ +typedef enum { + RESULT_VALID = 0, + RESULT_INVALID_NAME = 1, + RESULT_INVALID_INDEX = 2, + RESULT_ARRAY_FULL = 3, + RESULT_NULL_POINTER = 4 +} Result; + /** * * TASK 1: validate_first_name @@ -70,7 +84,7 @@ typedef struct { * ------------------- * Add a student to an array of Student. Return 0 if added. */ -int add_student(Student *array, int max_size, const char *name, +int add_student(Student *array, int max_length, const char *name, const char *index); /** @@ -78,4 +92,4 @@ int add_student(Student *array, int max_size, const char *name, * ------------------------ * Return error message string for code returned by register_student */ -const char *get_error_message(int code); +const char *get_error_message(int code); \ No newline at end of file -- cgit v1.2.3