File:  [Research Unix] / researchv10no / libc / stdio / sscanf.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

/*
 * pANS stdio -- sscanf
 */
#include "iolib.h"
int sscanf(const char *s, const char *fmt, ...){
	int n;
	va_list args;
#ifdef V10
	FILE _strbuf;

	_strbuf._flag = _IOREAD|_IOSTRG;
	_strbuf._ptr = _strbuf._base = (unsigned char *) s;
	_strbuf._cnt = 0;
	while (*s++)
		_strbuf._cnt++;
#define f &_strbuf
#define sclose(x)
#else
	FILE *f=sopenr(s);
#endif
	va_start(args, fmt);
	n=vfscanf(f, fmt, args);
	va_end(args);
	sclose(f);
	return n;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.