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

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

?? stdargv.c

?? C標準庫源代碼,能提高對C的理解,不錯的哦
?? C
字號:
/***
*stdargv.c - standard & wildcard _setargv routine
*
*       Copyright (c) 1989-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
*       processes program command line, with or without wildcard expansion
*
*******************************************************************************/


#include <cruntime.h>
#include <internal.h>
#include <rterr.h>
#include <stdlib.h>
#if defined (WILDCARD) || defined (_WIN32)
#include <dos.h>
#include <oscalls.h>
#endif  /* defined (WILDCARD) || defined (_WIN32) */
#ifdef _MBCS
#include <mbctype.h>
#endif  /* _MBCS */
#include <tchar.h>
#include <dbgint.h>

#define NULCHAR    _T('\0')
#define SPACECHAR  _T(' ')
#define TABCHAR    _T('\t')
#define DQUOTECHAR _T('\"')
#define SLASHCHAR  _T('\\')

/*
 * Flag to ensure multibyte ctype table is only initialized once
 */
extern int __mbctype_initialized;

#ifdef WPRFLAG
static void __cdecl wparse_cmdline(wchar_t *cmdstart, wchar_t **argv, wchar_t *args,
        int *numargs, int *numchars);
#else  /* WPRFLAG */
static void __cdecl parse_cmdline(char *cmdstart, char **argv, char *args,
        int *numargs, int *numchars);
#endif  /* WPRFLAG */

/***
*_setargv, __setargv - set up "argc" and "argv" for C programs
*
*Purpose:
*       Read the command line and create the argv array for C
*       programs.
*
*Entry:
*       Arguments are retrieved from the program command line,
*       pointed to by _acmdln.
*
*Exit:
*       "argv" points to a null-terminated list of pointers to ASCIZ
*       strings, each of which is an argument from the command line.
*       "argc" is the number of arguments.  The strings are copied from
*       the environment segment into space allocated on the heap/stack.
*       The list of pointers is also located on the heap or stack.
*       _pgmptr points to the program name.
*
*Exceptions:
*       Terminates with out of memory error if no memory to allocate.
*
*******************************************************************************/

#ifdef WILDCARD

#ifdef WPRFLAG
void __cdecl __wsetargv (
#else  /* WPRFLAG */
void __cdecl __setargv (
#endif  /* WPRFLAG */

#else  /* WILDCARD */

#ifdef WPRFLAG
void __cdecl _wsetargv (
#else  /* WPRFLAG */
void __cdecl _setargv (
#endif  /* WPRFLAG */

#endif  /* WILDCARD */
    void
    )
{
        _TSCHAR *p;
        _TSCHAR *cmdstart;                  /* start of command line to parse */
        int numargs, numchars;

        static _TSCHAR _pgmname[ MAX_PATH ];

#if !defined (CRTDLL) && defined (_MBCS)
        /* If necessary, initialize the multibyte ctype table. */
        if ( __mbctype_initialized == 0 )
            __initmbctable();
#endif  /* !defined (CRTDLL) && defined (_MBCS) */

        /* Get the program name pointer from Win32 Base */

        GetModuleFileName( NULL, _pgmname, sizeof( _pgmname ) / sizeof(_TSCHAR));
#ifdef WPRFLAG
        _wpgmptr = _pgmname;
#else  /* WPRFLAG */
        _pgmptr = _pgmname;
#endif  /* WPRFLAG */

        /* if there's no command line at all (won't happen from cmd.exe, but
           possibly another program), then we use _pgmptr as the command line
           to parse, so that argv[0] is initialized to the program name */

#ifdef WPRFLAG
        cmdstart = (*_wcmdln == NULCHAR) ? _wpgmptr : _wcmdln;
#else  /* WPRFLAG */
        cmdstart = (*_acmdln == NULCHAR) ? _pgmptr : _acmdln;
#endif  /* WPRFLAG */

        /* first find out how much space is needed to store args */
#ifdef WPRFLAG
        wparse_cmdline(cmdstart, NULL, NULL, &numargs, &numchars);
#else  /* WPRFLAG */
        parse_cmdline(cmdstart, NULL, NULL, &numargs, &numchars);
#endif  /* WPRFLAG */

        /* allocate space for argv[] vector and strings */
        p = _malloc_crt(numargs * sizeof(_TSCHAR *) + numchars * sizeof(_TSCHAR));
        if (p == NULL)
            _amsg_exit(_RT_SPACEARG);

        /* store args and argv ptrs in just allocated block */

#ifdef WPRFLAG
        wparse_cmdline(cmdstart, (wchar_t **)p, (wchar_t *)(((char *)p) + numargs * sizeof(wchar_t *)), &numargs, &numchars);
#else  /* WPRFLAG */
        parse_cmdline(cmdstart, (char **)p, p + numargs * sizeof(char *), &numargs, &numchars);
#endif  /* WPRFLAG */

        /* set argv and argc */
        __argc = numargs - 1;
#ifdef WPRFLAG
        __wargv = (wchar_t **)p;
#else  /* WPRFLAG */
        __argv = (char **)p;
#endif  /* WPRFLAG */

#ifdef WILDCARD

        /* call _[w]cwild to expand wildcards in arg vector */
#ifdef WPRFLAG
        if (_wcwild())
#else  /* WPRFLAG */
        if (_cwild())
#endif  /* WPRFLAG */
            _amsg_exit(_RT_SPACEARG);   /* out of space */

#endif  /* WILDCARD */
}


/***
*static void parse_cmdline(cmdstart, argv, args, numargs, numchars)
*
*Purpose:
*       Parses the command line and sets up the argv[] array.
*       On entry, cmdstart should point to the command line,
*       argv should point to memory for the argv array, args
*       points to memory to place the text of the arguments.
*       If these are NULL, then no storing (only coujting)
*       is done.  On exit, *numargs has the number of
*       arguments (plus one for a final NULL argument),
*       and *numchars has the number of bytes used in the buffer
*       pointed to by args.
*
*Entry:
*       _TSCHAR *cmdstart - pointer to command line of the form
*           <progname><nul><args><nul>
*       _TSCHAR **argv - where to build argv array; NULL means don't
*                       build array
*       _TSCHAR *args - where to place argument text; NULL means don't
*                       store text
*
*Exit:
*       no return value
*       int *numargs - returns number of argv entries created
*       int *numchars - number of characters used in args buffer
*
*Exceptions:
*
*******************************************************************************/

#ifdef WPRFLAG
static void __cdecl wparse_cmdline (
#else  /* WPRFLAG */
static void __cdecl parse_cmdline (
#endif  /* WPRFLAG */
    _TSCHAR *cmdstart,
    _TSCHAR **argv,
    _TSCHAR *args,
    int *numargs,
    int *numchars
    )
{
        _TSCHAR *p;
        _TUCHAR c;
        int inquote;                    /* 1 = inside quotes */
        int copychar;                   /* 1 = copy char to *args */
        unsigned numslash;              /* num of backslashes seen */

        *numchars = 0;
        *numargs = 1;                   /* the program name at least */

        /* first scan the program name, copy it, and count the bytes */
        p = cmdstart;
        if (argv)
            *argv++ = args;

#ifdef WILDCARD
        /* To handle later wild card expansion, we prefix each entry by
        it's first character before quote handling.  This is done
        so _[w]cwild() knows whether to expand an entry or not. */
        if (args)
            *args++ = *p;
        ++*numchars;

#endif  /* WILDCARD */

        /* A quoted program name is handled here. The handling is much
           simpler than for other arguments. Basically, whatever lies
           between the leading double-quote and next one, or a terminal null
           character is simply accepted. Fancier handling is not required
           because the program name must be a legal NTFS/HPFS file name.
           Note that the double-quote characters are not copied, nor do they
           contribute to numchars. */
        if ( *p == DQUOTECHAR ) {
            /* scan from just past the first double-quote through the next
               double-quote, or up to a null, whichever comes first */
            while ( (*(++p) != DQUOTECHAR) && (*p != NULCHAR) ) {

#ifdef _MBCS
                if (_ismbblead(*p)) {
                    ++*numchars;
                    if ( args )
                        *args++ = *p++;
                }
#endif  /* _MBCS */
                ++*numchars;
                if ( args )
                    *args++ = *p;
            }
            /* append the terminating null */
            ++*numchars;
            if ( args )
                *args++ = NULCHAR;

            /* if we stopped on a double-quote (usual case), skip over it */
            if ( *p == DQUOTECHAR )
                p++;
        }
        else {
            /* Not a quoted program name */
            do {
                ++*numchars;
                if (args)
                    *args++ = *p;

                c = (_TUCHAR) *p++;
#ifdef _MBCS
                if (_ismbblead(c)) {
                    ++*numchars;
                    if (args)
                        *args++ = *p;   /* copy 2nd byte too */
                    p++;  /* skip over trail byte */
                }
#endif  /* _MBCS */

            } while ( c != SPACECHAR && c != NULCHAR && c != TABCHAR );

            if ( c == NULCHAR ) {
                p--;
            } else {
                if (args)
                    *(args-1) = NULCHAR;
            }
        }

        inquote = 0;

        /* loop on each argument */
        for(;;) {

            if ( *p ) {
                while (*p == SPACECHAR || *p == TABCHAR)
                    ++p;
            }

            if (*p == NULCHAR)
                break;              /* end of args */

            /* scan an argument */
            if (argv)
                *argv++ = args;     /* store ptr to arg */
            ++*numargs;

#ifdef WILDCARD
        /* To handle later wild card expansion, we prefix each entry by
        it's first character before quote handling.  This is done
        so _[w]cwild() knows whether to expand an entry or not. */
        if (args)
            *args++ = *p;
        ++*numchars;

#endif  /* WILDCARD */

        /* loop through scanning one argument */
        for (;;) {
            copychar = 1;
            /* Rules: 2N backslashes + " ==> N backslashes and begin/end quote
               2N+1 backslashes + " ==> N backslashes + literal "
               N backslashes ==> N backslashes */
            numslash = 0;
            while (*p == SLASHCHAR) {
                /* count number of backslashes for use below */
                ++p;
                ++numslash;
            }
            if (*p == DQUOTECHAR) {
                /* if 2N backslashes before, start/end quote, otherwise
                    copy literally */
                if (numslash % 2 == 0) {
                    if (inquote) {
                        if (p[1] == DQUOTECHAR)
                            p++;    /* Double quote inside quoted string */
                        else        /* skip first quote char and copy second */
                            copychar = 0;
                    } else
                        copychar = 0;       /* don't copy quote */

                    inquote = !inquote;
                }
                numslash /= 2;          /* divide numslash by two */
            }

            /* copy slashes */
            while (numslash--) {
                if (args)
                    *args++ = SLASHCHAR;
                ++*numchars;
            }

            /* if at end of arg, break loop */
            if (*p == NULCHAR || (!inquote && (*p == SPACECHAR || *p == TABCHAR)))
                break;

            /* copy character into argument */
#ifdef _MBCS
            if (copychar) {
                if (args) {
                    if (_ismbblead(*p)) {
                        *args++ = *p++;
                        ++*numchars;
                    }
                    *args++ = *p;
                } else {
                    if (_ismbblead(*p)) {
                        ++p;
                        ++*numchars;
                    }
                }
                ++*numchars;
            }
            ++p;
#else  /* _MBCS */
            if (copychar) {
                if (args)
                    *args++ = *p;
                ++*numchars;
            }
            ++p;
#endif  /* _MBCS */
            }

            /* null-terminate the argument */

            if (args)
                *args++ = NULCHAR;          /* terminate string */
            ++*numchars;
        }

        /* We put one last argument in -- a null ptr */
        if (argv)
            *argv++ = NULL;
        ++*numargs;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久99久久久久| 国内精品免费**视频| 国产欧美精品国产国产专区| 欧美一区二区在线视频| 91 com成人网| 日韩免费高清视频| 欧美r级在线观看| 久久网这里都是精品| 国产精品久久久久aaaa樱花| 亚洲欧美偷拍三级| 一区二区三区四区不卡视频| 亚洲高清免费视频| 久久电影网电视剧免费观看| 久久av资源站| 成人国产精品免费观看视频| 色av一区二区| 日韩视频一区二区| 欧美精品一区二区三区蜜桃视频| 精品区一区二区| 国产精品女主播av| 亚洲成人av中文| 蜜臀av性久久久久蜜臀aⅴ| 国产自产高清不卡| 94色蜜桃网一区二区三区| 欧美日本韩国一区二区三区视频| 欧美精品一区二区三区一线天视频 | 国产精品一线二线三线| 国产aⅴ精品一区二区三区色成熟| 成+人+亚洲+综合天堂| 欧美蜜桃一区二区三区| 久久久久久久久久电影| 亚洲综合免费观看高清完整版 | 精品国产91九色蝌蚪| 国产精品的网站| 亚洲国产一区视频| 韩国理伦片一区二区三区在线播放| 成人av综合一区| 日韩一区二区三区在线视频| 亚洲欧洲精品天堂一级 | 欧美高清www午色夜在线视频| 欧美日韩国产美| 欧美国产精品v| 青青草国产成人99久久| 一本大道av一区二区在线播放| 日韩一级片网址| 亚洲乱码国产乱码精品精的特点| 秋霞午夜鲁丝一区二区老狼| 在线一区二区三区做爰视频网站| 26uuu精品一区二区| 日韩制服丝袜先锋影音| 91网址在线看| 中文字幕乱码亚洲精品一区| 美腿丝袜亚洲一区| 在线一区二区视频| 国产精品电影院| 国产成人精品www牛牛影视| 91精品蜜臀在线一区尤物| 亚洲欧美激情一区二区| 国产成人精品影视| 日韩一级视频免费观看在线| 亚洲v中文字幕| 在线精品视频免费观看| 亚洲天堂精品在线观看| 成人国产精品免费观看| 久久久久久久久久久电影| 国产在线精品一区二区夜色| 91麻豆精品国产综合久久久久久| 亚洲自拍都市欧美小说| 色综合天天综合网天天狠天天| 国产精品国产三级国产三级人妇 | 欧美精品日韩精品| 一区二区三区久久久| 色综合久久综合网| 亚洲免费高清视频在线| 色婷婷综合久色| 亚洲精品精品亚洲| 欧美日韩亚洲综合在线| 日韩和欧美一区二区三区| 5566中文字幕一区二区电影 | 国产乱色国产精品免费视频| 久久影院视频免费| 九九精品视频在线看| 欧美成va人片在线观看| 黄色小说综合网站| 国产午夜精品一区二区三区嫩草 | 国产精品超碰97尤物18| 成人av免费观看| 亚洲欧美激情一区二区| 欧美日韩一区二区三区高清| 日本午夜精品一区二区三区电影| 精品91自产拍在线观看一区| 成人激情动漫在线观看| 亚洲午夜日本在线观看| 777色狠狠一区二区三区| 久久99精品国产麻豆婷婷| 久久先锋资源网| 色综合天天综合在线视频| 日日夜夜精品视频免费 | 99精品国产99久久久久久白柏| 一区二区三区免费看视频| 日韩一级片网站| 成人激情综合网站| 亚洲v日本v欧美v久久精品| 日韩欧美黄色影院| 99久久99久久免费精品蜜臀| 图片区日韩欧美亚洲| 精品国产乱码久久久久久图片 | 日韩成人一区二区三区在线观看| 精品电影一区二区| 欧美在线播放高清精品| 国产一区二区影院| 亚洲成av人片一区二区| 久久久不卡网国产精品二区| 欧美亚洲国产怡红院影院| 久久超碰97人人做人人爱| 日韩理论在线观看| 欧美精品一区二区三区高清aⅴ| 色哟哟一区二区| 国产成人精品影院| 日本不卡在线视频| 亚洲精品国产a久久久久久 | 99久久99久久精品免费看蜜桃| 日本伊人精品一区二区三区观看方式| 中文字幕av一区二区三区高| 日韩精品一区国产麻豆| 91老司机福利 在线| 国产成人综合在线观看| 日韩国产欧美三级| 亚洲制服丝袜在线| 中文字幕制服丝袜成人av| 久久婷婷色综合| 91精品久久久久久蜜臀| 在线看国产一区二区| 成人av资源网站| 福利一区二区在线观看| 国产一区二区91| 韩国一区二区视频| 麻豆精品在线视频| 琪琪一区二区三区| 日韩专区在线视频| 天堂av在线一区| 亚洲一本大道在线| 亚洲一区二区在线免费看| 亚洲精品免费电影| 亚洲美女精品一区| 亚洲免费观看高清完整版在线观看熊 | 精品视频资源站| 欧美系列在线观看| 欧美性受xxxx黑人xyx性爽| 色欧美乱欧美15图片| 在线精品视频免费播放| 欧美在线影院一区二区| 色婷婷综合久久久中文一区二区 | 欧美亚洲图片小说| 欧美日韩色一区| 777a∨成人精品桃花网| 欧美一二三四在线| 精品国产a毛片| 国产午夜精品理论片a级大结局| 国产欧美精品国产国产专区| 国产色综合久久| 国产精品视频第一区| 综合色天天鬼久久鬼色| 一区二区三区在线视频免费观看| 亚洲午夜久久久久久久久电影院| 亚洲成人激情自拍| 精品一区精品二区高清| 国产精品456露脸| 色悠久久久久综合欧美99| 欧美日本在线看| 精品免费日韩av| 国产精品久久久久四虎| 亚洲电影在线播放| 精品一区二区三区蜜桃| www.在线欧美| 欧美日韩www| 欧美国产精品一区二区三区| 亚洲欧美国产三级| 老色鬼精品视频在线观看播放| 懂色av一区二区在线播放| 在线看不卡av| 亚洲精品一区在线观看| 亚洲免费观看高清完整| 免费久久99精品国产| jizz一区二区| 日韩欧美成人一区| 亚洲欧洲精品成人久久奇米网| 丝袜诱惑制服诱惑色一区在线观看| 久久99精品国产麻豆不卡| 成人av午夜影院| 日韩一区二区在线看| 综合久久久久综合| 国内精品久久久久影院色| 一本一本大道香蕉久在线精品| 日韩欧美中文字幕一区| 国产精品久久久久久久岛一牛影视| 欧美bbbbb| 在线日韩国产精品| 国产精品污网站| 久久成人羞羞网站|