Lines Matching refs:flags
24 /* Set some control flags or file descript for the stream
30 int sfset(Sfio_t* f, int flags, int set)
32 int sfset(f,flags,set)
34 int flags;
43 if(flags == 0 && set == 0)
44 SFMTXRETURN(f, (f->flags&SF_FLAGS));
48 if(set && (flags & (SF_LINE|SF_WCWIDTH)) && !(f->flags & (SF_LINE|SF_WCWIDTH)))
50 f->flags |= tflags;
55 f->flags &= ~tflags;
59 if(flags == 0)
60 SFMTXRETURN(f, (f->flags&SF_FLAGS));
65 oflags = f->flags;
66 if(!(f->bits&SF_BOTH) || (flags&SF_RDWR) == SF_RDWR )
67 flags &= ~SF_RDWR;
71 f->flags |= (flags&SF_SETS);
72 else f->flags &= ~(flags&SF_SETS);
75 if(!(f->flags&SF_RDWR))
76 f->flags |= (oflags&SF_RDWR);
79 f->flags &= ~SF_APPENDWR;
82 if((flags &= SF_RDWR) )
84 { if(flags == SF_READ)
85 flags = SF_WRITE;
86 else flags = SF_READ;
88 if((flags == SF_WRITE && !(f->mode&SF_WRITE)) ||
89 (flags == SF_READ && !(f->mode&(SF_READ|SF_SYNCED))) )
90 (void)_sfmode(f,flags,1);
94 if(!(f->flags&SF_SHARE) || f->extent < 0)
95 f->flags &= ~SF_PUBLIC;