Only caller passes in NULL for the moment, and doesn't use it in the
callback, but it will allow fewer scopes by name of the variables the
action callback uses.
const char *);
int pop_fd (char *, int, char *, int);
int pop_stat (int *, int *);
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);
int pop_dele (int);
int pop_quit (void);
int pop_done (void);
* prototypes
*/
static void inc_done(int) NORETURN;
* 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)
int
maildir_srt(const void *va, const void *vb)
chmod (cp, m_gmprot ());
start = stop = 0L;
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))
adios (NULL, "%s", response);
if (fflush (pf))
+pop_action(void *closure, char *s)
fprintf (pf, "%s\n", s);
stop += strlen (s) + 1;
return 0; /* Is return value used? This was missing before 1999-07-15. */
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 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 *,
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 *,
-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);
-traverse (int (*action)(char *), const char *fmt, ...)
+traverse (int (*action)(void *, char *), void *closure, const char *fmt, ...)
{
int result, snoopstate;
va_list ap;
{
int result, snoopstate;
va_list ap;
+ (*action)(closure, response);