diff --git a/src/common.c b/src/common.c index 4b64b597..6a0e24fa 100644 --- a/src/common.c +++ b/src/common.c @@ -748,17 +748,17 @@ call_external(gchar** argv) * * This function constructs an argument vector (argv) based on the provided template string, replacing placeholders ("%u" and "%p") with the provided URL and filename, respectively. * - * @param template The template string with placeholders. - * @param url The URL to replace "%u" (or NULL to skip). - * @param filename The filename to replace "%p" (or NULL to skip). - * @return The constructed argument vector (argv) as a null-terminated array of strings. + * @param template_fmt The template string with placeholders. + * @param url The URL to replace "%u" (or NULL to skip). + * @param filename The filename to replace "%p" (or NULL to skip). + * @return The constructed argument vector (argv) as a null-terminated array of strings. * * @note Remember to free the returned argument vector using `auto_gcharv` or `g_strfreev()`. */ gchar** -format_call_external_argv(const char* template, const char* url, const char* filename) +format_call_external_argv(const char* template_fmt, const char* url, const char* filename) { - gchar** argv = g_strsplit(template, " ", 0); + gchar** argv = g_strsplit(template_fmt, " ", 0); guint num_args = 0; while (argv[num_args]) { @@ -767,7 +767,7 @@ format_call_external_argv(const char* template, const char* url, const char* fil argv[num_args] = g_strdup(url); } else if (0 == g_strcmp0(argv[num_args], "%p") && filename != NULL) { g_free(argv[num_args]); - argv[num_args] = strdup(filename); + argv[num_args] = g_strdup(filename); } num_args++; } diff --git a/src/common.h b/src/common.h index cb3155e4..40c68d60 100644 --- a/src/common.h +++ b/src/common.h @@ -181,7 +181,7 @@ void get_file_paths_recursive(const char* directory, GSList** contents); gchar* get_random_string(int length); gboolean call_external(gchar** argv); -gchar** format_call_external_argv(const char* template, const char* url, const char* filename); +gchar** format_call_external_argv(const char* template_fmt, const char* url, const char* filename); gchar* unique_filename_from_url(const char* url, const char* path); gchar* get_expanded_path(const char* path); diff --git a/src/event/common.h b/src/event/common.h index 177fd912..edf7850c 100644 --- a/src/event/common.h +++ b/src/event/common.h @@ -10,6 +10,8 @@ #ifndef EVENT_COMMON_H #define EVENT_COMMON_H +#include "glib.h" + void ev_disconnect_cleanup(void); void ev_inc_connection_counter(void); void ev_reset_connection_counter(void); diff --git a/src/pgp/gpg.h b/src/pgp/gpg.h index 7651e719..0ad19607 100644 --- a/src/pgp/gpg.h +++ b/src/pgp/gpg.h @@ -10,6 +10,8 @@ #ifndef PGP_GPG_H #define PGP_GPG_H +#include "glib.h" + typedef struct pgp_key_t { gchar* id; diff --git a/src/tools/bookmark_ignore.h b/src/tools/bookmark_ignore.h index cba61ce0..092c96c4 100644 --- a/src/tools/bookmark_ignore.h +++ b/src/tools/bookmark_ignore.h @@ -10,8 +10,10 @@ #ifndef BOOKMARK_IGNORE_H #define BOOKMARK_IGNORE_H +#include "xmpp/xmpp.h" + void bookmark_ignore_on_connect(const char* const barejid); -void bookmark_ignore_on_disconnect(void); +void bookmark_ignore_on_disconnect(); gboolean bookmark_ignored(Bookmark* bookmark); gchar** bookmark_ignore_list(gsize* len); void bookmark_ignore_add(const char* const barejid); diff --git a/src/ui/titlebar.h b/src/ui/titlebar.h index 69f92e1e..81a74cbe 100644 --- a/src/ui/titlebar.h +++ b/src/ui/titlebar.h @@ -10,6 +10,8 @@ #ifndef UI_TITLEBAR_H #define UI_TITLEBAR_H +#include "glib.h" + void create_title_bar(void); void free_title_bar(void); void title_bar_update_virtual(void); diff --git a/src/xmpp/blocking.h b/src/xmpp/blocking.h index 7f0df5b4..b72c7fb0 100644 --- a/src/xmpp/blocking.h +++ b/src/xmpp/blocking.h @@ -10,6 +10,8 @@ #ifndef XMPP_BLOCKING_H #define XMPP_BLOCKING_H +#include + void blocking_request(void); int blocked_set_handler(xmpp_stanza_t* stanza); int reporting_set_handler(xmpp_stanza_t* stanza); diff --git a/src/xmpp/iq.h b/src/xmpp/iq.h index 546e1912..2a5fd81b 100644 --- a/src/xmpp/iq.h +++ b/src/xmpp/iq.h @@ -10,6 +10,8 @@ #ifndef XMPP_IQ_H #define XMPP_IQ_H +#include + typedef int (*ProfIqCallback)(xmpp_stanza_t* const stanza, void* const userdata); typedef void (*ProfIqFreeCallback)(void* userdata); diff --git a/src/xmpp/ox.h b/src/xmpp/ox.h index b17bd894..a671b948 100644 --- a/src/xmpp/ox.h +++ b/src/xmpp/ox.h @@ -7,6 +7,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception */ +#include "glib.h" + /*! * \page OX OX Implementation * diff --git a/src/xmpp/roster.h b/src/xmpp/roster.h index 7e561f55..77711c95 100644 --- a/src/xmpp/roster.h +++ b/src/xmpp/roster.h @@ -10,6 +10,9 @@ #ifndef XMPP_ROSTER_H #define XMPP_ROSTER_H +#include "glib.h" +#include + void roster_request(void); void roster_set_handler(xmpp_stanza_t* const stanza); void roster_result_handler(xmpp_stanza_t* const stanza); diff --git a/src/xmpp/vcard_funcs.h b/src/xmpp/vcard_funcs.h index 6951ecce..03a5e30f 100644 --- a/src/xmpp/vcard_funcs.h +++ b/src/xmpp/vcard_funcs.h @@ -12,6 +12,7 @@ #include "ui/win_types.h" #include "xmpp/vcard.h" +#include vCard* vcard_new(); void vcard_free(vCard* vcard);