예제 #1
0
	bool readfields(void* object, const bsreq* fields) {
		while(*p && !islinefeed()) {
			const bsreq* req = 0;
			if(readidentifier())
				req = fields->find(buffer);
			if(!req)
				warning(ErrorNotFoundMember1pInBase2p, buffer, getbasename(fields));
			readreq(object, req, 0);
		}
		return true;
	}
예제 #2
0
파일: roff.c 프로젝트: ysei/h-compiler
int readline()
{
    int startline;
    int doingword;
    isrequest = 0;
    startline = 1;
    doingword = 0;
    c = suck();
    if (c == '\n') {
        o_sp = 1;
        writebreak();
        goto out;
    } else if (isspace(c))
        writebreak();
    while(1) {
        if (c == EOF) {
            if (doingword) bumpword();
            break;
        }
        if (isspace(c)) {
            if (doingword == 0) {
                startline = 0;
                if (c==' ') {
                    assyline[assylen] = ' ';
                    assylen++;
                }
                if (c=='\t') {
                    tabulate();
                }
                if (c=='\n')	goto out;
                c = suck();
                continue;
            }
        }
        if (isspace(c)) {
            if (doingword) {
                bumpword();
                if (c == '\t')
                    tabulate();
                else if (assylen) {
                    assyline[assylen] = ' ';
                    assylen++;
                }
                doingword = 0;
                if (c == '\n') break;
            }
        }
        if (isspace(c) == 0) {
            if (doingword) {
                if (o_ul)
                    *holdp = c | UNDERL;
                else
                    *holdp = c;
                holdp++;
                goto readline1;
            }
            if (startline) {
                if (c == o_cc) {
                    isrequest = 1;
                    return(readreq());
                }
            }
            doingword = 1;
            holdp = holdword;
            if (o_ul)
                *holdp = c | UNDERL;
            else
                *holdp = c;
            holdp++;
        }
readline1:
        startline = 0;
        c = suck();
    }
out:
    if (o_ul) o_ul--;
    if (c != EOF)
        return(1);
    else
        return(0);
}