#define _X_OPEN_SOURCE #include "tui.h" #include "yt.h" #include #include #include #include #include #include #include #include #include #include #include static std::string user_home; std::vector channels; std::unordered_map> videos; std::optional selected_channel; size_t current_video_count = 0; size_t selected_video = 0; size_t videos_per_page = 0; size_t current_page_count = 0; size_t title_offset = 0; bool any_title_in_next_half = false; #define SC(x) { const int res = (x); if(res != SQLITE_OK && res != SQLITE_ROW && res != SQLITE_DONE) { tui_abort("Database error:\n%s failed: (%d) %s", #x, res, sqlite3_errstr(res)); }} static termpaint_attr* get_attr(const AttributeSetType type, const bool highlight=false) { return highlight ? attributes[type].highlight : attributes[type].normal; } void draw_channel_list(const std::vector