Fixes for Ecore Api changes.

SVN revision: 50072
master
Christopher Michael 12 years ago
parent 37f32c8d53
commit b17e200dc9
  1. 18
      src/e_mod_main.c
  2. 1
      src/e_mod_main.h
  3. 38
      src/imap2.c
  4. 34
      src/pop.c

@ -54,8 +54,8 @@ static void _mail_menu_cb_exec (void *data, E_Menu * m, E_Menu_Item * mi);
static Config_Item *_mail_config_item_get (const char *id);
static Mail *_mail_new (Evas * evas);
static void _mail_free (Mail * mail);
static int _mail_cb_check (void *data);
static int _mail_cb_exe_exit (void *data, int type, void *event);
static Eina_Bool _mail_cb_check (void *data);
static Eina_Bool _mail_cb_exe_exit (void *data, int type, void *event);
static E_Config_DD *conf_edd = NULL;
static E_Config_DD *conf_item_edd = NULL;
@ -601,15 +601,14 @@ _mail_free (Mail * mail)
mail = NULL;
}
static int
static Eina_Bool
_mail_cb_check (void *data)
{
Instance *inst = data;
Eina_List *l;
int have_imap = 0, have_pop = 0, have_mbox = 0;
if (!inst)
return 1;
if (!inst) return EINA_TRUE;
for (l = inst->ci->boxes; l; l = l->next)
{
@ -643,7 +642,7 @@ _mail_cb_check (void *data)
_mail_pop_check_mail (inst);
if (have_mbox)
_mail_mbox_check_mail (inst);
return 1;
return EINA_TRUE;
}
void
@ -694,17 +693,16 @@ _mail_start_exe (void *data)
cb->exe = ecore_exe_run (cb->exec, cb);
}
static int
static Eina_Bool
_mail_cb_exe_exit (void *data, int type, void *event)
{
Config_Box *cb;
cb = data;
if (!cb)
return 0;
if (!cb) return EINA_FALSE;
cb->exe = NULL;
ecore_event_handler_del (exit_handler);
return 0;
return EINA_FALSE;
}
void

@ -1,6 +1,7 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <libintl.h>
#define D_(str) dgettext(PACKAGE, str)
#ifndef E_MOD_MAIN_H

@ -19,15 +19,15 @@
static ImapClient *_mail_imap_client_find (Ecore_Con_Server *server);
static ImapClient *_mail_imap_client_get (Config_Box *cb);
static int _mail_imap_server_add (void *data, int type, void *event);
static int _mail_imap_server_del (void *data, int type, void *event);
static int _mail_imap_server_data (void *data, int type, void *event);
static Eina_Bool _mail_imap_server_add (void *data, int type, void *event);
static Eina_Bool _mail_imap_server_del (void *data, int type, void *event);
static Eina_Bool _mail_imap_server_data (void *data, int type, void *event);
static int _mail_imap_server_data_parse (ImapClient *ic, char *line);
static void _mail_imap_client_logout (ImapClient *ic);
static void _mail_imap_server_idle (ImapClient *ic);
static void _mail_imap_server_noop (ImapClient *ic);
static int elements (char *p);
static int elements (char *p);
static char *find_rn (char *data, unsigned int size);
static Eina_List *iclients = NULL;
@ -210,31 +210,29 @@ _mail_imap_client_get (Config_Box *cb)
return ic;
}
static int
static Eina_Bool
_mail_imap_server_add (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Add *ev = event;
ImapClient *ic;
ic = _mail_imap_client_find (ev->server);
if (!ic)
return 1;
if (!ic) return EINA_TRUE;
D ("Connect to %s:%s\n", ic->config->host, ic->config->new_path);
ic->state = IMAP_STATE_CONNECTED;
ic->cmd = 1;
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_mail_imap_server_del (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Del *ev = event;
ImapClient *ic;
ic = _mail_imap_client_find (ev->server);
if (!ic)
return 1;
if (!ic) return EINA_TRUE;
D ("Disconnect from %s:%s\n", ic->config->host, ic->config->new_path);
if (ic->state != IMAP_STATE_DISCONNECTED)
@ -253,10 +251,10 @@ _mail_imap_server_del (void *data, int type, void *event)
&& (ic->config->use_exec) && (ic->config->exec))
_mail_start_exe (ic->config);
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_mail_imap_server_data (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Data *ev = event;
@ -266,10 +264,8 @@ _mail_imap_server_data (void *data, int type, void *event)
unsigned int len, size;
ic = _mail_imap_client_find (ev->server);
if (!ic)
return 1;
if (ic->state == IMAP_STATE_DISCONNECTED)
return 1;
if (!ic) return EINA_TRUE;
if (ic->state == IMAP_STATE_DISCONNECTED) return EINA_TRUE;
D ("Data from %s:%s\n", ic->config->host, ic->config->new_path);
@ -282,7 +278,7 @@ _mail_imap_server_data (void *data, int type, void *event)
memcpy (ic->prev.data + ic->prev.size, ev->data, ev->size);
ic->prev.size += ev->size;
E_FREE (ev->data);
if (ic->prev.size < 2) return 0;
if (ic->prev.size < 2) return EINA_FALSE;
reply = ic->prev.data;
size = ic->prev.size;
@ -333,7 +329,7 @@ _mail_imap_server_data (void *data, int type, void *event)
{
printf ("Imap Failure: Couldn't find EOL\n");
_mail_imap_client_logout (ic);
return 0;
return EINA_FALSE;
}
*pp = '\0';
/* parse data */
@ -341,7 +337,7 @@ _mail_imap_server_data (void *data, int type, void *event)
{
printf ("Imap Failure: Couldn't parse data\n");
_mail_imap_client_logout (ic);
return 0;
return EINA_FALSE;
}
/* next */
p = pp + 2;
@ -408,7 +404,7 @@ _mail_imap_server_data (void *data, int type, void *event)
ic->cmd = 1;
_mail_set_text (ic->data);
D ("\n");
return 0;
return EINA_FALSE;
}
static int

@ -2,9 +2,9 @@
#include "e_mod_main.h"
#include "pop.h"
static int _mail_pop_server_add (void *data, int type, void *event);
static int _mail_pop_server_del (void *data, int type, void *event);
static int _mail_pop_server_data (void *data, int type, void *event);
static Eina_Bool _mail_pop_server_add (void *data, int type, void *event);
static Eina_Bool _mail_pop_server_del (void *data, int type, void *event);
static Eina_Bool _mail_pop_server_data (void *data, int type, void *event);
static PopClient *_mail_pop_client_get (void *data);
static PopClient *_mail_pop_client_get_from_server (void *data);
static void _mail_pop_client_quit (void *data);
@ -119,29 +119,27 @@ _mail_pop_shutdown ()
}
/* PRIVATES */
static int
static Eina_Bool
_mail_pop_server_add (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Add *ev = event;
PopClient *pc;
pc = _mail_pop_client_get_from_server (ev->server);
if (!pc)
return 1;
if (!pc) return EINA_TRUE;
pc->state = POP_STATE_CONNECTED;
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_mail_pop_server_del (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Del *ev = event;
PopClient *pc;
pc = _mail_pop_client_get_from_server (ev->server);
if (!pc)
return 1;
if (!pc) return EINA_TRUE;
if (pc->state == POP_STATE_DISCONNECTED)
printf ("Pop Server Disconnected\n");
@ -150,10 +148,10 @@ _mail_pop_server_del (void *data, int type, void *event)
pc->server = NULL;
pc->state = POP_STATE_DISCONNECTED;
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_mail_pop_server_data (void *data, int type, void *event)
{
Ecore_Con_Event_Server_Data *ev = event;
@ -162,10 +160,8 @@ _mail_pop_server_data (void *data, int type, void *event)
int len, num = 0, total = 0;
pc = _mail_pop_client_get_from_server (ev->server);
if (!pc)
return 1;
if (pc->state == POP_STATE_DISCONNECTED)
return 1;
if (!pc) return EINA_TRUE;
if (pc->state == POP_STATE_DISCONNECTED) return EINA_TRUE;
len = sizeof (in) - 1;
len = (((len) > (ev->size)) ? ev->size : len);
@ -176,13 +172,13 @@ _mail_pop_server_data (void *data, int type, void *event)
{
printf ("ERROR: %s\n", in);
_mail_pop_client_quit (pc);
return 0;
return EINA_FALSE;
}
else if (strncmp (in, "+OK", 3))
{
printf ("Unexpected reply: %s\n", in);
_mail_pop_client_quit (pc);
return 0;
return EINA_FALSE;
}
pc->state++;
@ -213,7 +209,7 @@ _mail_pop_server_data (void *data, int type, void *event)
default:
break;
}
return 0;
return EINA_FALSE;
}
static PopClient *

Loading…
Cancel
Save