Commit graph

89 commits

Author SHA1 Message Date
CismonX
08f0655721
test: init tests; add tests for util lib
- Init Autotest.
  Not using DejaGNU since there won't be many interactive testing.
- Add basic test cases for the utility library (hash and prng).
2025-02-08 01:48:07 +08:00
CismonX
b195e7821a
hash: add hash_digestcb() function
May be useful for calculating hash of a stream of input data.
2025-02-06 16:09:58 +08:00
CismonX
767e25e867
xstd: update xabort_() output format 2025-02-05 18:28:22 +08:00
CismonX
d99ef6d681
chore: update links
- Specify the full homepage URL.
- Follow GNU's naming convention for mailing lists.
2025-02-05 18:11:37 +08:00
CismonX
fbed71ce3e
all: add line number to log output 2025-02-04 20:55:49 +08:00
CismonX
852caab209
doc: misc update 2025-02-04 20:55:29 +08:00
CismonX
8b848825f2
doc: update backend API
Add doc for the `cookie_free` and `bookmark_sync` functions.
2025-02-04 16:51:31 +08:00
CismonX
d0aa74b212
backend: rename object_free -> cookie_free 2025-02-03 18:15:52 +08:00
CismonX
f92054bdf5
doc: update backend API
- Add doc for the `bookmark_get` function.
- Update doc for the `bookmark_list` function.
2025-02-03 18:02:59 +08:00
CismonX
1d1ff58aa4
ioctl: move type definitions to common.h 2025-02-02 21:35:12 +08:00
CismonX
031691fae5
build: move BUILDING_BOOKMARKFS to config.h 2025-02-02 18:51:48 +08:00
CismonX
d08848c097
db: minor refactor 2025-02-02 17:55:14 +08:00
CismonX
54c81c43bb
all: fix __FILE_NAME__ workaround
Do not apply offset for __FILE__ in non-VPATH build,
since the path is not prefixed with `${srcdir}/` in that case.
2025-02-02 17:48:42 +08:00
CismonX
c17d6ebadf
all: better workaround for __FILE_NAME__
There's only a few legacy releases of gcc and clang that
support -fmacro-prefix-map but not __FILE_NAME__.
Thus the originial workaround is not very beneficial.

Switching to a more portable `__FILE__ + offset` workaround
that works for any standard-compliant compiler, even TinyCC.

However, this workaround may produce binaries that leak
information about the build environment, especially when using
an exotic build path.
2025-02-01 23:25:19 +08:00
CismonX
5286cda051
doc: update backend API
- Add doc for the `bookmark_list` function.
- Other misc changes.
2025-02-01 19:07:42 +08:00
CismonX
88e38bd38e
backend: update cookie even on callback failure
No need to check status and always update cookie after
invoking callback for bookmark_list() and bookmark_fsck().
2025-02-01 00:21:02 +08:00
CismonX
78b80be2e5
backend: rename struct bookmarkfs_bookmark_entry
Rename field `next` -> `off`.
2025-01-31 20:31:52 +08:00
CismonX
93ff8cabe9
doc: update backend API
Add doc for the `backend_mkfs` function.
2025-01-31 00:09:17 +08:00
CismonX
6cae25ee7f
doc: misc update 2025-01-30 21:50:56 +08:00
CismonX
da453cdefd
doc: update backend API
Add doc for the `backend_sandbox` function.
2025-01-29 23:10:22 +08:00
CismonX
341b7b3d5a
doc: misc update
- Add manual section for the utility library.
- Add comments for utility library functions.
- Fix installation path for backends and fsck handlers.
2025-01-28 20:56:06 +08:00
CismonX
50f05d2bd3
all: relax compiler requirements
- Do not check __STDC_HOSTED__.
- Do not use atomic builtins.
- Do not use thread-local storage for PRNG state.
2025-01-28 20:20:20 +08:00
CismonX
56fa90397d
fs_ops: limit xattr value length 2025-01-27 23:48:37 +08:00
CismonX
18b801f960
doc: update backend API
Add doc for the `bookmark_lookup` function.
2025-01-27 23:19:28 +08:00
CismonX
579f396e46
doc: minor update 2025-01-26 19:39:13 +08:00
CismonX
3ed11f53e5
backend: fix xattr bookmark title check
Do not check if the bookmark title is a valid filename,
as we said in the user manual.

However, we should ensure that the string does not contain
NUL characters, since we assume that a valid bookmark storage
should not contain bookmarks with such names.
2025-01-26 19:35:03 +08:00
CismonX
996ca0e042
backend_firefox: fix and refactor mkfs
- Make sure all tables and indices are created for the database,
  even the ones that are not used by BookmarkFS.
- Maintain the schema version in `PRAGMA user_version`.
- Always use `INT` for integer type, and `TEXT` for text type,
  so that we could save a little space.  This does not affect the
  actual datatype (more precisely, type affinity) of the columns.
2025-01-26 00:19:54 +08:00
CismonX
3b45900157
db: allow non-integer argument for safeincr 2025-01-25 21:25:37 +08:00
CismonX
35d4a93a41
backend_firefox: fix sandbox
- Allow fdatasync(), since it is used by SQLite when commiting.
- Move `PRAGMA quick_check` to backend_create(), since it sometimes
  calls stat() and cannot be sandboxed.
2025-01-25 21:15:57 +08:00
CismonX
10ad224b03
backend: rename backend_sync -> bookmark_sync 2025-01-24 23:07:22 +08:00
CismonX
bff21c54b1
doc: update doc for fsck handler API
Add doc for the `run` function.
2025-01-24 18:37:23 +08:00
CismonX
a01912e6f0
doc: misc update
- Remove bogus EACCES for BOOKMARKFS_IOC_FSCK_NEXT.
  If read permission is denied, the directory fd would not have
  been obtained from open() in the first place.
- Add description for pkglibdir.
2025-01-24 17:18:57 +08:00
CismonX
8e86e56dfc
doc: update backend API and fsck handler API
- Add doc for the `backend_destroy` function.
- Add doc for the fsck handler `create` and `destroy` functions.
2025-01-24 09:44:04 +08:00
CismonX
623b4dd4f3
backend: rename backend_free -> backend_destroy 2025-01-24 09:12:41 +08:00
CismonX
b9e02d2d3d
fsck: add BOOKMARKFS_FSCK_HANDLER_READONLY flag
instead of reusing the BOOKMARKFS_BACKEND_READONLY flag
2025-01-24 08:34:40 +08:00
CismonX
3cb99fe85b
all: fix punctuation regarding "e.g." and "i.e."
Follow the convention of modern English grammar that
a comma should usually come after "e.g." and "i.e.".
2025-01-23 19:23:54 +08:00
CismonX
5d861f4752
doc: update doc for backend API
Add doc for the `backend_create` function.
2025-01-23 19:11:36 +08:00
CismonX
0510e5e8c0
doc: update doc for fsck handler API
Add doc for the `info` function.
2025-01-23 18:02:10 +08:00
CismonX
228f1b621e
doc: misc fix
- Specify lowercase "c" for @example, otherwise
  GNU Source-highlight recognize it as C++ code.
- ...
2025-01-23 17:48:47 +08:00
CismonX
22263e48f2
backend: rename struct
`bookmarkfs_backend_init_resp` -> `bookmarkfs_backend_create_resp`,
since it is used for `backend_create` instead of `backend_init`.
2025-01-23 17:41:31 +08:00
CismonX
b699a613ef
fsck_online: wrap Linux getdents(2) to a function 2025-01-23 00:00:00 +08:00
CismonX
c2bdd02c65
doc: update backend API
Add doc for `backend_init` and `backend_info` functions.
2025-01-21 20:15:58 +08:00
CismonX
6989f1e828
doc: misc refactor 2025-01-21 19:24:02 +08:00
CismonX
12fb17463a
doc: add overview for backend and fsck handler API 2025-01-21 11:53:49 +08:00
CismonX
8b1c0d0dc1
doc: misc update 2025-01-20 20:08:06 +08:00
CismonX
712861e8f8
fsck: fix fsck apply
- Throw an error if the handler tries to apply in readonly mode
- Do not expose BOOKMARKFS_FSCK_RESULT_END to the handler
2025-01-18 08:52:43 +08:00
CismonX
7aaa8753cc
doc: misc update
- Limitations on FreeBSD
- Extended attributes for backends
- ...
2025-01-17 21:52:59 +08:00
CismonX
521fadcc2c
doc: add doc for the Tcl-based fsck handler 2025-01-16 22:19:59 +08:00
CismonX
fb197f9941
doc: fix style
Make sure there is a blank line between table items.
This affects Info output.
2025-01-16 12:46:58 +08:00
CismonX
dad6533028
doc: update section "directory entries"
Explain why "." and ".." entries are missing from BookmarkFS.
2025-01-16 11:42:42 +08:00