2 * have_fpos - Determine if have fgetpos and fsetpos functions
4 * Copyright (C) 1999 Landon Curt Noll
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.1 $
21 * @(#) $Id: have_fpos.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/have_fpos.c,v $
24 * Under source code control: 1994/11/05 03:19:52
25 * File existed as early as: 1994
27 * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
32 * If the symbol HAVE_NO_FPOS is defined, we will output nothing.
33 * If we are able to compile this program, then we must have the
34 * fgetpos and fsetpos functions and we will output the
35 * appropriate have_fpos.h file body.
44 #if !defined(HAVE_NO_FPOS)
45 fpos_t pos
; /* file position */
47 /* get the current position */
48 (void) fgetpos(stdin
, &pos
);
50 /* set the current position */
51 (void) fsetpos(stdin
, &pos
);
53 /* print a have_fpos.h body that says we have the functions */
54 printf("#undef HAVE_FPOS\n");
55 printf("#define HAVE_FPOS 1 /* yes */\n\n");
56 printf("typedef fpos_t FILEPOS;\n");