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

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

?? userlib.c

?? 飛思卡爾相關的codewarrior程序開發PortucosiiV252工程范例
?? 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一区二区三区免费野_久草精品视频
丝袜亚洲另类丝袜在线| 国产精品动漫网站| 99riav一区二区三区| 五月天婷婷综合| 中文字幕欧美日本乱码一线二线 | 欧美午夜在线一二页| 久久aⅴ国产欧美74aaa| 一区二区三区四区在线免费观看 | 国产a精品视频| 日韩av在线免费观看不卡| 亚洲人成7777| 中文在线一区二区| 久久综合久久鬼色中文字| 欧美人与禽zozo性伦| 99r精品视频| 国产一区999| 老司机精品视频一区二区三区| 亚洲另类在线一区| 中文字幕av不卡| 337p日本欧洲亚洲大胆色噜噜| 欧美性大战久久久| 91丨九色porny丨蝌蚪| 成人免费看片app下载| 国产一区二区三区在线观看免费 | 久久久久久久久久久黄色| 亚洲一线二线三线视频| 日韩欧美三级在线| 欧美片网站yy| 欧美区在线观看| 欧美日本高清视频在线观看| 在线观看亚洲精品视频| 97精品国产露脸对白| 成+人+亚洲+综合天堂| 国产盗摄女厕一区二区三区| 国产一区二区看久久| 国内一区二区视频| 国产一区二区三区综合| 国模少妇一区二区三区| 国模娜娜一区二区三区| 国产电影一区二区三区| 国产成都精品91一区二区三| 国产aⅴ精品一区二区三区色成熟| 麻豆91在线播放| 精品系列免费在线观看| 国产久卡久卡久卡久卡视频精品| 国产一区二区三区在线看麻豆| 国产精品一区专区| 成人美女视频在线观看18| 成人黄色电影在线| 91在线你懂得| 欧美性大战久久久久久久蜜臀| 欧美日韩一区二区三区视频| 3d成人动漫网站| 欧美变态tickle挠乳网站| 久久综合九色欧美综合狠狠 | www国产精品av| 久久精品一区二区三区不卡| 国产日韩欧美高清在线| 中文字幕亚洲一区二区va在线| 一区二区在线观看视频在线观看| 亚洲国产一区二区a毛片| 美国十次综合导航| 高清免费成人av| 色欧美日韩亚洲| 91精品国产一区二区三区蜜臀| 精品国产一区二区精华| 中文字幕日本乱码精品影院| 一区二区在线免费观看| 美女脱光内衣内裤视频久久网站 | 亚洲欧美日韩电影| 视频一区二区不卡| 国产精品123| 在线视频欧美区| 日韩精品中午字幕| 国产精品久久夜| 日韩精品电影在线| 大尺度一区二区| 欧美手机在线视频| 国产亚洲精品免费| 香蕉av福利精品导航| 国产精品亚洲第一| 欧美片网站yy| 欧美国产成人在线| 日韩国产成人精品| 成人综合在线视频| 7777精品久久久大香线蕉| 欧美国产综合一区二区| 亚洲va欧美va天堂v国产综合| 国产乱码精品一区二区三区av | 91蝌蚪porny成人天涯| 日韩一区二区影院| 亚洲视频在线一区二区| 激情综合网天天干| 欧美系列在线观看| 中文字幕av资源一区| 久久精品国产色蜜蜜麻豆| 色婷婷久久久亚洲一区二区三区 | 欧美日韩精品一区二区三区四区| 久久久久久久久久电影| 日韩电影在线免费看| 色综合网色综合| 国产蜜臀97一区二区三区| 另类小说图片综合网| 在线视频综合导航| 亚洲私人影院在线观看| 国产成人综合自拍| 日韩欧美激情在线| 香蕉影视欧美成人| 在线观看免费一区| 最新久久zyz资源站| 国产又黄又大久久| 日韩午夜激情视频| 日精品一区二区| 欧美亚一区二区| 亚洲免费在线观看视频| eeuss鲁片一区二区三区在线观看| 欧美成人猛片aaaaaaa| 首页综合国产亚洲丝袜| 欧美日韩在线不卡| 一区二区三区四区蜜桃 | 久久夜色精品国产噜噜av| 日韩av一级电影| 3751色影院一区二区三区| 亚洲国产日韩a在线播放性色| 色婷婷狠狠综合| 亚洲欧美日韩在线| 99riav一区二区三区| 国产精品国产三级国产aⅴ中文| 国产成人综合网| 国产视频视频一区| 国产99久久久久久免费看农村| 久久久久一区二区三区四区| 国产一二三精品| 久久精品欧美日韩| 国产精品资源网| 国产欧美日韩麻豆91| 成人黄色在线网站| 亚洲欧洲日产国码二区| 91麻豆6部合集magnet| 悠悠色在线精品| 欧美区在线观看| 美女任你摸久久| 337p粉嫩大胆色噜噜噜噜亚洲| 韩国三级中文字幕hd久久精品| 久久美女艺术照精彩视频福利播放| 国产精品影视天天线| 亚洲国产精品成人综合色在线婷婷| 国产成人在线视频网址| 成人免费在线视频| 欧美在线观看18| 日本美女视频一区二区| wwwwww.欧美系列| aaa欧美日韩| 亚洲国产视频一区二区| 日韩欧美一区二区免费| 经典三级视频一区| 国产精品久久一卡二卡| 欧洲一区二区av| 日韩精品一级中文字幕精品视频免费观看 | 中文字幕一区二区在线播放| 91香蕉视频黄| 五月婷婷综合激情| 精品国产自在久精品国产| 成人av网站在线| 天堂成人免费av电影一区| 欧美va在线播放| 色综合天天综合色综合av| 中文字幕一区二区视频| 在线视频你懂得一区| 亚洲高清免费观看高清完整版在线观看| 欧美人动与zoxxxx乱| 国产一区在线观看视频| 综合电影一区二区三区 | 中文字幕免费一区| 欧美调教femdomvk| 国产在线视频一区二区三区| 亚洲欧美综合在线精品| 69久久夜色精品国产69蝌蚪网| 国产麻豆成人精品| 一区二区成人在线视频| 精品久久久三级丝袜| 91蜜桃免费观看视频| 麻豆91精品视频| 国产成人av一区| 成+人+亚洲+综合天堂| 午夜久久久影院| 国产精品久久久久久久久动漫| 欧美视频精品在线| 成人免费视频app| 婷婷亚洲久悠悠色悠在线播放| 久久久久久久综合色一本| 91黄视频在线| 高清成人在线观看| 蜜桃一区二区三区四区| 亚洲久草在线视频| 国产日本欧洲亚洲| 日韩欧美一级精品久久| 在线一区二区视频| 成人动漫视频在线| 国产毛片精品视频|