Compare commits

...

914 Commits

Author SHA1 Message Date
Jim Meyering
6af7fe7bf9 *** empty log message *** 1998-08-09 20:08:27 +00:00
Jim Meyering
26abcd14d2 update from glibc 1998-08-07 12:54:51 +00:00
Jim Meyering
2fe9a639e5 *** empty log message *** 1998-08-03 03:03:29 +00:00
Jim Meyering
f1db42afed Ansideclify. 1998-08-03 03:03:11 +00:00
Jim Meyering
2d329c22c0 *** empty log message *** 1998-08-03 03:02:20 +00:00
Jim Meyering
c3db9f982a (readline): Return zero upon error as well as upon
end of file.  From James Youngman.
1998-08-03 03:02:04 +00:00
Jim Meyering
c01e767ceb . 1998-08-02 20:52:34 +00:00
Jim Meyering
0d16e71b07 . 1998-08-02 19:45:45 +00:00
Jim Meyering
2fcce776e8 . 1998-08-02 16:33:53 +00:00
Jim Meyering
bad1e4b2e1 *** empty log message *** 1998-08-02 16:33:45 +00:00
Jim Meyering
f5a228ae42 *** empty log message *** 1998-08-02 16:32:42 +00:00
Jim Meyering
a40eb86598 . 1998-08-02 16:25:14 +00:00
Jim Meyering
0136b885fe (re_protect): Add comment. 1998-08-02 16:24:41 +00:00
Jim Meyering
0f7ac75854 (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP, MTIME_CMP): New macros. 1998-08-02 16:24:13 +00:00
Jim Meyering
9fc5987250 (copy_internal): Compare time stamps with subsecond resolution if available. 1998-08-02 16:23:28 +00:00
Jim Meyering
e71d9696d7 (compare_ctime, rev_cmp_ctime, compare_mtime,
rev_cmp_mtime, compare_atime, rev_cmp_atime): Compare time
stamps with subsecond resolution if available.
1998-08-02 16:23:06 +00:00
Jim Meyering
6e1306ba8b (touch): Add comment. 1998-08-02 16:22:43 +00:00
Jim Meyering
a607901e48 (change_timestamps): Add comment. 1998-08-02 16:22:24 +00:00
Jim Meyering
01053400d0 *** empty log message *** 1998-08-02 16:20:50 +00:00
Jim Meyering
419b2d26fe Use hack to avoid having to put #undef HAVE_ST_MTIM in acconfig.h manually. 1998-08-02 16:20:39 +00:00
Jim Meyering
4ed33b3073 tweak indentation 1998-08-02 16:18:21 +00:00
Jim Meyering
ef9ee27d89 from Paul Eggert 1998-08-02 16:15:17 +00:00
Jim Meyering
277da1b998 *** empty log message *** 1998-08-02 04:16:01 +00:00
Jim Meyering
983b8c433c . 1998-08-01 15:48:56 +00:00
Jim Meyering
d5c69ef797 (my_setlocale): Guard definition within #ifdef ENABLE_NLS. 1998-08-01 15:47:26 +00:00
Jim Meyering
eb8ea6eac5 Avoid broken pipe message for tests that fail with usage errors. 1998-07-30 12:26:24 +00:00
Jim Meyering
da68f39411 * src/sort.c (usage): Add angle brackets to make `Report bugs...'
message consistent with all the rest.
1998-07-30 12:13:39 +00:00
Jim Meyering
2fcc1267b5 *** empty log message *** 1998-07-29 13:29:23 +00:00
Jim Meyering
4ead0cb8df (NEGATION_SIGN): Renamed from NEGATIVE_SIGN to avoid
clash with <langinfo.h>.  All uses changed.
From Andreas Schwab.
1998-07-29 13:29:10 +00:00
Jim Meyering
f96dc5e195 Avoid broken pipe for 'y' and 'z' tests.
From Andreas.
1998-07-29 13:27:28 +00:00
Jim Meyering
82e166ebbb *** empty log message *** 1998-07-29 04:01:45 +00:00
Jim Meyering
6a9aa3cf98 (show_all_fs):
Revert to boolean value; the old negative value is
now in show_local_fs.
(show_local_fs): New variable.
(show_dev): New args me_dummy and me_class.  Use show_local_fs
and boolean show_all_fs in combination with these new args
to decide whether to show a device.
(show_disk): Pass flags to show_dev.
(show_point): Use a non-dummy mount entry if possible.
(show_all_entries): Pass flags to show_dev.
(main): --local sets show_local_fs now.  Ask for file system types if
show_local_fs is nonzero, since ME_REMOTE might need them.

From Paul.
1998-07-29 04:01:29 +00:00
Jim Meyering
3cf7eece6f Remove duplicate include of <stdio.h>. 1998-07-29 04:00:36 +00:00
Jim Meyering
7dfff499c3 (struct mount_entry):
New members me_dummy, me_remote.
(read_filesystem_list): Remove all_fs argument.
(REMOTE_FS_TYPE): Remove.
(ME_DUMMY, ME_REMOTE): New macros.

From Paul.
1998-07-29 03:58:55 +00:00
Jim Meyering
52e2de5780 (read_filesystem_list): Remove all_fs
argument, but put the necessary information into the result so
that the caller can ignore filesystems that he's not
interested in.

From Paul.
1998-07-29 03:58:02 +00:00
Jim Meyering
c0d6757201 *** empty log message *** 1998-07-28 13:29:22 +00:00
Jim Meyering
3942f87ee3 *** empty log message *** 1998-07-28 13:20:20 +00:00
Jim Meyering
9d07c1872f Undef stat. 1998-07-28 13:15:58 +00:00
Jim Meyering
be388d139c *** empty log message *** 1998-07-27 14:25:10 +00:00
Jim Meyering
6e132bee5e Make copy create each destination file initially
with mode 0600 so strip will work, then apply specified mode.
Arne Henrik Juul reported that `./ginstall -s -c -m 555 dd /tmp' failed.
1998-07-27 13:39:36 +00:00
Jim Meyering
7d63d3c635 . 1998-07-27 13:38:42 +00:00
Jim Meyering
08d53c4c6a (TESTS_ENVIRONMENT): Set LS, MKDIR, and RM. 1998-07-27 13:27:45 +00:00
Jim Meyering
94edd792f7 use ls to check the permissions 1998-07-27 13:26:58 +00:00
Jim Meyering
5ab6986171 Test stripping an executable that eventually will be made unwritable. 1998-07-27 13:18:31 +00:00
Jim Meyering
25176dbdef *** empty log message *** 1998-07-26 21:48:37 +00:00
Jim Meyering
b49807bfb2 Convert some char* dcls to `unsigned char*' and remove a cast --
to placate irix4's cc.
1998-07-26 20:43:50 +00:00
Jim Meyering
d71367f33e (check_punctuation): Add cast to placate irix4's cc. Reported by Kaveh Ghazi. 1998-07-26 20:42:02 +00:00
Jim Meyering
bd85887daf (split_3): Add cast to placate irix4's cc. From Kaveh Ghazi. 1998-07-26 20:09:25 +00:00
Jim Meyering
82988e97cf (chown): Remove unused definition.
Reported by Kaveh Ghazi.
1998-07-26 04:13:57 +00:00
Jim Meyering
2b374ec2d9 . 1998-07-26 04:10:01 +00:00
Jim Meyering
3e3b8558d6 . 1998-07-26 04:06:55 +00:00
Jim Meyering
5c4cb177ef Add tests for new --output-delimiter option,
as well as for NUL input delimiter (--delimiter='').
1998-07-26 04:06:37 +00:00
Jim Meyering
71a3fc7989 . 1998-07-26 04:06:07 +00:00
Jim Meyering
5c9345dbd1 (cut_fields): Honor new --output-delimiter option.
(main): Fix handling of --delimiter='' (-d '').  Until now, it has
never worked as advertised.  I guess no one tried it.
1998-07-26 04:05:07 +00:00
Jim Meyering
287ddc8d05 *** empty log message *** 1998-07-26 03:59:27 +00:00
Jim Meyering
36ac5f1519 . 1998-07-26 02:59:37 +00:00
Jim Meyering
bde54af30f *** empty log message *** 1998-07-26 02:56:36 +00:00
Jim Meyering
cafbd3477a Add two tests. `sort -o no-file no-file' didn't fail. 1998-07-26 02:55:53 +00:00
Jim Meyering
165718775f (main): Stat all non-`-' input file files (and fail if a
stat fails) when an output file is specified by `-o' but doesn't exist.
1998-07-26 02:54:01 +00:00
Jim Meyering
f90d1551cb *** empty log message *** 1998-07-26 00:29:45 +00:00
Jim Meyering
613f0e187f (main): rmdir fails with EEXIST on some systems.
Handle that, so --ignore-fail-on-non-empty works.
(EEXIST): Define to zero if not defined.
(ENOTEMPTY): Likewise.
1998-07-26 00:29:30 +00:00
Jim Meyering
ca6da4ffce *** empty log message *** 1998-07-25 21:50:53 +00:00
Jim Meyering
ac517dbe89 Remove `diff' I'd put in for debugging.
Exit with the status from cmp.
1998-07-25 21:50:35 +00:00
Jim Meyering
3ae3622d9e *** empty log message *** 1998-07-25 17:52:54 +00:00
Jim Meyering
27682ba5ce Skip three more unportable tests. These failed on SunOS4.1.4. 1998-07-25 17:52:37 +00:00
Jim Meyering
8dd3e53122 *** empty log message *** 1998-07-25 16:49:13 +00:00
Jim Meyering
d1187d36da *** empty log message *** 1998-07-25 16:45:45 +00:00
Jim Meyering
0f85045bb3 . 1998-07-25 15:32:12 +00:00
Jim Meyering
69835e9fb6 (SAME_INODE): Define it here instead. 1998-07-25 15:31:23 +00:00
Jim Meyering
3ba948db7e (SAME_INODE): Remove definition. 1998-07-25 15:30:08 +00:00
Jim Meyering
d1f9e2315b . 1998-07-25 15:28:24 +00:00
Jim Meyering
d04604664a (same_file): New function
(remove_dir): Use it to give a better diagnostic when rmdir fails
because it can't remove the current directory.
1998-07-25 15:27:55 +00:00
Jim Meyering
4e9a99dd9a (long_options): Changes table entries not to use this form:
{"all", no_argument, &show_all_fs, 1},
but rather this form:
{"all", no_argument, NULL, 'a'},
Using the latter, all the option handling in one place: the getopt loop.
1998-07-25 15:14:16 +00:00
Jim Meyering
3f3df4e600 Use PARAMS macro. 1998-07-25 15:01:32 +00:00
Jim Meyering
27e780fe97 (xatoi): Ansideclify.
(fstype_to_string): Ansideclify.
1998-07-25 15:00:37 +00:00
Jim Meyering
122d3f15ae (REMOTE_FS_TYPE): New macro. 1998-07-25 14:55:10 +00:00
Jim Meyering
bb3fca40db (read_filesystem_list) [MOUNTED_GETMNTINFO]: Use fsp_to_string.
(fsp_to_string): Don't xmalloc return value (yet).
1998-07-25 14:54:42 +00:00
Jim Meyering
91c40bd499 (read_filesystem_list): If all_fs is negative, omit non-local filesytems.
From Paul Eggert.
1998-07-25 14:41:04 +00:00
Jim Meyering
0f4fcb1fbd (show_dev): Omit local devices if show_all_fs is negative.
(show_all_fs): If negative, omit non-local filesystems.
All uses of (all_fs != 0) changed to (all_fs > 0).
(long_options, usage, main): Add -l or --local option.
(main): When asking for df of an explicit file name, get all
the mount points, so that we're more likely to find it when
we look it up.
1998-07-25 14:36:07 +00:00
Jim Meyering
3fbc98bb54 . 1998-07-25 13:49:47 +00:00
Jim Meyering
240b9c0f89 . 1998-07-25 13:48:45 +00:00
Jim Meyering
fc13bb65df (utime_now): Moved into m4/utimes.m4.
(touch) [!HAVE_UTIME_NULL]: Remove #ifdef and use of utime_now in if-block.
1998-07-25 13:20:49 +00:00
Jim Meyering
27f3ca3d5a . 1998-07-25 13:16:38 +00:00
Jim Meyering
f1a7e03bbe *** empty log message *** 1998-07-25 13:10:11 +00:00
Jim Meyering
8d58cbb99e . 1998-07-22 18:32:36 +00:00
Jim Meyering
3b87431a69 (human_readable): amt -> damt, to fix typo when
computing which power to use after overflow occurs during
multiplication.

From Paul Eggert.
1998-07-22 18:30:16 +00:00
Jim Meyering
d09816b054 *** empty log message *** 1998-07-22 16:57:26 +00:00
Jim Meyering
19c23eefb7 Include <stdio.h> if NDEBUG is not defined; needed on SunOS 4.
From Paul Eggert.
1998-07-22 16:57:15 +00:00
Jim Meyering
ef8d2acace . 1998-07-20 03:59:51 +00:00
Jim Meyering
f7d6ece6e4 . 1998-07-20 03:58:24 +00:00
Jim Meyering
90a63a16ec . 1998-07-20 03:58:04 +00:00
Jim Meyering
ec7ec3773f *** empty log message *** 1998-07-20 03:57:59 +00:00
Jim Meyering
a97f821233 (copy_internal): Add another exclusion from the
sameness test: when --force has been specified, the destination
is unlinked before any copy.
(copy_internal): Add yet another: when both src and dest are symlinks.
1998-07-19 04:14:52 +00:00
Jim Meyering
b15e832f4d *** empty log message *** 1998-07-18 14:06:38 +00:00
Jim Meyering
e77a16efec *** empty log message *** 1998-07-18 13:54:40 +00:00
Jim Meyering
7fd7c6465e *** empty log message *** 1998-07-18 13:53:32 +00:00
Jim Meyering
7fc23ef625 . 1998-07-18 13:51:11 +00:00
Jim Meyering
1bd7deb235 (TESTS): Add into-self-2. 1998-07-18 13:16:43 +00:00
Jim Meyering
f2dd2f10c1 . 1998-07-18 13:15:33 +00:00
Jim Meyering
1af4f2f11d (read_filesystem_list): Fix more memory leaks on failure.
From Andreas Schwab.
1998-07-18 12:28:31 +00:00
Jim Meyering
1703d0d59c *** empty log message *** 1998-07-16 23:41:43 +00:00
Jim Meyering
7ac1d190bc Include lchown.h. 1998-07-16 23:41:03 +00:00
Jim Meyering
0c3c6b1b0b *** empty log message *** 1998-07-16 23:40:18 +00:00
Jim Meyering
01c3ff5a1e (noinst_HEADERS): Add lchown.h. 1998-07-16 23:26:50 +00:00
Jim Meyering
1b03d98f62 include lchown.h 1998-07-16 23:25:29 +00:00
Jim Meyering
b294d530d4 . 1998-07-16 23:23:05 +00:00
Jim Meyering
75b6b90fe1 [!ENOSYS] (ENOSYS): Define to ENOTSUP or ENOMSG. 1998-07-16 23:20:03 +00:00
Jim Meyering
7613946ac6 *** empty log message *** 1998-07-16 23:14:30 +00:00
Jim Meyering
5b16f997e8 [!ENOSYS] (ENOSYS): Define to ENOTSUP or ENOMSG. 1998-07-16 23:12:25 +00:00
Jim Meyering
ee041d6d4f Update prototype. 1998-07-16 23:02:19 +00:00
Jim Meyering
f89f495c0d (safe_read): Change type of pointer parameter to
`void' to avoid Irix4 cc errors.  Reported by Kaveh Ghazi.
1998-07-16 23:02:03 +00:00
Jim Meyering
5e3e9e7a15 . 1998-07-16 22:58:12 +00:00
Jim Meyering
8d4d2c4cf4 (check_format): Add `5' to the list of digits.
Reported by Donni Erpel.
1998-07-15 12:39:58 +00:00
Jim Meyering
36de2ed1e2 . 1998-07-13 00:33:36 +00:00
Jim Meyering
f42b337a0b check: depend on maint_gen 1998-07-13 00:31:49 +00:00
Jim Meyering
6cdd12a9f2 (print_header): Print "1k-blocks", not "1.0k-blocks". 1998-07-13 00:17:57 +00:00
Jim Meyering
a0ec87fbf9 *** empty log message *** 1998-07-09 14:29:22 +00:00
Jim Meyering
5c71306463 (jm_FUNC_CHOWN): Add a check to verify that the
uid and gid actually remain unchanged.
1998-07-09 14:29:11 +00:00
Jim Meyering
da69105424 *** empty log message *** 1998-07-08 01:10:45 +00:00
Jim Meyering
1ea1c0864c *** empty log message *** 1998-07-08 01:08:37 +00:00
Jim Meyering
a4e98775a4 Remove FCLOSE_UNLOCKED block. 1998-07-08 01:07:39 +00:00
Jim Meyering
5017930f13 Remove fclose_unlocked. 1998-07-08 01:03:34 +00:00
Jim Meyering
73b7370917 (parse_line): Add casts to avoid errors from Irix4's `cc' C compiler.
From Kaveh Ghazi.
1998-07-05 00:25:10 +00:00
Jim Meyering
bca292d9e6 Include stdio.h. Required on some systems when using assert.
From Kaveh Ghazi.
1998-07-04 17:15:08 +00:00
Jim Meyering
6e3b675ea8 Use cmp, not diff.
Reported by Kaveh Ghazi.
1998-07-04 17:08:26 +00:00
Jim Meyering
95efa0587b *** empty log message *** 1998-07-04 16:46:04 +00:00
Jim Meyering
e49ef588db bump serial number 1998-07-04 16:45:52 +00:00
Jim Meyering
5823a999fe Use syscmd, ifelse, and sysval. Mainly as an exercise
to prove that this macro can be used in packages without regex.c.
1998-07-04 16:45:18 +00:00
Jim Meyering
218c464b91 tweak comment 1998-07-04 15:46:38 +00:00
Jim Meyering
3cc80de466 . 1998-07-04 15:14:46 +00:00
Jim Meyering
52fa9ac235 Remove #ifdef around <regex.h> inclusion. 1998-07-04 14:45:29 +00:00
Jim Meyering
9b809393be Remove #ifdef around <regex.h> inclusion.
(extract_regexp): Remove #if !WITH_REGEX...#endif block.
1998-07-04 14:45:12 +00:00
Jim Meyering
610567e17f *** empty log message *** 1998-07-04 04:10:28 +00:00
Jim Meyering
ad4e506e0f add warning 1998-07-04 04:07:55 +00:00
Jim Meyering
4475ffda48 (remove_dir): Use fprintf, not error to avoid newline in prompt. 1998-07-04 03:59:34 +00:00
Jim Meyering
1b23f5094d *** empty log message *** 1998-07-04 03:43:50 +00:00
Jim Meyering
02f917c543 . 1998-07-04 03:42:40 +00:00
Jim Meyering
60a6e7be26 *** empty log message *** 1998-07-04 03:17:08 +00:00
Jim Meyering
8133377948 . 1998-07-04 01:46:33 +00:00
Jim Meyering
1df5503ccf *** empty log message *** 1998-07-04 01:46:23 +00:00
Jim Meyering
e9a5c7551c use $jm_with_regex, now $WITH_REGEX 1998-07-04 01:46:01 +00:00
Jim Meyering
adfde62439 remove ifdef around inclusion of regex.h altogether!! 1998-07-04 01:44:01 +00:00
Jim Meyering
4b05962106 add 100 to serial number 1998-07-04 01:38:14 +00:00
Jim Meyering
df142feab8 . 1998-07-04 01:33:27 +00:00
Jim Meyering
b2aff777b1 (noinst_HEADERS): Add regex.h. 1998-07-04 01:33:19 +00:00
Jim Meyering
b793f241f4 . 1998-07-04 00:53:46 +00:00
Jim Meyering
ad22b83e45 *** empty log message *** 1998-07-04 00:53:38 +00:00
Jim Meyering
c71fc5f18e . 1998-07-04 00:48:49 +00:00
Jim Meyering
3e13b5e49d . 1998-07-04 00:48:15 +00:00
Jim Meyering
8f55e63084 (read_filesystem_list):
Don't leak memory on failure.
Don't create a dummy struct mount_entry entry;
use the address-of-the-tail-address method instead.
Preserve errno if possible on failure, setting it to 0 if inapplicable.
Close file descriptor leak if the F_SETLKW failed.
Report an error if SVR4 lock file cannot be opened for some reason
other than a nonexistent lock file.
1998-07-04 00:48:11 +00:00
Jim Meyering
2eb479a682 . 1998-07-04 00:41:16 +00:00
Jim Meyering
ec65e39e6f *** empty log message *** 1998-07-04 00:40:52 +00:00
Jim Meyering
bedf44ba83 (AM_WITH_NLS): Remove intl/libintl.h if <libintl.h> is to be used. 1998-07-04 00:39:41 +00:00
Jim Meyering
0cb0cc4e2f . 1998-07-04 00:35:27 +00:00
Jim Meyering
aee16a6664 . 1998-07-04 00:23:40 +00:00
Jim Meyering
93d47b3db9 . 1998-07-04 00:22:39 +00:00
Jim Meyering
18c222c5b5 . 1998-07-04 00:20:47 +00:00
Jim Meyering
bb01a24be5 Require jm_WITH_REGEX. 1998-07-04 00:20:36 +00:00
Jim Meyering
1ccc979847 . 1998-07-04 00:19:23 +00:00
Jim Meyering
ad1d74e973 *** empty log message *** 1998-07-04 00:19:08 +00:00
Jim Meyering
0142ca7d96 *** empty log message *** 1998-07-04 00:17:52 +00:00
Jim Meyering
bcfa9cbbd7 Change guard on <regex.h> inclusion to use new
symbol `! HAVE_LIBC_REGEX' defined in m4/regex.m4.
1998-07-04 00:15:37 +00:00
Jim Meyering
6c93489171 . 1998-07-04 00:05:23 +00:00
Jim Meyering
345c323ffd (copy_internal): Rename variable and reverse sense of tests
to make the code a little clearer.
1998-07-03 23:56:44 +00:00
Jim Meyering
1f682431ae (df_readable): Rename local so as not to shadow global. 1998-07-03 21:05:06 +00:00
Jim Meyering
698a43f363 (SAME_INODE): New macro.
Use it to replace open-coded equivalents.
1998-07-03 20:57:31 +00:00
Jim Meyering
def9c2bf0b (copy_internal): Try harder identifying a relative
symbolic link in the current directory.
From Andreas Schwab.
1998-07-03 20:32:37 +00:00
Jim Meyering
6191d1839a Skip tests that depend on link(2) not following symlinks.
From Andreas Schwab.
1998-07-03 20:09:03 +00:00
Jim Meyering
184870f9bb (copy_internal): Don't skip test for same file if creating a hardlink
from symlink over a non-symlink while making backups.
1998-07-03 20:06:50 +00:00
Jim Meyering
6ccae5e2d8 (copy_internal): Don't call chown on a symlink. 1998-07-03 19:57:42 +00:00
Jim Meyering
31f6e2b228 *** empty log message *** 1998-07-01 12:46:39 +00:00
Jim Meyering
d05618c5c2 Don't define NDEBUG, now that it's done via configure's --disable-assert option. 1998-07-01 12:44:22 +00:00
Jim Meyering
7a314199db (read_filesystem_list):
Plug file descriptor leak on failure.
Report failure if lock file can't be opened for some reason
other than nonexistence.
1998-06-30 14:32:53 +00:00
Jim Meyering
837a447ba4 *** empty log message *** 1998-06-30 14:32:33 +00:00
Jim Meyering
5d2bbddf97 . 1998-06-30 03:57:55 +00:00
Jim Meyering
6dda2aaa52 (read_filesystem_list) [MOUNTED_GETMNTENT2]:
Always close stream and file descriptor before returning.
1998-06-30 03:56:57 +00:00
Jim Meyering
3fa1d4bb24 (main): Move the test of the result of the read_filesystem_list call
up out of if-block -- code in the else-block depends on it too.
1998-06-30 02:27:51 +00:00
Jim Meyering
1c84606b56 (read_filesystem_list): If SVR4, lock /etc/.mnttab.lock if available,
to avoid race conditions (e.g. with the automounter on Solaris 2.6).

Include <errno.h>, <fcntl.h>, <unistd.h>.
1998-06-30 02:15:43 +00:00
Jim Meyering
b1b273f24f *** empty log message *** 1998-06-29 20:34:02 +00:00
Jim Meyering
e211d3960f . 1998-06-29 20:33:24 +00:00
Jim Meyering
9282f5f8a6 . 1998-06-29 20:32:36 +00:00
Jim Meyering
1d2074e02a protoize 1998-06-29 20:29:28 +00:00
Jim Meyering
8dce8df49a . 1998-06-29 17:35:28 +00:00
Jim Meyering
4d4b2c8e5e *** empty log message *** 1998-06-29 17:31:11 +00:00
Jim Meyering
a72bab1a32 *** empty log message *** 1998-06-29 17:19:30 +00:00
Jim Meyering
affbb977af . 1998-06-29 17:03:13 +00:00
Jim Meyering
aa1c5467ec (fstype_to_string): Guard with #if ! HAVE_F_FSTYPENAME_IN_STATFS. 1998-06-29 17:01:48 +00:00
Jim Meyering
435fa5a7dd Include sys/param.h. NetBSD 1.3.1 requires this
for the definition of NGROUPS (used in a system header included
by sys/mount.h).
1998-06-29 16:57:09 +00:00
Jim Meyering
b7441176e3 *** empty log message *** 1998-06-29 16:24:37 +00:00
Jim Meyering
f3c14cb59f revert back to using lower case _unlocked wrapper names 1998-06-29 16:24:01 +00:00
Jim Meyering
8ba97d963e Include system.h only after error.h and readutmp.h
so we don't get redefinition warnings about getc, etc.
Revert back to using lower case _unlocked wrapper names.
1998-06-29 16:23:15 +00:00
Jim Meyering
223e88f957 *** empty log message *** 1998-06-29 16:16:58 +00:00
Jim Meyering
83d4b736d2 revert back to using lower case _unlocked wrapper names 1998-06-29 15:59:39 +00:00
Jim Meyering
257c5c4737 revert back to using lower case _unlocked wrapper names 1998-06-29 15:57:45 +00:00
Jim Meyering
391c960cba Update call to human_readable -- now there's one fewer arg. 1998-06-29 15:56:23 +00:00
Jim Meyering
62f208d493 . 1998-06-29 15:38:09 +00:00
Jim Meyering
60ae0b81a5 (__xstrtol), src/dd.c (parse_integer):
Add support for SI-like suffixes like "GB" and "TD".
(usage): Describe it.
1998-06-29 15:36:28 +00:00
Jim Meyering
09d344df5b (human_readable_base, output_units): Remove;
replace with new variable output_block_size.  All uses changed.
(long_options, usage, main): Add --block-size.
(main, decode_switches): Use new human_block_size function to
initialize output block size consistently with other programs.

From Paul Eggert.
1998-06-29 15:34:54 +00:00
Jim Meyering
43f4099c95 (human_readable_base, output_units): Remove;
replace with new variable output_block_size.  All uses changed.
(long_options, usage, main): Add --block-size.
(main, decode_switches): Use new human_block_size function to
initialize output block size consistently with other programs.

(print_header, show_dev): Shrink some columns and expand
others, to squeeze in support for today's larger filesystems.
(print_header): Print output block size using power-of-1024 SI format.
(df_readable): Coalesce last two args into one, for convenience.
All callers changed.
(main): Remove check for portable output format and larger
or human-readable block sizes.

From Paul Eggert.
1998-06-29 15:33:38 +00:00
Jim Meyering
476cb02516 * lib/xstrtol.c (bkm_scale): Don't assume that you can convert
unsigned long to double without losing information.
	(bkm_scale_by_power): New function.

	* lib/xstrtol.c (__xstrtol), src/dd.c (parse_integer):
	Add support for SI-like suffixes like "GB" and "TD".
	* src/dd.c (usage): Describe it.
1998-06-29 15:24:43 +00:00
Jim Meyering
159788fcca (__ZLONG_MAX): Remove. 1998-06-29 15:24:15 +00:00
Jim Meyering
f32dc5a2b0 (human_readable): Coalesce last two args into one, for convenience. 1998-06-29 15:23:45 +00:00
Jim Meyering
ea7102f120 * lib/human.c, lib/human.h (human_readable): Coalesce last two args
into one, for convenience.  All callers changed.
	(human_block_size): New function.
	* lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
	Include <stdlib.h> if HAVE_STDLIB_H;
	declare getenv unless HAVE_DECL_GETENV.
	(_): New macro.
	Include <argmatch.h>, <error.h>, <xstrtoul.h>.
	(DEFAULT_BLOCK_SIZE): New macro.
	(block_size_args, block_size_types): New constants.
	(humblock): New function.
1998-06-29 15:23:04 +00:00
Jim Meyering
41ef62c472 *** empty log message *** 1998-06-29 14:27:03 +00:00
Jim Meyering
26d5ce2f26 . 1998-06-29 03:42:55 +00:00
Jim Meyering
868ed3b0af (usage): Make --kilobytes description consistent with
that in du and df.  From Gran Uddeborg.
1998-06-29 03:42:50 +00:00
Jim Meyering
6552bb980b *** empty log message *** 1998-06-29 03:42:18 +00:00
Jim Meyering
79a6760fe4 . 1998-06-29 02:27:55 +00:00
Jim Meyering
531453d901 . 1998-06-29 02:16:17 +00:00
Jim Meyering
1d94869663 . 1998-06-29 02:15:29 +00:00
Jim Meyering
ce195c7a07 . 1998-06-29 02:14:27 +00:00
Jim Meyering
09a2261919 . 1998-06-29 02:13:56 +00:00
Jim Meyering
c5eb9edf26 Change all uses of unlocked-wrapped functions to their upper case wrapper names. 1998-06-29 02:13:21 +00:00
Jim Meyering
dd9470cb58 Change all uses of unlocked-wrapped functions to their upper case wrapper names. 1998-06-29 02:11:07 +00:00
Jim Meyering
02fc5fa0d0 Change all uses of unlocked-wrapped functions to their upper case wrapper names. 1998-06-29 02:10:24 +00:00
Jim Meyering
b62793b100 . 1998-06-29 01:11:00 +00:00
Jim Meyering
c7af539321 (fsp_to_string): Clean out some crufty #ifdefs
now that we're using the jm_FSTYPENAME autoconf macro.
1998-06-29 01:10:24 +00:00
Jim Meyering
e989012b57 add #undefs, alphabetize 1998-06-29 01:00:51 +00:00
Jim Meyering
7aeda9a4d3 . 1998-06-28 23:51:58 +00:00
Jim Meyering
d51682ef43 *** empty log message *** 1998-06-28 23:51:47 +00:00
Jim Meyering
ab869ed00e . 1998-06-28 23:12:10 +00:00
Jim Meyering
73ab48d4e7 experimental support for -t [optional fd] -- probably soon to be backed out 1998-06-28 21:53:05 +00:00
Jim Meyering
73e6d60538 . 1998-06-28 21:42:37 +00:00
Jim Meyering
032aecf5e7 Require the new macro: jm_FUNC_GLIBC_UNLOCKED_IO. 1998-06-28 21:41:08 +00:00
Jim Meyering
8f3524de4a . 1998-06-28 21:40:12 +00:00
Jim Meyering
439fdff851 Add macro definitions for GNU libc unlocked wrappers. 1998-06-28 21:38:14 +00:00
Jim Meyering
933b990ab9 add a FIXME for output delimiter 1998-06-28 21:32:51 +00:00
Jim Meyering
ae965a958a remove `non-directory' 1998-06-28 21:13:04 +00:00
Jim Meyering
214ee5aecd *** empty log message *** 1998-06-28 21:11:31 +00:00
Jim Meyering
4dc12acc27 *** empty log message *** 1998-06-28 21:11:20 +00:00
Jim Meyering
a92dd43b7c Add DIRED_ prefix to the macros: FPUTS and FPUTS_LITERAL. 1998-06-28 20:34:29 +00:00
Jim Meyering
d2698caef3 s/PUTCHAR/DIRED_PUTCHAR/g. 1998-06-28 20:31:16 +00:00
Jim Meyering
db8fe3cf1f *** empty log message *** 1998-06-28 02:35:08 +00:00
Jim Meyering
664ba0841c *** empty log message *** 1998-06-27 23:54:10 +00:00
Jim Meyering
26d84b6c70 *** empty log message *** 1998-06-27 23:45:46 +00:00
Jim Meyering
70c8aaf873 Add two tests for double spacing. 1998-06-27 23:45:03 +00:00
Jim Meyering
182a1780ac (print_page): Break out of loop before double space test
if cols_ready_to_print is zero.
1998-06-27 23:43:40 +00:00
Jim Meyering
cf430d3590 *** empty log message *** 1998-06-27 22:10:02 +00:00
Jim Meyering
6ae99a4290 (copy_internal): Fix it so hard-link test is no longer hidden inside
big if-(backup_type == none) block.
1998-06-27 22:09:45 +00:00
Jim Meyering
c76172fbb0 *** empty log message *** 1998-06-27 21:36:28 +00:00
Jim Meyering
dd040b917a *** empty log message *** 1998-06-27 21:14:40 +00:00
Jim Meyering
4ec1fad4e7 *** empty log message *** 1998-06-27 21:03:16 +00:00
Jim Meyering
9d9fef5595 (copy_reg): Detect identical source and dest here.
(copy_internal): Make the test symmetric.
1998-06-27 20:44:23 +00:00
Jim Meyering
6fd3c331ba . 1998-06-27 20:37:17 +00:00
Jim Meyering
9b989298f4 *** empty log message *** 1998-06-27 20:35:26 +00:00
Jim Meyering
07507c07da (TESTS): Add same-file. 1998-06-27 20:35:16 +00:00
Jim Meyering
c96968a2a3 *** empty log message *** 1998-06-27 20:33:58 +00:00
Jim Meyering
a3e1200b4a *** empty log message *** 1998-06-27 20:33:22 +00:00
Jim Meyering
2b2424aab8 *** empty log message *** 1998-06-27 20:22:36 +00:00
Jim Meyering
994c3c82ef . 1998-06-27 20:20:25 +00:00
Jim Meyering
dfc86db1cc *** empty log message *** 1998-06-27 20:14:15 +00:00
Jim Meyering
162f6824cf *** empty log message *** 1998-06-27 20:10:29 +00:00
Jim Meyering
feccdc6c58 *** empty log message *** 1998-06-27 13:45:23 +00:00
Jim Meyering
2f617e52d6 changed --verbose message 1998-06-27 04:40:13 +00:00
Jim Meyering
d200f4974b (remove_file): Remove `non-directory' part of
`removing non-directory FILE' verbose message.
1998-06-27 04:39:25 +00:00
Jim Meyering
de45950430 (show_dev): Increase field width for blocks, used,
and available columns from 7 to 8.
1998-06-24 03:02:06 +00:00
Jim Meyering
4d95aa356f *** empty log message *** 1998-06-21 18:53:07 +00:00
Jim Meyering
d82af243b1 *** empty log message *** 1998-06-21 18:51:18 +00:00
Jim Meyering
2781ec69b7 . 1998-06-18 15:22:51 +00:00
Jim Meyering
4a9222e0c2 (check): Depend on $(maint_gen) so
`make maintainer-clean; ./configure; make check' works.
1998-06-18 15:20:03 +00:00
Jim Meyering
84c104b6da . 1998-06-07 14:45:55 +00:00
Jim Meyering
500594433a *** empty log message *** 1998-06-07 14:40:04 +00:00
Jim Meyering
ed1fdb8841 *** empty log message *** 1998-06-07 14:27:15 +00:00
Jim Meyering
5d59e18618 *** empty log message *** 1998-06-07 14:08:40 +00:00
Jim Meyering
94ff35fc2d . 1998-06-07 13:56:20 +00:00
Jim Meyering
dc6658157d . 1998-06-06 04:42:12 +00:00
Jim Meyering
36fc028151 *** empty log message *** 1998-06-05 13:00:17 +00:00
Jim Meyering
6db9dc96d3 *** empty log message *** 1998-06-01 03:31:42 +00:00
Jim Meyering
7af859841f . 1998-06-01 03:29:54 +00:00
Jim Meyering
dcfb3e037a (main): Fix argv-handling bug in my 1998-05-09 change.
Reported by Don Parsons.
1998-06-01 03:28:16 +00:00
Jim Meyering
bc63f10b59 *** empty log message *** 1998-06-01 03:27:57 +00:00
Jim Meyering
ce42a622b2 *** empty log message *** 1998-05-30 21:34:32 +00:00
Jim Meyering
5cd15e8abb Clean up ctime test. Note that it fails also
on Solaris5.5.1 tmpfs file systems.
1998-05-30 21:34:21 +00:00
Jim Meyering
c685d1c4cb . 1998-05-30 20:49:07 +00:00
Jim Meyering
cc13b3d81f *** empty log message *** 1998-05-30 20:48:26 +00:00
Jim Meyering
f23d890626 *** empty log message *** 1998-05-27 12:54:34 +00:00
Jim Meyering
e7976515e2 . 1998-05-27 12:41:08 +00:00
Jim Meyering
25485fa497 . 1998-05-27 12:39:37 +00:00
Jim Meyering
ab4ea710f1 (TESTS): s/cr-1/rt-1/ 1998-05-27 12:38:10 +00:00
Jim Meyering
39f78131e2 . 1998-05-27 12:36:38 +00:00
Jim Meyering
75637a7ef4 Don't use the ctime for testing, it is impossible to set it reliably. 1998-05-27 12:35:56 +00:00
Jim Meyering
9e1c89c38e (two_arguments): Don't test argv[pos][2] if it's past end of string. 1998-05-26 13:36:49 +00:00
Jim Meyering
c726bc5709 it's --disable-nls, not --disable-gettext 1998-05-25 04:10:33 +00:00
Jim Meyering
585b65b676 . 1998-05-25 03:41:02 +00:00
Jim Meyering
b815641481 *** empty log message *** 1998-05-24 17:45:14 +00:00
Jim Meyering
84d222f735 new version from automake-1.3 1998-05-24 17:43:17 +00:00
Jim Meyering
001e1b4302 . 1998-05-24 14:20:58 +00:00
Jim Meyering
dd2934197b tweak --changed diagnostic 1998-05-24 14:17:33 +00:00
Jim Meyering
ad174925d9 . 1998-05-24 14:02:44 +00:00
Jim Meyering
2aacc55e9b Fix braino: check S_ISLNK only if lstat succeeds. 1998-05-24 14:00:03 +00:00
Jim Meyering
6f050de759 fix typo: s/chat/char/ 1998-05-24 13:41:57 +00:00
Jim Meyering
45d32cef80 tweak comment 1998-05-24 13:36:54 +00:00
Jim Meyering
3f51edcdec Accept new option, --dereference. --no-dereference is now the default.
(Change_status) [CH_NOT_APPLIED]: New member.
(change_symlinks): Enable this by default, now.
(describe_change): Handle new case.
(change_file_owner): Add new parameter: cmdline_arg.  Update callers.
Reorganize to reflect changed semantics.
(LCHOWN): Remove definitions.
1998-05-24 12:51:37 +00:00
Jim Meyering
59c9c4036b *** empty log message *** 1998-05-24 12:49:44 +00:00
Jim Meyering
ef2860263b *** empty log message *** 1998-05-20 01:30:57 +00:00
Jim Meyering
d6b76c3f75 . 1998-05-20 01:09:12 +00:00
Jim Meyering
efa242bee1 *** empty log message *** 1998-05-20 01:08:28 +00:00
Jim Meyering
8ea818e214 *** empty log message *** 1998-05-19 16:22:58 +00:00
Jim Meyering
9bd57c9f22 . 1998-05-19 16:05:54 +00:00
Jim Meyering
0d457a6aee . 1998-05-19 16:05:30 +00:00
Jim Meyering
2722883a87 Add jm_FUNC_LCHOWN. 1998-05-19 16:05:23 +00:00
Jim Meyering
8105878c15 *** empty log message *** 1998-05-19 16:04:24 +00:00
Jim Meyering
231c5aec0f . 1998-05-19 16:02:40 +00:00
Jim Meyering
e4e242e839 . 1998-05-19 16:01:48 +00:00
Jim Meyering
da8b83f81a *** empty log message *** 1998-05-19 16:01:31 +00:00
Jim Meyering
df610e05ba *** empty log message *** 1998-05-19 15:53:03 +00:00
Jim Meyering
9dab634c13 *** empty log message *** 1998-05-19 15:51:10 +00:00
Jim Meyering
e5154f74b1 . 1998-05-19 15:49:18 +00:00
Jim Meyering
67786e0fb6 *** empty log message *** 1998-05-19 15:15:09 +00:00
Jim Meyering
c84011e059 . 1998-05-19 15:06:49 +00:00
Jim Meyering
e36f49348b Remove $other_partition_tmpdir 1998-05-18 13:53:40 +00:00
Jim Meyering
e786c1a0eb *** empty log message *** 1998-05-17 04:57:10 +00:00
Jim Meyering
c057d35836 . 1998-05-16 23:46:05 +00:00
Jim Meyering
d9b628359a *** empty log message *** 1998-05-16 20:37:24 +00:00
Jim Meyering
29b1eab1af . 1998-05-16 20:35:46 +00:00
Jim Meyering
9abd463ffb . 1998-05-16 20:35:23 +00:00
Jim Meyering
b54c86e8bc add 2 more tsts 1998-05-16 20:35:19 +00:00
Jim Meyering
b885f7cbca . 1998-05-16 20:33:44 +00:00
Jim Meyering
7006d5fed6 *** empty log message *** 1998-05-16 20:27:26 +00:00
Jim Meyering
976664803c (read_utmp): Add variant for systems that have the utmpname function.
Ansideclify.
1998-05-16 20:26:54 +00:00
Jim Meyering
3fdd4e6cd2 add copyright 1998-05-16 20:21:39 +00:00
Jim Meyering
42755ceb62 cast for losing Solaris 1998-05-16 20:21:06 +00:00
Jim Meyering
8f03befb52 . 1998-05-16 20:11:01 +00:00
Jim Meyering
78af2f9732 . 1998-05-16 20:08:30 +00:00
Jim Meyering
88b4a9a940 *** empty log message *** 1998-05-16 20:07:59 +00:00
Jim Meyering
045ebed00c (opt-b, opt-s, opt_sb, opt_r): New test.
(opt_br): New test -- exercises above-fixed bug.
1998-05-16 20:07:40 +00:00
Jim Meyering
24a7456cc0 (tac_seekable): Fix error in handling regex separators. 1998-05-16 20:06:56 +00:00
Jim Meyering
b17e1af41c . 1998-05-16 05:18:07 +00:00
Jim Meyering
349b13e33a remove jm_FUNC_GNU_STRFTIME 1998-05-16 04:44:48 +00:00
Jim Meyering
7b1d31a9b1 . 1998-05-16 04:40:58 +00:00
Jim Meyering
085866c1a3 (hash_compare_strings): Return true or false, not 1/0.
(remove_cwd_entries): Use RM_OK, not equivalent literal `1'.
1998-05-16 04:40:38 +00:00
Jim Meyering
4f75855c2e (is_prime): Ansideclify.
(next_prime): Ansideclify.  Add an assertion.
1998-05-16 04:39:24 +00:00
Jim Meyering
d649910685 (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
lines in the m4/*.m4 macros, so the hack of including some
custom-replaced C source file names here is no longer needed.
1998-05-16 04:37:45 +00:00
Jim Meyering
e3e1698c6b . 1998-05-16 04:30:42 +00:00
Jim Meyering
b49e060cda . 1998-05-14 16:03:15 +00:00
Jim Meyering
e769659852 . 1998-05-13 04:15:47 +00:00
Jim Meyering
33d7cba8a7 *** empty log message *** 1998-05-13 04:03:21 +00:00
Jim Meyering
65b2d6c97e *** empty log message *** 1998-05-13 03:51:10 +00:00
Jim Meyering
2f3c1a3561 . 1998-05-13 03:50:46 +00:00
Jim Meyering
d8b68fc0c5 (EXTRA_DIST): Add isc-posix.m4. 1998-05-13 03:50:35 +00:00
Jim Meyering
06ffb13ff0 clean up diagnostic 1998-05-13 03:49:36 +00:00
Jim Meyering
3e62291a3c . 1998-05-13 03:48:43 +00:00
Jim Meyering
10972f68e8 *** empty log message *** 1998-05-13 03:48:05 +00:00
Jim Meyering
15aac9a45d (copy_internal): Plug a small leak. 1998-05-13 03:47:02 +00:00
Jim Meyering
43fd950ef9 undefine before redefining 1998-05-11 15:16:40 +00:00
Jim Meyering
6c4002b2b5 . 1998-05-11 12:39:16 +00:00
Jim Meyering
816ee7dc0d . 1998-05-11 12:33:07 +00:00
Jim Meyering
916c762152 . 1998-05-11 11:54:48 +00:00
Jim Meyering
0d7fe8a4de (do_move): Remove lots of code that was duplicated in
copy.c (copy), now that copy() has better support for mv.  This fixes
a bug with cross-filesystem `mv -i' whereby you could get two prompts
for the same destination file and eventually remove the destination
file even though one of the responses was negative.
Reported by Dirk Lattermann.
1998-05-11 04:12:51 +00:00
Jim Meyering
841c6fbfe0 *** empty log message *** 1998-05-11 04:12:26 +00:00
Jim Meyering
859bfc78b1 reflect additional parameter to copy
initialize new member: move_mode.
1998-05-11 04:07:16 +00:00
Jim Meyering
21ae3d911c (copy_internal): Use new move_mode member.
Add parameter.
(copy): Add parameter.
1998-05-11 04:06:22 +00:00
Jim Meyering
4520ff31e2 Better support for mv:
[struct cp_options] (move_mode): New member.
1998-05-11 04:04:16 +00:00
Jim Meyering
92ce634177 (TESTS): Likewise. 1998-05-11 04:01:42 +00:00
Jim Meyering
6d89cf5f12 *** empty log message *** 1998-05-11 04:00:54 +00:00
Jim Meyering
83a4462018 . 1998-05-11 03:55:18 +00:00
Jim Meyering
2b416bd83e *** empty log message *** 1998-05-11 03:48:31 +00:00
Jim Meyering
96ab6a541a (TESTS): Add backup-is-src. 1998-05-11 03:47:24 +00:00
Jim Meyering
571a29d870 *** empty log message *** 1998-05-11 03:46:59 +00:00
Jim Meyering
20f1f8b063 . 1998-05-11 03:46:48 +00:00
Jim Meyering
4e1e8c600d add --verbose and compare against expected output 1998-05-11 03:35:01 +00:00
Jim Meyering
d816bb4f14 *** empty log message *** 1998-05-11 03:26:40 +00:00
Jim Meyering
ce60ef7400 *** empty log message *** 1998-05-11 03:19:35 +00:00
Jim Meyering
6e98d78fd4 add "'s 1998-05-11 03:13:51 +00:00
Jim Meyering
2c5862c808 *** empty log message *** 1998-05-11 03:13:36 +00:00
Jim Meyering
268db2760a *** empty log message *** 1998-05-11 03:13:00 +00:00
Jim Meyering
0062e8f915 *** empty log message *** 1998-05-11 03:09:18 +00:00
Jim Meyering
057743741f Use am_cv_func_working_getline, not `jm_'-prefixed version. 1998-05-10 20:58:09 +00:00
Jim Meyering
3f2774c8b4 *** empty log message *** 1998-05-10 16:11:13 +00:00
Jim Meyering
3e0c559579 Use AM_FUNC_MKTIME, now that it's up to date. 1998-05-10 16:10:40 +00:00
Jim Meyering
e7d6615b76 Don't declare strdup if it's defined as a macro.
Reported by Lorne Baker.
1998-05-10 16:04:39 +00:00
Jim Meyering
91df5bbc48 *** empty log message *** 1998-05-10 16:03:56 +00:00
Jim Meyering
4cc5661b42 (cp_option_init): s/use_mode/set_mode/ 1998-05-10 12:22:58 +00:00
Jim Meyering
19a98e3edc (cp_option_init): Likewise.
(main): Set new preserve_* options.
1998-05-10 12:22:23 +00:00
Jim Meyering
50e17793c8 (cp_option_init): Initialize new members. 1998-05-10 12:19:30 +00:00
Jim Meyering
8a0a50e6b0 (new_nondir_mode): New function. Use where appropriate.
Use more-specific preserve_* members in place of removed `preserve'.
(copy_internal): Honor failed_unlink_is_fatal.
1998-05-10 12:18:21 +00:00
Jim Meyering
a42054dd57 Support for install:
[struct cp_options] (failed_unlink_is_fatal): New member.
(preserve_owner_and_group): New member.
(preserve_chmod_bits): New member.
(preserve_timestamps): New member.
(preserve): Remove member.
(set_mode): New member.
(mode): New member.
1998-05-10 12:17:46 +00:00
Jim Meyering
24da56f990 (main): Rewrite argv-handling to be clearer.
(copy_file): Rewrite to use copy.c (copy).
(change_attributes): Get rid of now-(with chown wrapper)-unnecessary
`no_need_to_chown' parameter.  Fix caller.
(install_file_in_file): Remove now-unnecessary `to_created' parameter.
(cp_option_init): New function.
Update several functions to take new parameter specifying copy options.
1998-05-10 03:05:44 +00:00
Jim Meyering
d8e6937773 . 1998-05-09 20:25:09 +00:00
Jim Meyering
e1b2b2337d . 1998-05-09 20:23:38 +00:00
Jim Meyering
60c77b6c28 . 1998-05-09 19:56:35 +00:00
Jim Meyering
c7b3d3e91b . 1998-05-09 19:56:14 +00:00
Jim Meyering
60c1207b74 . 1998-05-09 19:07:40 +00:00
Jim Meyering
d344aaa129 *** empty log message *** 1998-05-09 17:42:59 +00:00
Jim Meyering
83c2cfa04d Include safe-read.h.
Don't declare safe_read.
1998-05-09 17:42:50 +00:00
Jim Meyering
53c7a54a58 Include safe-read.h.
Don't declare safe_read.
1998-05-09 17:41:37 +00:00
Jim Meyering
e81bcd87cb . 1998-05-09 17:38:05 +00:00
Jim Meyering
10d98345b4 . 1998-05-09 17:37:10 +00:00
Jim Meyering
e17b601d5e (EXTRA_DIST): Remove mktime.m4, now that the new version is included
with automake.
1998-05-09 17:18:55 +00:00
Jim Meyering
f5d8ee465e (EXTRA_DIST): Add ssize_t.m4. 1998-05-09 17:00:48 +00:00
Jim Meyering
51c06c49cf . 1998-05-09 17:00:38 +00:00
Jim Meyering
bbf4d37373 (tac_seekable): Rename from tac_stream.
Change `FILE *in' parameter to `int input_fd'. Adjust callers.
Revert to using safe_read -- can't mix lseek and fread.
And can't use fseek because it can't handle files larger than 2^32.
1998-05-09 14:42:31 +00:00
Jim Meyering
9bb85624cf fix up compile warnings 1998-05-07 17:45:10 +00:00
Jim Meyering
9b5402ec48 Don't use safe_read. Use fread instead.
Fix open and fdopen to agree that file is read/write: O_RDWR and "w+".
This is required on at least solaris5.5.1.
1998-05-07 17:43:13 +00:00
Jim Meyering
77728e4f4b add curlies 1998-05-07 16:01:02 +00:00
Jim Meyering
9db889c372 add some curly braces 1998-05-07 15:55:56 +00:00
Jim Meyering
caace05438 rename variable 1998-05-07 15:54:44 +00:00
Jim Meyering
cd7f8d6e9b (tac_stdin): Use STDIN_FILENO rather than literal `0' in fstat call. 1998-05-07 15:50:54 +00:00
Jim Meyering
bf598c02ba add tr `double' script example 1998-05-07 14:32:59 +00:00
Jim Meyering
3954a4f441 remove dcl of unused safe_read 1998-05-04 00:44:37 +00:00
Jim Meyering
506343b223 . 1998-05-04 00:28:35 +00:00
Jim Meyering
2f8dc98340 . 1998-05-04 00:27:15 +00:00
Jim Meyering
d015aad1f2 . 1998-05-03 23:21:42 +00:00
Jim Meyering
a99c3df843 *** empty log message *** 1998-05-03 23:21:39 +00:00
Jim Meyering
e78bc7655d . 1998-05-03 22:18:22 +00:00
Jim Meyering
a519a07f25 . 1998-05-03 22:15:39 +00:00
Jim Meyering
02efcd60ed . 1998-05-03 22:14:55 +00:00
Jim Meyering
39e2377300 . 1998-05-03 22:14:06 +00:00
Jim Meyering
cda5bf9db9 . 1998-05-03 21:56:10 +00:00
Jim Meyering
27c8d53a3a . 1998-05-03 21:46:06 +00:00
Jim Meyering
3e7e7d0792 Use `-I.' with each invocation of $(PERL).
perl-5.004_xx comes with a Test.pm module that'd be used otherwise.
1998-05-03 21:41:51 +00:00
Jim Meyering
a5b0ca6f24 . 1998-05-03 21:05:51 +00:00
Jim Meyering
1f62fd20a3 update from gettext-0.10.35 1998-05-03 20:46:29 +00:00
Jim Meyering
254fc64f64 update from gettext-0.10.35 1998-05-03 20:37:39 +00:00
Jim Meyering
9dc7d5d2ae . 1998-05-02 15:37:18 +00:00
Jim Meyering
45af919ce6 (check_format): Use ISDIGIT, not isdigit. 1998-05-02 15:36:43 +00:00
Jim Meyering
89c9e683a3 . 1998-05-02 15:33:01 +00:00
Jim Meyering
d20d0fc27d . 1998-05-02 15:31:13 +00:00
Jim Meyering
5b7e895b65 . 1998-05-02 15:25:56 +00:00
Jim Meyering
2e97d27586 (parse_line): Use ISSPACE, not isspace.
Use unsigned char * pointers, not potentially signed ones, to avoid
sign extension.
1998-04-28 13:09:47 +00:00
Jim Meyering
a155c3d684 tweak from FSF 1998-04-28 12:19:53 +00:00
Jim Meyering
3489f267a4 *** empty log message *** 1998-04-27 16:09:46 +00:00
Jim Meyering
3fc7024e49 . 1998-04-27 05:05:47 +00:00
Jim Meyering
30b522371a . 1998-04-27 05:04:54 +00:00
Jim Meyering
88013e3cb4 . 1998-04-27 05:04:05 +00:00
Jim Meyering
7c8a2cdacf . 1998-04-27 05:03:43 +00:00
Jim Meyering
876f399d50 . 1998-04-27 05:03:09 +00:00
Jim Meyering
05ffec210e Disable test f-1, now that it fails. 1998-04-27 05:02:56 +00:00
Jim Meyering
163f7f9c20 . 1998-04-27 05:01:43 +00:00
Jim Meyering
8fbf79b4e0 *** empty log message *** 1998-04-27 05:01:19 +00:00
Jim Meyering
08b5c3046c *** empty log message *** 1998-04-27 05:00:00 +00:00
Jim Meyering
551b879bf1 *** empty log message *** 1998-04-27 04:57:59 +00:00
Jim Meyering
bd1eee0315 add 22b 1998-04-27 04:53:31 +00:00
Jim Meyering
72f7eb4e63 . 1998-04-27 04:41:41 +00:00
Jim Meyering
fef313b2b0 Remove definition of _GNU_SOURCE 1998-04-27 04:31:45 +00:00
Jim Meyering
464e2ce05d (22a): Add test. 1998-04-27 04:30:30 +00:00
Jim Meyering
a48999494d *** empty log message *** 1998-04-27 04:29:36 +00:00
Jim Meyering
d5d061ee9b (keycompare): Don't return 0 from inside the keyspec-iterating loop.
With this change, test 22a passes.  Reported by Zvi Har'El.
1998-04-27 04:29:05 +00:00
Jim Meyering
b44e91e99d (strncoll): Remove bogus assertion. 1998-04-27 03:50:17 +00:00
Jim Meyering
ce3668f3c1 (EXTRA_DIST): Add assert.m4. 1998-04-26 20:48:58 +00:00
Jim Meyering
44fa09dc5e . 1998-04-26 20:48:00 +00:00
Jim Meyering
808b938840 Don't define NDEBUG. 1998-04-26 20:42:16 +00:00
Jim Meyering
83d4d74a88 Don't define NDEBUG. 1998-04-26 20:41:42 +00:00
Jim Meyering
0d38a270a4 Do not define _GNU_SOURCE and/or NDEBUG 1998-04-26 20:38:28 +00:00
Jim Meyering
3f017c26ca [struct File_spec] (pretty_name): Remove member.
(pretty_name): New function.
1998-04-26 20:09:26 +00:00
Jim Meyering
4c946943ea *** empty log message *** 1998-04-26 19:58:57 +00:00
Jim Meyering
7dd872d963 Remove usage-like comments near beginning of file. 1998-04-26 19:58:43 +00:00
Jim Meyering
b7d50ca523 (xwrite): New function -- converted from macro. 1998-04-26 19:53:54 +00:00
Jim Meyering
fe18d63a65 (close_fd): New function -- converted from macro.
[struct File_spec] (n_stat_calls): New member.
[struct File_spec] (n_unchanged_stats): New member.
(max_n_unchanged_stats): New global.
Initialize new members.
1998-04-26 19:50:21 +00:00
Jim Meyering
6668e39160 *** empty log message *** 1998-04-26 15:28:20 +00:00
Jim Meyering
d738449858 (md5_check): Declare local, `md5num' as _unsigned_ char*.
(hex_digits): Declare parameter `s' as _unsigned_ char*.
(split_3): Declare parameter `u' as _unsigned_ char**.
1998-04-26 15:28:06 +00:00
Jim Meyering
7254d243f2 (print_nth_dir): Remove first (and always-true) part of conjunct in assertion. 1998-04-26 05:14:50 +00:00
Jim Meyering
91da5cedc7 . 1998-04-17 15:37:52 +00:00
Jim Meyering
1187f5eb7f (xfields): Used unsigned char* pointers to avoid 1998-04-17 15:37:29 +00:00
Jim Meyering
5bcc1fd7fd (check_punctuation): Used unsigned char* pointers to avoid 1998-04-17 15:37:03 +00:00
Jim Meyering
e4c9ae3c6b . 1998-04-17 15:30:37 +00:00
Jim Meyering
d1121fa4c0 *** empty log message *** 1998-04-14 15:17:45 +00:00
Jim Meyering
713c315978 Use STREQ in string equality tests, not strcmp. 1998-04-14 15:17:32 +00:00
Jim Meyering
8cc46c2a18 (noinst_HEADERS): Add safe-read.h. 1998-04-13 16:29:58 +00:00
Jim Meyering
518f85fc40 . 1998-04-13 13:51:27 +00:00
Jim Meyering
48990a9078 Include safe-read.h instead of merely declaring safe_read. 1998-04-12 19:56:25 +00:00
Jim Meyering
69a3ee0b49 . 1998-04-12 15:16:37 +00:00
Jim Meyering
8ed3137f52 (TYPE_MAXIMUM): Update from system.h. 1998-04-12 09:39:30 +00:00
Jim Meyering
d4257e63c7 Use STREQ rather than strcmp 1998-04-12 09:27:45 +00:00
Jim Meyering
7154d646cb (wc): Declare per-file counters and `linepos' to be of type uintmax_t.
Declare bytes_read to be ssize_t.
1998-04-12 09:12:21 +00:00
Jim Meyering
b388203a65 Include safe-read.h instead of merely declaring safe_read. 1998-04-11 18:24:09 +00:00
Jim Meyering
66c7b3c41d Include safe-read.h instead of merely declaring safe_read. 1998-04-11 18:23:13 +00:00
Jim Meyering
ac7b3c4fa9 [HAVE_INTTYPES_H]: Include inttypes.h.
Declare counters to be of type uintmax_t.
(write_counts): Use human_readable to format potentially-long-long
numbers.  Suggestion from Rogier Wolff.
1998-04-11 18:21:24 +00:00
Jim Meyering
b402870080 (noinst_HEADERS): Add safe-read.h. 1998-04-11 17:53:09 +00:00
Jim Meyering
1cbe202b0a . 1998-04-11 17:52:28 +00:00
Jim Meyering
d618576e0e split a couple long lines 1998-04-11 15:37:35 +00:00
Jim Meyering
51fe35760e Add curly braces around statements in if/else/while/do/etc. that
span more than a line -- even around multiline simple statements or
single-line simple statements preceded by a comment line.
1998-04-11 15:35:06 +00:00
Jim Meyering
8bbe8ab5d4 . 1998-04-11 15:05:20 +00:00
Jim Meyering
ba51843a2c . 1998-04-11 15:04:39 +00:00
Jim Meyering
397d9be228 import version 2.231 1998-04-11 15:03:51 +00:00
Jim Meyering
dddfcab3b3 *** empty log message *** 1998-04-11 09:24:28 +00:00
Jim Meyering
00ea94587f indent cpp directives 1998-04-09 07:28:10 +00:00
Jim Meyering
49875c1593 make there be two spaces after `.' in comments 1998-04-09 07:22:52 +00:00
Jim Meyering
7b9c4d3d03 (cph_hash_insert): Rename from now-conflicting hash_insert.
Also declare to be static.
1998-04-06 08:15:29 +00:00
Jim Meyering
3783d6be57 (hash_insert): Remove declaration. 1998-04-06 08:14:58 +00:00
Jim Meyering
632ebfa209 Change names/usage of hash-related functions to work with the above. 1998-04-06 08:11:35 +00:00
Jim Meyering
29cc8bf4f3 Lots of minor spec and name changes, and new comments.
From Franois Pinard.
1998-04-06 08:09:36 +00:00
Jim Meyering
50892edd61 Lots of minor spec and name changes, and new comments.
(hash_rehash): Rewritten to be easier on the allocator.
From Franois Pinard.
1998-04-06 08:09:11 +00:00
Jim Meyering
72193ba149 *** empty log message *** 1998-04-06 00:26:54 +00:00
Jim Meyering
854b5197ad *** empty log message *** 1998-04-05 23:44:12 +00:00
Jim Meyering
d90641d9d8 . 1998-04-05 23:43:58 +00:00
Jim Meyering
300be5a250 *** empty log message *** 1998-04-05 21:35:33 +00:00
Jim Meyering
3911fadcf9 add braces to disambiguate ambiguous else 1998-04-05 21:32:26 +00:00
Jim Meyering
382ca69cec . 1998-04-05 18:24:45 +00:00
Jim Meyering
9fc10dc6c3 (WIDE_CHAR_SUPPORT): Define.
This now depends on HAVE_BTOWC so systems that lack btowc (like
solaris-2.5.1) don't lose.
1998-04-05 18:24:18 +00:00
Jim Meyering
f0a8ebf596 *** empty log message *** 1998-04-05 18:22:30 +00:00
Jim Meyering
53c085b7e5 (jm_PREREQ_REGEX): New macro.
(jm_PREREQ): Use it here.
1998-04-05 18:22:11 +00:00
Jim Meyering
faa759b349 *** empty log message *** 1998-04-04 21:37:50 +00:00
Jim Meyering
398e92a2ec *** empty log message *** 1998-04-04 18:17:10 +00:00
Jim Meyering
3483943ebc (PARAMS): Define. 1998-04-04 18:16:51 +00:00
Jim Meyering
108b074aea . 1998-04-04 16:47:29 +00:00
Jim Meyering
19fcb4356c Use "%s", not device_name, as the format string, in case the
latter contains `%'.
1998-04-04 16:47:19 +00:00
Jim Meyering
c4b7f217a5 stty: document new --file/-F option 1998-04-04 16:36:30 +00:00
Jim Meyering
cb04f85936 . 1998-04-04 16:28:11 +00:00
Jim Meyering
902bbe7707 *** empty log message *** 1998-04-04 16:27:12 +00:00
Jim Meyering
c9a9ec9b53 . 1998-04-04 16:20:15 +00:00
Jim Meyering
840a08ccde . 1998-04-04 16:19:34 +00:00
Jim Meyering
5fbcd963df clean up comments 1998-04-04 10:36:32 +00:00
Jim Meyering
953c42bd52 (valid_options): Parenthesize assignment in while expr.
(main): Remove dcl of unused `cp'.
1998-04-04 09:38:47 +00:00
Jim Meyering
765122f558 Use STREQ in place of strcmp everywhere.
(valid_options): Indent
(main): s/case 'f':/case 'F':/
Tweak error messages to make them consistent.
Remove #if-0'd block.
Move dcl of fdflags into scope where it's used.
1998-04-04 09:30:39 +00:00
Jim Meyering
e46a424ce9 [1998-03-31 Theodore Ts'o <tytso@rsts-11.mit.edu>]
(main): Fix broken options parsing that worked only
by serendipity (getopt_long_only already parsed short options; no
need to parse them again manually!).  Add support for the --file
option, which allows the user to specify the device whose line
settings are to be set.  This is necessary because POSIX ttys will
block waiting for carrier detect to go high if CLOCAL is not set,
unless the device is opened with the O_NONBLOCK flag.
Unfortunately, the shell doesn't use this flag, so users lose.
Opening the device in stty is the easist way to fix this.
(speeds): Add support for 230400 and 460800 line speeds, which are
supported by Linux.
1998-04-04 09:08:04 +00:00
Jim Meyering
095c92bc46 . 1998-04-04 08:24:11 +00:00
Jim Meyering
7957dcc00a . 1998-04-04 08:11:22 +00:00
Jim Meyering
108f8f2d04 . 1998-04-04 08:07:26 +00:00
Jim Meyering
39463d50ed update comment 1998-04-04 08:06:24 +00:00
Jim Meyering
4a46351e06 Add conditionals so that running `make' in an
unconfigured source directory will get a reasonable diagnostic.
1998-04-04 08:05:18 +00:00
Jim Meyering
8aca15bac0 . 1998-04-04 08:03:48 +00:00
Jim Meyering
1ddffff8c0 *** empty log message *** 1998-04-04 08:02:23 +00:00
Jim Meyering
e7683a577a (aclocal-files): Remove now-unnecessary (with
automake-1.2h and the above change) aclocal-related rules and includes.
1998-04-04 07:50:13 +00:00
Jim Meyering
3063e56f2e *** empty log message *** 1998-04-01 06:47:32 +00:00
Jim Meyering
eb3a4daa24 . 1998-04-01 06:47:25 +00:00
Jim Meyering
b6844f1931 (TESTS): Add cr-1. 1998-04-01 06:46:52 +00:00
Jim Meyering
a636450727 (compare_ctime, rev_cmp_ctime, compare_mtime,
rev_cmp_mtime, compare_atime, rev_cmp_atime, compare_size,
rev_cmp_size): Use file name as secondary sort key to get
consistent sorting.
1998-04-01 06:35:01 +00:00
Jim Meyering
6456a7d8ac . 1998-03-31 23:11:50 +00:00
Jim Meyering
a57d5061ff (TYPE_MAXIMUM): Cast result to (t)' so this macro works with unsigned char'.
From Greg Wooledge.
(SCHAR_MIN, SCHAR_MAX, SHRT_MIN, SHRT_MAX, LONG_MAX, ULONG_MAX): Define.
1998-03-31 23:11:37 +00:00
Jim Meyering
45e8e5c550 Merge with the version from textutils. 1998-03-31 13:14:22 +00:00
Jim Meyering
69412999dc (EXTRA_DIST): Remove mk-script.pl.
(mk_script): Set to ../mk-script.
(x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
Remove @MAINT@ cruft.
(Makefile.am): Likewise.
Remove @MAINT@ cruft.  Now `missing' will explain the failure
when people don't have Perl yet modify a file whose rebuilding
would lead to the use of Perl.
1998-03-31 12:49:00 +00:00
Jim Meyering
85b39cb589 add descriptive first-line comment 1998-03-31 12:09:55 +00:00
Jim Meyering
9f358e6830 (rpl_memcmp): Rename from memcmp. 1998-03-31 12:05:17 +00:00
Jim Meyering
defb2bdef8 . 1998-03-31 07:50:22 +00:00
Jim Meyering
6e577f0b56 *** empty log message *** 1998-03-28 14:57:25 +00:00
Jim Meyering
c157e5fbef Add copyright. 1998-03-28 14:56:49 +00:00
Jim Meyering
ca6cf35a5e Add copyright.
[_AIX]: Add #pragma alloca.
1998-03-28 14:56:11 +00:00
Jim Meyering
ede420f14a ($(ACLOCAL_M4)): Replace old rule with this
dependency and the := assignment of ACLOCAL to make the default
rule use the `-I m4' option.
1998-03-27 22:37:56 +00:00
Jim Meyering
52a2ff839c . 1998-03-27 22:34:23 +00:00
Jim Meyering
821a0823b1 *** empty log message *** 1998-03-27 22:33:37 +00:00
Jim Meyering
e52d8736b1 remove dcl of unused local, num_regs 1998-03-27 22:29:05 +00:00
Jim Meyering
5c0ee776d4 cpp-directive aesthetics 1998-03-27 12:40:03 +00:00
Jim Meyering
465ebf7c37 new version from Uli 1998-03-27 11:23:07 +00:00
Jim Meyering
18ad404d02 . 1998-03-26 16:27:28 +00:00
Jim Meyering
28cb02fc78 (batch_convert): Remove spurious space in error message.
Reported by Karl Berry.
1998-03-26 15:41:14 +00:00
Jim Meyering
cbf0181378 s/@samp/@email/ for e-mail addresses 1998-03-25 07:38:24 +00:00
Jim Meyering
bca2db9877 . 1998-03-23 23:52:30 +00:00
Jim Meyering
aa71be25c0 . 1998-03-23 23:49:18 +00:00
Jim Meyering
cd053a291e update from automake-2.1h 1998-03-23 23:19:01 +00:00
Jim Meyering
fa4148be50 *** empty log message *** 1998-03-23 23:13:24 +00:00
Jim Meyering
5695f8ea2d . 1998-03-23 23:13:08 +00:00
Jim Meyering
18d159d47e *** empty log message *** 1998-03-23 23:12:45 +00:00
Jim Meyering
0bb2acd9da Kludges so I don't have to add HAVE_INTTYPES_H in acconfig.h. 1998-03-23 23:10:30 +00:00
Jim Meyering
7a8b4afa3e . 1998-03-23 22:47:45 +00:00
Jim Meyering
3a0352ad9a . 1998-03-23 22:47:05 +00:00
Jim Meyering
55569d4f9f update from libc/copies 1998-03-23 07:24:54 +00:00
Jim Meyering
eeef5c523d merge variables: forever_multiple and forever
(recheck): New function.
Begin to support --allow-missing option.
1998-03-22 20:55:34 +00:00
Jim Meyering
e8ab1c28f8 *** empty log message *** 1998-03-22 20:38:44 +00:00
Jim Meyering
df4ba7d9ca (tail_forever): plug gross fd leaks
Don't close stdin
Don't print header unnecessarily if the first file to grow
is the last one for which a header was printed.
1998-03-21 16:33:53 +00:00
Jim Meyering
e832812173 *** empty log message *** 1998-03-21 08:54:58 +00:00
Jim Meyering
ac648dbc8a Update from patch-2.5.3. 1998-03-21 08:51:48 +00:00
Jim Meyering
c75ccba2d3 Update from patch-2.5.3. 1998-03-21 08:49:00 +00:00
Jim Meyering
a33adfebb2 (decode_switches): Pass a null pointer instead of address
of quotearg_quoting_options.
1998-03-21 08:47:54 +00:00
Jim Meyering
b50b941826 . 1998-03-19 22:27:17 +00:00
Jim Meyering
6ec5bace8a (show_dev): If fsu_bavail_top_bit_set is nonzero,
assume the original value corresponding to fsu_bavail was negative.
1998-03-19 22:18:29 +00:00
Jim Meyering
b48e78e3b7 Include <limits.h>.
(CHAR_BIT, EXTRACT_TOP_BIT, PROPAGATE_TOP_BIT): New macros.
(get_fs_usage): If top bit of system variable corresponding to
fsu_bavail is set, then set fsu_bavail_top_bit_set, and
sign-extend the value when storing it into fsu_bavail.
1998-03-19 22:18:04 +00:00
Jim Meyering
33179975d7 (struct fs_usage): New member
fsu_bavail_top_bit_set.
1998-03-19 22:17:43 +00:00
Jim Meyering
d4a8891aef *** empty log message *** 1998-03-18 21:53:35 +00:00
Jim Meyering
fcbfefa513 *** empty log message *** 1998-03-17 23:31:18 +00:00
Jim Meyering
fcf6405f2d (tail_file): Merge largely-duplicated blocks of code. 1998-03-15 23:04:56 +00:00
Jim Meyering
0ecb6ace02 . 1998-03-15 20:36:02 +00:00
Jim Meyering
6d42c7e9d7 *** empty log message *** 1998-03-15 18:05:05 +00:00
Jim Meyering
6684ffa826 Use #if, not #ifdef with HAVE_ macros.
Use #if !, not #ifndef with HAVE_ macros.
1998-03-15 17:54:50 +00:00
Jim Meyering
bfbc3ce20c Use #if, not #ifdef with HAVE_ macros 1998-03-15 11:09:10 +00:00
Jim Meyering
0f5f23cb9e . 1998-03-15 09:52:09 +00:00
Jim Meyering
93494dde07 *** empty log message *** 1998-03-15 09:48:52 +00:00
Jim Meyering
be3b9520ad (EXTRA_DIST): Add prereq.m4. 1998-03-15 09:47:28 +00:00
Jim Meyering
c2c6f081c5 *** empty log message *** 1998-03-15 09:47:03 +00:00
Jim Meyering
36b10d9f21 . 1998-03-15 09:45:00 +00:00
Jim Meyering
72c0980585 *** empty log message *** 1998-03-15 09:43:27 +00:00
Jim Meyering
58647fd63d *** empty log message *** 1998-03-15 09:11:44 +00:00
Jim Meyering
6eb5e899e1 *** empty log message *** 1998-03-15 09:10:21 +00:00
Jim Meyering
a01c762a81 *** empty log message *** 1998-03-15 09:08:51 +00:00
Jim Meyering
c29025e6ed (EXTRA_DIST): Add error.m4. 1998-03-15 09:08:39 +00:00
Jim Meyering
b3582e7533 . 1998-03-15 09:07:39 +00:00
Jim Meyering
12f49aa1ae update from fsf 1998-03-15 08:11:02 +00:00
Jim Meyering
f31f7e1c75 *** empty log message *** 1998-03-14 19:53:21 +00:00
Jim Meyering
d34d42ca05 . 1998-03-14 16:39:09 +00:00
Jim Meyering
6974d67aa2 *** empty log message *** 1998-03-14 16:38:41 +00:00
Jim Meyering
85d9447441 . 1998-03-14 16:38:35 +00:00
Jim Meyering
45c381f4ba s/get-date.h/getdate.h/ 1998-03-14 16:35:24 +00:00
Jim Meyering
184c0062a4 s/get-date.h/getdate.h/ 1998-03-14 16:32:35 +00:00
Jim Meyering
7024c7d55c s/get-date.h/getdate.h/ 1998-03-14 16:31:51 +00:00
Jim Meyering
d84a21ea2d . 1998-03-14 16:30:52 +00:00
Jim Meyering
2f6fa9d160 . 1998-03-14 16:26:41 +00:00
Jim Meyering
4ac374c8e5 *** empty log message *** 1998-03-14 16:26:14 +00:00
Jim Meyering
17070ae7bf . 1998-03-14 16:25:42 +00:00
Jim Meyering
a1cc8f5961 *** empty log message *** 1998-03-14 15:56:46 +00:00
Jim Meyering
27caa20d7b *** empty log message *** 1998-03-14 15:32:55 +00:00
Jim Meyering
757555a4dc . 1998-03-14 15:31:41 +00:00
Jim Meyering
ada5e63612 . 1998-03-14 10:42:01 +00:00
Jim Meyering
a8d20df6b2 (TESTS): Add into-self. 1998-03-14 10:41:39 +00:00
Jim Meyering
4a28ea9bd6 *** empty log message *** 1998-03-14 10:41:26 +00:00
Jim Meyering
e4a1ead494 *** empty log message *** 1998-03-14 10:41:02 +00:00
Jim Meyering
ad1a2f76ce *** empty log message *** 1998-03-14 10:40:30 +00:00
Jim Meyering
a7a6111f81 . 1998-03-14 10:37:29 +00:00
Jim Meyering
7c579a0231 . 1998-03-13 23:39:48 +00:00
Jim Meyering
6630a24b7a (copy): Update prototype. 1998-03-13 23:39:39 +00:00
Jim Meyering
6429ffabbb *** empty log message *** 1998-03-13 23:39:10 +00:00
Jim Meyering
e558629ce1 (do_move): Add &copy_into_self arg in call to copy.
Don't remove source directory when copy_into_self is nonzero.
Reported by Arne Henrik Juul.
1998-03-13 23:38:50 +00:00
Jim Meyering
fefa8511b8 (do_copy): Add unused arg in calls to copy. 1998-03-13 23:38:27 +00:00
Jim Meyering
347db9ce77 (copy_dir): Add new parameter, copy_into_self, and set it.
(copy_internal): Likewise.
(copy): Likewise.
Update all callers.
1998-03-13 23:37:42 +00:00
Jim Meyering
92da57a7be Use `virtual memory exhausted' message, not
`Memory exhausted' to be consistent with the majority of other
such messages.
Say `removing all...', not `removing any...'.
1998-03-13 23:35:43 +00:00
Jim Meyering
4078ae8de8 (remove_parents): Be consistent with documentation of
--verbose option and with remove.c in saying `removing...' before
the operation is attempted.
(main): Likewise.
Suggestions from Santiago Vila.
1998-03-13 23:35:25 +00:00
Jim Meyering
3086193091 (usage): Tweak spacing 1998-03-13 15:32:28 +00:00
Jim Meyering
823425b310 *** empty log message *** 1998-03-13 15:27:10 +00:00
Jim Meyering
e03fc9bc82 protoize 1998-03-13 15:25:49 +00:00
Jim Meyering
64379c5cd8 (getugroups): Don't add a group number if it would be a duplicate.
From Ulrich Drepper.
1998-03-13 15:24:43 +00:00
Jim Meyering
d4825df6cf *** empty log message *** 1998-03-11 11:55:31 +00:00
Jim Meyering
cb3b5ed486 (save_stdin): Open temporary file exclusively, to
foil a common denial-of-service attack.
From Paul Eggert.
1998-03-11 11:54:11 +00:00
Jim Meyering
7ee8ed7e37 (xtmpfopen): Open temporary file exclusively, to
foil a common denial-of-service attack.
From Paul Eggert.
1998-03-11 11:53:29 +00:00
Jim Meyering
a991132f3e (getuidbyname) [__DJGPP__]: Make function know about
any arbitrary user name.
(getgidbyname) [__DJGPP__]: Make function know about any arbitrary
group name.
From Eli.
1998-03-10 22:55:20 +00:00
Jim Meyering
7f0867df00 (parse_user_spec) [__DJGPP__]: Make function know
about any arbitrary user and group by pretending to be the user
and to belong to the group specified in `spec_arg' argument.
1998-03-10 22:49:04 +00:00
Jim Meyering
6354d07ea0 . 1998-02-25 23:47:36 +00:00
Jim Meyering
3216105fbb . 1998-02-25 23:46:59 +00:00
Jim Meyering
8d5c4784b8 . 1998-02-25 23:46:13 +00:00
Jim Meyering
ec47f73107 . 1998-02-25 23:36:33 +00:00
Jim Meyering
94cd0c09f6 . 1998-02-25 23:35:53 +00:00
Jim Meyering
db3440d444 . 1998-02-25 22:40:24 +00:00
Jim Meyering
e8bec0725e *** empty log message *** 1998-02-25 22:39:46 +00:00
Jim Meyering
8598c54bb1 Use -include, not `include' for aclocal-files. 1998-02-25 22:39:29 +00:00
Jim Meyering
e457645eac Include new file quotearg.h.
(enum indicator_style): Rename all to classify, and not_programs
to file_type, to match option spellings.  All users changed.
(indicator_style_args): New constant.
(quote_funny_chars, quote_as_string, quote_shell): Remove;
(filename_quoting_options, dirname_quoting_options): Use these
variables instead.
(long_options): Add --indicator-style, --quoting-style,
--show-control-chars.  Remove --quote-shell.
(dired_dump_obstack): Remove style parameter and don't output style.
(main): Go back to previous method of outputting //DIRED//
and //SUBDIRED// lines, without style.  But add a new
//DIRED-OPTIONS// line that does output style.
(decode_switches, usage): Add --indicator-style, --quoting-style,
--show-control-chars.  Remove --quote-shell.
(decode_switches): Default from QUOTING_STYLE environment variable.
Set new quoting vars.
(quote_name): Renamed from quote_filename.
Take new arg specifying quoting options.
Always print; do not have a special case for null FILE * argument.
All callers changed.
Move the guts of this function to new file quotearg.c.
(length_of_file_name_and_frills): Use quotearg_buffer instead
of (old) quote_filename to find length of file name.
(decode_switches, parse_ls_color, print_dir, gobble_file,
get_link_name):	Quote output in diagnostics.
1998-02-25 22:38:12 +00:00
Jim Meyering
a14303dbc9 *** empty log message *** 1998-02-25 08:20:55 +00:00
Jim Meyering
84ad5c47c8 (TYPE_SIGNED): Define.
(TYPE_MAXIMUM): Define.
(ULONG_MAX): Use TYPE_MAXIMUM.
(LONG_MAX): Use TYPE_MAXIMUM.
1998-02-24 23:33:41 +00:00
Jim Meyering
998b3a148c (libfu_a_SOURCES): Add quotearg.c.
(noinst_HEADERS): Add quotearg.h.
1998-02-24 23:31:40 +00:00
Jim Meyering
71ee764f1e . 1998-02-24 23:31:11 +00:00
Jim Meyering
07a6f7a9e2 protoize 1998-02-24 23:19:33 +00:00
Jim Meyering
0f5ca22215 add comment 1998-02-24 23:19:13 +00:00
Jim Meyering
fc50286759 update from libit 1998-02-24 23:18:23 +00:00
Jim Meyering
0a1fd1d2ad protoize 1998-02-24 23:17:38 +00:00
Jim Meyering
7a04e95c62 capitalize macro params and protoize 1998-02-24 22:59:34 +00:00
Jim Meyering
938e7fe7ef add copyright 1998-02-24 22:58:26 +00:00
Jim Meyering
d8ab75cedc Update from libit. 1998-02-24 22:54:10 +00:00
Jim Meyering
650b182278 . 1998-02-23 10:16:53 +00:00
Jim Meyering
f31f7889fb *** empty log message *** 1998-02-22 12:36:32 +00:00
Jim Meyering
b1f2e5a7fd *** empty log message *** 1998-02-22 12:31:06 +00:00
Jim Meyering
34141257cf . 1998-02-22 12:30:47 +00:00
Jim Meyering
c96ef37ba9 *** empty log message *** 1998-02-22 09:20:33 +00:00
Jim Meyering
ccc65c4a81 *** empty log message *** 1998-02-22 09:20:17 +00:00
Jim Meyering
be5250f0ec *** empty log message *** 1998-02-22 09:19:36 +00:00
Jim Meyering
d1c1677873 . 1998-02-22 09:18:33 +00:00
Jim Meyering
6eae430477 Truncate to 1998 entries only. 1998-02-22 09:17:58 +00:00
Jim Meyering
82d361dc53 *** empty log message *** 1998-02-22 09:10:57 +00:00
Jim Meyering
6e05a13259 revert most of last delta, but leave cppi/copyright changes 1998-02-22 08:21:07 +00:00
Jim Meyering
a1413ad1cd *** empty log message *** 1998-02-22 08:19:19 +00:00
Jim Meyering
c9dd33ec3f *** empty log message *** 1998-02-22 08:18:51 +00:00
Jim Meyering
b9a394eec5 *** empty log message *** 1998-02-21 16:15:23 +00:00
Jim Meyering
f315b52ca9 . 1998-02-21 16:14:42 +00:00
Jim Meyering
26c02dd946 . 1998-02-21 16:14:15 +00:00
Jim Meyering
a03a97d7d8 *** empty log message *** 1998-02-21 16:14:05 +00:00
Jim Meyering
ead1152ef8 *** empty log message *** 1998-02-21 11:55:30 +00:00
Jim Meyering
2326be84d5 *** empty log message *** 1998-02-21 11:54:09 +00:00
Jim Meyering
7980fa3b78 *** empty log message *** 1998-02-21 11:53:27 +00:00
Jim Meyering
70a8ff09ed *** empty log message *** 1998-02-21 11:52:45 +00:00
Jim Meyering
38a63c863e . 1998-02-21 11:44:39 +00:00
Jim Meyering
a4fb33a110 . 1998-02-21 11:44:13 +00:00
Jim Meyering
bd9a38183c *** empty log message *** 1998-02-21 11:39:06 +00:00
Jim Meyering
45d85e3ba2 . 1998-02-21 11:38:47 +00:00
Jim Meyering
afa328c54e . 1998-02-21 11:33:09 +00:00
Jim Meyering
c66e967d70 . 1998-02-21 11:29:12 +00:00
Jim Meyering
ccaf565665 *** empty log message *** 1998-02-21 11:28:46 +00:00
Jim Meyering
b1a82ad6f2 . 1998-02-21 11:17:06 +00:00
Jim Meyering
c9a2ec01e5 *** empty log message *** 1998-02-21 11:15:43 +00:00
Jim Meyering
f7acc2f589 *** empty log message *** 1998-02-21 11:09:33 +00:00
Jim Meyering
5bf77e1015 . 1998-02-21 11:04:07 +00:00
Jim Meyering
3aa15eac61 *** empty log message *** 1998-02-20 21:51:48 +00:00
Jim Meyering
5799c6474d . 1998-02-20 21:50:49 +00:00
Jim Meyering
f8998dae41 Include get-date.h.
Remove get_date decl.
1998-02-20 21:50:30 +00:00
Jim Meyering
a7ba2688ca s/getdate.h/get-date.h/ 1998-02-20 21:47:10 +00:00
Jim Meyering
6810b30f39 (noinst_HEADERS): s/getdate.h/get-date.h/ 1998-02-20 21:42:29 +00:00
Jim Meyering
f8d66bde6a s/getdate.h/get-date.h/ 1998-02-20 21:42:11 +00:00
Jim Meyering
4675b67c10 . 1998-02-20 12:22:50 +00:00
Jim Meyering
ae3c7c2fb1 *** empty log message *** 1998-02-19 21:38:16 +00:00
Jim Meyering
a3ff199f12 *** empty log message *** 1998-02-19 21:37:45 +00:00
Jim Meyering
61ef81a837 (dirname): Include ctype.h.
[IN_CTYPE_DOMAIN]: Define.
[ISALPHA]: Define.
[MSDOS]: Add support for DOS-style file names with drive letters.
Based on a patch from Eli Zaretskii.
1998-02-19 21:31:06 +00:00
Jim Meyering
dcb8db3c82 [__DJGPP__]: Add missing typedef for daddr_t. 1998-02-19 21:28:38 +00:00
Jim Meyering
92b49f0da1 *** empty log message *** 1998-02-16 23:28:09 +00:00
Jim Meyering
f322649c58 (cp_option_init): Set copy_as_regular to 0, not 1.
Otherwise, mv tries to open special files.
Reported by Kjetil Torgrim Homme.
1998-02-16 23:27:50 +00:00
Jim Meyering
f49fee3e5f *** empty log message *** 1998-02-13 08:49:34 +00:00
Jim Meyering
6dbc8ff80b *** empty log message *** 1998-02-13 08:48:54 +00:00
Jim Meyering
65978b6328 Add my comment from ChangeLog entry for gkm's change. 1998-02-11 22:17:38 +00:00
Jim Meyering
5f8949c46c *** empty log message *** 1998-02-09 07:02:15 +00:00
Jim Meyering
b302e2becc *** empty log message *** 1998-02-09 07:01:02 +00:00
Jim Meyering
5921d6bc50 (cvs-dist): Update po/. 1998-02-09 07:00:34 +00:00
Jim Meyering
ec76108bb7 . 1998-02-08 22:17:10 +00:00
Jim Meyering
519365bb08 (usage): Reword to use TARGET' and LINK_NAME' in description. 1998-02-08 21:27:18 +00:00
Jim Meyering
c1fc9dbe64 . 1998-02-07 15:17:56 +00:00
Jim Meyering
06b4686f8a . 1998-02-07 15:17:31 +00:00
Jim Meyering
5a244d2598 *** empty log message *** 1998-02-07 10:19:22 +00:00
Jim Meyering
497a1e0c04 *** empty log message *** 1998-02-07 10:17:43 +00:00
Jim Meyering
32ee7fb170 *** empty log message *** 1998-02-07 10:14:29 +00:00
Jim Meyering
db7449461c . 1998-02-07 09:59:05 +00:00
Jim Meyering
9ed89c9d9c *** empty log message *** 1998-02-07 09:58:59 +00:00
Jim Meyering
6110857115 *** empty log message *** 1998-02-07 09:57:39 +00:00
Jim Meyering
36afcc383a *** empty log message *** 1998-02-07 09:54:05 +00:00
Jim Meyering
9e7ca26738 Don't set am_cv_func_working_getline before the
cache-check for the same variable -- that defeated the purpose of
the test; the test program was never run.  This was a problem only
on systems with losing getline functions -- HP-UX 10.20 is one.
Reported by Bjorn Helgaas.
1998-02-07 09:50:58 +00:00
Jim Meyering
de38f9c61f . 1998-02-07 08:13:44 +00:00
Jim Meyering
aa14b2d994 . 1998-02-07 08:13:08 +00:00
Jim Meyering
a6a3dee962 *** empty log message *** 1998-02-06 20:48:10 +00:00
Jim Meyering
0324f8d422 . 1998-02-06 20:47:23 +00:00
Jim Meyering
5a9c4223f6 . 1998-02-06 20:45:51 +00:00
Jim Meyering
eeeb6c7b23 . 1998-02-06 12:37:16 +00:00
Jim Meyering
206e3f08de *** empty log message *** 1998-02-06 12:37:07 +00:00
Jim Meyering
61a80b3a12 (EXTRA_DIST): Add perl.m4. 1998-02-06 12:36:59 +00:00
Jim Meyering
4da3feb0e9 . 1998-02-06 12:36:04 +00:00
Jim Meyering
a3d39ceb13 *** empty log message *** 1998-02-06 10:42:55 +00:00
Jim Meyering
b252cc8d6d . 1998-02-06 10:32:31 +00:00
Jim Meyering
afac7f3a78 . 1998-02-04 20:28:08 +00:00
Jim Meyering
fae6846955 *** empty log message *** 1998-02-04 20:19:14 +00:00
Jim Meyering
f79e8bdcaf . 1998-02-04 20:18:09 +00:00
Jim Meyering
ebfdc834f2 . 1998-02-04 18:15:05 +00:00
Jim Meyering
6e5ac55673 . 1998-02-04 18:06:31 +00:00
Jim Meyering
43d2406f55 . 1998-02-04 18:04:39 +00:00
Jim Meyering
29772527c8 . 1998-02-04 18:01:23 +00:00
Jim Meyering
4e72061130 . 1998-02-04 18:00:57 +00:00
Jim Meyering
470cfd9491 . 1998-02-04 12:41:35 +00:00
Jim Meyering
ff9a9a2bdf . 1998-02-03 08:56:02 +00:00
Jim Meyering
a3db75c4b3 add comments on #endif's 1998-02-03 08:28:43 +00:00
Jim Meyering
46fb234f5f (xgetgroups): Guard function defn with #if HAVE_GETGROUPS. 1998-02-03 08:27:48 +00:00
Jim Meyering
1e985af9d7 . 1998-02-03 07:38:23 +00:00
Jim Meyering
8ef38f80ec (sys/types.h): Include to get size_t on some systems.
(NULL): Define if needed.
1998-02-03 07:23:13 +00:00
Jim Meyering
047f0c2125 *** empty log message *** 1998-02-01 09:58:33 +00:00
Jim Meyering
a10c7fcd7c *** empty log message *** 1998-02-01 09:56:46 +00:00
Jim Meyering
54a0879129 *** empty log message *** 1998-01-31 07:28:56 +00:00
Jim Meyering
494d8173bd *** empty log message *** 1998-01-28 08:14:56 +00:00
Jim Meyering
e8b739e317 (print_header): Change format to align heading over
last column of `df -i' output.  From Andreas Schwab.
1998-01-28 08:09:56 +00:00
Jim Meyering
ef4765e11b . 1998-01-25 21:21:47 +00:00
Jim Meyering
ca9451a39d . 1998-01-25 21:20:53 +00:00
Jim Meyering
1349c30df2 Use $(VERSION) etc. Not @VERSION@. 1998-01-25 21:07:30 +00:00
Jim Meyering
8659ec88d4 . 1998-01-25 20:50:57 +00:00
Jim Meyering
e27d21668c (parse_obsolescent_option): -l is an obsolescent option. 1998-01-25 14:07:46 +00:00
Jim Meyering
902598d05d . 1998-01-25 12:20:58 +00:00
Jim Meyering
fc026cd548 . 1998-01-25 12:19:05 +00:00
Jim Meyering
7d4a70eaff *** empty log message *** 1998-01-25 10:51:55 +00:00
Jim Meyering
186958482f *** empty log message *** 1998-01-25 10:51:21 +00:00
Jim Meyering
da80ee04d2 . 1998-01-25 09:49:00 +00:00
Jim Meyering
dd3a865a8e . 1998-01-25 09:47:51 +00:00
Jim Meyering
aaf66a2413 *** empty log message *** 1998-01-25 09:29:46 +00:00
Jim Meyering
0eba2a8dd7 (DO_CHOWN): Don't fail for non-root when chown fails due
not only to lack of permission (EPERM), but also to lack of support
(EINVAL).  Reported by Bengt Martensson.
1998-01-25 09:28:48 +00:00
Jim Meyering
7c04ce1f09 (re_protect): Don't fail for non-root when chown fails due
not only to lack of permission (EPERM), but also to lack of support
(EINVAL).  Reported by Bengt Martensson.
1998-01-25 09:27:57 +00:00
Jim Meyering
7b4833b03c *** empty log message *** 1998-01-25 09:23:26 +00:00
Jim Meyering
3a62f8785f (cat): Convert comma-expressions to pairs of
semicolon-terminated stmts.
Add braces around compound if/else stmts.
1998-01-25 08:25:05 +00:00
Jim Meyering
85923cb2bc add missing `)' 1998-01-24 23:34:46 +00:00
Jim Meyering
bc05ba3d5a *** empty log message *** 1998-01-24 23:33:18 +00:00
Jim Meyering
ea2969da49 (parse_obsolescent_option): Do not interpret `-f -n 1 ...'
as obsolescent options.
Accept new option: --sleep-interval=SECONDS (-s).
(parse_options): Recognize it.
(usage): Describe it.
(tail_forever): Use it.
(dump_remainder): Use it.
1998-01-24 23:33:02 +00:00
Jim Meyering
0966b97bd1 (f-1): Add test for option-processing of `-f -n 1'. 1998-01-24 23:32:43 +00:00
Jim Meyering
8c3fb79a89 . 1998-01-24 16:48:52 +00:00
Jim Meyering
fc68d2786b *** empty log message *** 1998-01-24 16:27:26 +00:00
Jim Meyering
0d26afa6e0 *** empty log message *** 1998-01-24 16:22:11 +00:00
Jim Meyering
bb964b3eec (test_failure): Note that the SunOS4.1.4 failure
of the ctime test is expected.
Rename does not update ctime; link does -- so use ln, not mv.
1998-01-24 16:21:48 +00:00
Jim Meyering
638776e577 *** empty log message *** 1998-01-24 15:13:58 +00:00
Jim Meyering
0881032a16 *** empty log message *** 1998-01-24 14:50:28 +00:00
Jim Meyering
c58c644f8f *** empty log message *** 1998-01-24 14:50:16 +00:00
Jim Meyering
6e602a0232 *** empty log message *** 1998-01-24 14:49:30 +00:00
Jim Meyering
097d40b3d3 *** empty log message *** 1998-01-24 09:55:10 +00:00
Jim Meyering
57258b3446 . 1998-01-24 08:46:29 +00:00
Jim Meyering
39508b8db3 *** empty log message *** 1998-01-24 08:46:21 +00:00
Jim Meyering
cd4c2d0fdc (TYPE_MINIMUM): Add extra outer cast to work around
bug in Cray C 5.0.3.0 when T == time_t.
1998-01-24 08:45:55 +00:00
Jim Meyering
8a0550a816 Adjust expected output for changed format of `rm --verbose'. 1998-01-24 08:43:46 +00:00
Jim Meyering
663d8b143c *** empty log message *** 1998-01-23 22:09:18 +00:00
Jim Meyering
2a1a1843b7 (__mktime_internal): Work around bug in Irix4.0.5's
C compiler.  From Kaveh Ghazi.
(TYPE_MINIMUM): Define.
(TYPE_MAXIMUM): Define.
(TIME_T_MIN): Use TYPE_MINIMUM.
(TIME_T_MAX): Use TYPE_MAXIMUM.
1998-01-23 22:02:54 +00:00
Jim Meyering
9c70563ee7 add curlies 1998-01-23 18:34:12 +00:00
Jim Meyering
37ce5a5497 . 1998-01-22 23:29:35 +00:00
Jim Meyering
37a3052a36 *** empty log message *** 1998-01-22 09:03:08 +00:00
Jim Meyering
2a4842f7f3 (quit): Declare to be inline to stifle compile warning. 1998-01-22 08:58:12 +00:00
Jim Meyering
d82fadf365 Reorder functions to obviate forward dcls. 1998-01-22 08:55:13 +00:00
Jim Meyering
ef63ce007d (do_copy): Add unreachable `return 0' to stifle warning. 1998-01-22 08:36:27 +00:00
Jim Meyering
6a8e657775 . 1998-01-22 08:33:34 +00:00
Jim Meyering
309819620b (TESTS_ENVIRONMENT): Add TOUCH. 1998-01-22 08:33:26 +00:00
Jim Meyering
f7bb262cc8 minor tweaks 1998-01-22 08:33:02 +00:00
Jim Meyering
d5494d57f5 Don't use -f. Do adjust $RM if it's a relative path. 1998-01-22 08:32:22 +00:00
Jim Meyering
14a2593daf Use GNU touch to work around problems with NFS caching and/or clock skew. 1998-01-22 08:27:16 +00:00
Jim Meyering
9cdd2e05e6 (copy_internal): Use x->backup_type, not the global.
(valid_options): Use VALID_BACKUP_TYPE and VALID_SPARSE_MODE.
1998-01-22 08:22:00 +00:00
Jim Meyering
6cce6a1b7f [NDEBUG]: Comment out definition.
(do_copy): Use x->backup_type, not the global.
1998-01-22 08:19:17 +00:00
Jim Meyering
d9f0ca41bd (rm_option_init): New function.
(cp_option_init): New function.
(copy_reg): Remove now-unused function.
(do_move): Set up for and use `copy.c (copy)' in place of copy_reg.
Set up for and use `remove.c (rm)' in place of unlink.
1998-01-22 08:16:09 +00:00
Jim Meyering
df7cef21c7 Remove and minimally librarify guts for use in mv.c.
(main): Pass options (`&x') to rm.
Call remove_init and remove_fini instead of open-coding them.
1998-01-22 08:14:52 +00:00
Jim Meyering
9f2d1beded *** empty log message *** 1998-01-22 08:14:17 +00:00
Jim Meyering
ff59218d54 New file. Contains guts of old rm.c.
(remove_init): New function.
(remove_fini): New function.
1998-01-22 08:13:57 +00:00
Jim Meyering
1a18272561 Declare new global, backup_type.
(main): Initialize backup_type unconditionally.
(do_link): Call find_backup_file_name with new argument, backup_type.
1998-01-22 08:13:12 +00:00
Jim Meyering
2bdf8621d6 Declare new global, backup_type.
(main): Initialize backup_type unconditionally.
(copy_file): Call find_backup_file_name with new backup_type, argument.
1998-01-22 08:12:24 +00:00
Jim Meyering
758ab7a013 *** empty log message *** 1998-01-21 16:37:09 +00:00
Jim Meyering
734d1cccc3 (VALID_SPARSE_MODE): Define.
[struct cp_options] (backup_type): New member.
1998-01-21 16:16:00 +00:00
Jim Meyering
13de1036ac . 1998-01-21 15:59:28 +00:00
Jim Meyering
2167febcb1 Fix copyright 1998-01-21 15:57:48 +00:00
Jim Meyering
2c11b736aa Use ANSI function definitions.
Remove global declaration of backup_type.
(simple_backup_suffix): Default to `~', not `.orig'.
Use PARAMS, not __BACKUPFILE_P.
(find_backup_file_name): Add parameter, backup_type.
1998-01-21 15:57:18 +00:00
Jim Meyering
a52e0efbe2 Remove extern declaration of backup_type.
Use PARAMS, not __BACKUPFILE_P.
(VALID_BACKUP_TYPE): Define.
(find_backup_file_name): Adjust prototype.
1998-01-21 15:55:12 +00:00
Jim Meyering
4935348b67 Use ANSI function definitions. 1998-01-20 11:34:38 +00:00
Jim Meyering
e6a0306b1b [enum backup_type]: Set `none' to 1. 1998-01-20 11:34:04 +00:00
Jim Meyering
2bec121abb add `,' in comment 1998-01-19 09:29:27 +00:00
Jim Meyering
412043f1d8 . 1998-01-18 11:52:44 +00:00
Jim Meyering
4ffa362cc4 *** empty log message *** 1998-01-18 11:52:38 +00:00
Jim Meyering
35592ba64c (strncoll, strncoll_s2_readonly, look_for_fraction, numcompare):
Remove the `unsigned' from some `unsigned char*' parameter types.
Add casts via UCHAR where necessary to avoid problems with unwanted
sign extension.  Based on a patch from Kaveh Ghazi to appease Irix4's
cc compiler.
e.g.,
 > cc -DLOCALEDIR=\"/caip/u3/ghazi/foobar/share/locale\" -DHAVE_CONFIG_H
 >      -I.. -I../../src -I../../lib -I../intl -c ../../src/sort.c
 > accom: Error: ../../src/sort.c, line 500: prototype parameter 1 type
 >      must have all of the actual arguments qualifiers (except the
 >      outermost) and pointed-to types must be compatible (ANSI
 >      3.3.2.2,3.3.16.1)
 >              diff = strcoll (s1, s2);
 >        ----------------------------^
 > accom: Error: ../../src/sort.c, line 500: Argument 1 Type Doesn't
 >      Match prototype description; prototype: pointer to const char is
 >      different from actual: pointer to unsigned char
 >              diff = strcoll (s1, s2);
 >        ----------------------------^
 > accom: Error: ../../src/sort.c, line 500: prototype parameter 2 type
 >      must have all of the actual arguments qualifiers (except the
 >      outermost) and pointed-to types must be compatible (ANSI
 >      3.3.2.2,3.3.16.1)
 >              diff = strcoll (s1, s2);
 >        ----------------------------^
 > accom: Error: ../../src/sort.c, line 500: Argument 2 Type Doesn't
 >      Match prototype description; prototype: pointer to const char is
 >      different from actual: pointer to unsigned char
 >              diff = strcoll (s1, s2);
 >        ----------------------------^
1998-01-18 11:51:08 +00:00
Jim Meyering
c1618a8c4c (next_file_name): Rewrite. This removes an artificial limit (albeit
already high, at INT_MAX :-) on the number of files split could create.
Reported by Ralf W. Stephan.
1998-01-18 11:18:08 +00:00
Jim Meyering
96be8bca99 Guard inclusion of langinfo.h also with HAVE_LANGINFO_H,
for Irix-4.0.5.  From Kaveh Ghazi.
1998-01-16 23:29:24 +00:00
Jim Meyering
b8a16a3f2a (mergefps): Add braces to avoid ambiguous `else' statement.
(nls_set_fraction): Likewise.
1998-01-16 23:23:04 +00:00
Jim Meyering
f1217e4976 . 1998-01-16 11:18:05 +00:00
Jim Meyering
62279c6e2d . 1998-01-16 11:17:02 +00:00
Jim Meyering
71545a6276 Make PARAMS-defining conditionals consistent. 1998-01-16 08:52:30 +00:00
Jim Meyering
53cfcbd19c Make PARAMS-defining conditionals consistent. 1998-01-16 08:51:39 +00:00
Jim Meyering
5618133eed (fail-0): Disable test. It depends on
sizeof(long) being 32 bits.  Reported by Kaveh Ghazi.
1998-01-16 08:04:19 +00:00
Jim Meyering
ade1f58e11 (print_header): Fix inode format header to line it up
with the rest of the output.
1998-01-14 08:52:56 +00:00
Jim Meyering
74cf3e8bab Set errno to ENOENT, not EINVAL. This is consistent
with most other implementations.
1998-01-13 10:08:11 +00:00
Jim Meyering
ca50e875af *** empty log message *** 1998-01-13 09:53:15 +00:00
Jim Meyering
a75ea1014e *** empty log message *** 1998-01-12 09:00:10 +00:00
Jim Meyering
98af2e9636 *** empty log message *** 1998-01-12 08:55:42 +00:00
Jim Meyering
68e5877403 *** empty log message *** 1998-01-12 08:55:01 +00:00
Jim Meyering
2b906615c2 *** empty log message *** 1998-01-12 08:53:18 +00:00
Jim Meyering
443f852f61 Include sys/param.h only #if HAVE_SYS_PARAM_H.
Move function-spanning `#if ...BSIZE' stmt to follow inclusion of
sys/param.h since BSIZE is sometimes defined in sys/param.h.
Based on a patch from Philippe De Muyter.
1998-01-12 08:13:39 +00:00
Jim Meyering
d1f4e617b5 *** empty log message *** 1998-01-11 09:24:17 +00:00
Jim Meyering
1aa070dd2e . 1998-01-11 09:14:29 +00:00
Jim Meyering
007e81132a . 1998-01-11 09:14:02 +00:00
Jim Meyering
6bcfff640e *** empty log message *** 1998-01-11 09:12:30 +00:00
Jim Meyering
aa2880362c . 1998-01-11 08:02:39 +00:00
Jim Meyering
88bd90109b *** empty log message *** 1998-01-10 22:13:49 +00:00
Jim Meyering
dba300a0d0 CHAR_BIT SCHAR_MAX UCHAR_MAX SHRT_MAX INT_MAX UINT_MAX LONG_MAX ULONG_MAX
Remove definitions of those symbols.
* src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h
since it now includes limit.h which defines RE_DUP_MAX.
* src/nl.c: Likewise.
* src/tac.c: Likewise.
1998-01-10 22:12:03 +00:00
Jim Meyering
b9ed71e46e . 1998-01-10 20:53:56 +00:00
Jim Meyering
7bba3e945f initialize fail to 0 1998-01-10 16:25:46 +00:00
Jim Meyering
1bdfcabd2c . 1998-01-10 16:24:46 +00:00
Jim Meyering
c88a4c91da (EXTRA_DIST): Add const.m4. 1998-01-10 16:24:26 +00:00
Jim Meyering
136f2fd28c . 1998-01-10 15:57:57 +00:00
Jim Meyering
82739833a1 *** empty log message *** 1998-01-10 15:09:46 +00:00
Jim Meyering
1c5c2597b5 *** empty log message *** 1998-01-10 15:08:00 +00:00
Jim Meyering
eacbf12ea4 *** empty log message *** 1998-01-10 15:04:32 +00:00
Jim Meyering
0ccdf3419d (usage): Describe -D. 1998-01-10 15:03:58 +00:00
Jim Meyering
cec85a4b3a . 1998-01-10 14:25:27 +00:00
Jim Meyering
a077a7833c *** empty log message *** 1998-01-10 14:23:08 +00:00
Jim Meyering
a3094b0529 (batch_convert): Use memcpy when we don't need return value. 1998-01-10 14:21:35 +00:00
Jim Meyering
d73dd15544 . 1998-01-10 13:36:47 +00:00
Jim Meyering
27c1ad9576 *** empty log message *** 1998-01-10 13:36:09 +00:00
Jim Meyering
2eefbf7647 (usage): Correct descriptions of --sort, --time, and -t.
Suggestions from Andreas Schwab.
1998-01-10 12:53:09 +00:00
Jim Meyering
79d39ab7bf (decode_switches) [-u]: Fix bug whereby -u had no effect
without -l or -t.  Now, -u (like -c) implies --sort=time.
Suggestion from Andreas Schwab.
1998-01-10 12:07:50 +00:00
Jim Meyering
12782f54b0 *** empty log message *** 1998-01-10 11:56:26 +00:00
Jim Meyering
fff6de7b04 *** empty log message *** 1998-01-10 11:54:39 +00:00
Jim Meyering
cc76db2016 use sh-script test, not Test.pm framework 1998-01-10 11:27:24 +00:00
Jim Meyering
77c94909cf *** empty log message *** 1998-01-10 11:24:51 +00:00
Jim Meyering
3b8d19272d . 1998-01-10 11:00:46 +00:00
Jim Meyering
6099914170 *** empty log message *** 1998-01-10 10:36:41 +00:00
Jim Meyering
09d96ac539 (make_path): Reformat 3 if-stmts to test `if (newly_created_dir)' only once.
Suggestion from Andreas Schwab.
1998-01-10 10:28:37 +00:00
Jim Meyering
3edbca0e04 (make_path): Put only newly created directories on the LEADING_DIRS list. 1998-01-10 10:22:30 +00:00
Jim Meyering
c062a35803 *** empty log message *** 1998-01-08 23:17:20 +00:00
Jim Meyering
3da029a5d9 *** empty log message *** 1998-01-08 23:16:14 +00:00
Jim Meyering
de1dabf7d7 *** empty log message *** 1998-01-08 22:58:18 +00:00
Jim Meyering
03283b5000 (tac_stream): Don't perform arithmetic on now-void pointer
result of xrealloc (until recently it was char*).
1998-01-08 22:58:03 +00:00
Jim Meyering
9f5dc7e7d0 (inittables): Add && HAVE_NL_LANGINFO to the #if-test
guarding the nls month-checking code.
(nls_numeric_format): Remove unnecessary (and error-evoking w/SunOS' cc)
`unsigned' from dcls of text and lim.
(main): Cast lconvp->grouping to `unsigned char*' to appease SunOS's cc.
1998-01-08 22:56:45 +00:00
Jim Meyering
ab9cd27938 *** empty log message *** 1998-01-07 07:45:46 +00:00
Jim Meyering
c767a49741 *** empty log message *** 1998-01-06 23:53:50 +00:00
Jim Meyering
0fdd1b9130 Add %expect directive.
Move inclusion of getdate.h and dependent extern declarations down
so getdate.h's prototype follows the sometimes-enabled definition
of `const' to nothing.  Otherwise, the prototype wouldn't match
the definition because of the defined-away `const'.
(get_date): ANSI-fy definition.
From Kaveh Ghazi.
1998-01-06 23:53:33 +00:00
Jim Meyering
f19ca6fe29 *** empty log message *** 1998-01-05 17:43:31 +00:00
Jim Meyering
6cc3cf776c (df_readable): New function.
(show_dev): If a value consists entirely of 1 bits, or is derived
from some other value that consists entirely of 1 bits, report "-".
Check inode and block counts more carefully for plausibility,
to avoid arithmetic overflow when computing percentages.
1998-01-05 17:43:00 +00:00
Jim Meyering
e162abfc5b (get_fs_usage): Add parens. 1998-01-05 17:38:38 +00:00
Jim Meyering
866773c72a (PROPAGATE_ALL_ONES): New macro.
(get_fs_usage): If a value consists entirely of 1 bits,
propagate this info to the output by setting it to (uintmax_t) -1.
1998-01-05 17:33:54 +00:00
Jim Meyering
06bab849fc reindent a little 1998-01-05 10:11:08 +00:00
Jim Meyering
ed0becde29 reformat comment, dcl fail, dirname 1998-01-05 10:09:24 +00:00
Jim Meyering
8d64a37a77 remove SPECIAL_BITS #ifdefs 1998-01-05 10:06:41 +00:00
Jim Meyering
0520188821 Add support for marty's -D option 1998-01-05 10:06:07 +00:00
Jim Meyering
05d9a7233b *** empty log message *** 1998-01-04 23:28:28 +00:00
Jim Meyering
f664e44a2f *** empty log message *** 1998-01-04 23:27:12 +00:00
Jim Meyering
5705eaaee2 . 1998-01-04 22:54:19 +00:00
Jim Meyering
0e69432852 . 1998-01-04 22:46:40 +00:00
Jim Meyering
2d69426882 copyright 1998-01-04 22:46:23 +00:00
Jim Meyering
5d4f8ebdfd (main, usage): Check for write error to stdout before exiting.
Include "closeout.h".
1998-01-04 22:45:28 +00:00
Jim Meyering
b246280c27 (parse_long_options): Check for write error to stdout before exiting. 1998-01-04 22:43:44 +00:00
Jim Meyering
60e021ee4e (libfu_a_SOURCES): Add closeout.c.
(noinst_HEADERS): Add closeout.h.
1998-01-04 22:42:38 +00:00
Jim Meyering
63c0f480ad Use a single enumerated type, Verbosity, instead of
the two booleans, verbose and changes_only.  This fixes a bug whereby
--change had the same effect as --verbose.
Plus Paul's close_stdout changes.
1998-01-04 22:41:02 +00:00
Jim Meyering
e375f4e9c8 Use a single enumerated type, Verbosity, instead of
the two booleans, verbose and changes_only.  This fixes a bug whereby
--change had the same effect as --verbose.
1998-01-04 22:40:27 +00:00
Jim Meyering
109b9c5f94 . 1998-01-04 21:48:30 +00:00
Jim Meyering
126c1a40e5 . 1998-01-04 21:47:31 +00:00
Jim Meyering
2440fd8bac . 1998-01-03 22:53:52 +00:00
Jim Meyering
98b9c4bed7 . 1998-01-03 22:16:23 +00:00
Jim Meyering
40f708f534 . 1998-01-03 22:14:58 +00:00
Jim Meyering
ebc5dc0b0c *** empty log message *** 1998-01-03 22:13:53 +00:00
Jim Meyering
e0ed4e6a77 *** empty log message *** 1998-01-03 18:10:47 +00:00
Jim Meyering
c24393e0fd *** empty log message *** 1998-01-03 18:09:23 +00:00
Jim Meyering
e15db4ca81 *** empty log message *** 1998-01-03 16:47:35 +00:00
Jim Meyering
1059e96721 (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
just like `fsu.fsu_blocks == 0' as an indicator that usage information
is invalid.  This happens with Solaris-5.5.1 CD-ROM partitions.
1998-01-03 16:47:21 +00:00
Jim Meyering
234ea05171 *** empty log message *** 1998-01-03 14:40:33 +00:00
Jim Meyering
0fa007e352 *** empty log message *** 1998-01-03 12:03:01 +00:00
Jim Meyering
9e6b379dbf *** empty log message *** 1998-01-03 11:58:49 +00:00
Jim Meyering
d46bab3a59 Guard PARAMS-enabling definition with
`defined PROTOTYPES || (defined __STDC__ && __STDC__)' to be consistent.
1998-01-03 11:56:58 +00:00
Jim Meyering
541699c01c Guard PARAMS-enabling definition with
`defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
problems with Irix4's cc.  From Kaveh Ghazi.
1998-01-03 11:56:09 +00:00
Jim Meyering
23a8ea7992 *** empty log message *** 1998-01-02 23:18:08 +00:00
Jim Meyering
6b4321fd1b *** empty log message *** 1998-01-02 23:16:53 +00:00
Jim Meyering
2fb86e2eb8 (get_ids): When otherwise unspecified, set uid and gid to -1. 1998-01-02 23:16:38 +00:00
Jim Meyering
53bc7b04cb (make_path): Try to change ownership only if we've just created the
directory.  Fix latent bug (s/&&/||/ in two places -- also, note that
it could not be exercised via install or mkdir) whereby chown would
not be invoked when only one of owner/group is not -1.
1998-01-02 23:15:39 +00:00
Jim Meyering
43c2a5f62b *** empty log message *** 1998-01-01 21:33:29 +00:00
Jim Meyering
b3d19ee824 (remove_cwd_entries): Initialize the entry-name obstack
only once and never free it.
1998-01-01 21:32:46 +00:00
Jim Meyering
2c2fa642c4 (show_dev): Move check for 0-block device (and return if
not e.g., -a) back up to precede first print stmt.
1998-01-01 21:30:00 +00:00
Jim Meyering
cb5e8a14c2 *** empty log message *** 1998-01-01 19:45:43 +00:00
Jim Meyering
48221eb8bd *** empty log message *** 1998-01-01 19:44:02 +00:00
Jim Meyering
3e6934d53e *** empty log message *** 1998-01-01 19:41:47 +00:00
Jim Meyering
741e2bd94b *** empty log message *** 1998-01-01 19:36:19 +00:00
Jim Meyering
0327bae400 *** empty log message *** 1997-12-31 21:36:14 +00:00
Jim Meyering
e3d35f6789 (show_dev): Print inode counts human readably. 1997-12-31 21:34:07 +00:00
Jim Meyering
b76a453304 (decode_switches): -h and -H override output units.
(print_dir, gobble_file, print_long_format,
print_file_name_and_frills): Print disk allocations human readably.
1997-12-31 21:33:51 +00:00
Jim Meyering
069e564d89 . 1997-12-31 14:28:44 +00:00
Jim Meyering
cadfe29978 *** empty log message *** 1997-12-31 14:04:54 +00:00
Jim Meyering
da111683d5 (show_dev): Move computation of
blocks_used etc. and blocks_percent_used,
inodes_used etc. and inodes_percent_used into respective branches
of the `if (inode_format)' statement where they're actually used.
1997-12-31 14:04:20 +00:00
Jim Meyering
57da248b85 *** empty log message *** 1997-12-31 11:01:48 +00:00
Jim Meyering
b66148ba39 Define and use PARAMS, not __EXCLUDE_P. 1997-12-31 11:01:35 +00:00
Jim Meyering
86d2f9eaa8 Use PARAMS, not __EXCLUDE_P. 1997-12-31 11:01:18 +00:00
Jim Meyering
25e06fece0 (usage): s/TAB/ /g 1997-12-29 22:09:28 +00:00
Jim Meyering
d1de57abbc *** empty log message *** 1997-12-29 21:29:51 +00:00
Jim Meyering
5cc8090de2 (remove_cwd_entries): Plug a gross leak -- don't call
obstack_init inside the loop.
1997-12-29 21:04:26 +00:00
Jim Meyering
e2ed51f99e *** empty log message *** 1997-12-29 12:06:02 +00:00
Jim Meyering
134ed86e33 (usage): Replace TABs with spaces in --help message. 1997-12-29 12:05:36 +00:00
Jim Meyering
f7d4fc0e38 (invalid_arg): Use a single fprintf and whole
format statements to ease translation.
Convert from K&R to ANSI function dcls.
1997-12-29 12:02:43 +00:00
Jim Meyering
3531b69552 . 1997-12-28 21:49:54 +00:00
Jim Meyering
ce9923ab87 Use ANSI syntax, not K&R. 1997-12-28 10:41:01 +00:00
Jim Meyering
6d02c37081 *** empty log message *** 1997-12-28 10:38:30 +00:00
Jim Meyering
b2e7f8b0af (make_path) [!__STDC__]: Remove K&R-style definition. 1997-12-28 10:38:15 +00:00
Jim Meyering
08c3f260a1 define PARAMS 1997-12-28 09:48:26 +00:00
Jim Meyering
cde7e42dde Add PARAMS. 1997-12-28 08:04:08 +00:00
Jim Meyering
4656a7e55b Remove incorrect declaration of group_member.
Include group-member.h instead.
Based on suggestion from Ulrich Drepper.
1997-12-28 08:03:54 +00:00
264 changed files with 22682 additions and 14171 deletions

166
ABOUT-NLS
View File

@@ -1,16 +1,16 @@
Notes on the GNU Translation Project
************************************
Notes on the Free Translation Project
*************************************
GNU is going international! The GNU Translation Project is a way to
get maintainers, translators, and users all together, so that GNU will
gradually become able to speak many languages. A few packages already
provide translations for their messages.
Free software is going international! The Free Translation Project
is a way to get maintainers of free software, translators, and users all
together, so that will gradually become able to speak many languages.
A few packages already provide translations for their messages.
If you found this `ABOUT-NLS' file inside a GNU distribution, you
may assume that the distributed package does use GNU `gettext'
internally, itself available at your nearest GNU archive site. But you
do *not* need to install GNU `gettext' prior to configuring, installing
or using this package with messages translated.
If you found this `ABOUT-NLS' file inside a distribution, you may
assume that the distributed package does use GNU `gettext' internally,
itself available at your nearest GNU archive site. But you do *not*
need to install GNU `gettext' prior to configuring, installing or using
this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
@@ -31,19 +31,23 @@ should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in
the operating system where this package is being installed. So far, no
prior implementation provides as many useful features (such as locale
alias or message inheritance). It is also not possible to offer this
additional functionality on top of a `catgets' implementation. Future
versions of GNU `gettext' will very likely convey even more
functionality. So it might be a good idea to change to GNU `gettext'
as soon as possible.
package, despite the existence of internationalizing capabilities in the
operating system where this package is being installed. So far, only
the `gettext' implementation in the GNU C library version 2 provides as
many features (such as locale alias or message inheritance) as the
implementation here. It is also not possible to offer this additional
functionality on top of a `catgets' implementation. Future versions of
GNU `gettext' will very likely convey even more functionality. So it
might be a good idea to change to GNU `gettext' as soon as possible.
So you need not provide this option if you are using GNU libc 2 or
you have installed a recent copy of the GNU gettext package with the
included `libintl'.
INSTALL Matters
===============
Some GNU packages are "localizable" when properly installed; the
Some packages are "localizable" when properly installed; the
programs they contain can be made to speak your own native language.
Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
@@ -113,37 +117,35 @@ shell prompt, merely execute `setenv LANG de' (in `csh'),
can be done from your `.login' or `.profile' file, once and for all.
An operating system might already offer message localization for
many of its programs, while other programs (whether GNU or not) have
been installed locally with the full capabilities of GNU `gettext'.
Just using `gettext' extended syntax for `LANG' would break proper
localization of already available operating system programs. In this
case, users should set both `LANGUAGE' and `LANG' variables in their
environment, as programs using GNU `gettext' give preference to
`LANGUAGE'. For example, some Swedish users would rather read
translations in German than English for when Swedish is not available.
This is easily accomplished by setting `LANGUAGE' to `sv:de' while
leaving `LANG' to `sv'.
many of its programs, while other programs have been installed locally
with the full capabilities of GNU `gettext'. Just using `gettext'
extended syntax for `LANG' would break proper localization of already
available operating system programs. In this case, users should set
both `LANGUAGE' and `LANG' variables in their environment, as programs
using GNU `gettext' give preference to `LANGUAGE'. For example, some
Swedish users would rather read translations in German than English for
when Swedish is not available. This is easily accomplished by setting
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
Translating Teams
=================
For the GNU Translation Project to be a success, we need interested
For the Free Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list, courtesy of Linux
International. You may reach your translation team at the address
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
language. Language codes are *not* the same as the country codes given
in ISO 3166. The following translation teams exist, as of February
in ISO 3166. The following translation teams exist, as of December
1997:
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
English `en', Esperanto `eo', Finnish `fi', French `fr', German
`de', Greek `el', Hebrew `he', Hungarian `hu', Irish `ga', Italian
`it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la',
Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt',
Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', Telugu
`te', Turkish `tr' and Ukrainian `uk'.
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
Swedish `sv', and Turkish `tr'.
For example, you may reach the Chinese translation team by writing to
`zh@li.org'.
@@ -160,55 +162,53 @@ message to `sv-request@li.org', having this message body:
*actively* in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `gnu-translation@gnu.ai.mit.edu' to reach
the GNU coordinator for all translator teams.
get started, please write to `translation@iro.umontreal.ca' to reach the
coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology used in GNU. Proven linguistic skill are praised more
than programming skill, here. For the time being, please avoid
subscribing to the English team unless explicitly invited to do so.
the terminology in use. Proven linguistic skill are praised more than
programming skill, here.
Available Packages
==================
Languages are not equally supported in all GNU packages. The
following matrix shows the current state of GNU internationalization,
as of February 1997. The matrix shows, in regard of each package, for
which languages PO files have been submitted to translation
coordination.
Languages are not equally supported in all packages. The following
matrix shows the current state of internationalization, as of December
1997. The matrix shows, in regard of each package, for which languages
PO files have been submitted to translation coordination.
Ready PO files cs de en es fi fr ja ko nl no pl pt sl sv
.-------------------------------------------.
bash | [] [] [] | 3
bison | [] [] [] | 3
clisp | [] [] [] | 3
cpio | [] [] [] [] [] | 5
diffutils | [] [] [] [] | 4
enscript | [] [] [] [] [] | 5
fileutils | [] [] [] [] [] [] [] [] | 8
findutils | [] [] [] [] [] [] [] | 7
flex | [] [] [] | 3
gcal | [] [] [] | 3
gettext | [] [] [] [] [] [] [] [] [] [] | 11
grep | [] [] [] [] [] [] [] [] | 8
hello | [] [] [] [] [] [] [] [] [] [] | 10
id-utils | [] [] | 2
indent | [] [] | 2
libc | [] [] [] [] [] [] [] | 7
m4 | [] [] [] [] [] | 5
make | [] [] [] [] [] [] | 6
music | [] | 1
ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] [] | 8
sh-utils | [] [] [] [] [] | 5
sharutils | [] [] [] [] [] | 5
tar | [] [] [] [] [] [] [] [] [] | 9
texinfo | | 0
textutils | [] [] [] [] [] [] | 6
wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------'
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
27 packages 1 22 1 14 1 25 1 10 20 7 14 7 7 15 145
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
.----------------------------------------------------.
bash | [] [] [] | 3
bison | [] [] [] | 3
clisp | [] [] [] [] | 4
cpio | [] [] [] [] [] [] | 6
diffutils | [] [] [] [] [] | 5
enscript | [] [] [] [] [] [] | 6
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
findutils | [] [] [] [] [] [] [] [] [] | 9
flex | [] [] [] [] | 4
gcal | [] [] [] [] [] | 5
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
grep | [] [] [] [] [] [] [] [] [] [] | 10
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
id-utils | [] [] [] | 3
indent | [] [] [] [] [] | 5
libc | [] [] [] [] [] [] [] | 7
m4 | [] [] [] [] [] [] | 6
make | [] [] [] [] [] [] | 6
music | [] [] | 2
ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] [] [] | 9
sh-utils | [] [] [] [] [] [] [] [] | 8
sharutils | [] [] [] [] [] [] | 6
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
texinfo | [] [] [] | 3
textutils | [] [] [] [] [] [] [] [] [] | 9
wdiff | [] [] [] [] [] [] [] [] | 8
`----------------------------------------------------'
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
@@ -219,8 +219,8 @@ dialects.
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
GNU distribution.
distribution.
If February 1997 seems to be old, you may fetch a more recent copy
If December 1997 seems to be old, you may fetch a more recent copy
of this `ABOUT-NLS' file on most GNU archive sites.

23
GNUmakefile Normal file
View File

@@ -0,0 +1,23 @@
# Having a separate GNUmakefile lets me `include' the dynamically
# generated rules created via Makefile.maint as well as Makefile.maint itself.
# This makefile is used only if you run GNU Make.
# It is necessary if you want to build targets usually of interest
# only to the maintainer.
have-Makefile := $(shell test -f Makefile && echo yes)
# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
ifeq ($(have-Makefile),yes)
include Makefile
include $(srcdir)/Makefile.maint
else
all:
@echo There seems to be no Makefile in this directory.
@echo "You must run ./configure before running \`make'."
@exit 1
endif

44
Makefile.maint Normal file
View File

@@ -0,0 +1,44 @@
# -*-Makefile-*-
# This Makefile fragment is shared between fileutils, sh-utils, textutils.
maintainer-check:
if head ChangeLog| grep 'Version $(VERSION)' > /dev/null; then \
:; \
else \
echo "$(VERSION) not in ChangeLog; not tagging" 1>&2; \
exit 1; \
fi
$(MAKE) distcheck
$(MAKE) my-distcheck
# Tag before making distribution. Also, don't make a distribution if
# checks fail. Also, make sure the NEWS file is up-to-date.
cvs-dist: maintainer-check
pkg=`echo "$(PACKAGE)" | tr a-z A-Z`; \
ver=`echo "$(VERSION)" | sed 's/\./_/g'`; \
tag="$$pkg-$$ver"; \
echo tag=$$tag; \
if cvs -n log -h README| grep -e $$tag > /dev/null; then \
echo "VERSION not new; not tagging" 1>&2; \
exit 1; \
fi; \
cvs update po; \
cvs tag -c $$tag
$(MAKE) dist
t=./=test
my-distcheck: dist
-rm -rf $(t)
mkdir $(t)
GZIP=$(GZIP) $(TAR) -C $(t) -zxf $(distdir).tar.gz
cd $(t)/$(distdir) \
&& ./configure --disable-nls \
&& $(MAKE) \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) distclean
cd $(t) && $(TAR) --diff -z -f ../$(distdir).tar.gz
-rm -rf $(t)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"

13
THANKS
View File

@@ -6,17 +6,26 @@ Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
Arne Henrik Juul: arnej@imf.unit.no
Bauke Jan Douma: bjdouma@xs4all.nl
Bengt Martensson: bengt@mathematik.uni-Bremen.de
Bjorn Helgaas: helgaas@rsn.hp.com
Charles Karney: karney@pppl.gov
Dirk Lattermann: dlatt@t-online.de
Don Parsons: dparsons@synapse.kent.edu
Eirik Fuller: eirik@netcom.com
Eli Zaretskii: eliz@is.elta.co.il
Emile LeBlanc: leblanc@math.toronto.edu
François Pinard: pinard@iro.umontreal.ca
Galen Hazelwood: galenh@micron.net
Göran Uddeborg: goeran@uddeborg.pp.se
Greg McGary: gkm@eng.ascend.com
Hugh Daniel: hugh@xanadu.com
James: james@albion.glarp.com
James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
James Tanis: jtt@soscorp.com
Jesse Thilo: jgt2@eecs.lehigh.edu
Joakim Rosqvist: dvljrt@cs.umu.se
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
Kjetil Torgrim Homme: kjetilho@ifi.uio.no
Lorne Baker: lbaker@nitro.avint.net
Marcus Daniels: marcus@sysc.pdx.edu
Mark A. Thomas: thommark@access.digex.net
Mark Harris: mark@monitor.designacc.com
@@ -27,12 +36,12 @@ Miles Bader: miles@gnu.ai.mit.edu
Noel Cragg: noel@red-bean.com
Peter Eriksson: peter@ifm.liu.se
Paul Eggert: eggert@twinsun.com
Philippe De Muyter: phdm@macqel.be
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
Santiago Vila Doncel: sanvila@ctv.es
Santiago Vila Doncel: sanvila@unex.es
Stuart Kemp: skemp@peter.bmc.com
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
Torbjorn Lindgren: tl@funcom.no
Tony Leneis: tony@plaza.ds.adp.com
Michael Veksler: mveksler@techunix.technion.ac.il
Wayne Stewart: wstewa@atl.com

View File

@@ -1,10 +1,9 @@
# Makefile.in generated automatically by automake 1.2d from Makefile.am
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -32,6 +31,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -66,12 +67,12 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
@@ -112,19 +113,19 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
all: Makefile $(INFO_DEPS)
.SUFFIXES:
.SUFFIXES: .dvi .info .ps .texi .texinfo
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
version.texi: @MAINT@stamp-vti
version.texi: stamp-vti
cp $(srcdir)/stamp-vti $(srcdir)/version.texi
stamp-vti: fileutils.texi $(top_srcdir)/configure.in
@@ -145,7 +146,7 @@ clean-vti:
distclean-vti:
maintainer-clean-vti:
-@MAINT@rm -f stamp-vti version.texi
-rm -f stamp-vti version.texi
fileutils.info: fileutils.texi version.texi
fileutils.dvi: fileutils.texi version.texi
@@ -180,26 +181,40 @@ DVIPS = dvips
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.txi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.txi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(infodir)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@for file in $(INFO_DEPS); do \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
else : ; fi; \
done; \
done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
for file in $(INFO_DEPS); do \
echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
done; \
else : ; fi
@@ -210,11 +225,11 @@ uninstall-info:
else ii=; fi; \
for file in $(INFO_DEPS); do \
test -z "$ii" \
|| install-info --info-dir=$(infodir) --remove $$file; \
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
done
$(NORMAL_UNINSTALL)
@$(NORMAL_UNINSTALL)
for file in $(INFO_DEPS); do \
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
@@ -282,12 +297,10 @@ install: install-exec install-data all
uninstall: uninstall-info
all: Makefile $(INFO_DEPS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(infodir)
$(mkinstalldirs) $(DESTDIR)$(infodir)
mostlyclean-generic:
@@ -316,11 +329,11 @@ maintainer-clean: maintainer-clean-vti maintainer-clean-aminfo \
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-vti distclean-vti clean-vti \
maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \
distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
dvi installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
.PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \
install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
clean-aminfo maintainer-clean-aminfo tags distdir info dvi installcheck \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean

View File

@@ -467,15 +467,15 @@ year.
@cindex MacKenzie, David
@cindex Meyering, Jim
@code{getdate} was originally implemented by Steven M. Bellovin
(@samp{smb@@research.att.com}) while at the University of North Carolina
(@email{smb@@research.att.com}) while at the University of North Carolina
at Chapel Hill. The code was later tweaked by a couple of people on
Usenet, then completely overhauled by Rich $alz (@samp{rsalz@@bbn.com})
and Jim Berets (@samp{jberets@@bbn.com}) in August, 1990. Various
Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
and Jim Berets (@email{jberets@@bbn.com}) in August, 1990. Various
revisions for the GNU system were made by David MacKenzie, Jim Meyering,
and others.
@cindex Pinard, F.
@cindex Berry, K.
This chapter was originally produced by Fran@,{c}ois Pinard
(@samp{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
and then edited by K.@: Berry (@samp{kb@@cs.umb.edu}).
(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).

View File

@@ -166,7 +166,7 @@ The GNU shell utilities are mostly compatible with the POSIX.2 standard.
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
@c sh-utils.texi too -- so be sure to keep them consistent.
@cindex bugs, reporting
Please report bugs to @samp{sh-utils-bugs@@gnu.ai.mit.edu}. Remember
Please report bugs to @samp{sh-utils-bugs@@gnu.org}. Remember
to include the version number, machine architecture, input files, and
any other information needed to reproduce the bug: your input, what you
expected, what you got, and why it is wrong. Diffs are welcome, but
@@ -1140,15 +1140,16 @@ The only options are a lone @samp{--help} or
Synopses:
@example
stty [@var{setting}]@dots{}
stty [@var{option}] [@var{setting}]@dots{}
stty [@var{option}]
@end example
If given no arguments, @code{stty} prints the baud rate, line
If given no line settings, @code{stty} prints the baud rate, line
discipline number (on systems that support it), and line settings
that have been changed from the values set by @samp{stty sane}.
Mode reading and setting are performed on the tty line connected to
standard input.
By default, mode reading and setting are performed on the tty line
connected to standard input, although this can be modified by the
@samp{--file} option.
@code{stty} accepts many non-option arguments that change aspects of
the terminal line operation, as described below.
@@ -1160,7 +1161,19 @@ The program accepts the following options. Also see @ref{Common options}.
@itemx --all
@opindex -a
@opindex --all
Print all current settings in human-readable form.
Print all current settings in human-readable form. This option may not
be used in combination with any line settings.
@item -F @var{device}
@itemx --file @var{device}
@opindex -F
@opindex --file
Set the line opened by the filename specified in @var{device} instead of
the tty line connected to standard input. This option is necessary
because opening a POSIX tty requires use of the @code{O_NONDELAY} flag to
prevent a POSIX tty from blocking until the carrier detect line is high if
the @code{clocal} flag is not set. Hence, it is not always possible
to allow the shell to open the device in the traditional manner.
@item -g
@itemx --save
@@ -1168,7 +1181,8 @@ Print all current settings in human-readable form.
@opindex --save
@cindex machine-readable @code{stty} output
Print all current settings in a form that can be used as an argument to
another @code{stty} command to restore the current settings.
another @code{stty} command to restore the current settings. This option
may not be used in combination with any line settings.
@end table

View File

@@ -1,32 +1,56 @@
%% TeX macros to handle Texinfo files.
%% $Id: texinfo.tex,v 1.16 1997/12/25 18:00:21 meyering Exp $
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 96, 97 Free Software Foundation, Inc.
%This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%Boston, MA 02111-1307, USA.
%In other words, you are welcome to use, share and improve this program.
%You are forbidden to forbid anyone else to use, share and improve
%what you give them. Help stamp out software-hoarding!
% Send bug reports to bug-texinfo@prep.ai.mit.edu.
% Please include a *precise* test case in each bug report.
% texinfo.tex -- TeX macros to handle Texinfo files.
% $Id: texinfo.tex,v 1.17 1998/04/11 15:03:51 meyering Exp $
%
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
% Free Software Foundation, Inc.
%
% This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
%
% In other words, you are welcome to use, share and improve this program.
% You are forbidden to forbid anyone else to use, share and improve
% what you give them. Help stamp out software-hoarding!
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
% (and all GNU mirrors)
% ftp://tug.org/tex/texinfo.tex
% ftp://ctan.org/macros/texinfo/texinfo.tex
% (and all CTAN mirrors, finger ctan@tug.org for a list).
%
% Send bug reports to bug-texinfo@gnu.org.
% Please include a precise test case in each bug report,
% including a complete document with which we can reproduce the problem.
%
% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
% have to run makeinfo -E to expand macros first; the texi2dvi script
% does this.
%
% To process a Texinfo manual with TeX, it's most reliable to use the
% texi2dvi shell script that comes with the distribution. For simple
% manuals, you can get away with:
% tex foo.texi
% texindex foo.??
% tex foo.texi
% tex foo.texi
% dvips foo.dvi -o # or whatever, to process the dvi file.
% The extra runs of TeX get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
% Make it possible to create a .fmt file just by loading this file:
@@ -36,7 +60,7 @@
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 1.16 $
\deftexinfoversion$Revision: 1.17 $
\message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number
@@ -54,24 +78,17 @@
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
\let\ptexequiv = \equiv
\let\ptexequiv=\equiv
\let\ptexexclam=\!
\let\ptexi=\i
\let\ptexlbrace=\{
\let\ptexrbrace=\}
\let\ptexstar=\*
\let\ptext=\t
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
% Avoid using \@M directly, because that causes trouble
% if the definition is written into an index file.
\global\let\tiepenalty = \@M
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
% We never want plain's outer \+ definition in Texinfo.
% For @tex, we can use \tabalign.
\let\+ = \relax
\message{Basics,}
@@ -384,7 +401,7 @@
% @@ prints an @
% Kludge this until the fonts are right (grr).
\def\@{{\tt \char '100}}
\def\@{{\tt\char64}}
% This is turned off because it was never documented
% and you can use @w{...} around a quote to suppress ligatures.
@@ -394,8 +411,8 @@
%\def\'{{'}}
% Used to generate quoted braces.
\def\mylbrace {{\tt \char '173}}
\def\myrbrace {{\tt \char '175}}
\def\mylbrace {{\tt\char123}}
\def\myrbrace {{\tt\char125}}
\let\{=\mylbrace
\let\}=\myrbrace
\begingroup
@@ -432,6 +449,18 @@
\fi\fi
}
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
% Avoid using \@M directly, because that causes trouble
% if the definition is written into an index file.
\global\let\tiepenalty = \@M
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
@@ -763,6 +792,7 @@ where each line of input produces a line of output.}
% Also ignore @macro ... @end macro. The user must run texi2dvi,
% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
\def\macro{\doignore{macro}}
\def\macrocsname{macro}
\let\unmacro = \comment
@@ -777,7 +807,9 @@ where each line of input produces a line of output.}
\ignoresections
%
% Define a command to swallow text until we reach `@end #1'.
\long\def\doignoretext##1\end #1{\enddoignore}%
% This @ is a catcode 12 token (that is the normal catcode of @ in
% this texinfo.tex file). We change the catcode of @ below to match.
\long\def\doignoretext##1@end #1{\enddoignore}%
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10
@@ -786,6 +818,22 @@ where each line of input produces a line of output.}
\catcode`\{ = 9
\catcode`\} = 9
%
% We must not have @c interpreted as a control sequence.
\catcode`\@ = 12
%
% Make the letter c a comment character so that the rest of the line
% will be ignored. This way, the document can have (for example)
% @c @end ifinfo
% and the @end ifinfo will be properly ignored.
% (We've just changed @ to catcode 12.)
%
% But we can't do this if #1 is `macro', since that actually contains a c.
% Happily, none of the other conditionals have the letter `c' in their names!
\def\temp{#1}%
\ifx\temp\macrocsname \else
\catcode`\c = 14
\fi
%
% And now expand that command.
\doignoretext
}
@@ -1278,6 +1326,10 @@ where each line of input produces a line of output.}
%
\textfonts
% Define these so they can be easily changed for other fonts.
\def\angleleft{$\langle$}
\def\angleright{$\rangle$}
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
@@ -1315,15 +1367,15 @@ where each line of input produces a line of output.}
\null
}
\let\ttfont=\t
\def\samp #1{`\tclose{#1}'\null}
\def\samp#1{`\tclose{#1}'\null}
\setfont\smallrm\rmshape{8}{1000}
\font\smallsy=cmsy9
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
\raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
\hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
\kern-0.4pt\hrule}%
\kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
\kern-.06em\raise0.4pt\hbox{\angleright}}}}
% The old definition, with no lozenge:
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
@@ -1436,7 +1488,7 @@ where each line of input produces a line of output.}
% rms does not like the angle brackets --karl, 17may97.
% So now @email is just like @uref.
%\def\email#1{$\langle${\tt #1}$\rangle$}
%\def\email#1{\angleleft{\tt #1}\angleright}
\let\email=\uref
% Check if we are currently using a typewriter font. Since all the
@@ -1689,18 +1741,6 @@ July\or August\or September\or October\or November\or December\fi
\message{tables,}
% @tabs -- simple alignment
% These don't work. For one thing, \+ is defined as outer.
% So these macros cannot even be defined.
%\def\tabs{\parsearg\tabszzz}
%\def\tabszzz #1{\settabs\+#1\cr}
%\def\tabline{\parsearg\tablinezzz}
%\def\tablinezzz #1{\+#1\cr}
%\def\&{&}
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
% default indentation of table text
@@ -2058,10 +2098,7 @@ July\or August\or September\or October\or November\or December\fi
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
%%%%
% Dimensions
%
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
@@ -2071,15 +2108,15 @@ July\or August\or September\or October\or November\or December\fi
\multitablecolspace=12pt
\multitablelinespace=0pt
%%%%
% Macros used to set up halign preamble:
%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
%% 2/1/96, to allow fractions to be given with more than one digit.
% 2/1/96, to allow fractions to be given with more than one digit.
\def\pickupwholefraction#1 {\global\advance\colcount by1 %
\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
\setuptable}
@@ -2105,80 +2142,84 @@ July\or August\or September\or October\or November\or December\fi
\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
\fi\go}
%%%%
% multitable syntax
\def\tab{&\hskip1sp\relax} % 2/2/96
% tiny skip here makes sure this column space is
% maintained, even if it is never used.
%%%%
% @multitable ... @end multitable definitions:
\def\multitable{\parsearg\dotable}
\def\dotable#1{\bgroup
\let\item\cr
\tolerance=9500
\hbadness=9500
\setmultitablespacing
\parskip=\multitableparskip
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0\relax%
\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
% To parse everything between @multitable and @item :
\setuptable#1 \endsetuptable
% Need to reset this to 0 after \setuptable.
\global\colcount=0\relax%
%
% This preamble sets up a generic column definition, which will
% be used as many times as user calls for columns.
% \vtop will set a single line and will also let text wrap and
% continue for many paragraphs if desired.
\halign\bgroup&\global\advance\colcount by 1\relax%
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
% In order to keep entries from bumping into each other
% we will add a \leftskip of \multitablecolspace to all columns after
% the first one.
% If a template has been used, we will add \multitablecolspace
% to the width of each template entry.
% If user has set preamble in terms of percent of \hsize
% we will use that dimension as the width of the column, and
% the \leftskip will keep entries from bumping into each other.
% Table will start at left margin and final column will justify at
% right margin.
\ifnum\colcount=1
\else
\ifsetpercent
\vskip\parskip
\let\item\crcr
\tolerance=9500
\hbadness=9500
\setmultitablespacing
\parskip=\multitableparskip
\parindent=\multitableparindent
\overfullrule=0pt
\global\colcount=0
\def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
%
% \everycr will reset column counter, \colcount, at the end of
% each line. Every column entry will cause \colcount to advance by one.
% The table preamble
% looks at the current \colcount to find the correct column width.
\everycr{\noalign{%
%
% \filbreak%% keeps underfull box messages off when table breaks over pages.
% Maybe so, but it also creates really weird page breaks when the table
% breaks over pages. Wouldn't \vfil be better? Wait until the problem
% manifests itself, so it can be fixed for real --karl.
\global\colcount=0\relax}}%
%
% This preamble sets up a generic column definition, which will
% be used as many times as user calls for columns.
% \vtop will set a single line and will also let text wrap and
% continue for many paragraphs if desired.
\halign\bgroup&\global\advance\colcount by 1\relax
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
%
% In order to keep entries from bumping into each other
% we will add a \leftskip of \multitablecolspace to all columns after
% the first one.
%
% If a template has been used, we will add \multitablecolspace
% to the width of each template entry.
%
% If the user has set preamble in terms of percent of \hsize we will
% use that dimension as the width of the column, and the \leftskip
% will keep entries from bumping into each other. Table will start at
% left margin and final column will justify at right margin.
%
% Make sure we don't inherit \rightskip from the outer environment.
\rightskip=0pt
\ifnum\colcount=1
% The first column will be indented with the surrounding text.
\advance\hsize by\leftskip
\else
% If user has <not> set preamble in terms of percent of \hsize
% we will advance \hsize by \multitablecolspace
\advance\hsize by \multitablecolspace
\ifsetpercent \else
% If user has not set preamble in terms of percent of \hsize
% we will advance \hsize by \multitablecolspace.
\advance\hsize by \multitablecolspace
\fi
% In either case we will make \leftskip=\multitablecolspace:
\leftskip=\multitablecolspace
\fi
% In either case we will make \leftskip=\multitablecolspace:
\leftskip=\multitablecolspace
\fi
% Ignoring space at the beginning and end avoids an occasional spurious
% blank line, when TeX decides to break the line at the space before the
% box from the multistrut, so the strut ends up on a line by itself.
% For example:
% @multitable @columnfractions .11 .89
% @item @code{#}
% @tab Legal holiday which is valid in major parts of the whole country.
% Is automatically provided with highlighting sequences respectively marking
% characters.
\noindent\ignorespaces##\unskip\multistrut}\cr
% \everycr will reset column counter, \colcount, at the end of
% each line. Every column entry will cause \colcount to advance by one.
% The table preamble
% looks at the current \colcount to find the correct column width.
\global\everycr{\noalign{%
% \filbreak%% keeps underfull box messages off when table breaks over pages.
% Maybe so, but it also creates really weird page breaks when the table
% breaks over pages Wouldn't \vfil be better? Wait until the problem
% manifests itself, so it can be fixed for real --karl.
\global\colcount=0\relax}}
% Ignoring space at the beginning and end avoids an occasional spurious
% blank line, when TeX decides to break the line at the space before the
% box from the multistrut, so the strut ends up on a line by itself.
% For example:
% @multitable @columnfractions .11 .89
% @item @code{#}
% @tab Legal holiday which is valid in major parts of the whole country.
% Is automatically provided with highlighting sequences respectively marking
% characters.
\noindent\ignorespaces##\unskip\multistrut}\cr
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
@@ -2246,20 +2287,24 @@ width0pt\relax} \fi
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
\def\synindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\doindex {#2}}%
% The \closeout helps reduce unnecessary open files; the limit on the
% Acorn RISC OS is a mere 16 files.
\def\synindex#1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\closeout\csname#1indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
\noexpand\doindex{#2}}%
}
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
\def\syncodeindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\docodeindex {#2}}%
\def\syncodeindex#1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\closeout\csname#1indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
\noexpand\docodeindex{#2}}%
}
% Define \doindex, the driver for all \fooindex macros.
@@ -2525,6 +2570,11 @@ width0pt\relax} \fi
\indexbreaks
%
% See if the index file exists and is nonempty.
% Change catcode of @ here so that if the index file contains
% \initial {@}
% as its first line, TeX doesn't complain about mismatched braces
% (because it thinks @} is a control sequence).
\catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
@@ -2546,7 +2596,6 @@ width0pt\relax} \fi
% to make right now.
\def\indexbackslash{\rawbackslashxx}%
\catcode`\\ = 0
\catcode`\@ = 11
\escapechar = `\\
\begindoublecolumns
\input \jobname.#1s
@@ -3442,11 +3491,12 @@ width0pt\relax} \fi
% the index entries, but we want to suppress hyphenation here. (We
% can't do that in the \entry macro, since index entries might consist
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
%
% \turnoffactive is for the sake of @" used for umlauts.
\def\tocentry#1#2{\begingroup
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
\entry{\turnoffactive #1}{\turnoffactive #2}%
% Do not use \turnoffactive in these arguments. Since the toc is
% typeset in cmr, so characters such as _ would come out wrong; we
% have to do the usual translation tricks.
\entry{#1}{#2}%
\endgroup}
% Space between chapter (or whatever) number and the title.
@@ -3512,30 +3562,36 @@ width0pt\relax} \fi
% But \@ or @@ will get a plain tex @ character.
\def\tex{\begingroup
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
\catcode `\%=14
\catcode 43=12 % plus
\catcode`\"=12
\catcode`\==12
\catcode`\|=12
\catcode`\<=12
\catcode`\>=12
\escapechar=`\\
%
\let\,=\ptexcomma
\let\{=\ptexlbrace
\let\}=\ptexrbrace
\let\.=\ptexdot
\let\*=\ptexstar
\let\dots=\ptexdots
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
\def\@{@}%
\let\bullet=\ptexbullet
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
%
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
\catcode `\%=14
\catcode 43=12 % plus
\catcode`\"=12
\catcode`\==12
\catcode`\|=12
\catcode`\<=12
\catcode`\>=12
\escapechar=`\\
%
\let\b=\ptexb
\let\bullet=\ptexbullet
\let\c=\ptexc
\let\,=\ptexcomma
\let\.=\ptexdot
\let\dots=\ptexdots
\let\equiv=\ptexequiv
\let\!=\ptexexclam
\let\i=\ptexi
\let\{=\ptexlbrace
\let\+=\tabalign
\let\}=\ptexrbrace
\let\*=\ptexstar
\let\t=\ptext
%
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
\def\@{@}%
\let\Etex=\endgroup}
% Define @lisp ... @endlisp.
@@ -3580,8 +3636,8 @@ width0pt\relax} \fi
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
\let\nonarrowing=\relax
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \cartouche: draw rectangle w/rounded corners around argument
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
\font\circle=lcircle10
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
@@ -3608,9 +3664,9 @@ width0pt\relax} \fi
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
\advance\cartouter by 18pt % allow for 3pt kerns on either
\advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
% each corner char
% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
% Flag to tell @lisp, etc., not to narrow margin.
\let\nonarrowing=\comment
@@ -4246,18 +4302,17 @@ width0pt\relax} \fi
\message{cross reference,}
% Define cross-reference macros
\newwrite \auxfile
\newwrite\auxfile
\newif\ifhavexrefs % True if xref values are known.
\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
% @inforef is simple.
% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
% \setref{foo} defines a cross-reference point named foo.
% @setref{foo} defines a cross-reference point named foo.
\def\setref#1{%
\dosetq{#1-title}{Ytitle}%
@@ -4325,7 +4380,7 @@ width0pt\relax} \fi
% into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg.
{\turnoffactive \refx{#1-snt}{}}%
{\normalturnoffactive \refx{#1-snt}{}}%
\space [\printednodename],\space
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
\fi
@@ -4333,11 +4388,15 @@ width0pt\relax} \fi
% \dosetq is the interface for calls from other macros
% Use \turnoffactive so that punctuation chars such as underscore
% work in node names.
\def\dosetq #1#2{{\let\folio=0 \turnoffactive
\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
\next}}
% Use \normalturnoffactive so that punctuation chars such as underscore
% and backslash work in node names. (\turnoffactive doesn't do \.)
\def\dosetq#1#2{%
{\let\folio=0
\normalturnoffactive
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
\next
}%
}
% \internalsetq {foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
@@ -4388,7 +4447,7 @@ width0pt\relax} \fi
\def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
$\langle$un\-de\-fined$\rangle$%
\angleleft un\-de\-fined\angleright
\ifhavexrefs
\message{\linenumber Undefined cross reference `#1'.}%
\else
@@ -4405,10 +4464,13 @@ width0pt\relax} \fi
}
% This is the macro invoked by entries in the aux file.
\def\xrdef #1#2{{%
\catcode`\'=\other
\expandafter\gdef\csname X#1\endcsname{#2}%
}}
%
\def\xrdef#1{\begingroup
% Reenable \ as an escape while reading the second argument.
\catcode`\\ = 0
\afterassignment\endgroup
\expandafter\gdef\csname X#1\endcsname
}
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
@@ -4465,8 +4527,7 @@ width0pt\relax} \fi
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
% `\+ does not work, so use 43.
\catcode43=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
% Make the characters 128-255 be printing characters
{%
\count 1=128
@@ -4837,10 +4898,10 @@ width0pt\relax} \fi
% use math or other variants that look better in normal text.
\catcode`\"=\active
\def\activedoublequote{{\tt \char '042}}
\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active
\def~{{\tt \char '176}}
\def~{{\tt\char126}}
\chardef\hat=`\^
\catcode`\^=\active
\def^{{\tt \hat}}
@@ -4851,7 +4912,7 @@ width0pt\relax} \fi
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
\catcode`\|=\active
\def|{{\tt \char '174}}
\def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active
\def<{{\tt \less}}
@@ -4938,8 +4999,8 @@ width0pt\relax} \fi
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
@catcode`+=@active @catcode`@_=@active}
%% These look ok in all fonts, so just make them not special. The @rm below
%% makes sure that the current font starts out as the newly loaded cmr10
% These look ok in all fonts, so just make them not special. The @rm below
% makes sure that the current font starts out as the newly loaded cmr10
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
@textfonts

View File

@@ -142,7 +142,7 @@ The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
@c sh-utils.texi too -- so be sure to keep them consistent.
@cindex bugs, reporting
Please report bugs to @samp{textutils-bugs@@gnu.ai.mit.edu}. Remember
Please report bugs to @email{textutils-bugs@@gnu.org}. Remember
to include the version number, machine architecture, input files, and
any other information needed to reproduce the bug: your input, what you
expected, what you got, and why it is wrong. Diffs are welcome, but
@@ -2696,6 +2696,24 @@ Convert each sequence of repeated newlines to a single newline:
tr -s '\n'
@end example
@item
Find doubled occurrences of words in a document.
For example, people often write ``the the'' with the duplicated words
separated by a newline. The bourne shell script below works first
by converting each sequence of punctuation and blank characters to a
single newline. That puts each ``word'' on a line by itself.
Next it maps all uppercase characters to lower case, and finally it
runs @code{uniq} with the @samp{-d} option to print out only the words
that were adjacent duplicates.
@example
#!/bin/sh
cat "$@@" \
| tr -s '[:punct:][:blank:]' '\n' \
| tr '[:upper:]' '[:lower:]' \
| uniq -d
@end example
@end itemize

View File

@@ -4,24 +4,24 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
noinst_LIBRARIES = libfu.a
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
realloc.c stat.c strftime.c
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c dirname.c exclude.c filemode.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
xalloc.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c

View File

@@ -1,10 +1,9 @@
# Makefile.in generated automatically by automake 1.2d from Makefile.am
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@@ -32,6 +31,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -66,12 +67,12 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
@@ -92,25 +93,25 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
noinst_LIBRARIES = libfu.a
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
realloc.c stat.c strftime.c
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c dirname.c exclude.c filemode.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h lchown.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
quotearg.h regex.h safe-read.h save-cwd.h savedir.h strverscmp.h \
xalloc.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -125,11 +126,12 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../src/ansi2knr
libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
addext$U.o argmatch$U.o backupfile$U.o basename$U.o dirname$U.o \
exclude$U.o filemode$U.o full-write$U.o human$U.o idcache$U.o isdir$U.o \
long-options$U.o makepath$U.o modechange$U.o hash$U.o path-concat$U.o \
safe-read$U.o save-cwd$U.o savedir$U.o stripslash$U.o userspec$U.o \
xgetcwd$U.o xmalloc$U.o xstrdup$U.o xstrtol$U.o xstrtoul$U.o yesno$U.o
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
hash$U.o path-concat$U.o quotearg$U.o safe-read$U.o save-cwd$U.o \
savedir$U.o stripslash$U.o userspec$U.o xgetcwd$U.o xmalloc$U.o \
xstrdup$U.o xstrtol$U.o xstrtoul$U.o yesno$U.o
AR = ar
YLWRAP = $(srcdir)/ylwrap
CFLAGS = @CFLAGS@
@@ -137,13 +139,13 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS)
DIST_COMMON = Makefile.am Makefile.in alloca.c chown.c error.c error.h \
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
getgroups.c getline.c group-member.c lstat.c malloc.c memcmp.c memcpy.c \
memset.c mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c \
realloc.c regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c \
stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \
strtoul.c strverscmp.c ylwrap
DIST_COMMON = Makefile.am Makefile.in TODO alloca.c chown.c error.c \
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
getdate.c getgroups.c getline.c group-member.c lchown.c lstat.c \
malloc.c memcmp.c memcpy.c memset.c mkdir.c mktime.c mountlist.c \
obstack.c obstack.h posixtm.c realloc.c regex.c rename.c rmdir.c \
rpmatch.c stat.c stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c \
strstr.c strtol.c strtoul.c strverscmp.c utime.c ylwrap
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -151,34 +153,35 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/dirname.P \
.deps/error.P .deps/euidaccess.P .deps/exclude.P .deps/fileblocks.P \
.deps/filemode.P .deps/fnmatch.P .deps/fsusage.P .deps/ftruncate.P \
.deps/full-write.P .deps/getdate.P .deps/getgroups.P .deps/getline.P \
.deps/getopt.P .deps/getopt1.P .deps/group-member.P .deps/hash.P \
.deps/human.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
.deps/lstat.P .deps/makepath.P .deps/malloc.P .deps/memcmp.P \
.deps/memcpy.P .deps/memset.P .deps/mkdir.P .deps/mktime.P \
.deps/modechange.P .deps/mountlist.P .deps/obstack.P \
.deps/path-concat.P .deps/posixtm.P .deps/realloc.P .deps/regex.P \
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \
.deps/stpcpy.P .deps/strcasecmp.P .deps/strdup.P .deps/strftime.P \
.deps/stripslash.P .deps/strndup.P .deps/strstr.P .deps/strtol.P \
.deps/strtoul.P .deps/strverscmp.P .deps/userspec.P .deps/xgetcwd.P \
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/closeout.P \
.deps/dirname.P .deps/error.P .deps/euidaccess.P .deps/exclude.P \
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
.deps/ftruncate.P .deps/full-write.P .deps/getdate .deps/getdate.P \
.deps/getgroups.P .deps/getline.P .deps/getopt.P .deps/getopt1.P \
.deps/group-member.P .deps/hash.P .deps/human.P .deps/idcache.P \
.deps/isdir.P .deps/lchown.P .deps/long-options.P .deps/lstat.P \
.deps/makepath.P .deps/malloc.P .deps/memcmp.P .deps/memcpy.P \
.deps/memset.P .deps/mkdir.P .deps/mktime.P .deps/modechange.P \
.deps/mountlist.P .deps/obstack.P .deps/path-concat.P .deps/posixtm \
.deps/posixtm.P .deps/quotearg.P .deps/realloc.P .deps/regex.P \
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/safe-read.P \
.deps/save-cwd.P .deps/savedir.P .deps/stat.P .deps/stpcpy.P \
.deps/strcasecmp.P .deps/strdup.P .deps/strftime.P .deps/stripslash.P \
.deps/strndup.P .deps/strstr.P .deps/strtol.P .deps/strtoul.P \
.deps/strverscmp.P .deps/userspec.P .deps/utime.P .deps/xgetcwd.P \
.deps/xmalloc.P .deps/xstrdup.P .deps/xstrtol.P .deps/xstrtoul.P \
.deps/yesno.P
SOURCES = $(libfu_a_SOURCES)
OBJECTS = $(libfu_a_OBJECTS)
default: all
all: Makefile $(LIBRARIES) $(HEADERS)
.SUFFIXES:
.SUFFIXES: .S .c .h .o .s .y
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
.SUFFIXES: .S .c .o .s .y
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -192,9 +195,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
@@ -202,7 +202,7 @@ maintainer-clean-noinstLIBRARIES:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core
-rm -f *.o core *.core
clean-compile:
@@ -213,6 +213,9 @@ maintainer-clean-compile:
../src/ansi2knr: ../src/ansi2knr.o
cd ../src && $(MAKE) ansi2knr
../src/ansi2knr.o:
cd ../src && $(MAKE) ansi2knr.o
mostlyclean-kr:
-rm -f *_.c
@@ -229,76 +232,161 @@ libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
$(RANLIB) libfu.a
.y.c:
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
.y.h:
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
posixtm.h: posixtm.c
getdate.h: getdate.c
addext_.c: addext.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` addext_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | $(ANSI2KNR) > addext_.c
alloca_.c: alloca.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | $(ANSI2KNR) > alloca_.c
argmatch_.c: argmatch.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` argmatch_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | $(ANSI2KNR) > argmatch_.c
backupfile_.c: backupfile.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` backupfile_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | $(ANSI2KNR) > backupfile_.c
basename_.c: basename.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` basename_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | $(ANSI2KNR) > basename_.c
chown_.c: chown.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | $(ANSI2KNR) > chown_.c
closeout_.c: closeout.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | $(ANSI2KNR) > closeout_.c
dirname_.c: dirname.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` dirname_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | $(ANSI2KNR) > dirname_.c
error_.c: error.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | $(ANSI2KNR) > error_.c
euidaccess_.c: euidaccess.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` | $(ANSI2KNR) > euidaccess_.c
exclude_.c: exclude.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` exclude_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | $(ANSI2KNR) > exclude_.c
fileblocks_.c: fileblocks.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | $(ANSI2KNR) > fileblocks_.c
filemode_.c: filemode.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` filemode_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` | $(ANSI2KNR) > filemode_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | $(ANSI2KNR) > fnmatch_.c
fsusage_.c: fsusage.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` | $(ANSI2KNR) > fsusage_.c
ftruncate_.c: ftruncate.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` | $(ANSI2KNR) > ftruncate_.c
full-write_.c: full-write.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` full-write_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` | $(ANSI2KNR) > full-write_.c
getdate_.c: getdate.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` getdate_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | $(ANSI2KNR) > getdate_.c
getgroups_.c: getgroups.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | $(ANSI2KNR) > getgroups_.c
getline_.c: getline.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | $(ANSI2KNR) > getline_.c
getopt_.c: getopt.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` getopt_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | $(ANSI2KNR) > getopt_.c
getopt1_.c: getopt1.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` getopt1_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | $(ANSI2KNR) > getopt1_.c
group-member_.c: group-member.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | $(ANSI2KNR) > group-member_.c
hash_.c: hash.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` hash_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | $(ANSI2KNR) > hash_.c
human_.c: human.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` human_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | $(ANSI2KNR) > human_.c
idcache_.c: idcache.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` idcache_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | $(ANSI2KNR) > idcache_.c
isdir_.c: isdir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` isdir_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | $(ANSI2KNR) > isdir_.c
lchown_.c: lchown.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | $(ANSI2KNR) > lchown_.c
long-options_.c: long-options.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` long-options_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | $(ANSI2KNR) > long-options_.c
lstat_.c: lstat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | $(ANSI2KNR) > lstat_.c
makepath_.c: makepath.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` makepath_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | $(ANSI2KNR) > makepath_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | $(ANSI2KNR) > malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | $(ANSI2KNR) > memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | $(ANSI2KNR) > memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | $(ANSI2KNR) > memset_.c
mkdir_.c: mkdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` | $(ANSI2KNR) > mkdir_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | $(ANSI2KNR) > mktime_.c
modechange_.c: modechange.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` modechange_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | $(ANSI2KNR) > modechange_.c
mountlist_.c: mountlist.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` | $(ANSI2KNR) > mountlist_.c
obstack_.c: obstack.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | $(ANSI2KNR) > obstack_.c
path-concat_.c: path-concat.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` path-concat_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | $(ANSI2KNR) > path-concat_.c
posixtm_.c: posixtm.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` posixtm_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | $(ANSI2KNR) > posixtm_.c
quotearg_.c: quotearg.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | $(ANSI2KNR) > quotearg_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | $(ANSI2KNR) > realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | $(ANSI2KNR) > regex_.c
rename_.c: rename.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | $(ANSI2KNR) > rename_.c
rmdir_.c: rmdir.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | $(ANSI2KNR) > rmdir_.c
rpmatch_.c: rpmatch.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | $(ANSI2KNR) > rpmatch_.c
safe-read_.c: safe-read.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` safe-read_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` | $(ANSI2KNR) > safe-read_.c
save-cwd_.c: save-cwd.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` save-cwd_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | $(ANSI2KNR) > save-cwd_.c
savedir_.c: savedir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` savedir_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | $(ANSI2KNR) > savedir_.c
stat_.c: stat.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | $(ANSI2KNR) > stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | $(ANSI2KNR) > stpcpy_.c
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | $(ANSI2KNR) > strcasecmp_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | $(ANSI2KNR) > strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | $(ANSI2KNR) > strftime_.c
stripslash_.c: stripslash.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` stripslash_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` | $(ANSI2KNR) > stripslash_.c
strndup_.c: strndup.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | $(ANSI2KNR) > strndup_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | $(ANSI2KNR) > strstr_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | $(ANSI2KNR) > strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | $(ANSI2KNR) > strtoul_.c
strverscmp_.c: strverscmp.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | $(ANSI2KNR) > strverscmp_.c
userspec_.c: userspec.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` userspec_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | $(ANSI2KNR) > userspec_.c
utime_.c: utime.c $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/utime.c; then echo $(srcdir)/utime.c; else echo utime.c; fi` | $(ANSI2KNR) > utime_.c
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` xgetcwd_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | $(ANSI2KNR) > xgetcwd_.c
xmalloc_.c: xmalloc.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` xmalloc_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | $(ANSI2KNR) > xmalloc_.c
xstrdup_.c: xstrdup.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` xstrdup_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | $(ANSI2KNR) > xstrdup_.c
xstrtol_.c: xstrtol.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` xstrtol_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | $(ANSI2KNR) > xstrtol_.c
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` xstrtoul_.c
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | $(ANSI2KNR) > xstrtoul_.c
yesno_.c: yesno.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` yesno_.c
addext_.o argmatch_.o backupfile_.o basename_.o dirname_.o exclude_.o \
filemode_.o full-write_.o getdate_.o getopt_.o getopt1_.o hash_.o \
human_.o idcache_.o isdir_.o long-options_.o makepath_.o modechange_.o \
path-concat_.o posixtm_.o safe-read_.o save-cwd_.o savedir_.o \
stripslash_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
xstrtoul_.o yesno_.o : $(ANSI2KNR)
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | $(ANSI2KNR) > yesno_.c
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
closeout_.o dirname_.o error_.o euidaccess_.o exclude_.o fileblocks_.o \
filemode_.o fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
getgroups_.o getline_.o getopt_.o getopt1_.o group-member_.o hash_.o \
human_.o idcache_.o isdir_.o lchown_.o long-options_.o lstat_.o \
makepath_.o malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
quotearg_.o realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o \
safe-read_.o save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o \
strdup_.o strftime_.o stripslash_.o strndup_.o strstr_.o strtol_.o \
strtoul_.o strverscmp_.o userspec_.o utime_.o xgetcwd_.o xmalloc_.o \
xstrdup_.o xstrtol_.o xstrtoul_.o yesno_.o : $(ANSI2KNR)
tags: TAGS
@@ -309,8 +397,12 @@ ID: $(HEADERS) $(SOURCES) $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) $(LISP) -o $$here/TAGS)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
@@ -338,14 +430,9 @@ distdir: $(DISTFILES)
|| cp -p $$d/$$file $(distdir)/$$file; \
done
MKDEP = $(CC) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include $(DEP_FILES)
-include .deps/.P
.deps/.P: $(BUILT_SOURCES)
echo > $@
mostlyclean-depend:
@@ -356,13 +443,16 @@ distclean-depend:
maintainer-clean-depend:
-rm -rf .deps
.deps/%.P: %.c
@echo "Computing dependencies for $<..."
@o='o'; \
test -n "$o" && o='$$o'; \
$(MKDEP) $< >$@.tmp \
&& sed "s,^\(.*\)\.o:,\1.$$o \1.l$$o $@:," < $@.tmp > $@ \
&& rm -f $@.tmp
%.o: %.c
@echo '$(COMPILE) -c $<'; \
$(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
< .deps/$(*F).p > .deps/$(*F).P
@-rm -f .deps/$(*F).p
info:
dvi:
check: all
@@ -379,8 +469,6 @@ install: install-exec install-data all
uninstall:
all: Makefile $(LIBRARIES) $(HEADERS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
@@ -418,7 +506,7 @@ maintainer-clean: maintainer-clean-noinstLIBRARIES \
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \

32
lib/TODO Normal file
View File

@@ -0,0 +1,32 @@
Things to do to hash.c:
Always use curly braces around statements in if/else/while/do/etc.
that span more than a line -- even around multiline simple statements
or single-line simple statements preceded by a comment line.
Never have lines longer than 80 chars.
Remove ^L characters. We don't want/need such crutches.
Get a good (smart) pagination filter. I have one (a perl script)
that usually does a decent job for me -- I called it something
like stdc-print and think I sent you an early verison.
I don't like the name `cursor'. I much prefer short names
like `p' for index variables. I doubt I'll change all of them,
but thought you should know why some will probably end up changing.
#define USE_OBSTACK somewhere
Fix this comment. Depending on system and application...
Mention fragmentation.
+#if USE_OBSTACK
+ /* Whenever obstacks are used, it is possible to allocate all overflowed
+ entries into a single stack, so they all can be freed in a single
+ operation. It is not clear if the speedup is worth the trouble. */
+ struct obstack entry_stack;
+#endif
assert (bucket_limit - bucket == n_buckets) ?
remove.c: s/done/successful or ok

View File

@@ -22,11 +22,11 @@
your main control loop, etc. to force garbage collection. */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#ifdef emacs
#include "blockinput.h"
# include "blockinput.h"
#endif
/* If compiling with GCC 2, this file's not needed. */
@@ -34,39 +34,41 @@
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
#ifndef alloca
# ifndef alloca
#ifdef emacs
#ifdef static
# ifdef emacs
# ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
# ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif /* static */
#endif /* emacs */
# endif /* STACK_DIRECTION undefined */
# endif /* static */
# endif /* emacs */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
#else
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
# else
# define ADDRESS_FUNCTION(arg) &(arg)
# endif
#if __STDC__
# if __STDC__
typedef void *pointer;
#else
# else
typedef char *pointer;
#endif
# endif
#define NULL 0
# ifndef NULL
# define NULL 0
# endif
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc, because
@@ -78,9 +80,9 @@ typedef char *pointer;
Callers below should use malloc. */
#ifndef emacs
#define malloc xmalloc
#endif
# ifndef emacs
# define malloc xmalloc
# endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
@@ -91,18 +93,18 @@ extern pointer malloc ();
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* Direction unknown. */
#endif
# ifndef STACK_DIRECTION
# define STACK_DIRECTION 0 /* Direction unknown. */
# endif
#if STACK_DIRECTION != 0
# if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
#else /* STACK_DIRECTION == 0; need run-time code. */
# else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
#define STACK_DIR stack_dir
# define STACK_DIR stack_dir
static void
find_stack_direction ()
@@ -126,7 +128,7 @@ find_stack_direction ()
}
}
#endif /* STACK_DIRECTION == 0 */
# endif /* STACK_DIRECTION == 0 */
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
@@ -135,9 +137,9 @@ find_stack_direction ()
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#endif
# ifndef ALIGN_SIZE
# define ALIGN_SIZE sizeof(double)
# endif
typedef union hdr
{
@@ -165,20 +167,20 @@ alloca (size)
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#if STACK_DIRECTION == 0
# if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
#endif
# endif
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
#ifdef emacs
# ifdef emacs
BLOCK_INPUT;
#endif
# endif
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
@@ -195,9 +197,9 @@ alloca (size)
last_alloca_header = hp; /* -> last valid storage. */
#ifdef emacs
# ifdef emacs
UNBLOCK_INPUT;
#endif
# endif
}
if (size == 0)
@@ -220,15 +222,15 @@ alloca (size)
}
}
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
#ifdef DEBUG_I00AFUNC
#include <stdio.h>
#endif
# ifdef DEBUG_I00AFUNC
# include <stdio.h>
# endif
#ifndef CRAY_STACK
#define CRAY_STACK
#ifndef CRAY2
# ifndef CRAY_STACK
# define CRAY_STACK
# ifndef CRAY2
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
@@ -280,7 +282,7 @@ struct stack_segment_linkage
long sss7;
};
#else /* CRAY2 */
# else /* CRAY2 */
/* The following structure defines the vector of words
returned by the STKSTAT library routine. */
struct stk_stat
@@ -333,12 +335,12 @@ struct stk_trailer
long unknown14;
};
#endif /* CRAY2 */
#endif /* not CRAY_STACK */
# endif /* CRAY2 */
# endif /* not CRAY_STACK */
#ifdef CRAY2
# ifdef CRAY2
/* Determine a "stack measure" for an arbitrary ADDRESS.
I doubt that "lint" will like this much. */
I doubt that "lint" will like this much. */
static long
i00afunc (long *address)
@@ -407,7 +409,7 @@ i00afunc (long *address)
return (result);
}
#else /* not CRAY2 */
# else /* not CRAY2 */
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
Determine the number of the cell within the stack,
given the address of the cell. The purpose of this
@@ -452,9 +454,9 @@ i00afunc (long address)
while (!(this_segment <= address && address <= stkl))
{
#ifdef DEBUG_I00AFUNC
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
#endif
# endif
if (pseg == 0)
break;
stkl = stkl - pseg;
@@ -473,9 +475,9 @@ i00afunc (long address)
while (pseg != 0)
{
#ifdef DEBUG_I00AFUNC
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o\n", pseg, size);
#endif
# endif
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
@@ -485,8 +487,8 @@ i00afunc (long address)
return (result);
}
#endif /* not CRAY2 */
#endif /* CRAY */
# endif /* not CRAY2 */
# endif /* CRAY */
#endif /* no alloca */
# endif /* no alloca */
#endif /* not GCC version 2 */

View File

@@ -39,9 +39,7 @@
or -2 if it is ambiguous (is a prefix of more than one element). */
int
argmatch (arg, optlist)
const char *arg;
const char *const *optlist;
argmatch (const char *arg, const char *const *optlist)
{
int i; /* Temporary index in OPTLIST. */
size_t arglen; /* Length of ARG. */
@@ -78,15 +76,10 @@ argmatch (arg, optlist)
PROBLEM is the return value from argmatch. */
void
invalid_arg (kind, value, problem)
const char *kind;
const char *value;
int problem;
invalid_arg (const char *kind, const char *value, int problem)
{
fprintf (stderr, "%s: ", program_name);
if (problem == -1)
fprintf (stderr, "invalid");
else /* Assume -2. */
fprintf (stderr, "ambiguous");
fprintf (stderr, " %s `%s'\n", kind, value);
const char *fmt = (problem == -1
? "%s: invalid %s `%s'\n"
: "%s: ambiguous %s `%s'\n");
fprintf (stderr, fmt, program_name, kind, value);
}

View File

@@ -1,5 +1,5 @@
/* backupfile.c -- make Emacs style backup file names
Copyright (C) 1990,1991,1992,1993,1995,1997 Free Software Foundation, Inc.
Copyright (C) 1990-1997, 1998 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
@@ -74,7 +74,7 @@ char *malloc ();
# include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
# define CHAR_BIT 8
#endif
/* Upper bound on the string length of an integer converted to string.
302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
@@ -97,15 +97,12 @@ char *malloc ();
# define REAL_DIR_ENTRY(dp) 1
#endif
/* Which type of backup file names are generated. */
enum backup_type backup_type = none;
/* The extension added to file names to produce a simple (as opposed
to numbered) backup file name. */
const char *simple_backup_suffix = ".orig";
const char *simple_backup_suffix = "~";
static int max_backup_version __BACKUPFILE_P ((const char *, const char *));
static int version_number __BACKUPFILE_P ((const char *, const char *, size_t));
static int max_backup_version PARAMS ((const char *, const char *));
static int version_number PARAMS ((const char *, const char *, size_t));
/* Return the name of the new backup file for file FILE,
allocated with malloc. Return 0 if out of memory.
@@ -113,8 +110,7 @@ static int version_number __BACKUPFILE_P ((const char *, const char *, size_t));
Do not call this function if backup_type == none. */
char *
find_backup_file_name (file)
const char *file;
find_backup_file_name (const char *file, enum backup_type backup_type)
{
size_t backup_suffix_size_max;
size_t file_len = strlen (file);
@@ -163,9 +159,7 @@ find_backup_file_name (file)
*/
static int
max_backup_version (file, dir)
const char *file;
const char *dir;
max_backup_version (const char *file, const char *dir)
{
DIR *dirp;
struct dirent *dp;
@@ -199,10 +193,7 @@ max_backup_version (file, dir)
*/
static int
version_number (base, backup, base_length)
const char *base;
const char *backup;
size_t base_length;
version_number (const char *base, const char *backup, size_t base_length)
{
int version;
const char *p;
@@ -235,8 +226,7 @@ static const enum backup_type backup_types[] =
Unique abbreviations are accepted. */
enum backup_type
get_version (version)
const char *version;
get_version (const char *version)
{
int i;

View File

@@ -1,5 +1,5 @@
/* backupfile.h -- declarations for making Emacs style backup file names
Copyright (C) 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1992, 1997, 1998 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
@@ -33,18 +33,23 @@ enum backup_type
numbered
};
extern enum backup_type backup_type;
#define VALID_BACKUP_TYPE(Type) \
((Type) == none \
|| (Type) == simple \
|| (Type) == numbered_existing \
|| (Type) == numbered)
extern char const *simple_backup_suffix;
#ifndef __BACKUPFILE_P
# if defined __STDC__ || __GNUC__
# define __BACKUPFILE_P(args) args
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define __BACKUPFILE_P(args) ()
# define PARAMS(Args) ()
# endif
#endif
char *base_name __BACKUPFILE_P ((char const *));
char *find_backup_file_name __BACKUPFILE_P ((char const *));
enum backup_type get_version __BACKUPFILE_P ((char const *));
void addext __BACKUPFILE_P ((char *, char const *, int));
char *base_name PARAMS ((char const *));
char *find_backup_file_name PARAMS ((char const *, enum backup_type));
enum backup_type get_version PARAMS ((char const *));
void addext PARAMS ((char *, char const *, int));

View File

@@ -1,15 +1,30 @@
/* basename.c -- return the last element in a path */
/* basename.c -- return the last element in a path
Copyright (C) 1990, 1998 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
#ifndef FILESYSTEM_PREFIX_LEN
# define FILESYSTEM_PREFIX_LEN(f) 0
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif
#ifndef ISSLASH
# define ISSLASH(c) ((c) == '/')
# define ISSLASH(C) ((C) == '/')
#endif
/* In general, we can't use the builtin `basename' function if available,
@@ -17,8 +32,7 @@
In some environments the builtin `basename' modifies its argument. */
char *
base_name (name)
char const *name;
base_name (char const *name)
{
char const *base = name += FILESYSTEM_PREFIX_LEN (name);

View File

@@ -27,7 +27,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif

60
lib/closeout.c Normal file
View File

@@ -0,0 +1,60 @@
/* closeout.c - close standard output
Copyright (C) 1998 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
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <stdio.h>
#include "closeout.h"
#include "error.h"
/* Close standard output, exiting with status STATUS on failure. */
void
close_stdout_status (int status)
{
if (ferror (stdout))
error (status, 0, _("write error"));
if (fclose (stdout) != 0)
error (status, errno, _("write error"));
}
/* Close standard output, exiting with status EXIT_FAILURE on failure. */
void
close_stdout (void)
{
close_stdout_status (EXIT_FAILURE);
}

10
lib/closeout.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
void close_stdout PARAMS ((void));
void close_stdout_status PARAMS ((int status));

View File

@@ -1,5 +1,5 @@
/* dirname.c -- return all but the last element in a path
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1998 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
@@ -15,22 +15,22 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#else
char *malloc ();
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
#if defined STDC_HEADERS || defined HAVE_STRING_H
# include <string.h>
#else
#include <strings.h>
#ifndef strrchr
#define strrchr rindex
#endif
# include <strings.h>
# ifndef strrchr
# define strrchr rindex
# endif
#endif
/* Return the leading directories part of PATH,

View File

@@ -1,23 +1,27 @@
/* error.c -- error handler for noninteractive utilities
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
/* Error handler for noninteractive utilities
Copyright (C) 1990,91,92,93,94,95,96,97,98 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 file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
This program is distributed in the hope that it will be useful,
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library 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. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -43,13 +47,12 @@
void exit ();
#endif
#include "error.h"
#ifndef _
# define _(String) String
#endif
/* Get prototypes for the functions defined here. */
#include <error.h>
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
@@ -68,17 +71,25 @@ unsigned int error_message_count;
# define program_name program_invocation_name
# include <errno.h>
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
# define error __error
# define error_at_line __error_at_line
#else /* not _LIBC */
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
# if HAVE_STRERROR
# ifndef strerror /* On some systems, strerror is a macro */
char *strerror ();
# endif
# ifdef HAVE_STRERROR_R
# define __strerror_r strerror_r
# else
# if HAVE_STRERROR
# ifndef strerror /* On some systems, strerror is a macro */
char *strerror ();
# endif
# else
static char *
private_strerror (errnum)
int errnum;
@@ -87,12 +98,12 @@ private_strerror (errnum)
extern int sys_nerr;
if (errnum > 0 && errnum <= sys_nerr)
return sys_errlist[errnum];
return _(sys_errlist[errnum]);
return _("Unknown system error");
}
# define strerror private_strerror
# endif /* HAVE_STRERROR */
# define strerror private_strerror
# endif /* HAVE_STRERROR */
# endif /* HAVE_STRERROR_R */
#endif /* not _LIBC */
/* Print the program name and error message MESSAGE, which is a printf-style
@@ -102,7 +113,7 @@ private_strerror (errnum)
/* VARARGS */
void
#if defined(VA_START) && __STDC__
#if defined VA_START && __STDC__
error (int status, int errnum, const char *message, ...)
#else
error (status, errnum, message, va_alist)
@@ -138,7 +149,14 @@ error (status, errnum, message, va_alist)
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
{
#if defined HAVE_STRERROR_R || defined _LIBC
char errbuf[1024];
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
}
putc ('\n', stderr);
fflush (stderr);
if (status)
@@ -150,7 +168,7 @@ error (status, errnum, message, va_alist)
int error_one_per_line;
void
#if defined(VA_START) && __STDC__
#if defined VA_START && __STDC__
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
#else
@@ -206,9 +224,24 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
{
#if defined HAVE_STRERROR_R || defined _LIBC
char errbuf[1024];
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
}
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
}
#ifdef _LIBC
/* Make the weak alias. */
# undef error
# undef error_at_line
weak_alias (__error, error)
weak_alias (__error_at_line, error_at_line)
#endif

View File

@@ -1,10 +1,14 @@
/* error.h -- declaration for error-reporting function
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
/* Declaration for error-reporting function
Copyright (C) 1995, 1996, 1997 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.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
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
@@ -12,26 +16,31 @@
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. */
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifndef ERROR_H_
# define ERROR_H_
#ifndef _ERROR_H
#define _ERROR_H 1
# ifndef __attribute__
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
#endif
# if defined (__STDC__) && __STDC__
#ifdef __cplusplus
extern "C" {
#endif
#if defined (__STDC__) && __STDC__
/* Print a message with `fprintf (stderr, FORMAT, ...)';
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
@@ -49,11 +58,11 @@ extern void error_at_line (int status, int errnum, const char *fname,
function without parameters instead. */
extern void (*error_print_progname) (void);
# else
#else
void error ();
void error_at_line ();
extern void (*error_print_progname) ();
# endif
#endif
/* This variable is incremented each time `error' is called. */
extern unsigned int error_message_count;
@@ -62,4 +71,8 @@ extern unsigned int error_message_count;
variable controls whether this mode is selected or not. */
extern int error_one_per_line;
#endif /* not ERROR_H_ */
#ifdef __cplusplus
}
#endif
#endif /* error.h */

View File

@@ -21,7 +21,7 @@ Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie and Torbjorn Granlund.
Adapted for GNU C library by Roland McGrath. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -111,7 +111,7 @@ static gid_t egid;
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
static int have_ids = 0;
# ifdef HAVE_GETGROUPS
# if HAVE_GETGROUPS
int group_member ();
# else
# define group_member(gid) 0

View File

@@ -31,8 +31,8 @@ extern int errno;
#include <stdio.h>
#include <sys/types.h>
void *xmalloc __EXCLUDE_P ((size_t));
void *xrealloc __EXCLUDE_P ((void *, size_t));
void *xmalloc PARAMS ((size_t));
void *xrealloc PARAMS ((void *, size_t));
/* Keep track of excluded file name patterns. */

View File

@@ -18,17 +18,17 @@
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifndef __EXCLUDE_P
# if defined __STDC__ || __GNUC__
# define __EXCLUDE_P(args) args
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define __EXCLUDE_P(args) ()
# define PARAMS(Args) ()
# endif
#endif
struct exclude;
struct exclude *new_exclude __EXCLUDE_P ((void));
void add_exclude __EXCLUDE_P ((struct exclude *, char const *));
int add_exclude_file __EXCLUDE_P ((struct exclude *, char const *, char));
int excluded_filename __EXCLUDE_P ((struct exclude const *, char const *));
struct exclude *new_exclude PARAMS ((void));
void add_exclude PARAMS ((struct exclude *, char const *));
int add_exclude_file PARAMS ((struct exclude *, char const *, char));
int excluded_filename PARAMS ((struct exclude const *, char const *));

View File

@@ -1,5 +1,5 @@
/* Convert file size to number of blocks on System V-like machines.
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998 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
@@ -17,22 +17,31 @@
/* Written by Brian L. Matthews, blm@6sceng.UUCP. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if !HAVE_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
# include <sys/types.h>
#include <sys/types.h>
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#if !HAVE_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
# ifndef NINDIR
# if defined (__DJGPP__)
typedef long daddr_t; /* for disk address */
# endif
/* Some SysV's, like Irix, seem to lack this. Hope it's correct. */
/* Number of inode pointers per indirect block. */
# define NINDIR (BSIZE/sizeof(daddr_t))
# define NINDIR (BSIZE / sizeof (daddr_t))
# endif /* !NINDIR */
/* Number of direct block addresses in an inode. */

View File

@@ -1,5 +1,5 @@
/* filemode.c -- make a string describing file modes
Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc.
Copyright (C) 1985, 1990, 1993, 1998 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
@@ -15,8 +15,8 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -47,45 +47,45 @@
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISBLK
#undef S_ISCHR
#undef S_ISDIR
#undef S_ISFIFO
#undef S_ISLNK
#undef S_ISMPB
#undef S_ISMPC
#undef S_ISNWK
#undef S_ISREG
#undef S_ISSOCK
# undef S_ISBLK
# undef S_ISCHR
# undef S_ISDIR
# undef S_ISFIFO
# undef S_ISLNK
# undef S_ISMPB
# undef S_ISMPC
# undef S_ISNWK
# undef S_ISREG
# undef S_ISSOCK
#endif /* STAT_MACROS_BROKEN. */
#if !defined(S_ISBLK) && defined(S_IFBLK)
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#endif
#if !defined(S_ISCHR) && defined(S_IFCHR)
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#if !defined(S_ISREG) && defined(S_IFREG)
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
#if !defined(S_ISFIFO) && defined(S_IFIFO)
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#endif
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
#endif
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
void mode_string ();

View File

@@ -1,37 +1,52 @@
/* Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
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 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. */
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
/* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fnmatch.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || !defined (isascii)
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii(c)
#endif
#define ISUPPER(c) (ISASCII (c) && isupper (c))
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined _LIBC || !defined __GNU_LIBRARY__
# if defined STDC_HEADERS || !defined isascii
# define ISASCII(c) 1
# else
# define ISASCII(c) isascii(c)
# endif
# define ISUPPER(c) (ISASCII (c) && isupper (c))
# ifndef errno
extern int errno;
@@ -49,7 +64,7 @@ fnmatch (pattern, string, flags)
register char c;
/* Note that this evaluates C many times. */
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
{
@@ -71,6 +86,9 @@ fnmatch (pattern, string, flags)
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
@@ -82,10 +100,24 @@ fnmatch (pattern, string, flags)
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
if (((flags & FNM_FILE_NAME) && *n == '/') ||
(c == '?' && *n == '\0'))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if ((flags & FNM_FILE_NAME) && *n == '/')
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0')
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
if (c == '\0')
return 0;
@@ -122,7 +154,11 @@ fnmatch (pattern, string, flags)
register char cstart = c, cend = c;
if (!(flags & FNM_NOESCAPE) && c == '\\')
cstart = cend = *p++;
{
if (*p == '\0')
return FNM_NOMATCH;
cstart = cend = *p++;
}
cstart = cend = FOLD (cstart);
@@ -169,8 +205,12 @@ fnmatch (pattern, string, flags)
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
/* XXX 1003.2d11 is unclear if this is right. */
++p;
{
if (*p == '\0')
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
}
if (not)
return FNM_NOMATCH;
@@ -196,3 +236,5 @@ fnmatch (pattern, string, flags)
# undef FOLD
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,5 +1,5 @@
/* fsusage.c -- return space usage of mounted filesystems
Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1996, 1998 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
@@ -26,6 +26,13 @@
#include <sys/stat.h>
#include "fsusage.h"
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
int statfs ();
#if HAVE_SYS_PARAM_H
@@ -65,6 +72,25 @@ int statfs ();
int statvfs ();
#endif
/* Many space usage primitives use all 1 bits to denote a value that is
not applicable or unknown. Propagate this information by returning
a uintmax_t value that is all 1 bits if the argument is all 1 bits,
even if the argument is unsigned and smaller than uintmax_t. */
#define PROPAGATE_ALL_ONES(x) ((x) == -1 ? (uintmax_t) -1 : (uintmax_t) (x))
/* Extract the top bit of X as an uintmax_t value. */
#define EXTRACT_TOP_BIT(x) ((x) \
& ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
/* If a value is negative, many space usage primitives store it into an
integer variable by assignment, even if the variable's type is unsigned.
So, if a space usage variable X's top bit is set, convert X to the
uintmax_t value V such that (- (uintmax_t) V) is the negative of
the original value. If X's top bit is clear, just yield X.
Use PROPAGATE_TOP_BIT if the original value might be negative;
otherwise, use PROPAGATE_ALL_ONES. */
#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
int safe_read ();
/* Fill in the fields of FSP with information about space usage for
@@ -87,7 +113,7 @@ get_fs_usage (path, disk, fsp)
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
return -1;
fsp->fsu_blocksize = fsd.f_fsize;
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
#endif /* STAT_STATFS3_OSF1 */
@@ -99,11 +125,12 @@ get_fs_usage (path, disk, fsp)
return -1;
fsp->fsu_blocksize = 1024;
fsp->fsu_blocks = fsd.fd_req.btot;
fsp->fsu_bfree = fsd.fd_req.bfree;
fsp->fsu_bavail = fsd.fd_req.bfreen;
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot);
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree);
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen);
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0;
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
#endif /* STAT_STATFS2_FS_DATA */
@@ -132,12 +159,15 @@ get_fs_usage (path, disk, fsp)
}
close (fd);
fsp->fsu_blocksize = fsd.s_type == Fs2b ? 1024 : 512;
fsp->fsu_blocks = fsd.s_fsize;
fsp->fsu_bfree = fsd.s_tfree;
fsp->fsu_bavail = fsd.s_tfree;
fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1);
fsp->fsu_ffree = fsd.s_tinode;
fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512);
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize);
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree);
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
fsp->fsu_files = (fsd.s_isize == -1
? (uintmax_t) -1
: (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode);
#endif /* STAT_READ_FILSYS */
@@ -148,7 +178,7 @@ get_fs_usage (path, disk, fsp)
if (statfs (path, &fsd) < 0)
return -1;
fsp->fsu_blocksize = fsd.f_bsize;
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
@@ -174,7 +204,7 @@ get_fs_usage (path, disk, fsp)
if (statfs (path, &fsd) < 0)
return -1;
fsp->fsu_blocksize = fsd.f_fsize;
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
#endif /* STAT_STATFS2_FSIZE */
@@ -193,7 +223,7 @@ get_fs_usage (path, disk, fsp)
systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */
# if _AIX || defined(_CRAY)
fsp->fsu_blocksize = fsd.f_bsize;
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
# else
fsp->fsu_blocksize = 512;
# endif
@@ -208,18 +238,20 @@ get_fs_usage (path, disk, fsp)
return -1;
/* f_frsize isn't guaranteed to be supported. */
fsp->fsu_blocksize = fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize;
fsp->fsu_blocksize =
PROPAGATE_ALL_ONES (fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize);
#endif /* STAT_STATVFS */
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
/* !Ultrix && !SVR2 */
fsp->fsu_blocks = fsd.f_blocks;
fsp->fsu_bfree = fsd.f_bfree;
fsp->fsu_bavail = fsd.f_bavail;
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.f_bavail);
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0;
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.f_files);
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */

View File

@@ -26,6 +26,7 @@ struct fs_usage
uintmax_t fsu_blocks; /* Total blocks. */
uintmax_t fsu_bfree; /* Free blocks available to superuser. */
uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
int fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
uintmax_t fsu_files; /* Total file nodes. */
uintmax_t fsu_ffree; /* Free file nodes. */
};

View File

@@ -1,8 +1,8 @@
/* ftruncate emulations that work on some System V's.
This file is in the public domain. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -19,15 +19,15 @@ ftruncate (fd, length)
}
#else /* not F_CHSIZE */
#ifdef F_FREESP
# ifdef F_FREESP
/* By William Kucharski <kucharsk@netcom.com>. */
#include <sys/stat.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
# include <sys/stat.h>
# include <errno.h>
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
int
ftruncate (fd, length)
@@ -71,8 +71,8 @@ ftruncate (fd, length)
return 0;
}
#else /* not F_CHSIZE nor F_FREESP */
#ifdef HAVE_CHSIZE
# else /* not F_CHSIZE nor F_FREESP */
# if HAVE_CHSIZE
int
ftruncate (fd, length)
@@ -82,12 +82,12 @@ ftruncate (fd, length)
return chsize (fd, length);
}
#else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
# else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
#include <errno.h>
#ifndef errno
# include <errno.h>
# ifndef errno
extern int errno;
#endif
# endif
int
ftruncate (fd, length)
@@ -98,6 +98,6 @@ ftruncate (fd, length)
return -1;
}
#endif /* not HAVE_CHSIZE */
#endif /* not F_FREESP */
# endif /* not HAVE_CHSIZE */
# endif /* not F_FREESP */
#endif /* not F_CHSIZE */

View File

@@ -1,5 +1,5 @@
/* full-write.c -- an interface to write that retries after interrupts
Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1997, 1998 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
@@ -37,10 +37,7 @@ extern int errno;
Return LEN upon success, write's (negative) error code otherwise. */
int
full_write (desc, ptr, len)
int desc;
char *ptr;
size_t len;
full_write (int desc, const char *ptr, size_t len)
{
int total_written;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1997, 1998 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
@@ -14,28 +14,28 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
# ifndef PARAMS
# if defined (__GNUC__) || __STDC__
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
#if defined (vms)
#ifdef vms
# include <types.h>
# include <time.h>
#else
# include <sys/types.h>
# ifdef TIME_WITH_SYS_TIME
# if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
# else
# ifdef HAVE_SYS_TIME_H
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>

View File

@@ -5,8 +5,6 @@
** a couple of people on Usenet. Completely overhauled by Rich $alz
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
**
** This grammar has 13 shift/reduce conflicts.
**
** This code is in the public domain and has no copyright.
*/
@@ -51,8 +49,6 @@
host does not conform to Posix. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#include "getdate.h"
#if defined (STDC_HEADERS) || defined (USG)
# include <string.h>
#endif
@@ -64,10 +60,6 @@
# define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
extern struct tm *gmtime ();
extern struct tm *localtime ();
extern time_t mktime ();
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in the same program. Note that these are only
@@ -172,6 +164,9 @@ static int yyRelYear;
%}
/* This grammar has 13 shift/reduce conflicts. */
%expect 13
%union {
int Number;
enum _MERIDIAN Meridian;
@@ -441,6 +436,15 @@ o_merid : /* NULL */
%%
/* Include this file down here because bison inserts code above which
may define-away `const'. We want the prototype for get_date to have
the same signature as the function definition does. */
#include "getdate.h"
extern struct tm *gmtime ();
extern struct tm *localtime ();
extern time_t mktime ();
/* Month and day table. */
static TABLE const MonthDayTable[] = {
{ "january", tMONTH, 1 },
@@ -886,9 +890,7 @@ difftm (a, b)
}
time_t
get_date (p, now)
const char *p;
const time_t *now;
get_date (const char *p, const time_t *now)
{
struct tm tm, tm0, *tmp;
time_t Start;

View File

@@ -701,16 +701,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
{
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
}
nextchar += strlen (nextchar);

View File

@@ -1,5 +1,5 @@
/* getugroups.c -- return a list of the groups a user is in
Copyright (C) 1990, 1991 Free Software Foundation.
Copyright (C) 1990, 1991, 1998 Free Software Foundation.
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
@@ -45,10 +45,7 @@ struct group *getgrent ();
the current process. */
int
getugroups (maxcount, grouplist, username)
int maxcount;
GETGROUPS_T *grouplist;
char *username;
getugroups (int maxcount, GETGROUPS_T *grouplist, char *username)
{
struct group *grp;
register char **cp;
@@ -59,16 +56,27 @@ getugroups (maxcount, grouplist, username)
for (cp = grp->gr_mem; *cp; ++cp)
if (!strcmp (username, *cp))
{
if (maxcount != 0)
int n;
/* See if this group number is already on the list. */
for (n = 0; n < count; ++n)
if (grouplist[n] == grp->gr_gid)
break;
/* If it's a new group number, then try to add it to the list. */
if (n == count)
{
if (count >= maxcount)
if (maxcount != 0)
{
endgrent ();
return count;
if (count >= maxcount)
{
endgrent ();
return count;
}
grouplist[count] = grp->gr_gid;
}
grouplist[count] = grp->gr_gid;
count++;
}
count++;
}
endgrent ();
return count;

View File

@@ -1,5 +1,5 @@
/* group-member.c -- determine whether group id is in calling user's group list
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 1997, 1998 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
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -26,7 +26,7 @@
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -41,18 +41,17 @@ struct group_info
GETGROUPS_T *group;
};
#ifdef HAVE_GETGROUPS
#if HAVE_GETGROUPS
static void
free_group_info (g)
struct group_info *g;
free_group_info (struct group_info *g)
{
free (g->group);
free (g);
}
static struct group_info *
get_group_info ()
get_group_info (void)
{
int n_groups;
int n_group_slots;
@@ -96,8 +95,7 @@ get_group_info ()
either of the current or effective group IDs. */
int
group_member (gid)
gid_t gid;
group_member (gid_t gid)
{
#ifndef HAVE_GETGROUPS
return ((gid == getgid ()) || (gid == getegid ()));

View File

@@ -1,7 +1,15 @@
#ifndef GROUP_MEMBER_H_
# define GROUP_MEMBER_H_ 1
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int
group_member ();
group_member PARAMS ((gid_t));
#endif /* GROUP_MEMBER_H_ */

1409
lib/hash.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,193 +1,103 @@
#ifndef HASH_H
# define HASH_H 1
/* hash - hashing table processing.
Copyright (C) 1998 Free Software Foundation, Inc.
Written by Jim Meyering <meyering@ascend.com>, 1998.
# if HAVE_CONFIG_H
# include <config.h>
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. */
/* A generic hash table package. */
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
obstacks instead of malloc, and recompile `hash.c' with same setting. */
#ifndef PARAMS
# if PROTOTYPES || __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
# include <stdio.h>
# include <assert.h>
typedef unsigned int (*Hash_hasher) PARAMS ((const void *, unsigned int));
typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
typedef void (*Hash_data_freer) PARAMS ((void *));
typedef bool (*Hash_processor) PARAMS ((void *, void *));
# ifdef STDC_HEADERS
# include <stdlib.h>
# endif
# ifndef HAVE_DECL_FREE
void free ();
# endif
# ifndef HAVE_DECL_MALLOC
char *malloc ();
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
# define USE_OBSTACK
# ifdef USE_OBSTACK
# include "obstack.h"
# endif
# define obstack_chunk_alloc malloc
# define obstack_chunk_free free
struct hash_ent
struct hash_entry
{
void *key;
struct hash_ent *next;
};
typedef struct hash_ent HASH_ENT;
/* This is particularly useful to cast uses in hash_initialize of the
system free function. */
typedef void (*Hash_key_freer_type) PARAMS((void *key));
struct HT
{
/* User-supplied function for freeing keys. It is specified in
hash_initialize. If non-null, it is used by hash_free and
hash_clear. You should specify `free' here only if you want
these functions to free all of your `key' data. This is typically
the case when your key is simply an auxilliary struct that you
have malloc'd to aggregate several values. */
Hash_key_freer_type hash_key_freer;
/* User-supplied hash function that hashes entry E to an integer
in the range 0..TABLE_SIZE-1. */
unsigned int (*hash_hash) PARAMS((const void *e, unsigned int table_size));
/* User-supplied function that determines whether a new entry is
unique by comparing the new entry to entries that hashed to the
same bucket index. It should return zero for a pair of entries
that compare equal, non-zero otherwise. */
int (*hash_key_comparator) PARAMS((const void *, const void *));
HASH_ENT **hash_table;
unsigned int hash_table_size;
unsigned int hash_n_slots_used;
unsigned int hash_max_chain_length;
/* Gets set when an entry is deleted from a chain of length
hash_max_chain_length. Indicates that hash_max_chain_length
may no longer be valid. */
unsigned int hash_dirty_max_chain_length;
/* Sum of lengths of all chains (not counting any dummy
header entries). */
unsigned int hash_n_keys;
/* A linked list of freed HASH_ENT structs.
FIXME: Perhaps this is unnecessary and we should simply free
and reallocate such structs. */
HASH_ENT *hash_free_entry_list;
/* FIXME: comment. */
# ifdef USE_OBSTACK
struct obstack ht_obstack;
# endif
void *data;
struct hash_entry *next;
};
typedef struct HT HT;
struct hash_table
{
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
are not empty, there are N_ENTRIES active entries in the table. */
struct hash_entry *bucket;
struct hash_entry *bucket_limit;
unsigned int n_buckets;
unsigned int n_buckets_used;
unsigned int n_entries;
unsigned int
hash_get_n_slots_used PARAMS((const HT *ht));
/* Three functions are given to `hash_initialize', see the documentation
block for this function. In a word, HASHER randomizes a user entry
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
true if two user entries compare equally; and DATA_FREER is the cleanup
function for a user entry. */
Hash_hasher hasher;
Hash_comparator comparator;
Hash_data_freer data_freer;
unsigned int
hash_get_max_chain_length PARAMS((HT *ht));
/* A linked list of freed struct hash_entry structs. */
struct hash_entry *free_entry_list;
int
hash_rehash PARAMS((HT *ht, unsigned int new_table_size));
#if USE_OBSTACK
/* Whenever obstacks are used, it is possible to allocate all overflowed
entries into a single stack, so they all can be freed in a single
operation. It is not clear if the speedup is worth the trouble. */
struct obstack entry_stack;
#endif
};
unsigned int
hash_get_table_size PARAMS((const HT *ht));
typedef struct hash_table Hash_table;
HT *
hash_initialize PARAMS((unsigned int table_size,
void (*key_freer) PARAMS((void *key)),
unsigned int (*hash) PARAMS((const void *,
unsigned int)),
int (*equality_tester) PARAMS((const void *,
const void *))));
/* Information and lookup. */
unsigned int hash_get_n_buckets PARAMS ((const Hash_table *));
unsigned int hash_get_n_buckets_used PARAMS ((const Hash_table *));
unsigned int hash_get_n_entries PARAMS ((const Hash_table *));
unsigned int hash_get_max_bucket_length PARAMS ((const Hash_table *));
bool hash_table_ok PARAMS ((const Hash_table *));
void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
void *hash_lookup PARAMS ((const Hash_table *, const void *));
unsigned int
hash_get_n_keys PARAMS((const HT *ht));
/* Walking. */
void *hash_get_first PARAMS ((const Hash_table *));
void *hash_get_next PARAMS ((const Hash_table *, const void *));
unsigned int hash_get_entries PARAMS ((const Hash_table *, void **,
unsigned int));
unsigned int hash_do_for_each PARAMS ((const Hash_table *, Hash_processor,
void *));
int
hash_query_in_table PARAMS((const HT *ht, const void *e));
/* Allocation and clean-up. */
unsigned int hash_string PARAMS ((const char *, unsigned int));
Hash_table *hash_initialize PARAMS ((unsigned int, Hash_hasher,
Hash_comparator, Hash_data_freer));
void hash_clear PARAMS ((Hash_table *));
void hash_free PARAMS ((Hash_table *));
void *
hash_lookup PARAMS((const HT *ht, const void *e));
void *
hash_insert_if_absent PARAMS((HT *ht,
const void *e,
int *failed));
void *
hash_delete_if_present PARAMS((HT *ht, const void *e));
void
hash_print_statistics PARAMS((const HT *ht, FILE *stream));
int
hash_get_statistics PARAMS((const HT *ht, unsigned int *n_slots_used,
unsigned int *n_keys,
unsigned int *max_chain_length));
int
hash_table_ok PARAMS((HT *ht));
void
hash_do_for_each PARAMS((HT *ht,
void (*f) PARAMS((void *e, void *aux)),
void *aux));
int
hash_do_for_each_2 PARAMS((HT *ht,
int (*f) PARAMS((void *e, void *aux)),
void *aux));
int
hash_do_for_each_in_selected_bucket PARAMS((HT *ht,
const void *key,
int (*f) PARAMS((const void *bucket_key,
void *e,
void *aux)),
void *aux));
void
hash_clear PARAMS((HT *ht));
void
hash_free PARAMS((HT *ht));
void
hash_get_key_list PARAMS((const HT *ht,
unsigned int bufsize,
void **buf));
void *
hash_get_first PARAMS((const HT *ht));
void *
hash_get_next PARAMS((const HT *ht, const void *e));
/* This interface to hash_insert_if_absent is used frequently enough to
merit a macro here. */
# define HASH_INSERT_NEW_ITEM(Ht, Item, Failp) \
do \
{ \
void *_already; \
_already = hash_insert_if_absent ((Ht), (Item), Failp); \
assert (_already == NULL); \
} \
while (0)
#endif /* HASH_H */
/* Insertion and deletion. */
bool hash_rehash PARAMS ((Hash_table *, unsigned int));
void *hash_insert PARAMS ((Hash_table *, const void *, bool *));
void *hash_delete PARAMS ((Hash_table *, const void *));

View File

@@ -1,5 +1,5 @@
/* human.c -- print human readable file size
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998 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
@@ -16,9 +16,12 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Originally contributed by lm@sgi.com;
--si and large file support added by eggert@twinsun.com. */
--si, output block size selection, and large file support
added by eggert@twinsun.com. */
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
@@ -34,6 +37,24 @@
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifndef HAVE_DECL_GETENV
char *getenv ();
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#include <argmatch.h>
#include <error.h>
#include <xstrtoul.h>
#include "human.h"
@@ -52,25 +73,32 @@ static const char suffixes[] =
/* Convert N to a human readable format in BUF.
N is expressed in units of FROM_UNITS; use units of TO_UNITS in the
output number. FROM_UNITS and TO_UNITS must be positive, and one must
be a multiple of the other.
N is expressed in units of FROM_BLOCK_SIZE. FROM_BLOCK_SIZE must
be positive.
If BASE is nonzero, use a format like "127k" if possible,
using powers of BASE; otherwise, use ordinary decimal format.
Normally BASE is either 1000 or 1024; it must be at least 2.
Most people visually process strings of 3-4 digits effectively,
but longer strings of digits are more prone to misinterpretation.
Hence, converting to an abbreviated form usually improves readability.
Use a suffix indicating which power is being used.
For example, assuming BASE is 1024, 8500 would be converted to 8.3k,
If OUTPUT_BLOCK_SIZE is positive, use units of OUTPUT_BLOCK_SIZE in
the output number. OUTPUT_BLOCK_SIZE must be a multiple of
FROM_BLOCK_SIZE or vice versa.
If OUTPUT_BLOCK_SIZE is negative, use a format like "127k" if
possible, using powers of -OUTPUT_BLOCK_SIZE; otherwise, use
ordinary decimal format. Normally -OUTPUT_BLOCK_SIZE is either
1000 or 1024; it must be at least 2. Most people visually process
strings of 3-4 digits effectively, but longer strings of digits are
more prone to misinterpretation. Hence, converting to an
abbreviated form usually improves readability. Use a suffix
indicating which power is being used. For example, assuming
-OUTPUT_BLOCK_SIZE is 1024, 8500 would be converted to 8.3k,
133456345 to 127M, 56990456345 to 53G, and so on. Numbers smaller
than BASE aren't modified. */
than -OUTPUT_BLOCK_SIZE aren't modified. */
char *
human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
human_readable (uintmax_t n, char *buf,
int from_block_size, int output_block_size)
{
uintmax_t amt;
int base;
int to_block_size;
int tenths;
int power;
char *p;
@@ -81,6 +109,17 @@ human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
3 means AMT.TENTHS + 0.05 < adjusted N < AMT.TENTHS + 0.1. */
int rounding;
if (output_block_size < 0)
{
base = -output_block_size;
to_block_size = 1;
}
else
{
base = 0;
to_block_size = output_block_size;
}
p = buf + LONGEST_HUMAN_READABLE;
*p = '\0';
@@ -89,11 +128,11 @@ human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
power = 0;
#endif
/* Adjust AMT out of FROM_UNITS units and into TO_UNITS units. */
/* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE units. */
if (to_units <= from_units)
if (to_block_size <= from_block_size)
{
int multiplier = from_units / to_units;
int multiplier = from_block_size / to_block_size;
amt = n * multiplier;
tenths = rounding = 0;
@@ -119,7 +158,7 @@ human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
e *= base;
power++;
}
while (e * base <= amt && power < sizeof suffixes - 1);
while (e * base <= damt && power < sizeof suffixes - 1);
damt /= e;
@@ -133,7 +172,7 @@ human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
}
else
{
int divisor = to_units / from_units;
int divisor = to_block_size / from_block_size;
int r10 = (n % divisor) * 10;
int r2 = (r10 % divisor) * 2;
amt = n / divisor;
@@ -201,3 +240,47 @@ human_readable (uintmax_t n, char *buf, int from_units, int to_units, int base)
return p;
}
/* The default block size used for output. This number may change in
the future as disks get larger. */
#ifndef DEFAULT_BLOCK_SIZE
# define DEFAULT_BLOCK_SIZE 1024
#endif
static char const *const block_size_args[] = { "human-readable", "si", 0 };
static int const block_size_types[] = { -1024, -1000 };
static strtol_error
humblock (char const *spec, int *block_size)
{
int i;
if (! spec && ! (spec = getenv ("BLOCK_SIZE")))
*block_size = getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE;
else if (0 <= (i = argmatch (spec, block_size_args)))
*block_size = block_size_types[i];
else
{
char *ptr;
unsigned long val;
strtol_error e = xstrtoul (spec, &ptr, 0, &val, "eEgGkKmMpPtTyYzZ0");
if (e != LONGINT_OK)
return e;
if (*ptr)
return LONGINT_INVALID_SUFFIX_CHAR;
if ((int) val < 0 || val != (int) val)
return LONGINT_OVERFLOW;
*block_size = (int) val;
}
return LONGINT_OK;
}
void
human_block_size (char const *spec, int report_errors, int *block_size)
{
strtol_error e = humblock (spec, block_size);
if (e != LONGINT_OK && report_errors)
STRTOL_FATAL_ERROR (spec, _("block size"), e);
}

View File

@@ -15,6 +15,8 @@
# endif
# endif
char *human_readable PARAMS ((uintmax_t, char *, int, int, int));
char *human_readable PARAMS ((uintmax_t, char *, int, int));
void human_block_size PARAMS ((char const *, int, int *));
#endif /* HUMAN_H_ */

View File

@@ -1,5 +1,5 @@
/* idcache.c -- map user and group IDs, cached for speed
Copyright (C) 1985, 1988, 1989, 1990, 1997 Free Software Foundation, Inc.
Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998 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
@@ -24,7 +24,7 @@
#include <pwd.h>
#include <grp.h>
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
@@ -44,6 +44,10 @@ struct group *getgrnam ();
char *xmalloc ();
char *xstrdup ();
#ifdef __DJGPP__
static char digits[] = "0123456789";
#endif
struct userid
{
union
@@ -55,23 +59,15 @@ struct userid
struct userid *next;
};
/* The members of this list have already been looked up.
If a name is NULL, the corresponding id is not in the password file. */
static struct userid *user_alist;
#ifdef NOT_USED
/* The members of this list are names not in the local passwd file;
their names are always not NULL, and their ids are irrelevant. */
/* The members of this list have names not in the local passwd file. */
static struct userid *nouser_alist;
#endif /* NOT_USED */
/* Translate UID to a login name, with cache.
If UID cannot be resolved, return NULL.
Cache lookup failures, too. */
/* Translate UID to a login name, with cache, or NULL if unresolved. */
char *
getuser (uid)
uid_t uid;
getuser (uid_t uid)
{
register struct userid *tail;
struct passwd *pwent;
@@ -83,31 +79,28 @@ getuser (uid)
pwent = getpwuid (uid);
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->id.u = uid;
tail->name = (pwent ? xstrdup (pwent->pw_name) : NULL);
tail->name = pwent ? xstrdup (pwent->pw_name) : NULL;
/* Add to the head of the list, so most recently added is first. */
/* Add to the head of the list, so most recently used is first. */
tail->next = user_alist;
user_alist = tail;
return tail->name;
}
#ifdef NOT_USED
/* Translate USER to a UID, with cache.
Return NULL if there is no such user.
(We also cache which user names have no passwd entry,
so we don't keep looking them up.) */
uid_t *
getuidbyname (user)
const char *user;
getuidbyname (const char *user)
{
register struct userid *tail;
struct passwd *pwent;
for (tail = user_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
if (tail->name && *tail->name == *user && !strcmp (tail->name, user))
if (*tail->name == *user && !strcmp (tail->name, user))
return &tail->id.u;
for (tail = nouser_alist; tail; tail = tail->next)
@@ -116,11 +109,20 @@ getuidbyname (user)
return 0;
pwent = getpwnam (user);
#ifdef __DJGPP__
/* We need to pretend to be the user USER, to make
pwd functions know about an arbitrary user name. */
if (!pwent && strspn (user, digits) < strlen (user))
{
setenv ("USER", user, 1);
pwent = getpwnam (user); /* now it will succeed */
}
#endif
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->name = xstrdup (user);
/* Add to the head of the list, so most recently added is first. */
/* Add to the head of the list, so most recently used is first. */
if (pwent)
{
tail->id.u = pwent->pw_uid;
@@ -134,20 +136,14 @@ getuidbyname (user)
return 0;
}
#endif /* NOT_USED */
/* Use the same struct as for userids. */
static struct userid *group_alist;
#ifdef NOT_USED
static struct userid *nogroup_alist;
#endif
/* Translate GID to a group name, with cache.
Return NULL if the group has no name. */
/* Translate GID to a group name, with cache, or NULL if unresolved. */
char *
getgroup (gid)
gid_t gid;
getgroup (gid_t gid)
{
register struct userid *tail;
struct group *grent;
@@ -159,7 +155,7 @@ getgroup (gid)
grent = getgrgid (gid);
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->id.g = gid;
tail->name = (grent ? xstrdup (grent->gr_name) : NULL);
tail->name = grent ? xstrdup (grent->gr_name) : NULL;
/* Add to the head of the list, so most recently used is first. */
tail->next = group_alist;
@@ -167,23 +163,20 @@ getgroup (gid)
return tail->name;
}
#ifdef NOT_USED
/* Translate GROUP to a GID, with cache.
Return NULL if there is no such group.
(We also cache which group names have no group entry,
so we don't keep looking them up.) */
gid_t *
getgidbyname (group)
const char *group;
getgidbyname (const char *group)
{
register struct userid *tail;
struct group *grent;
for (tail = group_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
if (tail->name && *tail->name == *group && !strcmp (tail->name, group))
if (*tail->name == *group && !strcmp (tail->name, group))
return &tail->id.g;
for (tail = nogroup_alist; tail; tail = tail->next)
@@ -192,6 +185,15 @@ getgidbyname (group)
return 0;
grent = getgrnam (group);
#ifdef __DJGPP__
/* We need to pretend to belong to group GROUP, to make
grp functions know about any arbitrary group name. */
if (!grent && strspn (group, digits) < strlen (group))
{
setenv ("GROUP", group, 1);
grent = getgrnam (group); /* now it will succeed */
}
#endif
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->name = xstrdup (group);
@@ -209,5 +211,3 @@ getgidbyname (group)
nogroup_alist = tail;
return 0;
}
#endif /* NOT_USED */

View File

@@ -1,5 +1,5 @@
/* isdir.c -- determine whether a directory exists
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1998 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
@@ -15,19 +15,19 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#endif /* STAT_MACROS_BROKEN. */
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#if !defined S_ISDIR && defined S_IFDIR
# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR)
#endif
/* If PATH is an existing directory or symbolic link to a directory,

45
lib/lchown.c Normal file
View File

@@ -0,0 +1,45 @@
/* Provide a stub lchown function for systems that lack it.
Copyright (C) 1998 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. */
/* written by Jim Meyering */
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include "lchown.h"
/* Work just like chown, except when FILE is a symbolic link.
In that case, set errno to ENOSYS and return -1. */
int
lchown (const char *file, uid_t uid, gid_t gid)
{
struct stat stats;
if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
{
errno = ENOSYS;
return -1;
}
return chown (file, uid, gid);
}

9
lib/lchown.h Normal file
View File

@@ -0,0 +1,9 @@
/* Some systems don't have ENOSYS. */
#ifndef ENOSYS
# ifdef ENOTSUP
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS ENOMSG
# endif
#endif

View File

@@ -1,5 +1,5 @@
/* linebuffer.c -- read arbitrarily long lines
Copyright (C) 1986, 1991 Free Software Foundation, Inc.
Copyright (C) 1986, 1991, 1998 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
@@ -12,11 +12,15 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Richard Stallman. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include "linebuffer.h"
@@ -27,8 +31,7 @@ void free ();
/* Initialize linebuffer LINEBUFFER for use. */
void
initbuffer (linebuffer)
struct linebuffer *linebuffer;
initbuffer (struct linebuffer *linebuffer)
{
linebuffer->length = 0;
linebuffer->size = 200;
@@ -37,19 +40,18 @@ initbuffer (linebuffer)
/* Read an arbitrarily long line of text from STREAM into LINEBUFFER.
Remove any newline. Does not null terminate.
Return LINEBUFFER, except at end of file return 0. */
Return zero upon error or upon end of file.
Otherwise, return LINEBUFFER. */
struct linebuffer *
readline (linebuffer, stream)
struct linebuffer *linebuffer;
FILE *stream;
readline (struct linebuffer *linebuffer, FILE *stream)
{
int c;
char *buffer = linebuffer->buffer;
char *p = linebuffer->buffer;
char *end = buffer + linebuffer->size; /* Sentinel. */
if (feof (stream))
if (feof (stream) || ferror (stream))
{
linebuffer->length = 0;
return 0;
@@ -83,8 +85,7 @@ readline (linebuffer, stream)
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
void
freebuffer (linebuffer)
struct linebuffer *linebuffer;
freebuffer (struct linebuffer *linebuffer)
{
free (linebuffer->buffer);
free (linebuffer);

View File

@@ -1,5 +1,5 @@
/* linebuffer.h -- declarations for reading arbitrarily long lines
Copyright (C) 1986, 1991 Free Software Foundation, Inc.
Copyright (C) 1986, 1991, 1998 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
@@ -14,7 +14,10 @@
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 !defined LINEBUFFER_H
# define LINEBUFFER_H
/* A `struct linebuffer' holds a line of text. */
struct linebuffer
@@ -24,12 +27,13 @@ struct linebuffer
char *buffer;
};
#undef PARAMS
#if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
#else
# define PARAMS(Args) ()
#endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
/* Initialize linebuffer LINEBUFFER for use. */
void initbuffer PARAMS ((struct linebuffer *linebuffer));
@@ -42,3 +46,5 @@ struct linebuffer *readline PARAMS ((struct linebuffer *linebuffer,
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
void freebuffer PARAMS ((struct linebuffer *));
#endif /* LINEBUFFER_H */

View File

@@ -1,5 +1,5 @@
/* Utility to accept --help and --version options as unobtrusively as possible.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1998 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
@@ -17,12 +17,13 @@
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <getopt.h>
#include "closeout.h"
#include "long-options.h"
static struct option const long_options[] =
@@ -62,6 +63,8 @@ parse_long_options (argc, argv, command_name, package, version, usage)
case 'v':
printf ("%s (%s) %s\n", command_name, package, version);
close_stdout (); /* FIXME: output failure exit status
should be settable via an arg. */
exit (0);
default:

View File

@@ -1,5 +1,5 @@
/* makepath.c -- Ensure that a directory path exists.
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998 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
@@ -71,6 +71,16 @@ extern int errno;
# endif
#endif
#ifndef S_IWUSR
# define S_IWUSR 0200
#endif
#ifndef S_IXUSR
# define S_IXUSR 0100
#endif
#define WX_USR (S_IWUSR | S_IXUSR)
#ifdef __MSDOS__
typedef int uid_t;
typedef int gid_t;
@@ -123,7 +133,6 @@ void strip_trailing_slashes ();
Return 0 if ARGPATH exists as a directory with the proper
ownership and permissions when done, otherwise 1. */
#if __STDC__
int
make_path (const char *argpath,
int mode,
@@ -132,18 +141,6 @@ make_path (const char *argpath,
gid_t group,
int preserve_existing,
const char *verbose_fmt_string)
#else
int
make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
verbose_fmt_string)
const char *argpath;
int mode;
int parent_mode;
uid_t owner;
gid_t group;
int preserve_existing;
const char *verbose_fmt_string;
#endif
{
struct stat stats;
int retval = 0;
@@ -175,8 +172,8 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
/* If leading directories shouldn't be writable or executable,
or should have set[ug]id or sticky bits set and we are setting
their owners, we need to fix their permissions after making them. */
if (((parent_mode & 0300) != 0300)
|| (owner != (uid_t) -1 && group != (gid_t) -1
if (((parent_mode & WX_USR) != WX_USR)
|| ((owner != (uid_t) -1 || group != (gid_t) -1)
&& (parent_mode & 07000) != 0))
{
tmp_mode = 0700;
@@ -220,6 +217,14 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
if (!do_chdir)
basename_dir = dirpath;
/* The mkdir and stat calls below appear to be reversed.
They are not. It is important to call mkdir first and then to
call stat (to distinguish the three cases) only if mkdir fails.
The alternative to this approach is to `stat' each directory,
then to call mkdir if it doesn't exist. But if some other process
were to create the directory between the stat & mkdir, the mkdir
would fail with EEXIST. */
*slash = '\0';
if (mkdir (basename_dir, tmp_mode))
{
@@ -242,28 +247,31 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
}
}
if (newly_created_dir && verbose_fmt_string != NULL)
fprintf (stderr, verbose_fmt_string, dirpath);
if (newly_created_dir)
{
if (verbose_fmt_string)
fprintf (stderr, verbose_fmt_string, dirpath);
if (owner != (uid_t) -1 && group != (gid_t) -1
&& chown (basename_dir, owner, group)
if ((owner != (uid_t) -1 || group != (gid_t) -1)
&& chown (basename_dir, owner, group)
#if defined(AFS) && defined (EPERM)
&& errno != EPERM
&& errno != EPERM
#endif
)
{
error (0, errno, "%s", dirpath);
CLEANUP;
return 1;
}
)
{
error (0, errno, "%s", dirpath);
CLEANUP;
return 1;
}
if (re_protect)
{
struct ptr_list *new = (struct ptr_list *)
alloca (sizeof (struct ptr_list));
new->dirname_end = slash;
new->next = leading_dirs;
leading_dirs = new;
if (re_protect)
{
struct ptr_list *new = (struct ptr_list *)
alloca (sizeof (struct ptr_list));
new->dirname_end = slash;
new->next = leading_dirs;
leading_dirs = new;
}
}
/* If we were able to save the initial working directory,
@@ -361,7 +369,7 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
On System V, users can give away files with chown and then not
be able to chmod them. So don't give files away. */
if (owner != (uid_t) -1 && group != (gid_t) -1
if ((owner != (uid_t) -1 || group != (gid_t) -1)
&& chown (dirpath, owner, group)
#ifdef AFS
&& errno != EPERM

View File

@@ -1,8 +1,9 @@
#undef PARAMS
#if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
#else
# define PARAMS(Args) ()
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
int

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993, 1995, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
NOTE: The canonical source of this file is maintained with the GNU C Library.
@@ -325,7 +325,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)
}
int
memcmp (s1, s2, len)
rpl_memcmp (s1, s2, len)
const __ptr_t s1;
const __ptr_t s2;
size_t len;

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
/* mktime: convert a `struct tm' to a time_t value zzzzzz
Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc.
Contributed by Paul Eggert (eggert@twinsun.com).
NOTE: The canonical source of this file is maintained with the GNU C Library.
@@ -73,21 +74,26 @@
# define CHAR_BIT 8
#endif
/* The extra casts work around common compiler bugs. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
It is necessary at least when t == time_t. */
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
#ifndef INT_MIN
# define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1))
# define INT_MIN TYPE_MINIMUM (int)
#endif
#ifndef INT_MAX
# define INT_MAX (~0 - INT_MIN)
# define INT_MAX TYPE_MAXIMUM (int)
#endif
#ifndef TIME_T_MIN
/* The outer cast to time_t works around a bug in Cray C 5.0.3.0. */
# define TIME_T_MIN ((time_t) \
(0 < (time_t) -1 ? (time_t) 0 \
: ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)))
# define TIME_T_MIN TYPE_MINIMUM (time_t)
#endif
#ifndef TIME_T_MAX
# define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
# define TIME_T_MAX TYPE_MAXIMUM (time_t)
#endif
#define TM_YEAR_BASE 1900
@@ -365,7 +371,15 @@ __mktime_internal (tp, convert, offset)
double dday = 366 * dyear + mday;
double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested;
if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec))
/* On Irix4.0.5 cc, dividing TIME_T_MIN by 3 does not produce
correct results, ie., it erroneously gives a positive value
of 715827882. Setting a variable first then doing math on it
seems to work. (ghazi@caip.rutgers.edu) */
const time_t time_t_max = TIME_T_MAX;
const time_t time_t_min = TIME_T_MIN;
if (time_t_max / 3 - time_t_min / 3 < (dsec < 0 ? - dsec : dsec))
return -1;
}

View File

@@ -1,5 +1,5 @@
/* mountlist.c -- return a list of mounted filesystems
Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1997, 1998 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
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -42,7 +42,20 @@ char *xrealloc ();
char *xstrdup ();
void error ();
#ifdef HAVE_SYS_PARAM_H
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
@@ -101,7 +114,7 @@ void error ();
# define MOUNTED_GETMNTTBL
#endif
#ifdef HAVE_SYS_MNTENT_H
#if HAVE_SYS_MNTENT_H
/* This is to get MNTOPT_IGNORE on e.g. SVR4. */
# include <sys/mntent.h>
#endif
@@ -116,10 +129,10 @@ void error ();
/* Return the value of the hexadecimal number represented by CP.
No prefix (like '0x') or suffix (like 'h') is expected to be
part of CP. */
/* FIXME: this can overflow */
static int
xatoi (cp)
char *cp;
xatoi (char *cp)
{
int val;
@@ -140,107 +153,120 @@ xatoi (cp)
}
#endif /* MOUNTED_GETMNTENT1. */
#if defined (MOUNTED_GETMNTINFO) && !defined (__NetBSD__) && !defined (__OpenBSD__)
#if MOUNTED_GETMNTINFO
# if ! HAVE_F_FSTYPENAME_IN_STATFS
static char *
fstype_to_string (t)
short t;
fstype_to_string (short t)
{
switch (t)
{
# ifdef MOUNT_PC
# ifdef MOUNT_PC
case MOUNT_PC:
return "pc";
# endif
# ifdef MOUNT_MFS
# endif
# ifdef MOUNT_MFS
case MOUNT_MFS:
return "mfs";
# endif
# ifdef MOUNT_LO
# endif
# ifdef MOUNT_LO
case MOUNT_LO:
return "lo";
# endif
# ifdef MOUNT_TFS
# endif
# ifdef MOUNT_TFS
case MOUNT_TFS:
return "tfs";
# endif
# ifdef MOUNT_TMP
# endif
# ifdef MOUNT_TMP
case MOUNT_TMP:
return "tmp";
# endif
# ifdef MOUNT_UFS
# endif
# ifdef MOUNT_UFS
case MOUNT_UFS:
return "ufs" ;
# endif
# ifdef MOUNT_NFS
# endif
# ifdef MOUNT_NFS
case MOUNT_NFS:
return "nfs" ;
# endif
# ifdef MOUNT_MSDOS
# endif
# ifdef MOUNT_MSDOS
case MOUNT_MSDOS:
return "msdos" ;
# endif
# ifdef MOUNT_LFS
# endif
# ifdef MOUNT_LFS
case MOUNT_LFS:
return "lfs" ;
# endif
# ifdef MOUNT_LOFS
# endif
# ifdef MOUNT_LOFS
case MOUNT_LOFS:
return "lofs" ;
# endif
# ifdef MOUNT_FDESC
# endif
# ifdef MOUNT_FDESC
case MOUNT_FDESC:
return "fdesc" ;
# endif
# ifdef MOUNT_PORTAL
# endif
# ifdef MOUNT_PORTAL
case MOUNT_PORTAL:
return "portal" ;
# endif
# ifdef MOUNT_NULL
# endif
# ifdef MOUNT_NULL
case MOUNT_NULL:
return "null" ;
# endif
# ifdef MOUNT_UMAP
# endif
# ifdef MOUNT_UMAP
case MOUNT_UMAP:
return "umap" ;
# endif
# ifdef MOUNT_KERNFS
# endif
# ifdef MOUNT_KERNFS
case MOUNT_KERNFS:
return "kernfs" ;
# endif
# ifdef MOUNT_PROCFS
# endif
# ifdef MOUNT_PROCFS
case MOUNT_PROCFS:
return "procfs" ;
# endif
# ifdef MOUNT_AFS
# endif
# ifdef MOUNT_AFS
case MOUNT_AFS:
return "afs" ;
# endif
# ifdef MOUNT_CD9660
# endif
# ifdef MOUNT_CD9660
case MOUNT_CD9660:
return "cd9660" ;
# endif
# ifdef MOUNT_UNION
# endif
# ifdef MOUNT_UNION
case MOUNT_UNION:
return "union" ;
# endif
# ifdef MOUNT_DEVFS
# endif
# ifdef MOUNT_DEVFS
case MOUNT_DEVFS:
return "devfs" ;
# endif
# ifdef MOUNT_EXT2FS
# endif
# ifdef MOUNT_EXT2FS
case MOUNT_EXT2FS:
return "ext2fs" ;
# endif
# endif
default:
return "?";
}
}
# endif /* ! HAVE_F_FSTYPENAME_IN_STATFS */
/* __NetBSD__ || BSD_NET2 || __OpenBSD__ */
static char *
fsp_to_string (const struct statfs *fsp)
{
# if defined HAVE_F_FSTYPENAME_IN_STATFS
return fsp->f_fstypename;
# else
return fstype_to_string (fsp->f_type);
# endif
}
#endif /* MOUNTED_GETMNTINFO */
#ifdef MOUNTED_VMOUNT /* AIX. */
static char *
fstype_to_string (t)
int t;
fstype_to_string (int t)
{
struct vfs_ent *e;
@@ -255,22 +281,14 @@ fstype_to_string (t)
/* Return a list of the currently mounted filesystems, or NULL on error.
Add each entry to the tail of the list so that they stay in order.
If NEED_FS_TYPE is nonzero, ensure that the filesystem type fields in
the returned list are valid. Otherwise, they might not be.
If ALL_FS is zero, do not return entries for filesystems that
are automounter (dummy) entries. */
the returned list are valid. Otherwise, they might not be. */
struct mount_entry *
read_filesystem_list (need_fs_type, all_fs)
int need_fs_type, all_fs;
read_filesystem_list (int need_fs_type)
{
struct mount_entry *mount_list;
struct mount_entry *me;
struct mount_entry *mtail;
/* Start the list off with a dummy entry. */
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_next = NULL;
mount_list = mtail = me;
struct mount_entry **mtail = &mount_list;
#ifdef MOUNTED_LISTMNTENT
{
@@ -285,18 +303,17 @@ read_filesystem_list (need_fs_type, all_fs)
if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0)
return NULL;
p = mntlist;
while(p){
for (p = mntlist; p; p = p->next) {
mnt = p->ment;
me = (struct mount_entry*) xmalloc(sizeof (struct mount_entry));
me->me_devname = xstrdup(mnt->mnt_fsname);
me->me_mountdir = xstrdup(mnt->mnt_dir);
me->me_type = xstrdup(mnt->mnt_type);
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = -1;
me->me_next = NULL;
mtail->me_next = me;
mtail = me;
p = p->next;
*mtail = me;
mtail = &me->me_next;
}
freemntlist(mntlist);
}
@@ -315,14 +332,12 @@ read_filesystem_list (need_fs_type, all_fs)
while ((mnt = getmntent (fp)))
{
if (!all_fs && (!strcmp (mnt->mnt_type, "ignore")
|| !strcmp (mnt->mnt_type, "auto")))
continue;
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (mnt->mnt_fsname);
me->me_mountdir = xstrdup (mnt->mnt_dir);
me->me_type = xstrdup (mnt->mnt_type);
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
devopt = strstr (mnt->mnt_opts, "dev=");
if (devopt)
{
@@ -333,15 +348,14 @@ read_filesystem_list (need_fs_type, all_fs)
}
else
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
if (endmntent (fp) == 0)
return NULL;
goto free_then_fail;
}
#endif /* MOUNTED_GETMNTENT1. */
@@ -353,23 +367,21 @@ read_filesystem_list (need_fs_type, all_fs)
entries = getmntinfo (&fsp, MNT_NOWAIT);
if (entries < 0)
return NULL;
while (entries-- > 0)
for (; entries-- > 0; fsp++)
{
char *fs_type = fsp_to_string (fsp);
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (fsp->f_mntfromname);
me->me_mountdir = xstrdup (fsp->f_mntonname);
# if defined (__NetBSD__) || defined (__OpenBSD__)
me->me_type = xstrdup (fsp->f_fstypename);
# else
me->me_type = fstype_to_string (fsp->f_type);
# endif
me->me_type = fs_type;
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
fsp++;
*mtail = me;
mtail = &me->me_next;
}
}
#endif /* MOUNTED_GETMNTINFO */
@@ -380,22 +392,24 @@ read_filesystem_list (need_fs_type, all_fs)
int val;
struct fs_data fsd;
while ((val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY,
(char *) 0)) > 0)
while (errno = 0,
0 <= (val = getmnt (&offset, &fsd, sizeof (fsd), NOSTAT_MANY,
(char *) 0)))
{
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (fsd.fd_req.devname);
me->me_mountdir = xstrdup (fsd.fd_req.path);
me->me_type = gt_names[fsd.fd_req.fstype];
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = fsd.fd_req.dev;
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
if (val < 0)
return NULL;
goto free_then_fail;
}
#endif /* MOUNTED_GETMNT. */
@@ -424,12 +438,13 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_devname = xstrdup (stats[counter].f_mntfromname);
me->me_mountdir = xstrdup (stats[counter].f_mntonname);
me->me_type = mnt_names[stats[counter].f_type];
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
free (stats);
@@ -470,15 +485,24 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_type = xstrdup (typebuf);
}
# endif
me->me_next = NULL;
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
if (ferror (fp))
{
int saved_errno = errno;
fclose (fp);
errno = saved_errno;
goto free_then_fail;
}
if (fclose (fp) == EOF)
return NULL;
goto free_then_fail;
}
#endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */
@@ -491,12 +515,13 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_devname = xstrdup ( (*ent)->mt_resource);
me->me_mountdir = xstrdup( (*ent)->mt_directory);
me->me_type = xstrdup ((*ent)->mt_fstype);
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
endmnttbl();
}
@@ -508,33 +533,69 @@ read_filesystem_list (need_fs_type, all_fs)
char *table = MNTTAB;
FILE *fp;
int ret;
int lockfd = -1;
# if defined F_RDLCK && defined F_SETLKW
/* MNTTAB_LOCK is a macro name of our own invention; it's not present in
e.g. Solaris 2.6. If the SVR4 folks ever define a macro
for this file name, we should use their macro name instead.
(Why not just lock MNTTAB directly? We don't know.) */
# ifndef MNTTAB_LOCK
# define MNTTAB_LOCK "/etc/.mnttab.lock"
# endif
lockfd = open (MNTTAB_LOCK, O_RDONLY);
if (0 <= lockfd)
{
struct flock flock;
flock.l_type = F_RDLCK;
flock.l_whence = SEEK_SET;
flock.l_start = 0;
flock.l_len = 0;
while (fcntl (lockfd, F_SETLKW, &flock) == -1)
if (errno != EINTR)
{
int saved_errno = errno;
close (lockfd);
errno = saved_errno;
return NULL;
}
}
else if (errno != ENOENT)
return NULL;
# endif
errno = 0;
fp = fopen (table, "r");
if (fp == NULL)
return NULL;
while ((ret = getmntent (fp, &mnt)) == 0)
ret = errno;
else
{
/* Don't show automounted filesystems twice on e.g., Solaris. */
if (!all_fs && MNT_IGNORE (&mnt))
continue;
while ((ret = getmntent (fp, &mnt)) == 0)
{
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (mnt.mnt_special);
me->me_mountdir = xstrdup (mnt.mnt_mountp);
me->me_type = xstrdup (mnt.mnt_fstype);
me->me_dummy = MNT_IGNORE (&mnt) != 0;
me->me_remote = ME_REMOTE (me->me_devname, me->me_type);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (mnt.mnt_special);
me->me_mountdir = xstrdup (mnt.mnt_mountp);
me->me_type = xstrdup (mnt.mnt_fstype);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
*mtail = me;
mtail = &me->me_next;
}
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
ret = fclose (fp) == EOF ? errno : 0 < ret ? 0 : -1;
}
if (ret > 0)
return NULL;
if (fclose (fp) == EOF)
return NULL;
if (0 <= lockfd && close (lockfd) != 0)
ret = errno;
if (0 <= ret)
{
errno = ret;
goto free_then_fail;
}
}
#endif /* MOUNTED_GETMNTENT2. */
@@ -560,6 +621,7 @@ read_filesystem_list (need_fs_type, all_fs)
{
char *host, *path;
me->me_remote = 1;
/* Prepend the remote pathname. */
host = thisent + vmp->vmt_data[VMT_HOSTNAME].vmt_off;
path = thisent + vmp->vmt_data[VMT_OBJECT].vmt_off;
@@ -570,25 +632,43 @@ read_filesystem_list (need_fs_type, all_fs)
}
else
{
me->me_remote = 0;
me->me_devname = xstrdup (thisent +
vmp->vmt_data[VMT_OBJECT].vmt_off);
}
me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
me->me_dummy = ME_DUMMY (me->me_devname, me->me_type);
me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
me->me_next = NULL;
/* Add to the linked list. */
mtail->me_next = me;
mtail = me;
*mtail = me;
mtail = &me->me_next;
}
free (entries);
}
#endif /* MOUNTED_VMOUNT. */
/* Free the dummy head. */
me = mount_list;
mount_list = mount_list->me_next;
free (me);
*mtail = NULL;
return mount_list;
free_then_fail:
{
int saved_errno = errno;
*mtail = NULL;
while (mount_list)
{
me = mount_list->me_next;
free (mount_list->me_devname);
free (mount_list->me_mountdir);
/* FIXME: me_type is not always malloced. */
free (mount_list);
mount_list = me;
}
errno = saved_errno;
return NULL;
}
}

View File

@@ -1,5 +1,5 @@
/* mountlist.h -- declarations for list of mounted filesystems
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1998 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
@@ -22,11 +22,26 @@ struct mount_entry
char *me_mountdir; /* Mount point directory pathname. */
char *me_type; /* "nfs", "4.2", etc. */
dev_t me_dev; /* Device number of me_mountdir. */
unsigned int me_dummy : 1; /* Nonzero for dummy filesystems. */
unsigned int me_remote : 1; /* Nonzero for remote fileystems. */
struct mount_entry *me_next;
};
#if __STDC__
struct mount_entry *read_filesystem_list (int need_fs_type, int all_fs);
#else
struct mount_entry *read_filesystem_list ();
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
struct mount_entry *read_filesystem_list PARAMS ((int need_fs_type));
#ifndef ME_DUMMY
# define ME_DUMMY(fs_name, fs_type) \
(!strcmp (fs_type, "auto") || !strcmp (fs_type, "ignore"))
#endif
#ifndef ME_REMOTE
# define ME_REMOTE(fs_name, fs_type) (strchr (fs_name, ':') != 0)
#endif

View File

@@ -1,5 +1,5 @@
/* path-concat.c -- concatenate two arbitrary pathnames
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998 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
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -26,7 +26,7 @@
#endif
#include <stdio.h>
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# include <string.h>
#endif
#include <sys/types.h>

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1994, 1997, 1998 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -28,6 +28,8 @@
systems like Irix 5.3. */
#undef putenv
#include <sys/types.h>
#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
# include <stdlib.h>
#endif
@@ -51,6 +53,10 @@
extern char **environ;
#endif
#ifndef NULL
# define NULL 0
#endif
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
int

355
lib/quotearg.c Normal file
View File

@@ -0,0 +1,355 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998 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. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <quotearg.h>
#include <xalloc.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii (c)
#endif
#ifdef isgraph
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
#else
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
#endif
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#ifndef UCHAR_MAX
# define UCHAR_MAX ((unsigned char) -1)
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#define INT_BITS (sizeof (int) * CHAR_BIT)
struct quoting_options
{
/* Basic quoting style. */
enum quoting_style style;
/* Quote the chararacters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
};
/* Names of quoting styles. */
char const *const quoting_style_args[] =
{
"literal", "shell", "shell-always", "c", "escape", 0
};
/* The default quoting options. */
static struct quoting_options default_quoting_options;
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *
clone_quoting_options (struct quoting_options *o)
{
struct quoting_options *p
= (struct quoting_options *) xmalloc (sizeof (struct quoting_options));
*p = *(o ? o : &default_quoting_options);
return p;
}
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style
get_quoting_style (struct quoting_options *o)
{
return (o ? o : &default_quoting_options)->style;
}
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void
set_quoting_style (struct quoting_options *o, enum quoting_style s)
{
(o ? o : &default_quoting_options)->style = s;
}
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int
set_char_quoting (struct quoting_options *o, char c, int i)
{
unsigned char uc = c;
int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
int shift = uc % INT_BITS;
int r = (*p >> shift) & 1;
*p ^= ((i & 1) ^ r) << shift;
return r;
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
size_t
quotearg_buffer (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o)
{
unsigned char c;
size_t i;
size_t len;
int quote_mark;
struct quoting_options const *p = o ? o : &default_quoting_options;
enum quoting_style quoting_style = p->style;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case shell_quoting_style:
if (! (argsize == -1 ? arg[0] == '\0' : argsize == 0))
{
switch (arg[0])
{
case '#': case '~':
break;
default:
len = 0;
for (i = 0; ; i++)
{
if (argsize == -1 ? arg[i] == '\0' : i == argsize)
goto done;
c = arg[i];
switch (c)
{
case '\t': case '\n': case ' ':
case '!': /* special in csh */
case '"': case '$': case '&': case '\'':
case '(': case ')': case '*': case ';':
case '<': case '>': case '?': case '[': case '\\':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
goto needs_quoting;
}
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
goto needs_quoting;
STORE (c);
}
needs_quoting:;
break;
}
}
/* Fall through. */
case shell_always_quoting_style:
quote_mark = '\'';
break;
case c_quoting_style:
quote_mark = '"';
break;
default:
quote_mark = 0;
break;
}
len = 0;
if (quote_mark)
STORE (quote_mark);
for (i = 0; ! (argsize == -1 ? arg[i] == '\0' : i == argsize); i++)
{
c = arg[i];
switch (quoting_style)
{
case literal_quoting_style:
break;
case shell_quoting_style:
case shell_always_quoting_style:
if (c == '\'')
{
STORE ('\'');
STORE ('\\');
STORE ('\'');
}
break;
case c_quoting_style:
case escape_quoting_style:
switch (c)
{
case '?': /* Do not generate trigraphs. */
case '\\': goto store_escape;
/* Not all C compilers know what \a means. */
case 7 : c = 'a'; goto store_escape;
case '\b': c = 'b'; goto store_escape;
case '\f': c = 'f'; goto store_escape;
case '\n': c = 'n'; goto store_escape;
case '\r': c = 'r'; goto store_escape;
case '\t': c = 't'; goto store_escape;
case '\v': c = 'v'; goto store_escape;
case ' ':
if (quoting_style == escape_quoting_style)
goto store_escape;
break;
case '"':
if (quoting_style == c_quoting_style)
goto store_escape;
break;
default:
if (!ISGRAPH (c))
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 3));
c = '0' + (c & 3);
goto store_c;
}
break;
}
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
}
store_c:
STORE (c);
}
if (quote_mark)
STORE (quote_mark);
done:
if (len < buffersize)
buffer[len] = '\0';
return len;
}
/* Use storage slot N to return a quoted version of the string ARG.
OPTIONS specifies the quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. */
static char *
quotearg_n_options (int n, char const *arg, struct quoting_options *options)
{
static unsigned nslots;
static struct slotvec
{
size_t size;
char *val;
} *slotvec;
if (nslots <= n)
{
int n1 = n + 1;
size_t s = n1 * sizeof (struct slotvec);
if (! (0 < n1 && n1 == s / sizeof (struct slotvec)))
abort ();
slotvec = (struct slotvec *) xrealloc (slotvec, s);
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec));
nslots = n;
}
{
size_t size = slotvec[n].size;
char *val = slotvec[n].val;
size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options);
if (size <= qsize)
{
slotvec[n].size = size = qsize + 1;
slotvec[n].val = val = xrealloc (val, size);
quotearg_buffer (val, size, arg, (size_t) -1, options);
}
return val;
}
}
char *
quotearg_n (int n, char const *arg)
{
return quotearg_n_options (n, arg, &default_quoting_options);
}
char *
quotearg (char const *arg)
{
return quotearg_n (0, arg);
}
char *
quotearg_char (char const *arg, char ch)
{
struct quoting_options options;
options = default_quoting_options;
set_char_quoting (&options, ch, 1);
return quotearg_n_options (0, arg, &options);
}
char *
quotearg_colon (char const *arg)
{
return quotearg_char (arg, ':');
}

99
lib/quotearg.h Normal file
View File

@@ -0,0 +1,99 @@
/* quotearg.h - quote arguments for output
Copyright (C) 1998 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. */
/* Written by Paul Eggert <eggert@twinsun.com> */
/* Basic quoting styles. */
enum quoting_style
{
literal_quoting_style, /* --quoting-style=literal */
shell_quoting_style, /* --quoting-style=shell */
shell_always_quoting_style, /* --quoting-style=shell-always */
c_quoting_style, /* --quoting-style=c */
escape_quoting_style /* --quoting-style=escape */
};
/* For now, --quoting-style=literal is the default, but
this is planned to change to --quoting-style=shell in the future. */
#ifndef DEFAULT_QUOTING_STYLE
# define DEFAULT_QUOTING_STYLE literal_quoting_style
#endif
/* Names of quoting styles. */
extern char const *const quoting_style_args[];
struct quoting_options;
#ifndef PARAMS
# if defined PROTOTYPES || defined __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
/* The functions listed below set and use a hidden variable
that contains the default quoting style options. */
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *clone_quoting_options
PARAMS ((struct quoting_options *o));
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style get_quoting_style PARAMS ((struct quoting_options *o));
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void set_quoting_style PARAMS ((struct quoting_options *o,
enum quoting_style s));
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int set_char_quoting PARAMS ((struct quoting_options *o, char c, int i));
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
size_t quotearg_buffer PARAMS ((char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o));
/* Use storage slot N to return a quoted version of the string ARG.
Use the default quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. */
char *quotearg_n PARAMS ((int n, char const *arg));
/* Equivalent to quotearg_n (ARG, 0). */
char *quotearg PARAMS ((char const *arg));
/* Like quotearg (ARG), except also quote any instances of CH. */
char *quotearg_char PARAMS ((char const *arg, char ch));
/* Equivalent to quotearg_char (ARG, ':'). */
char *quotearg_colon PARAMS ((char const *arg));

View File

@@ -1,5 +1,5 @@
/* GNU's read utmp module.
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 92, 93, 94, 95, 96, 1997, 1998 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
@@ -34,8 +34,7 @@ char *xmalloc ();
trailing spaces from the copy, NUL terminate it, and return the copy. */
char *
extract_trimmed_name (ut)
const STRUCT_UTMP *ut;
extract_trimmed_name (const STRUCT_UTMP *ut)
{
char *p, *trimmed_name;
@@ -54,11 +53,74 @@ extract_trimmed_name (ut)
number of entries read, and return zero. If there is any error,
return non-zero and don't modify the parameters. */
#ifdef HAVE_UTMPNAME
int
read_utmp (filename, n_entries, utmp_buf)
const char *filename;
int *n_entries;
STRUCT_UTMP **utmp_buf;
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
{
int count_utmp = 0;
int n_read;
STRUCT_UTMP *u;
STRUCT_UTMP *uptr;
STRUCT_UTMP *utmp_contents;
if (utmpname (filename))
{
return 1;
}
/* FIXME: going through the list twice is wasteful. */
/* count the entries in utmp */
setutent ();
while ((u = getutent ()) != NULL)
++count_utmp;
if (count_utmp == 0)
return 0;
utmp_contents = (STRUCT_UTMP *) xmalloc (count_utmp * sizeof (STRUCT_UTMP));
/* read the entries in utmp */
/* FIXME: can this fail? */
setutent ();
n_read = 0;
uptr = utmp_contents;
while ((u = getutent ()) != NULL)
{
++n_read;
if (n_read > count_utmp)
{
STRUCT_UTMP *old_utmp_contents = utmp_contents;
++count_utmp;
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
(count_utmp
* sizeof (STRUCT_UTMP)));
uptr = utmp_contents + (uptr - old_utmp_contents);
}
*uptr = *u;
++uptr;
}
if (n_read != count_utmp)
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
n_read * sizeof (STRUCT_UTMP));
/* FIXME: can this fail? */
endutent ();
*n_entries = n_read;
*utmp_buf = utmp_contents;
return 0;
}
#else
int
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
{
FILE *utmp;
struct stat file_stats;
@@ -91,3 +153,5 @@ read_utmp (filename, n_entries, utmp_buf)
return 0;
}
#endif /* HAVE_UTMPNAME */

View File

@@ -1,5 +1,5 @@
/* Declarations for GNU's read utmp module.
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 92, 93, 94, 95, 96, 1997, 1998 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
@@ -20,6 +20,14 @@
#ifndef __READUTMP_H__
# define __READUTMP_H__
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
# include <stdio.h>
# include <sys/types.h>

File diff suppressed because it is too large Load Diff

View File

@@ -2,24 +2,24 @@
expression library, version 0.12.
Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
the C library, however. The master source lives in /gd/gnu/lib.
NOTE: The canonical source of this file is maintained with the
GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
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 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.
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. */
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. */
#ifndef _REGEX_H
#define _REGEX_H 1
@@ -32,10 +32,10 @@ extern "C" {
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
should be there. */
#include <stddef.h>
# include <stddef.h>
#endif
/* The following two types have to be signed and unsigned integer type
@@ -240,7 +240,7 @@ extern reg_syntax_t re_syntax_options;
(erroneously) define this in other header files, but we want our
value, so remove any previous define. */
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
# undef RE_DUP_MAX
#endif
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
#define RE_DUP_MAX (0x7fff)
@@ -283,6 +283,10 @@ extern reg_syntax_t re_syntax_options;
`re_error_msg' table in regex.c. */
typedef enum
{
#if (_XOPEN_SOURCE - 0) == 500
REG_NOSYS = -1, /* This will never happen for this implementation. */
#endif
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */
@@ -314,7 +318,7 @@ typedef enum
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
#define RE_TRANSLATE_TYPE char *
# define RE_TRANSLATE_TYPE char *
#endif
struct re_pattern_buffer
@@ -405,7 +409,7 @@ struct re_registers
`re_match_2' returns information about at least this many registers
the first time a `regs' structure is passed. */
#ifndef RE_NREGS
#define RE_NREGS 30
# define RE_NREGS 30
#endif
@@ -428,21 +432,25 @@ typedef struct
#if __STDC__
#define _RE_ARGS(args) args
# define _RE_ARGS(args) args
#else /* not __STDC__ */
#define _RE_ARGS(args) ()
# define _RE_ARGS(args) ()
#endif /* not __STDC__ */
/* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the `re_syntax_options' variable. */
extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
/* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
extern const char *__re_compile_pattern
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
extern const char *re_compile_pattern
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
@@ -451,6 +459,7 @@ extern const char *re_compile_pattern
/* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an
internal error. */
extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
@@ -459,6 +468,9 @@ extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */
extern int __re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
extern int re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
@@ -466,6 +478,10 @@ extern int re_search
/* Like `re_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */
extern int __re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs, int stop));
extern int re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
@@ -474,12 +490,19 @@ extern int re_search_2
/* Like `re_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */
extern int __re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
extern int re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
extern int __re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
@@ -498,27 +521,41 @@ extern int re_match_2
Unless this function is called, the first search or match using
PATTERN_BUFFER will allocate its own register data, without
freeing the old data. */
extern void __re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
extern void re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
#ifdef _REGEX_RE_COMP
#ifndef _CRAY
# ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
#endif
# endif
#endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
extern int regexec
_RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags));
extern size_t regerror
_RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
size_t errbuf_size));
extern void regfree _RE_ARGS ((regex_t *preg));
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
extern int __regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern int regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
extern void __regfree _RE_ARGS ((regex_t *__preg));
extern void regfree _RE_ARGS ((regex_t *__preg));
#ifdef __cplusplus

View File

@@ -1,6 +1,6 @@
/* Determine whether string value is affirmation or negative response
according to current locale's data.
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996, 1998 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
@@ -30,11 +30,7 @@
#endif
#include <sys/types.h>
#if WITH_REGEX
# include <regex.h>
#else
# include <rx.h>
#endif
#include <regex.h>
#if ENABLE_NLS
# include <libintl.h>

View File

@@ -1,5 +1,5 @@
/* safe-read.c -- an interface to read that retries after interrupts
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1998 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
@@ -31,17 +31,16 @@
extern int errno;
#endif
#include "safe-read.h"
/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted.
Return the actual number of bytes read, zero for EOF, or negative
for an error. */
int
safe_read (desc, ptr, len)
int desc;
char *ptr;
int len;
ssize_t
safe_read (int desc, void *ptr, size_t len)
{
int n_chars;
ssize_t n_chars;
if (len <= 0)
return len;

10
lib/safe-read.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
ssize_t
safe_read PARAMS ((int desc, void *ptr, size_t len));

View File

@@ -1,5 +1,5 @@
/* save-cwd.c -- Save and restore current working directory.
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
Copyright (C) 1995, 1997, 1998 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
@@ -17,7 +17,7 @@
/* Written by Jim Meyering <meyering@na-net.ornl.gov>. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include "config.h"
#endif
@@ -27,11 +27,11 @@
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#if HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
@@ -67,7 +67,7 @@ save_cwd (cwd)
if (have_working_fchdir)
{
#ifdef HAVE_FCHDIR
#if HAVE_FCHDIR
cwd->desc = open (".", O_RDONLY);
if (cwd->desc < 0)
{

View File

@@ -8,7 +8,7 @@ struct saved_cwd
};
# ifndef PARAMS
# if __STDC__
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()

View File

@@ -1,5 +1,5 @@
/* savedir.c -- save the list of files in a directory in a string
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
Copyright (C) 1990, 1997, 1998 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
@@ -17,13 +17,13 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif

View File

@@ -1,7 +1,7 @@
/* Work around the bug in some systems whereby stat succeeds when
given the zero-length file name argument. The stat from SunOS4.1.4
has this bug.
Copyright (C) 1997 Free Software Foundation, Inc.
Copyright (C) 1997, 1998 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
@@ -33,7 +33,13 @@
extern int errno;
#endif
/* FIXME: describe. */
/* This is a wrapper for stat(2).
If FILE is the empty string, fail with errno == ENOENT.
Otherwise, return the result of calling the real stat.
This works around the bug in some systems whereby stat succeeds when
given the zero-length file name argument. The stat from SunOS4.1.4
has this bug. */
int
rpl_stat (file, sbuf)
@@ -42,7 +48,7 @@ rpl_stat (file, sbuf)
{
if (file && *file == 0)
{
errno = EINVAL;
errno = ENOENT;
return -1;
}

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
/* stpcpy.c -- copy a string and return pointer to end of new string
Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.

View File

@@ -1,5 +1,5 @@
/* strdup.c -- return a newly allocated copy of a string
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1998 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
@@ -15,13 +15,13 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef STDC_HEADERS
#include <string.h>
#include <stdlib.h>
# include <string.h>
# include <stdlib.h>
#else
char *malloc ();
char *strcpy ();

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -490,7 +490,7 @@ my_strftime (s, maxsize, format, tp)
for (f = format; *f != '\0'; ++f)
{
int pad; /* Padding for number ('-', '_', or 0). */
int pad = 0; /* Padding for number ('-', '_', or 0). */
int modifier; /* Field modifier ('E', 'O', or 0). */
int digits; /* Max digits for numeric format. */
int number_value; /* Numeric value to be printed. */
@@ -580,7 +580,6 @@ my_strftime (s, maxsize, format, tp)
#endif /* ! DO_MULTIBYTE */
/* Check for flags that can modify a format. */
pad = 0;
while (1)
{
switch (*++f)

View File

@@ -1,5 +1,5 @@
/* userspec.c -- Parse a user and group string.
Copyright (C) 1989, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1991, 1992, 1997, 1998 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
@@ -24,7 +24,7 @@
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
# ifdef HAVE_ALLOCA_H
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
@@ -85,7 +85,9 @@ struct group *getgrgid ();
#define isdigit(c) ((c) >= '0' && (c) <= '9')
#ifndef strdup
char *strdup ();
#endif
/* Return nonzero if STR represents an unsigned decimal integer,
otherwise return 0. */
@@ -153,6 +155,15 @@ parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg)
if (u == NULL && g == NULL)
return "can not omit both user and group";
#ifdef __DJGPP__
/* Pretend that we are the user U whose group is G. This makes
pwd and grp functions ``know'' about the UID and GID of these. */
if (u && !is_number (u))
setenv ("USER", u, 1);
if (g && !is_number (g))
setenv ("GROUP", g, 1);
#endif
if (u != NULL)
{
pwd = getpwnam (u);

81
lib/utime.c Normal file
View File

@@ -0,0 +1,81 @@
/* Copyright (C) 1998 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. */
/* derived from a function in touch.c */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef utime
#include <sys/types.h>
#ifdef HAVE_UTIME_H
# include <utime.h>
#endif
#include "safe-read.h"
/* Some systems (even some that do have <utime.h>) don't declare this
structure anywhere. */
#ifndef HAVE_STRUCT_UTIMBUF
struct utimbuf
{
long actime;
long modtime;
};
#endif
/* Emulate utime (file, NULL) for systems (like 4.3BSD) that do not
interpret it to set the access and modification times of FILE to
the current time. Return 0 if successful, -1 if not. */
static int
utime_null (const char *file)
{
#if HAVE_UTIMES_NULL
return utimes (file, 0);
#else
int fd;
char c;
int status = 0;
struct stat sb;
fd = open (file, O_RDWR, 0666);
if (fd < 0
|| fstat (fd, &sb) < 0
|| safe_read (fd, &c, sizeof (char)) < 0
|| lseek (fd, (off_t) 0, SEEK_SET) < 0
|| full_write (fd, &c, sizeof (char)) < 0
/* Maybe do this -- it's necessary on SunOS4.1.3 with some combination
of patches, but that system doesn't use this code: it has utimes.
|| fsync (fd) < 0
*/
|| ftruncate (fd, st.st_size) < 0
|| close (fd) < 0)
status = -1;
return status;
#endif
}
int
rpl_utime (const char *file, const struct utimbuf *times)
{
if (times)
return utime (file, times);
return utime_null (file);
}

View File

@@ -1,5 +1,5 @@
/* xstrdup.c -- copy a string with out of memory checking
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
Copyright (C) 1990, 1996, 1998 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
@@ -19,24 +19,28 @@
# include <config.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
#if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if defined (__STDC__) && __STDC__
char *xmalloc (size_t);
char *xstrdup (char *string);
#else
char *xmalloc ();
#endif
#include <sys/types.h>
char *xmalloc PARAMS ((size_t n));
/* Return a newly allocated copy of STRING. */
char *
xstrdup (string)
char *string;
xstrdup (const char *string)
{
return strcpy (xmalloc (strlen (string) + 1), string);
}

View File

@@ -1,12 +1,13 @@
#ifndef XSTRTOD_H
# define XSTRTOD_H 1
#undef PARAMS
#if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
#else
# define PARAMS(Args) ()
#endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
int
xstrtod PARAMS ((const char *str, const char **ptr, double *result));

View File

@@ -1,5 +1,5 @@
/* A more useful interface to strtol.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1998 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
@@ -21,6 +21,10 @@
# include <config.h>
#endif
/* Some pre-ANSI implementations (e.g. SunOS 4)
need stderr defined if assertion checking is enabled. */
#include <stdio.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
@@ -34,7 +38,6 @@
# endif
#endif
#define NDEBUG
#include <assert.h>
#include <errno.h>
@@ -46,47 +49,66 @@ extern int errno;
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
/* The extra casts work around common compiler bugs. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
It is necessary at least when t == time_t. */
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
#define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t))
#ifndef ULONG_MAX
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
# define ULONG_MAX TYPE_MAXIMUM (unsigned long int)
#endif
#ifndef LONG_MAX
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
# define LONG_MAX TYPE_MAXIMUM (long int)
#endif
#include "xstrtol.h"
#define BKM_SCALE(x, scale_factor, error_return) \
do \
{ \
if ((x) > (double) __ZLONG_MAX / (scale_factor)) \
return (error_return); \
(x) *= (scale_factor); \
} \
while (0)
__unsigned long int __strtol ();
static int
bkm_scale (__unsigned long int *x, int scale_factor)
{
__unsigned long int product = *x * scale_factor;
if (*x != product / scale_factor)
return 1;
*x = product;
return 0;
}
static int
bkm_scale_by_power (__unsigned long int *x, int base, int power)
{
while (power--)
if (bkm_scale (x, base))
return 1;
return 0;
}
/* FIXME: comment. */
strtol_error
__xstrtol (s, ptr, base, val, valid_suffixes)
const char *s;
char **ptr;
int base;
__unsigned long int *val;
const char *valid_suffixes;
__xstrtol (const char *s, char **ptr, int strtol_base,
__unsigned long int *val, const char *valid_suffixes)
{
char *t_ptr;
char **p;
__unsigned long int tmp;
assert (0 <= base && base <= 36);
assert (0 <= strtol_base && strtol_base <= 36);
p = (ptr ? ptr : &t_ptr);
errno = 0;
tmp = __strtol (s, p, base);
tmp = __strtol (s, p, strtol_base);
if (errno != 0)
return LONGINT_OVERFLOW;
if (*p == s)
@@ -103,40 +125,92 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
if (**p != '\0')
{
int base = 1024;
int suffixes = 1;
int overflow;
if (!strchr (valid_suffixes, **p))
return LONGINT_INVALID_SUFFIX_CHAR;
if (strchr (valid_suffixes, '0'))
{
/* The ``valid suffix'' '0' is a special flag meaning that
an optional second suffix is allowed, which can change
the base, e.g. "100MD" for 100 megabytes decimal. */
switch (p[0][1])
{
case 'B':
suffixes++;
break;
case 'D':
base = 1000;
suffixes++;
break;
}
}
switch (**p)
{
case 'b':
BKM_SCALE (tmp, 512, LONGINT_OVERFLOW);
++(*p);
break;
case 'c':
++(*p);
overflow = bkm_scale (&tmp, 512);
break;
case 'B':
case 'k':
BKM_SCALE (tmp, 1024, LONGINT_OVERFLOW);
++(*p);
overflow = bkm_scale (&tmp, 1024);
break;
case 'm':
BKM_SCALE (tmp, 1024 * 1024, LONGINT_OVERFLOW);
++(*p);
case 'c':
overflow = 0;
break;
case 'E': /* Exa */
overflow = bkm_scale_by_power (&tmp, base, 6);
break;
case 'G': /* Giga */
overflow = bkm_scale_by_power (&tmp, base, 3);
break;
case 'k': /* kilo */
overflow = bkm_scale_by_power (&tmp, base, 1);
break;
case 'M': /* Mega */
case 'm': /* 'm' is undocumented; for backward compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 2);
break;
case 'P': /* Peta */
overflow = bkm_scale_by_power (&tmp, base, 5);
break;
case 'T': /* Tera */
overflow = bkm_scale_by_power (&tmp, base, 4);
break;
case 'w':
BKM_SCALE (tmp, 2, LONGINT_OVERFLOW);
++(*p);
overflow = bkm_scale (&tmp, 2);
break;
case 'Y': /* Yotta */
overflow = bkm_scale_by_power (&tmp, base, 8);
break;
case 'Z': /* Zetta */
overflow = bkm_scale_by_power (&tmp, base, 7);
break;
default:
return LONGINT_INVALID_SUFFIX_CHAR;
break;
}
if (overflow)
return LONGINT_OVERFLOW;
(*p) += suffixes;
}
*val = tmp;

View File

@@ -5,12 +5,10 @@
# define __xstrtol xstrtoul
# define __strtol strtoul
# define __unsigned unsigned
# define __ZLONG_MAX ULONG_MAX
# else
# define __xstrtol xstrtol
# define __strtol strtol
# define __unsigned /* empty */
# define __ZLONG_MAX LONG_MAX
# endif
# ifndef PARAMS

View File

@@ -1,5 +1,5 @@
/* yesno.c -- read a yes/no response from stdin
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1998 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
@@ -15,12 +15,12 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <ctype.h>
#ifdef HAVE_STDLIB_H
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <stdio.h>

View File

@@ -1,3 +1,141 @@
1998-08-02 Jim Meyering <meyering@ascend.com>
* st_mtim.m4: Use hack to avoid having to put #undef HAVE_ST_MTIM
in acconfig.h manually.
1998-07-31 Paul Eggert <eggert@twinsun.com>
* st_mtim.m4: New file.
1998-07-28 Jim Meyering <meyering@ascend.com>
* utimes.m4: Undef stat.
1998-07-25 Jim Meyering <meyering@ascend.com>
* utime.m4 (jm_FUNC_UTIME): New file and macro.
* utimes.m4 (jm_FUNC_UTIMES_NULL): New file and macro.
1998-07-09 Manfred Hollstein <manfred@s-direktnet.de>
* chown.m4 (jm_FUNC_CHOWN): Add a check to verify that the
uid and gid actually remain unchanged.
1998-07-07 Jim Meyering <meyering@ascend.com>
* jm-glibc-io.m4: Remove fclose_unlocked.
1998-07-04 Jim Meyering <meyering@ascend.com>
* regex.m4: Use syscmd, ifelse, and sysval. Mainly as an exercise
to prove that this macro can be used in packages without regex.c.
1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* gettext.m4 (AM_WITH_NLS): Remove intl/libintl.h if <libintl.h>
is to be used.
1998-07-03 Jim Meyering <meyering@ascend.com>
* gettext.m4: Add -lintl if it's found to be necessary.
* gettext.m4: New file -- from gettext-0.10.35.
* lcmessage.m4: Likewise.
* progtest.m4: Likewise.
* regex.m4 (jm_WITH_REGEX): New file and macro.
* jm-macros.m4: Require the new macro.
1998-06-29 Jim Meyering <meyering@ascend.com>
* fstypename.m4: Include sys/param.h. NetBSD 1.3.1 requires this
for the definition of NGROUPS (used in a system header included
by sys/mount.h).
1998-06-28 Jim Meyering <meyering@ascend.com>
* ls-mntd-fs.m4: New file.
* fstypename.m4: New file.
* jm-macros.m4: Require the new macro.
* jm-glibc-io.m4: New file.
1998-05-19 Jim Meyering <meyering@ascend.com>
* jm-macros.m4: Add jm_FUNC_LCHOWN.
* lchown.m4: New file.
* Makefile.am.in: New file.
* Makefile.am (Makefile.am): Depend on Makefile.am.in.
1998-05-14 Jim Meyering <meyering@ascend.com>
* Makefile.am (EXTRA_DIST): Add them.
* jm-macros.m4: New file.
* utimbuf.m4: New file.
1998-05-12 Jim Meyering <meyering@ascend.com>
* Makefile.am (EXTRA_DIST): Add isc-posix.m4.
1998-05-11 Jim Meyering <meyering@ascend.com>
* isc-posix.m4: New file.
1998-05-10 Jim Meyering <meyering@ascend.com>
* jm-mktime.m4: Use AM_FUNC_MKTIME, now that it's up to date.
1998-05-09 Jim Meyering <meyering@ascend.com>
* Makefile.am (EXTRA_DIST): Add ssize_t.m4.
(EXTRA_DIST): Remove mktime.m4, now that the new version is included
with automake.
* ssize_t.m4: New file.
* mktime.m4: Remove file -- the new automake has this now.
1998-04-26 Jim Meyering <meyering@ascend.com>
* assert.m4: New file.
* Makefile.am (EXTRA_DIST): Add assert.m4.
1998-04-05 Jim Meyering <meyering@ascend.com>
* prereq.m4 (jm_PREREQ_REGEX): New macro.
(jm_PREREQ): Use it here.
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
* inttypes_h.m4: Kludges so I don't have to add HAVE_INTTYPES_H
in acconfig.h.
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
* prereq.m4: New file.
* error.m4: New file.
* Makefile.am (EXTRA_DIST): Add error.m4 and prereq.m4.
1998-02-07 Jim Meyering <meyering@eng.ascend.com>
* getline.m4: Don't set am_cv_func_working_getline before the
cache-check for the same variable -- that defeated the purpose of
the test; the test program was never run. This was a problem only
on systems with losing getline functions -- HP-UX 10.20 is one.
Reported by Bjorn Helgaas.
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
* Makefile.am (EXTRA_DIST): Add perl.m4.
1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (EXTRA_DIST): Add const.m4.
* const.m4: New file. Use an initializer in this declaration
typedef int charset[2]; const charset x;
Reported by Bob Glickstein.
1997-12-21 Jim Meyering <meyering@na-net.ornl.gov>
* chown.m4: Fix reversed types on -1 args to chown.

View File

@@ -1,11 +1,25 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
# Generate this list with
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
check-decl.m4 chown.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 getline.m4 \
getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lfs.m4 \
lstat.m4 malloc.m4 memcmp.m4 putenv.m4 readdir.m4 realloc.m4 \
stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
mktime.m4
##m4-files-begin
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fstypename.m4 getgroups.m4 \
getline.m4 getloadavg.m4 gettext.m4 inttypes_h.m4 isc-posix.m4 \
jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 \
lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 lstat.m4 malloc.m4 memcmp.m4 \
perl.m4 prereq.m4 progtest.m4 putenv.m4 readdir.m4 realloc.m4 regex.m4 \
ssize_t.m4 st_mtim.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
utimbuf.m4 utime.m4 utimes.m4
##m4-files-end
Makefile.am: Makefile.am.in
rm -f $@ $@t
sed -n '1,/^##m4-files-begin/p' $< > $@t
( echo EXTRA_DIST = README Makefile.am.in; \
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|fmt | (tr '\012' @; echo) \
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
>> $@t
sed -n '/^##m4-files-end/,$$p' $< >> $@t
chmod a-w $@t
mv $@t $@

16
m4/Makefile.am.in Normal file
View File

@@ -0,0 +1,16 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
##m4-files-begin
##m4-files-end
Makefile.am: Makefile.am.in
rm -f $@ $@t
sed -n '1,/^##m4-files-begin/p' $< > $@t
( echo EXTRA_DIST = README Makefile.am.in; \
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|fmt | (tr '\012' @; echo) \
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
>> $@t
sed -n '/^##m4-files-end/,$$p' $< >> $@t
chmod a-w $@t
mv $@t $@

View File

@@ -1,19 +1,14 @@
# Makefile.in generated automatically by automake 1.2d from Makefile.am
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Generate this list with
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
SHELL = /bin/sh
@@ -36,6 +31,8 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -70,12 +67,12 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
@@ -92,12 +89,14 @@ VERSION = @VERSION@
YACC = @YACC@
l = @l@
EXTRA_DIST = README \
check-decl.m4 chown.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 getline.m4 \
getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lfs.m4 \
lstat.m4 malloc.m4 memcmp.m4 putenv.m4 readdir.m4 realloc.m4 \
stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
mktime.m4
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 fstypename.m4 getgroups.m4 \
getline.m4 getloadavg.m4 gettext.m4 inttypes_h.m4 isc-posix.m4 \
jm-glibc-io.m4 jm-macros.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 \
lchown.m4 lcmessage.m4 lfs.m4 ls-mntd-fs.m4 lstat.m4 malloc.m4 memcmp.m4 \
perl.m4 prereq.m4 progtest.m4 putenv.m4 readdir.m4 realloc.m4 regex.m4 \
ssize_t.m4 st_mtim.m4 stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
utimbuf.m4 utime.m4 utimes.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
@@ -108,13 +107,13 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
all: Makefile
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -154,8 +153,6 @@ install: install-exec install-data all
uninstall:
all: Makefile
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
@@ -186,12 +183,24 @@ maintainer-clean: maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default tags distdir info dvi installcheck install-exec \
install-data install uninstall all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
.PHONY: tags distdir info dvi installcheck install-exec install-data \
install uninstall all installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
Makefile.am: Makefile.am.in
rm -f $@ $@t
sed -n '1,/^##m4-files-begin/p' $< > $@t
( echo EXTRA_DIST = README Makefile.am.in; \
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|fmt | (tr '\012' @; echo) \
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
>> $@t
sed -n '/^##m4-files-end/,$$p' $< >> $@t
chmod a-w $@t
mv $@t $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -2,3 +2,7 @@ These files are used by a program called aclocal (part of the GNU automake
package). aclocal uses these files to create aclocal.m4 which is in turn
used by autoconf to create the configure script at the the top level in
this distribution.
The Makefile.am file in this directory is automatically generated
from the template file, Makefile.am.in. The generation will fail
if you don't have all the right tools.

13
m4/assert.m4 Normal file
View File

@@ -0,0 +1,13 @@
#serial 1
dnl based on code from Eleftherios Gkioulekas
AC_DEFUN(jm_ASSERT,
[
AC_MSG_CHECKING(whether to enable assertions)
AC_ARG_ENABLE(assert,
[ --disable-assert turn off assertions],
[ AC_MSG_RESULT(no)
AC_DEFINE(NDEBUG) ],
[ AC_MSG_RESULT(yes) ]
)
])

View File

@@ -17,6 +17,7 @@ AC_DEFUN(jm_FUNC_CHOWN,
AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
[AC_TRY_RUN([
# include <sys/types.h>
# include <stat.h>
# include <fcntl.h>
# ifdef HAVE_UNISTD_H
# include <unistd.h>
@@ -28,7 +29,14 @@ AC_DEFUN(jm_FUNC_CHOWN,
char *f = "conftestchown";
if (creat (f, 0600) < 0)
exit (1);
exit (chown (f, (uid_t) -1, (gid_t) -1) == -1 ? 1 : 0);
if (stat (f, &before) < 0)
exit (1);
if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
exit (1);
if (stat (f, &after) < 0)
exit (1);
exit ((before.st_uid == after.st_uid
&& before.st_gid == after.st_gid) ? 0 : 1);
}
],
jm_cv_func_working_chown=yes,

66
m4/const.m4 Normal file
View File

@@ -0,0 +1,66 @@
#serial 1
dnl Just like AC_C_CONST from autoconf-2.12, but with an initializer
dnl for `charset x' and with
dnl AC_DEFINE(const, )
dnl changed to
dnl AC_DEFINE_UNQUOTED(const, [/* empty */])
dnl to avoid this warning:
dnl [...]/m4: Warning: Excess arguments to built-in `define' ignored
undefine([AC_C_CONST])
AC_DEFUN(AC_C_CONST,
[dnl This message is consistent in form with the other checking messages,
dnl and with the result message.
AC_CACHE_CHECK([for working const], ac_cv_c_const,
[AC_TRY_COMPILE(,
changequote(<<, >>)dnl
<<
/* Ultrix mips cc rejects this. */
typedef int charset[2]; const charset x = {0, 0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* AIX XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in an arm
of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; };
struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
}
>>,
changequote([, ])dnl
ac_cv_c_const=yes, ac_cv_c_const=no)])
if test $ac_cv_c_const = no; then
AC_DEFINE_UNQUOTED(const, [/* empty */])
fi
])

11
m4/error.m4 Normal file
View File

@@ -0,0 +1,11 @@
#serial 1
dnl FIXME: put these prerequisite-only *.m4 files in a separate
dnl directory -- otherwise, they'll conflict with existing files.
dnl These are the prerequisite macros for GNU's error.c file.
AC_DEFUN(jm_PREREQ_ERROR,
[
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
AC_HEADER_STDC
])

42
m4/fstypename.m4 Normal file
View File

@@ -0,0 +1,42 @@
#serial 1
dnl From Jim Meyering.
dnl
dnl See if struct statfs has the f_fstypename member.
dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
dnl
AC_DEFUN(jm_FSTYPENAME,
[
AC_CACHE_CHECK([for f_fstypename in struct statfs],
fu_cv_sys_f_fstypename_in_statfs,
[
AC_TRY_COMPILE(
[
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mount.h>
],
[struct statfs s; int i = sizeof s.f_fstypename;],
fu_cv_sys_f_fstypename_in_statfs=yes,
fu_cv_sys_f_fstypename_in_statfs=no
)
]
)
if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
if test x = y; then
# This code is deliberately never run via ./configure.
# FIXME: this is a hack to make autoheader put the corresponding
# HAVE_* undef for this symbol in config.h.in. This saves me the
# trouble of having to maintain the #undef in acconfig.h manually.
AC_CHECK_FUNCS(F_FSTYPENAME_IN_STATFS)
fi
# Defining it this way (rather than via AC_DEFINE) short-circuits the
# autoheader check -- autoheader doesn't know it's already been taken
# care of by the hack above.
ac_kludge=HAVE_F_FSTYPENAME_IN_STATFS
AC_DEFINE_UNQUOTED($ac_kludge)
fi
]
)

View File

@@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl See if there's a working, system-supplied version of the getline function.
dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
@@ -7,7 +7,6 @@ dnl to do with the function we need.
AC_DEFUN(AM_FUNC_GETLINE,
[dnl
am_getline_needs_run_time_check=no
am_cv_func_working_getline=yes
AC_CHECK_FUNC(getline,
dnl Found it in some library. Verify that it works.
am_getline_needs_run_time_check=yes,

324
m4/gettext.m4 Normal file
View File

@@ -0,0 +1,324 @@
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 105
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_CHECK_LIB(intl, gettext,
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)])
if test "$gt_cv_func_gettext_libintl" = yes; then
LIBS="$LIBS -lintl"
fi
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
if test -z "$nsl_cv_header_intl"; then
# Clean out junk possibly left behind by a previous configuration.
rm -f intl/libintl.h
fi
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h sys/param.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
strdup __argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl The reference to <locale.h> in the installed <libintl.h> file
dnl must be resolved because we cannot expect the users of this
dnl to define HAVE_LOCALE_H.
if test $ac_cv_header_locale_h = yes; then
INCLUDE_LOCALE_H="#include <locale.h>"
else
INCLUDE_LOCALE_H="\
/* The system does not provide the header <locale.h>. Take care yourself. */"
fi
AC_SUBST(INCLUDE_LOCALE_H)
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl *** For now the libtool support in intl/Makefile is not for real.
l=
AC_SUBST(l)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])

View File

@@ -1,4 +1,4 @@
#serial 1
#serial 2
dnl From Paul Eggert.
@@ -7,6 +7,12 @@ dnl From Paul Eggert.
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
[
if test x = y; then
dnl This code is deliberately never run via ./configure.
dnl FIXME: this is a gross hack to make autoheader put an entry
dnl for `HAVE_INTTYPES_H' in config.h.in.
AC_CHECK_FUNCS(INTTYPES_H)
fi
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
@@ -15,6 +21,7 @@ AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
jm_ac_cv_header_inttypes_h=yes,
jm_ac_cv_header_inttypes_h=no)])
if test $jm_ac_cv_header_inttypes_h = yes; then
AC_DEFINE(HAVE_INTTYPES_H)
ac_kludge=HAVE_INTTYPES_H
AC_DEFINE_UNQUOTED($ac_kludge)
fi
])

16
m4/isc-posix.m4 Normal file
View File

@@ -0,0 +1,16 @@
#serial 1
dnl This test replaces the one in autoconf.
dnl Currently this macro should have the same name as the autoconf macro
dnl because gettext's gettext.m4 (distributed in the automake package)
dnl still uses it. Otherwise, the use in gettext.m4 makes autoheader
dnl give these diagnostics:
dnl configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
dnl configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
undefine([AC_ISC_POSIX])
AC_DEFUN(AC_ISC_POSIX,
[
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
]
)

23
m4/jm-glibc-io.m4 Normal file
View File

@@ -0,0 +1,23 @@
#serial 1
dnl From Jim Meyering.
dnl
dnl See if the glibc *_unlocked I/O macros are available.
dnl
AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
[AC_CHECK_FUNCS( \
clearerr_unlocked \
feof_unlocked \
ferror_unlocked \
fflush_unlocked \
fputc_unlocked \
fread_unlocked \
fwrite_unlocked \
getc_unlocked \
getchar_unlocked \
putc_unlocked \
putchar_unlocked \
)
]
)

32
m4/jm-macros.m4 Normal file
View File

@@ -0,0 +1,32 @@
#serial 1
dnl Misc type-related macros for fileutils, sh-utils, textutils.
AC_DEFUN(jm_MACROS,
[
dnl This macro actually runs replacement code. See isc-posix.m4.
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([jm_WITH_REGEX])
AC_REQUIRE([jm_ASSERT])
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_TYPE_SSIZE_T])
AC_REQUIRE([jm_STRUCT_UTIMBUF])
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
AC_REQUIRE([jm_CHECK_DECLS])
AC_REQUIRE([jm_PREREQ])
AC_REQUIRE([jm_FUNC_LCHOWN])
AC_REQUIRE([jm_FUNC_CHOWN])
AC_REQUIRE([jm_FUNC_MKTIME])
AC_REQUIRE([jm_FUNC_LSTAT])
AC_REQUIRE([jm_FUNC_STAT])
AC_REQUIRE([jm_FUNC_REALLOC])
AC_REQUIRE([jm_FUNC_MALLOC])
AC_REQUIRE([jm_FUNC_READDIR])
AC_REQUIRE([jm_FUNC_MEMCMP])
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
])

View File

@@ -1,4 +1,4 @@
#serial 2
#serial 3
dnl From Jim Meyering.
dnl If you use this macro in a package, you should
@@ -7,12 +7,12 @@ dnl /* Define to rpl_mktime if the replacement function should be used. */
dnl #undef mktime
dnl
AC_DEFUN(jm_FUNC_MKTIME,
[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
dnl mktime.c uses localtime_r if it exists. Check for it.
AC_CHECK_FUNCS(localtime_r)
if test $jm_am_cv_func_working_mktime = no; then
if test $am_cv_func_working_mktime = no; then
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
fi
])

10
m4/lchown.m4 Normal file
View File

@@ -0,0 +1,10 @@
#serial 1
dnl From Jim Meyering.
dnl Provide lchown on systems that lack it.
AC_DEFUN(jm_FUNC_LCHOWN,
[
AC_REQUIRE([AC_TYPE_UID_T])
AC_REPLACE_FUNCS(lchown)
])

19
m4/lcmessage.m4 Normal file
View File

@@ -0,0 +1,19 @@
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])

Some files were not shown because too many files have changed in this diff Show More