gpgme_data_write (ctx->body, ctx->linebuf, len);
{ if (ctx->is_utf8) gpgme_data_write (ctx->body, ctx->linebuf, len); else latin1_data_write (ctx->body, ctx->linebuf, len); }
plaintext_handler (void *handle, const void *buffer, size_t size){  pgpmime_context_t ctx = handle;  const char *s;  size_t nleft, pos, len;  s = buffer;  pos = ctx->linebufpos;  nleft = size;  for (; nleft ; nleft--, s++)    {      if (pos >= ctx->linebufsize)        {          log_error ("%s: ctx=%p, rfc822 parser failed: line too long\n",                     __FILE__, ctx);          ctx->line_too_long = 1;          return 0; /* Error. */        }      if (*s != '\n')        ctx->linebuf[pos++] = *s;      else        { /* Got a complete line. Remove the last CR */          if (pos && ctx->linebuf[pos-1] == '\r')            pos--;          if (rfc822parse_insert (ctx->msg, ctx->linebuf, pos))            {              log_error ("%s: ctx=%p, rfc822 parser failed: %s\n",                         __FILE__, ctx, strerror (errno));              ctx->parser_error = 1;              return 0; /* Error. */            }          if (ctx->in_data && ctx->collect_body && ctx->body)            {              /* We are inside the body of the message.  Save it away                 to a gpgme data object.  Note that this gets only                 used for the first text part. */              if (ctx->collect_body == 1)  /* Need to skip the first line. */                ctx->collect_body = 2;              else                {                  if (ctx->is_qp_encoded)                    len = qp_decode (ctx->linebuf, pos);                  else if (ctx->is_base64_encoded)                    len = base64_decode (ctx, ctx->linebuf, pos);                  else                    len = pos;                  if (len)                    gpgme_data_write (ctx->body, ctx->linebuf, len);                  if (!ctx->is_base64_encoded)                    gpgme_data_write (ctx->body, "\r\n", 2);                }            }          else if (ctx->in_data && ctx->collect_attachment)            {              /* We are inside of an attachment part.  Write it out. */              if (ctx->collect_attachment == 1)  /* Skip the first line. */                ctx->collect_attachment = 2;              else if (ctx->outstream)                {                  HRESULT hr = 0;                  if (ctx->is_qp_encoded)                    len = qp_decode (ctx->linebuf, pos);                  else if (ctx->is_base64_encoded)                    len = base64_decode (ctx, ctx->linebuf, pos);                  else                    len = pos;                  if (len)                    hr = IStream_Write (ctx->outstream, ctx->linebuf,                                        len, NULL);                  if (!hr && !ctx->is_base64_encoded)                    hr = IStream_Write (ctx->outstream, "\r\n", 2, NULL);                  if (hr)                    {                      log_debug ("%s:%s: Write failed: hr=%#lx",                                 __FILE__, __func__, hr);                      MessageBox (ctx->hwnd, "Error writing file",                                  "I/O-Error", MB_ICONERROR|MB_OK);                      ctx->parser_error = 1;                      return 0; /* Error. */                    }                }            }                    /* Continue with next line. */          pos = 0;        }    }  ctx->linebufpos = pos;  return size;}