sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-11-11 01:29:48 +00:00
parent 5903cbe575
commit 62d64fa864
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
841 changed files with 83929 additions and 40755 deletions

View file

@ -236,6 +236,11 @@ c_common_init_options (unsigned int argc, const char **argv)
if (c_language == clk_c)
{
/* The default for C is gnu99, without warnings for non-static
inline functions. */
set_std_c99 (false /* ISO */);
flag_gnu89_inline = 1;
/* If preprocessing assembly language, accept any of the C-family
front end options since the driver may pass them through. */
for (i = 1; i < argc; i++)

View file

@ -392,11 +392,11 @@ The revised ISO C standard, published in December 1999. Before
publication, this was known as C9X@.
@item gnu89
The 1990 C standard plus GNU extensions. This is the default.
The 1990 C standard plus GNU extensions.
@item gnu99
@itemx gnu9x
The 1999 C standard plus GNU extensions.
The 1999 C standard plus GNU extensions. This is the default.
@item c++98
The 1998 ISO C++ standard plus amendments.

View file

@ -1163,15 +1163,15 @@ provided; possible values are
names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
.IP "\fBgnu89\fR" 4
.IX Item "gnu89"
Default, \s-1ISO\s0 C90 plus \s-1GNU\s0 extensions (including some C99 features).
\&\s-1ISO\s0 C90 plus \s-1GNU\s0 extensions (including some C99 features).
.IP "\fBgnu99\fR" 4
.IX Item "gnu99"
.PD 0
.IP "\fBgnu9x\fR" 4
.IX Item "gnu9x"
.PD
\&\s-1ISO\s0 C99 plus \s-1GNU\s0 extensions. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
this will become the default. The name \fBgnu9x\fR is deprecated.
Default, \s-1ISO\s0 C99 plus \s-1GNU\s0 extensions.
The name \fBgnu9x\fR is deprecated.
.IP "\fBc++98\fR" 4
.IX Item "c++98"
The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
@ -6364,7 +6364,7 @@ publication, this was known as C9X.
.ie n .IP """gnu89""" 4
.el .IP "\f(CWgnu89\fR" 4
.IX Item "gnu89"
The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
The 1990 C standard plus \s-1GNU\s0 extensions.
.ie n .IP """gnu99""" 4
.el .IP "\f(CWgnu99\fR" 4
.IX Item "gnu99"
@ -6373,7 +6373,7 @@ The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
.el .IP "\f(CWgnu9x\fR" 4
.IX Item "gnu9x"
.PD
The 1999 C standard plus \s-1GNU\s0 extensions.
The 1999 C standard plus \s-1GNU\s0 extensions. This is the default.
.ie n .IP """c++98""" 4
.el .IP "\f(CWc++98\fR" 4
.IX Item "c++98"

File diff suppressed because it is too large Load diff

View file

@ -1188,12 +1188,12 @@ ISO C99. Note that this standard is not yet fully supported; see
names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
Default, ISO C90 plus GNU extensions (including some C99 features).
ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
@itemx gnu9x
ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
this will become the default. The name @samp{gnu9x} is deprecated.
Defaults, ISO C99 plus GNU extensions.
The name @samp{gnu9x} is deprecated.
@item c++98
The 1998 ISO C++ standard plus amendments.

View file

@ -1,2 +1,2 @@
major=4
major=5
minor=0

View file

@ -291,7 +291,7 @@ protected:
Builder.defineMacro("__HAIKU__");
Builder.defineMacro("__ELF__");
DefineStd(Builder, "unix", Opts);
if (this->HasFloat128)
if (this->HasFloat128)
Builder.defineMacro("__FLOAT128__");
}
@ -454,6 +454,7 @@ protected:
// OpenBSD defines; list based off of gcc output
Builder.defineMacro("__OpenBSD__");
Builder.defineMacro("__SecBSD__");
DefineStd(Builder, "unix", Opts);
Builder.defineMacro("__ELF__");
if (Opts.POSIXThreads)

View file

@ -35,7 +35,8 @@ uintptr_t GetCurrentProcess(void);
#include <machine/sysarch.h>
#endif
#if defined(__OpenBSD__) && (defined(__arm__) || defined(__mips__) || defined(__riscv))
#if defined(__OpenBSD__) || defined(__SecBSD__) && \
(defined(__arm__) || defined(__mips__) || defined(__riscv))
// clang-format off
#include <sys/types.h>
#include <machine/sysarch.h>
@ -65,7 +66,8 @@ void __clear_cache(void *start, void *end) {
#elif defined(_WIN32) && (defined(__arm__) || defined(__aarch64__))
FlushInstructionCache(GetCurrentProcess(), start, end - start);
#elif defined(__arm__) && !defined(__APPLE__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__SecBSD__)
struct arm_sync_icache_args arg;
arg.addr = (uintptr_t)start;

View file

@ -59,7 +59,7 @@
#endif // *BSD
#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__SecBSD__) ||
#include <machine/endian.h>
#if _BYTE_ORDER == _BIG_ENDIAN

View file

@ -13,7 +13,7 @@
#define SANITIZER_PLATFORM_H
#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
!defined(__OpenBSD__) && \
!defined(__OpenBSD__) && !defined(__SecBSD__) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__Fuchsia__) && \
!(defined(__sun__) && defined(__svr4__))
# error "This operating system is not supported"
@ -50,7 +50,7 @@
# define SANITIZER_NETBSD 0
#endif
#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__SecBSD__)
# define SANITIZER_OPENBSD 1
#else
# define SANITIZER_OPENBSD 0

View file

@ -15,8 +15,8 @@
// Other platforms should be easy to add, and probably work as-is.
#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \
defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || \
(defined(__sun__) && defined(__svr4__)) || defined(_WIN32) || \
defined(__Fuchsia__)
defined(__SecBSD__) || (defined(__sun__) && defined(__svr4__)) || \
defined(_WIN32) || defined(__Fuchsia__)
#define CAN_SANITIZE_UB 1
#else
# define CAN_SANITIZE_UB 0

View file

@ -395,7 +395,20 @@ private:
// Futex Implementation
//===----------------------------------------------------------------------===//
#if defined(SYS_futex)
#ifdef __SecBSD__
#include <sys/futex.h>
void PlatformFutexWait(int* addr, int expect) {
constexpr int WAIT = 0;
futex((volatile uint32_t *)addr, WAIT, expect, NULL, NULL);
__tsan_acquire(addr);
}
void PlatformFutexWake(int* addr) {
constexpr int WAKE = 1;
__tsan_release(addr);
futex((volatile uint32_t *)addr, WAKE, INT_MAX, NULL, NULL);
}
#elif defined(SYS_futex)
void PlatformFutexWait(int* addr, int expect) {
constexpr int WAIT = 0;
syscall(SYS_futex, addr, WAIT, expect, 0);

View file

@ -29,14 +29,12 @@
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#elif defined(LLVM_ON_UNIX) && \
(defined(_LIBCPP_VERSION) || \
!(defined(__NetBSD__) || defined(__OpenBSD__) || \
(defined(__ppc__) || defined(__PPC__))))
!(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SecBSD__)))
// std::call_once from libc++ is used on all Unix platforms. Other
// implementations like libstdc++ are known to have problems on NetBSD,
// OpenBSD and PowerPC.
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#elif defined(LLVM_ON_UNIX) && \
((defined(__ppc__) || defined(__PPC__)) && defined(__LITTLE_ENDIAN__))
#elif defined(LLVM_ON_UNIX) && defined(__LITTLE_ENDIAN__)
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
#else
#define LLVM_THREADING_USE_STD_CALL_ONCE 0

View file

@ -71,13 +71,14 @@ extern char **environ;
#include <sys/types.h>
#if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && \
!defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX)
!defined(__linux__) && !defined(__FreeBSD_kernel__) && !defined(_AIX) && \
!defined(__SecBSD__)
#include <sys/statvfs.h>
#define STATVFS statvfs
#define FSTATVFS fstatvfs
#define STATVFS_F_FRSIZE(vfs) vfs.f_frsize
#else
#if defined(__OpenBSD__) || defined(__FreeBSD__)
#if defined(__OpenBSD__) || defined(__SecBSD__) || defined(__FreeBSD__)
#include <sys/mount.h>
#include <sys/param.h>
#elif defined(__linux__)
@ -125,7 +126,8 @@ const file_t kInvalidFile = -1;
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
defined(__minix) || defined(__FreeBSD_kernel__) || defined(__linux__) || \
defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || defined(__GNU__)
defined(__CYGWIN__) || defined(__DragonFly__) || defined(_AIX) || \
defined(__GNU__) || defined(__SecBSD__)
static int
test_dir(char ret[PATH_MAX], const char *dir, const char *bin)
{
@ -234,7 +236,8 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) {
if (getprogpath(exe_path, argv0) != NULL)
return exe_path;
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__minix) || \
defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(_AIX)
defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(_AIX) || \
defined(__SecBSD__)
const char *curproc = "/proc/curproc/file";
char exe_path[PATH_MAX];
if (sys::fs::exists(curproc)) {

View file

@ -332,7 +332,7 @@ static ManagedStatic<std::mutex> TermColorMutex;
#endif
static bool terminalHasColors(int fd) {
#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__SecBSD__)
return false;
#endif

View file

@ -22,7 +22,7 @@
#include <pthread.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__SecBSD__)
#include <pthread_np.h> // For pthread_getthreadid_np() / pthread_set_name_np()
#endif
@ -38,7 +38,7 @@
#include <lwp.h> // For _lwp_self()
#endif
#if defined(__OpenBSD__)
#if defined(__OpenBSD__) || defined(__SecBSD__)
#include <unistd.h> // For getthrid()
#endif
@ -119,7 +119,7 @@ uint64_t llvm::get_threadid() {
return uint64_t(pthread_getthreadid_np());
#elif defined(__NetBSD__)
return uint64_t(_lwp_self());
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__SecBSD__)
return uint64_t(getthrid());
#elif defined(__ANDROID__)
return uint64_t(gettid());
@ -144,7 +144,7 @@ static constexpr uint32_t get_max_thread_name_length_impl() {
#endif
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
return 16;
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__SecBSD__)
return 32;
#else
return 0;
@ -175,7 +175,7 @@ void llvm::set_thread_name(const Twine &Name) {
::pthread_setname_np(::pthread_self(), NameStr.data());
#endif
#endif
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__SecBSD__)
::pthread_set_name_np(::pthread_self(), NameStr.data());
#elif defined(__NetBSD__)
::pthread_setname_np(::pthread_self(), "%s",
@ -230,7 +230,7 @@ void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
::pthread_getname_np(::pthread_self(), buf, len);
Name.append(buf, buf + strlen(buf));
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__SecBSD__)
constexpr uint32_t len = get_max_thread_name_length_impl();
char buf[len];
::pthread_get_name_np(::pthread_self(), buf, len);

View file

@ -2156,7 +2156,8 @@ TEST_F(FileSystemTest, permissions) {
// AIX and Solaris without root will mask off (i.e., lose) the sticky bit
// on files.
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \
!defined(_AIX) && !(defined(__sun__) && defined(__svr4__))
!defined(_AIX) && !(defined(__sun__) && defined(__svr4__)) && \
!defined(__SecBSD__)
EXPECT_EQ(fs::setPermissions(TempPath, fs::sticky_bit), NoError);
EXPECT_TRUE(CheckPermissions(fs::sticky_bit));

View file

@ -51,7 +51,7 @@
#define BENCHMARK_OS_FREEBSD 1
#elif defined(__NetBSD__)
#define BENCHMARK_OS_NETBSD 1
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__SecBSD__)
#define BENCHMARK_OS_OPENBSD 1
#elif defined(__linux__)
#define BENCHMARK_OS_LINUX 1

View file

@ -96,7 +96,7 @@
# define GTEST_OS_NACL 1
#elif defined __NetBSD__
# define GTEST_OS_NETBSD 1
#elif defined __OpenBSD__
#elif defined __OpenBSD_ || defined(__SecBSD__)
# define GTEST_OS_OPENBSD 1
#elif defined __QNX__
# define GTEST_OS_QNX 1

View file

@ -6,4 +6,4 @@
#define CLANG_VERSION_MINOR 0
#define CLANG_VERSION_PATCHLEVEL 0
#define CLANG_VENDOR "OpenBSD "
#define CLANG_VENDOR "SecBSD "

View file

@ -1,12 +1,12 @@
/*
* Copyright (c) 1992, Brian Berliner and Jeff Polk
* Copyright (c) 1989-1992, Brian Berliner
*
*
* You may distribute under the terms of the GNU General Public License as
* specified in the README file that comes with the CVS source distribution.
*
* The functions in this file provide an interface for performing
* operations directly on RCS files.
*
* The functions in this file provide an interface for performing
* operations directly on RCS files.
*/
#include "cvs.h"
@ -83,7 +83,7 @@ static void call_diff_write_stdout PROTO((const char *));
static void call_diff_error PROTO((const char *, const char *, const char *));
/* VARARGS */
static void
static void
call_diff_setup (prog)
const char *prog;
{
@ -406,9 +406,6 @@ RCS file: ", 0);
what the best behavior is. Passing NULL for the `nametag' argument
preserves the existing behavior. */
cvs_output ("retrieving revision ", 0);
cvs_output (rev1, 0);
cvs_output ("\n", 1);
status = RCS_checkout (rcsfile, NULL, rev1, NULL, options, tmpfile1,
(RCSCHECKOUTPROC)0, NULL);
if (status > 0)
@ -432,9 +429,6 @@ RCS file: ", 0);
else
{
tmpfile2 = cvs_temp_name ();
cvs_output ("retrieving revision ", 0);
cvs_output (rev2, 0);
cvs_output ("\n", 1);
status = RCS_checkout (rcsfile, NULL, rev2, NULL, options,
tmpfile2, (RCSCHECKOUTPROC)0, NULL);
if (status > 0)

View file

@ -140,7 +140,7 @@ install: maninstall target_path
${DESTDIR}/usr/bin/gcc
ln -f ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
clean cleandir:
clean cleandir:
-@if [ -e Makefile ]; then ${MAKE} distclean; fi
-rm -f ${CLEANFILES}

View file

@ -509,7 +509,7 @@ c_common_init_options (lang)
#endif
c_language = lang;
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX);
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC99 : CLK_GNUCXX);
cpp_opts = cpp_get_options (parse_in);
if (flag_objc)
cpp_opts->objc = 1;
@ -517,7 +517,12 @@ c_common_init_options (lang)
flag_const_strings = (lang == clk_cplusplus);
warn_pointer_arith = (lang == clk_cplusplus);
if (lang == clk_c)
warn_sign_compare = -1;
{
/* The default for C is gnu99. */
set_std_c99 (false /* ISO */);
warn_sign_compare = -1;
}
}
static char *bad_option;
@ -721,9 +726,9 @@ c_common_decode_option (argc, argv)
warn_sign_compare = on;
warn_switch = on;
warn_strict_aliasing = on;
/* Only warn about unknown pragmas that are not in system
headers. */
headers. */
warn_unknown_pragmas = on;
/* We save the value of warn_uninitialized, since if they put

View file

@ -18,29 +18,29 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Common OpenBSD configuration.
/* Common OpenBSD configuration.
All OpenBSD architectures include this file, which is intended as
a repository for common defines.
a repository for common defines.
Some defines are common to all architectures, a few of them are
triggered by OBSD_* guards, so that we won't override architecture
defaults by mistakes.
OBSD_HAS_CORRECT_SPECS:
OBSD_HAS_CORRECT_SPECS:
another mechanism provides correct specs already.
OBSD_NO_DYNAMIC_LIBRARIES:
OBSD_NO_DYNAMIC_LIBRARIES:
no implementation of dynamic libraries.
OBSD_OLD_GAS:
OBSD_OLD_GAS:
older flavor of gas which needs help for PIC.
OBSD_HAS_DECLARE_FUNCTION_NAME, OBSD_HAS_DECLARE_FUNCTION_SIZE,
OBSD_HAS_DECLARE_OBJECT:
OBSD_HAS_DECLARE_OBJECT:
PIC support, FUNCTION_NAME/FUNCTION_SIZE are independent, whereas
the corresponding logic for OBJECTS is necessarily coupled.
OBSD_HAS_CORRECT_ASM_OPS:
another mechanism provides correct ASM_OP values already.
There are also a few `default' defines such as ASM_WEAKEN_LABEL,
intended as common ground for arch that don't provide
intended as common ground for arch that don't provide
anything suitable. */
/* OPENBSD_NATIVE is defined only when gcc is configured as part of
@ -86,19 +86,19 @@ Boston, MA 02111-1307, USA. */
#endif
/* Controlling the compilation driver. */
/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets. */
#define OPENBSD_OS_CPP_BUILTINS_COMMON() \
do \
{ \
builtin_define ("__OpenBSD__"); \
builtin_define ("__OpenBSD__" || "__SecBSD__"); \
builtin_define ("__unix__"); \
builtin_define ("__ANSI_COMPAT"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=bsd"); \
builtin_assert ("system=OpenBSD"); \
builtin_assert ("system=OpenBSD" || "system=SecBSD"); \
} \
while (0)
@ -122,7 +122,7 @@ Boston, MA 02111-1307, USA. */
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
XXX the way threads are handled currently is not very satisfying,
since all code must be compiled with -pthread to work.
since all code must be compiled with -pthread to work.
This two-stage defines makes it easy to pick that for targets that
have subspecs. */
#ifdef CPP_CPU_SPEC
@ -144,8 +144,8 @@ Boston, MA 02111-1307, USA. */
#define CPP_SPEC OBSD_CPP_SPEC
#ifdef OBSD_OLD_GAS
/* ASM_SPEC appropriate for OpenBSD. For some architectures, OpenBSD
still uses a special flavor of gas that needs to be told when generating
/* ASM_SPEC appropriate for OpenBSD. For some architectures, OpenBSD
still uses a special flavor of gas that needs to be told when generating
pic code. */
#undef ASM_SPEC
#define ASM_SPEC "%{fpic:-k} %{fPIC:-k -K} %|"
@ -158,7 +158,7 @@ Boston, MA 02111-1307, USA. */
#endif
#endif
/* LINK_SPEC appropriate for OpenBSD. Support for GCC options
/* LINK_SPEC appropriate for OpenBSD. Support for GCC options
-static, -assert, and -nostdlib. */
#undef LINK_SPEC
#ifdef OBSD_NO_DYNAMIC_LIBRARIES
@ -177,7 +177,7 @@ Boston, MA 02111-1307, USA. */
#define LIB_SPEC OBSD_LIB_SPEC
#endif
/* Runtime target specification. */
/* You must redefine CPP_PREDEFINES in any arch specific file. */
@ -198,11 +198,11 @@ Boston, MA 02111-1307, USA. */
use DBX don't support it. */
#define DBX_NO_XREFS
/* Support of shared libraries, mostly imported from svr4.h through netbsd. */
/* Two differences from svr4.h:
- we use . - _func instead of a local label,
- we put extra spaces in expressions such as
- we put extra spaces in expressions such as
.type _func , @function
This is more readable for a human being and confuses c++filt less. */
@ -211,11 +211,11 @@ Boston, MA 02111-1307, USA. */
/* Define the strings used for the .type and .size directives.
These strings generally do not vary from one system running OpenBSD
to another, but if a given system needs to use different pseudo-op
names for these, they may be overridden in the arch specific file. */
names for these, they may be overridden in the arch specific file. */
/* OpenBSD assembler is hacked to have .type & .size support even in a.out
format object files. Functions size are supported but not activated
yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).
format object files. Functions size are supported but not activated
yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).
SET_ASM_OP is needed for attribute alias to work. */
#ifndef OBSD_HAS_CORRECT_ASM_OPS
@ -245,12 +245,12 @@ Boston, MA 02111-1307, USA. */
/* These macros generate the special .type and .size directives which
are used to set the corresponding fields of the linker symbol table
entries under OpenBSD. These macros also have to output the starting
entries under OpenBSD. These macros also have to output the starting
labels for the relevant functions/objects. */
#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME
/* Extra assembler code needed to declare a function properly.
Some assemblers may also need to also have something extra said
Some assemblers may also need to also have something extra said
about the function's return value. We allow for that here. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
@ -292,7 +292,7 @@ Boston, MA 02111-1307, USA. */
/* Output the size directive for a decl in rest_of_decl_compilation
in the case where we did not do so before the initializer.
Once we find the error_mark_node, we know that the value of
size_directive_output was set by ASM_DECLARE_OBJECT_NAME
size_directive_output was set by ASM_DECLARE_OBJECT_NAME
when it was run for the same decl. */
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \
@ -311,24 +311,24 @@ do { \
} while (0)
#endif
/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
to override a processor specific definition. Hence, #ifndef ASM_*
In case overriding turns out to be needed, one can always #undef ASM_*
In case overriding turns out to be needed, one can always #undef ASM_*
before including this file. */
/* Tell the assembler that a symbol is weak. */
/* Note: netbsd arm32 assembler needs a .globl here. An override may
/* Note: netbsd arm32 assembler needs a .globl here. An override may
be needed when/if we go for arm32 support. */
#ifndef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while (0)
#endif
/* Storage layout. */
/* bug work around: we don't want to support #pragma weak, but the current
code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to
work. On the other hand, we don't define HANDLE_PRAGMA_WEAK directly,
@ -336,7 +336,7 @@ do { \
#define HANDLE_SYSV_PRAGMA 1
/* Disable the use of unsafe builtin functions, (strcat, strcpy), making
* them easier to spot in the object files.
* them easier to spot in the object files.
*/
#define NO_UNSAFE_BUILTINS

View file

@ -351,11 +351,11 @@ The revised ISO C standard, published in December 1999. Before
publication, this was known as C9X@.
@item gnu89
The 1990 C standard plus GNU extensions. This is the default.
The 1990 C standard plus GNU extensions.
@item gnu99
@itemx gnu9x
The 1999 C standard plus GNU extensions.
The 1999 C standard plus GNU extensions. This is the default.
@item c++98
The 1998 ISO C++ standard plus amendments.

View file

@ -1015,12 +1015,12 @@ ISO C99. Note that this standard is not yet fully supported; see
names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
Default, ISO C90 plus GNU extensions (including some C99 features).
ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
@itemx gnu9x
ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
this will become the default. The name @samp{gnu9x} is deprecated.
Default, ISO C99 plus GNU extensions.
The name @samp{gnu9x} is deprecated.
@item c++98
The 1998 ISO C++ standard plus amendments.

View file

@ -17,9 +17,8 @@ sub croak
use strict;
use vars qw($VERSION $VMS_TERMCAP);
use vars qw($termpat $state $first $entry);
$VERSION = '1.17';
$VERSION = '1.18';
# TODO:
# support Berkeley DB termcaps
@ -33,7 +32,7 @@ Term::Cap - Perl termcap interface
=head1 SYNOPSIS
require Term::Cap;
$terminal = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed };
$terminal = Term::Cap->Tgetent({ TERM => undef, OSPEED => $ospeed });
$terminal->Trequire(qw/ce ku kd/);
$terminal->Tgoto('cm', $col, $row, $FH);
$terminal->Tputs('dl', $count, $FH);
@ -91,7 +90,7 @@ sub termcap_path
{
# Add the users $TERMPATH
push( @termcap_path, split( /(:|\s+)/, $ENV{TERMPATH} ) );
push( @termcap_path, split( /:|\s+/, $ENV{TERMPATH} ) );
}
else
{
@ -170,8 +169,8 @@ sub Tgetent
$self = {} unless defined $self;
bless $self, $class;
my ( $term, $cap, $search, $field, $max, $tmp_term, $TERMCAP );
local ( $termpat, $state, $first, $entry ); # used inside eval
my ( $term, $cap, $search, $field, $tmp_term, $TERMCAP );
my ( $state, $first, $entry );
local $_;
# Compute PADDING factor from OSPEED (to be used by Tpad)
@ -221,67 +220,25 @@ sub Tgetent
# $tmp_term is always the next term (possibly :tc=...:) we are looking for
$tmp_term = $self->{TERM};
my $seen = {};
# protect any pattern metacharacters in $tmp_term
$termpat = $tmp_term;
$termpat =~ s/(\W)/\\$1/g;
my $foo = ( exists $ENV{TERMCAP} ? $ENV{TERMCAP} : '' );
# $entry is the extracted termcap entry
if ( ( $foo !~ m:^/:s ) && ( $foo =~ m/(^|\|)${termpat}[:|]/s ) )
{
$entry = $foo;
if (exists $ENV{TERMCAP}) {
local $_ = $ENV{TERMCAP};
if ( !m:^/:s && m/(^|\|)\Q$tmp_term\E[:|]/s ) {
$entry = $_;
$seen->{$tmp_term} = 1;
}
}
my @termcap_path = termcap_path();
if ( !@termcap_path && !$entry )
{
# last resort--fake up a termcap from terminfo
local $ENV{TERM} = $term;
if ( $^O eq 'VMS' )
{
$entry = $VMS_TERMCAP;
}
else
{
if ( grep { -x "$_/infocmp" } split /:/, $ENV{PATH} )
{
eval {
my $tmp = `infocmp -C 2>/dev/null`;
$tmp =~ s/^#.*\n//gm; # remove comments
if ( ( $tmp !~ m%^/%s )
&& ( $tmp =~ /(^|\|)${termpat}[:|]/s ) )
{
$entry = $tmp;
}
};
warn "Can't run infocmp to get a termcap entry: $@" if $@;
}
else
{
# this is getting desperate now
if ( $self->{TERM} eq 'dumb' )
{
$entry = 'dumb|80-column dumb tty::am::co#80::bl=^G:cr=^M:do=^J:sf=^J:';
}
}
}
}
croak "Can't find a valid termcap file" unless @termcap_path || $entry;
$state = 1; # 0 == finished
# 1 == next file
# 2 == search again
# 3 == try infocmp
$first = 0; # first entry (keeps term name)
$max = 32; # max :tc=...:'s
if ($entry)
{
@ -291,10 +248,6 @@ sub Tgetent
if ( $entry =~ s/:tc=([^:]+):/:/ )
{
$tmp_term = $1;
# protect any pattern metacharacters in $tmp_term
$termpat = $tmp_term;
$termpat =~ s/(\W)/\\$1/g;
}
else
{
@ -302,57 +255,76 @@ sub Tgetent
}
}
# This is eval'ed inside the while loop for each file
$search = q{
while (<TERMCAP>) {
next if /^\\t/ || /^#/;
if ($_ =~ m/(^|\\|)${termpat}[:|]/o) {
while ( $state != 0 )
{
if ( $state == 1 ) {
# get the next TERMCAP
$TERMCAP = shift @termcap_path or $state = 3;
} elsif ($state == 3) {
croak "failed termcap lookup on $tmp_term";
} else {
# do the same file again
$state = 1; # ok, maybe do a new file next time
}
my ($fh, $child);
if ($state == 3) {
# need to do a proper fork, so that we can pass tmp_term
# without having to quote it.
$child = open($fh, "-|");
warn "cannot run infocmp: $!" if !defined $child;
if (!$child) {
open(STDERR, ">", "/dev/null");
exec('infocmp', '-CTrx', '--', $tmp_term);
exit(1);
}
} else {
open($fh, '<', $TERMCAP) || croak "open $TERMCAP: $!";
}
while (<$fh>) {
next if /^\t/ || /^#/;
if (m/(^|\|)\Q$tmp_term\E[:|]/) {
chomp;
s/^[^:]*:// if $first++;
$state = 0;
while ($_ =~ s/\\\\$//) {
defined(my $x = <TERMCAP>) or last;
$seen->{$tmp_term} = 1;
while (s/\\$//) {
defined(my $x = <$fh>) or last;
$_ .= $x; chomp;
}
if (defined $entry) {
$entry .= $_;
} else {
$entry = $_;
}
last;
}
}
defined $entry or $entry = '';
$entry .= $_ if $_;
};
close $fh;
waitpid($child, 0) if defined $child;
while ( $state != 0 )
{
if ( $state == 1 )
{
# get the next TERMCAP
$TERMCAP = shift @termcap_path
|| croak "failed termcap lookup on $tmp_term";
}
else
{
# do the same file again
# prevent endless recursion
$max-- || croak "failed termcap loop at $tmp_term";
$state = 1; # ok, maybe do a new file next time
}
open( TERMCAP, "< $TERMCAP\0" ) || croak "open $TERMCAP: $!";
eval $search;
die $@ if $@;
close TERMCAP;
next if $state != 0;
# If :tc=...: found then search this file again
$entry =~ s/:tc=([^:]+):/:/ && ( $tmp_term = $1, $state = 2 );
# protect any pattern metacharacters in $tmp_term
$termpat = $tmp_term;
$termpat =~ s/(\W)/\\$1/g;
while ($entry =~ s/:tc=([^:]+):/:/) {
$tmp_term = $1;
next if $seen->{$tmp_term};
$state = 2;
last;
}
}
croak "Can't find $term" if $entry eq '';
if ( !defined $entry ) {
if ( $^O eq 'VMS' ) {
$entry = $VMS_TERMCAP;
# this is getting desperate now
} elsif ( $self->{TERM} eq 'dumb' ){
$entry = 'dumb|80-column dumb tty::am::co#80::bl=^G:cr=^M:do=^J:sf=^J:';
}
}
croak "Can't find $term" if !defined $entry;
$entry =~ s/:+\s*:+/:/g; # cleanup $entry
$entry =~ s/:+/:/g; # cleanup $entry
$self->{TERMCAP} = $entry; # save it
@ -702,7 +674,7 @@ sub Trequire
# Get terminal output speed
require POSIX;
my $termios = new POSIX::Termios;
my $termios = POSIX::Termios->new;
$termios->getattr;
my $ospeed = $termios->getospeed;
@ -712,7 +684,7 @@ sub Trequire
# ($ispeed,$ospeed) = unpack('cc',$sgtty);
# allocate and initialize a terminal structure
$terminal = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed };
my $terminal = Term::Cap->Tgetent({ TERM => undef, OSPEED => $ospeed });
# require certain capabilities to be available
$terminal->Trequire(qw/ce ku kd/);

View file

@ -0,0 +1,83 @@
Revision history for Perl extension Term::Cap.
undef: Thu Dec 14 20:02:42 CST 1995 by sanders@bsdi.com
1.00: Thu Nov 30 23:34:29 EST 2000 by schwern@pobox.com
- [PATCH] $VERSION crusade, strict, tests, etc... all over lib/
1.01: Sun Oct 28 13:07:36 2001
- Avoid warnings in Tgetent and Tputs
- Version retrieved from the Perl 5.7.2 distribution
1.02: Sat Nov 17 13:50:39 2001
- Altered layout of the POD
- Added Test::More to PREREQ_PM in Makefile.PL
- Fixed no argument Tgetent()
1.03: Wed Nov 28 10:09:38 GMT 2001
- VMS Support from Charles Lane <lane@DUPHY4.Physics.Drexel.Edu>
1.04: Thu Nov 29 16:31:53 GMT 2001
- Fixed warnings in the test.
1.05: Mon Dec 3 15:37:43 GMT 2001
- Don't attempt to run infocmp if it's not there - from chromatic
<chromatic@rmci.net>
1.06: Thu Dec 6 19:10:15 GMT 2001
- More VMS fixes from Charles Lane
- Don't carp about setting OSPEED unless warnings are on
1.07:
- Fixed Makefile.PL with INSTALLDIRS - from Michael Schwern
- Sanity check on infocmp output - from Norton Allen
<allen@huarp.harvard.edu>
1.08: Sat Sep 28 11:33:15 BST 2002
- Late loading of 'Carp' as per Michael Schwern
1.09: Tue Apr 20 12:06:51 BST 2004
- Merged in changes from and to Core
- Core (Fri Aug 30 14:15:55 CEST 2002):
Cope with comments lines from 'infocmp' from Brendan O'Dea
- Allow for EBCDIC in Tgoto magic test.
1.10: Thu Oct 18 16:52:20 BST 2007
- Don't use try to use $ENV{HOME} if it doesn't exist
- Give Win32 'dumb' if TERM isn't set
- Provide fallback 'dumb' termcap entry as last resort
1.11: Thu Oct 25 09:33:07 BST 2007
- EBDIC fixes from Chun Bing Ge <gecb@cn.ibm.com>
1.12: Sat Dec 8 00:08:40 GMT 2007
- Pending fix for tests on QNX (Matt Kraai <kraai@ftbfs.org>)
1.13: Sat Oct 26 19:08:27 BST 2013
- Bring everything up to date with all patches from RT
- Sync version with core
1.14: Sat Oct 26 19:20:03 BST 2013
- Update versions everywhere
- Change email address and add the github location
1.15: Sat Oct 26 21:28:29 BST 2013
- meta data patch from David Steinbrunner
- Change email in metadata
1.16: Sat 5 Apr 10:19:35 BST 2014
- Make last resort actually work from drm00
- Removed change log from Cap.pm
1.17-RC1: Wed 1 Jul 10:30:15 BST 2015
- Fix regression caused by last resort change
- Add support for capabilities of more than 2 characters
1.17: Mon 17 Aug 08:30:54 BST 2015
- No changes version bounce
1.18: Fri 10 Feb 12:43:07 GMT 2023
- use isnt rather than isn't (Nicolas Mendoza <mendoza@pvv.ntnu.no>)
- Prevent unintended parse of ':' in TERMPATH (David Farrell <davidnmfarrell@gmail.com>)
- Various code cleanups (Arkadiy Voronov <voronov_ao@mail.ru>)
- Remove indirect method calls from documentation (Dan Book <grinnz@gmail.com>)

View file

@ -18,14 +18,14 @@ use Test::More;
my $files = join '',
grep { -f $_ }
( $ENV{HOME} . '/.termcap', # we assume pretty UNIXy system anyway
'/etc/termcap',
'/etc/termcap',
'/usr/share/misc/termcap' );
my $terminfo = `infocmp -C 2>/dev/null`;
unless( $files || $terminfo || $^O eq 'VMS' ) {
plan skip_all => 'no termcap available to test';
}
else {
plan tests => 45;
plan tests => 44;
}
use_ok( 'Term::Cap' );
@ -51,11 +51,11 @@ SKIP: {
skip("-f $file fails, some tests difficult now", 2) unless -f $file;
$ENV{TERMCAP} = $ENV{TERMPATH} = $file;
ok( grep($file, Term::Cap::termcap_path()),
ok( grep($file, Term::Cap::termcap_path()),
'termcap_path() should find file from $ENV{TERMCAP}' );
$ENV{TERMCAP} = '/';
ok( grep($file, Term::Cap::termcap_path()),
ok( grep($file, Term::Cap::termcap_path()),
'termcap_path() should find file from $ENV{TERMPATH}' );
}
@ -84,7 +84,7 @@ is( $out->read(), 'pc', 'Tputs() should write to filehandle when passed' );
eval { $t->Trequire( 'pc' ) };
is( $@, '', 'Trequire() should finds existing cap' );
eval { $t->Trequire( 'nonsense' ) };
like( $@, qr/support: \(nonsense\)/,
like( $@, qr/support: \(nonsense\)/,
'Trequire() should croak with unsupported cap' );
my $warn;
@ -121,7 +121,7 @@ SKIP: {
$ENV{TERMPATH} = '!';
$ENV{TERMCAP} = '';
eval { $t = Term::Cap->Tgetent($vals) };
isn't( $@, '', 'Tgetent() should catch bad termcap file' );
isnt( $@, '', 'Tgetent() should catch bad termcap file' );
}
SKIP: {
@ -135,12 +135,12 @@ SKIP: {
# it shouldn't try to read one file more than 32(!) times
# see __END__ for a really awful termcap example
$ENV{TERMPATH} = join(' ', ('tcout') x 33);
$vals->{TERM} = 'bar';
eval { $t = Term::Cap->Tgetent($vals) };
like( $@, qr/failed termcap loop/, 'Tgetent() should catch deep recursion');
# $ENV{TERMPATH} = join(' ', ('tcout') x 33);
# $vals->{TERM} = 'bar';
# eval { $t = Term::Cap->Tgetent($vals) };
# like( $@, qr/failed termcap loop/, 'Tgetent() should catch deep recursion');
# now let it read a fake termcap file, and see if it sets properties
# now let it read a fake termcap file, and see if it sets properties
$ENV{TERMPATH} = 'tcout';
$vals->{TERM} = 'baz';
$t = Term::Cap->Tgetent($vals);
@ -190,7 +190,7 @@ like( $t->Tgoto('test', '', 1), qr/a\x01/, 'Tgoto() should handle %+' );
$t->{_test} = 'a%+a';
is( $t->Tgoto('test', '', 1), 'ab', 'Tgoto() should handle %+char' );
$t->{_test} .= 'a' x 99;
like( $t->Tgoto('test', '', 1), qr/ba{98}/,
like( $t->Tgoto('test', '', 1), qr/ba{98}/,
'Tgoto() should substr()s %+ if needed' );
$t->{_test} = '%ra%d';

View file

@ -1,5 +1,5 @@
/* makeinfo -- convert Texinfo source into other formats.
$Id: makeinfo.c,v 1.9 2015/11/14 23:06:06 deraadt Exp $
$Id: makeinfo.c,v 1.10 2023/11/05 07:39:16 op Exp $
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@ -60,7 +60,7 @@
line between paragraphs. Paragraphs are defined by 2 or more consecutive
newlines in the input file (i.e., one or more blank lines). */
#define DEFAULT_PARAGRAPH_SPACING 1
/* Global variables. */
/* The output file name. */
@ -167,7 +167,7 @@ static void remember_brace (COMMAND_FUNCTION (*proc));
static int end_of_sentence_p (void);
void maybe_update_execution_strings (char **text, unsigned int new_len);
/* Error handling. */
/* Number of errors encountered. */
@ -320,7 +320,7 @@ misplaced_brace (void)
{
line_error (_("Misplaced %c"), '}');
}
/* Main. */
/* Display the version info of this invocation of Makeinfo. */
@ -859,7 +859,7 @@ For more information about these matters, see the files named COPYING.\n"));
xexit (errors_printed ? 2 : 0);
return 0; /* Avoid bogus warnings. */
}
/* Hacking tokens and strings. */
/* Return the next token as a string pointer. We cons the string. This
@ -999,7 +999,7 @@ discard_until (char *string)
char *end_block = xmalloc (8);
sprintf (end_block, "\n%cend ", COMMAND_PREFIX);
if (executing_string && strstr (string, end_block))
line_error (_("Multiline command %c%s used improperly"),
line_error (_("Multiline command %c%s used improperly"),
COMMAND_PREFIX, command);
else
line_error (_("Expected `%s'"), string);
@ -1242,7 +1242,7 @@ get_until_in_braces (char *match, char **string)
}
/* Converting a file. */
/* Convert the file named by NAME. The output is saved on the file
@ -1783,7 +1783,7 @@ _("%s: Removing macro output file `%s' due to errors; use --force to preserve.\n
}
free (real_output_filename);
}
/* If enable_encoding is set and @documentencoding is used, return a
Local Variables section (as a malloc-ed string) so that Emacs'
locale features can work. Else return NULL. */
@ -1809,7 +1809,7 @@ info_trailer (void)
free (encoding);
return NULL;
}
void
free_and_clear (char **pointer)
{
@ -1853,7 +1853,7 @@ init_paragraph (void)
current_indent = 0;
meta_char_pos = 0;
}
/* This is called from `reader_loop' when we are at the * beginning a
menu line. */
@ -1956,7 +1956,7 @@ handle_menu_entry (void)
if (tem)
free (tem);
}
/* Find the command corresponding to STRING. If the command is found,
return a pointer to the data structure. Otherwise return -1. */
static COMMAND *
@ -1978,7 +1978,7 @@ get_command_entry (char *string)
/* We never heard of this command. */
return (COMMAND *) -1;
}
/* input_text_offset is right at the command prefix character.
Read the next token to determine what to do. Return zero
if there's no known command or macro after the prefix character. */
@ -2290,7 +2290,7 @@ reader_loop (void)
if (macro_expansion_output_stream && !only_macro_expansion)
maybe_write_itext (input_text, input_text_offset);
}
static void
init_brace_stack (void)
{
@ -2444,7 +2444,7 @@ get_char_len (int character)
}
return len;
}
void
#if defined (VA_FPRINTF) && __STDC__
add_word_args (const char *format, ...)
@ -2523,7 +2523,7 @@ add_html_block_elt_args (format, va_alist)
va_end (ap);
add_html_block_elt (buffer);
}
/* Here is another awful kludge, used in add_char. Ordinarily, macro
expansions take place in the body of the document, and therefore we
should html_output_head when we see one. But there's an exception: a
@ -3245,7 +3245,7 @@ next_nonwhitespace_character (void)
return -1;
}
/* An external image is a reference, kind of. The parsing is (not
coincidentally) similar, anyway. */
void
@ -3363,11 +3363,13 @@ cm_image (int arg)
{ /* Try to open foo.EXT or foo.txt. */
FILE *image_file;
char *txtpath = NULL;
char *txtname = xmalloc (strlen (name_arg)
+ (ext_arg && *ext_arg
? strlen (ext_arg) : 4) + 1);
strcpy (txtname, name_arg);
strcat (txtname, ".txt");
char *txtname;
if (asprintf (&txtname, "%s.txt", name_arg) == -1) {
perror ("asprintf");
exit (1);
}
image_file = fopen (txtname, "r");
if (image_file == NULL)
{
@ -3431,7 +3433,7 @@ cm_image (int arg)
if (image_in_brackets)
add_char (']');
if (use_magic_cookie)
add_char ('"');
@ -3451,6 +3453,9 @@ cm_image (int arg)
else
warning (_("@image file `%s' (for text) unreadable: %s"),
txtname, strerror (errno));
free (txtname);
free (txtpath);
}
free (fullname);
@ -3471,7 +3476,7 @@ cm_image (int arg)
if (ext_arg)
free (ext_arg);
}
/* Conditionals. */
/* A structure which contains `defined' variables. */
@ -3671,7 +3676,7 @@ cm_value (int arg, int start_pos, int end_pos)
/* We need to get past the closing brace since the value may
expand to a context-sensitive macro (e.g. @xref) and produce
spurious warnings */
input_text_offset++;
input_text_offset++;
execute_string ("%s", value);
input_text_offset--;
}
@ -3856,7 +3861,7 @@ handle_variable_internal (int action, char *name)
}
}
}
/* Execution of random text not in file. */
typedef struct {
char *string; /* The string buffer. */
@ -4133,7 +4138,7 @@ text_expansion (char *str)
return ret;
}
/* Set the paragraph indentation variable to the value specified in STRING.
Values can be:
`asis': Don't change existing indentation.

View file

@ -26,7 +26,7 @@ compiled with a GNU compiler to produce an executable, this does not cause
the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
@ -70,7 +70,7 @@ the executable file might be covered by the GNU General Public License. */
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__) || defined(__SecBSD__)
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
@ -168,8 +168,8 @@ static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__)
#if defined(__GNU_LIBRARY__) || defined(__OpenBSD__) || defined(__SecBSD__)
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
@ -210,7 +210,7 @@ extern int strlen (const char *);
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
@ -318,7 +318,7 @@ _getopt_initialize (optstring)
return optstring;
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
@ -686,7 +686,7 @@ getopt (argc, argv, optstring)
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing

View file

@ -54,7 +54,7 @@
#endif
#include <fctldefs.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SecBSD__)
#include <sys/time.h>
#include <sys/resource.h>
#endif
@ -680,8 +680,8 @@ void usage(){
}
/*
* Fill in date in the iso9660 format
/*
* Fill in date in the iso9660 format
*
* The standards state that the timezone offset is in multiples of 15
* minutes, and is what you add to GMT to get the localtime. The U.S.
@ -699,9 +699,9 @@ int FDECL2(iso9660_date,char *, result, time_t, crtime){
result[4] = local->tm_min;
result[5] = local->tm_sec;
/*
/*
* Must recalculate proper timezone offset each time,
* as some files use daylight savings time and some don't...
* as some files use daylight savings time and some don't...
*/
result[6] = local->tm_yday; /* save yday 'cause gmtime zaps it */
local = gmtime(&crtime);
@ -709,11 +709,11 @@ int FDECL2(iso9660_date,char *, result, time_t, crtime){
local->tm_yday -= result[6];
local->tm_hour -= result[3];
local->tm_min -= result[4];
if (local->tm_year < 0)
if (local->tm_year < 0)
{
local->tm_yday = -1;
}
else
else
{
if (local->tm_year > 0) local->tm_yday = 1;
}
@ -1113,7 +1113,7 @@ int FDECL2(main, int, argc, char **, argv){
case OPTION_H_LIST:
hfs_add_list(optarg);
break;
/* NON-HFS change
/* NON-HFS change
The next options will probably appear in mkisofs in the future */
case OPTION_P_LIST:
pathnames = optarg;
@ -1135,10 +1135,10 @@ int FDECL2(main, int, argc, char **, argv){
parse_input_files:
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__SecBSD__)
{
struct rlimit rlp;
if (getrlimit(RLIMIT_DATA,&rlp) == -1)
if (getrlimit(RLIMIT_DATA,&rlp) == -1)
perror("Warning: getrlimit");
else {
rlp.rlim_cur=33554432;
@ -1302,7 +1302,7 @@ parse_input_files:
exit(1);
}
memcpy(&de.isorec.extent, mrootp->extent, 8);
memcpy(&de.isorec.extent, mrootp->extent, 8);
}
/*
@ -1415,8 +1415,8 @@ parse_input_files:
break;
}
*pnt = '\0';
graft_dir = find_or_create_directory(graft_dir,
graft_point,
graft_dir = find_or_create_directory(graft_dir,
graft_point,
NULL, TRUE);
*pnt = PATH_SEPARATOR;
xpnt = pnt + 1;
@ -1493,7 +1493,7 @@ parse_input_files:
if (pfp && pfp != stdin)
fclose(pfp);
/* exit if we don't have any pathnames to process - not going to happen
/* exit if we don't have any pathnames to process - not going to happen
at the moment as we have to have at least one path on the command line */
if(no_path_names){
usage();
@ -1536,12 +1536,12 @@ parse_input_files:
fprintf(stderr, "Joliet tree sort failed.\n");
exit(1);
}
/*
* Fix a couple of things in the root directory so that everything
* is self consistent.
*/
root->self = root->contents; /* Fix this up so that the path
root->self = root->contents; /* Fix this up so that the path
tables get done right */
/*
@ -1623,8 +1623,8 @@ parse_input_files:
outputlist_insert(&dirtree_clean);
if(extension_record)
{
if(extension_record)
{
outputlist_insert(&extension_desc);
}
@ -1635,7 +1635,7 @@ parse_input_files:
* will always be a primary and an end volume descriptor.
*/
last_extent = session_start;
/*
* Calculate the size of all of the components of the disc, and assign
* extent numbers.
@ -1681,7 +1681,7 @@ parse_input_files:
if( verbose > 0 )
{
#ifdef HAVE_SBRK
fprintf(stderr,"Max brk space used %x\n",
fprintf(stderr,"Max brk space used %x\n",
(unsigned int)(((unsigned long)sbrk(0)) - mem_start));
#endif
fprintf(stderr,"%d extents written (%d Mb)\n", last_extent, last_extent >> 9);

View file

@ -166,7 +166,7 @@ struct file_hash{
unsigned int starting_block;
unsigned int size;
};
/*
* This structure is used to control the output of fragments to the cdrom
@ -219,7 +219,7 @@ extern struct output_fragment jdirtree_desc;
extern struct output_fragment extension_desc;
extern struct output_fragment files_desc;
/*
/*
* This structure describes one complete directory. It has pointers
* to other directories in the overall tree so that it is clear where
* this directory lives in the tree, and it also must contain pointers
@ -333,18 +333,18 @@ extern struct directory *
struct directory_entry * self, int));
extern void DECL (finish_cl_pl_entries, (void));
extern int DECL(scan_directory_tree,(struct directory * this_dir,
char * path,
char * path,
struct directory_entry * self));
#ifdef APPLE_HYB
extern int DECL(insert_file_entry,(struct directory *, char *,
extern int DECL(insert_file_entry,(struct directory *, char *,
char *, int));
#else
extern int DECL(insert_file_entry,(struct directory *, char *,
extern int DECL(insert_file_entry,(struct directory *, char *,
char *));
#endif /* APPLE_HYB */
extern void DECL(generate_iso9660_directories,(struct directory *, FILE*));
extern void DECL(dump_tree,(struct directory * node));
extern struct directory_entry * DECL(search_tree_file, (struct
extern struct directory_entry * DECL(search_tree_file, (struct
directory * node,char * filename));
extern void DECL(update_nlink_field,(struct directory * node));
extern void DECL (init_fstatbuf, (void));
@ -375,17 +375,17 @@ extern void DECL(outputlist_insert, (struct output_fragment * frag));
extern FILE * in_image;
extern struct iso_directory_record *
DECL(merge_isofs,(char * path));
DECL(merge_isofs,(char * path));
extern int DECL(free_mdinfo, (struct directory_entry **, int len));
extern struct directory_entry **
extern struct directory_entry **
DECL(read_merging_directory,(struct iso_directory_record *, int*));
extern void
DECL(merge_remaining_entries, (struct directory *,
extern void
DECL(merge_remaining_entries, (struct directory *,
struct directory_entry **, int));
extern int
DECL(merge_previous_session, (struct directory *,
extern int
DECL(merge_previous_session, (struct directory *,
struct iso_directory_record *));
extern int DECL(get_session_start, (int *));
@ -406,7 +406,7 @@ struct dirent * DECL(readdir_add_files, (char **, char *, DIR *));
/* */
extern int DECL(iso9660_file_length,(const char* name,
extern int DECL(iso9660_file_length,(const char* name,
struct directory_entry * sresult, int flag));
extern int DECL(iso9660_date,(char *, time_t));
extern void DECL(add_hash,(struct directory_entry *));
@ -421,7 +421,7 @@ extern int DECL(delete_file_hash,(struct directory_entry *));
extern struct directory_entry * DECL(find_file_hash,(char *));
extern void DECL(add_file_hash,(struct directory_entry *));
extern int DECL(generate_rock_ridge_attributes,(char *, char *,
struct directory_entry *,
struct directory_entry *,
struct stat *, struct stat *,
int deep_flag));
extern char * DECL(generate_rr_extension_record,(char * id, char * descriptor,