Back to index

courier  0.68.2
Functions
mimegpgstack.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include "mimegpgstack.h"

Go to the source code of this file.

Functions

int libmail_mimestack_push (struct mimestack **s, const char *b)
void libmail_mimestack_pop (struct mimestack **p)
void libmail_mimestack_pop_to (struct mimestack **p, struct mimestack *s)
struct mimestacklibmail_mimestack_search (struct mimestack *p, const char *c)

Function Documentation

void libmail_mimestack_pop ( struct mimestack **  p)

Definition at line 34 of file mimegpgstack.c.

{
       struct mimestack *pp= *p;

       if (pp)
       {
              *p=pp->next;
              free(pp->boundary);
              free(pp);
       }
}

Here is the caller graph for this function:

void libmail_mimestack_pop_to ( struct mimestack **  p,
struct mimestack s 
)

Definition at line 46 of file mimegpgstack.c.

{
       while (*p)
       {
              int last=strcmp( (*p)->boundary, s->boundary) == 0;
              libmail_mimestack_pop(p);
              if (last)
                     break;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int libmail_mimestack_push ( struct mimestack **  s,
const char *  b 
)

Definition at line 15 of file mimegpgstack.c.

{
       struct mimestack *ss=(struct mimestack *)
              malloc(sizeof(**s));

       if (!ss)
              return -1;

       if ((ss->boundary=strdup(b)) == NULL)
       {
              free(ss);
              return -1;
       }

       ss->next= *s;
       *s=ss;
       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct mimestack* libmail_mimestack_search ( struct mimestack p,
const char *  c 
) [read]

Definition at line 57 of file mimegpgstack.c.

{
       int l=strlen(c);

       while (p)
       {
              int ll=strlen(p->boundary);

              if (l >= ll && strncasecmp(p->boundary, c, ll) == 0)
                     break;
              p=p->next;
       }
       return (p);
}

Here is the caller graph for this function: