New module 'readlink'.
authorBruno Haible <bruno@clisp.org>
Wed, 25 Jun 2003 20:54:21 +0000 (20:54 +0000)
committerBruno Haible <bruno@clisp.org>
Wed, 25 Jun 2003 20:54:21 +0000 (20:54 +0000)
ChangeLog
MODULES.html.sh
lib/ChangeLog
lib/readlink.c [new file with mode: 0644]
m4/ChangeLog
m4/readlink.m4 [new file with mode: 0644]
modules/readlink [new file with mode: 0644]
modules/xreadlink

index 4c14bfb..fa82c5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-25  Bruno Haible  <bruno@clisp.org>
+
+       * modules/readlink: New file.
+       * modules/xreadlink: Depend on it.
+       * MODULES.html.sh (func_all_modules): Add readlink.
+
 2003-06-22  Bruno Haible  <bruno@clisp.org>
 
        * modules/safe-read: Add m4/ssize_t.m4.
index 6a059d3..c1c202d 100755 (executable)
@@ -1672,6 +1672,7 @@ func_all_modules ()
   func_module mkstemp
   func_module mkdtemp
   func_module poll
+  func_module readlink
   func_module stat
   func_module lstat
   func_module timespec
index be7254f..ea69c6a 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-25  Bruno Haible  <bruno@clisp.org>
+
+       * readlink.c: New file.
+
 2003-06-20  Bruno Haible  <bruno@clisp.org>
 
        Assume C89, so PARAMS isn't needed.
diff --git a/lib/readlink.c b/lib/readlink.c
new file mode 100644 (file)
index 0000000..72d0e04
--- /dev/null
@@ -0,0 +1,36 @@
+/* Stub for readlink().
+   Copyright (C) 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+
+#if !HAVE_READLINK
+
+/* readlink() substitute for systems that don't have a readlink() function,
+   such as DJGPP 2.03 and mingw32.  */
+
+int
+readlink (const char *filename, char *buffer, size_t bufsize)
+{
+  errno = EINVAL;
+  return -1;
+}
+
+#endif
index 8656751..461fef0 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-25  Bruno Haible  <bruno@clisp.org>
+
+       * readlink.m4: New file.
+
 2003-06-22  Bruno Haible  <bruno@clisp.org>
 
        Portability to mingw32.
diff --git a/m4/readlink.m4 b/m4/readlink.m4
new file mode 100644 (file)
index 0000000..fd73d49
--- /dev/null
@@ -0,0 +1,22 @@
+# readlink.m4 serial 1
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_FUNC_READLINK],
+[
+  AC_CHECK_FUNCS(readlink)
+  if test $ac_cv_func_readlink = no; then
+    AC_LIBOBJ(readlink)
+    gl_PREREQ_READLINK
+  fi
+])
+
+# Prerequisites of lib/readlink.c.
+AC_DEFUN([gl_PREREQ_READLINE],
+[
+  :
+])
diff --git a/modules/readlink b/modules/readlink
new file mode 100644 (file)
index 0000000..8a0acb7
--- /dev/null
@@ -0,0 +1,19 @@
+Description:
+readlink() function: read the value of a symbolic link.
+
+Files:
+lib/readlink.c
+m4/readlink.m4
+
+Depends-on:
+
+configure.ac:
+gl_FUNC_READLINK
+
+Makefile.am:
+
+Include:
+
+Maintainer:
+Bruno Haible
+
index 0d0e08e..be4b484 100644 (file)
@@ -9,6 +9,7 @@ m4/ssize_t.m4
 
 Depends-on:
 xalloc
+readlink
 
 configure.ac:
 gl_XREADLINK