Subversion Repositories svn1

Rev

Rev 383 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 383 Rev 384
Line 53... Line 53...
53
 *  Returns:
53
 *  Returns:
54
 *      Address of an internal buffer that holds the ascii time
54
 *      Address of an internal buffer that holds the ascii time
55
 *
55
 *
56
 *========================================================================*/
56
 *========================================================================*/
57
 
57
 
58
char       *time_a( time_t tim )
58
char       *time_a( maraTime_t tim )
59
{
59
{
60
    static char buf[] = "00:00:00";              /* Hold return string here */
60
    static char buf[] = "00:00:00";              /* Hold return string here */
61
    static char invalid[] = "** ** **";          /* Invalid string */
61
    static char invalid[] = "** ** **";          /* Invalid string */
62
 
62
 
63
    time_t      hours, mins, secs;
63
    maraTime_t      hours, mins, secs;
64
 
64
 
65
    if( tim >= 0 && tim < 359999L )
65
    if( tim >= 0 && tim < 359999L )
66
    {
66
    {
67
        hours = tim / 3600L;                     /* Calc the hours */
67
        hours = tim / 3600L;                     /* Calc the hours */
68
        tim -= hours * 3600L;                    /* secs left */
68
        tim -= hours * 3600L;                    /* secs left */
Line 101... Line 101...
101
 *  Returns:
101
 *  Returns:
102
 *      Address of an internal buffer that holds the ascii time
102
 *      Address of an internal buffer that holds the ascii time
103
 *
103
 *
104
 *========================================================================*/
104
 *========================================================================*/
105
 
105
 
106
char       *time_fa( time_t tim, char flag )
106
char       *time_fa( maraTime_t tim, char flag )
107
{
107
{
108
    static char buf1[] = "00:00:00";             /* Hold return string here */
108
    static char buf1[] = "00:00:00";             /* Hold return string here */
109
    static char finvalid[] = "** ** **";         /* Invalid string */
109
    static char finvalid[] = "** ** **";         /* Invalid string */
110
    static char tinvalid[] = "-- -- --";
110
    static char tinvalid[] = "-- -- --";
111
    time_t      hours, mins, secs;
111
    maraTime_t      hours, mins, secs;
112
 
112
 
113
    if( tim >= 0 && tim < 359999L )
113
    if( tim >= 0 && tim < 359999L )
114
    {
114
    {
115
        hours = tim / 3600L;                     /* Calc the hours */
115
        hours = tim / 3600L;                     /* Calc the hours */
116
        tim -= hours * 3600L;                    /* secs left */
116
        tim -= hours * 3600L;                    /* secs left */
Line 146... Line 146...
146
 *  Returns:
146
 *  Returns:
147
 *      Time
147
 *      Time
148
 *
148
 *
149
 *========================================================================*/
149
 *========================================================================*/
150
 
150
 
151
time_t conv_time( int hh, int mm, int ss )
151
maraTime_t conv_time( int hh, int mm, int ss )
152
{
152
{
153
    time_t      time;                            /* The final result */
153
    maraTime_t      time;                            /* The final result */
154
 
154
 
155
    time = ( ( ( time_t ) hh * 60L ) + ( time_t ) mm ) * 60L + ( time_t ) ss;
155
    time = ( ( ( maraTime_t ) hh * 60L ) + ( maraTime_t ) mm ) * 60L + ( maraTime_t ) ss;
156
    return ( time );
156
    return ( time );
157
}
157
}
158
 
158
 
159
/********************************* EOF ***********************************/
159
/********************************* EOF ***********************************/