Mercurial > hg > octave-shane > gnulib-hg
annotate m4/isapipe.m4 @ 11007:f6cba5a556ce
many *.m4 files: improve m4 quoting
99% of this change was performed by running the following commands:
git ls-files | grep '\.m4$' | xargs perl -pi \
-e 's/(AC_\w+\()([^[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){1})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){2})([^,[()]+?)([,)])/$1\[$2]$3/g;' \
-e 's/(AC_\w+\((?:\[[^,]+?\], ){3})([^,[()]+?)([,)])/$1\[$2]$3/g'
perl -pi -e 's/\[\.\.\.\]/.../' m4/onceonly.m4
The remainder were to add Copyright dates, increment serial numbers,
undo some changes in comments, exclude m4/intl.m4, and add quotes
around the "1" in ",1" where the unusual spacing prohibited the
above regexps from doing the job. For more details, see
<http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16175>.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Tue, 13 Jan 2009 08:48:48 +0100 |
parents | ec85aace506a |
children | e8d2c6fc33ad |
rev | line source |
---|---|
7233 | 1 # Test whether a file descriptor is a pipe. |
2 | |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7233
diff
changeset
|
3 dnl Copyright (C) 2006, 2009 Free Software Foundation, Inc. |
7233 | 4 |
5 dnl This file is free software; the Free Software Foundation | |
6 dnl gives unlimited permission to copy and/or distribute it, | |
7 dnl with or without modifications, as long as this notice is preserved. | |
8 | |
9 dnl Written by Paul Eggert. | |
10 | |
11 AC_DEFUN([gl_ISAPIPE], | |
12 [ | |
13 # OpenVMS has isapipe already, so check for it. | |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7233
diff
changeset
|
14 AC_REPLACE_FUNCS([isapipe]) |
7233 | 15 if test $ac_cv_func_isapipe = no; then |
16 gl_PREREQ_ISAPIPE | |
17 fi | |
18 ]) | |
19 | |
20 # Prerequisites of lib/isapipe.c. | |
21 AC_DEFUN([gl_PREREQ_ISAPIPE], | |
22 [ | |
23 AC_CACHE_CHECK([whether pipes are FIFOs (and for their link count)], | |
24 [gl_cv_pipes_are_fifos], | |
25 [AC_RUN_IFELSE( | |
26 [AC_LANG_SOURCE( | |
27 [[#include <stdio.h> | |
28 #include <sys/types.h> | |
29 #include <sys/stat.h> | |
30 #include <unistd.h> | |
31 #ifndef S_ISFIFO | |
32 #define S_ISFIFO(m) 0 | |
33 #endif | |
34 #ifndef S_ISSOCK | |
35 #define S_ISSOCK(m) 0 | |
36 #endif | |
37 int | |
38 main (int argc, char **argv) | |
39 { | |
40 int fd[2]; | |
41 struct stat st; | |
42 if (pipe (fd) != 0 || fstat (fd[0], &st) != 0) | |
43 return 1; | |
44 if (2 <= argc && argv[1][0] == '-') | |
45 { | |
46 char const *yesno = (S_ISFIFO (st.st_mode) ? "yes" : "no"); | |
47 if (st.st_nlink <= 1) | |
48 { | |
49 long int i = st.st_nlink; | |
50 if (i != st.st_nlink) | |
51 return 1; | |
52 printf ("%s (%ld)\n", yesno, i); | |
53 } | |
54 else | |
55 { | |
56 unsigned long int i = st.st_nlink; | |
57 if (i != st.st_nlink) | |
58 return 1; | |
59 printf ("%s (%lu)\n", yesno, i); | |
60 } | |
61 } | |
62 else | |
63 { | |
64 if (! S_ISFIFO (st.st_mode) && ! S_ISSOCK (st.st_mode)) | |
65 return 1; | |
66 } | |
67 return 0; | |
68 }]])], | |
69 [gl_cv_pipes_are_fifos=`./conftest$ac_exeext -` | |
70 test -z "$gl_cv_pipes_are_fifos" && gl_cv_pipes_are_fifos=no], | |
71 [gl_cv_pipes_are_fifos=unknown], | |
72 [gl_cv_pipes_are_fifos=cross-compiling])]) | |
73 | |
74 case $gl_cv_pipes_are_fifos in #( | |
75 'yes ('*')') | |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7233
diff
changeset
|
76 AC_DEFINE([HAVE_FIFO_PIPES], [1], |
7233 | 77 [Define to 1 if pipes are FIFOs, 0 if sockets. Leave undefined |
78 if not known.]);; #( | |
79 'no ('*')') | |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
7233
diff
changeset
|
80 AC_DEFINE([HAVE_FIFO_PIPES], [0]);; |
7233 | 81 esac |
82 | |
83 case $gl_cv_pipes_are_fifos in #( | |
84 *'('*')') | |
85 AC_DEFINE_UNQUOTED([PIPE_LINK_COUNT_MAX], | |
86 [`expr "$gl_cv_pipes_are_fifos" : '.*\((.*)\)'`], | |
87 [Define to the maximum link count that a true pipe can have.]);; | |
88 esac | |
89 ]) |