[ADD/WIP] Push all the Janet changes

This is still unstable(and I still need to design/document the exposed
API)! Do(n't) go and use it!
This commit is contained in:
LDA 2024-11-16 14:11:32 +01:00
commit ca87972b3a
50 changed files with 3550 additions and 92 deletions

View file

@ -18,6 +18,11 @@
#include <XMPP.h>
#include <AS.h>
#ifdef JANET
#include <janet.h>
#endif
#include <Extension.h>
static HttpServer *server = NULL;
static pthread_t xmpp_thr;
static XMPPComponent *jabber = NULL;
@ -71,6 +76,8 @@ Main(Array *args, HashMap *env)
int http = 8;
int verbose = 0;
Extensions *ext_ctx = NULL;
start = UtilTsMillis();
memset(&conf, 0, sizeof(conf));
@ -82,6 +89,9 @@ Main(Array *args, HashMap *env)
Log(LOG_INFO, "=======================");
Log(LOG_INFO, "(C)opyright 2024 LDA and other contributors");
Log(LOG_INFO, "(This program is free software, see LICENSE.)");
#ifdef JANET
Log(LOG_INFO, "**Built with Janet!**");
#endif
#ifdef PLATFORM_IPHONE
Log(LOG_WARNING, "Wait. Are you running this on an iPhone?");
@ -241,6 +251,10 @@ Main(Array *args, HashMap *env)
Log(LOG_DEBUG, "Verbosity level: %d", verbose);
((ParseeData *) conf.handlerArgs)->verbosity = verbose;
ext_ctx = ExtensionCreateContext(conf.handlerArgs);
((ParseeData *) conf.handlerArgs)->exts = ext_ctx;
ExtensionLoadDir(ext_ctx, parsee_conf->extensions);
Log(LOG_NOTICE, "Setting up local Matrix user...");
if (ASRegisterUser(parsee_conf, parsee_conf->sender_localpart))
{
@ -303,6 +317,8 @@ end:
ParseeDestroyHeadTable();
ParseeDestroyJIDTable();
ExtensionDestroyContext(ext_ctx);
(void) env;
return 0;
}