index — thing @ 8758158744d8b7d6adae9f8a88bfae226bd38417

A little something I'm working on

structure, build: set up meson and library correctly
crispy-caesus crispy@crispy-caesus.eu
Wed, 09 Sep 2026 14:11:49 +0200
commit

8758158744d8b7d6adae9f8a88bfae226bd38417

parent

7a2b1e0c05f690291f01dcfa0560bbd8acc01ad1

D json.c

@@ -1,47 +0,0 @@

-struct ListItem { - char *name; - char *creator; - char *description; - char *cover_art; - char *release_status; - - int episodes_total; - int episodes_released; - int episodes_watched; - int season; - int rewatch_count; -}; - -struct Category { - char *name; - char *description; - struct ListItem *items; -}; - -struct List { - char *api_version; - struct Category categories[]; -}; - -struct state { - int plist; - int pversion; - int pcategories; - int pcname; - int pcitems; - int piname; - int picreator; - int pidescription; - int picover_art; - int pirelease_status; - int piepisodes_toral; - int piepisodes_released; - int piepisodes_watched; - int piseason; - int pirewatch_count; -}; - -struct List readJson() { - struct List list; - return list; -}
A libthingterm/meson.build

@@ -0,0 +1,45 @@

+project( + 'libthingterm', + 'c', + version: '0.0.1', + default_options: [ + 'c_std=c99', + 'warning_level=3', + ], +) + +libthingterm_sources = files( + 'src/term.c', + 'src/menu.c', +) + +libthingterm_headers = files( + 'include/term.h', + 'include/menu.h', +) + +libthingterm_inc = include_directories('include') + +libthingterm = library( + 'thingterm', + libthingterm_sources, + include_directories: libthingterm_inc, + install: true, +) + +install_headers( + libthingterm_headers, + subdir: 'libthingterm', +) + +pkg = import('pkgconfig') + +pkg.generate( + libthingterm, + name: 'libthingterm', + description: 'thing\'s terminal library', + version: meson.project_version(), + filebase: 'libthingterm', + subdirs: 'libthingterm', +) +
M main.cthing/src/thing.c

@@ -1,8 +1,8 @@

#include <stdio.h> #include <termios.h> -#include "menu.h" -#include "term.h" +#include <libthingterm/menu.h> +#include <libthingterm/term.h> int main() { uint8_t ret = 0;
D meson.build

@@ -1,9 +0,0 @@

-project( - 'thing', - 'c', - default_options : - ['c_std=c99', 'W=all'] - ) -term = library('thingterm', 'term.c') -menu = library('thingmenu', 'menu.c') -executable('thing', 'main.c', link_with: [term, menu])
D test.json

@@ -1,66 +0,0 @@

-{ - "api-version": "0.1", - "categories": [ - { - "name": "watching", - "items": [ - { - "name": "Witch Hat Atelier", - "creator": "BUG FILMS", - "description": "In a world where everyone takes wonders like magic spells and dragons for granted, Coco is a girl with a simple dream: she wants to be a witch. But everybody knows magicians are born, not made, and Coco was not born with a gift for magic. Resigned to her un-magical life, Coco is about to give up on her dream to become a witch … until the day she meets Qifrey, a mysterious, traveling magician. After secretly seeing Qifrey perform magic in a way she’s never seen before, Coco soon learns what everybody “knows” might not be the truth, and discovers that her magical dream may not be as far away as it may seem... ", - "cover-art": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx147105-rwOX8qyUy8gV.jpg", - "release-status": "releasing", - "episodes-total": 13, - "episodes-released": 5, - "episodes_watched": 5, - "season": 1, - "rewatch-count": 0 - }, - { - "name": "ONE PIECE", - "creator": "Toei Animation", - "description": "Gold Roger was known as the Pirate King, the strongest and most infamous being to have sailed the Grand Line. The capture and death of Roger by the World Government brought a change throughout the world. His last words before his death revealed the location of the greatest treasure in the world, One Piece. It was this revelation that brought about the Grand Age of Pirates, men who dreamed of finding One Piece (which promises an unlimited amount of riches and fame), and quite possibly the most coveted of titles for the person who found it, the title of the Pirate King.\n\nEnter Monkey D. Luffy, a 17-year-old boy that defies your standard definition of a pirate. Rather than the popular persona of a wicked, hardened, toothless pirate who ransacks villages for fun, Luffy’s reason for being a pirate is one of pure wonder; the thought of an exciting adventure and meeting new and intriguing people, along with finding One Piece, are his reasons of becoming a pirate. Following in the footsteps of his childhood hero, Luffy and his crew travel across the Grand Line, experiencing crazy adventures, unveiling dark mysteries and battling strong enemies, all in order to reach One Piece.", - "cover-art": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx21-ELSYx3yMPcKM.jpg", - "release-status": "releasing", - "episodes-total": 1160, - "episodes-released": 1159, - "episodes_watched": 88, - "season": 1, - "rewatch-count": 0 - }, - { - "name": "Penguin Highway", - "creator": "WIT STUDIO", - "description": "Budding genius Aoyama is only in the 4th grade, but already lives his life like a scientist. When penguins start appearing in his sleepy suburb hundreds of miles from the sea, Aoyama vows to solve the mystery. When he finds the source of the penguins is a woman from his dentist’s office, they team up for an unforgettable summer adventure!", - "cover-art": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/medium/b101249-GN52PNw4RiM6.jpg", - "release-status": "finished", - "episodes-total": 1, - "episodes-released": 1, - "episodes_watched": 0, - "season": 1, - "rewatch-count": 0 - } - ] - }, - { - "name": "planning" - }, - { - "name": "finished", - "items": [ - { - "name": "OSHI NO KO", - "creator": "Doga Kobo", - "description": "The third season of Oshi no Ko.\n\nThe story enters a new stage.\n\nIt's been six months since \"POP IN 2\" was released. Thanks to MEM-Cho's hard work, B-Komachi is about to get their major break. Aqua is a multi-talented entertainer, and Akane's career as a talented actress is going smoothly. Meanwhile, Kana lost the cheerfulness she once had. To track down the truth behind Ai and Goro's deaths, Ruby keeps rising in the entertainment world...\n\nUsing lies as a weapon.", - "cover-art": "https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx182587-fsU8LOjmd7oj.jpg", - "release-status": "finished", - "episodes-total": 11, - "episodes-released": 11, - "episodes_watched": 11, - "season": 3, - "rewatch-count": 0 - } - ] - } - ] -}
A thing/meson.build

@@ -0,0 +1,20 @@

+project( + 'thing', + 'c', + default_options : + ['c_std=c99', 'warning_level=3'] +) + +project_source_files = [ + 'src/thing.c' +] + +project_dependencies = [ + dependency('libthingterm'), +] + +executable( + meson.project_name(), + project_source_files, + dependencies: project_dependencies, +)