diff options
author | xengineering <me@xengineering.eu> | 2022-11-27 18:12:03 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-11-27 18:12:03 +0100 |
commit | 395957ed1e55d7f95e5a3589420fa321d7d6e8b2 (patch) | |
tree | a2544f8ea5eb527991405d472c71eb2f0af32dda /xmpp.c | |
parent | 8b9ce1d7848bd8ad417a3834d11e1b00c028f8eb (diff) | |
download | limox-legacy/gtk4-libstrophe.tar limox-legacy/gtk4-libstrophe.tar.zst limox-legacy/gtk4-libstrophe.zip |
Remove SDL2-based LimoXlegacy/gtk4-libstrophe
This commit is part of the maintenance branch of the legacy GTK4 /
libstrophe version of LimoX. Thus SDL2 and self-written XMPP stuff is
not needed anymore.
Diffstat (limited to 'xmpp.c')
-rw-r--r-- | xmpp.c | 54 |
1 files changed, 0 insertions, 54 deletions
@@ -1,54 +0,0 @@ - - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/types.h> -#include <sys/socket.h> - - -/* - * Get the domainpart of the Jabber ID (JID). - * See https://datatracker.ietf.org/doc/html/rfc7622#section-3.2 for details. - */ -char *domainpart(char *jid) -{ - int start = 0; // inclusive - int stop = strlen(jid); // exclusive - - for(int i=0; i<strlen(jid); i++) { - if (jid[i] == '/') { - stop = i; - break; - } - } - - for(int i=0; i<strlen(jid); i++) { - if (jid[i] == '@') { - start = i + 1; - break; - } - } - - char* retval = (char *)malloc((stop-start+1) * sizeof(char)); - memcpy(retval, jid+start, (stop-start)*sizeof(char)); - retval[stop] = '\0'; - - return retval; -} - -void net_init(void) -{ - printf("net_init()\n"); - - char* user_str = getenv("LIMOX_USER"); - char* pwd_str = getenv("LIMOX_PWD"); - char *domain = domainpart(user_str); - printf("Trying to connect as '%s' with '%s'.\n", user_str, pwd_str); - printf("Domainpart is '%s'.\n", domain); -} - -void net_quit(void) -{ - printf("net_quit()\n"); -} |