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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jim.c

?? 開(kāi)放源碼實(shí)時(shí)操作系統(tǒng)源碼.
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* Jim - A small embeddable Tcl interpreter
 * Copyright 2005 Salvatore Sanfilippo <antirez@invece.org>
 * Copyright 2005 Clemens Hintze <c.hintze@gmx.net>
 *
 * $Id: jim.c,v 1.170 2006/11/06 21:48:57 antirez Exp $
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * A copy of the license is also included in the source distribution
 * of Jim, as a TXT file name called LICENSE.
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define __JIM_CORE__
#define JIM_OPTIMIZATION /* comment to avoid optimizations and reduce size */

#include <pkgconf/athttpd.h>

#ifndef JIM_ANSIC
#define JIM_DYNLIB      /* Dynamic library support for UNIX and WIN32 */
#endif /* JIM_ANSIC */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <limits.h>
#include <assert.h>
#include <errno.h>
#include <time.h>

/* Include the platform dependent libraries for
 * dynamic loading of libraries. */
#ifdef JIM_DYNLIB
#if defined(_WIN32) || defined(WIN32)
#ifndef WIN32
#define WIN32 1
#endif
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if _MSC_VER >= 1000
#pragma warning(disable:4146)
#endif /* _MSC_VER */
#else
#include <dlfcn.h>
#endif /* WIN32 */
#endif /* JIM_DYNLIB */

#include <cyg/athttpd/jim.h>

#ifdef HAVE_BACKTRACE
#include <execinfo.h>
#endif

/* -----------------------------------------------------------------------------
 * Global variables
 * ---------------------------------------------------------------------------*/

/* A shared empty string for the objects string representation.
 * Jim_InvalidateStringRep knows about it and don't try to free. */
static char *JimEmptyStringRep = (char*) "";

/* -----------------------------------------------------------------------------
 * Required prototypes of not exported functions
 * ---------------------------------------------------------------------------*/
static void JimChangeCallFrameId(Jim_Interp *interp, Jim_CallFrame *cf);
static void JimFreeCallFrame(Jim_Interp *interp, Jim_CallFrame *cf, int flags);
static void JimRegisterCoreApi(Jim_Interp *interp);

static Jim_HashTableType JimVariablesHashTableType;

/* -----------------------------------------------------------------------------
 * Utility functions
 * ---------------------------------------------------------------------------*/

/*
 * Convert a string to a jim_wide INTEGER.
 * This function originates from BSD.
 *
 * Ignores `locale' stuff.  Assumes that the upper and lower case
 * alphabets and digits are each contiguous.
 */
#ifdef HAVE_LONG_LONG
#define JimIsAscii(c) (((c) & ~0x7f) == 0)
static jim_wide JimStrtoll(const char *nptr, char **endptr, register int base)
{
    register const char *s;
    register unsigned jim_wide acc;
    register unsigned char c;
    register unsigned jim_wide qbase, cutoff;
    register int neg, any, cutlim;

    /*
     * Skip white space and pick up leading +/- sign if any.
     * If base is 0, allow 0x for hex and 0 for octal, else
     * assume decimal; if base is already 16, allow 0x.
     */
    s = nptr;
    do {
        c = *s++;
    } while (isspace(c));
    if (c == '-') {
        neg = 1;
        c = *s++;
    } else {
        neg = 0;
        if (c == '+')
            c = *s++;
    }
    if ((base == 0 || base == 16) &&
        c == '0' && (*s == 'x' || *s == 'X')) {
        c = s[1];
        s += 2;
        base = 16;
    }
    if (base == 0)
        base = c == '0' ? 8 : 10;

    /*
     * Compute the cutoff value between legal numbers and illegal
     * numbers.  That is the largest legal value, divided by the
     * base.  An input number that is greater than this value, if
     * followed by a legal input character, is too big.  One that
     * is equal to this value may be valid or not; the limit
     * between valid and invalid numbers is then based on the last
     * digit.  For instance, if the range for quads is
     * [-9223372036854775808..9223372036854775807] and the input base
     * is 10, cutoff will be set to 922337203685477580 and cutlim to
     * either 7 (neg==0) or 8 (neg==1), meaning that if we have
     * accumulated a value > 922337203685477580, or equal but the
     * next digit is > 7 (or 8), the number is too big, and we will
     * return a range error.
     *
     * Set any if any `digits' consumed; make it negative to indicate
     * overflow.
     */
    qbase = (unsigned)base;
    cutoff = neg ? (unsigned jim_wide)-(LLONG_MIN + LLONG_MAX) + LLONG_MAX
        : LLONG_MAX;
    cutlim = (int)(cutoff % qbase);
    cutoff /= qbase;
    for (acc = 0, any = 0;; c = *s++) {
        if (!JimIsAscii(c))
            break;
        if (isdigit(c))
            c -= '0';
        else if (isalpha(c))
            c -= isupper(c) ? 'A' - 10 : 'a' - 10;
        else
            break;
        if (c >= base)
            break;
        if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
            any = -1;
        else {
            any = 1;
            acc *= qbase;
            acc += c;
        }
    }
    if (any < 0) {
        acc = neg ? LLONG_MIN : LLONG_MAX;
        errno = ERANGE;
    } else if (neg)
        acc = -acc;
    if (endptr != 0)
        *endptr = (char *)(any ? s - 1 : nptr);
    return (acc);
}
#endif

/* Glob-style pattern matching. */
static int JimStringMatch(const char *pattern, int patternLen,
        const char *string, int stringLen, int nocase)
{
    while(patternLen) {
        switch(pattern[0]) {
        case '*':
            while (pattern[1] == '*') {
                pattern++;
                patternLen--;
            }
            if (patternLen == 1)
                return 1; /* match */
            while(stringLen) {
                if (JimStringMatch(pattern+1, patternLen-1,
                            string, stringLen, nocase))
                    return 1; /* match */
                string++;
                stringLen--;
            }
            return 0; /* no match */
            break;
        case '?':
            if (stringLen == 0)
                return 0; /* no match */
            string++;
            stringLen--;
            break;
        case '[':
        {
            int not, match;

            pattern++;
            patternLen--;
            not = pattern[0] == '^';
            if (not) {
                pattern++;
                patternLen--;
            }
            match = 0;
            while(1) {
                if (pattern[0] == '\\') {
                    pattern++;
                    patternLen--;
                    if (pattern[0] == string[0])
                        match = 1;
                } else if (pattern[0] == ']') {
                    break;
                } else if (patternLen == 0) {
                    pattern--;
                    patternLen++;
                    break;
                } else if (pattern[1] == '-' && patternLen >= 3) {
                    int start = pattern[0];
                    int end = pattern[2];
                    int c = string[0];
                    if (start > end) {
                        int t = start;
                        start = end;
                        end = t;
                    }
                    if (nocase) {
                        start = tolower(start);
                        end = tolower(end);
                        c = tolower(c);
                    }
                    pattern += 2;
                    patternLen -= 2;
                    if (c >= start && c <= end)
                        match = 1;
                } else {
                    if (!nocase) {
                        if (pattern[0] == string[0])
                            match = 1;
                    } else {
                        if (tolower((int)pattern[0]) == tolower((int)string[0]))
                            match = 1;
                    }
                }
                pattern++;
                patternLen--;
            }
            if (not)
                match = !match;
            if (!match)
                return 0; /* no match */
            string++;
            stringLen--;
            break;
        }
        case '\\':
            if (patternLen >= 2) {
                pattern++;
                patternLen--;
            }
            /* fall through */
        default:
            if (!nocase) {
                if (pattern[0] != string[0])
                    return 0; /* no match */
            } else {
                if (tolower((int)pattern[0]) != tolower((int)string[0]))
                    return 0; /* no match */
            }
            string++;
            stringLen--;
            break;
        }
        pattern++;
        patternLen--;
        if (stringLen == 0) {
            while(*pattern == '*') {
                pattern++;
                patternLen--;
            }
            break;
        }
    }
    if (patternLen == 0 && stringLen == 0)
        return 1;
    return 0;
}

int JimStringCompare(const char *s1, int l1, const char *s2, int l2,
        int nocase)
{
    unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;

    if (nocase == 0) {
        while(l1 && l2) {
            if (*u1 != *u2)
                return (int)*u1-*u2;
            u1++; u2++; l1--; l2--;
        }
        if (!l1 && !l2) return 0;
        return l1-l2;
    } else {
        while(l1 && l2) {
            if (tolower((int)*u1) != tolower((int)*u2))
                return tolower((int)*u1)-tolower((int)*u2);
            u1++; u2++; l1--; l2--;
        }
        if (!l1 && !l2) return 0;
        return l1-l2;
    }
}

/* Search 's1' inside 's2', starting to search from char 'index' of 's2'.
 * The index of the first occurrence of s1 in s2 is returned. 
 * If s1 is not found inside s2, -1 is returned. */
int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index)
{
    int i;

    if (!l1 || !l2 || l1 > l2) return -1;
    if (index < 0) index = 0;
    s2 += index;
    for (i = index; i <= l2-l1; i++) {
        if (memcmp(s2, s1, l1) == 0)
            return i;
        s2++;
    }
    return -1;
}

int Jim_WideToString(char *buf, jim_wide wideValue)
{
    const char *fmt = "%" JIM_WIDE_MODIFIER;
    return sprintf(buf, fmt, wideValue);
}

int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
{
    char *endptr;

#ifdef HAVE_LONG_LONG
    *widePtr = JimStrtoll(str, &endptr, base);
#else
    *widePtr = strtol(str, &endptr, base);
#endif
    if (str[0] == '\0')
        return JIM_ERR;
    if (endptr[0] != '\0') {
        while(*endptr) {
            if (!isspace((int)*endptr))
                return JIM_ERR;
            endptr++;
        }
    }
    return JIM_OK;
}

int Jim_StringToIndex(const char *str, int *intPtr)
{
    char *endptr;

    *intPtr = strtol(str, &endptr, 10);
    if (str[0] == '\0')
        return JIM_ERR;
    if (endptr[0] != '\0') {
        while(*endptr) {
            if (!isspace((int)*endptr))
                return JIM_ERR;
            endptr++;
        }
    }
    return JIM_OK;
}

/* The string representation of references has two features in order
 * to make the GC faster. The first is that every reference starts
 * with a non common character '~', in order to make the string matching
 * fater. The second is that the reference string rep his 32 characters
 * in length, this allows to avoid to check every object with a string
 * repr < 32, and usually there are many of this objects. */

#define JIM_REFERENCE_SPACE (35+JIM_REFERENCE_TAGLEN)

static int JimFormatReference(char *buf, Jim_Reference *refPtr, jim_wide id)
{
    const char *fmt = "<reference.<%s>.%020" JIM_WIDE_MODIFIER ">";
    sprintf(buf, fmt, refPtr->tag, id);
    return JIM_REFERENCE_SPACE;
}

int Jim_DoubleToString(char *buf, double doubleValue)
{
    char *s;
    int len;

    len = sprintf(buf, "%.17g", doubleValue);
    s = buf;
    while(*s) {
        if (*s == '.') return len;
        s++;
    }
    /* Add a final ".0" if it's a number. But not
     * for NaN or InF */
    if (isdigit((int)buf[0])
        || ((buf[0] == '-' || buf[0] == '+')
            && isdigit((int)buf[1]))) {
        s[0] = '.';
        s[1] = '0';
        s[2] = '\0';
        return len+2;
    }
    return len;
}

int Jim_StringToDouble(const char *str, double *doublePtr)
{
    char *endptr;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人午夜片在线观看高清观看| 日韩欧美自拍偷拍| 国产mv日韩mv欧美| 国产乱码精品一区二区三区av | 国产成人综合网| 精品一区二区三区在线视频| 男女性色大片免费观看一区二区| 亚洲成av人片在线| 亚洲成人高清在线| 丝袜亚洲精品中文字幕一区| 亚洲成人资源网| 男人操女人的视频在线观看欧美 | 成人丝袜18视频在线观看| 国产成人精品一区二区三区网站观看| 国产在线精品一区二区| 豆国产96在线|亚洲| 91亚洲永久精品| 色综合 综合色| 欧美日韩国产高清一区二区| 9191成人精品久久| 精品第一国产综合精品aⅴ| 日本一区二区免费在线| 国产精品久久久久国产精品日日 | 国产精品乡下勾搭老头1| 国产**成人网毛片九色| 91在线精品秘密一区二区| 在线视频一区二区三| 欧美一区二区视频在线观看2022 | 国产日产欧产精品推荐色| 国产精品欧美久久久久一区二区| 中文字幕在线观看不卡| 亚洲国产美女搞黄色| 天天免费综合色| 国产一区二区三区久久久| 不卡高清视频专区| 欧美日韩成人综合在线一区二区| 日韩欧美一卡二卡| 中文字幕一区av| 天堂久久久久va久久久久| 国产精品亚洲午夜一区二区三区 | 精品日韩一区二区| 国产精品美女一区二区三区| 亚洲国产毛片aaaaa无费看| 国产一区二区三区最好精华液| 成人国产精品视频| 欧美绝品在线观看成人午夜影视| 精品国产3级a| 亚洲国产色一区| 国产91丝袜在线观看| 欧美撒尿777hd撒尿| 久久日韩精品一区二区五区| 亚洲精品成人天堂一二三| 麻豆久久一区二区| 91视频在线看| 久久婷婷综合激情| 午夜精品久久久久久久久久 | 91传媒视频在线播放| 欧美mv日韩mv| 一区二区久久久| 国产精品77777竹菊影视小说| 在线观看区一区二| 国产精品免费视频一区| 日韩电影在线免费看| 99精品视频免费在线观看| 欧美不卡在线视频| 五月天一区二区| 99久久精品国产毛片| 精品国精品国产尤物美女| 一区二区三区视频在线看| 国产盗摄视频一区二区三区| 欧美高清hd18日本| 亚洲日穴在线视频| 粉嫩在线一区二区三区视频| 91麻豆精品国产91久久久使用方法| 国产精品久久久久桃色tv| 精品一区二区三区影院在线午夜| 欧美日韩一二区| 亚洲人成7777| 成人综合在线观看| 久久综合九色欧美综合狠狠| 五月婷婷激情综合| 欧美伊人久久久久久久久影院| 中文字幕一区二区三区蜜月 | 欧美色电影在线| 亚洲欧美综合在线精品| 国产精品1区二区.| 精品国产一区二区三区久久影院 | 麻豆91精品91久久久的内涵| 在线观看91视频| 亚洲猫色日本管| 91视视频在线观看入口直接观看www | 日本韩国精品在线| 国产精品嫩草久久久久| 国产成人a级片| 国产亚洲一本大道中文在线| 激情图区综合网| 亚洲精品在线免费播放| 久久se精品一区二区| 日韩午夜中文字幕| 青青草原综合久久大伊人精品| 精品视频999| 天天爽夜夜爽夜夜爽精品视频| 欧美日韩在线播| 亚洲超碰97人人做人人爱| 欧美撒尿777hd撒尿| 亚洲第一在线综合网站| 欧美日本视频在线| 日本最新不卡在线| 91精品国产综合久久福利软件| 天天色综合天天| 日韩精品影音先锋| 国产综合一区二区| 久久精品免视看| 成人精品小蝌蚪| 中文字幕制服丝袜一区二区三区| 成人免费va视频| 18成人在线视频| 日本韩国一区二区三区视频| 亚洲午夜精品久久久久久久久| 欧美日韩国产影片| 捆绑变态av一区二区三区| 欧美成人三级在线| 国产成人午夜视频| 亚洲三级电影网站| 欧美精品在线一区二区三区| 久久精品国产秦先生| 久久精子c满五个校花| 成年人国产精品| 亚洲老司机在线| 日韩视频在线你懂得| 国产中文字幕精品| 中文字幕一区二区三区精华液| 欧洲一区在线电影| 久久99久国产精品黄毛片色诱| 国产色产综合产在线视频| 91香蕉视频污| 青青草97国产精品免费观看| 久久久午夜精品| 一本久久a久久免费精品不卡| 性欧美大战久久久久久久久| 久久综合成人精品亚洲另类欧美 | 午夜精品福利一区二区三区蜜桃| 91精品国产综合久久香蕉麻豆 | 久久久久亚洲综合| 99精品一区二区三区| 日韩avvvv在线播放| 国产欧美日韩在线视频| 在线观看亚洲专区| 国产精品自产自拍| 亚洲一区二区视频在线| 欧美成va人片在线观看| 91麻豆文化传媒在线观看| 久久成人18免费观看| 亚洲欧美在线观看| 日韩精品一区二区三区四区视频| 成人av网站免费观看| 视频一区欧美精品| 国产精品久久久久aaaa| 日韩三级视频在线看| 91免费观看视频在线| 久久国产精品99久久久久久老狼| 成人免费在线播放视频| 日韩一级免费一区| 色综合激情五月| 国产不卡视频一区| 麻豆91精品视频| 亚洲午夜激情网页| 国产精品久久三| 2023国产精华国产精品| 欧美日韩一级片在线观看| 成人国产精品免费网站| 黑人巨大精品欧美一区| 性久久久久久久久久久久| ...xxx性欧美| 久久久噜噜噜久久人人看 | 日韩午夜精品电影| 色噜噜夜夜夜综合网| 国产99久久久国产精品| 裸体在线国模精品偷拍| 亚洲第一主播视频| 亚洲色欲色欲www| 国产欧美一区二区精品久导航| 欧美一区二区黄| 欧美日本一区二区三区四区| 91啪亚洲精品| 丁香激情综合国产| 国产精品一二一区| 国产综合久久久久影院| 日本成人中文字幕在线视频| 亚洲最大成人综合| 亚洲视频香蕉人妖| 国产精品拍天天在线| 国产日韩一级二级三级| 久久这里只有精品首页| 欧美成人三级在线| 欧美成人精品高清在线播放| 日韩一区二区免费在线电影| 91 com成人网| 91精品国产综合久久小美女| 欧美精品高清视频|