mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
chore: misc cleanup
This commit is contained in:
parent
cadde0b61e
commit
9fab17734c
10 changed files with 48 additions and 68 deletions
|
@ -28,9 +28,7 @@ AS_CASE(["${host_os}"], [linux*], [
|
|||
], [freebsd*], [
|
||||
AS_VAR_SET([host_os_is_freebsd], [yes])
|
||||
], [
|
||||
AC_MSG_WARN(m4_normalize([
|
||||
Unsupported platform "${host_os}".
|
||||
]))
|
||||
AC_MSG_WARN(m4_normalize([Unsupported platform "${host_os}".]))
|
||||
])
|
||||
|
||||
# -- Checks for programs --
|
||||
|
@ -176,6 +174,7 @@ AX_GCC_FUNC_ATTRIBUTE([cold])
|
|||
AX_GCC_FUNC_ATTRIBUTE([destructor])
|
||||
AX_GCC_FUNC_ATTRIBUTE([malloc])
|
||||
AX_GCC_FUNC_ATTRIBUTE([noreturn])
|
||||
AX_GCC_FUNC_ATTRIBUTE([pure])
|
||||
AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
|
||||
AX_GCC_FUNC_ATTRIBUTE([visibility])
|
||||
AX_GCC_VAR_ATTRIBUTE([unused])
|
||||
|
@ -209,8 +208,7 @@ m4_version_prereq([2.72], [
|
|||
AC_SYS_YEAR2038
|
||||
AS_VAR_IF([ac_have_year2038], [no], [
|
||||
AC_MSG_ERROR(m4_normalize([
|
||||
64-bit time_t (required by some backends) is unsupported on
|
||||
this platform.
|
||||
64-bit time_t is unsupported on this platform.
|
||||
]))
|
||||
])
|
||||
], [
|
||||
|
|
|
@ -3648,7 +3648,6 @@ If this function is never called, the hash function bahaves as if it is
|
|||
seeded with all bits zero.
|
||||
|
||||
@item hash_digest
|
||||
|
||||
Calculates the digest of the given input.
|
||||
|
||||
@example c
|
||||
|
@ -3660,7 +3659,6 @@ hash_digest (
|
|||
@end example
|
||||
|
||||
@item hash_digestv
|
||||
|
||||
Like @code{hash_digest()}, but takes input from multiple buffers.
|
||||
|
||||
@example c
|
||||
|
@ -3675,7 +3673,6 @@ The function is guaranteed not to modify the buffer data of each
|
|||
@code{struct iovec} object.
|
||||
|
||||
@item hash_digestcb
|
||||
|
||||
Like @code{hash_digestv()}, but takes input buffers from a callback function.
|
||||
|
||||
@example c
|
||||
|
@ -3690,7 +3687,6 @@ Function arguments:
|
|||
|
||||
@table @code
|
||||
@item callback
|
||||
|
||||
The function to provide input buffers.
|
||||
It must not be @code{NULL}.
|
||||
|
||||
|
@ -3981,7 +3977,6 @@ Functions:
|
|||
|
||||
@table @code
|
||||
@item prng_seed
|
||||
|
||||
Updates the seed used by the PRNG.
|
||||
|
||||
@example c
|
||||
|
@ -4225,7 +4220,6 @@ watcher_destroy (
|
|||
@end example
|
||||
|
||||
@item watcher_poll
|
||||
|
||||
Checks whether the file being watched has changed.
|
||||
This function never blocks.
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ AC_DEFUN([BOOKMARKFS_AMCOND], [
|
|||
])
|
||||
|
||||
dnl
|
||||
dnl BOOKMARKFS_FEAT_OUT([features]...)
|
||||
dnl BOOKMARKFS_FEAT_EXPORT([features]...)
|
||||
dnl
|
||||
dnl Export feature flags to Autoconf output variables,
|
||||
dnl similar to the ones set by AM_CONTITIONAL() (`xxx_TRUE` only).
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#define BACKEND_OPT_BAD_VAL() BACKEND_OPT_ERR_(BAD_VAL)
|
||||
#define BACKEND_OPT_NO_VAL \
|
||||
if (val_ != NULL) return BACKEND_OPT_ERR_(HAS_VAL);
|
||||
#define BACKEND_OPT_VAL_STR val_
|
||||
#define BACKEND_OPT_VAL_STR (val_)
|
||||
|
||||
#define FILENAME_BADCHAR -1
|
||||
#define FILENAME_BADLEN -2
|
||||
|
@ -67,14 +67,12 @@
|
|||
* Returns the directory file descriptor if successful.
|
||||
* On error, -1 is returned, and errno is set.
|
||||
*/
|
||||
BOOKMARKFS_INTERNAL
|
||||
int
|
||||
basename_opendir (
|
||||
char *path,
|
||||
char **basename_ptr
|
||||
);
|
||||
|
||||
BOOKMARKFS_INTERNAL
|
||||
FUNCATTR_COLD
|
||||
int
|
||||
print_backend_opt_err_ (
|
||||
|
@ -91,7 +89,6 @@ print_backend_opt_err_ (
|
|||
* If returning FILENAME_BADCHAR, stores the pointer to the first
|
||||
* bad character to `end_ptr` unless it is NULL.
|
||||
*/
|
||||
BOOKMARKFS_INTERNAL
|
||||
int
|
||||
validate_filename (
|
||||
char const *str,
|
||||
|
@ -99,7 +96,6 @@ validate_filename (
|
|||
char const **end_ptr
|
||||
);
|
||||
|
||||
BOOKMARKFS_INTERNAL
|
||||
int
|
||||
validate_filename_fsck (
|
||||
char const *str,
|
||||
|
|
15
src/defs.h
15
src/defs.h
|
@ -61,6 +61,12 @@
|
|||
# endif /* defined(HAVE_FUNC_ATTRIBUTE_NORETURN) */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FUNC_ATTRIBUTE_PURE
|
||||
# define FUNCATTR_PURE __attribute__((pure))
|
||||
#else
|
||||
# define FUNCATTR_PURE
|
||||
#endif /* defined(HAVE_FUNC_ATTRIBUTE_PURE) */
|
||||
|
||||
#ifdef HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
|
||||
# define FUNCATTR_RETURNS_NONNULL __attribute__((returns_nonnull))
|
||||
#else
|
||||
|
@ -86,15 +92,6 @@
|
|||
# define UNUSED_VAR(name) name##_unused_ VARATTR_UNUSED_
|
||||
#endif /* defined(HAVE_STDC_23) */
|
||||
|
||||
#if defined(HAVE_STDC_23)
|
||||
# define BOOKMARKFS_TLS thread_local
|
||||
#elif defined(HAVE_STDC_11)
|
||||
# define BOOKMARKFS_TLS _Thread_local
|
||||
// Incomprehensive list. Add more if needed.
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
# define BOOKMARKFS_TLS __thread
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || (defined(__linux__) && defined(_GNU_SOURCE))
|
||||
# define HAVE_PIPE2 1
|
||||
#endif
|
||||
|
|
|
@ -197,7 +197,7 @@ static int bm_create (uint64_t, char const *, int, struct stat *);
|
|||
static int bm_delete (uint64_t, char const *, uint32_t);
|
||||
static int bm_do_write (uint64_t, struct fs_file_handle *);
|
||||
static void bm_fh_free (struct fs_file_handle *, long);
|
||||
static struct fs_file_handle *
|
||||
static struct fs_file_handle * FUNCATTR_PURE
|
||||
bm_fh_get (uint64_t, unsigned long *, unsigned long *);
|
||||
static struct fs_file_handle *
|
||||
bm_fh_new (uint64_t);
|
||||
|
|
|
@ -25,11 +25,9 @@
|
|||
|
||||
#include "defs.h"
|
||||
|
||||
BOOKMARKFS_INTERNAL
|
||||
int
|
||||
bookmarkfs_lib_init (void);
|
||||
|
||||
BOOKMARKFS_INTERNAL
|
||||
FUNCATTR_COLD
|
||||
void
|
||||
bookmarkfs_print_lib_version (
|
||||
|
|
|
@ -45,8 +45,5 @@ $(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 $(TESTS_)
|
|||
check-local: atconfig atlocal $(TESTSUITE)
|
||||
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
|
||||
|
||||
installcheck-local: atconfig atlocal $(TESTSUITE)
|
||||
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) AUTOTEST_PATH='$(bindir)'
|
||||
|
||||
clean-local:
|
||||
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
/**
|
||||
* bookmarkfs/tests/check_sandbox.c
|
||||
* ----
|
||||
*
|
||||
* Copyright (C) 2025 CismonX <admin@cismon.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* bookmarkfs/tests/check_sandbox.c
|
||||
* ----
|
||||
*
|
||||
* Copyright (C) 2025 CismonX <admin@cismon.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
/**
|
||||
* bookmarkfs/tests/check_watcher.c
|
||||
* ----
|
||||
*
|
||||
* Copyright (C) 2025 CismonX <admin@cismon.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* bookmarkfs/tests/check_watcher.c
|
||||
* ----
|
||||
*
|
||||
* Copyright (C) 2025 CismonX <admin@cismon.net>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
|
|
Loading…
Add table
Reference in a new issue