libkeepalive
Loading...
Searching...
No Matches
keepalive-object.h
Go to the documentation of this file.
1/****************************************************************************************
2**
3** Copyright (c) 2020 Jolla Ltd.
4 * Copyright (c) 2020 Open Mobile Platform LLC.
5**
6** Author: Simo Piiroinen <simo.piiroinen@jollamobile.com>
7**
8** All rights reserved.
9**
10** This file is part of nemo-keepalive package.
11**
12** You may use this file under the terms of the GNU Lesser General
13** Public License version 2.1 as published by the Free Software Foundation
14** and appearing in the file license.lgpl included in the packaging
15** of this file.
16**
17** This library is free software; you can redistribute it and/or
18** modify it under the terms of the GNU Lesser General Public
19** License version 2.1 as published by the Free Software Foundation
20** and appearing in the file license.lgpl included in the packaging
21** of this file.
22**
23** This library is distributed in the hope that it will be useful,
24** but WITHOUT ANY WARRANTY; without even the implied warranty of
25** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26** Lesser General Public License for more details.
27**
28****************************************************************************************/
29
35#ifndef KEEPALIVE_OBJECT_H_
36#define KEEPALIVE_OBJECT_H_
37
38# include <stdarg.h>
39# include <stdbool.h>
40
41# include <glib.h>
42
43# include <dbus/dbus.h>
44
45# ifdef __cplusplus
46extern "C" {
47# endif
48
49/* ========================================================================= *
50 * Types
51 * ========================================================================= */
52
108
110{
112 const char *kao_identity;
113
116
119
122
125
127 pthread_mutex_t kao_mutex;
128
140
147 GDestroyNotify kao_delete_cb;
148};
149
150/* ========================================================================= *
151 * Functions
152 * ========================================================================= */
153
161void keepalive_object_ctor (keepalive_object_t *self, const char *identity, GDestroyNotify shutdown_locked_cb, GDestroyNotify delete_cb);
162
168
180
189
204
219
228
237
249
263void keepalive_object_timer_start_locked (keepalive_object_t *self, guint *timer_id, guint interval, GSourceFunc notify_cb);
264
273
281
301void keepalive_object_ipc_start_locked_va (keepalive_object_t *self, DBusPendingCall **where, DBusPendingCallNotifyFunction notify_cb, DBusConnection *connection, const char *service, const char *object, const char *interface, const char *method, int arg_type, va_list va);
302
310void keepalive_object_ipc_cancel_locked(keepalive_object_t *self, DBusPendingCall **where);
311
323bool keepalive_object_ipc_finish_locked(keepalive_object_t *self, DBusPendingCall **where, DBusPendingCall *what);
324
339void keepalive_object_iowatch_start_locked(keepalive_object_t *self, guint *iowatch_id, int fd, GIOCondition cnd, GIOFunc io_cb);
340
349
350# ifdef __cplusplus
351};
352# endif
353
354#endif /* KEEPALIVE_OBJECT_H_ */
void keepalive_object_ipc_start_locked_va(keepalive_object_t *self, DBusPendingCall **where, DBusPendingCallNotifyFunction notify_cb, DBusConnection *connection, const char *service, const char *object, const char *interface, const char *method, int arg_type, va_list va)
void keepalive_object_unref_internal_locked(keepalive_object_t *self)
void keepalive_object_iowatch_stop_locked(keepalive_object_t *self, guint *iowatch_id)
void keepalive_object_timer_stop_locked(keepalive_object_t *self, guint *timer_id)
void keepalive_object_unref_internal_cb(void *aptr)
void keepalive_object_ctor(keepalive_object_t *self, const char *identity, GDestroyNotify shutdown_locked_cb, GDestroyNotify delete_cb)
void keepalive_object_lock(keepalive_object_t *self)
void keepalive_object_dtor(keepalive_object_t *self)
void keepalive_object_timer_start_locked(keepalive_object_t *self, guint *timer_id, guint interval, GSourceFunc notify_cb)
void keepalive_object_iowatch_start_locked(keepalive_object_t *self, guint *iowatch_id, int fd, GIOCondition cnd, GIOFunc io_cb)
void * keepalive_object_ref_external_locked(keepalive_object_t *self)
bool keepalive_object_in_shutdown_locked(keepalive_object_t *self)
void keepalive_object_unref_external_locked(keepalive_object_t *self)
void keepalive_object_unlock(keepalive_object_t *self)
bool keepalive_object_ipc_finish_locked(keepalive_object_t *self, DBusPendingCall **where, DBusPendingCall *what)
void keepalive_object_ipc_cancel_locked(keepalive_object_t *self, DBusPendingCall **where)
void * keepalive_object_ref_internal_locked(keepalive_object_t *self)
Definition keepalive-object.h:110
bool kao_in_shutdown
Definition keepalive-object.h:121
unsigned kao_refcount_internal
Definition keepalive-object.h:118
const char * kao_identity
Definition keepalive-object.h:112
guint kao_shutdown_id
Definition keepalive-object.h:124
GDestroyNotify kao_delete_cb
Definition keepalive-object.h:147
pthread_mutex_t kao_mutex
Definition keepalive-object.h:127
unsigned kao_refcount_external
Definition keepalive-object.h:115
GDestroyNotify kao_shutdown_locked_cb
Definition keepalive-object.h:139