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

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

?? ustdlib.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// ustdlib.c - Simple standard library functions.
//
// Copyright (c) 2007 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
//*****************************************************************************

#include <stdarg.h>
#include <string.h>
#include "debug.h"

//*****************************************************************************
//
//! \addtogroup utilities_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
// A mapping from an integer between 0 and 15 to its ASCII character
// equivalent.
//
//*****************************************************************************
static const char * const g_pcHex = "0123456789abcdef";

//*****************************************************************************
//
//! A simple vsnprintf function supporting \%c, \%d, \%s, \%u, \%x, and \%X.
//!
//! \param pcBuf points to the buffer where the converted string is stored.
//! \param ulSize is the size of the buffer.
//! \param pcString is the format string.
//! \param vaArgP is the list of optional arguments, which depend on the
//! contents of the format string.
//!
//! This function is very similar to the C library <tt>vsnprintf()</tt>
//! function. Only the following formatting characters are supported:
//!
//! - \%c to print a character
//! - \%d to print a decimal value
//! - \%s to print a string
//! - \%u to print an unsigned decimal value
//! - \%x to print a hexadecimal value using lower case letters
//! - \%X to print a hexadecimal value using lower case letters (not upper case
//! letters as would typically be used)
//! - \%\% to print out a \% character
//!
//! For \%d, \%u, \%x, and \%X, an optional number may reside between the \%
//! and the format character, which specifies the minimum number of characters
//! to use for that value; if preceeded by a 0 then the extra characters will
//! be filled with zeros instead of spaces.  For example, ``\%8d'' will use
//! eight characters to print the decimal value with spaces added to reach
//! eight; ``\%08d'' will use eight characters as well but will add zeros
//! instead of spaces.
//!
//! The type of the arguments after \b pcString must match the requirements of
//! the format string.  For example, if an integer was passed where a string
//! was expected, an error of some kind will most likely occur.
//!
//! The \b ulSize parameter limits the number of characters that will be
//! stored in the buffer pointed to by \b pcBuf to prevent the possibility
//! of a buffer overflow.  The buffer size should be large enough to hold
//! the expected converted output string, including the null termination
//! character.
//!
//! The function will return the number of characters that would be
//! converted as if there were no limit on the buffer size.  Therefore
//! it is possible for the function to return a count that is greater than
//! the specified buffer size.  If this happens, it means that the output
//! was truncated.
//!
//! \return the number of characters that were to be stored, not including
//! the NULL termination character, regardless of space in the buffer.
//
//*****************************************************************************
int
uvsnprintf(char *pcBuf, unsigned long ulSize, const char *pcString,
           va_list vaArgP)
{
    unsigned long ulIdx, ulValue, ulCount, ulBase;
    char *pcStr, cFill;
    int iConvertCount = 0;

    //
    // Check the arguments.
    //
    ASSERT(pcString != 0);
    ASSERT(pcBuf != 0);
    ASSERT(ulSize != 0);

    //
    // Adjust buffer size limit to allow one space for null termination.
    //
    if(ulSize)
    {
        ulSize--;
    }

    //
    // Initialize the count of characters converted.
    //
    iConvertCount = 0;

    //
    // Loop while there are more characters in the format string.
    //
    while(*pcString)
    {
        //
        // Find the first non-% character, or the end of the string.
        //
        for(ulIdx = 0; (pcString[ulIdx] != '%') && (pcString[ulIdx] != '\0');
            ulIdx++)
        {
        }

        //
        // Write this portion of the string to the output buffer.  If
        // there are more characters to write than there is space in the
        // buffer, then only write as much as will fit in the buffer.
        //
        if(ulIdx > ulSize)
        {
            strncpy(pcBuf, pcString, ulSize);
            pcBuf += ulSize;
            ulSize = 0;
        }
        else
        {
            strncpy(pcBuf, pcString, ulIdx);
            pcBuf += ulIdx;
            ulSize -= ulIdx;
        }

        //
        // Update the conversion count.  This will be the number of
        // characters that should have been written, even if there was
        // not room in the buffer.
        //
        iConvertCount += ulIdx;

        //
        // Skip the portion of the format string that was written.
        //
        pcString += ulIdx;

        //
        // See if the next character is a %.
        //
        if(*pcString == '%')
        {
            //
            // Skip the %.
            //
            pcString++;

            //
            // Set the digit count to zero, and the fill character to space
            // (i.e. to the defaults).
            //
            ulCount = 0;
            cFill = ' ';

            //
            // It may be necessary to get back here to process more characters.
            // Goto's aren't pretty, but effective.  I feel extremely dirty for
            // using not one but two of the beasts.
            //
again:

            //
            // Determine how to handle the next character.
            //
            switch(*pcString++)
            {
                //
                // Handle the digit characters.
                //
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                {
                    //
                    // If this is a zero, and it is the first digit, then the
                    // fill character is a zero instead of a space.
                    //
                    if((pcString[-1] == '0') && (ulCount == 0))
                    {
                        cFill = '0';
                    }

                    //
                    // Update the digit count.
                    //
                    ulCount *= 10;
                    ulCount += pcString[-1] - '0';

                    //
                    // Get the next character.
                    //
                    goto again;
                }

                //
                // Handle the %c command.
                //
                case 'c':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // Copy the character to the output buffer, if
                    // there is room.  Update the buffer size remaining.
                    //
                    if(ulSize != 0)
                    {
                        *pcBuf++ = (char)ulValue;
                        ulSize--;
                    }

                    //
                    // Update the conversion count.
                    //
                    iConvertCount++;

                    //
                    // This command has been handled.
                    //
                    break;
                }

                //
                // Handle the %d command.
                //
                case 'd':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // If the value is negative, make it positive and stick a
                    // minus sign in the beginning of the buffer.
                    //
                    if((long)ulValue < 0)
                    {
                        ulValue = -(long)ulValue;

                        if(ulSize != 0)
                        {
                            *pcBuf++ = '-';
                            ulSize--;
                        }

                        //
                        // Update the conversion count.
                        //
                        iConvertCount++;
                    }

                    //
                    // Set the base to 10.
                    //
                    ulBase = 10;

                    //
                    // Convert the value to ASCII.
                    //
                    goto convert;
                }

                //
                // Handle the %s command.
                //
                case 's':
                {
                    //
                    // Get the string pointer from the varargs.
                    //
                    pcStr = va_arg(vaArgP, char *);

                    //
                    // Determine the length of the string.
                    //
                    for(ulIdx = 0; pcStr[ulIdx] != '\0'; ulIdx++)
                    {
                    }

                    //
                    // Copy the string to the output buffer.  Only copy
                    // as much as will fit in the buffer.  Update the
                    // output buffer pointer and the space remaining.
                    //
                    if(ulIdx > ulSize)
                    {
                        strncpy(pcBuf, pcStr, ulSize);
                        pcBuf += ulSize;
                        ulSize = 0;
                    }
                    else
                    {
                        strncpy(pcBuf, pcStr, ulIdx);
                        pcBuf += ulIdx;
                        ulSize -= ulIdx;
                    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
7777精品伊人久久久大香线蕉的 | 精品国产一区久久| 亚洲人一二三区| 狠狠色狠狠色综合系列| 欧美日韩五月天| 亚洲欧洲精品一区二区三区不卡| 美女脱光内衣内裤视频久久网站| 成人国产一区二区三区精品| 日韩欧美国产一区二区三区| 亚洲激情校园春色| 成人黄页在线观看| 久久综合999| 久久精品国产99| 69久久夜色精品国产69蝌蚪网| 亚洲欧美偷拍卡通变态| 91蜜桃传媒精品久久久一区二区| 欧美一级高清大全免费观看| 一区二区三区精品| 91麻豆免费视频| 国产精品美女www爽爽爽| 国产乱子伦一区二区三区国色天香| 欧美精选一区二区| 亚洲国产成人tv| 精品视频免费看| 五月婷婷久久综合| 制服丝袜国产精品| 丝袜国产日韩另类美女| 欧美精品久久久久久久多人混战| 一区二区在线观看免费视频播放| 成人av在线影院| 国产精品超碰97尤物18| 成人h版在线观看| 国产精品蜜臀在线观看| 成人精品视频一区| ●精品国产综合乱码久久久久| 成人午夜视频免费看| 国产精品久线在线观看| 成人av免费观看| 亚洲欧美自拍偷拍色图| 日本丶国产丶欧美色综合| 亚洲已满18点击进入久久| 欧美在线观看视频一区二区| 亚洲国产aⅴ天堂久久| 9191久久久久久久久久久| 日韩成人一级大片| 欧美不卡视频一区| 国产成人在线观看免费网站| 中文字幕色av一区二区三区| 91黄色免费版| 麻豆精品新av中文字幕| 国产日韩欧美综合在线| 95精品视频在线| 亚洲电影一区二区| 日韩午夜av电影| 国产精品亚洲一区二区三区在线| 国产精品理论在线观看| 欧美日韩午夜影院| 韩国女主播成人在线观看| 国产精品动漫网站| 欧美高清精品3d| 国产成人av影院| 亚洲在线免费播放| 精品电影一区二区三区| 色中色一区二区| 麻豆精品国产91久久久久久| 中文字幕人成不卡一区| 欧美一区二区国产| www.av亚洲| 麻豆国产欧美日韩综合精品二区| 国产精品乱码久久久久久| 欧美放荡的少妇| 亚洲123区在线观看| 久久久亚洲欧洲日产国码αv| 一本到不卡免费一区二区| 看片的网站亚洲| 亚洲自拍偷拍综合| 中文字幕不卡在线观看| 538prom精品视频线放| 99国产精品久久久| 九色porny丨国产精品| 亚洲欧美韩国综合色| 国产亚洲欧美在线| 欧美精品一卡二卡| 色综合视频一区二区三区高清| 青草av.久久免费一区| 悠悠色在线精品| 国产欧美日韩麻豆91| 欧美一级免费观看| 在线观看免费成人| 成人激情视频网站| 国产麻豆9l精品三级站| 日本免费新一区视频| 亚洲国产精品尤物yw在线观看| 日本一区免费视频| 久久亚洲精华国产精华液| 欧美一级高清片在线观看| 欧美艳星brazzers| 色丁香久综合在线久综合在线观看| 国产剧情一区在线| 激情综合五月婷婷| 免费在线看成人av| 免费高清成人在线| 热久久一区二区| 日韩 欧美一区二区三区| 亚洲第一成人在线| 亚洲韩国一区二区三区| 一区二区三区在线视频观看| 国产精品的网站| 亚洲私人黄色宅男| 综合精品久久久| 亚洲免费成人av| 亚洲精品第一国产综合野| 日韩一区在线播放| 亚洲欧美日韩中文播放 | 欧美www视频| 精品久久久三级丝袜| 精品日产卡一卡二卡麻豆| 精品理论电影在线| 久久亚区不卡日本| 国产精品第13页| 一二三四区精品视频| 亚洲一区二区三区自拍| 日韩精品电影在线观看| 免费观看91视频大全| 国产一区二区三区免费播放| 国产美女一区二区三区| 国产成人免费视频网站高清观看视频 | 美女一区二区在线观看| 捆绑调教一区二区三区| 国产高清不卡二三区| a在线欧美一区| 欧美日韩三级视频| 精品国产乱子伦一区| 国产精品国产三级国产aⅴ入口 | 欧美精品久久久久久久多人混战| 日韩一级黄色大片| 国产日韩精品一区| 亚洲色欲色欲www| 日本午夜精品一区二区三区电影 | 国产婷婷色一区二区三区| 中文字幕精品一区 | 国产精品乱码久久久久久| 一区二区日韩av| 美女任你摸久久| 99re成人精品视频| 91精选在线观看| 国产欧美日韩综合| 亚洲一区二区三区视频在线| 蓝色福利精品导航| 色噜噜狠狠成人中文综合| 337p亚洲精品色噜噜狠狠| 久久女同性恋中文字幕| 亚洲综合视频网| 国产盗摄一区二区三区| 欧美日韩国产高清一区二区三区| 久久综合色之久久综合| 亚洲激情中文1区| 国产一区二区美女诱惑| 欧美性淫爽ww久久久久无| 久久男人中文字幕资源站| 亚洲午夜精品17c| 成年人网站91| 91精品国产入口| 亚洲免费毛片网站| 国精品**一区二区三区在线蜜桃| 日本久久精品电影| 国产欧美日韩综合| 久久99热国产| 欧美另类z0zxhd电影| 欧美激情一区二区在线| 久久精品理论片| 欧美色综合天天久久综合精品| 久久久亚洲综合| 美脚の诱脚舐め脚责91| 欧美日韩五月天| 亚洲一区二区三区自拍| 本田岬高潮一区二区三区| 精品国产一区二区三区av性色| 亚洲国产精品精华液网站| 色综合欧美在线视频区| 国产日韩欧美精品一区| 国产一区二区三区国产| 日韩午夜激情电影| 丝袜亚洲另类丝袜在线| 欧美制服丝袜第一页| 亚洲精品日韩一| 99久久国产综合精品女不卡| 国产精品青草久久| 成人性色生活片免费看爆迷你毛片| 欧美tickle裸体挠脚心vk| 日韩黄色免费电影| 91精品国产麻豆国产自产在线| 亚洲宅男天堂在线观看无病毒| 在线中文字幕一区二区| 一区二区三区四区中文字幕| 91在线视频在线| 亚洲乱码国产乱码精品精可以看| 99久久99久久精品免费观看| 国产精品视频免费看| 成人h精品动漫一区二区三区|