* $Id$
*
* Functions which handle translation between HTML and plain text
- * Copyright (c) 2000-2001 by Art Cancro and others. This program is
+ * Copyright (c) 2000-2005 by Art Cancro and others. This program is
* released under the terms of the GNU General Public License.
*/
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
* screenwidth = desired output screenwidth
* do_citaformat = set to 1 to indent newlines with spaces
*/
-char *html_to_ascii(char *inputmsg, int screenwidth, int do_citaformat) {
+char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaformat) {
char inbuf[SIZ];
char outbuf[SIZ];
char tag[1024];
int i, j, ch, did_out, rb, scanch;
int nest = 0; /* Bracket nesting level */
int blockquote = 0; /* BLOCKQUOTE nesting level */
+ int bytes_processed = 0;
inptr = inputmsg;
strcpy(inbuf, "");
strcpy(outbuf, "");
+ if (msglen == 0) msglen = strlen(inputmsg);
outptr_buffer_size = strlen(inptr) + SIZ;
outptr = malloc(outptr_buffer_size);
done_reading = 1;
}
+ ++bytes_processed;
+ if (bytes_processed > msglen) {
+ done_reading = 1;
+ }
+
}
/* Do some parsing */