当前位置: 首页>>代码示例>>C++>>正文


C++ printstr函数代码示例

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


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


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