本文整理汇总了C++中putstr函数的典型用法代码示例。如果您正苦于以下问题:C++ putstr函数的具体用法?C++ putstr怎么用?C++ putstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putstr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: diag_sd_verify_data
static int diag_sd_verify_data(u8* origin, u8* data, u32 len, int sector)
{
int err_cnt = 0;
u32 i;
for (i = 0; i < len; i++) {
if (origin[i] != data[i]) {
err_cnt++;
putstr("\r\nSector ");
putdec(i / SECTOR_SIZE + sector);
putstr(" byte ");
putdec(i % SECTOR_SIZE);
putstr(" failed data origin: 0x");
puthex(origin[i]);
putstr(" data: 0x");
puthex(data[i]);
putstr("\r\n");
}
}
return err_cnt;
}
开发者ID:ShawnOfMisfit,项目名称:ambarella,代码行数:22,代码来源:diag_sd.c
示例2: help
int help(int argc, const char** argv) {
shell_func func;
//Check if they are trying to find help for a particular command
if (argc > 1) {
func = get_help(argv[1]);
if (func == NULL) {
putstr("Sorry no help exists for the command '");
putstr(argv[1]);
putstr("'\n");
} else {
func(argc, (const char **)argv);
}
} else {
//List all possible commands
putstr("Available commands:");
putoptions(get_commands(""));
putch('\n');
}
return 0;
}
开发者ID:jordanbray,项目名称:CECS-525-in-C-shell,代码行数:22,代码来源:help.c
示例3: prtdbl
pascal int prtdbl(double dbl, int width, int precision, char E)
{
static char buf[200];
int nn;
if (width > 199)
width = 199;
if (width < -199)
width = -199;
nn = sprtdbl(buf, dbl, width, precision, E);
putstr(buf,width);
return nn;
}
开发者ID:robfinch,项目名称:Cores,代码行数:13,代码来源:prtdbl.c
示例4: addtopl
void addtopl(char *s)
{
curs(tlx, tly);
if((tlx + strlen(s)) > COLNO) {
putsym('\n');
}
putstr(s);
tlx = curx;
tly = cury;
flags.topl = 1;
}
开发者ID:tcadigan,项目名称:hack_1.0,代码行数:13,代码来源:hack.topl.c
示例5: main
void main(void)
{
int i;
TRISD = 0b00000111; // All SCK, SDI, D_C, _SCE and _RES are output pins.
initlcd();
putstr(" PCD-8544 LCD "); // A test message.... Also a new year's greeting. :)
cursorxy(0,1); // Next line.
putstr("Graphical Demo");
for(;;)
{
for(i=0;i<num_of_points;i++)
{
plot_pt[i] = (char)(rand() % 256); // Generate random numbers. Default is 0-255.
}
plotline(plot_pt, num_of_points, 255, 10, 2); // Plot the smooth(er) line graph.
plotbars(plot_pt, num_of_points, 255, 10, 4); // Plot the bar graph version with the same points.
// DelayS(5); // Remark this line if you want to see some really blazing fast plotting. :)
}
}
开发者ID:bluefix,项目名称:picsdr,代码行数:22,代码来源:nokia3310.c
示例6: deliver_by_window
static void
deliver_by_window (struct qtmsg *qt_msg, int how)
{
long size;
winid datawin = create_nhwindow(how);
for (size = 0; size < qt_msg->size; size += (long)strlen(in_line)) {
(void) dlb_fgets(in_line, 80, msg_file);
convert_line();
putstr(datawin, 0, out_line);
}
display_nhwindow(datawin, true);
destroy_nhwindow(datawin);
}
开发者ID:thejoshwolfe,项目名称:nethack,代码行数:14,代码来源:questpgr.c
示例7: inventory
void inventory(void) {
clear(NULL);
fgcolor(NULL, C_WHITE);
putstr(NULL, 1, 1, "Inventory");
/*
item_t *item = inv->head;
if (item == NULL) {
fgcolor(NULL, C_GREY);
putstr(NULL, 1, 3, "Empty");
}
else {
int y = 3;
while (item != NULL) {
putstr(NULL, 1, y++, item->name);
item = item->next;
}
}
*/
fgcolor(NULL, C_GREY);
putstr(NULL, 1, 23, "[? for help]");
update();
getkey();
}
开发者ID:jdp,项目名称:psionrl,代码行数:23,代码来源:game.c
示例8: main
void main(void)
{
char txtbuf[16]="";
Init_Dev();
PORTB=0x00;
putstr("\nLongQiu s.&t. Co. Ltd.");
putstr("\nhttp://shop36265907.taobao.com");
Dly_ms(1000);
PORTB=0xFF;
EnableInterrupts;
for(;;)
{
Dly_ms(500);
//----------PWM0----------------------------------
sprintf(txtbuf,"\nFrequence: %d0Hz",PWMPER1);
putstr(txtbuf);
sprintf(txtbuf,"\n duty circle: %d%%",(PWMPER1-PWMDTY1)*100/PWMDTY1);
putstr(txtbuf);
PORTB_PB0=~PORTB_PB0;
}//for(;;)
} //main
开发者ID:danbao,项目名称:SmartCar,代码行数:23,代码来源:demoXSPWM.c
示例9: redotoplin
void
redotoplin()
{
home();
if (strchr(toplines, '\n'))
cl_end();
putstr(toplines);
cl_end();
tlx = curx;
tly = cury;
flags.toplin = 1;
if (tly > 1)
more();
}
开发者ID:carriercomm,项目名称:BSDGames,代码行数:14,代码来源:hack.topl.c
示例10: envset
static void envset(char *a, char *b)
{
int al = strlen(a);
static char hptr[5];
char *tp = sbrk(al + strlen(b) + 2);
if (tp == (char *) -1) {
putstr("out of memory.\n");
return;
}
strcpy(tp, a);
tp[al] = '=';
strcpy(tp + al + 1, b);
env[envn++] = tp;
}
开发者ID:aralbrec,项目名称:FUZIX,代码行数:14,代码来源:init.c
示例11: parse_inittab
/*
* Parse the init table, then set up the pointers after the processed
* data, and adjust the brk() value to allow for the tables
*/
static void parse_inittab(void)
{
idata = inittab = sdata;
while (sdata < sdata_end)
parse_initline();
/* Allocate space for the control arrays */
initpid = (uint16_t *) idata;
idata += 2 * initcount;
initptr = (uint8_t **) idata;
idata += sizeof(void *) * initcount;
if (brk(idata) == -1)
putstr("unable to return space\n");
memset(initpid, 0, 2 * initcount);
memset(initptr, 0, sizeof(uint8_t *) * initcount);
}
开发者ID:aralbrec,项目名称:FUZIX,代码行数:19,代码来源:init.c
示例12: ia_voir
void ia_voir(t_world *world, t_cli *ia)
{
int i;
t_card pos;
int nb_case;
putstr("\033[33mClient numero : ");
print_nb(ia->numero);
putstr(" voir\n\033[39m");
pos.y = ia->pos.y;
pos.x = ia->pos.x;
pos.direction = ia->pos.direction;
save_cmd(ia, MSG_DEB_VOIR, LEN_DEB_VOIR, 'W');
i = 0;
nb_case = 1;
while (i <= ia->lvl)
{
look_rank(world, &pos, nb_case, ia);
select_incr(world, &pos, nb_case + 1);
nb_case += CASE_PER_LEVEL;
i++;
}
save_cmd(ia, MSG_FIN_VOIR, LEN_FIN_VOIR, 'W');
}
开发者ID:Sun42,项目名称:Zappy,代码行数:24,代码来源:ia_voir.c
示例13: flush_window
/* ===========================================================================
* Write the output window window[0..outcnt-1] and update bytes_out.
* (Used for the decompressed data only.)
*/
void flush_window(void)
{
unsigned n;
uch *in, *out, ch;
in = window;
out = &output_data[output_ptr];
for (n = 0; n < outcnt; n++)
ch = *out++ = *in++;
bytes_out += (ulg)outcnt;
output_ptr += (ulg)outcnt;
outcnt = 0;
putstr(".");
}
开发者ID:camelguo,项目名称:linux-2.6-trimedia,代码行数:19,代码来源:misc.c
示例14: serial_load
unsigned int serial_load(void *dst)
{
unsigned char *p = dst;
unsigned int idle, len;
putstr("Send binary now...");
len = 0;
while (len == 0) {
for (idle = 0; (idle < 200000); idle++) {
if (checkch()) {
*p++ = getch();
len++;
idle = 0;
}
}
}
putstr("\nReceived 0x");
putnum(len);
putstr(" bytes\n");
return len;
}
开发者ID:OPSF,项目名称:uClinux,代码行数:24,代码来源:flasher.c
示例15: text_Tests
void text_Tests(void)
{
gfx_Cls() ;
printf("Text Tests\n") ;
putstr("Text Tests") ;
txt_Attributes(BOLD + INVERSE + ITALIC + UNDERLINED) ;
txt_Xgap(3) ;
txt_Ygap(3) ;
txt_BGcolour(YELLOW) ;
txt_FGcolour(WHITE) ;
txt_FontID(FONT3) ;
txt_MoveCursor(5, 0) ;
putstr("Hello There") ;
txt_MoveCursor(6, 2) ;
txt_Height(2) ;
txt_Width(2) ;
txt_Inverse(OFF) ;
txt_Italic(OFF) ;
txt_Opacity(TRANSPARENT) ;
txt_Set(TEXT_COLOUR, LIME) ;
txt_Underline(ON) ;
txt_Bold(OFF) ;
txt_Wrap(88) ;
putstr("Hello There") ;
txt_Height(1) ;
txt_Width(1) ;
putCH('z') ;
txt_Wrap(0) ; // reset
printf("Char height= %d Width= %d\n", charheight('w'), charwidth('w') ) ;
txt_BGcolour(BLACK) ;
txt_FGcolour(LIME) ;
txt_FontID(FONT3) ;
txt_MoveCursor(0,0) ; // reset
}
开发者ID:Plomion,项目名称:Picaso-Serial-C-Library,代码行数:36,代码来源:BIGDEMO.C
示例16: envset
static void envset(const char *a, const char *b)
{
int al = strlen(a);
static char hptr[5];
/* May unalign the memory pool but we don't care by this point */
char *tp = sbrk(al + strlen(b) + 2);
if (tp == (char *) -1) {
putstr("out of memory.\n");
return;
}
strcpy(tp, a);
tp[al] = '=';
strcpy(tp + al + 1, b);
env[envn++] = tp;
}
开发者ID:nori6001,项目名称:FUZIX,代码行数:15,代码来源:init.c
示例17: copyboot
int
copyboot(struct open_file *fp, char *addr)
{
size_t n;
int i, blknum;
char *buf;
/* Need to use a buffer that can be mapped into DVMA space. */
buf = alloc(bbinfo.bbi_block_size);
if (!buf)
panic("bootxx: alloc failed");
for (i = 0; i < bbinfo.bbi_block_count; i++) {
if ((blknum = bbinfo.bbi_block_table[i]) == 0)
break;
#ifdef DEBUG
printf("bootxx: block # %d = %d\n", i, blknum);
#endif
if ((fp->f_dev->dv_strategy)(fp->f_devdata, F_READ, blknum,
bbinfo.bbi_block_size, buf, &n))
{
putstr("bootxx: read failed\n");
return -1;
}
if (n != bbinfo.bbi_block_size) {
putstr("bootxx: short read\n");
return -1;
}
memcpy(addr, buf, bbinfo.bbi_block_size);
addr += bbinfo.bbi_block_size;
}
return 0;
}
开发者ID:ryo,项目名称:netbsd-src,代码行数:36,代码来源:bootxx.c
示例18: nand_demo
void nand_demo() {
int (*OS_Entry)(void *);
unsigned int offset;
int blockno;
int blockstart;
int blockend;
int page;
enable_nand();
blockstart=0x20000/0x4000;
blockend=blockstart+(0x170000/0x4000);
offset=0x31000000;
for(blockno=blockstart;blockno<(blockend+1);blockno++) {
for(page=0;page<32;page++) {
NAND_ReadPage(blockno,page,offset);
offset = offset + 512;
}
}
clean_cache();
putstr("OS read successfully\r\n");
putstr("Press any key to continue\r\n");
getchar();
OS_Entry=(int *)0x31000000;
OS_Entry(1);
}
开发者ID:paulhsu,项目名称:sbl24x0,代码行数:24,代码来源:armboot.c
示例19: start_armboot
void start_armboot()
{
led_flash();
uart_init();
putstr("Lab 4:\r\n");
putstr("Hello World!\r\n");
while(1)
{
char ch;
print_menu();
ch = getchar();
switch(ch)
{
case '1':
NOR_check_id();
break;
case '2':
putstr("Which block do you want to erase?(0..9)?\r\n");
ch = getchar();
if(ch == '0')
putstr("Do you want to erase me? y/n\r\n");
ch = getchar();
if(ch == 'y'||ch == 'Y')
NOR_erase_block(0);
else
NOR_erase_block(ch - '0');
break;
case '3':
putstr("Here is a nand demo\r\n");
nand_demo();
break;
}
}
}
开发者ID:paulhsu,项目名称:sbl24x0,代码行数:36,代码来源:armboot.c
示例20: hex_dump
void hex_dump(unsigned char *data, size_t num)
{
int i;
long oldNum;
char buf[90];
char *bufp;
int line_resid;
while (num) {
bufp = buf;
binarytohex(bufp, (unsigned long)data, 4);
bufp += 8;
*bufp++ = ':';
*bufp++ = ' ';
oldNum = num;
for (i = 0; i < 16 && num; i++, num--) {
binarytohex(bufp, (unsigned long)data[i], 1);
bufp += 2;
*bufp++ = (i == 7) ? '-' : ' ';
}
line_resid = (16 - i) * 3;
if (line_resid) {
memset(bufp, ' ', line_resid);
bufp += line_resid;
}
memcpy(bufp, "| ", 2);
bufp += 2;
for (i = 0; i < 16 && oldNum; i++, oldNum--)
*bufp++ = BL_ISPRINT(data[i]) ? data[i] : '.';
line_resid = 16 - i;
if (line_resid) {
memset(bufp, ' ', 16 - i);
bufp += 16 - i;
}
*bufp++ = '\r';
*bufp++ = '\n';
*bufp++ = '\0';
putstr(buf);
data += 16;
}
}
开发者ID:nvl1109,项目名称:em2440iii,代码行数:48,代码来源:misc.c
注:本文中的putstr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论