Fix a regression in commit d1dac54b72 where sys/stat.h is no longer
included in backend_firefox.c and backend_chromium.c.
It has to be explicitly included for the UTIME_xxx macros.
Switch to schema version 74, so that it is compatible with
browsers (e.g., GNU IceCat) which are still based on
Firefox 115 ESR (now end-of-life), as well as saving us
a bit more space since there are fewer tables to be created.
There were bad code changes that cause the compiler to complain or
panic, but went unnoticed since they are only built if toggled with
`--enable-xxx` or `--disable-xxx` during build configuration.
Fix them altogether.
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.
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.
- 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.
- 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.
- 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.