summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-05-12 13:10:48 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-05-12 13:10:48 +0200
commit45ef4948db670224c7cc727507f84924bd826002 (patch)
tree45ab5e37a3cb062f4276e8b1456cb5397e58eddc /core/include
parentcf6951bbfe99bf494f22c1b1d02fb6a8f45e73a9 (diff)
downloadturns-45ef4948db670224c7cc727507f84924bd826002.tar.xz
turns-45ef4948db670224c7cc727507f84924bd826002.zip
core: begin c-style API
Diffstat (limited to 'core/include')
-rw-r--r--core/include/turns/turns-disposition.h18
-rw-r--r--core/include/turns/turns-enums.h.in22
-rw-r--r--core/include/turns/turns-participant.h27
3 files changed, 67 insertions, 0 deletions
diff --git a/core/include/turns/turns-disposition.h b/core/include/turns/turns-disposition.h
new file mode 100644
index 0000000..c5bb174
--- /dev/null
+++ b/core/include/turns/turns-disposition.h
@@ -0,0 +1,18 @@
+#ifndef TURNS_DISPOSITION_H
+#define TURNS_DISPOSITION_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef enum
+{
+ TURNS_DISPOSITION_NEUTRAL,
+ TURNS_DISPOSITION_FRIENDLY,
+ TURNS_DISPOSITION_HOSTILE,
+ TURNS_DISPOSITION_SECRET,
+} TurnsDisposition;
+
+G_END_DECLS
+
+#endif
diff --git a/core/include/turns/turns-enums.h.in b/core/include/turns/turns-enums.h.in
new file mode 100644
index 0000000..10bb3f1
--- /dev/null
+++ b/core/include/turns/turns-enums.h.in
@@ -0,0 +1,22 @@
+/*** BEGIN file-header ***/
+#pragma once
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@basename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name@_get_type (void) G_GNUC_CONST;
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+/*** END file-tail ***/ \ No newline at end of file
diff --git a/core/include/turns/turns-participant.h b/core/include/turns/turns-participant.h
new file mode 100644
index 0000000..001de6b
--- /dev/null
+++ b/core/include/turns/turns-participant.h
@@ -0,0 +1,27 @@
+#ifndef TURNS_PARTICIPANT_H
+#define TURNS_PARTICIPANT_H
+
+#include "turns/turns-disposition.h"
+
+#include <glib-object.h>
+#include <glib.h>
+#include <glibconfig.h>
+
+G_BEGIN_DECLS
+
+#define TURNS_TYPE_PARTICIPANT turns_participant_get_type()
+G_DECLARE_FINAL_TYPE(TurnsParticipant, turns_participant, TURNS, PARTICIPANT, GObject)
+
+TurnsParticipant * turns_participant_new(gchar const * name, gfloat priority, TurnsDisposition disposition) G_GNUC_WARN_UNUSED_RESULT;
+
+gchar const * turns_participant_get_name(TurnsParticipant const * self);
+gfloat turns_participant_get_priority(TurnsParticipant const * self);
+TurnsDisposition turns_participant_get_disposition(TurnsParticipant const * self);
+
+void turns_participant_set_name(TurnsParticipant * self, gchar const * value);
+void turns_participant_set_priority(TurnsParticipant * self, gfloat value);
+void turns_participant_set_disposition(TurnsParticipant * self, TurnsDisposition value);
+
+G_END_DECLS
+
+#endif \ No newline at end of file