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

C++ put_char函数代码示例

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

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



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

示例1: in_process

PUBLIC	void	in_process(TTY * p_tty,u32 key)
{
	//u8 out_buf[2] = {'\0','\0'};
	u32 raw_code;
	
	if(!(key & FLAG_EXT))
	{
		//out_buf[0] = key_code & 0xFF;
		put_char(p_tty,key);
	}
	else
	{
		raw_code = key & KEY_CODE_MASK;
		switch(raw_code)
		{
			case	F1:
			case	F2:
			case	F3:
				//disp_int(key);
				if((key & FLAG_LALT) || (key & FLAG_RALT))
				{
					switch_console((raw_code - F1) >> 16);
				}
				break;
			default:
				put_char(p_tty,raw_code);
		}
	}
开发者ID:defsky,项目名称:FunOS,代码行数:28,代码来源:keyboard.c


示例2: retry_transmit

static void retry_transmit(struct r3964_info *pInfo)
{
   if(pInfo->nRetry<R3964_MAX_RETRIES)
   {
      TRACE_PE("transmission failed. Retry #%d", 
             pInfo->nRetry);
      pInfo->bcc = 0;
      put_char(pInfo, STX);
      flush(pInfo);
      pInfo->state = R3964_TX_REQUEST;
      pInfo->count_down = R3964_TO_QVZ;
      pInfo->nRetry++;
   }
   else
   {
      TRACE_PE("transmission failed after %d retries", 
             R3964_MAX_RETRIES);

      remove_from_tx_queue(pInfo, R3964_TX_FAIL);
      
      put_char(pInfo, NAK);
      flush(pInfo);
      pInfo->state = R3964_IDLE;

      trigger_transmit(pInfo);
   }
}
开发者ID:archith,项目名称:camera_project,代码行数:27,代码来源:n_r3964.c


示例3: sys_handler

// system interrupt handler
extern void sys_handler(void) {
    unsigned st_status = AT91C_BASE_ST->ST_SR & AT91C_BASE_ST->ST_IMR;
    unsigned rtc_status = AT91C_BASE_RTC->RTC_SR & AT91C_BASE_RTC->RTC_IMR;
    unsigned dbgu_status = AT91C_BASE_DBGU->DBGU_CSR & AT91C_BASE_DBGU->DBGU_IMR;
    static unsigned char counter = '0';

    if (dbgu_status & AT91C_US_RXRDY) {
        // disable RXRDY interrupt in DBGU
        AT91C_BASE_DBGU->DBGU_IDR |= AT91C_US_RXRDY;
        // disable rtt interrupt flag
        AT91C_BASE_ST->ST_IDR = AT91C_ST_RTTINC;
        if (wait_status == 1) {
            wait_status = 0;
        }
        else {
            transfer_size = dbgu_xmod_recv((void *)LINUX_BASE_ADDRESS);
            run_kernel();
        }
    }

    // handler of rtt - rttinc
    if (st_status & AT91C_ST_RTTINC) {
        AT91C_BASE_PIOB->PIO_ODSR ^= AT91C_PIO_PB27;
        if (wait_status == 1) {
            put_char(counter);
            counter++;
            if (counter == '6')
                run_kernel();
            put_char(' ');
        }
        else
            put_char('C');
    }
}
开发者ID:no111u3,项目名称:arm_my_learn,代码行数:35,代码来源:main.c


示例4: while

/**
 * Construct the "pretty-printed" representation of the name in a short directory entry.
 *
 * @param[in]    fixed  Pointer to name[0] of a DIR_ENT
 *
 * @return  Pointer to static string containing pretty "8.3" equivalent of the
 *          name in the directory entry.
 */
char *file_name(unsigned char *fixed)
{
    static char path[MSDOS_NAME * 4 + 2];
    char *p;
    int i, j;

    p = path;
    for (i = j = 0; i < 8; i++)
	if (fixed[i] != ' ') {
	    while (j++ < i)
		*p++ = ' ';
	    put_char(&p, fixed[i]);
	}
    if (strncmp((const char *)(fixed + 8), "   ", 3)) {
	*p++ = '.';
	for (i = j = 0; i < 3; i++)
	    if (fixed[i + 8] != ' ') {
		while (j++ < i)
		    *p++ = ' ';
		put_char(&p, fixed[i + 8]);
	    }
    }
    *p = 0;
    return path;
}
开发者ID:XperiaMultiROM,项目名称:android_bootable_recovery,代码行数:33,代码来源:file.c


示例5: main

int main(void)
{
	char c;
	int term[2], result;
	unsigned int current_term;

	lcd_init();
	keymatrix_init();

	while (1) {
		put_char('>');
		term[0] = 0;
		term[1] = 0;
		current_term = 0;
		while (1) {
			c = get_char();
			put_char(c);
			if ('0' <= c && c <= '9') {
				term[current_term] = (term[current_term] * 10) + (c - '0');
			} else if (c == '*') {
				current_term++;
			} else if (c == '\n') {
				result = term[0] * term[1];
				put_dec(result);
				get_char();	/* 演算結果表示後、何らかのキー入力を待つ */
				break;
			}
		}
		put_char('\n');
	}

	return 0;
}
开发者ID:cupnes,项目名称:avr_pocket_computer,代码行数:33,代码来源:main.c


示例6: print_simple_condition

void print_simple_condition (STREAM stream, D instance, BOOL escape_p, int print_depth) {
  D format_string = dylan_simple_condition_format_string(instance);
  D format_args = dylan_simple_condition_format_args(instance);
  ignore(print_depth);
  if (escape_p) put_char('"', stream);
  dylan_format(stream, format_string, format_args);
  if (escape_p) put_char('"', stream);
}
开发者ID:h2oota,项目名称:opendylan,代码行数:8,代码来源:debug-print.c


示例7: _arch_debug_serial_putchar

static void
_arch_debug_serial_putchar(const char c)
{
    if (c == '\n') {
        put_char('\r');
        put_char('\n');
    } else if (c != '\r')
        put_char(c);
}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:9,代码来源:arch_debug_console.cpp


示例8: do_filter

 void do_filter()
 {
     int c;
     while ((c = std::cin.get()) != EOF) {
         if (c != '\n' && col_no_ >= line_length_)
             put_char('\n');
         put_char(c);
     }
 }
开发者ID:EricAlex,项目名称:PDAL,代码行数:9,代码来源:line_wrapping_filter.hpp


示例9: echo_char

static void echo_char(unsigned char c, struct tty_struct *tty)
{
	if (L_ECHOCTL(tty) && iscntrl(c) && c != '\t') {
		put_char('^', tty);
		put_char(c ^ 0100, tty);
		tty->column += 2;
	} else
		opost(c, tty);
}
开发者ID:benbee,项目名称:Learning,代码行数:9,代码来源:n_tty.c


示例10: process_command

void process_command() {
  int command_ptr  = 0;

  initialize_array(command, 80, 0);
  copy_string(command, buffer + C(current_line, 2));
  initialize_array(argument, ARGUMENT_HEAP_SIZE, 0);

  send_rs(command, 10);
  next_line();

  if (str_equal(c_exit, command, 4)) {
    put_char('b');
    put_char('y');
    put_char('e');
    send_display(buffer);
    halt();

  } else if (str_equal(c_cd, command, 3)) {
    int length = copy_string(argument, command + 3);
    change_directory(argument, length);

  } else if (command[0] == 0) {
    return;

  } else {
    int ptr = 0;
    while (command[command_ptr] != ' '
           && command[command_ptr] != 0
           && command_ptr < COLS) {
      int byte = command[command_ptr];
      if (byte >= 'a' && byte <= 'z') {
        byte -= 0x20;
      }
      program_name[ptr] = byte;
      command_ptr += 1;
      ptr += 1;
    }
    program_name[ptr] = 0;

    while (command[command_ptr] == ' ' && command_ptr < COLS) {
      command_ptr += 1;
    }

    ptr = 0;
    while (command[command_ptr] != ' '
           && command[command_ptr] != 0
           && command_ptr < COLS) {
      argument[ptr] = command[command_ptr];
      command_ptr += 1;
      ptr += 1;
    }
    argument[ptr] = 0;
    argument[ARGUMENT_HEAP_SIZE-1] = current_directory_id;
    execute_bin(program_name, argument);
  }
}
开发者ID:tomykaira,项目名称:mips,代码行数:56,代码来源:okarin.c


示例11: put_uint64

void put_uint64(uint64_t i)
{
  char str[32];
  int n = 0;
  while (i > 0) { str[n] = '0' + (i % 10); i /= 10; n++; }
  if (n == 0)
    put_char('0');
  else
    while (n > 0) { n--; put_char(str[n]); }
}
开发者ID:CTSRD-CHERI,项目名称:CHERI-Litmus,代码行数:10,代码来源:io.c


示例12: console_write

acoral_32 console_write(void *data,acoral_u32 size,acoral_time tm_out){
	acoral_u32 i;
  	char p;
	for(i=0;i<size;i++){
		p=*((acoral_char *)data+i);
		if(p=='\n')
			put_char('\r');
		put_char(p);
	}
}
开发者ID:ChenZewei,项目名称:acoral,代码行数:10,代码来源:console.c


示例13: put_short

Boolean
CDR::put_bytes (const Short len, const Ptr data)
{
    Char *tmp = (Char *)data;
    int i;
    put_short (len + 1);
    for (i = 0; i < len; i++)
      put_char (*tmp++);
    put_char ((Char) 0);
    return CDR_TRUE;
}
开发者ID:ForNeVeR,项目名称:interclient,代码行数:11,代码来源:CDR.cpp


示例14: main

void main(void) {
  uart_init();
  led_init();
  put_string("boot\r\n");
  while (1) {
    led_toggle();
    char c = get_char();
    put_char(c);
    if (c == '\r')
      put_char('\n');
  }
}
开发者ID:westrup,项目名称:stm32,代码行数:12,代码来源:main.c


示例15: do_filter

 void do_filter()
 {
     int c;
     while ((c = std::cin.get()) != EOF) {
         if (c == '\t') {
             int spaces = tab_size_ - (col_no_ % tab_size_);
             for (; spaces > 0; --spaces)
                 put_char(' ');
         } else {
             put_char(c);
         }
     }
 }
开发者ID:AsherBond,项目名称:PDAL,代码行数:13,代码来源:tab_expanding_filter.hpp


示例16: put

    bool put(Sink& dest, int c)
    {
        for (; spaces_ > 0; --spaces_)
            if (!put_char(dest, ' '))
                return false;

        if (c == '\t') {
            spaces_ = tab_size_ - (col_no_ % tab_size_) - 1;
            return this->put(dest, ' ');
        }

        return put_char(dest, c);
    }
开发者ID:AsherBond,项目名称:PDAL,代码行数:13,代码来源:tab_expanding_filter.hpp


示例17: tensor2str_recur

void tensor2str_recur(char* str, Shape& shape, T* buffer, int& cnt, int& val_cnt, int lv, int formal_indent, char format[])
{
  for (int i = 0; i < formal_indent; ++i) put_char(' ');

  if (shape.size() == 0) {
    char str_buf[16];
    sprintf(str_buf, format, *(buffer + (val_cnt++)));
    auto len = strlen(str_buf);
    memcpy(str + cnt, str_buf, len * sizeof(char));
    cnt += len;
  }
  else if (shape.size() - 1 == lv) {
    put_char('[');
    for (int i = 0; i < shape[lv]; ++i) {
      char str_buf[16];
      sprintf(str_buf, format, *(buffer + (val_cnt++)));
      auto len = strlen(str_buf);
      memcpy(str + cnt, str_buf, len * sizeof(char));
      cnt += len;
      if (i < shape[lv] - 1) {
        put_char(',');
        put_char(' ');
      }
    }
    put_char(']');
  }
  else {
    put_char('[');
    for (int i = 0; i < shape[lv]; i++) {
      tensor2str_recur<T>(str, shape, buffer, cnt, val_cnt, lv + 1, (i == 0 ? 0 : lv) + (int)(i != 0), format);
      if (i < shape[lv] - 1) put_char('\n');
    }
    put_char(']');
  }
}
开发者ID:ehd4585,项目名称:felix_lib,代码行数:35,代码来源:ndarray.cpp


示例18: print_token_nailed

/*
 * Send a token to the output at a given line (this is for text output
 * and unreplaced macros due to lack of arguments).
 */
static void print_token_nailed(struct lexer_state *ls, struct token *t,
	long nail_line)
{
	char *x = t->name;

	if (ls->flags & LEXER) {
		print_token(ls, t, 0);
		return;
	}
	if (ls->flags & KEEP_OUTPUT) {
		for (; ls->oline < nail_line;) put_char(ls, '\n');
	}
	if (!S_TOKEN(t->type)) x = operators_name[t->type];
	for (; *x; x ++) put_char(ls, *x);
}
开发者ID:scarabeusiv,项目名称:ucpp,代码行数:19,代码来源:macro.c


示例19: printf

int printf(const char *format, ...) {
	va_list ap;
	char *fmt = (char *)format;
	int d;
	char c;
	char *s;

	va_start(ap, format);

	while(*fmt) {
		c = *fmt++;
		if(c != '%') {
			put_char(c);
			continue;
		}
		switch(*fmt++) {
			case 'd':
				d = va_arg(ap, int);
				print_num(d, 10);
				break;
			case 'x':
				d = va_arg(ap, int);
				print_num(d, 16);
				break;
			case 'c':
				d = va_arg(ap, int);
				put_char(d);
				break;
			case 's':
				s = va_arg(ap, char *);
				while(*s != '\0') {
					put_char(*s++);
				}
				break;
			case 'b':
				d = va_arg(ap, int);
				print_num(d, 2);
				break;
			case 'o':
				d = va_arg(ap, int);
				print_num(d, 8);
				break;
		}
	}

	va_end(ap);
	return 0;
}
开发者ID:iamedu,项目名称:armdev,代码行数:48,代码来源:prueba.c


示例20: UART0_IRQHandler

/*
 * UART0 Interrupt Handler
 * Echos received character
 */
void UART0_IRQHandler(void)
{
	PRINTF("Echo:");
    if(UART0_S1 & RDRF_MASK)
    	//PUTCHAR(UART0_D);
    	put_char(UART0_D);
}
开发者ID:G00244090,项目名称:Final_Year_Project_Aonghus_Conneely,代码行数:11,代码来源:main2.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ put_chunk函数代码示例发布时间:2022-05-30
下一篇:
C++ put_buffer函数代码示例发布时间: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