Back to index

courier  0.68.2
Classes | Functions
rfc2045find.c File Reference
#include "rfc2045.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  rfc2045findstruct

Functions

static void do_decode (struct rfc2045 *p, struct rfc2045id *id, void *ptr)
struct rfc2045rfc2045_find (struct rfc2045 *p, const char *str)

Class Documentation

struct rfc2045findstruct

Definition at line 11 of file rfc2045find.c.

Collaboration diagram for rfc2045findstruct:
Class Members
const char * partnum
struct rfc2045 * ptr

Function Documentation

static void do_decode ( struct rfc2045 p,
struct rfc2045id id,
void *  ptr 
) [static]

Definition at line 17 of file rfc2045find.c.

{
struct rfc2045findstruct *fs=(struct rfc2045findstruct *)ptr;
const char *partnum=fs->partnum;
unsigned n;

       while (id)
       {
              if (!isdigit((int)(unsigned char)*partnum))      return;
              n=0;
              while (isdigit((int)(unsigned char)*partnum))
                     n=n*10 + *partnum++ - '0';
              if (*partnum)
              {
                     if (*partnum != '.') return;
                     ++partnum;
              }
              if (n != (unsigned)id->idnum)      return;
              id=id->next;
       }
       if ( *partnum == '\0')      fs->ptr=p;
}

Here is the caller graph for this function:

struct rfc2045* rfc2045_find ( struct rfc2045 p,
const char *  str 
) [read]

Definition at line 41 of file rfc2045find.c.

{
struct rfc2045findstruct fs;

       fs.partnum=str;
       fs.ptr=0;
       rfc2045_decode(p, &do_decode, &fs);
       return (fs.ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function: