BuildRequires: pkgconfig(python3-embed)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(rpc-port)
-BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(gmock)
Requires: python3-numpy
Requires: python3-xml
#include <dlfcn.h>
#include <service_app.h>
#include <glib.h>
-#include <Ecore.h>
#undef _POSIX_C_SOURCE
#include "service.h"
NLTK_CMD_UNKNOWN
} NLTK_CMDS;
-int sec = 180.0;
-static Ecore_Timer *service_close_timer = NULL;
+static int self_termination_timer_sec = 60;
+static gint service_close_timer = 0;
struct client_s {
char *id;
return handle;
}
-static Eina_Bool timer_cb(void *data)
+gboolean timer_cb(gpointer data)
{
PLOG("time runs out");
- service_close_timer = NULL;
+ service_close_timer = 0;
service_app_exit();
- return ECORE_CALLBACK_CANCEL;
+
+ return FALSE;
}
void stop_timer()
{
- if (service_close_timer != NULL) {
- ecore_timer_del(service_close_timer);
- service_close_timer = NULL;
- }
+ g_source_remove(service_close_timer);
+ service_close_timer = 0;
}
void start_timer()
{
stop_timer();
- service_close_timer = ecore_timer_add(sec,timer_cb,NULL);
- if (service_close_timer == NULL)
+ service_close_timer = g_timeout_add(self_termination_timer_sec*1000, timer_cb, NULL);
+ if (service_close_timer == 0)
PLOG("failed to create timer");
}