Back to index

courier  0.68.2
Classes | Defines | Functions | Variables
rfc3676parser.c File Reference
#include "rfc2045_config.h"
#include "rfc3676parser.h"
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  rfc3676_parser_struct

Defines

#define NONFLOWED_WRAP_REDUCE   74
#define NONFLOWED_THRESHOLD_EXCEEDED   30
#define EMIT_LINE_BEGIN(h)
#define EMIT_LINE_CONTENTS(h, uc, cnt)
#define EMIT_LINE_END(h)

Functions

static void emit_line_begin (rfc3676_parser_t handle)
static void emit_line_contents (rfc3676_parser_t handle, const unicode_char *uc, size_t cnt)
static void emit_line_flowed_wrap (rfc3676_parser_t handle)
static void emit_line_end (rfc3676_parser_t handle)
static void nonflowed_line_begin (rfc3676_parser_t handle)
static void nonflowed_line_contents (rfc3676_parser_t handle, const unicode_char *uc, size_t cnt)
static void nonflowed_line_end (rfc3676_parser_t handle)
static int nonflowed_line_process (int linebreak_opportunity, unicode_char ch, void *dummy)
static int parse_unicode (const char *, size_t, void *)
static size_t scan_crlf (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t scan_crlf_seen_cr (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t start_of_line (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t count_quote_level (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t counted_quote_level (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t check_signature_block (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t start_content_line (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t scan_content_line (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t seen_sig_block (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t seen_notsig_block (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
static size_t seen_content_sp (rfc3676_parser_t handle, const unicode_char *ptr, size_t cnt)
rfc3676_parser_t rfc3676parser_init (const struct rfc3676_parser_info *info)
int rfc3676parser (rfc3676_parser_t handle, const char *txt, size_t txt_cnt)
int rfc3676parser_deinit (rfc3676_parser_t handle, int *errptr)
static void initial_nonflowed_line (rfc3676_parser_t handle, int linebreak_opportunity, unicode_char ch, size_t ch_width)
static void initial_nonflowed_end (rfc3676_parser_t handle)
static void begin_forced_rewrap (rfc3676_parser_t handle)
static void check_abnormal_line (rfc3676_parser_t handle)
static void forced_rewrap_line (rfc3676_parser_t handle, int linebreak_opportunity, unicode_char ch, size_t ch_width)
static void forced_rewrap_end (rfc3676_parser_t handle)
static void emit_rewrapped_line (rfc3676_parser_t handle)

Variables

static const unicode_char sig_block [] = {'-', '-', ' '}

Define Documentation

#define EMIT_LINE_BEGIN (   h)
Value:
do {                 \
              (*(h)->line_begin_handler)(h);     \
       } while (0)

Definition at line 38 of file rfc3676parser.c.

#define EMIT_LINE_CONTENTS (   h,
  uc,
  cnt 
)
Value:
do {                 \
              (*(h)->line_content_handler)((h),(uc),(cnt));    \
       } while (0)

Definition at line 42 of file rfc3676parser.c.

#define EMIT_LINE_END (   h)
Value:
do {                 \
              (*(h)->line_end_handler)(h);       \
       } while (0)

Definition at line 46 of file rfc3676parser.c.

Definition at line 13 of file rfc3676parser.c.

#define NONFLOWED_WRAP_REDUCE   74

Definition at line 11 of file rfc3676parser.c.


Function Documentation

static void begin_forced_rewrap ( rfc3676_parser_t  handle) [static]

Definition at line 953 of file rfc3676parser.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void check_abnormal_line ( rfc3676_parser_t  handle) [static]

Definition at line 889 of file rfc3676parser.c.

{
       size_t n, i;
       const unicode_char *p;

       if (unicode_buf_len(&handle->nonflowed_line) > 0)
              return;

       /* Extreme times call for extreme measures */

       n=unicode_buf_len(&handle->nonflowed_next_word);
       p=unicode_buf_ptr(&handle->nonflowed_next_word);

       for (i=n; i>0; --i)
       {
              if (i < n && unicode_grapheme_break(p[i-1], p[i]))
              {
                     n=i;
                     break;
              }
       }

       unicode_buf_append(&handle->nonflowed_line, p, n);
       unicode_buf_remove(&handle->nonflowed_next_word, 0, n);

       /*
       ** Recalculate the width of the growing word, now.
       */

       handle->nonflowed_next_word_width=0;
       p=unicode_buf_ptr(&handle->nonflowed_next_word);

       for (i=0; i<unicode_buf_len(&handle->nonflowed_next_word); ++i)
              handle->nonflowed_next_word_width +=
                     unicode_wcwidth(p[i]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t check_signature_block ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 519 of file rfc3676parser.c.

{
       if (ptr && *ptr == sig_block[handle->sig_block_index])
       {
              if (++handle->sig_block_index == sizeof(sig_block)
                  /sizeof(sig_block[0]))

                     /* Well, it's there, but does a NL follow? */
                     handle->content_handler=seen_sig_block;
              return 1;
       }

       return seen_notsig_block(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t count_quote_level ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 398 of file rfc3676parser.c.

{
       size_t i;

       if (ptr == NULL) /* EOF, pretend that the quote level was counted */
              return (handle->content_handler=counted_quote_level)
                     (handle, ptr, cnt);

       for (i=0; i<cnt; ++i)
       {
              if (ptr[i] != '>' || !handle->info.isflowed)
              {
                     handle->content_handler=counted_quote_level;

                     if (i == 0)
                            return counted_quote_level(handle, ptr, cnt);
                     break;
              }
              ++handle->quote_level;
       }

       return i;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t counted_quote_level ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 427 of file rfc3676parser.c.

{
       handle->was_previous_quote_level=0;

       /*
       ** If the previous line was flowed and this line has the same
       ** quote level, make the flow official.
       */

       if (handle->has_previous_quote_level &&
           handle->quote_level == handle->previous_quote_level)
       {
              /* Remember that this line was flowed into */
              handle->was_previous_quote_level=1;
       }
       else
       {
              /*
              ** If the previous line was flowed, but this line carries
              ** a different quote level, force-terminate the previous
              ** line, before beginning this line.
              */
              if (handle->has_previous_quote_level)
                     EMIT_LINE_END(handle);

              EMIT_LINE_BEGIN(handle);
       }

       handle->has_previous_quote_level=0;
       /* Assume this line won't be flowed, until shown otherwise */


       if (!handle->info.isflowed)
       {
              /*
              ** No space-stuffing, or sig block checking, if this is not
              ** flowed content.
              */
              handle->content_handler=scan_content_line;
              return scan_content_line(handle, ptr, cnt);
       }


       handle->content_handler=start_content_line;

       if (ptr != NULL && *ptr == ' ')
              return 1; /* Remove stuffed space */

       return start_content_line(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void emit_line_begin ( rfc3676_parser_t  handle) [static]

Definition at line 678 of file rfc3676parser.c.

{
       if (handle->errflag == 0)
              handle->errflag=(*handle->info.line_begin)(handle->quote_level,
                                                    handle->info.arg);
}

Here is the caller graph for this function:

static void emit_line_contents ( rfc3676_parser_t  handle,
const unicode_char uc,
size_t  cnt 
) [static]

Definition at line 692 of file rfc3676parser.c.

{
       if (handle->errflag == 0 && cnt > 0)
              handle->errflag=(*handle->info.line_contents)
                     (uc, cnt, handle->info.arg);
}

Here is the caller graph for this function:

static void emit_line_end ( rfc3676_parser_t  handle) [static]

Definition at line 701 of file rfc3676parser.c.

{
       if (handle->errflag == 0)
              handle->errflag=(*handle->info.line_end)(handle->info.arg);
}

Here is the caller graph for this function:

static void emit_line_flowed_wrap ( rfc3676_parser_t  handle) [static]

Definition at line 685 of file rfc3676parser.c.

{
       if (handle->errflag == 0 && handle->info.line_flowed_notify)
              handle->errflag=(*handle->info.line_flowed_notify)
                     (handle->info.arg);
}

Here is the caller graph for this function:

static void emit_rewrapped_line ( rfc3676_parser_t  handle) [static]

Definition at line 940 of file rfc3676parser.c.

{
       check_abnormal_line(handle);
       emit_line_contents(handle, unicode_buf_ptr(&handle->nonflowed_line),
                        unicode_buf_len(&handle->nonflowed_line));

       emit_line_flowed_wrap(handle);

       /* nonflowed_line is now empty */
       unicode_buf_clear(&handle->nonflowed_line);
       handle->nonflowed_line_width=0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void forced_rewrap_end ( rfc3676_parser_t  handle) [static]

Definition at line 1001 of file rfc3676parser.c.

{
       initial_nonflowed_end(handle); /* Same logic, for now */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void forced_rewrap_line ( rfc3676_parser_t  handle,
int  linebreak_opportunity,
unicode_char  ch,
size_t  ch_width 
) [static]

Definition at line 960 of file rfc3676parser.c.

{
       if (linebreak_opportunity != UNICODE_LB_NONE)
       {
              /* Found a linebreaking opportunity */

              if (handle->nonflowed_line_width
                  + handle->nonflowed_next_word_width
                  > handle->nonflowed_line_target_width)
              {
                     /* Accumulated word is too long */
                     emit_rewrapped_line(handle);
              }

              unicode_buf_append_buf(&handle->nonflowed_line,
                                   &handle->nonflowed_next_word);

              handle->nonflowed_line_width +=
                     handle->nonflowed_next_word_width;
              unicode_buf_clear(&handle->nonflowed_next_word);
              handle->nonflowed_next_word_width=0;
       }

       /*
       ** Check for another excessively long line.
       */

       if (handle->nonflowed_line_width == 0 &&
           handle->nonflowed_next_word_width + ch_width
           > handle->nonflowed_line_target_width)
       {
              emit_rewrapped_line(handle);
       }

       unicode_buf_append(&handle->nonflowed_next_word, &ch, 1);
       handle->nonflowed_next_word_width += ch_width;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void initial_nonflowed_end ( rfc3676_parser_t  handle) [static]

Definition at line 872 of file rfc3676parser.c.

{
       emit_line_contents(handle,
                        unicode_buf_ptr(&handle->nonflowed_line),
                        unicode_buf_len(&handle->nonflowed_line));

       emit_line_contents(handle,
                        unicode_buf_ptr(&handle->nonflowed_next_word),
                        unicode_buf_len(&handle->nonflowed_next_word));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void initial_nonflowed_line ( rfc3676_parser_t  handle,
int  linebreak_opportunity,
unicode_char  ch,
size_t  ch_width 
) [static]

Definition at line 831 of file rfc3676parser.c.

{
       /*
       ** Collect words into nonflowed_line as long as it fits within the
       ** targeted width.
       */
       if (linebreak_opportunity != UNICODE_LB_NONE &&
           handle->nonflowed_line_width + handle->nonflowed_next_word_width
           <= handle->nonflowed_line_target_width)
       {
              unicode_buf_append_buf(&handle->nonflowed_line,
                                   &handle->nonflowed_next_word);
              handle->nonflowed_line_width +=
                     handle->nonflowed_next_word_width;

              unicode_buf_clear(&handle->nonflowed_next_word);
              handle->nonflowed_next_word_width=0;
       }

       /*
       ** Add the character to the growing word.
       **
       ** If the line's size now exceeds the target width by quite a bit,
       ** we've had enough!
       */

       unicode_buf_append(&handle->nonflowed_next_word, &ch, 1);
       handle->nonflowed_next_word_width += ch_width;

       if (handle->nonflowed_line_width + handle->nonflowed_next_word_width
           > handle->nonflowed_line_target_width
           + NONFLOWED_THRESHOLD_EXCEEDED)
              begin_forced_rewrap(handle);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void nonflowed_line_begin ( rfc3676_parser_t  handle) [static]

Definition at line 730 of file rfc3676parser.c.

{
       if (handle->lb)
       {
              /* Just in case */

              int rc=unicode_lbc_end(handle->lb);

              if (rc && handle->errflag == 0)
                     handle->errflag=rc;
       }

       if ((handle->lb=unicode_lbc_init(nonflowed_line_process, handle))
           == NULL)
       {
              if (handle->errflag == 0)
                     handle->errflag=-1;
       }

       if (handle->lb)
              unicode_lbc_set_opts(handle->lb,
                                 UNICODE_LB_OPT_PRBREAK
                                 | UNICODE_LB_OPT_SYBREAK);

       unicode_buf_clear(&handle->nonflowed_line);
       unicode_buf_clear(&handle->nonflowed_next_word);

       handle->nonflowed_line_width=0;
       handle->nonflowed_next_word_width=0;

       handle->nonflowed_line_process=initial_nonflowed_line;
       handle->nonflowed_line_end=initial_nonflowed_end;
       emit_line_begin(handle); /* Fallthru - user callback */

       handle->nonflowed_line_target_width=
              handle->quote_level < NONFLOWED_WRAP_REDUCE - 20 ?
              NONFLOWED_WRAP_REDUCE - handle->quote_level:20;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void nonflowed_line_contents ( rfc3676_parser_t  handle,
const unicode_char uc,
size_t  cnt 
) [static]

Definition at line 774 of file rfc3676parser.c.

{
       if (!handle->lb)
              return;

       while (cnt)
       {
              if (handle->errflag == 0)
                     handle->errflag=unicode_lbc_next(handle->lb, *uc);

              ++uc;
              --cnt;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void nonflowed_line_end ( rfc3676_parser_t  handle) [static]

Definition at line 795 of file rfc3676parser.c.

{
       if (handle->lb)
       {
              int rc=unicode_lbc_end(handle->lb);

              if (rc && handle->errflag == 0)
                     handle->errflag=rc;

              handle->lb=NULL;
       }

       (*handle->nonflowed_line_end)(handle);
       emit_line_end(handle); /* FALLTHRU */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int nonflowed_line_process ( int  linebreak_opportunity,
unicode_char  ch,
void *  dummy 
) [static]

Definition at line 816 of file rfc3676parser.c.

{
       rfc3676_parser_t handle=(rfc3676_parser_t)dummy;

       (*handle->nonflowed_line_process)(handle, linebreak_opportunity, ch,
                                     unicode_wcwidth(ch));

       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int parse_unicode ( const char *  ucs4,
size_t  nbytes,
void *  arg 
) [static]

Definition at line 225 of file rfc3676parser.c.

{
       rfc3676_parser_t handle=(rfc3676_parser_t)arg;
       unicode_char ucs4buf[128];
       const unicode_char *p;

       /* Keep going until there's an error, or everything is consumed. */

       while (handle->errflag == 0 && nbytes)
       {
              /* Do it in pieces, using the temporary unicode_char buffer */

              size_t cnt=nbytes;

              if (cnt > sizeof(ucs4buf))
                     cnt=sizeof(ucs4buf);

              memcpy(ucs4buf, ucs4, cnt);

              ucs4 += cnt;
              nbytes -= cnt;

              cnt /= sizeof(unicode_char);
              p=ucs4buf;

              /* Keep feeding it to the current handler */

              while (handle->errflag == 0 && cnt)
              {
                     size_t n=(*handle->line_handler)(handle, p, cnt);

                     if (handle->errflag == 0)
                     {
                            cnt -= n;
                            p += n;
                     }
              }
       }

       return handle->errflag;
}

Here is the caller graph for this function:

int rfc3676parser ( rfc3676_parser_t  handle,
const char *  txt,
size_t  txt_cnt 
)

Definition at line 208 of file rfc3676parser.c.

{
       if (handle->errflag)
              return handle->errflag; /* Error occured previously */

       /* Convert to unicode and invoke parse_unicode() */

       return libmail_u_convert(handle->uhandle, txt, txt_cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int rfc3676parser_deinit ( rfc3676_parser_t  handle,
int *  errptr 
)

Definition at line 267 of file rfc3676parser.c.

{
       /* Finish unicode conversion */

       int rc=libmail_u_convert_deinit(handle->uhandle, errptr);

       if (rc == 0)
              rc=handle->errflag;

       if (rc == 0)
       {
              (*handle->line_handler)(handle, NULL, 0);
              rc=handle->errflag;
       }

       if (handle->lb)
       {
              int rc2=unicode_lbc_end(handle->lb);

              if (rc2 && rc == 0)
                     rc=rc2;
       }

       unicode_buf_deinit(&handle->nonflowed_line);
       unicode_buf_deinit(&handle->nonflowed_next_word);

       free(handle);
       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file rfc3676parser.c.

{
       rfc3676_parser_t handle=
              (rfc3676_parser_t)calloc(1,
                                    sizeof(struct rfc3676_parser_struct));

       if (!handle)
              return NULL;

       handle->info=*info;
       if ((handle->uhandle=libmail_u_convert_init(info->charset,
                                              libmail_u_ucs4_native,
                                              parse_unicode,
                                              handle)) == NULL)
       {
              free(handle);
              return NULL;
       }

       if (!handle->info.isflowed)
              handle->info.isdelsp=0; /* Sanity check */

       handle->line_handler=scan_crlf;
       handle->content_handler=start_of_line;
       handle->has_previous_quote_level=0;
       handle->previous_quote_level=0;

       handle->line_begin_handler=emit_line_begin;
       handle->line_content_handler=emit_line_contents;
       handle->line_end_handler=emit_line_end;

       unicode_buf_init(&handle->nonflowed_line, (size_t)-1);
       unicode_buf_init(&handle->nonflowed_next_word, (size_t)-1);

       if (!handle->info.isflowed)
       {
              handle->line_begin_handler=nonflowed_line_begin;
              handle->line_content_handler=nonflowed_line_contents;
              handle->line_end_handler=nonflowed_line_end;
       }
       return handle;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t scan_content_line ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 598 of file rfc3676parser.c.

{
       size_t i;

       for (i=0; ptr && i<cnt && ptr[i] != '\n' &&
                   (ptr[i] != ' ' || !handle->info.isflowed); ++i)
              ;

       /* Pass through anything before the NL or potentially flowable SP */

       if (i)
              EMIT_LINE_CONTENTS(handle, ptr, i);

       if (i)
              return i;

       if (ptr && ptr[i] == ' ')
       {
              handle->content_handler=seen_content_sp;
              return 1;
       }

       /* NL. This line does not flow */
       EMIT_LINE_END(handle);

       handle->content_handler=start_of_line;

       return ptr ? 1:0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t scan_crlf ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 301 of file rfc3676parser.c.

{
       size_t i;

       if (ptr == NULL)
       {
              if (handle->errflag == 0)
                     (*handle->content_handler)(handle, NULL, 0);
              return 0;
       }

       for (i=0; ptr && i<cnt; ++i)
       {
              if (ptr[i] == '\r')
                     break;
       }

       if (i)
       {
              size_t consumed=0;

              while (i && handle->errflag == 0)
              {
                     size_t n=(*handle->content_handler)(handle, ptr, i);

                     ptr += n;
                     consumed += n;
                     i -= n;
              }
              return consumed;
       }

       /* Consume the first character, the CR */

       handle->line_handler=scan_crlf_seen_cr;
       return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t scan_crlf_seen_cr ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 344 of file rfc3676parser.c.

{
       unicode_char cr='\r';

       handle->line_handler=scan_crlf;

       if (ptr == NULL || *ptr != '\n')
       {
              /*
              ** CR was not followed by a NL.
              ** Restore it in the char stream.
              */

              while (handle->errflag == 0)
                     if ((*handle->content_handler)(handle, &cr, 1))
                            break;
       }

       return scan_crlf(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t seen_content_sp ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 629 of file rfc3676parser.c.

{
       unicode_char sp=' ';

       handle->content_handler=scan_content_line;

       if (ptr == NULL || *ptr != '\n')
       {
              /*
              ** SP was not followed by the NL. Pass through the space,
              ** then resume scanning.
              */
              EMIT_LINE_CONTENTS(handle, &sp, 1);
              return scan_content_line(handle, ptr, cnt);
       }

       /* NL after a SP -- flowed line */

       if (!handle->info.isdelsp)
              EMIT_LINE_CONTENTS(handle, &sp, 1);

       handle->has_previous_quote_level=1;
       handle->previous_quote_level=handle->quote_level;
       handle->content_handler=start_of_line;
       return ptr ? 1:0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t seen_notsig_block ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 568 of file rfc3676parser.c.

{
       const unicode_char *ptr;
       size_t i;

       if (handle->was_previous_quote_level)
              emit_line_flowed_wrap(handle);

       handle->content_handler=scan_content_line;

       ptr=sig_block;
       i=handle->sig_block_index;

       while (i && handle->errflag == 0)
       {
              size_t n=(*handle->content_handler)(handle, ptr, i);

              ptr += n;
              i -= n;
       }

       return (*handle->content_handler)(handle, newptr, newcnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t seen_sig_block ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 535 of file rfc3676parser.c.

{
       if (ptr == NULL || *ptr == '\n')
       {
              /*
              ** If the previous line was flowed, the sig block is not
              ** considered to be flowable-into content, so terminate
              ** the previous line before emitting the sig block.
              */

              if (handle->was_previous_quote_level)
              {
                     EMIT_LINE_END(handle);
                     EMIT_LINE_BEGIN(handle);
                     handle->was_previous_quote_level=0;
              }

              /* Pass through the sig block */

              handle->content_handler=start_of_line;

              EMIT_LINE_CONTENTS(handle, sig_block,
                               sizeof(sig_block)/sizeof(sig_block[0]));
              EMIT_LINE_END(handle);
              return ptr ? 1:0;
       }

       return seen_notsig_block(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t start_content_line ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 494 of file rfc3676parser.c.

{
       /*
       ** We'll start scanning for the signature block, as soon as
       ** this check is done.
       */
       handle->content_handler=check_signature_block;
       handle->sig_block_index=0;
       
       if (ptr && *ptr == '\n' && handle->was_previous_quote_level)
       {
              EMIT_LINE_END(handle);
              EMIT_LINE_BEGIN(handle);
              handle->was_previous_quote_level=0;
       }

       return check_signature_block(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static size_t start_of_line ( rfc3676_parser_t  handle,
const unicode_char ptr,
size_t  cnt 
) [static]

Definition at line 376 of file rfc3676parser.c.

{
       if (ptr == NULL)
       {
              if (handle->has_previous_quote_level)
                     EMIT_LINE_END(handle); /* Last line was flowed */

              return cnt; /* EOF */
       }

       /* Begin counting the quote level */

       handle->content_handler=count_quote_level;
       handle->quote_level=0;
       return count_quote_level(handle, ptr, cnt);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const unicode_char sig_block[] = {'-', '-', ' '} [static]

Definition at line 515 of file rfc3676parser.c.