|
time 1.0
Time validation library
|
#include "validate.h"
Functions | |
| RETURN_Data_Status | validate_time (const FORMAT_Time *time) |
| Validates a FORMAT_Time instance for proper hour, minute, and second ranges. | |
| RETURN_Data_Status | validate_date (const FORMAT_Date *date) |
| Validates a FORMAT_Date instance for basic day, month, and year ranges. | |
| RETURN_Data_Status | validate_datetime (const FORMAT_DateTime *datetime) |
| Validates a FORMAT_DateTime instance by checking its date and time components. | |
| RETURN_Data_Status validate_date | ( | const FORMAT_Date * | date | ) |
Validates a FORMAT_Date instance for basic day, month, and year ranges.
| date | Pointer to a FORMAT_Date structure whose fields will be checked:
|
This function performs a simple, range-based validation on the provided date structure. It checks only the maximum values for day, month, and year, and does not account for month-specific day counts or leap years. For stricter calendar validation, additional checks must be applied by the caller or a higher-level routine.

| RETURN_Data_Status validate_datetime | ( | const FORMAT_DateTime * | datetime | ) |
Validates a FORMAT_DateTime instance by checking its date and time components.
| datetime | Pointer to a FORMAT_DateTime structure whose date and time substructures will be validated using validate_date() and validate_time(). |
This function delegates validation to validate_time() for the time portion and validate_date() for the date portion of datetime. The individual results are bitwise OR-combined into a single RETURN_Data_Status value, allowing callers to treat any invalid subcomponent as an overall invalid date-time.

| RETURN_Data_Status validate_time | ( | const FORMAT_Time * | time | ) |
Validates a FORMAT_Time instance for proper hour, minute, and second ranges.
| time | Pointer to a FORMAT_Time structure whose fields will be checked:
|
This function performs a simple range validation on the provided time structure. If hour, minute, or second exceed their respective limits, the function reports an invalid status; otherwise, it reports a valid time.
