Пример #1
0
streammarker::streammarker(streambuf *sb)
{
    _sbuf = sb;
    if (!(sb->xflags() & _S_IS_BACKUPBUF)) {
	set_streampos(sb->seekoff(0, ios::cur, ios::in));
	_next = 0;
    }
    else {
	if (sb->put_mode())
	    sb->switch_to_get_mode();
	if (((backupbuf*)sb)->in_backup())
	    set_offset(sb->_gptr - sb->_egptr);
	else
	    set_offset(sb->_gptr - sb->_eback);

	// Should perhaps sort the chain?
	_next = ((backupbuf*)sb)->_markers;
	((backupbuf*)sb)->_markers = this;
    }
}
Пример #2
0
static void output_token_name(void)
{
	char *tname;

	/*  Run error detection only if last_defined_token was assigned  */
	if ((fcode > last_defined_token) && (last_defined_token > 0)) {
		char temp_buf[80];
		int buf_pos;
		u8 top_byte = fcode >> 8;
		printf("Invalid token:  [0x%03x]\n", fcode);
		sprintf(temp_buf, "Backing up over first byte, which is ");
		buf_pos = strlen(temp_buf);
		if (top_byte < 10) {
			sprintf(&temp_buf[buf_pos], " %02x", top_byte);
		} else {
			sprintf(&temp_buf[buf_pos], "0x%02x ( =dec %d)",
				top_byte, top_byte);
		}
		printremark(temp_buf);
		set_streampos(token_streampos + 1);
		return;
	}