mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
Compare commits
5 commits
763bba9444
...
5a28b069c4
Author | SHA1 | Date | |
---|---|---|---|
|
5a28b069c4 | ||
|
83f201435f | ||
|
0e20604c73 | ||
|
9c0d5fb337 | ||
|
565063ee9b |
8 changed files with 32 additions and 11 deletions
|
@ -8,7 +8,7 @@ dnl This file is offered as-is, without any warranty.
|
|||
dnl
|
||||
|
||||
AC_PREREQ([2.70])
|
||||
AC_INIT([bookmarkfs], [0.1.0], [bug-bookmarkfs@nongnu.org])
|
||||
AC_INIT([bookmarkfs], [0.1.1], [bug-bookmarkfs@nongnu.org])
|
||||
AC_CONFIG_SRCDIR([bookmarkfs_util.pc.in])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
|
|
@ -1358,6 +1358,12 @@ The bookmark creation time.
|
|||
|
||||
Value is a decimal integer representing number of microseconds since
|
||||
the Unix epoch.
|
||||
|
||||
@item keyword
|
||||
The keyword associated with the bookmark.
|
||||
@xref{Keywords}.
|
||||
|
||||
This attribute is read-only.
|
||||
@end table
|
||||
|
||||
Notable limitations:
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#define BM_XATTR_TITLE 2
|
||||
#define BM_XATTR_GUID 3
|
||||
#define BM_XATTR_DATE_ADDED 4
|
||||
#define BM_XATTR_KEYWORD 5
|
||||
#define MOZBM_XATTR_START BM_XATTR_TITLE
|
||||
|
||||
#define BACKEND_EXCLUSIVE_LOCK ( 1u << 16 )
|
||||
|
@ -397,9 +398,8 @@ bookmark_do_create (
|
|||
stat_buf->value_len = -1;
|
||||
int64_t place_id = 0;
|
||||
if (!is_dir) {
|
||||
char const *url = "about:blank";
|
||||
stat_buf->value_len = strlen(url);
|
||||
status = mozplace_addref(ctx, url, stat_buf->value_len, &place_id,
|
||||
stat_buf->value_len = 0;
|
||||
status = mozplace_addref(ctx, STR_WITHLEN("about:blank"), &place_id,
|
||||
&stat_buf->atime);
|
||||
if (status < 0) {
|
||||
return status;
|
||||
|
@ -1086,7 +1086,7 @@ mozkw_delete (
|
|||
char const *name,
|
||||
size_t name_len
|
||||
) {
|
||||
sqlite3_stmt **stmt_ptr = &ctx->stmts[STMT_MOZKW_RENAME];
|
||||
sqlite3_stmt **stmt_ptr = &ctx->stmts[STMT_MOZKW_DELETE];
|
||||
char const *sql = "DELETE FROM `moz_keywords` "
|
||||
"WHERE `keyword` = ? RETURNING `place_id`";
|
||||
|
||||
|
@ -2092,7 +2092,10 @@ bookmark_do_get (
|
|||
#define BOOKMARK_GET_(cols, join) "SELECT CASE ? " cols "END " \
|
||||
"FROM `moz_bookmarks` `b` " join "WHERE `b`.`id` = ?"
|
||||
#define BOOKMARK_GET(cols) BOOKMARK_GET_(cols \
|
||||
"WHEN " STRINGIFY(BM_XATTR_DATE_ADDED) " THEN `b`.`dateAdded` ", )
|
||||
"WHEN " STRINGIFY(BM_XATTR_DATE_ADDED) " THEN `b`.`dateAdded` " \
|
||||
"WHEN " STRINGIFY(BM_XATTR_KEYWORD) " THEN " \
|
||||
"(SELECT `keyword` FROM `moz_keywords` `k` " \
|
||||
"WHERE `k`.`place_id` = `b`.`fk`) ", )
|
||||
#define BOOKMARK_GET_EX BOOKMARK_GET_( \
|
||||
"WHEN " STRINGIFY(BM_XATTR_NULL) " THEN `p`.`url` " \
|
||||
"WHEN " STRINGIFY(BM_XATTR_DESC) " THEN `p`.`description` " \
|
||||
|
@ -2637,6 +2640,9 @@ get_xattr_id (
|
|||
return BM_XATTR_GUID;
|
||||
}
|
||||
}
|
||||
if (0 == strcmp("keyword", name)) {
|
||||
return BM_XATTR_KEYWORD;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2942,9 +2948,9 @@ backend_create (
|
|||
resp_flags |= BOOKMARKFS_BACKEND_EXCLUSIVE;
|
||||
}
|
||||
|
||||
char const *xattr_names = "guid\0date_added\0description\0";
|
||||
char const *xattr_names = "guid\0date_added\0description\0keyword\0";
|
||||
if (opts.flags & BACKEND_FILENAME_GUID) {
|
||||
xattr_names = "title\0date_added\0description\0";
|
||||
xattr_names = "title\0date_added\0description\0keyword\0";
|
||||
}
|
||||
|
||||
resp->name = "firefox";
|
||||
|
@ -3724,6 +3730,9 @@ bookmark_set (
|
|||
}
|
||||
break;
|
||||
|
||||
case BM_XATTR_KEYWORD:
|
||||
return -EPERM;
|
||||
|
||||
default:
|
||||
return -ENOATTR;
|
||||
}
|
||||
|
|
|
@ -409,6 +409,12 @@ bm_create (
|
|||
}
|
||||
}
|
||||
|
||||
if (flags & O_TRUNC) {
|
||||
// See bm_open() for comments on O_RDONLY|O_TRUNC.
|
||||
if ((flags & O_ACCMODE) != O_RDONLY) {
|
||||
stat.value_len = 0;
|
||||
}
|
||||
}
|
||||
bm_fillstat(&stat, SUBSYS_TYPE_BOOKMARK, false, stat_buf);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#define BOOKMARKFS_VER_MAJOR 0
|
||||
#define BOOKMARKFS_VER_MINOR 1
|
||||
#define BOOKMARKFS_VER_PATCH 0
|
||||
#define BOOKMARKFS_VER_PATCH 1
|
||||
|
||||
#define bookmarkfs_make_vernum(major, minor, patch) \
|
||||
( ((major) << 16) | ((minor) << 8) | ((patch) << 0) )
|
||||
|
|
|
@ -122,7 +122,7 @@ do_check_fs_regrw (
|
|||
#ifndef O_DIRECT
|
||||
# define O_DIRECT 0
|
||||
#endif
|
||||
int fd = open(path, O_RDWR | O_TRUNC | O_DIRECT);
|
||||
int fd = open(path, O_RDWR | O_CREAT | O_TRUNC | O_DIRECT);
|
||||
ASSERT_NE(-1, fd);
|
||||
|
||||
struct stat stat_buf;
|
||||
|
|
|
@ -19,7 +19,6 @@ ATX_CHECK_FS_NEW_ANY([file_max=524288], [
|
|||
echo "prng seed: $seed"
|
||||
|
||||
ATX_RUN([
|
||||
touch $name
|
||||
check-fs regrw -n 524288 -s "$seed" $name
|
||||
])
|
||||
])
|
||||
|
|
|
@ -139,6 +139,7 @@ m4_define([ATX_CHECK_FS], [
|
|||
fi
|
||||
done
|
||||
$6
|
||||
ATX_RUN_ONE([check-fs ismount "$4"])
|
||||
], [
|
||||
umount "$4"
|
||||
])
|
||||
|
|
Loading…
Add table
Reference in a new issue