Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * pANS stdio -- sopenr
3
 */
4
#include "iolib.h"
5
#include <string.h>
6
 
7
FILE *_IO_sopenr(const char *s){
8
	FILE *f;
9
	for(f=_IO_stream;f!=&_IO_stream[FOPEN_MAX];f++) if(f->state==CLOSED) break;
10
	if(f==&_IO_stream[FOPEN_MAX]) return NULL;
11
	f->buf=f->rp=(char *)s;	/* what an annoyance const is */
12
	f->bufl=strlen(s);
13
	f->wp=f->buf+f->bufl;
14
	f->state=RD;
15
	f->flags=STRING;
16
	f->fd=-1;
17
	return f;
18
}