diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index ac7ec7c..8bbcbd7 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -8,6 +8,7 @@ emojitoc static/*.ctmpl static/*.c mastodont-c +treebird.make config.h treebird test/tests diff --git a/premake4.lua b/premake4.lua index 4357dae..860c2a2 100644 --- a/premake4.lua +++ b/premake4.lua @@ -52,7 +52,7 @@ local pages = { -- 'scrobble.c', -- 'search.c', -- 'status.c', --- 'timeline.c', + 'timeline.c', }; local definitions = {}; diff --git a/src/main.c b/src/main.c index 716d580..bbf6581 100644 --- a/src/main.c +++ b/src/main.c @@ -116,7 +116,6 @@ static struct path_info paths[] = { #ifdef CMP_ENABLE_LISTS { "/lists/edit/:", list_edit }, - { "/lists/for/:", content_tl_list }, { "/lists", content_lists }, #endif @@ -125,6 +124,10 @@ static struct path_info paths[] = { { "/federated", content_tl_federated }, { "/direct", content_tl_direct }, { "/bookmarks", content_account_bookmarks }, + { "/lists/for/:", content_tl_list }, +# ifdef CMP_ENABLE_HASHTAG + { "/tag/:", content_tl_tag }, +# endif #endif #ifdef CMP_ENABLE_NOTIFICATIONS @@ -137,9 +140,6 @@ static struct path_info paths[] = { { "/treebird_api/v1/notifications", api_notifications }, #endif -#ifdef CMP_ENABLE_HASHTAG - { "/tag/:", content_tl_tag }, -#endif #ifdef CMP_ENABLE_CONVERSATIONS { "/chats/:", content_chat_view }, @@ -151,7 +151,9 @@ static struct path_info paths[] = { { "/exit", exit_treebird }, #endif // Debug, but cool to see +#ifdef CMP_ENABLE_MEMORY { "/memory_stats", content_memory_stats }, +#endif }; static int application(mastodont_t* api, REQUEST_T req) diff --git a/src/timeline.c b/src/timeline.c index c6a3d24..786e8e7 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -72,7 +72,7 @@ request_cb_tl_home(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_HOME, NULL, 1, 0); @@ -87,7 +87,7 @@ request_cb_tl_local(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_LOCAL, NULL, 1, 0); @@ -102,7 +102,7 @@ request_cb_tl_public(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_FEDERATED, NULL, 1, 0); @@ -117,7 +117,7 @@ request_cb_tl_list(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_LISTS, NULL, 0, 0); @@ -132,7 +132,7 @@ request_cb_tl_direct(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_DIRECT, NULL, 0, 0); @@ -147,7 +147,7 @@ request_cb_tl_tags(mstdnt_request_cb_data* cb_data, void* tbargs) struct mstdnt_statuses* statuses = MSTDNT_CB_DATA(cb_data); DESTRUCT_TB_ARGS(tbargs); - content_timeline(req, ssn, api, cb_data->storage, + content_timeline(req, ssn, api,// cb_data->storage, statuses->statuses, statuses->len, BASE_CAT_NONE, NULL, 0, 0); @@ -183,7 +183,7 @@ tl_home(REQUEST_T req, struct session* ssn, mastodont_t* api, int local) request_args_create(req, ssn, api, NULL); return mstdnt_timeline_home(api, &m_args, request_cb_tl_home, - cb_args, &args); + cb_args, args); } int @@ -211,7 +211,7 @@ tl_direct(REQUEST_T req, struct session* ssn, mastodont_t* api) request_args_create(req, ssn, api, NULL); return mstdnt_timeline_direct(api, &m_args, request_cb_tl_direct, - cb_args, &args); + cb_args, args); } int @@ -245,7 +245,7 @@ tl_public(REQUEST_T req, request_args_create(req, ssn, api, NULL); return mstdnt_timeline_public(api, &m_args, request_cb_tl_public, - cb_args, &args); + cb_args, args); } int @@ -275,7 +275,7 @@ tl_list(REQUEST_T req, request_args_create(req, ssn, api, NULL); return mstdnt_timeline_list(api, &m_args, request_cb_tl_list, cb_args, - list_id, &args); + list_id, args); } @@ -305,7 +305,7 @@ tl_tag(REQUEST_T req, request_args_create(req, ssn, api, NULL); return mstdnt_timeline_tag(api, &m_args, request_cb_tl_tags, cb_args, - tag_id, &args); + tag_id, args); } int diff --git a/treebird.make b/treebird.make deleted file mode 100644 index 142be46..0000000 --- a/treebird.make +++ /dev/null @@ -1,284 +0,0 @@ -# GNU Make project makefile autogenerated by Premake -ifndef config - config=debug -endif - -ifndef verbose - SILENT = @ -endif - -CC = cc -CXX = g++ -AR = ar - -ifndef RESCOMP - ifdef WINDRES - RESCOMP = $(WINDRES) - else - RESCOMP = windres - endif -endif - -ifeq ($(config),debug) - OBJDIR = obj/Debug - TARGETDIR = . - TARGET = $(TARGETDIR)/treebird - DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DDEBUG - INCLUDES += -Iinclude - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -g `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts` - LDDEPS += - LIBS += $(LDDEPS) -lfcgi - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -ifeq ($(config),release) - OBJDIR = obj/Release - TARGETDIR = . - TARGET = $(TARGETDIR)/treebird - DEFINES += -DCMP_ENABLE_ABOUT -DCMP_ENABLE_ACCOUNT -DCMP_ENABLE_APPLICATIONS -DCMP_ENABLE_ATTACHMENTS -DCMP_ENABLE_BASE_PAGE -DCMP_ENABLE_CONVERSATIONS -DCMP_ENABLE_EMOJI -DCMP_ENABLE_EMOJI_REACTION -DCMP_ENABLE_GLOBAL_CACHE -DCMP_ENABLE_GLOBAL_PERL -DCMP_ENABLE_HASHTAG -DCMP_ENABLE_HTTP -DCMP_ENABLE_INDEX -DCMP_ENABLE_LISTS -DNDEBUG - INCLUDES += -Iinclude - ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) - ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) $(ARCH) -O2 `pkg-config --cflags mastodont` `perl -MExtUtils::Embed -e ccopts` -Wno-compound-token-split-by-macro - ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CFLAGS) - ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) - ALL_LDFLAGS += $(LDFLAGS) -L. -s `pkg-config --libs mastodont` `perl -MExtUtils::Embed -e ldopts` - LDDEPS += - LIBS += $(LDDEPS) -lfcgi - LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ARCH) $(ALL_LDFLAGS) $(LIBS) - define PREBUILDCMDS - endef - define PRELINKCMDS - endef - define POSTBUILDCMDS - endef -endif - -OBJECTS := \ - $(OBJDIR)/main.o \ - $(OBJDIR)/types.o \ - $(OBJDIR)/cookie.o \ - $(OBJDIR)/easprintf.o \ - $(OBJDIR)/error.o \ - $(OBJDIR)/memory.o \ - $(OBJDIR)/helpers.o \ - $(OBJDIR)/key.o \ - $(OBJDIR)/local_config.o \ - $(OBJDIR)/local_config_set.o \ - $(OBJDIR)/query.o \ - $(OBJDIR)/string.o \ - $(OBJDIR)/string_helpers.o \ - $(OBJDIR)/request.o \ - $(OBJDIR)/session.o \ - $(OBJDIR)/path.o \ - $(OBJDIR)/mime.o \ - $(OBJDIR)/about.o \ - $(OBJDIR)/account.o \ - $(OBJDIR)/applications.o \ - $(OBJDIR)/attachments.o \ - $(OBJDIR)/base_page.o \ - $(OBJDIR)/conversations.o \ - $(OBJDIR)/emoji.o \ - $(OBJDIR)/emoji_reaction.o \ - $(OBJDIR)/global_cache.o \ - $(OBJDIR)/global_perl.o \ - $(OBJDIR)/hashtag.o \ - $(OBJDIR)/http.o \ - $(OBJDIR)/index.o \ - $(OBJDIR)/lists.o \ - -RESOURCES := \ - -SHELLTYPE := msdos -ifeq (,$(ComSpec)$(COMSPEC)) - SHELLTYPE := posix -endif -ifeq (/bin,$(findstring /bin,$(SHELL))) - SHELLTYPE := posix -endif - -.PHONY: clean prebuild prelink - -all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET) - @: - -$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES) - @echo Linking treebird - $(SILENT) $(LINKCMD) - $(POSTBUILDCMDS) - -$(TARGETDIR): - @echo Creating $(TARGETDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(TARGETDIR) -else - $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) -endif - -$(OBJDIR): - @echo Creating $(OBJDIR) -ifeq (posix,$(SHELLTYPE)) - $(SILENT) mkdir -p $(OBJDIR) -else - $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) -endif - -clean: - @echo Cleaning treebird -ifeq (posix,$(SHELLTYPE)) - $(SILENT) rm -f $(TARGET) - $(SILENT) rm -rf $(OBJDIR) -else - $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) - $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) -endif - -prebuild: - $(PREBUILDCMDS) - -prelink: - $(PRELINKCMDS) - -ifneq (,$(PCH)) -$(GCH): $(PCH) - @echo $(notdir $<) - $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" -endif - -$(OBJDIR)/main.o: src/main.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/types.o: src/types.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/cookie.o: src/cookie.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/easprintf.o: src/easprintf.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/error.o: src/error.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/memory.o: src/memory.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/helpers.o: src/helpers.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/key.o: src/key.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/local_config.o: src/local_config.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/local_config_set.o: src/local_config_set.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/query.o: src/query.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/string.o: src/string.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/string_helpers.o: src/string_helpers.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/request.o: src/request.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/session.o: src/session.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/path.o: src/path.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/mime.o: src/mime.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/about.o: src/about.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/account.o: src/account.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/applications.o: src/applications.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/attachments.o: src/attachments.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/base_page.o: src/base_page.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/conversations.o: src/conversations.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/emoji.o: src/emoji.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/emoji_reaction.o: src/emoji_reaction.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/global_cache.o: src/global_cache.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/global_perl.o: src/global_perl.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/hashtag.o: src/hashtag.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/http.o: src/http.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/index.o: src/index.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - -$(OBJDIR)/lists.o: src/lists.c - @echo $(notdir $<) - $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF $(@:%.o=%.d) -c "$<" - --include $(OBJECTS:%.o=%.d) -ifneq (,$(PCH)) - -include $(OBJDIR)/$(notdir $(PCH)).d -endif