Subversion Repositories svn1

Rev

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

Rev 158 Rev 195
Line 154... Line 154...
154
 
154
 
155
    time = ( ( ( time_t ) hh * 60L ) + ( time_t ) mm ) * 60L + ( time_t ) ss;
155
    time = ( ( ( time_t ) hh * 60L ) + ( time_t ) mm ) * 60L + ( time_t ) ss;
156
    return ( time );
156
    return ( time );
157
}
157
}
158
 
158
 
159
 
-
 
160
/*========================================================================
-
 
161
 *
-
 
162
 *  Read/Edit time from user
-
 
163
 *
-
 
164
 *  Purpose:
-
 
165
 *      This function is called accept a time field from user and allow
-
 
166
 *      the operator to edit the time as it is entered.
-
 
167
 *
-
 
168
 *  Parameters:
-
 
169
 *      tim         - Time to edit
-
 
170
 *
-
 
171
 *  Returns:
-
 
172
 *      Time entered
-
 
173
 *      Will return an illegal time if the entry is not complete
-
 
174
 *
-
 
175
 *========================================================================*/
-
 
176
 
-
 
177
//time_t get_time(time_t utim)
-
 
178
//{
-
 
179
//    char        c;                              /* One of those */
-
 
180
//    int         i = 0;                          /* Counts user input */
-
 
181
//    int         maxi = 0;                       /* Max user input */
-
 
182
//    static char buf[] = "00:00:00";             /* Build up a string here */
-
 
183
//    static char max_digit[] = "29:59:59";       /* Maximum digit's allowed in entry */
-
 
184
//    int         hh = 0, mm = 0, ss = 0;
-
 
185
 
-
 
186
//    /*
-
 
187
//    **  Insert the base time into the edit buffer
-
 
188
//    **  Invalid times are treated as 00:00:00
-
 
189
//    */
-
 
190
//    if ( utim == -1L )
-
 
191
//    {
-
 
192
//        utim = 0;
-
 
193
//    }
-
 
194
    
-
 
195
//    {
-
 
196
//        char * ctime;
-
 
197
//        ctime = time_a(utim);
-
 
198
//        if ( ctime[0] != '*' )
-
 
199
//            memcpy( buf, ctime, sizeof(buf)-1);
-
 
200
//        else
-
 
201
//            memcpy( buf, "00:00:00", sizeof(buf)-1);
-
 
202
//    }
-
 
203
 
-
 
204
//    /*
-
 
205
//    **  Edit the string
-
 
206
//    */
-
 
207
//    while( TRUE )
-
 
208
//    {
-
 
209
//        c = getinp();
-
 
210
//        if( c == ABORT_CHAR )
-
 
211
//        {
-
 
212
//            i = 0;
-
 
213
//            break;
-
 
214
//        }
-
 
215
//        if( c == '\n' || c == '\t' )
-
 
216
//            break;
-
 
217
 
-
 
218
//        if( ( c == rubout ) && i > 0 )           /* rubout character */
-
 
219
//        {
-
 
220
//            i--;
-
 
221
//            if( max_digit[i] == ':' )
-
 
222
//            {
-
 
223
//                printf( "\010:\010" );
-
 
224
//                buf[i--] = ':';
-
 
225
//            }
-
 
226
//            buf[i] = '0';
-
 
227
//            printf( "\010" "0" "\010" );
-
 
228
//        }
-
 
229
 
-
 
230
//        else if ( (c == (char)LEFTARROW)  && i > 0 )
-
 
231
//        {
-
 
232
//            i--;
-
 
233
//            if( max_digit[i] == ':' )
-
 
234
//            {
-
 
235
//                printf( "\010" );
-
 
236
//                buf[i--] = ':';
-
 
237
//            }
-
 
238
//            printf( "\010" );
-
 
239
//        }
-
 
240
 
-
 
241
//        else if ( (c == (char)DELETE_KEY)  && i < 8 )
-
 
242
//        {
-
 
243
//            buf[i]='0';
-
 
244
//            printf( "0" "\010");
-
 
245
//        }
-
 
246
 
-
 
247
//        else if ( (c == (char)RIGHTARROW)  && i < 8 )
-
 
248
//        {
-
 
249
//            printf( "%c", buf[i++] );
-
 
250
//            if( max_digit[i] == ':' )
-
 
251
//            {
-
 
252
//                printf( ":" );
-
 
253
//                buf[i++] = ':';
-
 
254
//            }
-
 
255
//        }
-
 
256
 
-
 
257
//        else if( ( i < 9 ) && isascii( c ) && isdigit( c )
-
 
258
//                 && max_digit[i] >= c )
-
 
259
//        {
-
 
260
//            printf( "%c", c );
-
 
261
//            buf[i++] = c;
-
 
262
//            if( max_digit[i] == ':' )
-
 
263
//            {
-
 
264
//                printf( ":" );
-
 
265
//                buf[i++] = ':';
-
 
266
//            }
-
 
267
//        }
-
 
268
//        else
-
 
269
//        {
-
 
270
//            beep();
-
 
271
//        }
-
 
272
 
-
 
273
//        if ( i > maxi )
-
 
274
//            maxi = i;
-
 
275
//    }
-
 
276
 
-
 
277
//    if( maxi > 0 )
-
 
278
//    {
-
 
279
//        /*
-
 
280
//         * Parse the buffer extracting the required fields
-
 
281
//         */
-
 
282
//        if( sscanf( buf, "%d:%d:%d", &hh, &mm, &ss ) == 3 )
-
 
283
//        {
-
 
284
//            return ( conv_time( hh, mm, ss ) );
-
 
285
//        }
-
 
286
//    }
-
 
287
//    return ( ( time_t ) -1L );
-
 
288
//}
-
 
289
 
-
 
290
/********************************* EOF ***********************************/
159
/********************************* EOF ***********************************/