亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? time.inl

?? ecos下的gui開發源代碼
?? INL
?? 第 1 頁 / 共 2 頁
字號:
#ifndef CYGONCE_LIBC_TIME_INL
#define CYGONCE_LIBC_TIME_INL
//===========================================================================
//
//      time.inl
//
//      Inline implementations of date and time routines from <time.h>
//
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================
//#####DESCRIPTIONBEGIN####
//
// Author(s):    jlarmour
// Contributors: 
// Date:         1999-02-25
// Purpose:      Provide inline implementations for some of the date and time
//               routines declared in <time.h> for ISO C section 7.12 and
//               POSIX 1003.1 8.3.4-8.3.7
// Description: 
// Usage:        Do not include this file directly. Instead include <time.h>
//
//####DESCRIPTIONEND####
//
//===========================================================================

// CONFIGURATION

#include <pkgconf/libc_time.h>          // C library configuration

// INCLUDES

#include <cyg/infra/cyg_type.h>    // Common type definitions and support
#include <time.h>                  // Header for this file
#include <cyg/infra/cyg_ass.h>     // Assertion infrastructure
#include <cyg/infra/cyg_trac.h>    // Tracing infrastructure

// DEFINES

// The following are overriden by the libc implementation to get a non-inline
// version to prevent duplication of code

#ifndef CYGPRI_LIBC_TIME_ASCTIME_R_INLINE
# define CYGPRI_LIBC_TIME_ASCTIME_R_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_CTIME_R_INLINE
# define CYGPRI_LIBC_TIME_CTIME_R_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_GMTIME_R_INLINE
# define CYGPRI_LIBC_TIME_GMTIME_R_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_LOCALTIME_R_INLINE
# define CYGPRI_LIBC_TIME_LOCALTIME_R_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_DIFFTIME_INLINE
# define CYGPRI_LIBC_TIME_DIFFTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_MKTIME_INLINE
# define CYGPRI_LIBC_TIME_MKTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_ASCTIME_INLINE
# define CYGPRI_LIBC_TIME_ASCTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_CTIME_INLINE
# define CYGPRI_LIBC_TIME_CTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_GMTIME_INLINE
# define CYGPRI_LIBC_TIME_GMTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_LOCALTIME_INLINE
# define CYGPRI_LIBC_TIME_LOCALTIME_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_GETZONEOFFSETS_INLINE
# define CYGPRI_LIBC_TIME_GETZONEOFFSETS_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_SETZONEOFFSETS_INLINE
# define CYGPRI_LIBC_TIME_SETZONEOFFSETS_INLINE extern __inline__
#endif

#ifndef CYGPRI_LIBC_TIME_SETDST_INLINE
# define CYGPRI_LIBC_TIME_SETDST_INLINE extern __inline__
#endif

#define CYGNUM_LIBC_TIME_EPOCH_WDAY       4  // Jan 1st 1970 was a Thursday

#ifdef __cplusplus
extern "C" {
#endif

// EXTERNS

// These are used in the dst access functions below. Do not access these
// directly - use the functions declared in time.h instead

extern Cyg_libc_time_dst cyg_libc_time_current_dst_stat;
extern time_t cyg_libc_time_current_std_offset;
extern time_t cyg_libc_time_current_dst_offset;

// INLINE FUNCTIONS

//===========================================================================
//
// Utility functions

//////////////////////////////////
// cyg_libc_time_year_is_leap() //
//////////////////////////////////
//
// This returns true if the year is a leap year.
// The argument is of type int in line with struct tm
//

static __inline__ cyg_bool
cyg_libc_time_year_is_leap( int __year )
{
    cyg_bool _leap=false;

    if (!(__year % 400))
        _leap = true;
    else if (!(__year % 4) && (__year % 100))
        _leap = true;
    return _leap;
} // cyg_libc_time_year_is_leap()


////////////////////////////////////
// cyg_libc_time_getzoneoffsets() //
////////////////////////////////////
//
// This function retrieves the current state of the Daylight Savings Time
// and the offsets of both STD and DST
// The offsets are both in time_t's i.e. seconds
//

CYGPRI_LIBC_TIME_GETZONEOFFSETS_INLINE Cyg_libc_time_dst
cyg_libc_time_getzoneoffsets( time_t *__stdoffset, time_t *__dstoffset )
{
    CYG_REPORT_FUNCNAMETYPE("cyg_libc_time_getzoneoffsets",
                            "returning DST state %d");
    CYG_REPORT_FUNCARG2("__stdoffset is at address %08x, "
                        "__dstoffset is at %08x", __stdoffset, __dstoffset);

    CYG_CHECK_DATA_PTR(__stdoffset, "__stdoffset is not a valid pointer!");
    CYG_CHECK_DATA_PTR(__dstoffset, "__dstoffset is not a valid pointer!");

    *__stdoffset = cyg_libc_time_current_std_offset;
    *__dstoffset = cyg_libc_time_current_dst_offset;

    CYG_REPORT_RETVAL(cyg_libc_time_current_dst_stat);

    return cyg_libc_time_current_dst_stat;
} // cyg_libc_time_getzoneoffsets()


////////////////////////////////////
// cyg_libc_time_setzoneoffsets() //
////////////////////////////////////
//
// This function sets the offsets used when Daylight Savings Time is enabled
// or disabled. The offsets are in time_t's i.e. seconds
//

CYGPRI_LIBC_TIME_SETZONEOFFSETS_INLINE void
cyg_libc_time_setzoneoffsets( time_t __stdoffset, time_t __dstoffset )
{
    CYG_REPORT_FUNCNAME("cyg_libc_time_setzoneoffsets");
    CYG_REPORT_FUNCARG2DV(__stdoffset, __dstoffset);

    cyg_libc_time_current_std_offset = __stdoffset;
    cyg_libc_time_current_dst_offset = __dstoffset;

    CYG_REPORT_RETURN();
} // cyg_libc_time_setzoneoffsets()


////////////////////////////
// cyg_libc_time_setdst() //
////////////////////////////
//
// This function sets the state of Daylight Savings Time: on, off, or unknown
//

CYGPRI_LIBC_TIME_SETDST_INLINE void
cyg_libc_time_setdst( Cyg_libc_time_dst __state )
{
    CYG_REPORT_FUNCNAME("cyg_libc_time_setdst");
    CYG_REPORT_FUNCARG1("__state=%d", __state);

    cyg_libc_time_current_dst_stat = __state;

    CYG_REPORT_RETURN();
} // cyg_libc_time_setdst()



//===========================================================================
//
// POSIX 1003.1 functions

/////////////////////////////////
// asctime_r() - POSIX.1 8.3.4 //
/////////////////////////////////
//
// This returns a textual representation of a struct tm, and writes
// the string to return into __buf
//

#ifdef CYGFUN_LIBC_TIME_POSIX
# define __asctime_r asctime_r
#else
// prototype internal function
__externC char *
__asctime_r( const struct tm *__timeptr, char *__buf );
#endif

#ifdef CYGIMP_LIBC_TIME_ASCTIME_R_INLINE

#include <cyg/libc/time/timeutil.h> // for cyg_libc_time_{day,month}_name
                                    // and cyg_libc_time_itoa()
#include <string.h>                 // for memcpy()

CYGPRI_LIBC_TIME_ASCTIME_R_INLINE char *
__asctime_r( const struct tm *__timeptr, char *__buf )
{
    cyg_ucount8 __i;
    
    // These initializers are [4] since C++ dictates you _must_ leave space
    // for the trailing '\0', even though ISO C says you don't need to!

    CYG_REPORT_FUNCNAMETYPE("asctime_r", "returning \"%s\"");
    CYG_REPORT_FUNCARG2("__timeptr = %08x, __buf = %08x", __timeptr, __buf);

    // paranoia - most of these aren't required but could be helpful to
    // a programmer debugging their own app.
    CYG_CHECK_DATA_PTR(__timeptr, "__timeptr is not a valid pointer!");
    CYG_CHECK_DATA_PTR(__buf, "__buf is not a valid pointer!");

    CYG_PRECONDITION((__timeptr->tm_sec >= 0) && (__timeptr->tm_sec < 62),
                     "__timeptr->tm_sec out of range!");
    CYG_PRECONDITION((__timeptr->tm_min >= 0) && (__timeptr->tm_min < 60),
                     "__timeptr->tm_min out of range!");
    CYG_PRECONDITION((__timeptr->tm_hour >= 0) && (__timeptr->tm_hour < 24),
                     "__timeptr->tm_hour out of range!");
    // Currently I don't check _actual_ numbers of days in each month here
    // FIXME: No reason why not though
    CYG_PRECONDITION((__timeptr->tm_mday >= 1) && (__timeptr->tm_mday < 32),
                     "__timeptr->tm_mday out of range!");
    CYG_PRECONDITION((__timeptr->tm_mon >= 0) && (__timeptr->tm_mon < 12),
                     "__timeptr->tm_mon out of range!");
    CYG_PRECONDITION((__timeptr->tm_wday >= 0) && (__timeptr->tm_wday < 7),
                     "__timeptr->tm_wday out of range!");
    CYG_PRECONDITION((__timeptr->tm_yday >= 0) && (__timeptr->tm_yday < 366),
                     "__timeptr->tm_yday out of range!");
    CYG_PRECONDITION((__timeptr->tm_year > -1900) &&
                     (__timeptr->tm_year < 8100),
                     "__timeptr->tm_year out of range!");
    
    // we can't use strftime because ISO C is stupid enough not to allow
    // the strings in asctime() to be localized. Duh.

    // day of the week
    memcpy(&__buf[0], cyg_libc_time_day_name[__timeptr->tm_wday], 3);
    __buf[3] = ' ';

    // month
    memcpy(&__buf[4], cyg_libc_time_month_name[__timeptr->tm_mon], 3);
    __buf[7] = ' ';

    __i = 8;

    // day of the month
    __i += cyg_libc_time_itoa( (cyg_uint8 *)&__buf[__i], __timeptr->tm_mday, 2,
                               true);
    __buf[__i++] = ' ';

    // hour
    __i += cyg_libc_time_itoa( (cyg_uint8 *)&__buf[__i], __timeptr->tm_hour, 2,
                               true);
    __buf[__i++] = ':';

    // minute
    __i += cyg_libc_time_itoa( (cyg_uint8 *)&__buf[__i], __timeptr->tm_min, 2,
                               true);
    __buf[__i++] = ':';

    // second
    __i += cyg_libc_time_itoa((cyg_uint8 *) &__buf[__i], __timeptr->tm_sec, 2,
                              true);
    __buf[__i++] = ' ';

    // year
    __i += cyg_libc_time_itoa( (cyg_uint8 *)&__buf[__i],
                               1900+__timeptr->tm_year, 0, true);
    
    __buf[__i++] = '\n';
    __buf[__i++] = '\0';

    CYG_REPORT_RETVAL(__buf);
    return __buf;
} // asctime_r()

#endif // ifdef CYGIMP_LIBC_TIME_ASCTIME_R_INLINE

////////////////////////////////
// gmtime_r() - POSIX.1 8.3.6 //
////////////////////////////////
//
// This converts a time_t into a struct tm expressed in UTC, and stores
// the result in the space occupied by __result
//

#ifdef CYGFUN_LIBC_TIME_POSIX
# define __gmtime_r gmtime_r
#else
// prototype internal function
__externC struct tm *
__gmtime_r( const time_t *__timer, struct tm *__result );
#endif

#ifdef CYGIMP_LIBC_TIME_GMTIME_R_INLINE

#include <cyg/libc/time/timeutil.h>   // for cyg_libc_time_month_lengths

CYGPRI_LIBC_TIME_GMTIME_R_INLINE struct tm *
__gmtime_r( const time_t *__timer, struct tm *__result )
{
    time_t _tim;
    const cyg_uint8 *_months_p;

    CYG_REPORT_FUNCNAMETYPE("gmtime_r", "returning %08x");
    CYG_CHECK_DATA_PTR(__timer, "__timer is not a valid pointer!");
    CYG_CHECK_DATA_PTR(__result, "__result is not a valid pointer!");
    CYG_REPORT_FUNCARG2("*__timer=%d, __result is at %08x",
                        *__timer, __result);

#define CYGNUM_LIBC_TIME_SECSPERDAY       (60*60*24)
#define CYGNUM_LIBC_TIME_SECSPERYEAR      (CYGNUM_LIBC_TIME_SECSPERDAY * 365)
#define CYGNUM_LIBC_TIME_SECSPERLEAPYEAR  (CYGNUM_LIBC_TIME_SECSPERDAY * 366)

    _tim = *__timer;

    // First, work out year. Start off with 1970 and work forwards or backwards
    // depending on the sign of _tim
    __result->tm_year = 70;

    // we also work out the day of the week of the start of the year as we
    // go along
    __result->tm_wday = CYGNUM_LIBC_TIME_EPOCH_WDAY;

    while (_tim < 0) {
        // Work backwards

        --__result->tm_year;

        // Check for a leap year.
        if (cyg_libc_time_year_is_leap(1900 + __result->tm_year)) {
            _tim += CYGNUM_LIBC_TIME_SECSPERLEAPYEAR; 
            __result->tm_wday -= 366;
        } // if
        else {
            _tim += CYGNUM_LIBC_TIME_SECSPERYEAR;
            __result->tm_wday -= 365;
        } // else

    } // while

    while (_tim >= CYGNUM_LIBC_TIME_SECSPERYEAR) {
        // Work forwards

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久久久久久久| 亚洲欧美色图小说| 欧美色视频在线| 99re热视频这里只精品| 成人影视亚洲图片在线| 成人免费视频免费观看| 99麻豆久久久国产精品免费优播| 国产v日产∨综合v精品视频| 成人天堂资源www在线| 成人免费毛片片v| 99热99精品| 欧美曰成人黄网| 欧美日韩极品在线观看一区| 91精品久久久久久久99蜜桃| 欧美一级二级三级蜜桃| 久久久国产一区二区三区四区小说| 精品sm捆绑视频| 国产精品久久久久久久久免费丝袜| 亚洲欧美欧美一区二区三区| 亚洲国产精品欧美一二99| 日韩在线一二三区| 精品系列免费在线观看| av亚洲精华国产精华| 欧美日韩亚洲国产综合| 精品乱人伦小说| 亚洲欧美一区二区三区极速播放| 亚洲一区二区3| 国产一区二区在线观看视频| 白白色 亚洲乱淫| 91精品免费观看| 亚洲特级片在线| 蜜桃av噜噜一区| 99久久99久久免费精品蜜臀| 欧美丰满少妇xxxbbb| 中文字幕国产一区| 亚洲123区在线观看| 国产jizzjizz一区二区| 欧美人与禽zozo性伦| 国产欧美日韩在线看| 日韩精品一区第一页| 成人激情小说乱人伦| 91精品国产色综合久久不卡蜜臀| 国产欧美一区二区精品久导航| 亚洲.国产.中文慕字在线| 成人激情综合网站| 精品成人一区二区三区| 亚洲国产成人porn| www.亚洲精品| 久久亚洲综合av| 日韩有码一区二区三区| 91激情在线视频| 国产午夜精品在线观看| 久久国产欧美日韩精品| 69堂成人精品免费视频| 亚洲最快最全在线视频| 成人污视频在线观看| 久久综合色婷婷| 久久超级碰视频| 欧美精品丝袜中出| 亚洲午夜一区二区三区| 色综合久久综合网| 中文乱码免费一区二区| 国产成人免费在线视频| 精品久久久久99| 久久机这里只有精品| 日韩久久免费av| 日本麻豆一区二区三区视频| 欧美三级日韩在线| 依依成人精品视频| 在线观看网站黄不卡| 亚洲色欲色欲www在线观看| 成人av网址在线观看| 国产精品你懂的| 99九九99九九九视频精品| 中文字幕在线播放不卡一区| a亚洲天堂av| 一区二区三区高清在线| 欧美视频日韩视频在线观看| 亚洲午夜激情av| 欧美日韩免费电影| 日本不卡免费在线视频| 日韩精品一区二区三区老鸭窝| 全部av―极品视觉盛宴亚洲| 欧美xxx久久| 国产aⅴ综合色| 亚洲六月丁香色婷婷综合久久 | 精品在线观看免费| 欧美xxxx老人做受| 懂色av噜噜一区二区三区av| 亚洲美女精品一区| 欧美日韩电影在线播放| 久久精品国产亚洲5555| www激情久久| 91在线观看地址| 亚洲成人av在线电影| 精品国一区二区三区| 粉嫩在线一区二区三区视频| 一区二区三区精密机械公司| 这里只有精品电影| 粉嫩aⅴ一区二区三区四区| 亚洲黄色片在线观看| 91精品麻豆日日躁夜夜躁| 高清成人在线观看| 亚洲国产一区二区视频| 久久婷婷国产综合精品青草 | 91行情网站电视在线观看高清版| 亚洲高清在线精品| 久久午夜电影网| 日本精品免费观看高清观看| 麻豆视频观看网址久久| 中文字幕日韩av资源站| 欧美一区二区视频免费观看| 国产 日韩 欧美大片| 亚洲3atv精品一区二区三区| 国产精品视频一二三| 在线电影一区二区三区| 波多野结衣欧美| 麻豆国产一区二区| 亚洲成va人在线观看| 国产女主播一区| 欧美一三区三区四区免费在线看| www.欧美.com| 久久99精品国产麻豆不卡| 亚洲国产精品久久不卡毛片| 国产精品久久久爽爽爽麻豆色哟哟| 51午夜精品国产| 99热精品国产| 成人午夜精品一区二区三区| 日本亚洲视频在线| 亚洲图片自拍偷拍| 国产日韩精品一区二区三区| 欧美日韩另类一区| 97国产一区二区| 国产成人午夜视频| 美腿丝袜一区二区三区| 一区二区三区精品视频在线| 久久综合九色综合欧美98| 91麻豆精品国产自产在线| 色婷婷av一区二区三区软件| 99麻豆久久久国产精品免费优播| 国产精品自拍av| 国产尤物一区二区| 久久99久久99小草精品免视看| 亚洲一区二区综合| 专区另类欧美日韩| 国产精品午夜在线观看| 欧美国产综合一区二区| 欧美一区二区三区播放老司机| 在线观看亚洲a| 欧美色偷偷大香| 欧美伊人久久久久久久久影院 | 老司机一区二区| 午夜日韩在线电影| 亚洲国产精品欧美一二99| 亚洲成人一区二区在线观看| 亚洲精品一二三| 亚洲人成网站在线| 亚洲老妇xxxxxx| 国产精品―色哟哟| 久久久精品蜜桃| 欧美国产亚洲另类动漫| 国产精品第四页| 一区二区三区四区中文字幕| 亚洲午夜一区二区| 奇米精品一区二区三区四区| 精品在线播放免费| 国产99久久久国产精品免费看| 国产成人精品午夜视频免费 | 国产精品免费av| 亚洲日本va在线观看| 天天色综合天天| 国产一区二区久久| 99re视频精品| 欧美一级视频精品观看| 久久人人爽人人爽| 玉足女爽爽91| 激情图片小说一区| 99热国产精品| 欧美成人精品福利| 亚洲日本va在线观看| 奇米一区二区三区av| 成人免费视频一区二区| 欧美三级韩国三级日本一级| 精品国产在天天线2019| 日韩毛片精品高清免费| 日本不卡视频在线观看| 97久久精品人人澡人人爽| 91精品国产综合久久精品| 国产精品美女一区二区| 婷婷一区二区三区| 成人午夜又粗又硬又大| 欧美高清www午色夜在线视频| 国产女同互慰高潮91漫画| 亚洲国产va精品久久久不卡综合| 国产黑丝在线一区二区三区| 欧美性视频一区二区三区| 久久人人97超碰com| 日韩精品电影在线| 91看片淫黄大片一级| 国产午夜三级一区二区三|