]> granicus.if.org Git - neomutt/commitdiff
add consts
authorRichard Russon <rich@flatcap.org>
Mon, 10 Dec 2018 16:23:53 +0000 (16:23 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 10 Dec 2018 18:13:39 +0000 (18:13 +0000)
18 files changed:
curs_lib.c
curs_lib.h
email/parse.c
email/parse.h
email/tags.c
email/tags.h
mutt/charset.c
mutt/charset.h
mutt/date.c
mutt/date.h
mutt/file.c
mutt/file.h
mutt/history.c
mutt/history.h
rfc1524.c
rfc1524.h
send.c
send.h

index 06e69463c396031b36331ad826822b2ab722b69f..cfc0111086f21f11c8842f6738e632bd5e0f4b5f 100644 (file)
@@ -289,7 +289,7 @@ int mutt_get_field_full(const char *field, char *buf, size_t buflen,
  * @retval 0  Selection made
  * @retval -1 Aborted
  */
-int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags)
+int mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, int flags)
 {
   int rc;
 
index 15173c1eb52e1975d9d6860f31397991bf2b1e4f..999a1395149a8f9bad09759f0093e6f0df88eef3 100644 (file)
@@ -58,7 +58,7 @@ void         mutt_format_s_tree(char *buf, size_t buflen, const char *prec, cons
 void         mutt_getch_timeout(int delay);
 struct Event mutt_getch(void);
 int          mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, bool multiple, char ***files, int *numfiles);
-int          mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
+int          mutt_get_field_unbuffered(const char *msg, char *buf, size_t buflen, int flags);
 int          mutt_multi_choice(const char *prompt, const char *letters);
 void         mutt_need_hard_redraw(void);
 void         mutt_paddstr(int n, const char *s);
index 204ec593de05b44c049930847345bd9dd53619cc..473785b257d083ddce46c85ad7a25887838fd406 100644 (file)
@@ -226,7 +226,7 @@ static void parse_references(struct ListHead *head, char *s)
  * @param s  Language string
  * @param ct Body of the email
  */
-static void parse_content_language(char *s, struct Body *ct)
+static void parse_content_language(const char *s, struct Body *ct)
 {
   if (!s || !ct)
     return;
@@ -390,7 +390,7 @@ int mutt_check_encoding(const char *c)
  *
  * e.g. parse a string "inline" and set #DISP_INLINE.
  */
-void mutt_parse_content_type(char *s, struct Body *ct)
+void mutt_parse_content_type(const char *s, struct Body *ct)
 {
   FREE(&ct->subtype);
   mutt_param_free(&ct->parameter);
index 90b4c75c22da289faaf80db6c75cfccf2b024ab1..ec2615f16382e86db4a876ef8c9ff20084522cc9 100644 (file)
@@ -35,7 +35,7 @@ int              mutt_check_mime_type(const char *s);
 char *           mutt_extract_message_id(const char *s, const char **saveptr);
 bool             mutt_is_message_type(int type, const char *subtype);
 bool             mutt_matches_ignore(const char *s);
-void             mutt_parse_content_type(char *s, struct Body *ct);
+void             mutt_parse_content_type(const char *s, struct Body *ct);
 struct Body *    mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest);
 void             mutt_parse_part(FILE *fp, struct Body *b);
 struct Body *    mutt_read_mime_header(FILE *fp, bool digest);
index ef6eabb0b48946485bf70128847b976f5a9af6e8..f72765039ea480177340e263f3fa1cc61e5b364d 100644 (file)
@@ -49,7 +49,7 @@ struct Hash *TagTransforms; /**< Lookup table of alternative tag names */
  * Return a new allocated string containing tags separated by space
  */
 static char *driver_tags_getter(struct TagHead *head, bool show_hidden,
-                                bool show_transformed, char *filter)
+                                bool show_transformed, const char *filter)
 {
   if (!head)
     return NULL;
@@ -174,7 +174,7 @@ char *driver_tags_get_with_hidden(struct TagHead *head)
  * Return a new allocated string containing all tags separated by space even
  * the hiddens.
  */
-char *driver_tags_get_transformed_for(char *name, struct TagHead *head)
+char *driver_tags_get_transformed_for(const char *name, struct TagHead *head)
 {
   return driver_tags_getter(head, true, true, name);
 }
index 25a144e4e4d61a29da1bde86b8013fd78c0062a8..c29778556714cf121c5cf7045888ff72554ff34e 100644 (file)
@@ -49,7 +49,7 @@ STAILQ_HEAD(TagHead, TagNode);
 void  driver_tags_free(struct TagHead *head);
 char *driver_tags_get(struct TagHead *head);
 char *driver_tags_get_transformed(struct TagHead *head);
-char *driver_tags_get_transformed_for(char *name, struct TagHead *head);
+char *driver_tags_get_transformed_for(const char *name, struct TagHead *head);
 char *driver_tags_get_with_hidden(struct TagHead *head);
 bool  driver_tags_replace(struct TagHead *head, char *tags);
 
index bd8ae23a2e8469605d1044dd04b85dee2c350cb1..daed6dd71408e31b5c6ae11b574f09aeb0469828 100644 (file)
@@ -984,7 +984,7 @@ void mutt_ch_set_charset(const char *charset)
  * @retval ptr  Best performing charset
  * @retval NULL None could be found
  */
-char *mutt_ch_choose(const char *fromcode, const char *charsets, char *u,
+char *mutt_ch_choose(const char *fromcode, const char *charsets, const char *u,
                      size_t ulen, char **d, size_t *dlen)
 {
   char *e = NULL, *tocode = NULL;
index abb605b01e60839f12e1ccd780f182b567370599..5fbe72d5f65e1ac852af08ad0080c2ddce899319 100644 (file)
@@ -86,7 +86,7 @@ void             mutt_ch_canonical_charset(char *buf, size_t buflen, const char
 const char *     mutt_ch_charset_lookup(const char *chs);
 int              mutt_ch_check(const char *s, size_t slen, const char *from, const char *to);
 bool             mutt_ch_check_charset(const char *cs, bool strict);
-char *           mutt_ch_choose(const char *fromcode, const char *charsets, char *u, size_t ulen, char **d, size_t *dlen);
+char *           mutt_ch_choose(const char *fromcode, const char *charsets, const char *u, size_t ulen, char **d, size_t *dlen);
 bool             mutt_ch_chscmp(const char *cs1, const char *cs2);
 int              mutt_ch_convert_nonmime_string(char **ps);
 int              mutt_ch_convert_string(char **ps, const char *from, const char *to, int flags);
index e09680b5a1e86936de87453db31ab92b0019c86e..c517cd976bf329fbcd931d9a549cfb7ba34bdafa 100644 (file)
@@ -636,7 +636,7 @@ int mutt_date_make_tls(char *buf, size_t buflen, time_t timestamp)
  * @retval num Unix time
  * @retval 0   Error
  */
-time_t mutt_date_parse_imap(char *s)
+time_t mutt_date_parse_imap(const char *s)
 {
   struct tm t;
   time_t tz;
index e40420b67ca7fe92c4d6a7285e233ccbde8038c0..1c47ce06cba576b4ae5d74af2f5df7e932def13b 100644 (file)
@@ -47,6 +47,6 @@ time_t mutt_date_make_time(struct tm *t, int local);
 int    mutt_date_make_tls(char *buf, size_t buflen, time_t timestamp);
 void   mutt_date_normalize_time(struct tm *tm);
 time_t mutt_date_parse_date(const char *s, struct Tz *tz_out);
-time_t mutt_date_parse_imap(char *s);
+time_t mutt_date_parse_imap(const char *s);
 
 #endif /* MUTT_LIB_DATE_H */
index a5373ead941c0139f4be9e894950b6458ac16ae0..ab187a644d53b9bdf53a245292578c6f75d1cc77 100644 (file)
@@ -1237,7 +1237,7 @@ void mutt_file_unlink_empty(const char *path)
  * @note on access(2) use No dangling symlink problems here due to
  * mutt_file_fopen().
  */
-int mutt_file_rename(char *oldfile, char *newfile)
+int mutt_file_rename(const char *oldfile, const char *newfile)
 {
   FILE *ofp = NULL, *nfp = NULL;
 
index 02d09b97679d988483816ee3a9d9fef697716cdb..7cb6519b6ac4caa0aba3ddcad81f45fb0ec0a55a 100644 (file)
@@ -105,7 +105,7 @@ int         mutt_file_open(const char *path, int flags);
 size_t      mutt_file_quote_filename(const char *filename, char *buf, size_t buflen);
 char *      mutt_file_read_keyword(const char *file, char *buf, size_t buflen);
 char *      mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, int flags);
-int         mutt_file_rename(char *oldfile, char *newfile);
+int         mutt_file_rename(const char *oldfile, const char *newfile);
 int         mutt_file_rmtree(const char *path);
 int         mutt_file_safe_rename(const char *src, const char *target);
 void        mutt_file_sanitize_filename(char *f, bool slash);
index ae88e58f94b297187c55072ee1f8315da5cdd45c..724bd634008b9288d8b101f6eb97b63463cd6a14 100644 (file)
@@ -410,7 +410,7 @@ static void remove_history_dups(enum HistoryClass hclass, const char *str)
  * @param[out] matches    All the matching lines
  * @retval num Matches found
  */
-int mutt_hist_search(char *search_buf, enum HistoryClass hclass, char **matches)
+int mutt_hist_search(const char *search_buf, enum HistoryClass hclass, char **matches)
 {
   struct History *h = get_history(hclass);
   int match_count = 0, cur;
index b001cd5627d02261284f5e057b380bb6adcd5c96..89f654a017c1b7cd437317cfd4657d5f6d9a19df 100644 (file)
@@ -59,6 +59,6 @@ char *mutt_hist_prev(enum HistoryClass hclass);
 void  mutt_hist_read_file(void);
 void  mutt_hist_reset_state(enum HistoryClass hclass);
 void  mutt_hist_save_scratch(enum HistoryClass hclass, const char *str);
-int   mutt_hist_search(char *search_buf, enum HistoryClass hclass, char **matches);
+int   mutt_hist_search(const char *search_buf, enum HistoryClass hclass, char **matches);
 
 #endif /* MUTT_LIB_HISTORY_H */
index 7394fc6e8fd78431ce13a962ce2ffcab81315bff..af6de0ab7a971d21cf3b14d06e9ea41df4575b1a 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -69,7 +69,7 @@ bool MailcapSanitize; ///< Config: Restrict the possible characters in mailcap e
  * %n is the integer number of sub-parts in the multipart
  * %F is "content-type filename" repeated for each sub-part
  */
-int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen)
+int rfc1524_expand_command(struct Body *a, const char *filename, const char *type, char *command, int clen)
 {
   int x = 0, y = 0;
   int needspipe = true;
@@ -501,7 +501,7 @@ int rfc1524_mailcap_lookup(struct Body *a, char *type,
  * for a "%s". If none is found, the nametemplate is used as the template for
  * newfile.  The first path component of the nametemplate and oldfile are ignored.
  */
-int rfc1524_expand_filename(char *nametemplate, char *oldfile, char *newfile, size_t nflen)
+int rfc1524_expand_filename(const char *nametemplate, const char *oldfile, char *newfile, size_t nflen)
 {
   int i, j, k, ps;
   char *s = NULL;
index 58e6ba5f934ed52ffe429a1f4b1419e8f6f0b410..c81ca14a69fa8e038d56098d43017a18873e1796 100644 (file)
--- a/rfc1524.h
+++ b/rfc1524.h
@@ -51,8 +51,8 @@ struct Rfc1524MailcapEntry
 
 struct Rfc1524MailcapEntry *rfc1524_new_entry(void);
 void rfc1524_free_entry(struct Rfc1524MailcapEntry **entry);
-int rfc1524_expand_command(struct Body *a, char *filename, char *type, char *command, int clen);
-int rfc1524_expand_filename(char *nametemplate, char *oldfile, char *newfile, size_t nflen);
+int rfc1524_expand_command(struct Body *a, const char *filename, const char *type, char *command, int clen);
+int rfc1524_expand_filename(const char *nametemplate, const char *oldfile, char *newfile, size_t nflen);
 int rfc1524_mailcap_lookup(struct Body *a, char *type, struct Rfc1524MailcapEntry *entry, int opt);
 
 #endif /* MUTT_RFC1524_H */
diff --git a/send.c b/send.c
index 10b9f18aa8be79258736ce1529ab364b8300a8e7..c3cf180f9b848273d2a0ee917b59b67266283ab5 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1527,7 +1527,7 @@ static bool search_attach_keyword(char *filename)
  * @retval -1 Message was aborted or an error occurred
  * @retval  1 Message was postponed
  */
-int ci_send_message(int flags, struct Email *msg, char *tempfile,
+int ci_send_message(int flags, struct Email *msg, const char *tempfile,
                     struct Context *ctx, struct Email *cur)
 {
   char buf[LONG_STRING];
diff --git a/send.h b/send.h
index 0d2102c87d6b3b31f8666acc65f8be44375e8f53..50e3d067a25c3f52e378ef685d0f59121adc6f88 100644 (file)
--- a/send.h
+++ b/send.h
@@ -94,7 +94,7 @@ extern bool          UseFrom;
 #define SEND_TO_SENDER      (1 << 12)
 #define SEND_NEWS           (1 << 13)
 
-int             ci_send_message(int flags, struct Email *msg, char *tempfile, struct Context *ctx, struct Email *cur);
+int             ci_send_message(int flags, struct Email *msg, const char *tempfile, struct Context *ctx, struct Email *cur);
 void            mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv);
 struct Address *mutt_default_from(void);
 void            mutt_encode_descriptions(struct Body *b, bool recurse);