本文整理汇总了C++中outc函数的典型用法代码示例。如果您正苦于以下问题:C++ outc函数的具体用法?C++ outc怎么用?C++ outc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: int_berganti
int int_berganti(void)
{
char a;
//if ( FIO0PIN & GPIO_INT )
if (I2C_INT_PIN & GPIO_INT )
{
//return 1;
// cek keypad yang ditekan
out("KEY \r\n");
if (i2c_read_register(0x68, 0x68, &a))
{
out("\r\n Read failed !\r\n");
}
else
{
out(" Read OK =");
a = a + '0';
outc((char) a);
out(" \r\n");
}
}
else
return 0;
}
示例2: bl_print
BLAPI_PROTO
bl_print(lua_State* L)
{
bl_addstr(L);
outc('\n');
return 0;
}
示例3: i2c_stop
void i2c_stop(void)
{
int tot;
SDA_out();
delay();
SCL_set(); // jadi in, akan H jika tidak streching
#if 1
/* cek jika clock strecting */
tot = 0;
while ( !SCL_read() )
{
delay();
#ifdef DEBUG_TSC
outc('b');
#endif
tot++;
if (tot > 100) return -1;
}
delay();
#endif
SCL_set();
delay();
SDA_set();
delay();
SDA_in();
}
示例4: i2c_start
void i2c_start(void)
{
int tot;
SCL_set(); // jadi in
#if 1
/* cek jika clock strecting */
tot = 0;
while ( !SCL_read() )
{
delay();
#ifdef DEBUG_TSC
outc('a');
#endif
tot++;
if (tot > 100) return -1;
}
delay();
#endif
SDA_out();
SDA_set();
delay();
SCL_set(); // in
delay();
SDA_clr();
delay();
SCL_out();
SCL_clr();
delay();
}
示例5: userprompt
int userprompt(unsigned id,...)
{
char *fmt, *str;
int ch;
if(!getPromptString(id, &str, &fmt))
return 0;
/* Issue message */
if(*fmt) {
va_list ap;
va_start(ap, id);
vprintf(fmt, ap);
va_end(ap);
}
while((ch = vcgetchar()) == 0 || (ch = mapMetakey(str, ch)) == 0)
beep(); /* hit erroreous character */
outc('\n'); /* advance to next line */
freePromptString(str, fmt);
return ch;
}
示例6: echocmd
int
echocmd(int argc, char **argv)
{
int nonl = 0;
struct output *outs = out1;
if (!*++argv)
goto end;
if (equal(*argv, "-n")) {
nonl = ~nonl;
if (!*++argv)
goto end;
}
do {
char c;
nonl += conv_escape_str(*argv);
outstr(stackblock(), outs);
if (nonl > 0)
break;
c = ' ';
if (!*++argv) {
end:
if (nonl) {
break;
}
c = '\n';
}
outc(c, outs);
} while (*argv);
return 0;
}
示例7: do_indent
void do_indent(void)
{
int i = indent_level * 8;
while ( i >= 8 )
{
outc( '\t' );
i -= 8;
}
while ( i > 0 )
{
outc( ' ' );
--i;
}
}
示例8: transition_struct_out
/* transition_struct_out - output a yy_trans_info structure
*
* outputs the yy_trans_info structure with the two elements, element_v and
* element_n. Formats the output with spaces and carriage returns.
*/
void
transition_struct_out(int element_v, int element_n)
{
out_dec2(" {%4d,%4d },", element_v, element_n);
datapos += TRANS_STRUCT_PRINT_LENGTH;
if (datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH) {
outc('\n');
if (++dataline % 10 == 0)
outc('\n');
datapos = 0;
}
}
示例9: outs
void outs( char *s )
{
char c;
while( c = *s++ ) {
outc( c );
}
}
示例10: dataflush
/* dataflush - flush generated data statements */
void
dataflush(void)
{
outc('\n');
if (++dataline >= NUMDATALINES) {
/* Put out a blank line so that the table is grouped into
* large blocks that enable the user to find elements easily.
*/
outc('\n');
dataline = 0;
}
/* Reset the number of characters written on the current line. */
datapos = 0;
}
示例11: outstr
void
outstr(const char *p, struct output *file)
{
while (*p)
outc(*p++, file);
if (file == out2)
flushout(file);
}
示例12: outshstr
void
outshstr(const char *p, struct output *file)
{
static const char norm_chars [] \
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
int need_q = p[0] == 0 || p[strspn(p, norm_chars)] != 0;
char c;
if (need_q)
outc('\'', file);
while (c = *p++, c != 0){
if (c != '\''){
outc(c, file);
}else{
outc('\'', file);
outc('\\', file);
outc(c, file);
outc('\'', file);
}
}
if (need_q)
outc('\'', file);
if (file == out2)
flushout(file);
}
示例13: outbin
void
outbin(const void *data, size_t len, struct output *file)
{
const char *p;
p = data;
while (len-- > 0)
outc(*p++, file);
}
示例14: outns
void
outns(const char *str, int n)
{
if (!str)
return;
while (*str && n-- > 0) {
outc(*str++);
}
}
示例15: outs
void
outs(const char *str)
{
if (!str)
return;
while (*str) {
outc(*str++);
}
}