summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/texinfo/lib
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-01-11 16:32:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-01-11 16:32:52 +0000
commit99605a9e62a5b339ff09bd970d377cb20fc4a159 (patch)
treeca0b64a242d089f2c1a3157aaea330c4fa8732fd /gnu/usr.bin/texinfo/lib
parent3b187a70df975056e21b96d03a1b54e685617508 (diff)
Import of FSF texinfo 3.12. This version creates empty info-dirs correctly.
Diffstat (limited to 'gnu/usr.bin/texinfo/lib')
-rw-r--r--gnu/usr.bin/texinfo/lib/README5
-rw-r--r--gnu/usr.bin/texinfo/lib/getopt.c57
-rw-r--r--gnu/usr.bin/texinfo/lib/getopt.h30
-rw-r--r--gnu/usr.bin/texinfo/lib/getopt1.c34
4 files changed, 59 insertions, 67 deletions
diff --git a/gnu/usr.bin/texinfo/lib/README b/gnu/usr.bin/texinfo/lib/README
index 04ae4817aa9..6280ef53c9a 100644
--- a/gnu/usr.bin/texinfo/lib/README
+++ b/gnu/usr.bin/texinfo/lib/README
@@ -1,3 +1,4 @@
-Common routines to the Texinfo package.
+Common routines for the Texinfo package.
+
Many are common to other GNU packages as well.
-(On the FSF machines, check /gd/gnu/lib for the latest.)
+(On the FSF machines, check /home/gd/gnu/lib for the latest.)
diff --git a/gnu/usr.bin/texinfo/lib/getopt.c b/gnu/usr.bin/texinfo/lib/getopt.c
index 300f86de3eb..fc87ce67d69 100644
--- a/gnu/usr.bin/texinfo/lib/getopt.c
+++ b/gnu/usr.bin/texinfo/lib/getopt.c
@@ -6,23 +6,23 @@
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
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 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. */
+ 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
+ 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. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -79,12 +79,6 @@ USA. */
#endif
#endif
-#if defined (WIN32) && !defined (__CYGWIN32__)
-/* It's not Unix, really. See? Capital letters. */
-#include <windows.h>
-#define getpid() GetCurrentProcessId()
-#endif
-
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
@@ -262,8 +256,6 @@ static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
-extern pid_t __libc_pid;
-
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */
@@ -276,7 +268,9 @@ store_args_and_env (int argc, char *const *argv)
original_argc = argc;
original_argv = argv;
}
+# ifdef text_set_element
text_set_element (__libc_subinit, store_args_and_env);
+# endif /* text_set_element */
# define SWAP_FLAGS(ch1, ch2) \
if (nonoption_flags_len > 0) \
@@ -329,9 +323,9 @@ exchange (argv)
nonoption_flags_len = nonoption_flags_max_len = 0;
else
{
- memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
- memset (&new_str[nonoption_flags_max_len], '\0',
- top + 1 - nonoption_flags_max_len);
+ memset (__mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
nonoption_flags_max_len = top + 1;
__getopt_nonoption_flags = new_str;
}
@@ -440,11 +434,8 @@ _getopt_initialize (argc, argv, optstring)
if (__getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1;
else
- {
- memcpy (__getopt_nonoption_flags, orig_str, len);
- memset (&__getopt_nonoption_flags[len], '\0',
- nonoption_flags_max_len - len);
- }
+ memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
}
}
nonoption_flags_len = nonoption_flags_max_len;
diff --git a/gnu/usr.bin/texinfo/lib/getopt.h b/gnu/usr.bin/texinfo/lib/getopt.h
index 69256fd3864..c4adc30bbba 100644
--- a/gnu/usr.bin/texinfo/lib/getopt.h
+++ b/gnu/usr.bin/texinfo/lib/getopt.h
@@ -1,23 +1,23 @@
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 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.
+ 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 _GETOPT_H
#define _GETOPT_H 1
@@ -130,4 +130,4 @@ extern int _getopt_internal ();
}
#endif
-#endif /* _GETOPT_H */
+#endif /* getopt.h */
diff --git a/gnu/usr.bin/texinfo/lib/getopt1.c b/gnu/usr.bin/texinfo/lib/getopt1.c
index 6507ba1b1f6..af8e6819657 100644
--- a/gnu/usr.bin/texinfo/lib/getopt1.c
+++ b/gnu/usr.bin/texinfo/lib/getopt1.c
@@ -1,23 +1,23 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 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 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. */
+ 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
+ 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. */
#ifdef HAVE_CONFIG_H
#include <config.h>