本文整理汇总了C++中putstr函数的典型用法代码示例。如果您正苦于以下问题:C++ putstr函数的具体用法?C++ putstr怎么用?C++ putstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putstr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例4: 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. :)
}
}
示例5: addtopl
void addtopl(char *s)
{
curs(tlx, tly);
if((tlx + strlen(s)) > COLNO) {
putsym('\n');
}
putstr(s);
tlx = curx;
tly = cury;
flags.topl = 1;
}
示例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);
}
示例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();
}
示例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
示例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();
}
示例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;
}
示例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);
}
示例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');
}
示例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(".");
}
示例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;
}
示例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
}