about summary refs log tree commit diff stats
path: root/src/common.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-06-23 17:38:30 +0100
committerJames Booth <boothj5@gmail.com>2013-06-23 17:38:30 +0100
commitd5e9ca649dff53e7696e1f590a087001cc9b03f5 (patch)
treef77563239a7e6388da7a1e541c5cf48b34a1ed41 /src/common.c
parentdace47e5d334a9fd7be8a73d83b8108988f78e49 (diff)
downloadprofani-tty-d5e9ca649dff53e7696e1f590a087001cc9b03f5.tar.gz
Show messages on /group add and /group remove
closes #189
closes #190
Diffstat (limited to 'src/common.c')
-rw-r--r--src/common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common.c b/src/common.c
index 94b2872c..2d1ac3d7 100644
--- a/src/common.c
+++ b/src/common.c
@@ -37,6 +37,9 @@
 // and page size is at least 4KB
 #define READ_BUF_SIZE 4088
 
+// for generating ids
+static int unique_id = 0;
+
 struct curl_data_t
 {
     char *buffer;
@@ -394,6 +397,19 @@ xdg_get_data_home(void)
     }
 }
 
+char *
+get_unique_id(void)
+{
+    char *result = NULL;
+    unique_id++;
+    GString *result_str = g_string_new("");
+    g_string_printf(result_str, "prof%d", unique_id);
+    result = result_str->str;
+    g_string_free(result_str, FALSE);
+
+    return result;
+}
+
 static size_t
 _data_callback(void *ptr, size_t size, size_t nmemb, void *data)
 {
id='n158' href='#n158'>158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176