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

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

?? userlib.c

?? codewarrior_Samples.rar
?? C
字號:
#include "includes.h"
#define EXT extern
#include "main.h"


/*********************************************************************/

/* printp() ------------ a simply version of printf()                */

/**********************************************************************/
/* with the help of printp() function, you can get the out format as below:
   printp("This first line outputs the format string.\n");
   printp("%s\n","This second line outputs a string.");
   printp( "Notice that the first %s\n","two output lines had CR/LF at the end.");
   printp( "%c%c%c%c line outputs 'This' as chars.\n",'T', 'h', 'i', 's');
   printp( "Dec values: %d  %d   Hex value: %x\n",dec_value, neg_value, hex_value);
   printp( "Long dec values: %ld  %ld\n",ldec_value,lneg_value);
   printp( "Output sized strings: %20s %-20s\n","Right string","Left string");
   printp( "Output sized values:  %20d %-20d\n",dec_value,neg_value);
   printp( "                      %20x %-20x\n",hex_value,hex_value);
   printp( "                      %20ld %-20ld\n",ldec_value,ldec_value);
where the variables can be as:
   int hex_value = 0x1234;
   int dec_value = 1234;
   int neg_value = -1234;
   long ldec_value = 12345678L;
   long lneg_value = -12345678L;


修改了部分printp()代碼,
 打印時如果 %后面的x,d為大寫,打印的數作為無符號數
                      為小寫,作為有符號數
                 加l為取長型變量。

例如打印如下語句:

	printp("\n here i is 0xF123ABCD, j is 0xF123");
	printp("\n 1 : %%lX i is: %lX",i);
	printp("\n 2 : %%lx i is: %lx",i);
	printp("\n 3 : %%lD i is: %lD",i);
	printp("\n 4 : %%ld i is: %ld",i);
	printp("\n 5 : %%8X i is: %8X",i);
	printp("\n 6 : %%8x i is: %8x",i);
	printp("\n 7 : %%8D i is: %8D",i);
	printp("\n 8 : %%8d i is: %8d",i);
	printp("\n 9 :  %%X j is: %X",j);
	printp("\n 10:  %%x j is: %x",j);
	printp("\n 11:  %%D j is: %D",j);
	printp("\n 12:  %%d j is: %d",j);
結果為:
	 here i is 0xF123ABCD, j is 0xF123
	 1 : %lX i is: F123ABCD
	 2 : %lx i is: -EDC5433
	 3 : %lD i is: 4045646797
	 4 : %ld i is: -249320499
	 5 : %8X i is:     F123
	 6 : %8x i is:     -EDD
	 7 : %8D i is:    61731
	 8 : %8d i is:    -3805
	 9 :  %X j is: F123
	 10:  %x j is: -EDD
	 11:  %D j is: 61731
	 12:  %d j is: -3805  */
 
/************************************************************************/
#include <ctype.h>
#include <string.h>
#include <stdarg.h>

#ifndef  TRUE
#define  TRUE 1
#endif
#ifndef  FALSE
#define  FALSE 0
#endif

#define CR_as_CRLF  TRUE             // if true , you can use "\n" to act as CR/LF, 
                                     // if false , you have to use "\n\r",but can get a higher speed
static int do_padding;
static int left_flag;
static int len;
static int num1;					//number before dot. as 45 in %45.34s format.
static int num2;					//number after  dot. as 34 in %45.34s format. and num2 is only used in s format
static char pad_character;
/*---------------------------------------------------*/
/*                                                   */
/* This routine puts pad characters into the output  */
/* buffer.                                           */
/*                                                   */
static void padding(void (*PortToPut)(), const int l_flag)
{
   int i;

   if (do_padding && l_flag && (len < num1))
      for (i=len; i<num1; i++)
          PortToPut( pad_character);
   }

/*---------------------------------------------------*/
/*                                                   */
/* This routine moves a string to the output buffer  */
/* as directed by the padding and positioning flags. */
/*                                                   */
static void outs(void (*PortToPut)(), char* lp)
{
   /* pad on left if needed                          */
   len = strlen( lp);
   padding(PortToPut, !left_flag);

   /* Move string to the buffer                      */
   while (*lp && num2--)
      PortToPut( *lp++);

   /* Pad on right if needed                         */
   len = strlen( lp);
   padding(PortToPut, left_flag);
   }

/*---------------------------------------------------*/
/*                                                   */
/* This routine moves a number to the output buffer  */
/* as directed by the padding and positioning flags. */
/*                                                   */
static void reoutnum(void (*PortToPut)(),unsigned long num, unsigned int negative, const long base ) 
{
   char* cp;
   char outbuf[32];
   const char digits[] = "0123456789ABCDEF";
   
   /* Build number (backwards) in outbuf             */
   cp = outbuf;
   do {
      *cp++ = digits[(int)(num % base)];
      } while ((num /= base) > 0);
   if (negative)
      *cp++ = '-';
   *cp-- = 0;								//add a 0 in buffer is to use strlen function below

   /* Move the converted number to the buffer and    */
   /* add in the padding where needed.               */
   len = strlen(outbuf);
   padding(PortToPut, !left_flag);
   while (cp >= outbuf)
      PortToPut( *cp--);
   padding(PortToPut, left_flag);
}


static void outnum(void (*PortToPut)(),long num, const long base ,unsigned char sign)//1, signed  0 unsigned
{   unsigned int negative;

   if ( (num < 0L) && sign ) 
   {  negative=1;
      num = -num;
      }
   else negative=0;
   
   reoutnum(PortToPut,num,negative,base);  
} 
/*---------------------------------------------------*/
/*                                                   */
/* This routine gets a number from the format        */
/* string.                                           */
/*                                                   */
static int getnum( char** linep)						//in this routine ,the return value is the number after % or dot、-、l.
{														//and the ctrl(pointer to the format string) will change too.
   int n;
   char* cp;

   n = 0;
   cp = *linep;
   while (isdigit(*cp))
      n = n*10 + ((*cp++) - '0');
   *linep = cp;
   return(n);
}

/*---------------------------------------------------*/
/*                                                   */
/* This routine operates just like a printf/sprintf  */
/* routine. It outputs a set of data under the       */
/* control of a formatting string. Not all of the    */
/* standard C format control are supported. The ones */
/* provided are primarily those needed for embedded  */
/* systems work. Primarily the floaing point         */
/* routines are omitted. Other formats could be      */
/* added easily by following the examples shown for  */
/* the supported formats.                            */
/*                                                   */

void printp(void (*PortToPut)(), char* ctrl, ...)
{

   int long_flag;
   int dot_flag;										//dot_flag is only used in s format

   char ch;
   va_list argp;

   va_start( argp, ctrl);

   for ( ; *ctrl; ctrl++) {								//at the begin of for loop, check the char pointed by ctrl
														//if a %, extract numbers after % if they exist;
      /* move format string chars to buffer until a  */ //        then begin the format conversion and putout.
      /* format control is found.                    */ //if not a %, putout the char and start next for loop.
      if (*ctrl != '%') {
         PortToPut(*ctrl);
#if CR_as_CRLF==TRUE         
         if(*ctrl=='\n') PortToPut('\r');
#endif         
         continue;
         }

      /* initialize all the flags for this format.   */
      dot_flag   =
      long_flag  =
      left_flag  =
      do_padding = 0;
      pad_character = ' ';
      num2=32767;					// largest unsigned number

try_next:
      ch = *(++ctrl);

      if (isdigit(ch)) {
         if (dot_flag)
            num2 = getnum(&ctrl);
         else {
            if (ch == '0')
               pad_character = '0';

            num1 = getnum(&ctrl);		//in getnum function, ctrl is changed to point to the next value after numbers 
            do_padding = 1;				//in the format string.
         }
         ctrl--;				//here, adjust ctrl point to the last char in numbers to fit the sentense ch = *(++ctrl);
         goto try_next;
      }

      switch (tolower(ch)) {		//the ch is the char after % or %numbers in format string
         case '%':
              PortToPut( '%');
              continue;				//if %, putout % and start next for loop

         case '-':
              left_flag = 1;
              break;				//if -,  left align    out switch and goto try_next to see the next char
									//go to try_next to get another format char
         case '.':
              dot_flag = 1;
              break;				//a number after dot is used in s format to direct the out char number
									//go to try_next to get another format char
         case 'l':
              long_flag = 1;		
              break;				//l means long
									//go to try_next to get another format char
         case 'd':		//D unsigned ,  d signed
              if (long_flag ==1 ) {
              		if(ch == 'D')                {outnum(PortToPut, va_arg(argp, unsigned long), 10L , 0);continue;}
              	        else  /* ch == 'd' */        {outnum(PortToPut, va_arg(argp, long), 10L,1);continue;}
                 }								//va_arg will extract a special type argument from the stack
              else {							//and adjust the argp to point to next argument in stack
              		if(ch == 'D')                {outnum(PortToPut, va_arg(argp, unsigned int),10L,0);continue;}
              		else  /* ch == 'd' */        {outnum(PortToPut, va_arg(argp, int), 10L,1);continue;}
                }
                
         case 'x':    // X unsigned , x  signed
              if (long_flag ==1 )  {
              	        if(ch == 'X')                {outnum(PortToPut, va_arg(argp, unsigned long), 16L,0);continue;}
              	        else  /* ch == 'x' */        {outnum(PortToPut, va_arg(argp, long), 16L,1);continue;} 
                 }
              else {
              		if(ch == 'X')                {outnum(PortToPut, va_arg(argp, unsigned int), 16L,0);continue;}
              		else  /* ch == 'x' */        {outnum(PortToPut, va_arg(argp, int), 16L,1);continue;}
                 } 

         case 's':
              outs(PortToPut, va_arg( argp, char*));
              continue;				//output a string with special format as -10.8s and start next for loop

         case 'c':
              PortToPut( va_arg( argp, int));
              continue;				//output a char and start next for loop

         default:
              continue;
         }
      goto try_next;				//execute only if there is '-' or '.' or 'l' in format
      }								//end of for loop
   va_end( argp);					//end arguments extraction
   }


/***********delay(long j)*************/

void delay(long j){
long i;
for(i=0;i<j;i++)
{};
}
	








?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av中文字幕| 欧美日本一区二区| 欧美精品久久99久久在免费线| 欧美日本一区二区在线观看| 欧美国产日韩a欧美在线观看| 亚洲综合男人的天堂| 精品一区二区免费在线观看| 在线观看成人免费视频| 中文一区二区完整视频在线观看 | 精品久久久久一区二区国产| 99riav一区二区三区| 免费在线看一区| 亚洲欧洲制服丝袜| 国产精品美女一区二区三区| 91同城在线观看| 青青草国产成人99久久| 亚洲第一会所有码转帖| 777色狠狠一区二区三区| 成人综合婷婷国产精品久久| 亚洲一级二级在线| 一区二区三区蜜桃网| 亚洲永久免费视频| 成人深夜视频在线观看| 精品国产电影一区二区| 日韩精品乱码av一区二区| 91美女福利视频| 亚洲欧美综合色| 懂色av一区二区三区免费观看| 精品伦理精品一区| 国产一区日韩二区欧美三区| 日韩美女主播在线视频一区二区三区| 亚洲18影院在线观看| 在线视频中文字幕一区二区| 依依成人精品视频| 色一情一乱一乱一91av| 亚洲品质自拍视频网站| 日本韩国欧美三级| 亚洲超丰满肉感bbw| 欧美性xxxxxx少妇| 午夜精品久久久久久久99樱桃 | 一区二区三区四区在线播放 | 国产精品传媒在线| 91在线精品一区二区| 亚洲精品少妇30p| 在线欧美日韩精品| 石原莉奈一区二区三区在线观看 | 日本欧美一区二区| 欧美一区二区三区精品| 久久成人18免费观看| 久久久美女毛片| www.日韩在线| 亚洲一区二区三区三| 欧美日韩免费一区二区三区视频 | 欧美v亚洲v综合ⅴ国产v| 精品亚洲免费视频| 国产欧美日韩在线| 91福利资源站| 美女mm1313爽爽久久久蜜臀| 国产亚洲视频系列| 91麻豆福利精品推荐| 日韩亚洲欧美在线| 一区二区三区在线播| 色婷婷久久综合| 欧美一二三区在线观看| 亚洲国产精华液网站w| 青青草国产精品97视觉盛宴| 成人福利在线看| 欧美一区二区视频在线观看2022 | 97久久超碰国产精品电影| 久久日一线二线三线suv| 国产精品激情偷乱一区二区∴| 蜜桃视频一区二区| 亚洲色图.com| 日韩一区二区麻豆国产| 99re这里只有精品首页| 奇米色一区二区| 国产精品女同一区二区三区| 欧美日韩在线观看一区二区| 国产精品白丝jk黑袜喷水| 一区二区国产视频| 国产日韩综合av| 欧美精品久久天天躁| 9久草视频在线视频精品| 久久99在线观看| 亚洲激情在线播放| 久久久国际精品| 7777精品久久久大香线蕉 | 久久久久久免费毛片精品| 欧洲亚洲精品在线| 成人国产精品免费| 极品少妇xxxx精品少妇| 亚洲国产成人tv| 亚洲色图另类专区| 国产日韩综合av| 久久一留热品黄| 欧美一区二区三区电影| 欧美日韩在线免费视频| 色哟哟一区二区三区| 国产1区2区3区精品美女| 卡一卡二国产精品| 婷婷国产在线综合| 亚洲已满18点击进入久久| 国产精品久久综合| 久久久久国产精品厨房| 久久综合av免费| 精品久久久网站| 欧美videos大乳护士334| 日韩欧美国产wwwww| 5月丁香婷婷综合| 欧美日韩一区二区三区不卡| 欧美在线高清视频| 欧美亚洲禁片免费| 精品污污网站免费看| 欧美三级日韩在线| 欧美人狂配大交3d怪物一区| 欧美色电影在线| 欧美高清性hdvideosex| 欧美久久久久免费| 日韩免费在线观看| wwww国产精品欧美| 中文字幕av一区二区三区| 国产女人18毛片水真多成人如厕| 国产欧美日韩一区二区三区在线观看 | 欧美一区二区精品| 欧美不卡一区二区三区四区| 精品国产青草久久久久福利| 久久久三级国产网站| 国产拍欧美日韩视频二区| 国产亲近乱来精品视频| 国产精品欧美极品| 亚洲一区二区美女| 蜜桃av噜噜一区| 成人污污视频在线观看| 色婷婷香蕉在线一区二区| 69成人精品免费视频| 2欧美一区二区三区在线观看视频| 久久美女高清视频| 最新欧美精品一区二区三区| 亚洲狠狠爱一区二区三区| 日本欧美在线观看| 国产成人av资源| 欧美伊人久久久久久久久影院 | 国产成人久久精品77777最新版本| www.欧美亚洲| 欧美年轻男男videosbes| 精品国产一区二区三区不卡| 国产精品美女一区二区三区| 午夜精品福利一区二区三区av| 日本大胆欧美人术艺术动态| 激情综合亚洲精品| 五月婷婷激情综合| 韩国av一区二区三区四区| 日一区二区三区| 国产成人三级在线观看| 狠狠色丁香婷婷综合| 国产成人综合亚洲91猫咪| 国产福利不卡视频| 国产v综合v亚洲欧| 在线视频国内一区二区| 在线成人免费视频| 久久人人97超碰com| 亚洲第一会所有码转帖| 九色porny丨国产精品| 国产91精品免费| 91麻豆6部合集magnet| 亚洲精品一区二区在线观看| 国产精品欧美一区二区三区| 亚洲成人7777| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 在线观看成人小视频| 日韩午夜在线观看| 国产精品麻豆久久久| 日韩中文字幕区一区有砖一区| 99麻豆久久久国产精品免费优播| 欧美精品色综合| 国产精品网站在线| 一区二区三区四区乱视频| 丁香婷婷综合激情五月色| 欧美色视频一区| 国产日产欧美精品一区二区三区| 午夜精品aaa| 成人丝袜高跟foot| 91精品国产日韩91久久久久久| 日本一区二区不卡视频| 韩国女主播一区| 欧美性生活大片视频| 久久午夜羞羞影院免费观看| 蜜桃视频免费观看一区| 91蜜桃在线免费视频| www欧美成人18+| 日韩**一区毛片| 成人91在线观看| 久久综合精品国产一区二区三区| 亚洲第一会所有码转帖| 91免费观看在线| 国产精品麻豆网站| 亚洲一区中文日韩| 欧美a级理论片| 日韩一区欧美二区| av激情亚洲男人天堂|