projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
BSD 3 development
[unix-history]
/
usr
/
src
/
libc
/
stdio
/
setbuf.c
#include <stdio.h>
setbuf
(
iop
,
buf
)
register
struct
_iobuf
*
iop
;
char
*
buf
;
{
if
(
iop
->
_base
!=
NULL
&&
iop
->
_flag
&
_IOMYBUF
)
free
(
iop
->
_base
);
iop
->
_flag
&= ~(
_IOMYBUF
|
_IONBF
);
if
((
iop
->
_base
=
buf
) ==
NULL
)
iop
->
_flag
|=
_IONBF
;
else
iop
->
_ptr
=
iop
->
_base
;
iop
->
_cnt
=
0
;
}