/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1985-2011 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* David Korn <[email protected]> *18* Phong Vo <[email protected]> *19* *20***********************************************************************/21#pragma prototyped2223#include "stdhdr.h"2425int26fwide(Sfio_t* f, int mode)27{28STDIO_INT(f, "fwide", int, (Sfio_t*, int), (f, mode))2930if (mode > 0)31{32f->bits &= ~SF_MB;33f->bits |= SF_WC;34}35else if (mode < 0)36{37f->bits &= ~SF_WC;38f->bits |= SF_MB;39}40if (f->bits & SF_MB)41return -1;42if (f->bits & SF_WC)43return 1;44if ((f->flags & SF_SYNCED) || f->next > f->data)45{46f->bits |= SF_MB;47return -1;48}49return 0;50}515253