示例#1
0
Rune*
runestrcat(Rune *s1, const Rune *s2)
{

	runestrcpy((Rune*)runestrchr(s1, 0), s2);
	return s1;
}
示例#2
0
Rune*
runestrcat(Rune *s1, Rune *s2)
{

	runestrcpy(runestrchr(s1, 0), s2);
	return s1;
}
示例#3
0
Rune*
runestrdup(Rune *s) 
{  
	Rune *ns;

	ns = malloc(sizeof(Rune)*(runestrlen(s) + 1));
	if(ns == 0)
		return 0;
	setmalloctag(ns, getcallerpc(&s));
	return runestrcpy(ns, s);
}
示例#4
0
Rune*
runestrdup(Rune *s) 
{  
	Rune *ns;

	ns = malloc(sizeof(Rune)*(runestrlen(s) + 1));
	if(ns == 0)
		return 0;

	return runestrcpy(ns, s);
}
示例#5
0
文件: t11.c 项目: aahud/harvey
int
dv(int d)
{
	Rune sub[6];

	d += getnr(L(".dv"));
	nr(L(".dv"), d);

	runestrcpy(sub, L("<sub>"));
	sub[0] = Ult;
	sub[4] = Ugt;
	if(d < 0){
		sub[3] = 'p';
		ihtml(L(".dv"), sub);
	}else if(d > 0)
		ihtml(L(".dv"), sub);
	else
		ihtml(L(".dv"), nil);
	return 0;
}
示例#6
0
文件: t7.c 项目: 00001/plan9port
/* .di, .da */
void
r_di(int argc, Rune **argv)
{
	br();
	if(argc > 2)
		warn("extra arguments to %C%S", dot, argv[0]);
	if(argc == 1){
		/* end diversion */
		if(ndi <= 0){
			/* warn("unmatched %C%S", dot, argv[0]); */
			return;
		}
		flushdi();
		if(--ndi == 0){
			_nr(L(".z"), nil);
			outcb = nil;
		}else{
			_nr(L(".z"), di[ndi-1]);
			runefmtstrinit(&difmt);
			fmtrune(&difmt, Uformatted);
			difmtinit = 1;
		}
		return;
	}
	/* start diversion */
	/* various register state should be saved, but it's all useless to us */
	flushdi();
	if(ndi >= nelem(di))
		sysfatal("%Cdi overflow", dot);
	if(argv[0][1] == 'i')
		ds(argv[1], nil);
	_nr(L(".z"), argv[1]);
	runestrcpy(di[ndi++], argv[1]);
	runefmtstrinit(&difmt);
	fmtrune(&difmt, Uformatted);
	difmtinit = 1;
	outcb = outdi;
}