#define _POSIX_C_SOURCE 200809L #include #include #include #include #include #include "auth.h" #include "http.h" #include "timeline.h" #include "login_window.h" static void activate(GtkApplication *app, gpointer user_data) { create_login_window(app, user_data); } int main(int argc, char **argv) { /* gtk_init(&argc, &argv); */ /* create_main_window(); */ /* gtk_main(); */ if (http_init()) { fprintf(stderr, "main(): failed to load http library\n"); return EXIT_FAILURE; } GtkApplication *app; int status; app = gtk_application_new("org.gtk.ap_client", G_APPLICATION_FLAGS_NONE); g_signal_connect(app, "activate", G_CALLBACK(activate), NULL); status = g_application_run(G_APPLICATION(app), argc, argv); g_object_unref(app); http_cleanup(); auth_cleanup(); return status; /* char *text; */ /* struct timeline *t; */ /* char *url = "https://mstdn.io/api/v1/timelines/home"; */ /* char *token = */ /* "580acfb412e927c2030fb5519f417b03ced1482c862d44376922cd81ee8a3655"; */ /* text = request(url, token); */ /* if (!text) { */ /* fprintf(stderr, "main(): failed to get http response\n"); */ /* return EXIT_FAILURE; */ /* } */ /* t = timeline_from_json(text); */ /* if (t == NULL) { */ /* fprintf(stderr, "main(): failed to parse timeline\n"); */ /* return EXIT_FAILURE; */ /* } */ /* for (size_t i = 0; i < t->size; i++) { */ /* printf("status id: %s\n", t->statuses[i]->id); */ /* printf("content: %s\n", t->statuses[i]->content); */ /* printf("reblog count: %d\n", t->statuses[i]->reblogs_count); */ /* printf("fav count: %d\n", t->statuses[i]->favourites_count); */ /* printf("\n"); */ /* } */ /* free(text); */ /* timeline_free(t); */ }