+2024-04-17 Bruno Haible <bruno@clisp.org>
+
+ Fix linkage errors when using C++.
+ Reported by Miro Palmu <email@miropalmu.cc> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00274.html>.
+ * lib/acl.h: Add 'extern "C" {' / '}' boilerplate.
+ * lib/alignalloc.h: Likewise.
+ * lib/aligned-malloc.h: Likewise.
+ * lib/allocator.h: Likewise.
+ * lib/arcfour.h: Likewise.
+ * lib/arctwo.h: Likewise.
+ * lib/areadlink.h: Likewise.
+ * lib/argv-iter.h: Likewise.
+ * lib/argz.in.h: Likewise.
+ * lib/binary-io.h: Likewise.
+ * lib/bitrotate.h: Likewise.
+ * lib/bitset.h: Likewise.
+ * lib/bitsetv.h: Likewise.
+ * lib/c-strcaseeq.h: Likewise.
+ * lib/canon-host.h: Likewise.
+ * lib/careadlinkat.h: Likewise.
+ * lib/chdir-long.h: Likewise.
+ * lib/check-version.h: Likewise.
+ * lib/classpath.h: Likewise.
+ * lib/cloexec.h: Likewise.
+ * lib/close-stream.h: Likewise.
+ * lib/crc.h: Likewise.
+ * lib/csharpcomp.h: Likewise.
+ * lib/csharpexec.h: Likewise.
+ * lib/cycle-check.h: Likewise.
+ * lib/des.h: Likewise.
+ * lib/dev-ino.h: Likewise.
+ * lib/di-set.h: Likewise.
+ * lib/eealloc.h: Likewise.
+ * lib/exclude.h: Likewise.
+ * lib/execinfo.in.h: Likewise.
+ * lib/execute.h: Likewise.
+ * lib/exitfail.h: Likewise.
+ * lib/fcntl-safer.h: Likewise.
+ * lib/file-set.h: Likewise.
+ * lib/file-type.h: Likewise.
+ * lib/filenamecat.h: Likewise.
+ * lib/filevercmp.h: Likewise.
+ * lib/fpending.h: Likewise.
+ * lib/fprintftime.h: Likewise.
+ * lib/fpucw.h: Likewise.
+ * lib/fsusage.h: Likewise.
+ * lib/ftoastr.h: Likewise.
+ * lib/full-read.h: Likewise.
+ * lib/gc.h: Likewise.
+ * lib/getndelim2.h: Likewise.
+ * lib/getnline.h: Likewise.
+ * lib/getugroups.h: Likewise.
+ * lib/glthread/tls.h: Likewise.
+ * lib/hamt.h: Likewise.
+ * lib/hard-locale.h: Likewise.
+ * lib/hash-pjw-bare.h: Likewise.
+ * lib/hash-pjw.h: Likewise.
+ * lib/hash-triple.h: Likewise.
+ * lib/hmac.h: Likewise.
+ * lib/human.h: Likewise.
+ * lib/i-ring.h: Likewise.
+ * lib/idcache.h: Likewise.
+ * lib/idx.h: Likewise.
+ * lib/ino-map.h: Likewise.
+ * lib/inttostr.h: Likewise.
+ * lib/isapipe.h: Likewise.
+ * lib/javacomp.h: Likewise.
+ * lib/javaexec.h: Likewise.
+ * lib/jit/cache.h: Likewise.
+ * lib/linebuffer.h: Likewise.
+ * lib/localeinfo.h: Likewise.
+ * lib/long-options.h: Likewise.
+ * lib/mbchar.h: Likewise.
+ * lib/mbfile.h: Likewise.
+ * lib/mbiter.h: Likewise.
+ * lib/mbiterf.h: Likewise.
+ * lib/mbuiter.h: Likewise.
+ * lib/mbuiterf.h: Likewise.
+ * lib/mcel.h: Likewise.
+ * lib/memcasecmp.h: Likewise.
+ * lib/memcoll.h: Likewise.
+ * lib/memxor.h: Likewise.
+ * lib/mgetgroups.h: Likewise.
+ * lib/mkdir-p.h: Likewise.
+ * lib/modechange.h: Likewise.
+ * lib/mountlist.h: Likewise.
+ * lib/mpsort.h: Likewise.
+ * lib/msvc-nothrow.h: Likewise.
+ * lib/nan.h: Likewise.
+ * lib/openat-priv.h: Likewise.
+ * lib/openat.h: Likewise.
+ * lib/opendirat.h: Likewise.
+ * lib/pagealign_alloc.h: Likewise.
+ * lib/parse-datetime.h: Likewise.
+ * lib/parse-duration.h: Likewise.
+ * lib/physmem.h: Likewise.
+ * lib/posixtm.h: Likewise.
+ * lib/posixver.h: Likewise.
+ * lib/printf-frexp.h: Likewise.
+ * lib/printf-frexpl.h: Likewise.
+ * lib/priv-set.h: Likewise.
+ * lib/quote.h: Likewise.
+ * lib/quotearg.h: Likewise.
+ * lib/read-file.h: Likewise.
+ * lib/readline.h: Likewise.
+ * lib/readtokens.h: Likewise.
+ * lib/readtokens0.h: Likewise.
+ * lib/regex-quote.h: Likewise.
+ * lib/renameatu.h: Likewise.
+ * lib/rijndael-alg-fst.h: Likewise.
+ * lib/rijndael-api-fst.h: Likewise.
+ * lib/safe-alloc.h: Likewise.
+ * lib/safe-write.h: Likewise.
+ * lib/same-inode.h: Likewise.
+ * lib/same.h: Likewise.
+ * lib/save-cwd.h: Likewise.
+ * lib/savedir.h: Likewise.
+ * lib/savewd.h: Likewise.
+ * lib/selinux-at.h: Likewise.
+ * lib/signed-nan.h: Likewise.
+ * lib/signed-snan.h: Likewise.
+ * lib/snan.h: Likewise.
+ * lib/sockets.h: Likewise.
+ * lib/stdio-safer.h: Likewise.
+ * lib/stdlib-safer.h: Likewise.
+ * lib/streq.h: Likewise.
+ * lib/strerror-override.h: Likewise.
+ * lib/tmpdir.h: Likewise.
+ * lib/trim.h: Likewise.
+ * lib/u64.h: Likewise.
+ * lib/unicase/casefold.h: Likewise.
+ * lib/unicase/caseprop.h: Likewise.
+ * lib/unicase/invariant.h: Likewise.
+ * lib/unicase/special-casing.in.h: Likewise.
+ * lib/unicase/unicasemap.h: Likewise.
+ * lib/unicodeio.h: Likewise.
+ * lib/unilbrk/lbrktables.h: Likewise.
+ * lib/unilbrk/ulc-common.h: Likewise.
+ * lib/uninorm/decompose-internal.h: Likewise.
+ * lib/unistd-safer.h: Likewise.
+ * lib/unitypes.in.h: Likewise.
+ * lib/uniwbrk/wbrktable.h: Likewise.
+ * lib/unlinkdir.h: Likewise.
+ * lib/userspec.h: Likewise.
+ * lib/utimecmp.h: Likewise.
+ * lib/utimens.h: Likewise.
+ * lib/windows-spawn.h: Likewise.
+ * lib/write-any-file.h: Likewise.
+ * lib/xbinary-io.h: Likewise.
+ * lib/xgetcwd.h: Likewise.
+ * lib/xgetdomainname.h: Likewise.
+ * lib/xgethostname.h: Likewise.
+ * lib/xmemcoll.h: Likewise.
+ * lib/xprintf.h: Likewise.
+ * lib/xreadlink.h: Likewise.
+ * lib/xsize.h: Likewise.
+ * lib/xstrndup.h: Likewise.
+ * lib/xstrtod.h: Likewise.
+ * lib/xstrtol.h: Likewise.
+ * lib/yesno.h: Likewise.
+ * lib/isnand-nolibm.h (isnand): Declare with C linkage.
+ * lib/isnanf-nolibm.h (isnanf): Likewise.
+ * lib/isnanl-nolibm.h (isnanl): Likewise.
+
2024-04-17 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Make an instance variable local to a function.
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST;
int file_has_acl (char const *, struct stat const *);
int qset_acl (char const *, int, mode_t);
int copy_acl (char const *, int, char const *, int, mode_t);
int chmod_or_fchmod (char const *, int, mode_t);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
# define ALIGNALLOC_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Whether aligned_alloc supports any power-of-two alignment,
returns a nonnull pointer for size-zero allocations,
and sets errno on failure. */
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((2))
_GL_ATTRIBUTE_RETURNS_NONNULL /* _GL_ATTRIBUTE_DEALLOC (alignfree, 1) */;
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* !ALIGNALLOC_H_ */
#error "Please include config.h first."
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if !defined ALIGNMENT
# error "ALIGNMENT is not defined"
#endif
}
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* An object describing a memory allocator family. */
struct allocator
/* An allocator using the stdlib functions and a null DIE function. */
extern struct allocator const stdlib_allocator;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_ALLOCATOR_H */
/* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
#ifndef ARCFOUR_H
-# define ARCFOUR_H
+#define ARCFOUR_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
-# include <stdint.h>
#define ARCFOUR_SBOX_SIZE 256
extern void
arcfour_setkey (arcfour_context * context, const char *key, size_t keylen);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ARCFOUR_H */
/* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
#ifndef ARCTWO_H
-# define ARCTWO_H
+#define ARCTWO_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
-# include <stdint.h>
typedef struct
{
arctwo_decrypt (arctwo_context *context, const char *inbuf,
char *restrict outbuf, size_t length);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ARCTWO_H */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern char *areadlink (char const *filename)
_GL_ATTRIBUTE_DEALLOC_FREE;
extern char *areadlink_with_size (char const *filename, size_t size_hint)
size_t size_hint)
_GL_ATTRIBUTE_DEALLOC_FREE;
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
/* Definition of _GL_ARG_NONNULL. */
#include "arg-nonnull.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct argv_iterator;
enum argv_iter_err
_GL_ARG_NONNULL ((1, 2));
size_t argv_iter_n_args (struct argv_iterator const *)
_GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1));
+
+
+#ifdef __cplusplus
+}
+#endif
#include <errno.h>
#include <string.h> /* Need size_t. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifndef __error_t_defined
typedef int error_t;
#endif
const char *restrict /*entry*/);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* argz.h */
}
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY.
Return the old mode if successful, -1 (setting errno) on failure.
Ordinarily this function would be called 'setmode', since that is
/* This macro is obsolescent. */
#define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _BINARY_H */
# define BITROTATE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifdef UINT64_MAX
/* Given an unsigned 64-bit argument X, return the value corresponding
to rotating the bits N steps to the left. N must be between 1 and
return (((unsigned int) x >> n) | ((unsigned int) x << (8 - n))) & UINT8_MAX;
}
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _GL_BITROTATE_H */
#include "bitset/base.h"
#include "obstack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Attributes used to select a bitset implementation. */
enum bitset_attr {BITSET_FIXED = 1, /* Bitset size fixed. */
BITSET_VARIABLE = 2, /* Bitset size variable. */
/* Function to debug bitset stats from debugger. */
void debug_bitset_stats (void);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_BITSET_H */
#include "bitset.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
typedef bitset * bitsetv;
/* Free vector of bitsets. Do nothing if NULL. */
/* Dump vector of bitsets as a matrix. */
void bitsetv_matrix_dump (FILE *, const char *, bitsetv);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _BITSETV_H */
#include "c-strcase.h"
#include "c-ctype.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* STRCASEEQ allows to optimize string comparison with a small literal string.
STRCASEEQ (s, "UTF-8", 'U','T','F','-','8',0,0,0,0)
is semantically equivalent to
(c_strcasecmp (s1, s2) == 0)
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef CANON_HOST_H
-# define CANON_HOST_H 1
+#define CANON_HOST_H 1
/* This file uses _GL_ATTRIBUTE_MALLOC. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdlib.h>
char *canon_host (char const *host)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
const char *ch_strerror (void);
-# define ch_strerror_r(cherror) gai_strerror (cherror);
+#define ch_strerror_r(cherror) gai_strerror (cherror);
+
+
+#ifdef __cplusplus
+}
+#endif
#endif /* !CANON_HOST_H */
#include <fcntl.h>
#include <unistd.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct allocator;
/* Assuming the current directory is FD, get the symbolic link value
# endif
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_CAREADLINKAT_H */
#include "pathmax.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* On systems without PATH_MAX, presume that chdir accepts
arbitrarily long directory names. */
#ifndef PATH_MAX
#else
int chdir_long (char *dir);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#ifndef CHECK_VERSION_H
# define CHECK_VERSION_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern const char *
check_version (const char *req_version);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CHECK_VERSION_H */
#error "Please include config.h first."
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return the new CLASSPATH value. The given classpaths are prepended to
the current CLASSPATH value. If use_minimal_classpath, the current
CLASSPATH is ignored. */
/* Restore CLASSPATH to its previous value. */
extern void reset_classpath (char *old_classpath);
+
+
+#ifdef __cplusplus
+}
+#endif
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true,
or clear the flag if VALUE is false.
Return 0 on success, or -1 on error with 'errno' set.
be duplicated. */
int dup_cloexec (int fd);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int close_stream (FILE *stream);
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Simon Josefsson. */
#ifndef CRC_H
-# define CRC_H 1
+#define CRC_H 1
#include <stddef.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compute CRC-32 value of LEN bytes long BUF, and return it. */
extern uint32_t crc32 (const char *buf, size_t len);
extern uint32_t
crc32_update_no_xor (uint32_t crc, const char *buf, size_t len);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* CRC_H */
#ifndef _CSHARPCOMP_H
#define _CSHARPCOMP_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compile a set of C# source files to bytecode.
sources is an array of source file names, including resource files.
libdirs is a list of directories to be searched for libraries.
bool optimize, bool debug,
bool verbose);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _CSHARPCOMP_H */
#ifndef _CSHARPEXEC_H
#define _CSHARPEXEC_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
typedef bool execute_fn (const char *progname,
const char *prog_path, const char * const *prog_argv,
void *private_data);
bool verbose, bool quiet,
execute_fn *executer, void *private_data);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _CSHARPEXEC_H */
/* Written by Jim Meyering */
#ifndef CYCLE_CHECK_H
-# define CYCLE_CHECK_H 1
+#define CYCLE_CHECK_H 1
+
+#include <stdint.h>
+#include "dev-ino.h"
+#include "same-inode.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdint.h>
-# include "dev-ino.h"
-# include "same-inode.h"
struct cycle_check_state
{
void cycle_check_init (struct cycle_check_state *state);
bool cycle_check (struct cycle_check_state *state, struct stat const *sb);
-# define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir) \
+#define CYCLE_CHECK_REFLECT_CHDIR_UP(State, SB_dir, SB_subdir) \
do \
{ \
/* You must call cycle_check at least once before using this macro. */ \
} \
while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* Adapted for gnulib by Simon Josefsson, based on Libgcrypt. */
#ifndef DES_H
-# define DES_H
+#define DES_H
#include <stddef.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/*
* Encryption/Decryption context of DES
*/
#define gl_3des_ecb_encrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,0)
#define gl_3des_ecb_decrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,1)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* DES_H */
/* Written by Jim Meyering, 2003. */
#ifndef DEV_INO_H
-# define DEV_INO_H 1
+#define DEV_INO_H 1
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
-# include <sys/stat.h>
struct dev_ino
{
dev_t st_dev;
};
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* Written by Jim Meyering, 2010. */
#ifndef _GL_DI_SET_H
-# define _GL_DI_SET_H
+#define _GL_DI_SET_H
/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_NONNULL. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
struct di_set;
int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
_GL_ATTRIBUTE_NONNULL ((1));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
# define EEALLOC_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if MALLOC_0_IS_NONNULL
# define eemalloc malloc
#else
eenrealloc (void *p, size_t n, size_t s) - like eerealloc (p, n * s)
If this would be useful in your application. please speak up. */
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _EEALLOC_H */
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+/* Written by Paul Eggert <eggert@twinsun.com>
+ and Sergey Poznyakoff <gray@gnu.org> */
+
#ifndef _GL_EXCLUDE_H
#define _GL_EXCLUDE_H 1
#include <stdio.h>
-/* Written by Paul Eggert <eggert@twinsun.com>
- and Sergey Poznyakoff <gray@gnu.org> */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Exclude options, which can be ORed with fnmatch options. */
void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
bool exclude_fnmatch (char const *, char const *, int);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_EXCLUDE_H */
# define _GL_EXECINFO_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
_GL_EXECINFO_INLINE int
backtrace (void **buffer, int size)
{
(void) fd;
}
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif
#ifndef _EXECUTE_H
#define _EXECUTE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Execute a command, optionally redirecting any of the three standard file
descriptors to /dev/null. Return its exit code.
If it didn't terminate correctly, exit if exit_on_error is true, otherwise
bool slave_process, bool exit_on_error,
int *termsigp);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _EXECUTE_H */
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern int volatile exit_failure;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int open_safer (char const *, int, ...);
int creat_safer (char const *, mode_t);
#if GNULIB_OPENAT_SAFER
int openat_safer (int, char const *, int, ...);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#include "hash.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern void record_file (Hash_table *ht, char const *file,
struct stat const *stats)
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
extern bool seen_file (Hash_table const *ht, char const *file,
struct stat const *stats);
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Paul Eggert and Jim Meyering. */
#ifndef FILE_TYPE_H
-# define FILE_TYPE_H 1
+#define FILE_TYPE_H 1
/* This file uses _GL_ATTRIBUTE_PURE. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
-# include <sys/stat.h>
char const *c_file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
char const *file_type (struct stat const *) _GL_ATTRIBUTE_PURE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* FILE_TYPE_H */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if GNULIB_FILENAMECAT
char *file_name_concat (char const *dir, char const *base,
char **base_in_result)
char *mfile_name_concat (char const *dir, char const *base,
char **base_in_result)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compare strings A and B as file names containing version numbers,
and return an integer that is negative, zero, or positive depending
on whether A compares less than, equal to, or greater than B.
int filenvercmp (char const *a, ptrdiff_t alen, char const *b, ptrdiff_t blen)
_GL_ATTRIBUTE_PURE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* FILEVERCMP_H */
# include <stdio_ext.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if !HAVE_DECL___FPENDING
size_t __fpending (FILE *) _GL_ATTRIBUTE_PURE;
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdio.h>
#include <time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* A cross between fprintf and nstrftime, that prints directly
to the output stream, without the need for the potentially
large buffer that nstrftime would require.
and NANOSECONDS values. */
size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
timezone_t zone, int nanoseconds);
+
+
+#ifdef __cplusplus
+}
+#endif
'long double' safe operation precision
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Inline assembler like this works only with GNU C and clang. */
#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _FPUCW_H */
/* Space usage statistics for a file system. Blocks are 512-byte. */
#if !defined FSUSAGE_H_
-# define FSUSAGE_H_
+#define FSUSAGE_H_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdint.h>
struct fs_usage
{
int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <float.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Store into BUF (of size BUFSIZE) an accurate minimal-precision
string representation of a floating point number. FLAGS affect the
formatting of the number. Pad the output string with spaces as
#define DBL_BUFSIZE_BOUND ( DBL_STRLEN_BOUND + 1)
#define LDBL_BUFSIZE_BOUND (LDBL_STRLEN_BOUND + 1)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_FTOASTR_H */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Read COUNT bytes at BUF to descriptor FD, retrying if interrupted
or if partial reads occur. Return the number of bytes successfully
read, setting errno if that is less than COUNT. errno = 0 means EOF. */
extern size_t full_read (int fd, void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
*/
#ifndef _GL_GC_H
-# define _GL_GC_H
+#define _GL_GC_H
/* This file uses _GL_ATTRIBUTE_CONST. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
/* Get size_t. */
-# include <stddef.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum Gc_rc
{
Simon
*/
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_GC_H */
#include <stdio.h>
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define GETNLINE_NO_LIMIT ((size_t) -1)
/* Read into a buffer *LINEPTR returned from malloc (or NULL),
size_t nmax, int delim1, int delim2,
FILE *stream);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GETNDELIM2_H */
#include <stdio.h>
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define GETNLINE_NO_LIMIT ((size_t) -1)
/* Read a line, up to the next newline, from STREAM, and store it in *LINEPTR.
extern ssize_t getndelim (char **lineptr, size_t *linesize, size_t nmax,
int delimiter, FILE *stream);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GETNLINE_H */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int getugroups (int maxcount, gid_t *grouplist, char const *username,
gid_t gid);
+
+
+#ifdef __cplusplus
+}
+#endif
# include <threads.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* ------------------------- gl_tls_key_t datatype ------------------------- */
typedef tss_t gl_tls_key_t;
# define glthread_tls_key_destroy(KEY) \
(tss_delete (*(KEY)), 0)
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
# include <pthread.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if PTHREAD_IN_USE_DETECTION_HARD
/* The pthread_in_use() detection needs to be done at runtime. */
# define glthread_tls_key_destroy(KEY) \
(pthread_in_use () ? pthread_key_delete ((KEY)->key) : 0)
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
# include "windows-tls.h"
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* ------------------------- gl_tls_key_t datatype ------------------------- */
typedef glwthread_tls_key_t gl_tls_key_t;
# define glthread_tls_key_destroy(KEY) \
glwthread_tls_key_delete (*(KEY))
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
/* Provide dummy implementation if threads are not supported. */
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* ------------------------- gl_tls_key_t datatype ------------------------- */
typedef struct
# define glthread_tls_key_destroy(KEY) \
0
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
#include <stddef.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Hash values are of type size_t. For each level of the trie, we use
5 bits (corresponding to lg2 of the width of a 32-bit word. */
#define _GL_HAMT_MAX_DEPTH ((SIZE_WIDTH + 4) / 5)
false. */
extern bool hamt_remove_x (Hamt *hamt, Hamt_entry *elt);
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _GL_HAMT_H */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef HARD_LOCALE_H_
-# define HARD_LOCALE_H_ 1
+#define HARD_LOCALE_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Return true if the specified CATEGORY of the current locale is hard, i.e.
different from the C or POSIX locale that has a fixed behavior.
per-thread locale. */
extern bool hard_locale (int category);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HARD_LOCALE_H_ */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compute a hash code for a buffer starting at X and of size N,
and return the hash code. Note that unlike hash_pjw(), it does not
return it modulo a table size.
The result is platform dependent: it depends on the size of the 'size_t'
type. */
extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compute a hash code for a NUL-terminated string starting at X,
and return the hash code modulo TABLESIZE.
The result is platform dependent: it depends on the size of the 'size_t'
type and on the signedness of the 'char' type. */
extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Describe a just-created or just-renamed destination file. */
struct F_triple
{
_GL_ATTRIBUTE_PURE;
extern bool triple_compare (void const *x, void const *y);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/* Written by Simon Josefsson. */
#ifndef HMAC_H
-# define HMAC_H 1
+#define HMAC_H 1
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compute Hashed Message Authentication Code with MD5, as described
in RFC 2104, over BUFFER data of BUFLEN bytes using the KEY of
KEYLEN bytes, writing the output to pre-allocated 16 byte minimum
hmac_sha512 (const void *key, size_t keylen,
const void *in, size_t inlen, void *restrict resbuf);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HMAC_H */
/* Written by Paul Eggert and Larry McVoy. */
#ifndef HUMAN_H_
-# define HUMAN_H_ 1
+#define HUMAN_H_ 1
-# include <limits.h>
-# include <stdint.h>
-# include <unistd.h>
+#include <limits.h>
+#include <stdint.h>
+#include <unistd.h>
+
+#include <xstrtol.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <xstrtol.h>
/* A conservative bound on the maximum length of a human-readable string.
The output can be the square of the largest uintmax_t, so double
so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX.
Append 1 for a space before the suffix.
Finally, append 3, the maximum length of a suffix. */
-# define LONGEST_HUMAN_READABLE \
+#define LONGEST_HUMAN_READABLE \
((2 * sizeof (uintmax_t) * CHAR_BIT * 146 / 485 + 1) * (MB_LEN_MAX + 1) \
- MB_LEN_MAX + 1 + 3)
enum strtol_error human_options (char const *, int *, uintmax_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HUMAN_H_ */
#error "Please include config.h first."
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
enum { I_RING_SIZE = 4 };
static_assert (1 <= I_RING_SIZE);
int i_ring_push (I_ring *ir, int val);
int i_ring_pop (I_ring *ir);
bool i_ring_empty (I_ring const *ir) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Jim Meyering, 2007. */
#ifndef IDCACHE_H
-# define IDCACHE_H 1
+#define IDCACHE_H 1
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
extern char *getuser (uid_t uid);
extern char *getgroup (gid_t gid);
extern uid_t *getuidbyname (const char *user);
extern gid_t *getgidbyname (const char *group);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
help producing good code and good warnings. The type 'idx_t' could
then be typedef'ed to a range type that is signed after promotion. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* In the future, idx_t could be typedef'ed to a signed range type.
The clang "extended integer types", supported in Clang 11 or newer
<https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
Perhaps there should be another macro IDX_VALUE_BITS that does not
count the sign bit and is therefore one less than PTRDIFF_WIDTH. */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _IDX_H */
/* Written by Paul Eggert, 2010. */
#ifndef _GL_INO_MAP_H
-# define _GL_INO_MAP_H
+#define _GL_INO_MAP_H
/* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
_GL_ATTRIBUTE_NONNULL. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
-# define INO_MAP_INSERT_FAILURE ((size_t) -1)
+#define INO_MAP_INSERT_FAILURE ((size_t) -1)
struct ino_map;
size_t ino_map_insert (struct ino_map *, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include "intprops.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
_GL_ATTRIBUTE_NODISCARD char *imaxtostr (intmax_t, char *);
_GL_ATTRIBUTE_NODISCARD char *inttostr (int, char *);
_GL_ATTRIBUTE_NODISCARD char *offtostr (off_t, char *);
_GL_ATTRIBUTE_NODISCARD char *uinttostr (unsigned int, char *);
_GL_ATTRIBUTE_NODISCARD char *umaxtostr (uintmax_t, char *);
+
+
+#ifdef __cplusplus
+}
+#endif
#error "Please include config.h first."
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Whether pipes are FIFOs; -1 if not known. */
#ifndef HAVE_FIFO_PIPES
# define HAVE_FIFO_PIPES (-1)
#endif
int isapipe (int fd);
+
+
+#ifdef __cplusplus
+}
+#endif
/* Test whether X is a NaN. */
# undef isnand
# define isnand rpl_isnand
-extern int isnand (double x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnand (double x);
#endif
# if defined __sgi
/* We can't include <ieeefp.h>, because it conflicts with our definition of
isnand. Therefore declare isnanf separately. */
-extern int isnanf (float x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnanf (float x);
# endif
# endif
#else
/* Test whether X is a NaN. */
# undef isnanf
# define isnanf rpl_isnanf
-extern int isnanf (float x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnanf (float x);
#endif
/* Test whether X is a NaN. */
# undef isnanl
# define isnanl rpl_isnanl
-extern int isnanl (long double x);
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int isnanl (long double x);
#endif
#ifndef _JAVACOMP_H
#define _JAVACOMP_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compile a Java source file to bytecode.
java_sources is an array of source file names.
classpaths is a list of pathnames to be prepended to the CLASSPATH.
bool use_minimal_classpath,
bool verbose);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _JAVACOMP_H */
#ifndef _JAVAEXEC_H
#define _JAVAEXEC_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
typedef bool execute_fn (const char *progname,
const char *prog_path, const char * const *prog_argv,
void *private_data);
bool verbose, bool quiet,
execute_fn *executer, void *private_data);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _JAVAEXEC_H */
# include <stddef.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Clears the instruction cache for addresses
start <= address < end.
We need this because some CPUs have separate data cache and instruction
# error "Don't know how to implement clear_cache on this platform."
#endif
}
+
+
+#ifdef __cplusplus
+}
+#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#if !defined LINEBUFFER_H
-# define LINEBUFFER_H
+#define LINEBUFFER_H
+
+#include "idx.h"
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include "idx.h"
-# include <stdio.h>
/* A 'struct linebuffer' holds a line of text. */
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
void freebuffer (struct linebuffer *);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* LINEBUFFER_H */
# include <uchar.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct localeinfo
{
/* MB_CUR_MAX > 1. */
enum { CASE_FOLDED_BUFSIZE = 32 };
extern int case_folded_counterparts (wint_t, char32_t[CASE_FOLDED_BUFSIZE]);
+
+
+#ifdef __cplusplus
+}
+#endif
#ifndef LONG_OPTIONS_H_
# define LONG_OPTIONS_H_ 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
void parse_long_options (int _argc,
char **_argv,
const char *_command_name,
void (*usage_func) (int),
/* const char *author1, ...*/ ...);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* LONG_OPTIONS_H_ */
# define MBCHAR_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* The longest multibyte characters, nowadays, are 4 bytes long.
Regardless of the values of MB_CUR_MAX and MB_LEN_MAX. */
#define MBCHAR_BUF_SIZE 4
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBCHAR_H */
# define MBFILE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbfile_multi {
FILE *fp;
bool eof_seen;
#define mb_iseof(mbc) ((mbc).bytes == 0)
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBFILE_H */
# define MBITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbiter_multi
{
const char *limit; /* pointer to end of string */
/* Copying an iterator. */
#define mbi_copy mbiter_multi_copy
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBITER_H */
# define MBITERF_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbif_state
{
#if !GNULIB_MBRTOC32_REGULAR
#define mbif_next(st, iter, endptr) \
mbiterf_next (&(st), (iter), (endptr))
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBITERF_H */
# define MBUITER_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbuiter_multi
{
#if !GNULIB_MBRTOC32_REGULAR
/* Copying an iterator. */
#define mbui_copy mbuiter_multi_copy
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBUITER_H */
# define MBUITERF_INLINE _GL_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct mbuif_state
{
#if !GNULIB_MBRTOC32_REGULAR
#define mbuif_next(st, iter) \
mbuiterf_next (&(st), (iter))
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MBUITERF_H */
#include <stddef.h>
#include <uchar.h>
+_GL_INLINE_HEADER_BEGIN
+#ifndef MCEL_INLINE
+# define MCEL_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Pacify GCC re type limits. */
#if defined __GNUC__ && 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
# pragma GCC diagnostic ignored "-Wtype-limits"
# define _GL_UNLIKELY(cond) __builtin_expect ((cond), 0)
#endif
-_GL_INLINE_HEADER_BEGIN
-#ifndef MCEL_INLINE
-# define MCEL_INLINE _GL_INLINE
-#endif
-
/* mcel_t constructors. */
MCEL_INLINE mcel_t
mcel_ch (char32_t ch, size_t len)
return mcel_scant (p, '\0');
}
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _MCEL_H */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int memcasecmp (const void *vs1, const void *vs2, size_t n) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
#ifndef MEMCOLL_H_
-# define MEMCOLL_H_ 1
+#define MEMCOLL_H_ 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
int memcoll (char *restrict, size_t, char *restrict, size_t);
int memcoll0 (char const *, size_t, char const *, size_t);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MEMCOLL_H_ */
in Niels Möller's Nettle. */
#ifndef MEMXOR_H
-# define MEMXOR_H
+#define MEMXOR_H
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Compute binary exclusive OR of memory areas DEST and SRC, putting
the result in DEST, of length N bytes. Returns a pointer to
DEST. */
void *memxor (void *restrict dest, const void *restrict src, size_t n);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MEMXOR_H */
/*
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int mgetgroups (const char *username, gid_t gid, gid_t **groups);
#if GNULIB_XGETGROUPS
int xgetgroups (const char *username, gid_t gid, gid_t **groups);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
struct savewd;
bool make_dir_parents (char *dir,
struct savewd *wd,
uid_t owner,
gid_t group,
bool preserve_existing);
+
+
+#ifdef __cplusplus
+}
+#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#if ! defined MODECHANGE_H_
-# define MODECHANGE_H_
+#define MODECHANGE_H_
/* This file uses _GL_ATTRIBUTE_MALLOC. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdlib.h>
-# include <sys/types.h>
struct mode_change *mode_compile (const char *)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
mode_t *)
_GL_ATTRIBUTE_PURE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef MOUNTLIST_H_
-# define MOUNTLIST_H_
+#define MOUNTLIST_H_
/* This file uses _GL_ATTRIBUTE_MALLOC. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
/* A mount table entry. */
struct mount_entry
_GL_ATTRIBUTE_MALLOC;
void free_mount_entry (struct mount_entry *entry);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
void mpsort (void const **, size_t, int (*) (void const *, void const *));
+
+
+#ifdef __cplusplus
+}
+#endif
/* Get original declaration of _get_osfhandle. */
# include <io.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
/* Override _get_osfhandle. */
# endif
+# ifdef __cplusplus
+}
+# endif
+
#endif
#endif /* _MSVC_NOTHROW_H */
#ifndef _GL_NAN_H
#define _GL_NAN_H
-
/* IBM z/OS supports both hexadecimal and IEEE floating-point formats. The
former does not support NaN and its isnan() implementation returns zero
for all values. */
# error "NaN is not supported with IBM's hexadecimal floating-point format; please re-compile with -qfloat=ieee"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* NaNf () returns a 'float' not-a-number. */
/* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_NAN_H */
#include <limits.h>
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Maximum number of bytes that it is safe to allocate as a single
array on the stack, and that is known as a compile-time constant.
The assumption is that we'll touch the array very quickly, or a
int fd2, char const *file2,
int (*func) (char const *file1, char const *file2));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_HEADER_OPENAT_PRIV */
_GL_INLINE_HEADER_BEGIN
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if !HAVE_OPENAT
int openat_permissive (int fd, char const *file, int flags, mode_t mode,
wrappers are not provided for accessat or euidaccessat, so as to
avoid dragging in -lgen on some platforms. */
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _GL_HEADER_OPENAT */
#include <dirent.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
DIR *opendirat (int, char const *, int, int *)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (closedir, 1);
+
+
+#ifdef __cplusplus
+}
+#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _PAGEALIGN_ALLOC_H
-# define _PAGEALIGN_ALLOC_H
+#define _PAGEALIGN_ALLOC_H
/* This file uses _GL_ATTRIBUTE_ALLOC_SIZE, _GL_ATTRIBUTE_DEALLOC,
_GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_NONNULL,
_GL_ATTRIBUTE_RETURNS_NONNULL. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
/* Free a memory block.
PTR must be a non-NULL pointer returned by pagealign_alloc or
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (pagealign_free, 1)
_GL_ATTRIBUTE_ALLOC_SIZE ((1)) _GL_ATTRIBUTE_RETURNS_NONNULL;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _PAGEALIGN_ALLOC_H */
#include <time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
bool parse_datetime (struct timespec *restrict,
char const *, struct timespec const *);
bool parse_datetime2 (struct timespec *restrict,
char const *, struct timespec const *,
unsigned int flags, timezone_t, char const *);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <time.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return value when a valid duration cannot be parsed. */
#define BAD_TIME ((time_t)~0)
and errno is set to either EINVAL (bad syntax) or ERANGE (out of range). */
extern time_t parse_duration (char const * in_pz);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GNULIB_PARSE_DURATION_H */
#ifndef PHYSMEM_H_
# define PHYSMEM_H_ 1
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
double physmem_total (void);
double physmem_available (void);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* PHYSMEM_H_ */
Rewritten by Jim Meyering. */
#ifndef POSIXTM_H_
-# define POSIXTM_H_
+#define POSIXTM_H_
+
+#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <time.h>
/* POSIX Date Syntax flags. */
-# define PDS_TRAILING_YEAR 1
-# define PDS_CENTURY 2
-# define PDS_SECONDS 4
-# define PDS_PRE_2000 8
+#define PDS_TRAILING_YEAR 1
+#define PDS_CENTURY 2
+#define PDS_SECONDS 4
+#define PDS_PRE_2000 8
/* For compatibility with older versions of this header, in which
PDS_LEADING_YEAR had its own bit. */
-# define PDS_LEADING_YEAR 0
+#define PDS_LEADING_YEAR 0
bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int posix2_version (void);
+
+
+#ifdef __cplusplus
+}
+#endif
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Write a finite, positive number x as
x = mantissa * 2^exp
where exp >= DBL_MIN_EXP - 1,
if x is not a denormalized number then mantissa >= 1.0.
Store exp in *EXPPTR and return mantissa. */
extern double printf_frexp (double x, int *expptr);
+
+
+#ifdef __cplusplus
+}
+#endif
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Write a finite, positive number x as
x = mantissa * 2^exp
where exp >= LDBL_MIN_EXP - 1,
if x is not a denormalized number then mantissa >= 1.0.
Store exp in *EXPPTR and return mantissa. */
extern long double printf_frexpl (long double x, int *expptr);
+
+
+#ifdef __cplusplus
+}
+#endif
# include <priv.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+
int priv_set_ismember (const char *priv);
int priv_set_remove (const char *priv);
int priv_set_restore (const char *priv);
return -1;
}
+
+# ifdef __cplusplus
+}
+# endif
+
#endif
_GL_INLINE_HEADER_END
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef QUOTE_H_
-# define QUOTE_H_ 1
+#define QUOTE_H_ 1
+
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
/* The quoting options used by quote_n and quote. Its type is incomplete,
so it's useful only in expressions like '"e_quoting_options'. */
diagnostics. */
char const *quote (char const *arg);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !QUOTE_H_ */
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifndef QUOTEARG_H_
-# define QUOTEARG_H_ 1
+#define QUOTEARG_H_ 1
/* This file uses _GL_ATTRIBUTE_MALLOC, _GL_ATTRIBUTE_RETURNS_NONNULL. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdlib.h>
/* Basic quoting styles. For each style, an example is given on the
input strings "simple", "\0 \t\n'\"\033?""?/\\", and "a:b", using
};
/* For now, --quoting-style=literal is the default, but this may change. */
-# ifndef DEFAULT_QUOTING_STYLE
-# define DEFAULT_QUOTING_STYLE literal_quoting_style
-# endif
+#ifndef DEFAULT_QUOTING_STYLE
+# define DEFAULT_QUOTING_STYLE literal_quoting_style
+#endif
/* Names of quoting styles and their corresponding values. */
extern char const *const quoting_style_args[];
/* Free any dynamically allocated memory. */
void quotearg_free (void);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !QUOTEARG_H_ */
/* Get FILE. */
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Indicate that the file is treated as binary. */
#define RF_BINARY 0x1
extern char *read_file (const char *filename, int flags, size_t * length)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* READ_FILE_H */
# include <readline/readline.h>
#else
# include <stdlib.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* Prints a prompt PROMPT and then reads and returns a single line of
text from the user. If PROMPT is NULL or the empty string, no
prompt is displayed. The returned line is allocated with malloc;
the caller should free the line when it has finished with it. */
extern char *readline (const char *prompt)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+# ifdef __cplusplus
+}
+# endif
+
#endif
#endif /* GL_READLINE_H */
# include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* FIXME: This header should use idx_t, not size_t. */
struct tokenbuffer
const char *delim, size_t n_delim,
char ***tokens_out, size_t **token_lengths);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* not READTOKENS_H */
Written by Jim Meyering. */
#ifndef READTOKENS0_H
-# define READTOKENS0_H 1
+#define READTOKENS0_H 1
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "obstack.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stdio.h>
-# include <sys/types.h>
-# include "obstack.h"
struct Tokens
{
void readtokens0_free (struct Tokens *t);
bool readtokens0 (FILE *in, struct Tokens *t);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Specifies a quotation task for converting a fixed string to a regular
expression pattern. */
struct regex_quote_spec
_GL_ATTRIBUTE_RETURNS_NONNULL;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _REGEX_QUOTE_H */
/* Get RENAME_* macros from <stdio.h> if present, otherwise supply
the traditional Linux values. */
#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#ifndef RENAME_NOREPLACE
# define RENAME_NOREPLACE (1 << 0)
# define RENAME_EXCHANGE (1 << 1)
#endif
extern int renameatu (int, char const *, int, char const *, unsigned int);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdint.h>
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define RIJNDAEL_MAXKC (256/32)
#define RIJNDAEL_MAXKB (256/8)
#define RIJNDAEL_MAXNR 14
void rijndaelDecrypt (const uint32_t rk[ /*4*(Nr + 1) */ ], size_t Nr,
const char ct[16], char pt[16]);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __RIJNDAEL_ALG_FST_H */
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Default number of bits in a cipher block */
#define RIJNDAEL_BITSPERBLOCK 128
const char *input, size_t inputOctets,
char *restrict outBuffer);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __RIJNDAEL_API_FST_H */
# define SAFE_ALLOC_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Don't call these directly - use the macros below. */
SAFE_ALLOC_INLINE void *
safe_alloc_realloc_n (void *ptr, size_t count, size_t size)
*/
#define FREE(ptr) ((void) (free (ptr), (ptr) = NULL))
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* SAFE_ALLOC_H_ */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define SAFE_WRITE_ERROR ((size_t) -1)
/* Write up to COUNT bytes at BUF to descriptor FD, retrying if interrupted.
Return the actual number of bytes written, zero for EOF, or SAFE_WRITE_ERROR
upon error. */
extern size_t safe_write (int fd, const void *buf, size_t count);
+
+
+#ifdef __cplusplus
+}
+#endif
# define SAME_INODE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* True if A and B point to structs with st_dev and st_ino members
that are known to represent the same file.
return PSAME_INODE (a, b);
}
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef SAME_H_
-# define SAME_H_ 1
+#define SAME_H_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool same_name (const char *source, const char *dest);
bool same_nameat (int, char const *, int, char const *);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SAME_H_ */
/* Written by Jim Meyering. */
#ifndef SAVE_CWD_H
-# define SAVE_CWD_H 1
+#define SAVE_CWD_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct saved_cwd
{
int restore_cwd (const struct saved_cwd *cwd);
void free_cwd (struct saved_cwd *cwd);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* SAVE_CWD_H */
#include <dirent.h>
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
enum savedir_option
{
SAVEDIR_SORT_NONE,
char *savedir (char const *, enum savedir_option)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
# define SAVEWD_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* A saved working directory. The member names and constants defined
by this structure are private to the savewd module. */
struct savewd
int (*act) (char *, struct savewd *, void *),
void *options);
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif
#include <selinux/selinux.h>
#include <selinux/context.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* These are the dir-fd-relative variants of the functions without the
"at" suffix. For example, getfileconat (AT_FDCWD, file, &c) is usually
equivalent to getfilecon (file, &c). The emulation is accomplished
except when DIR_FD and FILE specify a symlink: lsetfileconat operates on
the symlink, while setfileconat operates on the referent of the symlink. */
int lsetfileconat (int dir_fd, char const *file, char const *con);
+
+
+#ifdef __cplusplus
+}
+#endif
#include "nan.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Returns a quiet 'float' NaN with sign bit == 0. */
_GL_UNUSED static float
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _SIGNED_NAN_H */
#include "signed-nan.h"
#include "snan.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_SNANF
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _SIGNED_SNAN_H */
#include "nan.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* The bit that distinguishes a quiet NaN from a signalling NaN is, according to
<https://en.wikipedia.org/wiki/NaN#Encoding>, the most significant bit of the
#undef NWORDS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _SNAN_H */
#error "Please include config.h first."
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define SOCKETS_1_0 0x0001
#define SOCKETS_1_1 0x0101
#define SOCKETS_2_0 0x0002
#endif
;
+#ifdef __cplusplus
+}
+#endif
+
+
/* This function is useful it you create a socket using gnulib's
Winsock wrappers but needs to pass on the socket handle to some
other library that only accepts sockets. */
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if GNULIB_FOPEN_SAFER
FILE *fopen_safer (char const *, char const *)
_GL_ARG_NONNULL ((1, 2)) _GL_ATTRIBUTE_DEALLOC (fclose, 1);
FILE *tmpfile_safer (void)
_GL_ATTRIBUTE_DEALLOC (fclose, 1);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Paul Eggert. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int mkstemp_safer (char *);
#if GNULIB_MKOSTEMP
#if GNULIB_MKSTEMPS
int mkstemps_safer (char *, int);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#include <string.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* STREQ_OPT allows to optimize string comparison with a small literal string.
STREQ_OPT (s, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
is semantically equivalent to
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _GL_STREQ_H */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef _GL_STRERROR_OVERRIDE_H
-# define _GL_STRERROR_OVERRIDE_H
+#define _GL_STRERROR_OVERRIDE_H
/* This file uses _GL_ATTRIBUTE_CONST. */
-# if !_GL_CONFIG_H_INCLUDED
-# error "Please include config.h first."
-# endif
+#if !_GL_CONFIG_H_INCLUDED
+# error "Please include config.h first."
+#endif
+
+#include <errno.h>
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <errno.h>
-# include <stddef.h>
/* Reasonable buffer size that should never trigger ERANGE; if this
proves too small, we intentionally abort(), to remind us to fix
this value. */
-# define STACKBUF_LEN 256
+#define STACKBUF_LEN 256
/* If ERRNUM maps to an errno value defined by gnulib, return a string
describing the error. Otherwise return NULL. */
-# if REPLACE_STRERROR_0 \
- || GNULIB_defined_ESOCK \
- || GNULIB_defined_ESTREAMS \
- || GNULIB_defined_EWINSOCK \
- || GNULIB_defined_ENOMSG \
- || GNULIB_defined_EIDRM \
- || GNULIB_defined_ENOLINK \
- || GNULIB_defined_EPROTO \
- || GNULIB_defined_EMULTIHOP \
- || GNULIB_defined_EBADMSG \
- || GNULIB_defined_EOVERFLOW \
- || GNULIB_defined_ENOTSUP \
- || GNULIB_defined_ENETRESET \
- || GNULIB_defined_ECONNABORTED \
- || GNULIB_defined_ESTALE \
- || GNULIB_defined_EDQUOT \
- || GNULIB_defined_ECANCELED \
- || GNULIB_defined_EOWNERDEAD \
- || GNULIB_defined_ENOTRECOVERABLE \
- || GNULIB_defined_EILSEQ
+#if REPLACE_STRERROR_0 \
+ || GNULIB_defined_ESOCK \
+ || GNULIB_defined_ESTREAMS \
+ || GNULIB_defined_EWINSOCK \
+ || GNULIB_defined_ENOMSG \
+ || GNULIB_defined_EIDRM \
+ || GNULIB_defined_ENOLINK \
+ || GNULIB_defined_EPROTO \
+ || GNULIB_defined_EMULTIHOP \
+ || GNULIB_defined_EBADMSG \
+ || GNULIB_defined_EOVERFLOW \
+ || GNULIB_defined_ENOTSUP \
+ || GNULIB_defined_ENETRESET \
+ || GNULIB_defined_ECONNABORTED \
+ || GNULIB_defined_ESTALE \
+ || GNULIB_defined_EDQUOT \
+ || GNULIB_defined_ECANCELED \
+ || GNULIB_defined_EOWNERDEAD \
+ || GNULIB_defined_ENOTRECOVERABLE \
+ || GNULIB_defined_EILSEQ
extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
-# else
-# define strerror_override(ignored) NULL
-# define GNULIB_defined_strerror_override_macro 1
-# endif
+#else
+# define strerror_override(ignored) NULL
+# define GNULIB_defined_strerror_override_macro 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
#endif /* _GL_STRERROR_OVERRIDE_H */
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
non-null and exists, uses it; otherwise uses the first of $TMPDIR,
P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
doesn't exist, none of the searched dirs exists, or there's not
enough space in TMPL. */
extern int path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Trim mode. */
#define TRIM_TRAILING 0
#define TRIM_LEADING 1
char *trim2 (const char *, int)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_RETURNS_NONNULL;
+
+
+#ifdef __cplusplus
+}
+#endif
# define _GL_U64_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return X rotated left by N bits, where 0 < N < 64. */
#define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n))
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#include "unitypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return the casefold mapping of a Unicode character. */
extern ucs4_t
uc_tocasefold (ucs4_t uc);
+
+
+#ifdef __cplusplus
+}
+#endif
#include "unitypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Determine whether a character is "cased" according to the Unicode Standard,
<https://www.unicode.org/versions/Unicode5.0.0/ch03.pdf>, section 3.13,
definition D120. */
extern bool
uc_is_case_ignorable (ucs4_t uc)
_UC_ATTRIBUTE_CONST;
+
+
+#ifdef __cplusplus
+}
+#endif
#include "unitypes.h"
#include "uninorm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return true if mapping NFD(S) to via MAPPING is a no-op. */
extern int
u8_is_invariant (const uint8_t *s, size_t n,
uint32_t *resultbuf, size_t *lengthp),
const char *iso639_language,
bool *resultp);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* A special casing context.
A context is negated through x -> -x. */
enum
extern const struct special_casing_rule *
gl_unicase_special_lookup (const char *str, size_t len);
+
+
+#ifdef __cplusplus
+}
+#endif
#include "unicase.h"
#include "uninorm.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern uint8_t *
u8_casemap (const uint8_t *s, size_t n,
casing_prefix_context_t prefix_context,
size_t offset_in_rule, /* offset in 'struct special_casing_rule' */
uninorm_t nf,
uint32_t *resultbuf, size_t *lengthp);
+
+
+#ifdef __cplusplus
+}
+#endif
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef UNICODEIO_H
-# define UNICODEIO_H
+#define UNICODEIO_H
+
+#include <stddef.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <stddef.h>
-# include <stdio.h>
/* Converts the Unicode character CODE to its multibyte representation
in the current locale and calls the SUCCESS callback on the resulting
extern long fwrite_success_callback (const char *buf, size_t buflen,
void *callback_arg);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include "unitypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Line breaking classification. */
enum
/* We don't support line breaking of complex-context dependent characters
(Thai, Lao, Myanmar, Khmer) yet, because it requires dictionary lookup. */
+
+
+#ifdef __cplusplus
+}
+#endif
#include "c-ctype.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define is_utf8_encoding unilbrk_is_utf8_encoding
extern int is_utf8_encoding (const char *encoding);
extern int is_all_ascii (const char *s, size_t n);
#endif /* C_CTYPE_ASCII */
+
+
+#ifdef __cplusplus
+}
+#endif
#include "unitypes.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Variant of uc_decomposition that does not produce the 'tag'. */
extern int
uc_compat_decomposition (ucs4_t uc, ucs4_t *decomposition);
extern void
gl_uninorm_decompose_merge_sort_inplace (struct ucs4_with_ccc *src, size_t n,
struct ucs4_with_ccc *tmp);
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Paul Eggert and Eric Blake. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int dup_safer (int);
int fd_safer (int);
int pipe_safer (int[2]);
#if GNULIB_PIPE2_SAFER
int pipe2_safer (int[2], int);
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
/* Get uint8_t, uint16_t, uint32_t. */
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Type representing a Unicode character. */
typedef uint32_t ucs4_t;
# endif
#endif
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _UNITYPES_H */
License and of the GNU General Public License along with this
program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const int uniwbrk_prop_index[23];
extern const unsigned char uniwbrk_table[12][12];
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Paul Eggert and Jim Meyering. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if UNLINK_CANNOT_UNLINK_DIR
# define cannot_unlink_dir() true
#else
bool cannot_unlink_dir (void);
#endif
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Jim Meyering, 2003. */
#ifndef USERSPEC_H
-# define USERSPEC_H 1
+#define USERSPEC_H 1
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
-# include <sys/types.h>
char const *
parse_user_spec (char const *spec_arg, uid_t *uid, gid_t *gid,
parse_user_spec_warn (char const *spec_arg, uid_t *uid, gid_t *gid,
char **username_arg, char **groupname_arg, bool *pwarn);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Options for utimecmp. */
enum
{
int utimecmpat (int, char const *, struct stat const *, struct stat const *,
int);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#endif
#include <time.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int fdutimens (int, char const *, struct timespec const [2]);
int utimens (char const *, struct timespec const [2]);
int lutimens (char const *, struct timespec const [2]);
+#ifdef __cplusplus
+}
+#endif
+
+
#if GNULIB_FDUTIMENSAT
+
# include <fcntl.h>
# include <sys/stat.h>
# define _GL_UTIMENS_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int fdutimensat (int fd, int dir, char const *name, struct timespec const [2],
int atflag);
return utimensat (dir, file, times, AT_SYMLINK_NOFOLLOW);
}
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif
#include <windows.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Prepares an argument vector before calling spawn().
Note that spawn() does not by itself call the command interpreter
HANDLE stdin_handle, HANDLE stdout_handle,
HANDLE stderr_handle);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _WINDOWS_SPAWN_H */
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
bool can_write_any_file (void);
+
+
+#ifdef __cplusplus
+}
+#endif
# define XBINARY_IO_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if O_BINARY
extern _Noreturn void xset_binary_mode_error (void);
#else
xset_binary_mode_error ();
}
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _XBINARY_IO_H */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern char *xgetcwd (void)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return the NIS domain name of the machine, in malloc'd storage.
WARNING! The NIS domain name is unrelated to the fully qualified host name
of the machine. It is also unrelated to email addresses.
extern char *xgetdomainname (void)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _XGETDOMAINNAME_H */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
char *xgethostname (void)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
int xmemcoll (char *restrict, size_t, char *restrict, size_t);
int xmemcoll0 (char const *, size_t, char const *, size_t);
+
+
+#ifdef __cplusplus
+}
+#endif
#include <stdarg.h>
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern int xprintf (char const *restrict format, ...)
#if GNULIB_VPRINTF_POSIX
_GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 2))
#endif
;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
extern char *xreadlink (char const *filename)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
extern char *xreadlinkat (int fd, char const *filename)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
#endif
+
+
+#ifdef __cplusplus
+}
+#endif
# define XSIZE_INLINE _GL_INLINE
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* The size of memory objects is often computed through expressions of
type size_t. Example:
void* p = malloc (header_size + n * element_size).
#define size_in_bounds_p(SIZE) \
((SIZE) != SIZE_MAX)
+
+#ifdef __cplusplus
+}
+#endif
+
_GL_INLINE_HEADER_END
#endif /* _XSIZE_H */
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/* Return a newly allocated copy of at most N bytes of STRING.
In other words, return a copy of the initial segment of length N of
STRING. */
extern char *xstrndup (const char *string, size_t n)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE
_GL_ATTRIBUTE_RETURNS_NONNULL;
+
+
+#ifdef __cplusplus
+}
+#endif
/* Written by Jim Meyering. */
#ifndef XSTRTOD_H
-# define XSTRTOD_H 1
+#define XSTRTOD_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
bool xstrtod (const char *str, const char **ptr, double *result,
double (*convert) (char const *, char **));
bool xstrtold (const char *str, const char **ptr, long double *result,
long double (*convert) (char const *, char **));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* not XSTRTOD_H */
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#ifndef XSTRTOL_H_
-# define XSTRTOL_H_ 1
+#define XSTRTOL_H_ 1
/* Get intmax_t, uintmax_t. */
-# include <stdint.h>
+#include <stdint.h>
-# ifndef _STRTOL_ERROR
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#ifndef _STRTOL_ERROR
enum strtol_error
{
LONGINT_OK = 0,
LONGINT_INVALID = 4
};
typedef enum strtol_error strtol_error;
-# endif
+#endif
-# define _DECLARE_XSTRTOL(name, type) \
+#define _DECLARE_XSTRTOL(name, type) \
strtol_error name (const char *, char **, int, type *, const char *);
_DECLARE_XSTRTOL (xstrtol, long int)
_DECLARE_XSTRTOL (xstrtoul, unsigned long int)
_DECLARE_XSTRTOL (xstrtoimax, intmax_t)
_DECLARE_XSTRTOL (xstrtoumax, uintmax_t)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* not XSTRTOL_H_ */
#ifndef YESNO_H_
# define YESNO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
bool yesno (void);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif