[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37835 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37835 - gnunet/src/util |
Date: |
Mon, 29 Aug 2016 13:58:01 +0200 |
Author: grothoff
Date: 2016-08-29 13:58:01 +0200 (Mon, 29 Aug 2016)
New Revision: 37835
Modified:
gnunet/src/util/service_new.c
Log:
-starting with service_new main logic
Modified: gnunet/src/util/service_new.c
===================================================================
--- gnunet/src/util/service_new.c 2016-08-29 11:53:43 UTC (rev 37834)
+++ gnunet/src/util/service_new.c 2016-08-29 11:58:01 UTC (rev 37835)
@@ -112,7 +112,7 @@
/**
* Message handlers to use for all clients.
*/
- struct GNUNET_MQ_MessageHandler *handlers;
+ const struct GNUNET_MQ_MessageHandler *handlers;
/**
* Closure for @e task.
@@ -209,6 +209,20 @@
};
+static void
+service_main (void *cls)
+{
+ struct GNUNET_SERVICE_Handle *sh = cls;
+
+ GNUNET_SCHEDULER_add_shutdown (&service_shutdown,
+ sh);
+ GNUNET_SERVICE_resume (sh);
+ sh->service_init_cb (sh->cb_cls,
+ sh->cfg,
+ sh);
+}
+
+
/**
* Creates the "main" function for a GNUnet service. You
* should almost always use the #GNUNET_SERVICE_MAIN macro
@@ -261,7 +275,12 @@
void *cls,
const struct GNUNET_MQ_MessageHandler *handlers)
{
- GNUNET_break (0); // not implemented
+ struct GNUNET_SERVICE_Handle sh;
+
+ // FIXME: setup (parse command line, configuration, init sh)
+ GNUNET_SCHEDULER_run (&service_main,
+ &sh);
+ // FIXME: cleanup
return 1;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37835 - gnunet/src/util,
gnunet <=