h/tws.h \
h/utils.h \
mts/smtp/smtp.h \
+ sbr/base64.h \
sbr/ctype-checked.h \
sbr/lock_file.h \
sbr/m_maildir.h \
int, struct msgs *, char *, int, char *, int);
int WhatNow(int, char **) NORETURN;
-/* Includes trailing NUL */
-
-#define BASE64SIZE(x) ((((x + 2) / 3) * 4) + 1)
-
-/*
- * 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 (const unsigned char *, size_t, unsigned char *);
-int writeBase64raw (const unsigned char *, size_t, unsigned char *);
-
-/*
- * encoded - the string to be decoded
- * decoded - the decoded bytes
- * len - number of decoded bytes
- * skip-crs - non-zero for text content, and for which CR's should be
- * skipped
- * digest - for an MD5 digest, it can be null
- */
-int decodeBase64 (const char *encoded, unsigned char **decoded, size_t *len,
- int skip_crs, unsigned char *digest);
-
-void hexify (const unsigned char *, size_t, char **);
-
/*
* credentials management
*/
#include <h/netsec.h>
#include <sys/socket.h>
+#include "../../sbr/base64.h"
/*
* This module implements an interface to SendMail very similar
static const char nib2b64[0x40+1] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+/*
+ * 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)
{
/*
* Decode a base64 string. The result, decoded, must be freed by the caller.
- * See description of arguments with declaration in h/prototypes.h.
+ *
+ * encoded - the string to be decoded
+ * decoded - the decoded bytes
+ * len - number of decoded bytes
+ * skip-crs - non-zero for text content, and for which CR's should be
+ * skipped
+ * digest - for an MD5 digest, it can be null
*/
int
decodeBase64 (const char *encoded, unsigned char **decoded, size_t *len,
--- /dev/null
+/* base64.h -- routines for converting to base64
+ *
+ * This code is Copyright (c) 2017, by the authors of nmh. See the
+ * COPYRIGHT file in the root directory of the nmh distribution for
+ * complete copyright information.
+ */
+
+int writeBase64aux(FILE *, FILE *, int);
+int writeBase64(const unsigned char *, size_t, unsigned char *);
+int writeBase64raw(const unsigned char *, size_t, unsigned char *);
+int decodeBase64(const char *, unsigned char **, size_t *, int, unsigned char *);
+void hexify(const unsigned char *, size_t, char **);
+
+/* Includes trailing NUL. */
+#define BASE64SIZE(x) ((((x + 2) / 3) * 4) + 1)
#include <h/mhparse.h>
#include <h/addrsbr.h>
#include <h/utils.h>
+#include "base64.h"
#include "unquote.h"
/*
#include "h/mh.h"
#include "h/icalendar.h"
#include "sbr/icalparse.h"
+#include "base64.h"
static char *unfold (char *, size_t *);
static void destroy_icallex(void);
#include "m_rand.h"
#include "message_id.h"
#include <sys/time.h> /* for gettimeofday() */
+#include "base64.h"
static enum {
#include <h/oauth.h>
#include <stdarg.h>
#include <sys/select.h>
+#include "base64.h"
#ifdef CYRUS_SASL
#include <sasl/sasl.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include "mhoutsbr.h"
+#include "../sbr/base64.h"
/*
#ifdef HAVE_ICONV
# include <iconv.h>
#endif /* HAVE_ICONV */
+#include "../sbr/base64.h"
extern int debugsw;
#include <h/popsbr.h>
#include <h/signals.h>
+#include "../sbr/base64.h"
#define TRM "."
#include <h/mhparse.h>
#include <h/utils.h>
#include "../sbr/m_mktemp.h"
+#include "../sbr/base64.h"
#define VIAMAIL_SWITCHES \
X("to mailpath", 0, TOSW) \