diff options
author | James Booth <boothj5@gmail.com> | 2013-06-23 17:38:30 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-06-23 17:38:30 +0100 |
commit | d5e9ca649dff53e7696e1f590a087001cc9b03f5 (patch) | |
tree | f77563239a7e6388da7a1e541c5cf48b34a1ed41 /src/common.c | |
parent | dace47e5d334a9fd7be8a73d83b8108988f78e49 (diff) | |
download | profani-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.c | 16 |
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) { |