diff options
author | pommicket <pommicket@gmail.com> | 2025-09-15 22:00:24 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-15 22:00:24 -0400 |
commit | 2fc802b267092ad647672bcbfcd31f0117eec27c (patch) | |
tree | 9b45ae643adfba9e23e761599d5d8240f6ed3180 /errors.c | |
parent | b93385c0fded8d6c232267a8bd9293153baea777 (diff) |
Switch back to `pom_error` for typed get functions
Diffstat (limited to 'errors.c')
-rw-r--r-- | errors.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -18,6 +18,11 @@ enum error_id { ERROR_EMPTY_KEY, ERROR_REDEFINITION, ERROR_NO_CLOSING_QUOTE, + ERROR_KEY_NOT_FOUND, + ERROR_INVALID_INT, + ERROR_INVALID_UINT, + ERROR_INVALID_FLOAT, + ERROR_INVALID_BOOL, ERROR_COUNT, }; @@ -39,6 +44,11 @@ static const char *const error_messages_en[ERROR_COUNT] = { [ERROR_EMPTY_KEY] = "Expected key name before =", [ERROR_REDEFINITION] = "Re-definition of %s (previously defined on line %" PRIu64 ")", [ERROR_NO_CLOSING_QUOTE] = "Missing closing %c", + [ERROR_KEY_NOT_FOUND] = "Key %s not found", + [ERROR_INVALID_INT] = "Value '%s' for %s is not a valid integer", + [ERROR_INVALID_UINT] = "Value '%s' for %s is not a valid (non-negative) integer", + [ERROR_INVALID_FLOAT] = "Value '%s' for %s is not a valid number", + [ERROR_INVALID_BOOL] = "Value '%s' for %s is invalid (want on/off/yes/no/true/false)", }; @@ -60,6 +70,11 @@ static const char *const error_messages_fr[ERROR_COUNT] = { [ERROR_EMPTY_KEY] = "Nom de clé devrait précéder =", [ERROR_REDEFINITION] = "Redéfinition de %s (définition précédente à ligne %" PRIu64 ")", [ERROR_NO_CLOSING_QUOTE] = "Aucun %c fermant", + [ERROR_KEY_NOT_FOUND] = "Clé %s n'existe pas", + [ERROR_INVALID_INT] = "Valeur '%s' du clé %s n'est pas un nombre entier", + [ERROR_INVALID_UINT] = "Valeur '%s' du clé %s n'est pas un nombre entier (positif)", + [ERROR_INVALID_FLOAT] = "Valeur '%s' du clé %s n'est pas un nombre valide", + [ERROR_INVALID_BOOL] = "Valeur '%s' du clé %s est invalide (veut on/off/yes/no/true/false)", }; static struct { |