X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/71458b3b2492943349f7693a46792756d5013c69..cdbb097c8f061dfea2e92f0beafc64fdf50a4eb7:/h/prototypes.h diff --git a/h/prototypes.h b/h/prototypes.h index a4184312..1ff92f64 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -191,6 +191,8 @@ int m_putenv (char *, char *); 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 m_unknown(m_getfld_state_t *, FILE *); int makedir (char *); char *message_id (time_t, int); @@ -361,7 +363,20 @@ int SOprintf (char *, ...); int what_now (char *, int, int, char *, char *, int, struct msgs *, char *, int, char *, int); int WhatNow(int, char **); -int writeBase64aux(FILE *, FILE *); + +/* + * Copy data from one file to another, converting to base64-encoding. + * + * Arguments include: + * + * in - Input filehandle (unencoded data) + * out - Output filename (base64-encoded data) + * crlf - If set, output encoded CRLF for every LF on input. + * + * Returns OK on success, NOTOK otherwise. + */ +int writeBase64aux(FILE *in, FILE *out, int crlf); + int writeBase64 (unsigned char *, size_t, unsigned char *); int writeBase64raw (unsigned char *, size_t, unsigned char *); @@ -370,3 +385,10 @@ int writeBase64raw (unsigned char *, size_t, unsigned char *); */ void init_credentials_file (); int nmh_get_credentials (char *, char *, int, nmh_creds_t); + +/* + * temporary file management + */ +int nmh_init(const char *argv0, int read_context); +int m_unlink(const char *); +void unregister_for_removal(int remove_files);