• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ printstr函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中printstr函数的典型用法代码示例。如果您正苦于以下问题:C++ printstr函数的具体用法?C++ printstr怎么用?C++ printstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了printstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: printmenuhelp

static void printmenuhelp(int y)
{
	setcurs(0, y);
	printstr("Use the arrow keys or TAB to navigate,"); newln(0);
	printstr("ENTER to proceed, BACKSPACE or ESC to");  newln(0);
	printstr("go back.  Exit at once with Q.");
}
开发者ID:gsrr,项目名称:Python,代码行数:7,代码来源:men_allegro.c


示例2: load_file

static int
load_file(EFI_BLOCK_IO *blkio, EFI_LBA *head, UINTN *size, unsigned char *base)
{
	unsigned char *pagesp = base;
	UINTN pages;
	EFI_STATUS status;

	pages = *size / 4096;
	if (*size % 4096)
		++pages;

	status = BS->AllocatePages(AllocateAddress, EfiLoaderData, pages, (EFI_PHYSICAL_ADDRESS *)&pagesp);
	if (EFI_ERROR(status)) {
		printstr("load_file: AllocatePages failed.\n");
		return -1;
	}

	status = blkio->ReadBlocks(blkio, blkio->Media->MediaId, *head, pages * 4096, pagesp);
	if (EFI_ERROR(status)) {
		printstr("load_file: ReadBlocks failed.\n");
		return -1;
	}

	return 0;
}
开发者ID:m-asama,项目名称:soma,代码行数:25,代码来源:loader.c


示例3: startupmenu

int startupmenu(int i)
{
	while (1) {
		print_vitetris_ver(19, 4);
		newln(0);
		newln(19);
		printstr("Written by"); newln(19);
		printstr("Victor Nilsson"); newln(19);
		printstr("2007-2009");
		i = startup_menu(i-1, 1, 4);
# ifndef TTY_SOCKET
		if (!i)
			break;
# else
		if (i==2 && !select_2p_tty(17, 5))
			continue;
		if (!i && (i = menu_checkinvit(1, 4)) == -1) {
			i = 1;
			continue;
		}
		if (!i)
			break;
		setcurs_end();
		printf("\033[K");
# endif
		clearbox(0, 4, 0, menuheight-4);
		break;
	}
	return i;
}
开发者ID:gsrr,项目名称:Python,代码行数:30,代码来源:men_ansi.c


示例4: redraw

void redraw() {
  static uint32_t color = 1;
  const int y_offset = 64;

  uint32_t *p = (uint32_t *)fbRequest.fbBaseAddress;
  p += y_offset * kWidth / 4;

  for (int y = y_offset; y < kHeight; y++) {
    for (int x = 0; x < kWidth; x += 4 * 8) {
      int32_t c = color << 24 | color << 16 | color << 8 | color;
      *p++ = c;
      *p++ = c;
      *p++ = c;
      *p++ = c;
      *p++ = c;
      *p++ = c;
      *p++ = c;
      *p++ = c;
    }
  }
  color = ++color % 8;

  /* myputchar(0, 0, 'A', 7); */
  printstr(10, 0, "HOG", 7);
  printstr(10 + 8 * 3, 0, "E", 1);
}
开发者ID:sokoide,项目名称:rpi-baremetal,代码行数:26,代码来源:hoge.c


示例5: selectitem

int selectitem(const char **items, int n, int *i, int k)
{
	int x, y;
	switch (k) {
	case 0:
		break;
	case MVLEFT:
		if (*i)
			*i -= 1;
		break;
	case MVRIGHT:
		if (*i < n-1)
			*i += 1;
		break;
	case STARTBTN:
	case A_BTN:
		get_xy(&x, &y);
		n = dropdownlist(items, n, *i, x, y);
		if (n)
			*i = n-1;
		setcurs(x, y);
		return 3;
	default:
		return 0;
	}
	putch('[');
	printstr(items[*i]);
	n = getdropdownwidth(items, n) - strlen(items[*i]);
	putnchars(' ', n);
	printstr("] ");
	return 1;
}
开发者ID:gsrr,项目名称:Python,代码行数:32,代码来源:dropdown.c


示例6: c_thread

static void c_thread(void)
{
again:
	printstr("c calling w...\n");
	static char res[20], data[20] = "L4oskrnl.sys!";
	L4_Call(5, 1, res, data);
	printstr("c got res=");
	printnstr(res, sizeof(res));
	printstr("\n");
	L4m_Pagger(2, 0, 0x60000000, 0x60000200); // !
	L4m_Pagger(2, 1, 0x80000000, 0x90000000); // !
	//(*(volatile int*)0x60000000) = 12;
	/*int x = (*(volatile int*)0x60000030);
	int y = (*(volatile int*)0x80000020);
	printstr("c got x=");
	printint(x);
	printstr(", y=");
	printint(y);*/
	printstr("\nc got dat:\n=====\n");
	static char dat[512];
	memset(dat, 0, sizeof(dat));
	memcpy(dat, (char*)0x60000000, sizeof(dat));
	printnstr(dat, sizeof(dat));
	/*memset(dat, 0, sizeof(dat));
	memcpy(dat, (char*)0x60000000, sizeof(dat));*/
	printstr("\n=====\n");
	L4_Call1(0, 0xcafe);
	goto again;
	for (;;); panic("cc");
}
开发者ID:archibate,项目名称:Lake-OS,代码行数:30,代码来源:test.c


示例7: c_start

void c_start(void)
{
	printstr("hello1\n");
	printstr("hello2\n");
	semi_write0("[Fast Model] Hello World!\n");
	while(1);
}
开发者ID:finallyjustice,项目名称:fastmodels-code,代码行数:7,代码来源:c_start.c


示例8: printmenuitem

void printmenuitem(const char *name, int sel)
{
#if !NO_MENU
	if (*name == '-') {
		putch(' ');
		if (!name[1])
			putnchars('-', 16);
		else
			printstr(name);
		return;
	}
#endif
	if (!sel)
		setcolorpair(MAGENTA_FG);
	else if (!_MONOCHROME)
		setcolorpair(WHITE_ON_BLUE);
	else
		setattr_standout();
	if (sel && (textgfx_flags & TT_MONO)==TT_BLOCKS) {
		while (*name==' ') {
			putch(' ');
			name++;
		}
		putch('*');
	} else
		putch(' ');
	printstr(name);
	putch(' ');
	setattr_normal();
	movefwd(1);
}
开发者ID:gsrr,项目名称:Python,代码行数:31,代码来源:menucore.c


示例9: fifoRead

// samples are written to from one thread, and read from another (this one)
int fifoRead (int fifoBasePtr, int fifoPtrPtr, int fifoCheckBasePtr, int fifoCheckVal) {
  int *fifoBase;
  int *fifoPtr;
  int readData;
  int *fifoCheckBase;
  int readCheckData;

  fifoBase = (int *)(fifoBasePtr);
  fifoPtr  = (int *)(fifoPtrPtr);
  fifoCheckBase = (int *)(fifoCheckBasePtr);

  // Check the sample number
  readCheckData = fifoCheckBase[*fifoPtr];
  #if PRINT == PWM_FLOW_CHECK
    if (readCheckData != fifoCheckVal)
    {
      printstrln("PWM Fifo Checking failure");
      printstr("Expected: ");
      printintln(fifoCheckVal);
      printstr("Actual:   ");
      printintln(readCheckData);
      while(1);
    }
  #endif

  // now perform read
  readData = fifoBase[*fifoPtr];
  (*fifoPtr)++;
  (*fifoPtr) = (*fifoPtr) & PWM_FIFO_MASK;
  return (readData);

}
开发者ID:arjunmenon,项目名称:sc_class_d_amplifier,代码行数:33,代码来源:fifoRead.c


示例10: hiscore_congrats

static int hiscore_congrats(const char **menu)
{
	char name[8] = "       ";
	int x = 9;
	int y = _HEIGHT_24L ? 7 : 3;
	setwcurs(0, 9, y);
	while (is_outside_screen(x+26, 0))
		x--;
	drawbox(x, y, 26, 9, "CONGRATULATIONS!");
	setcurs(x+2, y+2);
	printstr("You have a highscore!");  newln(x+2);
	printstr("Please enter your name");
entername:
	switch (hiscore_entername_menu(name, menu, x+4, y+4)) {
	case 0:
		return 0;
	case 1:
		if (savehiscore(name)) {
			if (x > 7)
				clearbox(33, y, 2, 9);
			return hiscorebox(menu, 9, y);
		}
		setcurs(x+2, y+2);
		printstr("ERROR! Could not save");  newln(x+2);
		printstr("score to file.        ");
		goto entername;
	case 2:
		clearbox(32, y, 0, 9);
		return 1;
	}
}
开发者ID:williamiced,项目名称:SocketTetris,代码行数:31,代码来源:gameover.c


示例11: dump_mem

void dump_mem(unsigned char *ptr, unsigned long bytes)
{
	unsigned long	i;
	int				j;
	char			ch;
    static char 	hex[] = "0123456789abcdef";
	
	for (i=0; i<bytes; i++)
	{
        if (!(i%16)) 
        {
            for (j=20; j>=0; j-=4)
                putch(hex[((i+(unsigned long)ptr)>>j) & 0x0f]);

            putch(':');
            putch(' ');
        }

        ch=ptr[i];
        putch(hex[(ch>>4) & 0x0f]);
        putch(hex[ch & 0x0f]);
        
        if (!((i+1)%2)) 
            putch(' ');
        if (!((i+1)%16)) 
			printstr("\n");
	}
	printstr("\n");
}
开发者ID:deadbok,项目名称:aMOS,代码行数:29,代码来源:main.c


示例12: mrb_show_version

void
mrb_show_version(mrb_state *mrb)
{
  mrb_value msg;

  msg = mrb_const_get(mrb, mrb_obj_value(mrb->object_class), mrb_intern_lit(mrb, "MRUBY_DESCRIPTION"));
  printstr(mrb, msg);
  printstr(mrb, mrb_str_new_lit(mrb, "\n"));
}
开发者ID:Synposis,项目名称:mruby,代码行数:9,代码来源:print.c


示例13: mrb_show_copyright

void
mrb_show_copyright(mrb_state *mrb)
{
  mrb_value msg;

  msg = mrb_const_get(mrb, mrb_obj_value(mrb->object_class), mrb_intern_lit(mrb, "MRUBY_COPYRIGHT"));
  printstr(mrb, msg);
  printstr(mrb, mrb_str_new_lit(mrb, "\n"));
}
开发者ID:Synposis,项目名称:mruby,代码行数:9,代码来源:print.c


示例14: printmenuhelp

static void printmenuhelp(int y)
{
	if (term_height < y+5 || term_width < 48)
		return;
	setcurs(0, y);
	printstr("Use the arrow keys or TAB to navigate,"); newln(0);
	printstr("ENTER to proceed, BACKSPACE or ESC to");  newln(0);
	printstr("go back.  Exit at once with Q.");
}
开发者ID:gsrr,项目名称:Python,代码行数:9,代码来源:men_curses.c


示例15: monitorProc

int monitorProc(char **chargvp, ACSHandle_t acsHandle, int numtokens)
{
  char *chargv1;
  char *chargv2;  
  if (ldebug_flag)
  {
    printstr(NULL,"monitor paramiter number is %d\n", numtokens);
  }
    
  if (numtokens >= 3)
  {
    chargv1 = strupr(chargvp[1]);   
    chargv2 = strupr(chargvp[2]); 
    if ((strcmp(chargv1, "-O") == 0) && (strcmp(chargv2, "SS7LINK") == 0))    
    {
      if ((chargvp[3] != NULL) && (strcmp(chargvp[3], "-t") == 0))
      {
        for (; ;)
        {
          showSS7LinkState();
          usleep(30000*100);
        }
       }
       else
       {
          showSS7LinkState();
       }            
      return 0;
    }
    else if ((strcmp(chargv1, "-O") == 0) && (strcmp(chargv2, "PCM") == 0))
    {
      if ((chargvp[3] != NULL) && (strcmp(chargvp[3], "-t") == 0))
      {
        for(; ;)
        {
          showPCMState();
          usleep(30000*100);
        }
      }
      else
      {       
        showPCMState();
      }
      return 0;
    }
    else
    {
      printstr(NULL,"Input monitor parameter has been omittem,please input again(q exit, h help)\n");
    }     
  }
  else
  {
    printstr(NULL,"Input monitor parameter has been omittem,please input again(q exit, h help)\n");
  }
  
  return 1;
}
开发者ID:liguyu,项目名称:cppexample,代码行数:57,代码来源:KeygoeMonitor.cpp


示例16: __attribute__

__attribute__ ((noinline)) void uip_printip4(const uip_ipaddr_t ip4) {
	printint(uip_ipaddr1(ip4));
	printstr(".");
	printint(uip_ipaddr2(ip4));
	printstr(".");
	printint(uip_ipaddr3(ip4));
	printstr(".");
	printint(uip_ipaddr4(ip4));
}
开发者ID:colinbroad,项目名称:sc_xtcp,代码行数:9,代码来源:uip_server_support.c


示例17: initsystem

int initsystem(ServerID_t serverID, ACSHandle_t *acsHandlep)
{
  RetCode_t ret = 0;
  DJ_U8 u8UnitID;
  WINDOW *win;
  win = stdscr;
  int height, width;
  
  ret = XMS_acsDllInit();
  if (ret < 0)
  {
  	getyx(win, height, width);
    mvprintw(height, 0, "XMS_acsDllInit(IP:%s, port:%d) fail. ret=%d\n",
           serverID.m_s8ServerIp, serverID.m_u32ServerPort, ret);
    return ret;
  }
  
  u8UnitID = 128;
  ret = XMS_acsOpenStream(acsHandlep, &serverID,
                          u8UnitID, 64, 64, 0, NULL);
  if ( ret < 0)
  {
    if (ldebug_flag)
    {
      getyx(win, height, width);
      mvprintw(height, 0, "XMS_acsOpenStream(IP:%s, port:%d) fail. ret=%d\n",
              serverID.m_s8ServerIp, serverID.m_u32ServerPort, ret);
    }
    return ret;
  }
  else
  {
    if (ldebug_flag)
      printstr(NULL,"XMS_acsOpenStream(IP:%s,port:%d)OK!\n",
             serverID.m_s8ServerIp, serverID.m_u32ServerPort, ret);
  }  
  
  ret = XMS_acsSetESR(*acsHandlep, (EsrFunc)EvtHandler, 0, 1);
  if(ret < 0)
  {
    if (ldebug_flag)
      printstr(NULL,"XMS_acsSetESR() fial! ret=%d\n", ret);
    return ret;   
  }
  else
  {
    if (ldebug_flag)
      printstr(NULL,"XMS_acsSetESR() OK!\n");
  }
  
  XMS_acsGetDeviceList(*acsHandlep, NULL); 
  
  g_acsHandle = *acsHandlep;
  
  return 0;
}
开发者ID:myswirl,项目名称:myworkspace,代码行数:56,代码来源:KeygoeEvent.cpp


示例18: printvarg

static int printvarg(int *varg)
{
	char scr[2];

	char *format = (char *)(*varg++);
	int pc = 0;

	for (; *format != 0; ++format) {
		if (*format == '%') {
			++format;
			if (*format == '\0')
				break;

			if (*format == '%')
				goto symbol;

			if( *format == 's' ) {
				char *s = *((char **)varg++);
				pc += printstr(s ? s : "(null)");
				continue;
			}

			if( *format == 'd' ) {
				pc += printint(*varg++, 10, 1, 'a');
				continue;
			}

			if( *format == 'x' ) {
				pc += printint(*varg++, 16, 0, 'a');
				continue;
			}

			if( *format == 'X' ) {
				pc += printint(*varg++, 16, 0, 'A');
				continue;
			}

			if( *format == 'u' ) {
				pc += printint(*varg++, 10, 0, 'a');
				continue;
			}

			if( *format == 'c' ) {
				scr[0] = *varg++;
				scr[1] = '\0';
				pc += printstr(scr);
				continue;
			}
		} else {
		symbol:
			pc += printchar(*format);
		}
	}

	return pc;
}
开发者ID:geomatsi,项目名称:Pandaboard-FreeRTOS,代码行数:56,代码来源:trace.c


示例19: printf

int printf(const char *format, ...) {
	char const *p = format;
	char buf[20];
	void *args = (&format + 1);
	int argn = 0;
	bool isfmt = false;
	int len = 0;
	
	do {
		if(*p == '\0') break;
		if(!isfmt && *p != '%') {
			printchar(*p);
			len++;
		} else if(isfmt) {
			switch(*p) {
				case 'c':
					printchar(((char*)args)[argn++]);
					len++;
					break;
				case 's':
					printstr(((char**)args)[argn]);
					len += (int)strlen(((char**)args)[argn++]);
					break;
				case 'd':
					len += (int)strlen(itoa(((int*)args)[argn++], buf, 10));
					printstr(buf);
					break;
				case 'u':
					len += (int)strlen(utoa(((uint*)args)[argn++], buf, 10));
					printstr(buf);
					break;
				case 'o':
					len += (int)strlen(utoa(((uint*)args)[argn++], buf, 8));
					printstr(buf);
					break;
				case 'x':
				case 'p':
					len += (int)strlen(utoa(((uint*)args)[argn++], buf, 16));
					printstr(buf);
					break;
				case '%':
					printchar('%');
					len++;
					break;
				default:
					return -1;
			}
			isfmt = false;
		} else if(*p == '%') {
			isfmt = true;
		}
	} while(*p++);

	return len;
}
开发者ID:levelfour,项目名称:swallow,代码行数:55,代码来源:stdio.c


示例20: plong

void
plong(FTSENT *p)
{
    char tmp[NAME_BUFSZ];
    FTSENT_PRT *prt=(FTSENT_PRT*)p->fts_pointer;
    int length=prt->s_name;
    if (f_inodenum)
        printf("%*lld ", prt->s_inode, 
               (LL)p->fts_statp->st_ino);
    if (f_dispblock) {
        LL b=p->fts_statp->st_blocks;
        b/=block_size_factor;
        printf("%*lld ", prt->s_block, b);
    }
    printmodestr(p);
    printf("%*hd ", prt->s_link, (short)p->fts_statp->st_nlink);
    if (f_numric) {
        printf("%*d  ", prt->s_uid, (int)p->fts_statp->st_uid);
        printf("%*d  ", prt->s_gid, (int)p->fts_statp->st_gid);
    }
    else {
        if (printuname(p, prt->s_uname)==-1)
            printf("%*d  ", prt->s_uid, (int)p->fts_statp->st_uid);
        if (printgname(p, prt->s_gname)==-1)
            printf("%*d  ", prt->s_gid, (int)p->fts_statp->st_gid);
    }
    printsize(p);
    if (f_sortbyacc)
        printtime(p->fts_statp->st_atime);
    else if (f_sortbychg)
        printtime(p->fts_statp->st_ctime);
    else
        printtime(p->fts_statp->st_mtime);
    if (f_displgd) {
        sprintf(tmp, "%s%c", p->fts_name, type(p));
        length++;
    }
    else
        sprintf(tmp, "%s", p->fts_name);
    printstr(tmp, length);
    if (S_ISLNK(p->fts_statp->st_mode)) {
        int l;
        char buf[NAME_BUFSZ], path[NAME_BUFSZ];
        if (p->fts_level==0)
            sprintf(path, "%s", p->fts_name);
        else
            sprintf(path, "%s/%s", p->fts_parent->fts_accpath, p->fts_name);
        if ((l=readlink(path, buf, sizeof(path)))==-1)
            warn("%s", p->fts_path);
        buf[l]='\0';
        printf(" -> ");
        printstr(buf, prt->s_name);
    }
}
开发者ID:Kaikaiw,项目名称:apue,代码行数:54,代码来源:print.c



注:本文中的printstr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ printstring函数代码示例发布时间:2022-05-30
下一篇:
C++ prints函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap