summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_misc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-07 12:09:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-07 12:09:27 +0000
commit03a0b643b94d5aa7f9c129fe73eea314d099cf56 (patch)
tree221081ffe0602905765815d302b02d1f761cf100 /protocols/Tlen/src/tlen_misc.cpp
parent0ac4b544972fb011e7c7c69e60a1d5d180ada0ac (diff)
shameful end of the group processing zoo, part 1
git-svn-id: http://svn.miranda-ng.org/main/trunk@5994 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_misc.cpp')
-rw-r--r--protocols/Tlen/src/tlen_misc.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp
index 4c05d5e566..7876d2348e 100644
--- a/protocols/Tlen/src/tlen_misc.cpp
+++ b/protocols/Tlen/src/tlen_misc.cpp
@@ -123,88 +123,3 @@ HANDLE TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL temp
}
return hContact;
}
-
-static void TlenContactListCreateClistGroup(char *groupName)
-{
- char str[33], newName[128];
- int i;
- DBVARIANT dbv;
- char *name;
-
- for (i=0;;i++) {
- itoa(i, str, 10);
- if (db_get(NULL, "CListGroups", str, &dbv))
- break;
- name = dbv.pszVal;
- if (name[0] != '\0' && !strcmp(name+1, groupName)) {
- // Already exist, no need to create
- db_free(&dbv);
- return;
- }
- db_free(&dbv);
- }
-
- // Create new group with id = i (str is the text representation of i)
- newName[0] = 1 | GROUPF_EXPANDED;
- strncpy(newName+1, groupName, sizeof(newName)-1);
- newName[sizeof(newName)-1] = '\0';
- db_set_s(NULL, "CListGroups", str, newName);
- CallService(MS_CLUI_GROUPADDED, i+1, 0);
-}
-
-void TlenContactListCreateGroup(char *groupName)
-{
- char name[128];
- char *p;
-
- if (groupName == NULL || groupName[0] == '\0' || groupName[0] == '\\') return;
-
- strncpy(name, groupName, sizeof(name));
- name[sizeof(name)-1] = '\0';
- for (p=name; *p != '\0'; p++) {
- if (*p == '\\') {
- *p = '\0';
- TlenContactListCreateClistGroup(name);
- *p = '\\';
- }
- }
- TlenContactListCreateClistGroup(name);
-}
-
-
-struct FORK_ARG {
- HANDLE hEvent;
- void (__cdecl *threadcode)(void*);
- void *arg;
-};
-
-static void __cdecl forkthread_r(struct FORK_ARG *fa)
-{
- void (*callercode)(void*) = fa->threadcode;
- void *arg = fa->arg;
- Thread_Push(0);
- SetEvent(fa->hEvent);
- callercode(arg);
- Thread_Pop();
- return;
-}
-
-unsigned long TlenForkThread(
- void (__cdecl *threadcode)(void*),
- unsigned long stacksize,
- void *arg
-)
-{
- unsigned long rc;
- struct FORK_ARG fa;
-
- fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- fa.threadcode = threadcode;
- fa.arg = arg;
- rc = _beginthread((void (__cdecl *)(void*))forkthread_r, stacksize, &fa);
- if ((unsigned long) -1L != rc) {
- WaitForSingleObject(fa.hEvent, INFINITE);
- }
- CloseHandle(fa.hEvent);
- return rc;
-}