本文整理汇总了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.");
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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");
}
示例7: c_start
void c_start(void)
{
printstr("hello1\n");
printstr("hello2\n");
semi_write0("[Fast Model] Hello World!\n");
while(1);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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");
}
示例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"));
}
示例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"));
}
示例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.");
}
示例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;
}