summaryrefslogtreecommitdiffstats
path: root/src/daemon/purple_private.h
blob: ff5013996a6973bb4c7b006aeff4e8ea14c3557e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 * Usurpation – server daemon IM module, private header
 *
 * Copyright (C) 2019 Gediminas Jakutis
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; version 2.1
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef USURPATION_PURPLE_PRIVATE_H
#define USURPATION_PURPLE_PRIVATE_H

#include <pthread.h>

static void iface_init(void);

static struct state {
	pthread_mutex_t mutex;
	pthread_t purple;
	PurpleAccount *account;
} state = {PTHREAD_MUTEX_INITIALIZER, 0, 0};

struct glib_io {
	PurpleInputFunction func;
	guint result;
	void *data;
};

static PurpleCoreUiOps core_uiops = {
	NULL,
	NULL,
	iface_init,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL
};

static gboolean purple_glib_io(GIOChannel *source, GIOCondition cond, gpointer data);
static guint glib_input_add(gint fd, PurpleInputCondition pio_cond, PurpleInputFunction function, gpointer data);
static void *purple_spawn(void *disregard);
static void pthread_mutex_unlock_thunk(void *arg);

#endif /* USURPATION_PURPLE_PRIVATE_H */