Lines Matching defs:f2
30 #define STKMTXLOCK(f1,f2) \
32 if(f2) SFMTXLOCK(f2); \
34 #define STKMTXRETURN(f1,f2,rv) \
36 if(f2) SFMTXUNLOCK(f2); \
41 Sfio_t* sfstack(Sfio_t* f1, Sfio_t* f2)
43 Sfio_t* sfstack(f1,f2)
45 Sfio_t* f2; /* top of stack */
53 STKMTXLOCK(f1,f2);
56 STKMTXRETURN(f1,f2, NIL(Sfio_t*));
57 if(f2 && (f2->mode&SF_RDWR) != f2->mode && _sfmode(f2,0,0) < 0)
58 STKMTXRETURN(f1,f2, NIL(Sfio_t*));
60 STKMTXRETURN(f1,f2, f2);
65 if(f2 == SF_POPSTACK)
66 { if(!(f2 = f1->push))
67 STKMTXRETURN(f1,f2, NIL(Sfio_t*));
68 f2->mode &= ~SF_PUSH;
71 { if(f2->push)
72 STKMTXRETURN(f1,f2, NIL(Sfio_t*));
73 if(f1->pool && f1->pool != &_Sfpool && f1->pool != f2->pool &&
85 if(f2->pool && f2->pool != &_Sfpool && f2 != f2->pool->sf[0])
86 (*_Sfpmove)(f2,0);
89 sfswap(f1,f2);
92 rsrv = f1->rsrv; f1->rsrv = f2->rsrv; f2->rsrv = rsrv;
93 mtx = f1->mutex; f1->mutex = f2->mutex; f2->mutex = mtx;
96 SFLOCK(f2,0);
98 if(f2->push != f2)
100 f2->mode |= SF_PUSH;
101 f1->push = f2;
107 f2->push = NIL(Sfio_t*);
108 rf = f2;
112 SFOPEN(f2,0);
114 STKMTXRETURN(f1,f2, rf);