summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2024-01-30 21:12:06 -0700
committerEduardo Chappa <chappa@washington.edu>2024-01-30 21:12:06 -0700
commiteaa7b17bca60632bc703f97c169ee4af2a519a2a (patch)
tree1c39d658ccf304f7d64fa3ef8ce104a44dcd3c03 /pith
parentf7deb74aa5612d4d49da4ec179e61124e8fa0763 (diff)
downloadalpine-eaa7b17bca60632bc703f97c169ee4af2a519a2a.tar.xz
* Changes in the source code of Alpine to define internal prototypes
of all functions so that they follow modern C standards. This lead to the splitting of the gf_io_t type into two types gf_i_t and gf_o_t with different internal prototypes. More details in the file pith/detach.c. This work was initiated based on a report by Holger Hoffstätte.
Diffstat (limited to 'pith')
-rw-r--r--pith/detach.c43
-rw-r--r--pith/detach.h6
-rw-r--r--pith/editorial.c4
-rw-r--r--pith/editorial.h2
-rw-r--r--pith/filter.c24
-rw-r--r--pith/filter.h20
-rw-r--r--pith/filttype.h3
-rw-r--r--pith/ical.c196
-rw-r--r--pith/mailindx.c2
-rw-r--r--pith/mailview.c61
-rw-r--r--pith/mailview.h16
-rw-r--r--pith/mimedesc.c2
-rw-r--r--pith/mimedesc.h2
-rw-r--r--pith/options.h2
-rw-r--r--pith/remote.c2
-rw-r--r--pith/reply.c20
-rw-r--r--pith/reply.h12
-rw-r--r--pith/save.c32
-rw-r--r--pith/send.c4
-rw-r--r--pith/smime.c4
-rw-r--r--pith/smime.h2
-rw-r--r--pith/sort.c2
-rw-r--r--pith/state.h2
-rw-r--r--pith/takeaddr.c2
-rw-r--r--pith/text.c8
-rw-r--r--pith/text.h2
26 files changed, 295 insertions, 180 deletions
diff --git a/pith/detach.c b/pith/detach.c
index 112f9628..6cb85e4d 100644
--- a/pith/detach.c
+++ b/pith/detach.c
@@ -65,14 +65,47 @@ FETCH_READC_S *g_fr_desc;
/*
* Internal Prototypes
*/
-/*
+/* HISTORICAL COMMENT
* This function is intentionally declared without an argument type so
* that warnings will go away in Windows. We're using gf_io_t for both
* input and output functions and the arguments aren't actually the
* same in the two cases. We should really have a read version and
* a write version of gf_io_t. That's why this is like this for now.
+ *
+ * EXPANDED VERSION
+ * The previous paragraph refers to the definition of the detach_writec
+ * function. It used to be that that function was defined as
+ * detach_writec();
+ * without any internal prototype. The reason why this was defined like
+ * that was because a function of type gf_io_t could be used to read
+ * data from or write data to a store object. In the case that a function
+ * of type gf_io_t is used to read data its internal prototype is of
+ * type (unsigned char *), and in the case that it is used to write
+ * data its internal prototype is of type (int).
+ *
+ * One way to deal with this is to make functions of type gf_io_t
+ * with internal prototype of type (void *) and to cast this to (int)
+ * and (unsigned char *) as needed, but then we get to into casting
+ * of different size warnings that will never lose information, but
+ * are not nice to read, so the solution is to really eliminate the
+ * type gf_io_t and split it into two types:
+ * One type is gf_i_t with internal prototype (unsigned char *) and
+ * another is gf_o_t with internal prototype (int).
+ *
+ * In the source code of Alpine the functions of this type are typically
+ * called gc for functions of the type gf_i_t, where gc stands for getchar,
+ * and pc for functions of the type gf_o_t, where pc stands for putchar.
+ * So a pc function writes data, and a gc function reads data. The gf_io_t
+ * type is gone. I have left some comments that refer to this type in the
+ * source code for historical reasons, now they must be interpreted as
+ * a gf_i_t or gf_o_t as appropiate, depending on if we need to read or
+ * write to a store object.
+ *
+ * One last thing, the gf_ prefix is for generic filter. Most of the gf_
+ * functions live in the file pith/filter.c, but there is a chance one can
+ * a function outside there. Have fun searching for them. ECh, 01/30/2024.
*/
-int detach_writec();
+int detach_writec(int);
TRGR_S *build_trigger_list(void);
void blast_trigger_list(TRGR_S **);
int df_trigger_cmp(long, char *, LT_INS_S **, void *);
@@ -96,7 +129,7 @@ char *
detach_raw(MAILSTREAM *stream, /* c-client stream to use */
long int msg_no, /* message number to deal with */
char *part_no, /* part number of message */
- gf_io_t pc, /* where to put it */
+ gf_o_t pc, /* where to put it */
int flags)
{
FETCH_READC_S *frd = (FETCH_READC_S *)fs_get(sizeof(FETCH_READC_S));
@@ -137,7 +170,7 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
char *part_no, /* part number of message */
long int partial, /* if >0, limit read to this many bytes */
long int *len, /* returns bytes read in this arg */
- gf_io_t pc, /* where to put it */
+ gf_o_t pc, /* where to put it */
FILTLIST_S *aux_filters, /* null terminated array of filts */
long flags)
{
@@ -337,7 +370,7 @@ detach(MAILSTREAM *stream, /* c-client stream to use */
fs_give((void **)&aux);
}
else{ /* just copy it, then */
- gf_io_t gc;
+ gf_i_t gc;
gf_set_so_readc(&gc, detach_so);
so_seek(detach_so, 0L, 0);
diff --git a/pith/detach.h b/pith/detach.h
index 96daa6dc..13681209 100644
--- a/pith/detach.h
+++ b/pith/detach.h
@@ -41,7 +41,7 @@ typedef struct _fetch_read {
allocsize; /* allocated size of chunk block */
long flags, /* flags to use fetching block */
fetchtime; /* usecs avg per chunk fetch */
- gf_io_t readc;
+ gf_i_t readc;
STORE_S *cache;
} FETCH_READC_S;
@@ -62,8 +62,8 @@ extern FETCH_READC_S *g_fr_desc;
#define DT_ALLIMAGES (long) 0x100000
/* exported prototypes */
-char *detach_raw(MAILSTREAM *, long, char *, gf_io_t, int);
-char *detach(MAILSTREAM *, long, char *, long, long *, gf_io_t, FILTLIST_S *, long);
+char *detach_raw(MAILSTREAM *, long, char *, gf_o_t, int);
+char *detach(MAILSTREAM *, long, char *, long, long *, gf_o_t, FILTLIST_S *, long);
int valid_filter_command(char **);
void fetch_readc_init(FETCH_READC_S *, MAILSTREAM *, long, char *,
unsigned long, long, long);
diff --git a/pith/editorial.c b/pith/editorial.c
index a93051b8..e841e371 100644
--- a/pith/editorial.c
+++ b/pith/editorial.c
@@ -48,9 +48,9 @@ typedef struct _editorial_s {
char *
-format_editorial(char *s, int width, int flags, HANDLE_S **handlesp, gf_io_t pc)
+format_editorial(char *s, int width, int flags, HANDLE_S **handlesp, gf_o_t pc)
{
- gf_io_t gc;
+ gf_i_t gc;
int *margin;
EDITORIAL_S es;
URL_HILITE_S uh;
diff --git a/pith/editorial.h b/pith/editorial.h
index 6ca16365..73f24fd2 100644
--- a/pith/editorial.h
+++ b/pith/editorial.h
@@ -23,7 +23,7 @@
/* exported prototypes */
-char *format_editorial(char *, int, int, HANDLE_S **, gf_io_t);
+char *format_editorial(char *, int, int, HANDLE_S **, gf_o_t);
#endif /* PITH_EDITORIAL_INCLUDED */
diff --git a/pith/filter.c b/pith/filter.c
index d2bd6c8f..e7da2238 100644
--- a/pith/filter.c
+++ b/pith/filter.c
@@ -68,7 +68,7 @@ int gf_freadc_getchar(unsigned char *, void *);
int gf_fwritec(int);
int gf_fwritec_locale(int);
#ifdef _WINDOWS
-int gf_freadc_windows(unsigned char *);
+int gf_freadc_windows(void *); /* of type unsigned char * */
#endif /* _WINDOWS */
int gf_preadc(unsigned char *);
int gf_preadc_locale(unsigned char *);
@@ -108,7 +108,7 @@ char *(*pith_opt_pretty_feature_name)(char *, int);
* pointer to first function in a pipe, and pointer to last filter
*/
FILTER_S *gf_master = NULL;
-static gf_io_t last_filter;
+static gf_o_t last_filter;
static char *gf_error_string;
static long gf_byte_count;
static jmp_buf gf_error_state;
@@ -252,7 +252,7 @@ static GF_SO_STACK {
* unprotected malloc/free/realloc, which can't be interrupted.
*/
int
-pc_is_picotext(gf_io_t pc)
+pc_is_picotext(gf_o_t pc)
{
return(pc == gf_so_writec && gf_so_out && gf_so_out->so &&
gf_so_out->so->src == ExternalText);
@@ -265,7 +265,7 @@ pc_is_picotext(gf_io_t pc)
* getc function
*/
void
-gf_set_readc(gf_io_t *gc, void *txt, long unsigned int len, SourceType src, int flags)
+gf_set_readc(gf_i_t *gc, void *txt, long unsigned int len, SourceType src, int flags)
{
gf_in.n = len;
gf_in.flags = flags;
@@ -303,7 +303,7 @@ gf_set_readc(gf_io_t *gc, void *txt, long unsigned int len, SourceType src, int
* putc function
*/
void
-gf_set_writec(gf_io_t *pc, void *txt, long unsigned int len, SourceType src, int flags)
+gf_set_writec(gf_o_t *pc, void *txt, long unsigned int len, SourceType src, int flags)
{
gf_out.n = len;
gf_out.flags = flags;
@@ -338,7 +338,7 @@ gf_set_writec(gf_io_t *pc, void *txt, long unsigned int len, SourceType src, int
* getc function
*/
void
-gf_set_so_readc(gf_io_t *gc, STORE_S *so)
+gf_set_so_readc(gf_i_t *gc, STORE_S *so)
{
GF_SO_STACK *sp = (GF_SO_STACK *) fs_get(sizeof(GF_SO_STACK));
@@ -372,7 +372,7 @@ gf_clear_so_readc(STORE_S *so)
* putc function
*/
void
-gf_set_so_writec(gf_io_t *pc, STORE_S *so)
+gf_set_so_writec(gf_o_t *pc, STORE_S *so)
{
GF_SO_STACK *sp = (GF_SO_STACK *) fs_get(sizeof(GF_SO_STACK));
@@ -695,7 +695,7 @@ gf_swritec_locale(int c)
* output the given string with the given function
*/
int
-gf_puts(register char *s, gf_io_t pc)
+gf_puts(register char *s, gf_o_t pc)
{
while(*s != '\0')
if(!(*pc)((unsigned char)*s++))
@@ -709,7 +709,7 @@ gf_puts(register char *s, gf_io_t pc)
* output the given string with the given function
*/
int
-gf_nputs(register char *s, long int n, gf_io_t pc)
+gf_nputs(register char *s, long int n, gf_o_t pc)
{
while(n--)
if(!(*pc)((unsigned char)*s++))
@@ -905,7 +905,7 @@ gf_terminal(FILTER_S *f, int flg)
* for example: a function to write a char to a file or into a buffer
*/
void
-gf_set_terminal(gf_io_t f) /* function to set generic filter */
+gf_set_terminal(gf_o_t f) /* function to set generic filter */
{
last_filter = f;
@@ -932,7 +932,7 @@ gf_error(char *s)
* it on to the first filter in the chain.
*/
char *
-gf_pipe(gf_io_t gc, gf_io_t pc)
+gf_pipe(gf_i_t gc, gf_o_t pc)
/* how to get a character */
{
unsigned char c;
@@ -1016,7 +1016,7 @@ gf_bytes_piped(void)
* Returns: NULL on success, reason for failure (not alloc'd!) on error
*/
char *
-gf_filter(char *cmd, char *prepend, STORE_S *source_so, gf_io_t pc,
+gf_filter(char *cmd, char *prepend, STORE_S *source_so, gf_o_t pc,
FILTLIST_S *aux_filters, int silent, int disable_reset,
void (*pipecb_f)(PIPE_S *, int, void *))
{
diff --git a/pith/filter.h b/pith/filter.h
index e3656bcb..4061333c 100644
--- a/pith/filter.h
+++ b/pith/filter.h
@@ -161,21 +161,21 @@ int generic_readc_locale(unsigned char *c,
int (*get_a_char)(unsigned char *, void *),
void *extraarg,
CBUF_S *cb);
-int pc_is_picotext(gf_io_t);
-void gf_set_readc(gf_io_t *, void *, unsigned long, SourceType, int);
-void gf_set_writec(gf_io_t *, void *, unsigned long, SourceType, int);
-void gf_set_so_readc(gf_io_t *, STORE_S *);
+int pc_is_picotext(gf_o_t);
+void gf_set_readc(gf_i_t *, void *, unsigned long, SourceType, int);
+void gf_set_writec(gf_o_t *, void *, unsigned long, SourceType, int);
+void gf_set_so_readc(gf_i_t *, STORE_S *);
void gf_clear_so_readc(STORE_S *);
-void gf_set_so_writec(gf_io_t *, STORE_S *);
+void gf_set_so_writec(gf_o_t *, STORE_S *);
void gf_clear_so_writec(STORE_S *);
-int gf_puts(char *, gf_io_t);
-int gf_nputs(char *, long, gf_io_t);
+int gf_puts(char *, gf_o_t);
+int gf_nputs(char *, long, gf_o_t);
void gf_filter_init(void);
void gf_link_filter(filter_t, void *);
-void gf_set_terminal(gf_io_t);
-char *gf_pipe(gf_io_t, gf_io_t);
+void gf_set_terminal(gf_o_t);
+char *gf_pipe(gf_i_t, gf_o_t);
long gf_bytes_piped(void);
-char *gf_filter(char *, char *, STORE_S *, gf_io_t, FILTLIST_S *, int,
+char *gf_filter(char *, char *, STORE_S *, gf_o_t, FILTLIST_S *, int,
int, void (*)(PIPE_S *, int, void *));
void gf_binary_b64(FILTER_S *, int);
void gf_b64_binary(FILTER_S *, int);
diff --git a/pith/filttype.h b/pith/filttype.h
index d3d08539..08a8d9d0 100644
--- a/pith/filttype.h
+++ b/pith/filttype.h
@@ -51,7 +51,8 @@ typedef struct filter_insert_s {
} LT_INS_S;
-typedef int (*gf_io_t)(); /* type of get and put char function */
+typedef int (*gf_i_t)(unsigned char *);
+typedef int (*gf_o_t)(int);
typedef void (*filter_t)(FILTER_S *, int);
typedef int (*linetest_t)(long, char *, LT_INS_S **, void *);
typedef void (*htmlrisk_t)(void);
diff --git a/pith/ical.c b/pith/ical.c
index 98080b5b..17dda00a 100644
--- a/pith/ical.c
+++ b/pith/ical.c
@@ -16,7 +16,7 @@ typedef struct ical_iana_prop_s {
char *prop; /* component PROPerty name */
size_t len; /* size of component name (strlen(x->prop)) */
int pos; /* location of this component in the prop array */
- void *(*parse)(); /* parser */
+ void *(*parse)(void **); /* parser */
void (*give)(void **); /* free memory */
} ICAL_PROP_S;
@@ -58,19 +58,22 @@ void ical_free_valarm(void **);
void ical_free_unknown_comp(ICAL_S **);
/* parse properties */
-void *ical_cline_from_token(void *, char **, char *);
-void *ical_gencline_from_token(void *, char **, char *);
-
-void *ical_parse_rrule(void *, char **, char *);
-void *ical_parse_time(void *, char **, char *);
-void *ical_parse_offset(void *, char **, char *);
-
-void *ical_parse_freq(void *, char *);
-void *ical_parse_until(void *, char *);
-void *ical_parse_count(void *, char *);
-void *ical_parse_interval(void *, char *);
-void *ical_parse_weekday_list(void *, char *);
-void *ical_parse_number_list(void *, char *);
+/* argument of type void *, char **, char * */
+void *ical_cline_from_token(void **);
+void *ical_gencline_from_token(void **);
+
+/* argument of type void *, char **, char * */
+void *ical_parse_rrule(void **);
+void *ical_parse_time(void **);
+void *ical_parse_offset(void **);
+
+/* argument of type (void *, char *) */
+void *ical_parse_freq(void **);
+void *ical_parse_until(void **);
+void *ical_parse_count(void **);
+void *ical_parse_interval(void **);
+void *ical_parse_weekday_list(void **);
+void *ical_parse_number_list(void **);
int ical_get_number_value(char *, int, int);
void ical_set_date(ICLINE_S *, VTIMEZONE_S *);
@@ -695,11 +698,18 @@ ical_parse_text(char *text)
}
void *
-ical_parse_time(void *ic_datep, char **text, char *token)
+ical_parse_time(void **arg)
{
+ void *ic_datep;
+ char **text;
+ char *token;
struct tm *datep;
ICLINE_S *icl;
+ ic_datep = arg[0];
+ text = (char **) arg[1];
+ token = (char *) arg[2];
+
datep = fs_get(sizeof(struct tm));
icl = ical_parse_line(text, token);
ical_parse_date(icl->value, datep);
@@ -710,11 +720,16 @@ ical_parse_time(void *ic_datep, char **text, char *token)
}
void *
-ical_parse_interval(void *longvp, char *value)
+ical_parse_interval(void **arg)
{
+ void *longvp;
+ char *value;
unsigned long *longp;
+ longvp = arg[0];
+ value = (char *) arg[1];
+
longp = fs_get(sizeof(unsigned long));
*longp = atoi(value);
longvp = (void *) longp;
@@ -724,12 +739,18 @@ ical_parse_interval(void *longvp, char *value)
void *
-ical_parse_offset(void *offsetv, char **text, char *token)
+ical_parse_offset(void **arg)
{
+ void *offsetv;
+ char **text;
+ char *token;
ICLINE_S *icl;
char *value;
int h, m, *offset;
+ offsetv = arg[0];
+ text = (char **) arg[1];
+ token = (char *) arg[2];
offset = fs_get(sizeof(int));
icl = ical_parse_line(text, token);
@@ -760,10 +781,17 @@ ical_parse_offset(void *offsetv, char **text, char *token)
* rv = (cast here *) ical_cline_from_token((void *)rv, &text, token);
*/
void *
-ical_cline_from_token(void *iclp, char **text, char *token)
+ical_cline_from_token(void **arg)
{
+ void *iclp;
+ char **text;
+ char *token;
ICLINE_S *icl;
+ iclp = arg[0];
+ text = (char **) arg[1];
+ token = (char *) arg[2];
+
ical_debug("ical_cline_from_token", *text);
icl = ical_parse_line(text, token);
@@ -777,16 +805,28 @@ ical_cline_from_token(void *iclp, char **text, char *token)
}
void *
-ical_gencline_from_token(void *giclv, char **text, char *token)
+ical_gencline_from_token(void **arg)
{
+ void *giclv;
+ char **text;
+ char *token;
+ void *a[3];
GEN_ICLINE_S *gicl= NULL;
+ giclv = arg[0];
+ text = (char **) arg[1];
+ token = (char *) arg[2];
+
if(!struncmp(*text, token, strlen(token))){
gicl = fs_get(sizeof(GEN_ICLINE_S));
memset((void *) gicl, 0, sizeof(GEN_ICLINE_S));
gicl->cline = ical_parse_line(text, token);
// gicl->line = (ICLINE_S *) ical_cline_from_token((void *) gicl->cline, text, token);
- gicl->next = (GEN_ICLINE_S *) ical_gencline_from_token((void *) gicl->next, text, token);
+ a[0] = (void *) gicl->next;
+ a[1] = (void *) text;
+ a[2] = (void *) token;
+ gicl->next = (GEN_ICLINE_S *) ical_gencline_from_token((void **)a);
+ arg[1] = (void *) text;
}
if(giclv != NULL)
@@ -873,9 +913,11 @@ ical_parse_vcalendar(char **text)
case 'C':
case 'c': if(!struncmp(s+1, "ALSCALE", 7)){
- v = (void *) vcal->calscale;
- v = ical_cline_from_token(v, &s, "CALSCALE");
- vcal->calscale = (ICLINE_S *) v;
+ void *a[3];
+ a[0] = (void *) vcal->calscale;
+ a[1] = (void *) &s;
+ a[2] = (char *) "CALSCALE";
+ vcal->calscale = (ICLINE_S *) ical_cline_from_token((void **) a);
}
else ukn++;
break;
@@ -894,27 +936,33 @@ ical_parse_vcalendar(char **text)
case 'M':
case 'm': if(!struncmp(s+1, "ETHOD", 5)){
- v = (void *) vcal->method;
- v = ical_cline_from_token(v, &s, "METHOD");
- vcal->method = (ICLINE_S *) v;
+ void *a[3];
+ a[0] = (void *) vcal->method;
+ a[1] = (void *) &s;
+ a[2] = (char *) "METHOD";
+ vcal->method = (ICLINE_S *) ical_cline_from_token((void **) a);
}
else ukn++;
break;
case 'P':
case 'p': if(!struncmp(s+1, "RODID", 5)){
- v = (void *) vcal->prodid;
- v = ical_cline_from_token(v, &s, "PRODID");
- vcal->prodid = (ICLINE_S *) v;
+ void *a[3];
+ a[0] = (void *) vcal->prodid;
+ a[1] = (void *) &s;
+ a[2] = (char *) "PRODID";
+ vcal->prodid = (ICLINE_S *) ical_cline_from_token((void **) a);
}
else ukn++;
break;
case 'V':
case 'v': if(!struncmp(s+1, "ERSION", 6)){
- v = (void *) vcal->version;
- v = ical_cline_from_token(v, &s, "VERSION");
- vcal->version = (ICLINE_S *) v;
+ void *a[3];
+ a[0] = (void *) vcal->version;
+ a[1] = (void *) &s;
+ a[2] = (char *) "VERSION";
+ vcal->version = (ICLINE_S *) ical_cline_from_token((void **) a);
} else ukn++;
break;
@@ -1004,14 +1052,15 @@ ical_parse_vevent(char **text)
if(!struncmp(s, event_prop[i].prop, t-s))
break;
if(event_prop[i].parse){
- void *v;
+ void *a[3];
if(vevent->prop == NULL){
vevent->prop = fs_get((EvUnknown+1)*sizeof(void *));
memset((void *)vevent->prop, 0, (EvUnknown+1)*sizeof(void *));
}
- v = vevent->prop[event_prop[i].pos];
- v = (event_prop[i].parse)(v , &s, event_prop[i].prop);
- vevent->prop[event_prop[i].pos] = v;
+ a[0] = vevent->prop[event_prop[i].pos];
+ a[1] = (void *) &s;
+ a[2] = (void *) event_prop[i].prop;
+ vevent->prop[event_prop[i].pos] = (event_prop[i].parse)((void **) a);
}
else
ukn++;
@@ -1107,14 +1156,15 @@ ical_parse_vtimezone(char **text)
if(!struncmp(s, tz_comp[i].prop, t-s))
break;
if(tz_comp[i].parse){
- void *v;
+ void *a[3];
if(vtz->prop == NULL){
vtz->prop = fs_get(TZCUnknown*sizeof(void *));
memset((void *)vtz->prop, 0, TZCUnknown*sizeof(void *));
}
- v = vtz->prop[tz_comp[i].pos];
- v = (tz_comp[i].parse)(v, &s, tz_comp[i].prop);
- vtz->prop[tz_comp[i].pos] = v;
+ a[0] = vtz->prop[tz_comp[i].pos];
+ a[1] = (void *) &s;
+ a[2] = (void *) tz_comp[i].prop;
+ vtz->prop[tz_comp[i].pos] = (tz_comp[i].parse)((void **) a);
}
else
ukn++;
@@ -1189,14 +1239,15 @@ ical_parse_timezone(char **text)
if(!struncmp(s, tz_prop[i].prop, t-s))
break;
if(tz_prop[i].parse){
- void *v;
+ void *a[3];
if(tzprop->prop == NULL){
tzprop->prop = fs_get(TZPUnknown*sizeof(void *));
memset((void *)tzprop->prop, 0, TZPUnknown*sizeof(void *));
}
- v = tzprop->prop[tz_prop[i].pos];
- v = (tz_prop[i].parse)(v, &s, tz_prop[i].prop);
- tzprop->prop[tz_prop[i].pos] = v;
+ a[0] = tzprop->prop[tz_prop[i].pos];
+ a[1] = (void *) &s;
+ a[2] = (void *) tz_prop[i].prop;
+ tzprop->prop[tz_prop[i].pos] = (tz_prop[i].parse)((void **) a);
}
else
ukn++;
@@ -1270,14 +1321,15 @@ ical_parse_valarm(char **text)
if(!struncmp(s, alarm_prop[i].prop, t-s))
break;
if(alarm_prop[i].parse){
- void *v;
+ void *a[3];
if(valarm->prop == NULL){
valarm->prop = fs_get((AlUnknown+1)*sizeof(void *));
memset((void *)valarm->prop, 0, (AlUnknown+1)*sizeof(void *));
}
- v = valarm->prop[alarm_prop[i].pos];
- v = (alarm_prop[i].parse)(v, &s, alarm_prop[i].prop);
- valarm->prop[alarm_prop[i].pos] = v;
+ a[0] = valarm->prop[alarm_prop[i].pos];
+ a[1] = (void *) &s;
+ a[2] = (void *) alarm_prop[i].prop;
+ valarm->prop[alarm_prop[i].pos] = (alarm_prop[i].parse)((void **) a);
}
else
ukn++;
@@ -1476,10 +1528,14 @@ ical_parse_line(char **text, char *name)
***/
void *
-ical_parse_freq(void *fvalp, char *text)
+ical_parse_freq(void **arg)
{
+ void *fvalp;
+ char *text;
Freq_value *fval;
+ fvalp = arg[0];
+ text = (char *) arg[1];
fval = fs_get(sizeof(Freq_value));
*fval = FUnknown;
@@ -1500,10 +1556,14 @@ ical_parse_freq(void *fvalp, char *text)
}
void *
-ical_parse_until(void *Tmp, char *text)
+ical_parse_until(void **arg)
{
+ void *Tmp;
+ char *text;
struct tm *Tm;
+ Tmp = arg[0];
+ text = (char *) arg[1];
if(text != NULL){
Tm = fs_get(sizeof(struct tm));
ical_parse_date(text, Tm);
@@ -1514,10 +1574,14 @@ ical_parse_until(void *Tmp, char *text)
}
void *
-ical_parse_count(void *countp, char *text)
+ical_parse_count(void **arg)
{
+ void *countp;
+ char *text;
int *count;
+ countp = arg[0];
+ text = (char *) arg[1];
if(text != NULL){
count = fs_get(sizeof(int));
*count = atoi(text);
@@ -1528,13 +1592,18 @@ ical_parse_count(void *countp, char *text)
}
void *
-ical_parse_weekday_list(void *bywkdyp, char *wklist)
+ical_parse_weekday_list(void **arg)
{
+ void *bywkdyp;
+ char *wklist;
BYWKDY_S *bywkdy, *w;
char *s, *t, c;
int done;
size_t len;
+ bywkdyp = arg[0];
+ wklist = (char *) arg[1];
+
bywkdy = NULL;
bywkdyp = (void *) bywkdy;
@@ -1581,14 +1650,17 @@ ical_parse_weekday_list(void *bywkdyp, char *wklist)
}
void *
-ical_parse_number_list(void *bynop, char *nolist)
+ical_parse_number_list(void **arg)
{
+ void *bynop;
+ char *nolist;
BYWKDY_S *byno, *n;
char *s, *t, c;
int done = 0;
byno = NULL;
- bynop = (void *) byno;
+ bynop = arg[0];
+ nolist = (char *) arg[1];
if(nolist == NULL) return bynop;
@@ -1621,14 +1693,21 @@ ical_parse_number_list(void *bynop, char *nolist)
}
void *
-ical_parse_rrule(void *rrulep, char **text, char *token)
+ical_parse_rrule(void **arg)
{
+ void *rrulep;
+ char **text;
+ char *token;
RRULE_S *rrule;
ICLINE_S *icl;
char *s;
ICAL_PARAMETER_S *param, *p;
int i;
+ rrulep = arg[0];
+ text = (char **) arg[1];
+ token = (char *) arg[2];
+
if(text == NULL || *text == NULL || struncmp(*text, "RRULE", 5))
return rrulep;
@@ -1652,9 +1731,10 @@ ical_parse_rrule(void *rrulep, char **text, char *token)
for(p = param; p != NULL; p = p->next){
for(i = 0; rrule_prop[i].prop != NULL && strucmp(p->name, rrule_prop[i].prop); i++);
if(rrule_prop[i].parse){
- void *v = rrule->prop[rrule_prop[i].pos];
- v = (rrule_prop[i].parse)(v, p->value);
- rrule->prop[rrule_prop[i].pos] = v;
+ void *a[2];
+ a[0] = rrule->prop[rrule_prop[i].pos];
+ a[1] = (void *) p->value;
+ rrule->prop[rrule_prop[i].pos] = (rrule_prop[i].parse)((void **) a);
}
}
rrule->prop[RRUnknown] = NULL;
diff --git a/pith/mailindx.c b/pith/mailindx.c
index 27e1b298..2e19a602 100644
--- a/pith/mailindx.c
+++ b/pith/mailindx.c
@@ -3733,7 +3733,7 @@ fetch_firsttext(INDEXDATA_S *idata, int delete_quotes)
BODY *body = NULL, *new_body = NULL;
char *firsttext = NULL;
STORE_S *so;
- gf_io_t pc;
+ gf_o_t pc;
long partial_fetch_len = 0L;
SEARCHSET *ss, **sset;
MESSAGECACHE *mc;
diff --git a/pith/mailview.c b/pith/mailview.c
index a3763329..c49d0ac2 100644
--- a/pith/mailview.c
+++ b/pith/mailview.c
@@ -89,7 +89,7 @@ static struct envelope_s {
/*
* Hook for optional display of rfc2369 content
*/
-int (*pith_opt_rfc2369_editorial)(long, HANDLE_S **, int, int, gf_io_t);
+int (*pith_opt_rfc2369_editorial)(long, HANDLE_S **, int, int, gf_o_t);
@@ -101,28 +101,28 @@ int format_blip_seen(long);
int is_an_env_hdr(char *);
int is_an_addr_hdr(char *);
void format_env_hdr(MAILSTREAM *, long, char *, ENVELOPE *,
- fmt_env_t, gf_io_t, char *, char *, int);
+ fmt_env_t, gf_o_t, char *, char *, int);
int delineate_this_header(char *, char *, char **, char **);
char *url_embed(int);
int color_headers(long, char *, LT_INS_S **, void *);
int url_hilite_hdr(long, char *, LT_INS_S **, void *);
int pad_to_right_edge(long, char *, LT_INS_S **, void *);
int url_bogus_imap(char **, char *, char *);
-int format_raw_header(MAILSTREAM *, long, char *, gf_io_t);
+int format_raw_header(MAILSTREAM *, long, char *, gf_o_t);
void format_envelope(MAILSTREAM *, long, char *, ENVELOPE *,
- gf_io_t, long, char *, int);
+ gf_o_t, long, char *, int);
int any_hdr_color(char *);
void format_addr_string(MAILSTREAM *, long, char *, char *,
- ADDRESS *, int, char *, gf_io_t);
-void pine_rfc822_write_address_noquote(ADDRESS *, gf_io_t, int *);
-void format_newsgroup_string(char *, char *, int, gf_io_t);
-int format_raw_hdr_string(char *, char *, gf_io_t, char *, int);
-int format_env_puts(char *, gf_io_t);
+ ADDRESS *, int, char *, gf_o_t);
+void pine_rfc822_write_address_noquote(ADDRESS *, gf_o_t, int *);
+void format_newsgroup_string(char *, char *, int, gf_o_t);
+int format_raw_hdr_string(char *, char *, gf_o_t, char *, int);
+int format_env_puts(char *, gf_o_t);
int find_field(char **, char *, size_t);
-int embed_color(COLOR_PAIR *, gf_io_t);
+int embed_color(COLOR_PAIR *, gf_o_t);
COLOR_PAIR *get_cur_embedded_color(void);
void clear_cur_embedded_color(void);
-void format_calendar_vevent(VCALENDAR_S *, ATTACH_S *, HANDLE_S **, int, int, gf_io_t, int);
+void format_calendar_vevent(VCALENDAR_S *, ATTACH_S *, HANDLE_S **, int, int, gf_o_t, int);
@@ -148,7 +148,7 @@ parts that are not displayed or can't be displayed.
----*/
int
format_message(long int msgno, ENVELOPE *env, struct mail_bodystruct *body,
- HANDLE_S **handlesp, int flgs, gf_io_t pc)
+ HANDLE_S **handlesp, int flgs, gf_o_t pc)
{
char *decode_err = NULL;
HEADER_S h;
@@ -217,7 +217,7 @@ format_message(long int msgno, ENVELOPE *env, struct mail_bodystruct *body,
}
void
-format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int flgs, int width, gf_io_t pc, int cflags)
+format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int flgs, int width, gf_o_t pc, int cflags)
{
int avail, m1, m2, hwid, i, partwid, padwid;
int s1, s2, dwid, minkey;
@@ -487,7 +487,7 @@ format_calendar_vevent(VCALENDAR_S *vcal, ATTACH_S *a, HANDLE_S **handlesp, int
}
int
-format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int width, gf_io_t pc)
+format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int width, gf_o_t pc)
{
char *rawtext, *caltext;
unsigned long callen;
@@ -561,14 +561,14 @@ format_calendar(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int w
char *
-format_body(long int msgno, BODY *body, HANDLE_S **handlesp, HEADER_S *hp, int flgs, int width, gf_io_t pc)
+format_body(long int msgno, BODY *body, HANDLE_S **handlesp, HEADER_S *hp, int flgs, int width, gf_o_t pc)
{
int filt_only_c0 = 0, wrapflags, error_found = 0;
int is_in_sig = OUT_SIG_BLOCK;
char *charset, *decode_err = NULL, *tmp1, *description;
ATTACH_S *a;
URL_HILITE_S uh;
- gf_io_t gc;
+ gf_i_t gc;
if(body == NULL
|| (ps_global->full_header == 2
@@ -883,7 +883,7 @@ format_body(long int msgno, BODY *body, HANDLE_S **handlesp, HEADER_S *hp, int f
int
-format_attachment_list(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int width, gf_io_t pc)
+format_attachment_list(long int msgno, BODY *body, HANDLE_S **handlesp, int flgs, int width, gf_o_t pc)
{
ATTACH_S *a;
@@ -1263,7 +1263,7 @@ is_an_addr_hdr(char *fieldname)
*/
void
format_env_hdr(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *env,
- fmt_env_t fmt_env, gf_io_t pc, char *field, char *oacs, int flags)
+ fmt_env_t fmt_env, gf_o_t pc, char *field, char *oacs, int flags)
{
register int i;
@@ -2307,7 +2307,7 @@ url_bogus(char *url, char *reason)
int
format_header(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *env,
HEADER_S *hdrs, char *prefix, HANDLE_S **handlesp, int flags,
- fmt_env_t fmt_env, gf_io_t final_pc)
+ fmt_env_t fmt_env, gf_o_t final_pc)
{
int rv = FHT_OK;
int nfields, i;
@@ -2315,7 +2315,8 @@ format_header(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *env,
*finish, *current;
STORE_S *tmp_store;
URL_HILITE_S uh;
- gf_io_t tmp_pc, tmp_gc;
+ gf_o_t tmp_pc;
+ gf_i_t tmp_gc;
struct variable *vars = ps_global->vars;
if((tmp_store = so_get(CharStar, NULL, EDIT_ACCESS)) != NULL)
@@ -2646,7 +2647,7 @@ format_header(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *env,
----*/
int
-format_raw_header(MAILSTREAM *stream, long int msgno, char *section, gf_io_t pc)
+format_raw_header(MAILSTREAM *stream, long int msgno, char *section, gf_o_t pc)
{
char *h = mail_fetch_header(stream, msgno, section, NULL, NULL, FT_PEEK);
unsigned char c;
@@ -2699,7 +2700,7 @@ format_raw_header(MAILSTREAM *stream, long int msgno, char *section, gf_io_t pc)
----*/
void
-format_envelope(MAILSTREAM *s, long int n, char *sect, ENVELOPE *e, gf_io_t pc,
+format_envelope(MAILSTREAM *s, long int n, char *sect, ENVELOPE *e, gf_o_t pc,
long int which, char *oacs, int flags)
{
char *q, *p2, buftmp[MAILTMPLEN];
@@ -2905,7 +2906,7 @@ any_hdr_color(char *fieldname)
----------------------------------------------------------------------*/
void
format_addr_string(MAILSTREAM *stream, long int msgno, char *section, char *field_name,
- struct mail_address *addr, int flags, char *oacs, gf_io_t pc)
+ struct mail_address *addr, int flags, char *oacs, gf_o_t pc)
{
char *ptmp, *mtmp = NULL;
int trailing = 0, group = 0;
@@ -3026,7 +3027,7 @@ const char *rspecials_minus_quote_and_dot = "()<>@,;:\\[]";
* doesn't usually break anything.
*/
void
-pine_rfc822_write_address_noquote(struct mail_address *adr, gf_io_t pc, int *group)
+pine_rfc822_write_address_noquote(struct mail_address *adr, gf_o_t pc, int *group)
{
extern const char *rspecials;
@@ -3064,7 +3065,7 @@ pine_rfc822_write_address_noquote(struct mail_address *adr, gf_io_t pc, int *gro
*/
void
-pine_rfc822_address(struct mail_address *adr, gf_io_t pc)
+pine_rfc822_address(struct mail_address *adr, gf_o_t pc)
{
extern char *wspecials;
@@ -3090,7 +3091,7 @@ pine_rfc822_address(struct mail_address *adr, gf_io_t pc)
*/
void
-pine_rfc822_cat(char *src, const char *specials, gf_io_t pc)
+pine_rfc822_cat(char *src, const char *specials, gf_o_t pc)
{
char *s;
@@ -3128,7 +3129,7 @@ pine_rfc822_cat(char *src, const char *specials, gf_io_t pc)
The resulting lines formatted are 80 columns wide.
----------------------------------------------------------------------*/
void
-format_newsgroup_string(char *field_name, char *newsgrps, int flags, gf_io_t pc)
+format_newsgroup_string(char *field_name, char *newsgrps, int flags, gf_o_t pc)
{
char buf[MAILTMPLEN];
int trailing = 0, llen, alen;
@@ -3208,7 +3209,7 @@ format_newsgroup_string(char *field_name, char *newsgrps, int flags, gf_io_t pc)
----------------------------------------------------------------------*/
int
-format_raw_hdr_string(char *start, char *finish, gf_io_t pc, char *oacs, int flags)
+format_raw_hdr_string(char *start, char *finish, gf_o_t pc, char *oacs, int flags)
{
register char *current;
unsigned char *p, *tmp = NULL, c;
@@ -3272,7 +3273,7 @@ format_raw_hdr_string(char *start, char *finish, gf_io_t pc, char *oacs, int fla
----------------------------------------------------------------------*/
int
-format_env_puts(char *s, gf_io_t pc)
+format_env_puts(char *s, gf_o_t pc)
{
if(ps_global->pass_ctrl_chars)
return(gf_puts(s, pc));
@@ -3454,7 +3455,7 @@ static char *_last_embedded_fg_color, *_last_embedded_bg_color;
int
-embed_color(COLOR_PAIR *cp, gf_io_t pc)
+embed_color(COLOR_PAIR *cp, gf_o_t pc)
{
if(cp && cp->fg){
if(_last_embedded_fg_color)
diff --git a/pith/mailview.h b/pith/mailview.h
index 8ffb53c1..f86ce591 100644
--- a/pith/mailview.h
+++ b/pith/mailview.h
@@ -80,7 +80,7 @@
/*
* Function to format
*/
-typedef void (*fmt_env_t)(MAILSTREAM *, long int, char *, ENVELOPE *, gf_io_t, long int, char *, int);
+typedef void (*fmt_env_t)(MAILSTREAM *, long int, char *, ENVELOPE *, gf_o_t, long int, char *, int);
/*
* Structure and macros to help control format_header_text
@@ -123,10 +123,10 @@ typedef struct header_s {
/* exported prototypes */
-int format_message(long, ENVELOPE *, BODY *, HANDLE_S **, int, gf_io_t);
-int format_attachment_list(long int, BODY *, HANDLE_S **, int, int, gf_io_t);
-char *format_body(long int, BODY *, HANDLE_S **, HEADER_S *, int, int, gf_io_t);
-int format_calendar(long int, BODY *, HANDLE_S **, int, int, gf_io_t);
+int format_message(long, ENVELOPE *, BODY *, HANDLE_S **, int, gf_o_t);
+int format_attachment_list(long int, BODY *, HANDLE_S **, int, int, gf_o_t);
+char *format_body(long int, BODY *, HANDLE_S **, HEADER_S *, int, int, gf_o_t);
+int format_calendar(long int, BODY *, HANDLE_S **, int, int, gf_o_t);
int url_hilite(long, char *, LT_INS_S **, void *);
int handle_start_color(char *, size_t, int *, int);
int handle_end_color(char *, size_t, int *);
@@ -138,10 +138,10 @@ int handle_end_color(char *, size_t, int *);
int url_external_specific_handler(char *, int);
int url_imap_folder(char *, char **, imapuid_t *, imapuid_t *, char **, int);
int url_bogus(char *, char *);
-void pine_rfc822_address(ADDRESS *, gf_io_t);
-void pine_rfc822_cat(char *, const char *, gf_io_t);
+void pine_rfc822_address(ADDRESS *, gf_o_t);
+void pine_rfc822_cat(char *, const char *, gf_o_t);
int format_header(MAILSTREAM *, long, char *, ENVELOPE *, HEADER_S *,
- char *, HANDLE_S **, int, fmt_env_t, gf_io_t);
+ char *, HANDLE_S **, int, fmt_env_t, gf_o_t);
COLOR_PAIR *hdr_color(char *, char *, SPEC_COLOR_S *);
char *display_parameters(PARAMETER *);
char *pine_fetch_header(MAILSTREAM *, long, char *, char **, long);
diff --git a/pith/mimedesc.c b/pith/mimedesc.c
index d79d9765..b5cff98e 100644
--- a/pith/mimedesc.c
+++ b/pith/mimedesc.c
@@ -764,7 +764,7 @@ Args: number -- A string with the part number i.e. "3.2.1"
Result: formatted description written to object ref'd by "pc"
----*/
char *
-part_desc(char *number, BODY *body, int type, int width, int flags, gf_io_t pc)
+part_desc(char *number, BODY *body, int type, int width, int flags, gf_o_t pc)
{
char *t;
char buftmp[MAILTMPLEN], sizebuf[256];
diff --git a/pith/mimedesc.h b/pith/mimedesc.h
index 85d41121..b99ead33 100644
--- a/pith/mimedesc.h
+++ b/pith/mimedesc.h
@@ -28,7 +28,7 @@ void zero_atmts(ATTACH_S *);
char *body_type_names(int);
char *type_desc(int, char *, PARAMETER *, PARAMETER *, int);
long fcc_size_guess(BODY *);
-char *part_desc(char *, BODY *, int, int, int, gf_io_t);
+char *part_desc(char *, BODY *, int, int, int, gf_o_t);
char *parameter_val(PARAMETER *, char *);
int mime_can_display(int, char *, BODY *);
char *get_filename_parameter(char *, size_t, BODY *, char **);
diff --git a/pith/options.h b/pith/options.h
index ac45aca3..41df3380 100644
--- a/pith/options.h
+++ b/pith/options.h
@@ -62,7 +62,7 @@ extern void (*pith_opt_paint_index_hline)(MAILSTREAM *, long, ICE_S *);
* [editorial comment] in message text to indicate the message contains
* list-management pointers
*/
-extern int (*pith_opt_rfc2369_editorial)(long, HANDLE_S **, int, int, gf_io_t);
+extern int (*pith_opt_rfc2369_editorial)(long, HANDLE_S **, int, int, gf_o_t);
#ifdef ENABLE_LDAP
/*
diff --git a/pith/remote.c b/pith/remote.c
index feddf1c2..a2a1a72f 100644
--- a/pith/remote.c
+++ b/pith/remote.c
@@ -1855,7 +1855,7 @@ rd_update_local(REMDATA_S *rd)
{
char *error;
STORE_S *store;
- gf_io_t pc;
+ gf_o_t pc;
int i, we_cancel = 0;
BODY *body = NULL;
ENVELOPE *env;
diff --git a/pith/reply.c b/pith/reply.c
index 41ae9fe6..07f4b9ad 100644
--- a/pith/reply.c
+++ b/pith/reply.c
@@ -937,7 +937,7 @@ reply_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
char *p, *sig = NULL, *section, sect_buf[SECTBUFLEN];
BODY *body = NULL, *tmp_body = NULL;
PART *part;
- gf_io_t pc;
+ gf_o_t pc;
int impl, template_len = 0, leave_cursor_at_top = 0, reply_raw_body = 0;
if(sect_prefix) /* SECTBUFLEN = sizeof(sect_buf) */
@@ -2036,7 +2036,7 @@ get_reply_data(ENVELOPE *env, ACTION_S *role, IndexColType type, char *buf, size
* with supplied character writing function.
*/
void
-reply_delimiter(ENVELOPE *env, ACTION_S *role, gf_io_t pc)
+reply_delimiter(ENVELOPE *env, ACTION_S *role, gf_o_t pc)
{
#define MAX_DELIM 2000
char buf[MAX_DELIM+1];
@@ -2223,7 +2223,7 @@ forward_mime_msg(MAILSTREAM *stream, long int msgno, char *section, ENVELOPE *en
* forward_delimiter - return delimiter for forwarded text
*/
void
-forward_delimiter(gf_io_t pc)
+forward_delimiter(gf_o_t pc)
{
gf_puts(NEWLINE, pc);
/* TRANSLATORS: When a message is forwarded by the user this is the
@@ -2247,7 +2247,7 @@ forward_delimiter(gf_io_t pc)
----------------------------------------------------------------------*/
void
reply_forward_header(MAILSTREAM *stream, long int msgno, char *part, ENVELOPE *env,
- gf_io_t pc, char *prefix)
+ gf_o_t pc, char *prefix)
{
int rv;
HEADER_S h;
@@ -2363,7 +2363,7 @@ forward_body(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_bod
{
BODY *body = NULL, *text_body, *tmp_body;
PART *part;
- gf_io_t pc;
+ gf_o_t pc;
char *tmp_text, *section, sect_buf[256];
int forward_raw_body = 0;
@@ -2589,7 +2589,7 @@ bounce_msg_body(MAILSTREAM *stream,
char *h, *p, *errstr = NULL;
int i;
STORE_S *msgtext;
- gf_io_t pc;
+ gf_o_t pc;
*outgoingp = mail_newenvelope();
(*outgoingp)->subject = cpystr(subject ? subject : "Resent mail....");
@@ -2729,7 +2729,7 @@ DOESN'T sanity check the prefix given!!!
----*/
int
get_body_part_text(MAILSTREAM *stream, struct mail_bodystruct *body,
- long int msg_no, char *part_no, long partial, gf_io_t pc,
+ long int msg_no, char *part_no, long partial, gf_o_t pc,
char *prefix, char **ret_charset, unsigned flags)
{
int we_cancel = 0, dashdata, wrapflags = GFW_FORCOMPOSE, flow_res = 0;
@@ -2752,7 +2752,7 @@ get_body_part_text(MAILSTREAM *stream, struct mail_bodystruct *body,
*/
if(body == NULL){
char *text, *decode_error;
- gf_io_t gc;
+ gf_i_t gc;
SourceType src = CharStar;
int rv = 0;
@@ -3691,7 +3691,7 @@ bail_out:
*/
BODY *
forward_multi_alt_mixed(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
- long int msgno, char *sect_prefix, void *msgtext, gf_io_t pc, int flags)
+ long int msgno, char *sect_prefix, void *msgtext, gf_o_t pc, int flags)
{
#define FWDTMPLEN 256
BODY *body = NULL, *text_body = NULL;
@@ -3784,7 +3784,7 @@ forward_multi_alt_mixed(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruc
----------------------------------------------------------------------*/
BODY *
forward_multi_alt(MAILSTREAM *stream, ENVELOPE *env, struct mail_bodystruct *orig_body,
- long int msgno, char *sect_prefix, void *msgtext, gf_io_t pc, int flags)
+ long int msgno, char *sect_prefix, void *msgtext, gf_o_t pc, int flags)
{
#define FWDTMPLEN 256
BODY *body = NULL;
diff --git a/pith/reply.h b/pith/reply.h
index 97c8f131..7a43c105 100644
--- a/pith/reply.h
+++ b/pith/reply.h
@@ -71,16 +71,16 @@ char *reply_signature(ACTION_S *, ENVELOPE *, REDRAFT_POS_S **, int *);
void get_addr_data(ENVELOPE *, IndexColType, char *, size_t);
void get_news_data(ENVELOPE *, IndexColType, char *, size_t);
char *get_reply_data(ENVELOPE *, ACTION_S *, IndexColType, char *, size_t);
-void reply_delimiter(ENVELOPE *, ACTION_S *, gf_io_t);
+void reply_delimiter(ENVELOPE *, ACTION_S *, gf_o_t);
void free_redraft_pos(REDRAFT_POS_S **);
int forward_mime_msg(MAILSTREAM *, long, char *, ENVELOPE *, PART **, void *);
-void forward_delimiter(gf_io_t);
-void reply_forward_header(MAILSTREAM *, long, char *, ENVELOPE *, gf_io_t, char *);
+void forward_delimiter(gf_o_t);
+void reply_forward_header(MAILSTREAM *, long, char *, ENVELOPE *, gf_o_t, char *);
char *forward_subject(ENVELOPE *, int);
BODY *forward_body(MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, int);
char *bounce_msg_body(MAILSTREAM *, long int, char *, char **, char *, ENVELOPE **, BODY **, int *);
int get_body_part_text(MAILSTREAM *, BODY *, long, char *, long,
- gf_io_t, char *, char **, unsigned);
+ gf_o_t, char *, char **, unsigned);
int quote_fold(long, char *, LT_INS_S **, void *);
int twsp_strip(long, char *, LT_INS_S **, void *);
int post_quote_space(long, char *, LT_INS_S **, void *);
@@ -101,8 +101,8 @@ char *get_signature_lit(char *, int, int, int, int);
int sigdashes_are_present(char *);
char *signature_path(char *, char *, size_t);
char *simple_read_remote_file(char *, char *);
-BODY *forward_multi_alt(MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, gf_io_t, int);
-BODY *forward_multi_alt_mixed(MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, gf_io_t, int);
+BODY *forward_multi_alt(MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, gf_o_t, int);
+BODY *forward_multi_alt_mixed(MAILSTREAM *, ENVELOPE *, BODY *, long, char *, void *, gf_o_t, int);
int same_subject(char *, char *s);
void shorten_subject(char *);
diff --git a/pith/save.c b/pith/save.c
index e1c13f7f..e12eb9a8 100644
--- a/pith/save.c
+++ b/pith/save.c
@@ -38,13 +38,13 @@
/*
* Internal prototypes
*/
-int save_ex_replace_body(char *, unsigned long *,BODY *,gf_io_t);
-int save_ex_output_body(MAILSTREAM *, long, char *, BODY *, unsigned long *, gf_io_t);
-int save_ex_mask_types(char *, unsigned long *, gf_io_t);
-int save_ex_explain_body(BODY *, unsigned long *, gf_io_t);
-int save_ex_explain_parts(BODY *, int, unsigned long *, gf_io_t);
-int save_ex_output_line(char *, unsigned long *, gf_io_t);
-int save_ex_output_text(char *, int, unsigned long *, gf_io_t);
+int save_ex_replace_body(char *, unsigned long *,BODY *,gf_o_t);
+int save_ex_output_body(MAILSTREAM *, long, char *, BODY *, unsigned long *, gf_o_t);
+int save_ex_mask_types(char *, unsigned long *, gf_o_t);
+int save_ex_explain_body(BODY *, unsigned long *, gf_o_t);
+int save_ex_explain_parts(BODY *, int, unsigned long *, gf_o_t);
+int save_ex_output_line(char *, unsigned long *, gf_o_t);
+int save_ex_output_text(char *, int, unsigned long *, gf_o_t);
/*
@@ -1092,7 +1092,7 @@ long save_fetch_append_cb(MAILSTREAM *stream, void *data, char **flags,
char section[64];
int failure = 0;
BODY *body;
- gf_io_t pc;
+ gf_o_t pc;
size = 0; /* all bets off, abort sanity test */
gf_set_so_writec(&pc, pkg->so);
@@ -1225,7 +1225,7 @@ save_fetch_append(MAILSTREAM *stream, long int raw, char *sect,
char section[64];
int failure = 0;
BODY *body;
- gf_io_t pc;
+ gf_o_t pc;
size = 0; /* all bets off, abort sanity test */
gf_set_so_writec(&pc, so);
@@ -1393,7 +1393,7 @@ save_fetch_append(MAILSTREAM *stream, long int raw, char *sect,
* *BUT* which is to contain the count of written bytes on exit
*/
int
-save_ex_replace_body(char *hdr, long unsigned int *hlen, struct mail_bodystruct *body, gf_io_t pc)
+save_ex_replace_body(char *hdr, long unsigned int *hlen, struct mail_bodystruct *body, gf_o_t pc)
{
unsigned long len;
@@ -1453,7 +1453,7 @@ save_ex_replace_body(char *hdr, long unsigned int *hlen, struct mail_bodystruct
int
save_ex_output_body(MAILSTREAM *stream, long int raw, char *section,
- struct mail_bodystruct *body, long unsigned int *len, gf_io_t pc)
+ struct mail_bodystruct *body, long unsigned int *len, gf_o_t pc)
{
char *txtp, newsect[128];
unsigned long ilen;
@@ -1565,7 +1565,7 @@ Args: hdr -- pointer to start of a header line
----*/
int
-save_ex_mask_types(char *hdr, long unsigned int *len, gf_io_t pc)
+save_ex_mask_types(char *hdr, long unsigned int *len, gf_o_t pc)
{
char *s = NULL;
@@ -1582,7 +1582,7 @@ save_ex_mask_types(char *hdr, long unsigned int *len, gf_io_t pc)
int
-save_ex_explain_body(struct mail_bodystruct *body, long unsigned int *len, gf_io_t pc)
+save_ex_explain_body(struct mail_bodystruct *body, long unsigned int *len, gf_o_t pc)
{
unsigned long ilen;
char **blurbp;
@@ -1608,7 +1608,7 @@ save_ex_explain_body(struct mail_bodystruct *body, long unsigned int *len, gf_io
int
-save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int *len, gf_io_t pc)
+save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int *len, gf_o_t pc)
{
char *tmp, namebuf[MAILTMPLEN], descbuf[MAILTMPLEN];
unsigned long ilen, tmplen;
@@ -1715,7 +1715,7 @@ save_ex_explain_parts(struct mail_bodystruct *body, int depth, long unsigned int
* line.
*/
int
-save_ex_output_text(char *text, int depth, unsigned long *len, gf_io_t pc)
+save_ex_output_text(char *text, int depth, unsigned long *len, gf_o_t pc)
{
int starti, i, startpos, pos, rv;
char tmp[100]; /* a number bigger than 68, we justify text here. */
@@ -1751,7 +1751,7 @@ save_ex_output_text(char *text, int depth, unsigned long *len, gf_io_t pc)
}
int
-save_ex_output_line(char *line, long unsigned int *len, gf_io_t pc)
+save_ex_output_line(char *line, long unsigned int *len, gf_o_t pc)
{
snprintf(tmp_20k_buf, SIZEOF_20KBUF, " [ %-*.*s ]\015\012", 68, 68, line);
*len = strlen(tmp_20k_buf);
diff --git a/pith/send.c b/pith/send.c
index c8f7f123..e33545ed 100644
--- a/pith/send.c
+++ b/pith/send.c
@@ -319,7 +319,7 @@ redraft_work(MAILSTREAM **streamp, long int cont_msg, ENVELOPE **outgoing,
BODY *b;
PART *part;
PINEFIELD *pf;
- gf_io_t pc;
+ gf_o_t pc;
char *extras, **fields, **values, *p;
char *hdrs[2], *h, *charset;
char **smtp_servers = NULL, **nntp_servers = NULL;
@@ -4242,7 +4242,7 @@ pine_rfc822_output_body(struct mail_bodystruct *body, soutr_t f, void *s)
char tmp[MAILTMPLEN];
int add_trailing_crlf;
LOC_2022_JP ljp;
- gf_io_t gc;
+ gf_i_t gc;
dprint((4, "-- pine_rfc822_output_body: %d\n",
body ? body->type : 0));
diff --git a/pith/smime.c b/pith/smime.c
index d0ee89a1..1e74316e 100644
--- a/pith/smime.c
+++ b/pith/smime.c
@@ -2669,7 +2669,7 @@ static STORE_S*
get_part_contents(long msgno, const char *section)
{
long len;
- gf_io_t pc;
+ gf_o_t pc;
STORE_S *store = NULL;
char *err;
@@ -3651,7 +3651,7 @@ fiddle_smime_message(BODY *b, long msgno)
* Output a string in a distinctive style
*/
void
-gf_puts_uline(char *txt, gf_io_t pc)
+gf_puts_uline(char *txt, gf_o_t pc)
{
pc(TAG_EMBED); pc(TAG_BOLDON);
gf_puts(txt, pc);
diff --git a/pith/smime.h b/pith/smime.h
index fe20cf17..df91fd80 100644
--- a/pith/smime.h
+++ b/pith/smime.h
@@ -44,7 +44,7 @@ int is_pkcs7_body(BODY *b);
int fiddle_smime_message(BODY *b, long msgno);
int encrypt_outgoing_message(METAENV *header, BODY **bodyP);
int sign_outgoing_message(METAENV *header, BODY **bodyP, int dont_detach, BODY **bp);
-void gf_puts_uline(char *txt, gf_io_t pc);
+void gf_puts_uline(char *txt, gf_o_t pc);
PERSONAL_CERT *find_certificate_matching_recip_info(PKCS7_RECIP_INFO *ri);
PERSONAL_CERT *get_personal_certs(char *path);
void smime_init(void);
diff --git a/pith/sort.c b/pith/sort.c
index 4783b682..c5399980 100644
--- a/pith/sort.c
+++ b/pith/sort.c
@@ -227,7 +227,7 @@ sort_folder(MAILSTREAM *stream, MSGNO_S *msgmap, SortOrder new_sort,
clear_index_cache(stream, 0);
if(flags & SRT_VRB){
- int (*sort_func)() = NULL;
+ int (*sort_func)(void) = NULL;
/*
* IMAP sort doesn't give us any way to get progress,
diff --git a/pith/state.h b/pith/state.h
index 5339f069..9f63d46f 100644
--- a/pith/state.h
+++ b/pith/state.h
@@ -360,7 +360,7 @@ struct pine {
* Optional tools Pine Data Engine caller might provide
*/
struct {
- char *(*display_filter)(char *, STORE_S *, gf_io_t, FILTLIST_S *);
+ char *(*display_filter)(char *, STORE_S *, gf_o_t, FILTLIST_S *);
char *(*display_filter_trigger)(BODY *, char *, size_t);
} tools;
diff --git a/pith/takeaddr.c b/pith/takeaddr.c
index 95d67945..630144ba 100644
--- a/pith/takeaddr.c
+++ b/pith/takeaddr.c
@@ -1817,7 +1817,7 @@ grab_addrs_from_body(MAILSTREAM *stream, long int msgno,
#define MAXLINESZ 2000
char line[MAXLINESZ + 1];
STORE_S *so;
- gf_io_t pc;
+ gf_o_t pc;
SourceType src = CharStar;
int added = 0, failure;
char *partno = "1";
diff --git a/pith/text.c b/pith/text.c
index 679a7be7..2a9d20d6 100644
--- a/pith/text.c
+++ b/pith/text.c
@@ -37,7 +37,7 @@
/* internal prototypes */
-int charset_editorial(char *, long, HANDLE_S **, int, int, int, gf_io_t);
+int charset_editorial(char *, long, HANDLE_S **, int, int, int, gf_o_t);
int replace_quotes(long, char *, LT_INS_S **, void *);
void mark_handles_in_line(char *, HANDLE_S **, int);
void clear_html_risk(void);
@@ -79,7 +79,7 @@ Returns: 1 if errors encountered, 0 if everything went A-OK
int
decode_text(ATTACH_S *att,
long int msgno,
- gf_io_t pc,
+ gf_o_t pc,
HANDLE_S **handlesp,
DetachErrStyle style,
int flags)
@@ -229,7 +229,7 @@ decode_text(ATTACH_S *att,
clear_html_risk();
if(flags & FM_DISPLAY){
- gf_io_t warn_pc;
+ gf_o_t warn_pc;
if(handlesp){ /* pass on handles awareness */
opts |= GFHP_HANDLES;
@@ -465,7 +465,7 @@ decode_text(ATTACH_S *att,
*/
int
charset_editorial(char *charset, long int msgno, HANDLE_S **handlesp, int flags,
- int quality, int width, gf_io_t pc)
+ int quality, int width, gf_o_t pc)
{
char *p, color[64], buf[2048];
int i, n;
diff --git a/pith/text.h b/pith/text.h
index 1982ea8d..b64d638b 100644
--- a/pith/text.h
+++ b/pith/text.h
@@ -50,7 +50,7 @@ typedef struct del_q_s {
/* exported prototypes */
-int decode_text(ATTACH_S *, long, gf_io_t, HANDLE_S **, DetachErrStyle, int);
+int decode_text(ATTACH_S *, long, gf_o_t, HANDLE_S **, DetachErrStyle, int);
int translate_utf8_to_2022_jp(long, char *, LT_INS_S **, void *);
int delete_quotes(long, char *, LT_INS_S **, void *);