void sourcedrop_shutdown(void)
{
    ecore_event_handler_del(handler);
    handler = NULL;
    ecore_con_shutdown();
    ecore_shutdown();
}
Exemple #2
0
Fichier : irc.c Projet : Limsik/e17
EMAPI int
protocol_shutdown(void)
{
   ecore_con_shutdown();
   if (_irc_servers)
     eina_hash_free(_irc_servers);
   return 1;
}
static void
_grabber_tmdb_shutdown(void)
{
   INF("Shutdown TMDb grabber");
   eina_hash_free(_hash_req);
   free(_stats);
   ecore_con_url_shutdown();
   ecore_con_shutdown();
}
Exemple #4
0
/**
 * @brief Initialize the store library and all it's required submodules.
 * @return 1 or greater on success, 0 otherwise.
 */
int
store_init(void)
{
   if (++_store_init_count != 1)
     return _store_init_count;

   if (!eina_init())
     {
        fprintf(stderr, "Store can not initialize Eina\n");
        return --_store_init_count;
     }

   _store_log_dom_global = eina_log_domain_register("store", EINA_COLOR_RED);
   if (_store_log_dom_global < 0)
     {
        EINA_LOG_ERR("Store can not create a general log domain");
        goto shutdown_eina;
     }

   if (!ecore_init())
     {
        ERR("Can not initialize Ecore");
        goto unregister_log_domain;
     }

   if (!ecore_con_init())
     {
        ERR("Can not initialize Ecore_Con");
        goto shutdown_ecore;
     }

   if (!ecore_con_url_init())
     {
        ERR("Can not initialize Ecore_Con_Url");
        goto shutdown_ecore_con;
     }

   if (!ecore_con_url_pipeline_get())
     ecore_con_url_pipeline_set(EINA_TRUE);

   return _store_init_count;

shutdown_ecore_con:
   ecore_con_shutdown();
shutdown_ecore:
   ecore_shutdown();
unregister_log_domain:
   eina_log_domain_unregister(_store_log_dom_global);
   _store_log_dom_global = -1;
shutdown_eina:
   eina_shutdown();
   return --_store_init_count;
}
ApplicationMain::~ApplicationMain()
{
    DELETE_NULL(controller)

            elm_shutdown();
    edje_shutdown();
    ecore_evas_shutdown();
    evas_shutdown();
    ecore_con_url_shutdown();
    ecore_con_shutdown();
    ecore_shutdown();
    eina_shutdown();
}
Exemple #6
0
/**
 * @brief Shut down Azy
 *
 * This function uninitializes memory allocated by azy_init.
 * Call when no further Azy functions will be used.
 * @return The number of times azy_init has been called, or -1 if
 * all occurrences of azy have been shut down
 */
int
azy_shutdown(void)
{
   if (--azy_init_count_ != 0)
     return azy_init_count_;

   eina_log_domain_unregister(azy_log_dom);
   if (azy_rpc_log_dom != -1)
     eina_log_domain_unregister(azy_rpc_log_dom);
   ecore_con_shutdown();
   ecore_shutdown();
   eina_shutdown();
   azy_log_dom = -1;
   azy_rpc_log_dom = -1;
   return azy_init_count_;
}
Exemple #7
0
int main (int argc, char *argv[]) {
  ecore_con_init();

  printf("Server is running: waiting for connections\n");
  svr = ecore_con_server_add(ECORE_CON_LOCAL_USER, "con_example", 0, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
			  (Handler_Func)client_connect, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL,
			  (Handler_Func)client_disconnect, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA,
			  (Handler_Func)client_data, NULL);
  ecore_main_loop_begin();

  ecore_con_shutdown();
  return 0;
}
int main (int argc, char *argv[]) {
  const char msg[] = "Hello Server\n";

  if (argc != 3)
    {
      fprintf(stderr, "Usage: con_tcp_client_example host port\n");
      return 1;
    }

  ecore_con_init();

  ecore_event_handler_add(ECORE_EVENT_SIGNAL_HUP, 
                          event_hup, NULL);

  svr = ecore_con_server_connect(ECORE_CON_REMOTE_TCP | ECORE_CON_USE_SSL3, argv[1], atoi(argv[2]), NULL);
  if( !svr )
    {
      printf("Unable to connect\n");
      return 1;
    }
  else
    {
      printf("Trying to connect\n");
    }

  printf("Server handle: 0x%08x\n", svr);

  ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD,
			  (Handler_Func)server_add, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL,
			  (Handler_Func)server_del, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD,
			  (Handler_Func)client_add, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL,
			  (Handler_Func)client_del, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA,
			  (Handler_Func)server_data, NULL);
  ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA,
			  (Handler_Func)client_data, NULL);

  ecore_con_server_send(svr, msg, sizeof(msg));

  ecore_main_loop_begin();

  ecore_con_shutdown();
  return 0;
}
Exemple #9
0
void
ipc_shutdown(void)
{
   char *ipc;

   if (!method || !strcmp(method, "fifo"))
     {
        ipc = getenv("EXQUISITE_IPC");
        if (!ipc) ipc = "/tmp/exquisite";
        unlink(ipc);
     }
   else if (strstr(method, "socket"))
     {
        if (sock) ecore_con_server_del(sock);
        ecore_con_shutdown();
     }
}
Exemple #10
0
static void _shutdown(EWeather *eweather)
{
   Instance *inst = eweather->plugin.data;

   if (inst->host) eina_stringshare_del(inst->host);

   if (inst->buffer) free(inst->buffer);

   if (inst->check_timer) ecore_timer_del(inst->check_timer);
   if (inst->add_handler) ecore_event_handler_del(inst->add_handler);
   if (inst->data_handler) ecore_event_handler_del(inst->data_handler);
   if (inst->err_handler) ecore_event_handler_del(inst->err_handler);
   if (inst->del_handler) ecore_event_handler_del(inst->del_handler);
   if (inst->server) ecore_con_server_del(inst->server);

   ecore_con_shutdown();

   free(inst);
}
Exemple #11
0
/**
 * @brief Shutdown store and all it's submodules if possible.
 * @return 0 if store shuts down, greater than 0 otherwise.
 *         This function shuts down all things set up in store_init()
 *         and cleans up its memory.
 */
int
store_shutdown(void)
{
   if (_store_init_count <= 0)
     {
        fprintf(stderr, "Store init count not greater than 0 in shutdown.");
        return 0;
     }

   if (--_store_init_count != 0)
     return _store_init_count;

   ecore_con_url_shutdown();
   ecore_con_shutdown();
   ecore_shutdown();
   eina_log_domain_unregister(_store_log_dom_global);
   _store_log_dom_global = -1;
   eina_shutdown();
   return _store_init_count;
}
int
main(int argc, const char *argv[])
{
   Ecore_Con_Url *ec_url = NULL;
   struct _request *req;
   int fd;
   const char *filename = "downloadedfile.dat";

   if (argc < 2)
     {
        printf("need one parameter: <url>\n");
        return -1;
     }

   fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);

   if (fd == -1)
     {
        printf("error: could not open file for writing: \"%s\"\n",
               filename);
        return -1;
     }

   ecore_init();
   ecore_con_init();
   ecore_con_url_init();

   ec_url = ecore_con_url_new(argv[1]);
   if (!ec_url)
     {
        printf("error when creating ecore con url object.\n");
        goto end;
     }

   req = malloc(sizeof(*req));
   req->size = 0;
   ecore_con_url_data_set(ec_url, req);

   ecore_con_url_fd_set(ec_url, fd);

   ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _url_progress_cb, NULL);
   ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, NULL);

   if (!ecore_con_url_get(ec_url))
     {
        printf("could not realize request.\n");
        goto free_ec_url;
     }

   ecore_main_loop_begin();

free_ec_url:
   free(req);
   ecore_con_url_free(ec_url);
end:

   close(fd);
   ecore_con_url_shutdown();
   ecore_con_shutdown();
   ecore_shutdown();

   return 0;
}