]> git.cworth.org Git - loudgame/blobdiff - loudgame.c
Implement simple show, hint, and shuffle commands for lg-set.
[loudgame] / loudgame.c
index e2f0af2d5b751968725dfdd427b2e08b93e8f059..2cb9a1869f62e16160909a4fad2add98524abb7e 100644 (file)
@@ -93,6 +93,36 @@ loudgame_send (loudgame_t    *lg,
     }
 }
 
+void
+loudgame_vsendf (loudgame_t    *lg,
+                const char     *peer,
+                const char     *format,
+                va_list         va)
+{
+    char *str;
+
+    str = g_strdup_vprintf (format, va);
+
+    loudgame_send (lg, peer, str);
+
+    free (str);
+}
+
+void
+loudgame_sendf (loudgame_t     *lg,
+               const char      *peer,
+               const char      *format,
+               ...)
+{
+    va_list va;
+
+    va_start (va, format);
+
+    loudgame_vsendf (lg, peer, format, va);
+
+    va_end (va);
+}
+
 static void
 handle_command (LmConnection   *connection,
                const char      *peer,