|
|
|
| Listing 5.2 make_time() | |
|
|
|
|
/* maketime.c
+-------------------------------------------+
| Copyright (C) 1995 by Lance W. Latham. |
| All rights reserved |
+-------------------------------------------+
Builds a TIME_INFO structure from integer inputs.
INPUTS:
1. hours, type int, valid input range of 0 23.
2. minutes, type int, valid input range or 0 59.
3. seconds, type int, valid input range of 0 59.
OUTPUTS:
1. Returned by routine,a TIME_INFO structure, representing the
time of day.
NOTES:
1. This routine can be used for testing functions which use TIME_INFO
inputs, as well as building times after data entry and validation.
2. This routine does not validate the inputs. Use the routine
'validate_time_24' to validate the parts of a TIME_INFO structure
for a 24-hour clock.
3. This routine assumes a 24-hour clock.
*/
#include "scdtl_1.h"
struct TIME_INFO make_time (int hours, int minutes, int seconds)
{
struct TIME_INFO t;
t.hours = hours;
t.minutes = minutes;
t.seconds = seconds;
return (t);
}
|
|
|
|
|
|
|
|