[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new module 'ftello'
From: |
Bruno Haible |
Subject: |
new module 'ftello' |
Date: |
Wed, 25 Apr 2007 09:51:25 +0200 |
User-agent: |
KMail/1.5.4 |
Eric Blake wrote on 2007-04-17:
> I discovered that mingw lacks ftello, so we also need a module for
> ftell/ftello
2007-04-25 Bruno Haible <address@hidden>
* modules/ftello: New file.
* m4/ftello.m4: New file.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Set also GNULIB_FTELLO,
HAVE_FTELLO.
* lib/stdio_.h (ftello): New declaration.
* modules/stdio (Makefile.am): Substitute also GNULIB_FTELLO,
HAVE_FTELLO.
=========================== modules/ftello =================================
Description:
ftello() function: Retrieve the position of a FILE stream.
Files:
m4/ftello.m4
Depends-on:
stdio
configure.ac:
gl_FUNC_FTELLO
gl_STDIO_MODULE_INDICATOR([ftello])
Makefile.am:
Include:
<stdio.h>
License:
LGPL
Maintainer:
Bruno Haible
=========================== m4/ftello.m4 ===================================
# ftello.m4 serial 1
dnl Copyright (C) 2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FTELLO],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for ftello], [gl_cv_func_ftello],
[
AC_TRY_LINK([#include <stdio.h>], [ftello (stdin);],
[gl_cv_func_ftello=yes], [gl_cv_func_ftello=no])
])
if test $gl_cv_func_ftello = no; then
HAVE_FTELLO=0
fi
])
============================================================================
*** lib/stdio_.h 25 Apr 2007 07:39:55 -0000 1.18
--- lib/stdio_.h 25 Apr 2007 07:49:40 -0000
***************
*** 220,225 ****
--- 220,238 ----
fseeko (f, o, w))
#endif
+ #if @GNULIB_FTELLO@
+ # if address@hidden@
+ /* Assume 'off_t' is the same type as 'long'. */
+ # define ftello ftell
+ # endif
+ #else
+ # undef ftello
+ # define ftello(f) \
+ (GL_LINK_WARNING ("ftello is unportable - " \
+ "use gnulib module ftello for portability"), \
+ ftello (f))
+ #endif
+
#if @GNULIB_FFLUSH@
# if @REPLACE_FFLUSH@
# define fflush rpl_fflush
*** modules/stdio 25 Apr 2007 07:39:55 -0000 1.12
--- modules/stdio 25 Apr 2007 07:49:40 -0000
***************
*** 31,36 ****
--- 31,37 ----
-e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
-e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
-e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
+ -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
-e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
***************
*** 45,50 ****
--- 46,52 ----
-e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
-e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
-e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
+ -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio_.h; \
*** m4/stdio_h.m4 25 Apr 2007 07:39:55 -0000 1.12
--- m4/stdio_h.m4 25 Apr 2007 07:49:40 -0000
***************
*** 31,36 ****
--- 31,37 ----
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
+ GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
***************
*** 46,50 ****
--- 47,52 ----
HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
+ HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
])
- Re: operations on FILE streams, (continued)
- new module 'fseeko', Bruno Haible, 2007/04/25
- Re: new module 'fseeko', Eric Blake, 2007/04/25
- Re: new module 'fseeko', Bruno Haible, 2007/04/26
- Re: new module 'fseeko', Bruno Haible, 2007/04/28
- Re: new module 'fseeko', Paul Eggert, 2007/04/25
- Re: new module 'fseeko', Bruno Haible, 2007/04/26
- new module 'ftello',
Bruno Haible <=
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/25
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/25
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/26
- Re: 'fflush' test failure on Cygwin, Eric Blake, 2007/04/26
- Re: 'fflush' test failure on Cygwin, Bruno Haible, 2007/04/25