summaryrefslogtreecommitdiffstats
path: root/gatchat/gatchat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gatchat/gatchat.c')
-rw-r--r--gatchat/gatchat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 31ec81e5..8f060eeb 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -1231,6 +1231,25 @@ GAtChat *g_at_chat_new_blocking(GIOChannel *channel, GAtSyntax *syntax)
return g_at_chat_new_common(channel, 0, syntax);
}
+GAtChat *g_at_chat_clone(GAtChat *clone)
+{
+ GAtChat *chat;
+
+ if (clone == NULL)
+ return NULL;
+
+ chat = g_try_new0(GAtChat, 1);
+ if (chat == NULL)
+ return NULL;
+
+ chat->parent = clone->parent;
+ chat->group = chat->parent->next_gid++;
+ chat->ref_count = 1;
+ g_atomic_int_inc(&chat->parent->ref_count);
+
+ return chat;
+}
+
GIOChannel *g_at_chat_get_channel(GAtChat *chat)
{
if (chat == NULL || chat->parent->io == NULL)