Clean up the include mess

Keep all libtgl and telegram-purple includes in telegram-purple.h to prevent duplication of all those includes. Remove redundant includes.
This commit is contained in:
mjentsch 2015-11-23 03:06:30 +01:00
parent 9ee84e73a2
commit 04bc03bebf
15 changed files with 18 additions and 173 deletions

View file

@ -19,7 +19,6 @@
*/
#include <stdio.h>
#include <stdarg.h>
#include <debug.h>
#include "telegram-purple.h"
/*

View file

@ -21,32 +21,12 @@
#define _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <assert.h>
#include <tgl.h>
#include <tgl-binlog.h>
#include <tgl-methods-in.h>
#include <tgl-queries.h>
#include <glib.h>
#include <request.h>
#include <gcrypt.h>
#include "telegram-base.h"
#include "telegram-purple.h"
#include "msglog.h"
#include "tgp-2prpl.h"
#include "tgp-structs.h"
#include "tgp-utils.h"
#include "tgp-chat.h"
#include "tgp-request.h"
#include "lodepng/lodepng.h"
// O_BINARY exists on windows and must be defined, but doesn't exist on unix-based systems
#ifndef O_BINARY
#define O_BINARY 0

View file

@ -20,54 +20,10 @@
#include "telegram-purple.h"
#include <glib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <unistd.h>
#include <sys/types.h>
#include "accountopt.h"
#include "blist.h"
#include "cmds.h"
#include "conversation.h"
#include "debug.h"
#include "privacy.h"
#include "prpl.h"
#include "roomlist.h"
#include "status.h"
#include "util.h"
#include "prpl.h"
#include "prefs.h"
#include "util.h"
#include "eventloop.h"
#include "request.h"
#ifdef WIN32
#include "win32/win32dep.h"
#endif
#include <tgl.h>
#include <tgl-binlog.h>
#include <tgl-queries.h>
#include <tools.h>
#include <tgl-methods-in.h>
#include "msglog.h"
#include "telegram-base.h"
#include "tgp-2prpl.h"
#include "tgp-net.h"
#include "tgp-timers.h"
#include "tgp-utils.h"
#include "tgp-chat.h"
#include "tgp-ft.h"
#include "tgp-msg.h"
#include "tgp-request.h"
#include "tgp-blist.h"
#include "tgp-structs.h"
static void update_message_handler (struct tgl_state *TLS, struct tgl_message *M);
static void update_user_handler (struct tgl_state *TLS, struct tgl_user *U, unsigned flags);
static void update_user_status_handler (struct tgl_state *TLS, struct tgl_user *U);
@ -871,7 +827,6 @@ static PurplePluginProtocolInfo prpl_info = {
};
static void tgprpl_init (PurplePlugin *plugin) {
PurpleAccountOption *opt;
// set domain name that is used for translation

View file

@ -33,16 +33,25 @@
#endif
#include <tgl.h>
#include <purple.h>
#include <notify.h>
#include <server.h>
#include <plugin.h>
#include <version.h>
#include <account.h>
#include <connection.h>
#include <tgl-binlog.h>
#include <tgl-queries.h>
#include <tgl-structures.h>
#include <glib.h>
#include <purple.h>
#include "telegram-base.h"
#include "tgp-blist.h"
#include "tgp-structs.h"
#include "tgp-2prpl.h"
#include "tgp-net.h"
#include "tgp-timers.h"
#include "tgp-utils.h"
#include "tgp-chat.h"
#include "tgp-ft.h"
#include "tgp-msg.h"
#include "tgp-request.h"
#include "msglog.h"
#define PLUGIN_ID "prpl-telegram"
// FIXME: Name must be translated (for languages without latin script, it would look like gibberish. Just like Japanese script looks to me.)

View file

@ -25,20 +25,6 @@
#include "lodepng/lodepng.h"
#endif
#include "tgp-2prpl.h"
#include "tgp-structs.h"
#include "telegram-purple.h"
#include "tgp-utils.h"
#include "telegram-base.h"
#include "tgp-msg.h"
#include "tgp-net.h"
#include <server.h>
#include <tgl.h>
#include "msglog.h"
#include <assert.h>
PurpleAccount *tls_get_pa (struct tgl_state *TLS) {
return tls_get_data (TLS)->pa;
}

View file

@ -23,9 +23,6 @@
#include <stdio.h>
#include "telegram-purple.h"
#include "account.h"
#include "conversation.h"
#include "prpl.h"
PurpleAccount *tls_get_pa (struct tgl_state *TLS);
PurpleConnection *tls_get_conn (struct tgl_state *TLS);

View file

@ -16,13 +16,7 @@
Copyright Matthias Jentsch 2015
*/
#include "tgp-blist.h"
#include "tgp-structs.h"
#include "tgp-2prpl.h"
#include <glib.h>
#include <blist.h>
#include <assert.h>
#include "telegram-purple.h"
const char *tgp_blist_peer_get_purple_name (struct tgl_state *TLS, tgl_peer_id_t id) {
const char *name = g_hash_table_lookup (tls_get_data (TLS)->id_to_purple_name, GINT_TO_POINTER(tgl_get_peer_id (id)));

View file

@ -18,16 +18,7 @@
Copyright Matthias Jentsch 2014-2015
*/
#include "msglog.h"
#include "tgp-chat.h"
#include "tgp-utils.h"
#include "tgp-request.h"
#include "telegram-base.h"
#include "telegram-purple.h"
#include <tgl.h>
#include <tgl-queries.h>
#include <assert.h>
GHashTable *tgp_chat_info_new (struct tgl_state *TLS, struct tgl_chat *chat) {
gchar *title = g_strdup (chat->print_title);

View file

@ -22,9 +22,6 @@
#define __telegram_adium__tgp_chat__
#include "telegram-purple.h"
#include "tgp-structs.h"
#include "tgp-2prpl.h"
#include <purple.h>
PurpleChat *p2tgl_chat_new (struct tgl_state *TLS, struct tgl_chat *chat);

View file

@ -18,17 +18,7 @@
Copyright Matthias Jentsch 2014-2015
*/
#include <tgl-queries.h>
#include "tgp-utils.h"
#include "tgp-ft.h"
#include "tgp-structs.h"
#include "msglog.h"
#include <purple.h>
#include <glib.h>
#include <glib/gstdio.h>
#include "telegram-purple.h"
#include "telegram-base.h"
static void tgprpl_xfer_free_data (struct tgp_xfer_send_data *data);

View file

@ -20,12 +20,8 @@
#include "telegram-purple.h"
#include <assert.h>
#include <tgl.h>
#include <glib.h>
#include <errno.h>
#include <locale.h>
#include <tgl-queries.h>
#if !GLIB_CHECK_VERSION(2,30,0)
gchar *
@ -46,16 +42,6 @@ g_utf8_substring (const gchar *str,
}
#endif
#include "telegram-base.h"
#include "tgp-structs.h"
#include "tgp-msg.h"
#include "tgp-ft.h"
#include "tgp-2prpl.h"
#include "tgp-chat.h"
#include "tgp-utils.h"
#include "tgp-chat.h"
#include "msglog.h"
static char *format_service_msg (struct tgl_state *TLS, struct tgl_message *M) {
assert (M && M->flags & TGLMF_SERVICE);
connection_data *conn = TLS->ev_base;

View file

@ -40,19 +40,8 @@
#include <sys/time.h>
#include <time.h>
#include "tgp-net.h"
#include "tgp-structs.h"
#include "tgp-2prpl.h"
#include "telegram-base.h"
#include <tgl.h>
#include <tgl-inner.h>
#include <tools.h>
#include <mtproto-client.h>
#include <glib.h>
#include <eventloop.h>
#include "telegram-purple.h"
#include "msglog.h"
#include <mtproto-client.h>
#ifndef POLLRDHUP
#define POLLRDHUP 0

View file

@ -20,19 +20,6 @@
#include "telegram-purple.h"
#include <glib.h>
#include <tgl.h>
#include <tgl-binlog.h>
#include <tgl-methods-in.h>
#include <tgl-queries.h>
#include "msglog.h"
#include "tgp-request.h"
#include "telegram-base.h"
#include "tgp-2prpl.h"
#include "tgp-utils.h"
#include "tgp-structs.h"
static struct request_values_data *request_values_data_init (struct tgl_state *TLS, void *callback, void *arg, int num_values) {
struct request_values_data *data = talloc0 (sizeof (struct request_values_data));
data->TLS = TLS;

View file

@ -19,16 +19,6 @@
*/
#include "telegram-base.h"
#include "tgp-structs.h"
#include "purple.h"
#include "msglog.h"
#include "tgp-utils.h"
#include "tgp-ft.h"
#include "tgp-2prpl.h"
#include <glib.h>
#include <tgl.h>
#include <tgl-queries.h>
static void pending_reads_free_cb (gpointer data) {
free (data);

View file

@ -20,11 +20,6 @@
#include "telegram-purple.h"
#include "tgp-utils.h"
#include "msglog.h"
#include <purple.h>
const char *format_time (time_t date) {
struct tm *datetime = localtime(&date);
/* This should be the language's timestamp format.