Mercurial > flash_v2
comparison packages/language/c/libc/time/current/include/timeutil.h @ 115:6ed91473a1cd ecos-sw-2000-08-21
Merge from eCos master repository on 2000-08-21-22:40:54-BST
| author | jlarmour |
|---|---|
| date | Fri, 25 Aug 2000 17:32:38 +0000 |
| parents | |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 114:5ad2b71d525e | 115:6ed91473a1cd |
|---|---|
| 1 #ifndef CYGONCE_LIBC_TIME_TIMEUTIL_H | |
| 2 #define CYGONCE_LIBC_TIME_TIMEUTIL_H | |
| 3 //======================================================================== | |
| 4 // | |
| 5 // timeutil.h | |
| 6 // | |
| 7 // ISO C date and time implementation support functions | |
| 8 // | |
| 9 //======================================================================== | |
| 10 //####COPYRIGHTBEGIN#### | |
| 11 // | |
| 12 // ------------------------------------------- | |
| 13 // The contents of this file are subject to the Red Hat eCos Public License | |
| 14 // Version 1.1 (the "License"); you may not use this file except in | |
| 15 // compliance with the License. You may obtain a copy of the License at | |
| 16 // http://www.redhat.com/ | |
| 17 // | |
| 18 // Software distributed under the License is distributed on an "AS IS" | |
| 19 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 20 // License for the specific language governing rights and limitations under | |
| 21 // the License. | |
| 22 // | |
| 23 // The Original Code is eCos - Embedded Configurable Operating System, | |
| 24 // released September 30, 1998. | |
| 25 // | |
| 26 // The Initial Developer of the Original Code is Red Hat. | |
| 27 // Portions created by Red Hat are | |
| 28 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | |
| 29 // All Rights Reserved. | |
| 30 // ------------------------------------------- | |
| 31 // | |
| 32 //####COPYRIGHTEND#### | |
| 33 //======================================================================== | |
| 34 //#####DESCRIPTIONBEGIN#### | |
| 35 // | |
| 36 // Author(s): jlarmour | |
| 37 // Contributors: jlarmour | |
| 38 // Date: 1999-03-03 | |
| 39 // Purpose: Provide declarations for support functions used by the | |
| 40 // ISO C date and time implementation | |
| 41 // Description: | |
| 42 // Usage: #include <cyg/libc/time/timeutil.h> | |
| 43 // | |
| 44 //####DESCRIPTIONEND#### | |
| 45 // | |
| 46 //======================================================================== | |
| 47 | |
| 48 // INCLUDES | |
| 49 | |
| 50 #include <cyg/infra/cyg_type.h> // Common type definitions and support | |
| 51 | |
| 52 #ifdef __cplusplus | |
| 53 extern "C" { | |
| 54 #endif | |
| 55 | |
| 56 // GLOBALS | |
| 57 | |
| 58 // Strings of the days and month names | |
| 59 // FIXME: should comment out "const" in multi-dimensional arrays until | |
| 60 // PR 19440 is fixed | |
| 61 extern const char cyg_libc_time_day_name[7][10]; | |
| 62 extern const cyg_uint8 cyg_libc_time_day_name_len[7]; | |
| 63 extern const char cyg_libc_time_month_name[12][10]; | |
| 64 extern const cyg_uint8 cyg_libc_time_month_name_len[12]; | |
| 65 | |
| 66 // number of days in each month, defined for normal and leap years | |
| 67 extern const cyg_uint8 cyg_libc_time_month_lengths[2][12]; | |
| 68 | |
| 69 | |
| 70 // FUNCTION PROTOTYPES | |
| 71 | |
| 72 //////////////////////////////////////// | |
| 73 // cyg_libc_time_normalize_structtm() // | |
| 74 //////////////////////////////////////// | |
| 75 // | |
| 76 // cyg_libc_time_normalize_structtm() will adjust the fields of a struct tm | |
| 77 // so that they are within the normal ranges expected. | |
| 78 // tm_wday, tm_yday, and tm_isdst are ignored | |
| 79 | |
| 80 extern void | |
| 81 cyg_libc_time_normalize_structtm( struct tm *__timeptr ); | |
| 82 | |
| 83 ////////////////////////// | |
| 84 // cyg_libc_time_itoa() // | |
| 85 ////////////////////////// | |
| 86 // | |
| 87 // This converts num to a string and puts it into s padding with | |
| 88 // "0"'s if padzero is set, or spaces otherwise if necessary. | |
| 89 // The number of chars written to s is returned | |
| 90 // | |
| 91 | |
| 92 extern cyg_uint8 | |
| 93 cyg_libc_time_itoa( cyg_uint8 *__s, cyg_int32 __num, cyg_uint8 __width, | |
| 94 cyg_bool __padzero ); | |
| 95 | |
| 96 #ifdef __cplusplus | |
| 97 } // extern "C" | |
| 98 #endif | |
| 99 | |
| 100 #endif // CYGONCE_LIBC_TIME_TIMEUTIL_H multiple inclusion protection | |
| 101 | |
| 102 // EOF timeutil.h |
