コード例 #1
0
ファイル: macro.c プロジェクト: axelmuhr/Helios-NG
PRIVATE void collectarg(struct Arg *arg)
{
        struct Macro *macro = New(struct Macro);
	INT quoted = arg->quoted;
	
        pbskipspaces();

        while( quoted-- ) pbchar(c_quote);

        getdef(&macro->def);

        macro->nargs = 0;

        adddef((INT)s_macro,arg->sym,(INT)macro);
}
コード例 #2
0
ファイル: ex6_6.c プロジェクト: athulappadan/new-kr-solutions
main()
{
	char w[MAXWORD];
	struct nlist *p;

	while (getword(w, MAXWORD) != EOF)
		if (strcmp(w, "//") == 0)
			getdef();
		else if (!isalpha(w[0]))
			printf("%s", w);
		else if ((p = lookup(w)) == NULL)
			printf("%s", w);
		else
			ungets(p->defn);
	return 0;
}
コード例 #3
0
ファイル: getpagesize.c プロジェクト: yeonsh/Amoeba
int
getpagesize()
{
#ifdef PAGESIZE
	return PAGESIZE;
#else
	capability self;
	int clickshift, first, last;
	
	if (getinfo(&self, NILPD, 0) < 0)
		ERR(EIO, "getpagesize: getinfo failed");
	if (getdef(&self, &clickshift, &first, &last) < 0)
		ERR(EIO, "getpagesize: getdef failed");
	return 1<<clickshift;
#endif
}
コード例 #4
0
ファイル: 6-6.c プロジェクト: icesyc/K-R
int main(){
	char w[MAXWORD];
	nlist *p;
	while(getword(w, MAXWORD) != EOF){
		if(strcmp(w, "#") == 0){
			getdef();
		}else if(!isalpha(w[0])){
			printf("%s", w);
		}else if((p = lookup(w)) == NULL){
			printf("%s", w);
		}else{
			printf("%s", p->defn);
		}
	}
	return 0;
}