const char *);
int pop_fd (char *, int, char *, int);
int pop_stat (int *, int *);
-int pop_retr (int, int (*)(char *));
+int pop_retr (int, int (*)(void *, char *), void *);
int pop_dele (int);
int pop_quit (void);
int pop_done (void);
* prototypes
*/
static void inc_done(int) NORETURN;
-static int pop_action(char *);
+static int pop_action(void *closure, char *);
int
maildir_srt(const void *va, const void *vb)
chmod (cp, m_gmprot ());
start = stop = 0L;
- if (pop_retr (i, pop_action) == NOTOK)
+ if (pop_retr(i, pop_action, NULL) == NOTOK)
adios (NULL, "%s", response);
if (fflush (pf))
}
static int
-pop_action (char *s)
+pop_action(void *closure, char *s)
{
+ NMH_UNUSED(closure);
fprintf (pf, "%s\n", s);
stop += strlen (s) + 1;
return 0; /* Is return value used? This was missing before 1999-07-15. */
static int command(const char *, ...);
static int multiline(void);
-static int traverse (int (*)(char *), const char *, ...);
+static int traverse (int (*)(void *, char *), void *closure, const char *, ...);
static int vcommand(const char *, va_list);
static int pop_getline (char *, int, netsec_context *);
static int pop_sasl_callback(enum sasl_message_type, unsigned const char *,
int
-pop_retr (int msgno, int (*action)(char *))
+pop_retr (int msgno, int (*action)(void *, char *), void *closure)
{
- return traverse (action, "RETR %d", msgno);
+ return traverse (action, closure, "RETR %d", msgno);
}
static int
-traverse (int (*action)(char *), const char *fmt, ...)
+traverse (int (*action)(void *, char *), void *closure, const char *fmt, ...)
{
int result, snoopstate;
va_list ap;
return OK;
case OK:
- (*action) (response);
+ (*action)(closure, response);
break;
}
}