aboutsummaryrefslogtreecommitdiff
path: root/booki.c
diff options
context:
space:
mode:
authorBen Winston2025-02-04 22:14:57 -0500
committerBen Winston2025-02-04 22:14:57 -0500
commit7b3d731b738cbf23c5e1f117baf954cdb5d81f10 (patch)
treee1ea304bf3d4d84c17e6eab9532f1db457f1a128 /booki.c
parentafe32dfe3c3294ff12a9c39d1294cd2db66b5ec8 (diff)
add 'genre'
Diffstat (limited to 'booki.c')
-rw-r--r--booki.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/booki.c b/booki.c
index 8f9af6d..3edbd8f 100644
--- a/booki.c
+++ b/booki.c
@@ -32,6 +32,7 @@ static const DataField BOOK_FIELDS[] = {
{ "language", booki_string, true },
{ "translator", booki_string, true },
{ "on", booki_string, true },
+ { "genre", booki_string, true },
{ "id", booki_number, false },
{ "_other", booki_raw, false }
};
@@ -402,6 +403,7 @@ struct Book {
ES language;
ES translator;
ES on;
+ ES genre;
int published;
// catch-all
@@ -417,6 +419,7 @@ void init_book(BOOK* book) {
book->language = default_es;
book->translator = default_es;
book->on = default_es;
+ book->genre = default_es;
book->published = 0;
book->_other = default_es;
@@ -437,6 +440,8 @@ ES* get_string_field(BOOK* book, char* name) {
return &(book->translator);
else if (ATTR_MATCH(name, "on"))
return &(book->on);
+ else if (ATTR_MATCH(name, "genre"))
+ return &(book->genre);
else if (ATTR_MATCH(name, "_other"))
return &(book->_other);
else