/*
- * Copyright (c) 1996-2010 by the citadel.org team
+ * Copyright (c) 1996-2012 by the citadel.org team
*
* This program is open source software. You can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * modify it under the terms of the GNU General Public License, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
char encoding[16];
char istr[1024];
iconv_t ic = (iconv_t)(-1) ;
- char *ibuf; /**< Buffer of characters to be converted */
- char *obuf; /**< Buffer for converted characters */
- size_t ibuflen; /**< Length of input buffer */
- size_t obuflen; /**< Length of output buffer */
- char *isav; /**< Saved pointer to input buffer */
- char *osav; /**< Saved pointer to output buffer */
+ char *ibuf; /* Buffer of characters to be converted */
+ char *obuf; /* Buffer for converted characters */
+ size_t ibuflen; /* Length of input buffer */
+ size_t obuflen; /* Length of output buffer */
+ char *isav; /* Saved pointer to input buffer */
+ char *osav; /* Saved pointer to output buffer */
int passes = 0;
int i, len, delta;
int illegal_non_rfc2047_encoding = 0;
ibuf = malloc(1024);
isav = ibuf;
- if (!strcasecmp(encoding, "B")) { /**< base64 */
+ if (!strcasecmp(encoding, "B")) { /* base64 */
ibuflen = CtdlDecodeBase64(ibuf, istr, strlen(istr));
}
- else if (!strcasecmp(encoding, "Q")) { /**< quoted-printable */
+ else if (!strcasecmp(encoding, "Q")) { /* quoted-printable */
size_t len;
long pos;
ibuflen = CtdlDecodeQuotedPrintable(ibuf, istr, len);
}
else {
- strcpy(ibuf, istr); /**< unknown encoding */
+ strcpy(ibuf, istr); /* unknown encoding */
ibuflen = strlen(istr);
}
-/**
- * \brief RFC2047-encode a header field if necessary.
- * If no non-ASCII characters are found, the string
- * will be copied verbatim without encoding.
+/*
+ * RFC2047-encode a header field if necessary.
+ * If no non-ASCII characters are found, the string will be copied verbatim without encoding.
+ * Returns encoded length; -1 if non success.
*
- * \param target Target buffer.
- * \param maxlen Maximum size of target buffer.
- * \param source Source string to be encoded.
- * \param SourceLen Length of the source string
- * \returns encoded length; -1 if non success.
+ * target Target buffer.
+ * maxlen Maximum size of target buffer.
+ * source Source string to be encoded.
+ * SourceLen Length of the source string
*/
int webcit_rfc2047encode(char *target, int maxlen, char *source, long SourceLen)
{