Annotation of gnutrition/dbus.h, revision 1.1
1.1 ! asm 1: // SPDX-License-Identifier: GPL-3.0-or-later
! 2: /*
! 3: * $Id$
! 4: *
! 5: * dbus.h - D-Bus interface for GNUtrition
! 6: *
! 7: * Copyright (C) 2026 Free Software Foundation, Inc.
! 8: *
! 9: * Author: Jason Self <jself@gnu.org>
! 10: */
! 11:
! 12: #ifndef DBUS_H
! 13: #define DBUS_H
! 14:
! 15: #include <gio/gio.h>
! 16: #include <sqlite3.h>
! 17:
! 18: /* Context for the D-Bus service, holding database handles. */
! 19: struct dbus_context
! 20: {
! 21: sqlite3 *food_db;
! 22: sqlite3 *log_db;
! 23: int calories;
! 24: };
! 25:
! 26: /* Start the D-Bus service on the session bus. CTX holds the
! 27: database handles used by method implementations. Returns the
! 28: owner ID (> 0) on success, 0 on failure. The caller must call
! 29: dbus_service_stop to release resources. */
! 30: guint dbus_service_start (struct dbus_context *ctx);
! 31:
! 32: /* Stop the D-Bus service and release the bus name. */
! 33: void dbus_service_stop (guint owner_id);
! 34:
! 35: #endif /* DBUS_H */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>