当前位置: 首页>>代码示例>>C++>>正文


C++ outstr函数代码示例

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


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

示例1: parse_amp

/*
** parse_amp
**
** parse ampersand ("&")
*/
BOOL parse_amp( INFILE *inpf )
{
    if ( !fatal_error ) {
        char *nxtwd;
        char nxtch;
        DLNODE *nd;

        /* write blank if necessary */
        outstr( infgetcws( inpf ) );

        /* get entity id */
        nxtwd = infgetw( inpf );

        /* search for entity in list */
        nd = find_dlnode( defent->first, (APTR) nxtwd, cmp_strent );
        if ( nd == NULL ) {

            message( WARN_UNKN_ENTITY, inpf );
            errstr( "Unknown entity " );
            errqstr( nxtwd );
            errlf();

        }

        /* check for closing ';' */
        nxtch = infgetc( inpf );
        if ( nxtch != ';' ) {

            message( WARN_EXPT_SEMIK, inpf );
            errqstr( ";" );
            errstr( " expected (found: " );
            errqstr( ch2str( nxtch ) );
            errstr( ")\n" );

        }

        /* output whole entity */
        outch( '&' );
        outstr( nxtwd );
        outch( nxtch );
    }

    return (BOOL)( !fatal_error );
}
开发者ID:BackupTheBerlios,项目名称:hsc-svn,代码行数:49,代码来源:parse.c

示例2: lnexttoscreen

/*
 * lnexttoscreen
 *
 * Like nexttoscreen() but only for the cursor line.
 */
static void
lnexttoscreen()
{
        register char *np = Nextscreen + (Cline_row * Columns);
        register char *rp = Realscreen + (Cline_row * Columns);
        register char *endline;
        register int row, col;
        int gorow = -1, gocol = -1;

        endline = np + (Cline_size * Columns);

        row = Cline_row;
        col = 0;

        outstr(T_CI);                /* disable cursor */

        for ( ; np < endline ; np++,rp++ ) {
                /* If desired screen (contents of Nextscreen) does not */
                /* match what's really there, put it there. */
                if ( *np != *rp ) {
                        /* if we are positioned at the right place, */
                        /* we don't have to use windgoto(). */
                        if (gocol != col || gorow != row) {
                                /*
                                 * If we're just off by one, don't send
                                 * an entire esc. seq. (this happens a lot!)
                                 */
                                if (gorow == row && gocol+1 == col) {
                                        outchar(*(np-1));
                                        gocol++;
                                } else
                                        windgoto(gorow=row,gocol=col);
                        }
                        outchar(*rp = *np);
                        gocol++;
                }
                if ( ++col >= Columns ) {
                        col = 0;
                        row++;
                }
        }
        outstr(T_CV);                /* enable cursor again */
}
开发者ID:kindy,项目名称:vim0,代码行数:48,代码来源:screen.c

示例3: print_cpu_context

// prints cpu registers and flags (keep it on 2 lines)
void print_cpu_context()
{

	char tmpstr[160] = { 0 };
	char nextinstr[160];
	cpudef *cpu = get_cpu_struct(g_which_cpu);
	const char *s = NULL;	// results returned by CPU ascii callback
	int reg = CPU_INFO_REG;	// base register
	int x = 0;	// our X position so we can apply word wrap

	// fill nextinstr with the disassembly of the next instruction
	cpu->dasm_callback(nextinstr, cpu->getpc_callback());

	// print all registers we can
	for (reg = CPU_INFO_REG; reg < MAX_REGS; reg++)
	{
		s = cpu->ascii_info_callback(NULL, reg);

		// if we got something back ...
		if (s[0] != 0)
		{
			outstr(s);
			outstr(" ");	// spacer after register info
			x += strlen(s) + 1;	// +1 because we take into account space

			// if it's time to do a line feed ...
			if (x > 76)
			{
				newline();
				x = 0;
			}
		}
	};
	newline();

	sprintf(tmpstr,
	    "AT PC: [%02X - %s]   FLAGS: [%s] ",
		cpu->getpc_callback(),
		nextinstr,
		cpu->ascii_info_callback(NULL, CPU_INFO_FLAGS)
	);
	printline(tmpstr);
}
开发者ID:DavidGriffith,项目名称:daphne,代码行数:44,代码来源:cpu-debug.cpp

示例4: doformat

void
doformat(struct output *dest, const char *f, va_list ap)
{
#ifdef HAVE_VASPRINTF
	char *s;

	vasprintf(&s, f, ap);
	outstr(s, dest);
	free(s);
#else	/* !HAVE_VASPRINTF */
	static const char digit_lower[] = "0123456789abcdef";
	static const char digit_upper[] = "0123456789ABCDEF";
	const char *digit;
	char c;
	char temp[TEMPSIZE];
	int flushleft;
	int sharp;
	int width;
	int prec;
	int islong;
	int isquad;
	char *p;
	int sign;
	int64_t l;
	uint64_t num;
	unsigned base;
	int len;
	int size;
	int pad;

	while ((c = *f++) != '\0') {
		if (c != '%') {
			outc(c, dest);
			continue;
		}
		flushleft = 0;
		sharp = 0;
		width = 0;
		prec = -1;
		islong = 0;
		isquad = 0;
		for (;;) {
			if (*f == '-')
				flushleft++;
			else if (*f == '#')
				sharp++;
			else
				break;
			f++;
		}
		if (*f == '*') {
			width = va_arg(ap, int);
			f++;
		} else {
			while (is_digit(*f)) {
开发者ID:dezelin,项目名称:kBuild,代码行数:55,代码来源:output.c

示例5: dumplits

void dumplits(
    int size, int pr_label ,
    int queueptr,int queuelab,
    unsigned char *queue)
{
    int j, k,lit ;

    if ( queueptr ) {
        if ( pr_label ) {
            output_section("rodata_compiler"); // output_section("text");
            prefix(); queuelabel(queuelab) ;
            col() ; nl();
        }
        k = 0 ;
        while ( k < queueptr ) {
            /* pseudo-op to define byte */
            if (infunc) j=1;
            else j=10;
            if (size == 1) defbyte();
            else if (size == 4) deflong();
            else if (size == 0 ) { defmesg(); j=30; }
            else defword();
            while ( j-- ) {
                if (size==0) {
                    lit=getint(queue+k,1);
                    if (lit >= 32 && lit <= 126  && lit != '"' && lit != '\\' ) outbyte(lit);
                    else {
                        outstr("\"\n");
                        defbyte();
                        outdec(lit);
                        nl();
                        lit=0;
                    }
                    k++;
                    if ( j == 0 || k >=queueptr || lit == 0 ) {
                        if (lit) outbyte('"');
                        nl();
                        break;
                    }
                } else {
                    outdec(getint(queue+k, size));
                    k += size ;
                    if ( j == 0 || k >= queueptr ) {
                        nl();           /* need <cr> */
                        break;
                    }
                    outbyte(',');   /* separate bytes */
                }
            }
        }
        output_section("code_compiler"); // output_section("code");
    }
    nl();
}
开发者ID:meesokim,项目名称:z88dk,代码行数:54,代码来源:main.c

示例6: errorsummary

errorsummary()
  {
  /* see if anything left hanging... */
  if (ncmp) error("missing closing bracket");
    /* open compound statement ... */
  nl();
  comment();
  outdec(errcnt);  /* total # errors */
  outstr(" errors in compilation.");
  nl();
  }
开发者ID:adamsch1,项目名称:scc,代码行数:11,代码来源:c80.c

示例7: updateline

/*
 * updateline() - like s_refresh() but only for cursor line 
 *
 * This determines whether or not we need to call s_refresh() to examine
 * the entire screen for changes. This occurs if the size of the cursor line
 * (in rows) has changed.
 */
static void
updateline(void)
{
    char           *ptr;
    int             col;
    int             size;
    int             j;

    if (RedrawingDisabled)	/* Is this the correct action ? */
	return;

    ptr = format_line(Curschar->linep->s, &col);

    size = 1 + ((col - 1) / Columns);
    if (Cline_size == size) {
	s_cursor_off();
	windgoto(Cline_row, 0);
	if (P(P_NU)) {
	    /*
	     * This should be done more efficiently. 
	     */
	    outstr(mkline(cntllines(Filemem, Curschar)));
	}
	outstr(ptr);

	j = col;
	col %= Columns;
	if ((col != 0) || (j == 0)) {
#ifdef T_END_L
	    windgoto(Cline_row + size - 1, col);
	    toutstr(T_END_L);
#else
	    for (; col < Columns; col++)
		outchar(' ');
#endif
	}
	s_cursor_on();
    } else {
	s_refresh(VALID_TO_CURSCHAR);
    }
}
开发者ID:GnoConsortium,项目名称:gno,代码行数:48,代码来源:screen.c

示例8: fire_slime

/*
 * fire_slime:
 *	Fire a slime shot in the given direction
 */
static void
fire_slime(PLAYER *pp, int req_index)
{
	if (pp == NULL)
		return;
#ifdef DEBUG
	if (req_index < 0 || req_index >= MAXSLIME)
		message(pp, "What you do?");
#endif
	while (req_index >= 0 && pp->p_ammo < slime_req[req_index])
		req_index--;
	if (req_index < 0) {
		message(pp, "Not enough charges.");
		return;
	}
	if (pp->p_ncshot > MAXNCSHOT)
		return;
	if (pp->p_ncshot++ == MAXNCSHOT) {
		cgoto(pp, STAT_GUN_ROW, STAT_VALUE_COL);
		outstr(pp, "   ", 3);
	}
	pp->p_ammo -= slime_req[req_index];
	(void) snprintf(Buf, sizeof(Buf), "%3d", pp->p_ammo);
	cgoto(pp, STAT_AMMO_ROW, STAT_VALUE_COL);
	outstr(pp, Buf, 3);

	add_shot(SLIME, pp->p_y, pp->p_x, pp->p_face,
		slime_req[req_index] * SLIME_FACTOR, pp, false, pp->p_face);
	pp->p_undershot = true;

	/*
	 * Show the object to everyone
	 */
	showexpl(pp->p_y, pp->p_x, SLIME);
	for (pp = Player; pp < End_player; pp++)
		sendcom(pp, REFRESH);
#ifdef MONITOR
	for (pp = Monitor; pp < End_monitor; pp++)
		sendcom(pp, REFRESH);
#endif
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:45,代码来源:execute.c

示例9: print_tes

void print_tes(string tag)
{
    char buf[BUFLEN];  /* danger: buffer overflow */

    change_indent(- indent);
    if (xml)
      sprintf(buf, "</%s>",tag);
    else
      sprintf(buf, "tes");
    (void) outstr(buf);
    end_line();
}
开发者ID:Milkyway-at-home,项目名称:nemo,代码行数:12,代码来源:tsf.c

示例10: print_set

void print_set(string tag)
{
    char buf[BUFLEN];  /* danger: buffer overflow */

    if (xml)
      sprintf(buf, "<%s>", tag);
    else
      sprintf(buf, "set %s", tag);
    (void) outstr(buf);
    end_line();
    change_indent(indent);
}
开发者ID:Milkyway-at-home,项目名称:nemo,代码行数:12,代码来源:tsf.c

示例11: draw_screen

void draw_screen(editor_t *ed)
  {
  int pos;
  int i;

  gotoxy(ed, 0, 0);
  outstr(ed, TEXT_COLOR);
  pos = ed->toppos;
  for (i = 0; i < ed->lines; i++)
    {
    if (pos < 0)
      {
      outstr(ed, CLREOL "\r\n");
      }
    else
      {
      display_line(ed, pos, 1);
      pos = next_line(ed, pos);
      }
    }
  }
开发者ID:kotuku-aero,项目名称:diy-efis,代码行数:21,代码来源:edit.c

示例12: con_getline

void con_getline(char *buf, int length)

{

	int index = 0;
	char ch = 0;

	// loop until we encounter a linefeed or carriage return, or until we run out of space
	while (!get_quitflag())
	{
		ch = con_getkey();

		// if we get a linefeed or carriage return, we're done ...
		if ((ch == 10) || (ch == 13))
		{
			break;
		}

		// backspace, it works but it doesn't look pretty on the screen
		else if (ch == 8)
		{
			if (index >0)
			{
				index = index - 1;
				outstr("[BACK]");
			}
		}
		
		// if we've run out of space, terminate the string prematurely to avoid crashing

		else if (index >= (length - 1))
		{
			break;
		}

		// otherwise if we get a printable character, add it to the string
		else if (ch >= ' ')
		{

			outchr(ch);	// echo it to the screen
			buf[index] = ch;
			index = index + 1;
		}

		// else it was a non-printable character, so we ignore it
	}

	buf[index] = 0;	// terminate the string
	newline();		// go to the next line

}
开发者ID:DavidGriffith,项目名称:daphne,代码行数:51,代码来源:conin.cpp

示例13: draw_full_statusline

void draw_full_statusline(editor_t *ed)
  {
  int namewidth = ed->cols - 28;
  gotoxy(ed, 0, ed->lines);

  sprintf(ed->linebuf, STATUS_COLOR "%*.*sF1=Help %c Ln %-6dCol %-4d" CLREOL TEXT_COLOR,
          -namewidth,
          namewidth,
          ed->title,
          ed->dirty ? '*' : ' ', ed->line + 1,
          column(ed, ed->linepos, ed->col) + 1);

  outstr(ed, ed->linebuf);
  }
开发者ID:kotuku-aero,项目名称:diy-efis,代码行数:14,代码来源:edit.c

示例14: print_head

void print_head(string tag, string type, int *dims)
{
    char buf[128];
    int *dp;

    if (strlen(type) == 1) {
	sprintf(buf, "%s %s", type_name(type), tag);
	(void) outstr(buf);
    } else {
	(void) outstr("struct { ");
	while (*type != (char) NULL) {
	    sprintf(buf, "%s ", type_name(type++));
	    (void) outstr(buf);
	}
	sprintf(buf, "} %s", tag);
	(void) outstr(buf);
    }
    if (dims != NULL)				/* is this a plural item?   */
	for (dp = dims; *dp != 0; dp++) {	/*   loop over dimensions   */
            sprintf(buf, "[%d]", *dp);		/*     format a dimension   */
            (void) outstr(buf);                 /*     and print it out     */
        }
}
开发者ID:jasminegrosso,项目名称:zeno,代码行数:23,代码来源:tsf.c

示例15: outstr

void ConnectionInstance::sendDebugReply(string message) {
    string outstr("ZZZ ");
    json_t* topnode = json_object();
    json_t* messagenode = json_string(message.c_str());
    if (!messagenode)
        messagenode = json_string_nocheck("Failed to parse the debug reply as a valid UTF-8 string.");
    json_object_set_new_nocheck(topnode, "message", messagenode);
    const char* replystr = json_dumps(topnode, JSON_COMPACT);
    outstr += replystr;
    free((void*) replystr);
    json_decref(topnode);
    MessagePtr outMessage(MessageBuffer::FromString(outstr));
    send(outMessage);
}
开发者ID:Xenjin,项目名称:fserv,代码行数:14,代码来源:connection.cpp


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