summaryrefslogtreecommitdiff
path: root/pico
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 /pico
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 'pico')
-rw-r--r--pico/estruct.h2
-rw-r--r--pico/osdep/color.c2
-rw-r--r--pico/osdep/filesys.c2
-rw-r--r--pico/osdep/mswin.h2
-rw-r--r--pico/osdep/signals.h2
-rw-r--r--pico/osdep/terminal.c2
-rw-r--r--pico/pico.c2
-rw-r--r--pico/pico.h99
8 files changed, 60 insertions, 53 deletions
diff --git a/pico/estruct.h b/pico/estruct.h
index 4d0287e6..c6255760 100644
--- a/pico/estruct.h
+++ b/pico/estruct.h
@@ -317,7 +317,7 @@ typedef struct {
typedef struct {
UCS k_code; /* Key code */
- int (*k_fp)(); /* Routine to handle it */
+ int (*k_fp)(int, int); /* Routine to handle it */
} KEYTAB;
/* structure used for key menu painting */
diff --git a/pico/osdep/color.c b/pico/osdep/color.c
index 9b9f40d6..be2fd048 100644
--- a/pico/osdep/color.c
+++ b/pico/osdep/color.c
@@ -88,7 +88,7 @@ void free_color_name_list(struct color_name_list **nl);
#if HAS_TERMINFO
extern char *tparm(char *, ...);
#endif
-extern char *tgoto();
+extern char *tgoto(char *, int, int);
void tinitcolor(void);
int tfgcolor(int);
int tbgcolor(int);
diff --git a/pico/osdep/filesys.c b/pico/osdep/filesys.c
index 05be5fae..6b9784fa 100644
--- a/pico/osdep/filesys.c
+++ b/pico/osdep/filesys.c
@@ -62,7 +62,7 @@ fexist(char *file,
#ifndef _WINDOWS
struct stat sbuf;
int rv;
- int (*stat_f)() = (m && *m == 't') ? our_lstat : our_stat;
+ int (*stat_f)(char *, struct stat *) = (m && *m == 't') ? our_lstat : our_stat;
if(l)
*l = (off_t)0;
diff --git a/pico/osdep/mswin.h b/pico/osdep/mswin.h
index f76821dd..ec85cc7c 100644
--- a/pico/osdep/mswin.h
+++ b/pico/osdep/mswin.h
@@ -318,8 +318,6 @@ int mswin_caninput(void);
void mswin_beginupdate(void);
void mswin_endupdate(void);
int mswin_sethelptextcallback(cbstr_t);
-int strucmp(char *, char *);
-int struncmp(char *, char *, int);
#ifdef MSC_MALLOC
/*
diff --git a/pico/osdep/signals.h b/pico/osdep/signals.h
index 2ea33cc4..1ef6dc80 100644
--- a/pico/osdep/signals.h
+++ b/pico/osdep/signals.h
@@ -55,7 +55,7 @@ RETSIGTYPE winch_handler(int);
#endif
#ifdef POSIX_SIGNALS
-void (*posix_signal(int, RETSIGTYPE (*)()))(int);
+void (*posix_signal(int, RETSIGTYPE (*)(int)))(int);
int posix_sigunblock(int);
#endif
diff --git a/pico/osdep/terminal.c b/pico/osdep/terminal.c
index 74761212..6150c6fc 100644
--- a/pico/osdep/terminal.c
+++ b/pico/osdep/terminal.c
@@ -75,7 +75,7 @@ static void setup_dflt_esc_seq(void);
static void tinfoinsert(UCS);
static void tinfodelete(void);
-extern int tput();
+extern int tput(char);
extern int tputs(char *, int, int (*)(int));
extern char *tgoto(char *, int, int);
extern char *tigetstr (char *);
diff --git a/pico/pico.c b/pico/pico.c
index bb1376fa..639deccc 100644
--- a/pico/pico.c
+++ b/pico/pico.c
@@ -1456,7 +1456,7 @@ mouse_get_last(mousehandler_t *f, MOUSEPRESS *mp)
* register_key - register the given keystroke to accept mouse events
*/
void
-register_key(int i, unsigned rval, char *label, void (*label_printer)(),
+register_key(int i, unsigned rval, char *label, void (*label_printer)(int, MENUITEM *),
int row, int col, int len, COLOR_PAIR *kn, COLOR_PAIR *kl)
{
if(i > 11)
diff --git a/pico/pico.h b/pico/pico.h
index 907efe36..69cd8ba3 100644
--- a/pico/pico.h
+++ b/pico/pico.h
@@ -68,6 +68,24 @@ struct hdr_line {
/* must be the same as HelpType in pith/helptext.h */
#define HELP_T char **
+/*
+ * Structure to pass as arg to builders.
+ *
+ * me -- A pointer to the bldr_private data for the entry currently
+ * being edited.
+ * tptr -- A malloc'd copy of the displayed text for the affected_entry
+ * pointed to by the aff argument.
+ * aff -- A pointer to the bldr_private data for the affected_entry (the
+ * entry that this entry affects).
+ * next -- The next affected_entry in the list. For example, the Lcc entry
+ * affects the To entry which affects the Fcc entry.
+ */
+typedef struct bld_arg {
+ void **me;
+ char *tptr;
+ void **aff;
+ struct bld_arg *next;
+} BUILDER_ARG;
/*
* This structure controls the header line items on the screen. An
@@ -83,13 +101,16 @@ struct headerentry {
int prwid; /* prompt width on screen */
int maxlen;
char **realaddr;
- int (*builder)(); /* Function to verify/canonicalize val */
+ /* Function to verify/canonicalize val */
+ int (*builder)(char *, char **, char **, BUILDER_ARG *, int *);
struct headerentry *affected_entry, *next_affected;
/* entry builder's 4th arg affects */
- char *(*selector)(); /* Browser for possible values */
+ /* Browser for possible values */
+ char *(*selector)(char **);
char *key_label; /* Key label for key to call browser */
- char *(*fileedit)(); /* Editor for file named in header */
- int (*nickcmpl)(); /* routine that helps with nickname completion */
+ char *(*fileedit)(char *); /* Editor for file named in header */
+ /* routine that helps with nickname completion */
+ int (*nickcmpl)(char *, char **, int, unsigned int);
unsigned display_it:1; /* field is to be displayed by default */
unsigned break_on_comma:1; /* Field breaks on commas */
unsigned is_attach:1; /* Special case field for attachments */
@@ -108,27 +129,6 @@ struct headerentry {
struct hdr_line *hd_text;
};
-
-/*
- * Structure to pass as arg to builders.
- *
- * me -- A pointer to the bldr_private data for the entry currently
- * being edited.
- * tptr -- A malloc'd copy of the displayed text for the affected_entry
- * pointed to by the aff argument.
- * aff -- A pointer to the bldr_private data for the affected_entry (the
- * entry that this entry affects).
- * next -- The next affected_entry in the list. For example, the Lcc entry
- * affects the To entry which affects the Fcc entry.
- */
-typedef struct bld_arg {
- void **me;
- char *tptr;
- void **aff;
- struct bld_arg *next;
-} BUILDER_ARG;
-
-
/*
* structure to keep track of header display
*/
@@ -213,24 +213,33 @@ typedef struct pico_struct {
/* If we had this to do over, it would probably be one giant bitmap */
unsigned always_spell_check:1; /* always spell-checking upon quit */
unsigned strip_ws_before_send:1; /* don't default strip bc of flowed */
- unsigned allow_flowed_text:1; /* clean text when done to keep flowed */
- int (*helper)(); /* Pine's help function */
- int (*showmsg)(); /* Pine's display_message */
- UCS (*suspend)(); /* Pine's suspend */
- void (*keybinput)(); /* Pine's keyboard input indicator */
- int (*tty_fix)(); /* Let Pine fix tty state */
- long (*newmail)(); /* Pine's report_new_mail */
- long (*msgntext)(); /* callback to get msg n's text */
- int (*upload)(); /* callback to rcv uploaded text */
- char *(*ckptdir)(); /* callback for checkpoint file dir */
- int (*exittest)(); /* callback to verify exit request */
- char *(*canceltest)(); /* callback to verify cancel request */
- int (*mimetype)(); /* callback to display mime type */
- int (*expander)(); /* callback to expand address lists */
- int (*user_says_noflow)(); /* callback to tell us we're not flowing */
- void (*resize)(); /* callback handling screen resize */
- void (*winch_cleanup)(); /* callback handling screen resize */
- void (*newthread)(); /* callback to create new thread */
+ unsigned allow_flowed_text:1; /* clean text when done to keep flowed */
+ /* Pine's help function */
+ int (*helper)(HELP_T, char *, int);
+ int (*showmsg)(UCS); /* Pine's display_message */
+ UCS (*suspend)(void); /* Pine's suspend */
+ void (*keybinput)(void); /* Pine's keyboard input indicator */
+ int (*tty_fix)(int); /* Let Pine fix tty state */
+ long (*newmail)(int, int); /* Pine's report_new_mail */
+ /* callback to get msg n's text */
+ long (*msgntext)(long, int (*)(int));
+ /* callback to rcv uploaded text */
+ int (*upload)(char *, size_t, long *);
+ /* callback for checkpoint file dir */
+ char *(*ckptdir)(char *, size_t);
+ /* callback to verify exit request */
+ int (*exittest)(struct headerentry *, void (*)(void), int, char **);
+ /* callback to verify cancel request */
+ char *(*canceltest)(void(*)(void));
+ int (*mimetype)(char *); /* callback to display mime type */
+ /* callback to expand address lists */
+ int (*expander)(struct headerentry *, char ***);
+ int (*user_says_noflow)(void); /* callback to tell us we're not flowing */
+ /* callback handling screen resize */
+ void (*resize)(void);
+ /* callback handling screen resize */
+ void (*winch_cleanup)(void);
+ void (*newthread)(void); /* callback to create new thread */
int arm_winch_cleanup; /* do the winch_cleanup if resized */
HELP_T search_help;
HELP_T ins_help;
@@ -336,7 +345,7 @@ typedef struct menuitem {
MPOINT br; /* bottom-right corner of active area */
MPOINT lbl; /* where the label starts */
char *label;
- void (*label_hiliter)();
+ void (*label_hiliter)(int, struct menuitem *);
COLOR_PAIR *kncp; /* key name color pair */
COLOR_PAIR *klcp; /* key label color pair */
struct menuitem *next;
@@ -453,7 +462,7 @@ void clear_mfunc(mousehandler_t);
unsigned long mouse_in_content(unsigned long, int, int, int, int);
unsigned long mouse_in_pico(unsigned long, int, int, int, int);
void mouse_get_last(mousehandler_t *, MOUSEPRESS *);
-void register_key(int, unsigned, char *, void (*)(),
+void register_key(int, unsigned, char *, void (*)(int, MENUITEM *),
int, int, int, COLOR_PAIR *, COLOR_PAIR *);
int mouse_on_key(int, int);
#endif /* MOUSE */