Back to index

courier  0.68.2
rfc2045decodemimesection.c File Reference
#include "rfc2045_config.h"
#include "rfc2045.h"
#include "rfc2045src.h"
#include <stdio.h>
#include <unistd.h>

Go to the source code of this file.


int rfc2045_decodemimesection (struct rfc2045src *src, struct rfc2045 *rfc, int(*handler)(const char *, size_t, void *), void *voidarg)

Function Documentation

int rfc2045_decodemimesection ( struct rfc2045src src,
struct rfc2045 rfc,
int(*)(const char *, size_t, void *)  handler,
void *  voidarg 

Definition at line 19 of file rfc2045decodemimesection.c.

       off_t  start_pos, end_pos, start_body;
       char   buf[BUFSIZ];
       ssize_t       cnt;
       off_t  dummy;
       int    rc;

       rfc2045_mimepos(rfc, &start_pos, &end_pos, &start_body,
              &dummy, &dummy);
       if (SRC_SEEK(src, start_body) == (off_t)-1) return (-1);

        rfc2045_cdecode_start(rfc, handler, voidarg);

        while (start_body < end_pos)
                if (cnt > end_pos-start_body)
                cnt=SRC_READ(src, buf, cnt);
                if (cnt <= 0)   break;
                if ((rc=rfc2045_cdecode(rfc, buf, cnt)) != 0)
                     return (rc);
              start_body += cnt;
        return (rfc2045_cdecode_end(rfc));

Here is the call graph for this function:

Here is the caller graph for this function: