~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002101854

« back to all changes in this revision

Viewing changes to lib.h

Tags: 1.5.18-6
* Grab from upstream:
  + Guard idata->mailbox read in imap_mailbox_state.
    The bug happens when a user has more than a imap mailbox, when
    he/she browses through them mutt will segfault.
    (Closes: #462266, #513230, #514309. Mutt: #3057)

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
# include <signal.h>
39
39
 
40
40
# ifndef _POSIX_PATH_MAX
41
 
#  include <posix1_lim.h>
 
41
#  include <limits.h>
42
42
# endif
43
43
 
44
44
# ifdef ENABLE_NLS
84
84
# define MAX(a,b) ((a) < (b) ? (b) : (a))
85
85
# define MIN(a,b) ((a) < (b) ? (a) : (b))
86
86
 
 
87
/* For mutt_format_string() justifications */
 
88
/* Making left 0 and center -1 is of course completely nonsensical, but
 
89
 * it retains compatibility for any patches that call mutt_format_string.
 
90
 * Once patches are updated to use FMT_*, these can be made sane. */
 
91
#define FMT_LEFT        0
 
92
#define FMT_RIGHT       1
 
93
#define FMT_CENTER      -1
87
94
 
88
95
#define FOREVER while (1)
89
96
 
98
105
 * A non-mutt "implementation" (ahem) can be found in extlib.c.
99
106
 */
100
107
 
 
108
 
101
109
# ifndef _EXTLIB_C
102
110
extern void (*mutt_error) (const char *, ...);
103
111
# endif
 
112
 
 
113
# ifdef _LIB_C
 
114
#  define MUTT_LIB_WHERE 
 
115
#  define MUTT_LIB_INITVAL(x) = x
 
116
# else
 
117
#  define MUTT_LIB_WHERE extern
 
118
#  define MUTT_LIB_INITVAL(x)
 
119
# endif
 
120
 
104
121
void mutt_exit (int);
105
122
 
 
123
 
 
124
# ifdef DEBUG
 
125
 
 
126
MUTT_LIB_WHERE FILE *debugfile MUTT_LIB_INITVAL(0);
 
127
MUTT_LIB_WHERE int debuglevel MUTT_LIB_INITVAL(0);
 
128
 
 
129
#  define dprint(N,X) do { if(debuglevel>=N && debugfile) fprintf X; } while (0)
 
130
 
 
131
# else
 
132
 
 
133
#  define dprint(N,X)
 
134
 
 
135
# endif
 
136
 
 
137
 
106
138
/* Exit values used in send_msg() */
107
139
#define S_ERR 127
108
140
#define S_BKG 126
111
143
 
112
144
FILE *safe_fopen (const char *, const char *);
113
145
 
 
146
char *mutt_concatn_path (char *, size_t, const char *, size_t, const char *, size_t);
114
147
char *mutt_concat_path (char *, const char *, const char *, size_t);
115
148
char *mutt_read_line (char *, size_t *, FILE *, int *);
116
149
char *mutt_skip_whitespace (char *);
124
157
const char *mutt_stristr (const char *, const char *);
125
158
const char *mutt_basename (const char *);
126
159
 
 
160
int compare_stat (struct stat *, struct stat *);
127
161
int mutt_copy_stream (FILE *, FILE *);
128
162
int mutt_copy_bytes (FILE *, FILE *, size_t);
129
163
int mutt_rx_sanitize_string (char *, size_t, const char *);
133
167
int mutt_strncmp (const char *, const char *, size_t);
134
168
int mutt_strcoll (const char *, const char *);
135
169
int safe_open (const char *, int);
 
170
int safe_rename (const char *, const char *);
136
171
int safe_symlink (const char *, const char *);
137
 
int safe_rename (const char *, const char *);
138
172
int safe_fclose (FILE **);
139
173
 
140
174
size_t mutt_quote_filename (char *, size_t, const char *);