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

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

?? tzset.c

?? C標準庫源代碼,能提高對C的理解,不錯的哦
?? C
?? 第 1 頁 / 共 2 頁
字號:
            else if ( dstend.ms >= DAY_MILLISEC ) {
                dstend.ms -= DAY_MILLISEC;
                dstend.yd++;
            }

            /*
             * Set year field of dstend so that unnecessary calls to cvtdate()
             * may be avoided.
             */
            dstend.yr = year;
        }

        return;
}

/***
*int _isindst(tb) - determine if broken-down time falls in DST
*
*Purpose:
*       Determine if the given broken-down time falls within daylight saving
*       time (DST). The DST rules are either obtained from Win32 (tzapiused !=
*       TRUE) or assumed to be USA rules, post 1986.
*
*       If the DST rules are obtained from Win32's GetTimeZoneInformation API,
*       the transition dates to/from DST can be specified in either of two
*       formats. First, a day-in-month format, similar to the way USA rules
*       are specified, can be used. The transition date is given as the n-th
*       occurence of a specified day of the week in a specified month. Second,
*       an absolute date can be specified. The two cases are distinguished by
*       the value of wYear field in the SYSTEMTIME structure (0 denotes a
*       day-in-month format).
*
*       USA rules for DST are that a time is in DST iff it is on or after
*       02:00 on the first Sunday in April, and before 01:00 on the last
*       Sunday in October.
*
*Entry:
*       struct tm *tb - structure holding broken-down time value
*
*Exit:
*       1, if time represented is in DST
*       0, otherwise
*
*******************************************************************************/

int __cdecl _isindst (
        struct tm *tb
        )
#ifdef _MT
{
        int retval;

        _mlock( _TIME_LOCK );
        retval = _isindst_lk( tb );
        _munlock( _TIME_LOCK );

        return retval;
}

static int __cdecl _isindst_lk (
        struct tm *tb
        )
#endif  /* _MT */
{
        long ms;

        if ( _daylight == 0 )
            return 0;

        /*
         * Compute (recompute) the transition dates for daylight saving time
         * if necessary.The yr (year) fields of dststart and dstend is
         * compared to the year of interest to determine necessity.
         */
        if ( (tb->tm_year != dststart.yr) || (tb->tm_year != dstend.yr) ) {
            if ( tzapiused ) {
                /*
                 * Convert the start of daylight saving time to dststart.
                 */
                if ( tzinfo.DaylightDate.wYear == 0 )
                    cvtdate( 1,
                             1,             /* day-in-month format */
                             tb->tm_year,
                             tzinfo.DaylightDate.wMonth,
                             tzinfo.DaylightDate.wDay,
                             tzinfo.DaylightDate.wDayOfWeek,
                             0,
                             tzinfo.DaylightDate.wHour,
                             tzinfo.DaylightDate.wMinute,
                             tzinfo.DaylightDate.wSecond,
                             tzinfo.DaylightDate.wMilliseconds );
                else
                    cvtdate( 1,
                             0,             /* absolute date */
                             tb->tm_year,
                             tzinfo.DaylightDate.wMonth,
                             0,
                             0,
                             tzinfo.DaylightDate.wDay,
                             tzinfo.DaylightDate.wHour,
                             tzinfo.DaylightDate.wMinute,
                             tzinfo.DaylightDate.wSecond,
                             tzinfo.DaylightDate.wMilliseconds );
                /*
                 * Convert start of standard time to dstend.
                 */
                if ( tzinfo.StandardDate.wYear == 0 )
                    cvtdate( 0,
                             1,             /* day-in-month format */
                             tb->tm_year,
                             tzinfo.StandardDate.wMonth,
                             tzinfo.StandardDate.wDay,
                             tzinfo.StandardDate.wDayOfWeek,
                             0,
                             tzinfo.StandardDate.wHour,
                             tzinfo.StandardDate.wMinute,
                             tzinfo.StandardDate.wSecond,
                             tzinfo.StandardDate.wMilliseconds );
                else
                    cvtdate( 0,
                             0,             /* absolute date */
                             tb->tm_year,
                             tzinfo.StandardDate.wMonth,
                             0,
                             0,
                             tzinfo.StandardDate.wDay,
                             tzinfo.StandardDate.wHour,
                             tzinfo.StandardDate.wMinute,
                             tzinfo.StandardDate.wSecond,
                             tzinfo.StandardDate.wMilliseconds );

            }
            else {
                /*
                 * GetTimeZoneInformation API was NOT used, or failed. USA
                 * daylight saving time rules are assumed.
                 */
                cvtdate( 1,
                         1,
                         tb->tm_year,
                         4,                 /* April */
                         1,                 /* first... */
                         0,                 /* ...Sunday */
                         0,
                         2,                 /* 02:00 (2 AM) */
                         0,
                         0,
                         0 );

                cvtdate( 0,
                         1,
                         tb->tm_year,
                         10,                /* October */
                         5,                 /* last... */
                         0,                 /* ...Sunday */
                         0,
                         2,                 /* 02:00 (2 AM) */
                         0,
                         0,
                         0 );
            }
        }

        /*
         * Handle simple cases first.
         */
        if ( dststart.yd < dstend.yd ) {
            /*
             * Northern hemisphere ordering
             */
            if ( (tb->tm_yday < dststart.yd) || (tb->tm_yday > dstend.yd) )
                return 0;
            if ( (tb->tm_yday > dststart.yd) && (tb->tm_yday < dstend.yd) )
                return 1;
        }
        else {
            /*
             * Southern hemisphere ordering
             */
            if ( (tb->tm_yday < dstend.yd) || (tb->tm_yday > dststart.yd) )
                return 1;
            if ( (tb->tm_yday > dstend.yd) && (tb->tm_yday < dststart.yd) )
                return 0;
        }

        ms = 1000L * (tb->tm_sec + 60L * tb->tm_min + 3600L * tb->tm_hour);

        if ( tb->tm_yday == dststart.yd ) {
            if ( ms >= dststart.ms )
                return 1;
            else
                return 0;
        }
        else {
            /*
             * tb->tm_yday == dstend.yd
             */
            if ( ms < dstend.ms )
                return 1;
            else
                return 0;
        }

}



#else  /* _WIN32 */

#if defined (_M_MPPC) || defined (_M_M68K)


#include <cruntime.h>
#include <ctype.h>
#include <ctime.h>
#include <time.h>
#include <stdlib.h>
#include <internal.h>
#include <string.h>
#include <macos\script.h>
#include <macos\osutils.h>

/***
*void tzset() - sets timezone information and calc if in daylight time
*
*Purpose:
*       Sets the timezone information from the TZ environment variable
*       and then sets _timezone, _daylight, and _tzname. If we're in daylight
*       time is automatically calculated.
*
*Entry:
*       None, reads TZ environment variable.
*
*Exit:
*       sets _daylight, _timezone, and _tzname global vars, no return value
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _tzset (
        void
        )
{
        REG1 char *TZ;
        char *lastTZ=NULL;
        MachineLocation ml;
        long gmtDelta;
        REG2 int negdiff = 0;

        /*
         * Fetch the value of the TZ environment variable. If there is no TZ
         * environment variable, or if it is trivial, then the timezone
         * information will be taken from the OS.
         */

        if ( (TZ = getenv("TZ")) && (*TZ) ) {
            /*
             * TZ environment variable exists and is non-trivial. See if
             * it is unchanged from a previous _tzset call.
             */
            if ( (lastTZ == NULL) || (strcmp(TZ, lastTZ) != 0) ) {
                /*
                 * TZ has changed, or there has been no prior _tzset call.
                 * Update lastTZ value.
                 */
                free(lastTZ);
                lastTZ = _strdup(TZ);
            }
            else {
                /*
                 * Timezone environment variable hasn't changed since the
                 * last _tzset call, just return.
                 */
                return;

            }
        }
        else {
            /*
             * The TZ environment variable either does not exist, or is
             * trivial. Therefore, timezone information will be obtained
             * from the OS.
             */
            if ( lastTZ != NULL ) {
                free(lastTZ);
                lastTZ = NULL;
            }
            ReadLocation(&ml);
            //get gmtDelta from machinelocation in RAM
            gmtDelta = ml.u.gmtDelta & 0x00ffffff;

            if ((gmtDelta >> 23) & 1) //need to sign extend
                gmtDelta = gmtDelta | 0xff000000;

            //set timezone and daylight
            _timezone = - gmtDelta;
            _daylight = (ml.u.dlsDelta ? 1 : 0);
            *_tzname[0] = '\0';
            *_tzname[1] = '\0';
            return;
        }

        strncpy(_tzname[0], TZ, 3);

        /*
         * time difference is of the form:
         *
         *      [+|-]hh[:mm[:ss]]
         *
         * check minus sign first.
         */
        if ( *(TZ += 3) == '-' ) {
                negdiff++;
                TZ++;
        }

        /*
         * process, then skip over, the hours
         */
        _timezone = atol(TZ) * 3600L;

        while ( (*TZ == '+') || ((*TZ >= '0') && (*TZ <= '9')) ) TZ++;

        /*
         * check if minutes were specified
         */
        if ( *TZ == ':' ) {
            /*
             * process, then skip over, the minutes
             */
            _timezone += atol(++TZ) * 60L;
            while ( (*TZ >= '0') && (*TZ <= '9') ) TZ++;

            /*
             * check if seconds were specified
             */
            if ( *TZ == ':' ) {
                /*
                 * process, then skip over, the seconds
                 */
                _timezone += atol(++TZ);
                while ( (*TZ >= '0') && (*TZ <= '9') ) TZ++;
            }
        }
        if ( negdiff )
                _timezone = -_timezone;

        /*
         * finally, check for a DST zone suffix
         */
        if (*TZ)
                strncpy(_tzname[1], TZ, 3);
        else
                *_tzname[1] = '\0';
        _daylight = *_tzname[1] != '\0';
}

/*
 *  _isindst - Tells whether Xenix-type time value falls under DST
 *
 *  This is the rule for years before 1987:
 *  a time is in DST iff it is on or after 02:00:00 on the last Sunday
 *  in April and before 01:00:00 on the last Sunday in October.
 *  This is the rule for years starting with 1987:
 *  a time is in DST iff it is on or after 02:00:00 on the first Sunday
 *  in April and before 01:00:00 on the last Sunday in October.
 *
 *  ENTRY   tb  - 'time' structure holding broken-down time value
 *
 *  RETURN  1 if time represented is in DST, else 0
 */

int __cdecl _isindst (
        REG1 struct tm *tb
        )
{
        int mdays;
        REG2 int yr;
        int lastsun;

        /* If the month is before April or after October, then we know
         * immediately it can't be DST. */

        if (tb->tm_mon < 3 || tb->tm_mon > 9)
                return(0);

        /* If the month is after April and before October then we know
         * immediately it must be DST. */

        if (tb->tm_mon > 3 && tb->tm_mon < 9)
                return(1);
        /*
         * Now for the hard part.  Month is April or October; see if date
         * falls between appropriate Sundays.
         */

        /*
         * The objective for years before 1987 (after 1986) is to determine
         * if the day is on or after 2:00 am on the last (first) Sunday in
         * April, or before 1:00 am on the last Sunday in October.
         *
         * We know the year-day (0..365) of the current time structure. We must
         * determine the year-day of the last (first) Sunday in this month,
         * April or October, and then do the comparison.
         *
         * To determine the year-day of the last Sunday, we do the following:
         *      1. Get the year-day of the last day of the current month (Apr
         *         or Oct)
         *      2. Determine the week-day number of #1,
         *         which is defined as 0 = Sun, 1 = Mon, ... 6 = Sat
         *      3. Subtract #2 from #1
         *
         * To determine the year-day of the first Sunday, we do the following:
         *      1. Get the year-day of the 7th day of the current month (April)
         *      2. Determine the week-day number of #1,
         *         which is defined as 0 = Sun, 1 = Mon, ... 6 = Sat
         *      3. Subtract #2 from #1
         */

        yr = tb->tm_year + 1900;    /* To see if this is a leap-year */

        /* First we get #1. The year-days for each month are stored in _days[]
         * they're all off by -1 */

        if (yr > 1986 && tb->tm_mon == 3)
                mdays = 7 + _days[tb->tm_mon];
        else
                mdays = _days[tb->tm_mon+1];

        /* if this is a leap-year, add an extra day */
        if (!(yr & 3))
                mdays++;

        /* mdays now has #1 */

        yr = tb->tm_year - 70;

        /* Now get #2.  We know the week-day number of the beginning of the
         * epoch, Jan. 1, 1970, which is defined as the constant _BASE_DOW.  We
         * then add the number of days that have passed from _BASE_DOW to the day
         * of #2
         *      mdays + 365 * yr
         * correct for the leap years which intervened
         *      + (yr + 1)/ 4
         * and take the result mod 7, except that 0 must be mapped to 7.
         * This is #2, which we then subtract from #1, mdays
         */

        lastsun = mdays - ((mdays + 365*yr + ((yr+1)/4) + _BASE_DOW) % 7);

        /* Now we know 1 and 3; we're golden: */

        return (tb->tm_mon==3
                ? (tb->tm_yday > lastsun ||
                (tb->tm_yday == lastsun && tb->tm_hour >= 2))
                : (tb->tm_yday < lastsun ||
                (tb->tm_yday == lastsun && tb->tm_hour < 1)));
}




#endif  /* defined (_M_MPPC) || defined (_M_M68K) */

#endif  /* _WIN32 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区在线观看免费观看电影高清| 韩国v欧美v日本v亚洲v| 国产欧美一区二区三区在线看蜜臀| 欧美四级电影网| 欧美在线免费播放| 日本高清不卡一区| 色菇凉天天综合网| 日本韩国欧美在线| 91黄色免费观看| 欧美在线视频全部完| 91免费看视频| 欧美少妇xxx| 日韩欧美www| 久久精品一区蜜桃臀影院| 久久精品男人的天堂| 最新国产精品久久精品| 亚洲少妇30p| 日韩电影在线免费| 国产精品一色哟哟哟| zzijzzij亚洲日本少妇熟睡| 97久久精品人人澡人人爽| 色一情一乱一乱一91av| 欧美婷婷六月丁香综合色| 欧美电影一区二区三区| 久久久久97国产精华液好用吗| 久久精品亚洲国产奇米99 | 一区二区三区在线视频播放| 一区二区日韩电影| 免费在线观看视频一区| 高清不卡在线观看av| 欧美在线免费观看亚洲| 日韩视频在线一区二区| 国产日韩影视精品| 一区二区在线免费观看| 日本女优在线视频一区二区| 粉嫩av一区二区三区| 欧美综合天天夜夜久久| 精品国产乱码久久久久久牛牛| 国产精品麻豆久久久| 亚洲一区二区三区四区在线观看| 精品影视av免费| 91精彩视频在线观看| 日韩欧美在线一区二区三区| 国产欧美一区二区精品久导航 | 亚洲欧美日韩国产手机在线 | 91女人视频在线观看| 欧美日本不卡视频| 日本一区二区三级电影在线观看| 国产精品卡一卡二卡三| 精品一区二区三区在线观看国产| 色婷婷精品大在线视频| 久久婷婷久久一区二区三区| 亚洲福利一区二区| 99久久精品国产网站| 欧美大肚乱孕交hd孕妇| 亚洲永久免费视频| 91亚洲国产成人精品一区二三 | 美腿丝袜一区二区三区| 97久久超碰精品国产| 久久精品视频在线免费观看| 蜜桃视频一区二区三区在线观看| 在线免费观看日本欧美| 亚洲人成精品久久久久| 国产成人综合在线观看| 精品第一国产综合精品aⅴ| 日韩国产欧美三级| 欧美日韩国产高清一区二区三区| 亚洲精品视频在线看| 91视频免费观看| 国产精品毛片高清在线完整版| 青娱乐精品视频在线| 欧美三级韩国三级日本三斤| 亚洲影视在线观看| 精品视频一区三区九区| 亚洲一区二区精品视频| 91美女精品福利| 亚洲黄色录像片| 色综合天天视频在线观看 | 成人免费视频播放| 国产午夜精品一区二区三区视频| 国产伦精品一区二区三区视频青涩| 在线不卡中文字幕| 日本vs亚洲vs韩国一区三区 | 日本电影欧美片| 亚洲国产精品久久不卡毛片 | 日韩一二三区视频| 日韩在线一区二区三区| 欧美一区二区三区精品| 狠狠色狠狠色合久久伊人| 国产欧美精品一区二区色综合| 成人综合在线观看| 国产精品国产三级国产a| 成人动漫中文字幕| 一区二区在线看| 欧美午夜精品久久久久久超碰 | 欧美美女一区二区在线观看| 日本sm残虐另类| 国产亚洲婷婷免费| 欧美色精品在线视频| 极品少妇xxxx精品少妇偷拍| 中文字幕亚洲欧美在线不卡| av在线不卡免费看| 亚洲高清不卡在线| 精品美女在线观看| 高清在线观看日韩| 亚洲成精国产精品女| 欧美sm极限捆绑bd| 色综合中文字幕国产 | 亚洲欧美国产三级| 欧美一区二区黄色| 成人免费三级在线| 人妖欧美一区二区| 国产精品电影一区二区| 9191成人精品久久| av一二三不卡影片| 久久精品久久99精品久久| 成人免费视频在线观看| 欧美成人女星排行榜| 色综合一区二区三区| 国产一区二区三区免费在线观看| 伊人一区二区三区| 久久精品水蜜桃av综合天堂| 91 com成人网| 在线看日本不卡| 成人a区在线观看| 黄色资源网久久资源365| 亚洲一区二区视频在线观看| 欧美激情一区二区三区不卡| 91精品国产综合久久久久久久 | 91精品在线观看入口| 成人一区二区三区| 免费看欧美美女黄的网站| 亚洲欧美偷拍三级| 国产精品美女久久久久高潮| 精品第一国产综合精品aⅴ| 欧美肥妇free| 色八戒一区二区三区| 国产成人鲁色资源国产91色综 | 一本色道久久综合亚洲aⅴ蜜桃| 亚洲国产日韩精品| 一区二区三区日本| 日韩毛片精品高清免费| 中文字幕av免费专区久久| 欧美精品一区二区三区很污很色的 | 国产午夜精品美女毛片视频| 欧美三级一区二区| 91官网在线免费观看| 99精品视频一区| 91香蕉视频在线| 成人app软件下载大全免费| 日韩av网站在线观看| 亚洲一区二区三区不卡国产欧美| 亚洲日本在线视频观看| 国产精品短视频| 亚洲国产成人自拍| 一区在线播放视频| 国产精品久久久久aaaa| 国产精品剧情在线亚洲| 国产亲近乱来精品视频| 国产精品视频免费看| 亚洲精品中文在线观看| 亚洲国产人成综合网站| 三级久久三级久久| 久久国产精品第一页| 国产一区视频导航| 懂色av噜噜一区二区三区av| 成人一区二区视频| 色婷婷久久一区二区三区麻豆| 欧美性猛交xxxxxx富婆| 欧美一区二区不卡视频| 欧美精品一区二区三区四区| 国产精品国模大尺度视频| 一区二区三区高清在线| 青青草原综合久久大伊人精品 | 精品国产乱码久久久久久夜甘婷婷| 国产日韩成人精品| 亚洲日本在线天堂| 欧美aⅴ一区二区三区视频| 国产精品自拍毛片| 91在线一区二区三区| 7777精品伊人久久久大香线蕉超级流畅 | 不卡一区中文字幕| 99视频在线精品| 成人国产精品免费观看动漫 | 九九精品一区二区| 丰满少妇在线播放bd日韩电影| 91国偷自产一区二区使用方法| 日韩一级片在线观看| 久久精品视频免费| 亚洲香蕉伊在人在线观| 精品无人码麻豆乱码1区2区| 成人av一区二区三区| 在线91免费看| 精品女同一区二区| 亚洲视频在线一区观看| 九色porny丨国产精品| 日本精品视频一区二区| 久久久777精品电影网影网| 亚洲大片在线观看| 99久精品国产|