Back to index

courier  0.68.2
Classes | Functions
base64.h File Reference
#include "../rfc2045/rfc2045_config.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  base64decode

Functions

void base64_decode_init (struct base64decode *, int(*)(const char *, int, void *), void *)
int base64_decode (struct base64decode *, const char *, int)
int base64_decode_end (struct base64decode *)
char * base64_decode_str (const char *)

Function Documentation

int base64_decode ( struct base64decode ,
const char *  ,
int   
)

Definition at line 26 of file base64.c.

{
       while (l)
       {
              char c;

              if (b->workbuflen >= sizeof(b->workbuf))
              {
                     int rc=doflush(b);

                     if (rc)
                            return (rc);
              }


              if (*p == '=')
              {
                     c=100;
              }
              else
              {
                     char *s=strchr(base64tab, *p);

                     if (s == NULL)
                     {
                            ++p;
                            --l;
                            continue;
                     }

                     c= s-base64tab;
              }
              b->workbuf[b->workbuflen++]=c;
              ++p;
              --l;
       }
       return (0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int base64_decode_end ( struct base64decode )

Definition at line 65 of file base64.c.

{
       return (doflush(b));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void base64_decode_init ( struct base64decode ,
int(*)(const char *, int, void *)  ,
void *   
)

Definition at line 12 of file base64.c.

{
       b->workbuflen=0;
       b->decode_func=f;
       b->decode_func_arg=a;
}

Here is the caller graph for this function:

char* base64_decode_str ( const char *  )

Definition at line 120 of file base64.c.

{
       struct base64decode b;

       char *p=strdup(s);
       char *pp;

       if (!p)
              return (NULL);

       pp= p;

       base64_decode_init(&b, save_str, &pp);
       base64_decode(&b, s, strlen(s));
       base64_decode_end(&b);
       *pp=0;
       return p;
}

Here is the call graph for this function: