]> diplodocus.org Git - nmh/blobdiff - h/prototypes.h
mhmisc.c: Indent with "%*s" rather than "%*.*s".
[nmh] / h / prototypes.h
index 74bf725558e162d0fe2e3b3487cf6cb64732c139..7cce0ba75048431f16ec7a6ccd20a1e5918774a8 100644 (file)
@@ -16,11 +16,11 @@ char *etcpath(char *);
 struct msgs_array;
 
 void add_profile_entry (const char *, const char *);
-void inform(char *fmt, ...);
-void adios (const char *, const char *, ...) NORETURN;
-void admonish (char *, char *, ...);
-void advertise (const char *, char *, const char *, va_list);
-void advise (const char *, const char *, ...);
+void inform(char *fmt, ...) CHECK_PRINTF(1, 2);
+void adios (const char *, const char *, ...) CHECK_PRINTF(2, 3) NORETURN;
+void admonish (char *, char *, ...) CHECK_PRINTF(2, 3);
+void advertise (const char *, char *, const char *, va_list) CHECK_PRINTF(3, 0);
+void advise (const char *, const char *, ...) CHECK_PRINTF(2, 3);
 char **argsplit (char *, char **, int *);
 void argsplit_msgarg (struct msgs_array *, char *, char **);
 void argsplit_insert (struct msgs_array *, char *, char **);
@@ -59,7 +59,6 @@ char *cpytrim (const char *);
 char *rtrim (char *);
 int decode_rfc2047 (char *, char *, size_t);
 void discard (FILE *);
-char *upcase (const char *);
 
 /*
  * Decode two characters into their quoted-printable representation.
@@ -222,85 +221,23 @@ char *get_term_stringparm(char *capability, long arg1, long arg2);
  */
 int get_term_numcap(char *capability);
 
-/*
- * Lock open/close routines.
- *
- * The lk[f]opendata() functions are designed to open "data" files (anything
- * not a mail spool file) using the locking mechanism configured for data
- * files.  The lk[f]openspool() functions are for opening the mail spool
- * file, which will use the locking algorithm configured for the mail
- * spool.
- *
- * Files opened for reading are locked with a read lock (if possible by
- * the underlying lock mechanism), files opened for writing are locked
- * using an exclusive lock.  The int * argument is used to indicate failure
- * to acquire a lock.
- */
-int lkclosedata(int, const char *);
-int lkclosespool(int, const char *);
-int lkfclosedata(FILE *, const char *);
-int lkfclosespool(FILE *, const char *);
-FILE *lkfopendata(const char *, const char *, int *);
-int lkopendata(const char *, int, mode_t, int *);
-FILE *lkfopenspool(const char *, const char *);
-int lkopenspool(const char *, int, mode_t, int *);
 int m_atoi (char *);
 char *m_backup (const char *);
 int m_convert (struct msgs *, char *);
 char *m_draft (char *, char *, int, int *);
+
+m_getfld_state_t m_getfld_state_init(FILE *iob);
 void m_getfld_state_reset (m_getfld_state_t *);
 void m_getfld_state_destroy (m_getfld_state_t *);
 void m_getfld_track_filepos (m_getfld_state_t *, FILE *);
+void m_getfld_track_filepos2(m_getfld_state_t *);
 int m_getfld (m_getfld_state_t *, char[NAMESZ], char *, int *, FILE *);
+int m_getfld2(m_getfld_state_t *, char[NAMESZ], char *, int *);
 int m_gmprot (void);
-char *m_maildir (char *);
-char *m_mailpath (char *);
 char *m_name (int);
-int m_rand (unsigned char *, size_t);
-char *m_mktemp(const char *, int *, FILE **);
-char *m_mktemp2(const char *, const char *, int *, FILE **);
-char *m_mktemps(const char *pfx, const char *suffix, int *, FILE **);
-char *get_temp_dir(void);
-
-/*
- * Create a subprocess and redirect our standard output to it.
- *
- * Arguments are:
- *
- * name                - Name of process to create
- * savestdout  - If true, will save the current stdout file descriptor and
- *               m_pclose() will close it at the appropriate time.
- */
-void m_popen(char *name, int savestdout);
-
-/*
- * Wait for the last process opened by m_popen().
- */
-void m_pclose(void);
 
 void m_unknown(m_getfld_state_t *, FILE *);
-int makedir (const char *);
-char *message_id (time_t, int);
-
-/*
- * Return a MIME content-type string for the specified file.
- *
- * If the system supports it, will use the "file" command to determine
- * the appropriate content-type.  Otherwise it will try to determine the
- * content-type from the suffix.  If that fails, the file will be scanned
- * and either assigned a MIME type of text/plain or application/octet-stream
- * depending if binary content is present.
- *
- * Arguments:
- *
- * filename    - The name of the file to determine the MIME type of.
- *
- * Returns a pointer to a content-type string (which may include MIME
- * parameters, such as charset).  Returns a NULL if it cannot determine
- * the MIME type of the file.  Returns allocated storage that must be
- * free'd.
- */
-char *mime_type(const char *filename);
+void m_unknown2(m_getfld_state_t *);
 
 /*
  * Clear the screen, using the appropriate entry from the terminfo database
@@ -317,7 +254,6 @@ void print_intro (FILE *, int);
 void print_sw (const char *, const struct swit *, char *, FILE *);
 void print_version (char *);
 void push (void);
-char *pwd (void);
 char *r1bindex(char *, int);
 void readconfig (struct node **, FILE *, const char *, int);
 int refile (char **, char *);
@@ -341,7 +277,6 @@ void ruserpass (const char *host, char **aname, char **apass, int flags);
 int remdir (char *);
 void scan_detect_mbox_style (FILE *);
 void scan_finished(void);
-void scan_reset_m_getfld_state ();
 int seq_addmsg (struct msgs *, char *, int, int, int);
 int seq_addsel (struct msgs *, char *, int, int);
 char *seq_bits (struct msgs *);
@@ -415,22 +350,6 @@ int ssequal (const char *, const char *);
 int stringdex (char *, char *);
 char *trimcpy (char *);
 
-/*
- * Remove quotes and quoted-pair sequences from RFC-5322 atoms.
- *
- * Currently the actual algorithm is simpler than it technically should
- * be: any quotes are simply eaten, unless they're preceded by the escape
- * character (\).  This seems to be sufficient for our needs for now.
- *
- * Arguments:
- *
- * input       - The input string
- * output      - The output string; is assumed to have at least as much
- *               room as the input string.  At worst the output string will
- *               be the same size as the input string; it might be smaller.
- *
- */
-void unquote_string(const char *input, char *output);
 int uprf (const char *, const char *);
 int vfgets (FILE *, char **);
 
@@ -548,20 +467,3 @@ const char *nmh_cred_get_password(nmh_creds_t creds);
  * Free an allocated nmh_creds structure.
  */
 void nmh_credentials_free(nmh_creds_t creds);
-
-/*
- * program initialization
- *
- * argv0        - argv[0], presumably the program name
- * read_context - 0: don't read context
- *              - 1: read context, check nmh version, and issue warning message
- *                   if non-existent or old
- *              - 2: read context, don't check nmh version
- */
-int nmh_init(const char *argv0, int read_context);
-
-/*
- * temporary file management
- */
-int m_unlink(const char *);
-void unregister_for_removal(int remove_files);