Cross reference for ep/mail_parser.c of index.

# File ep/mail_parser.c

      $Revision: 1.28 $

      Email Parser module (ep) - wrapping functions to parse email,
      calling MM and PA.

      Status: NOT REVUED, TESTED

## Included Files

- `#include <stdio.h>`

- `#include <string.h>`

- `#include <stdlib.h>`

- `#include <netdb.h>`

- `#include <sys/param.h>`

- `#include "/home/shane/code/RIP/include/mm.h"`
  - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/mail.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/linkage.h"`
  - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/osdep.h"`
    - `#include <string.h>`
    - `#include <sys/types.h>`
    - `#include <stdlib.h>`
    - `#include <dirent.h>`
    - `#include <fcntl.h>`
    - `#include <unistd.h>`
    - `#include <time.h>`
    - `#include <utime.h>`
    - `#include <syslog.h>`
    - `#include <sys/file.h>`
    - `#include <ustat.h>`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env_unix.h"`
      - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/env.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/fs.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/ftl.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/nl.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/tcp.h"`
    - `#include "/ncc/dbwork/c-client/sparc-sun-solaris2.7/imap-2000a/c-client/lockfix.h"`
  - `#include "/home/shane/code/RIP/include/gpg.h"`
    - `#include <netdb.h>`
    - `#include <unistd.h>`
    - `#include "/home/shane/code/RIP/include/mail_parser.h"`
      - `#include "/home/shane/code/RIP/include/gpg.h"`
      - `#include "/home/shane/code/RIP/include/memwrap.h"`
        - `#include </home/shane/code/RIP/include/erroutines.h>`
        - `#include <glib.h>`
  - `#include "/home/shane/code/RIP/include/mail_parser.h"`
  - `#include "/home/shane/code/RIP/include/memwrap.h"`
  - `#include "/ncc/dbwork/platforms/yucca-debug/glib-indep/include/glib-1.2/glib.h"`

- `#include "/home/shane/code/RIP/include/gpg.h"`

- `#include "/home/shane/code/RIP/include/mail_parser.h"`

## Preprocessor definitions

`#define EP_TREEMAXHEIGHT 10`

## Global Variable EP_outputPrefix

`char EP_outputPrefix[1024]`

Visible in: |  | ep/mail_parser.c
Used in: | EP_BuildFilename() | ep/mail_parser.c
| EP_MIMEParse() | ep/mail_parser.c
| EP_ParseMail() | ep/mail_parser.c
| EP_ParseText() | ep/mail_parser.c

## Global Variable EP_keyRing

`char EP_keyRing[1024]`

Visible in: |  | ep/mail_parser.c
Used in: | EP_ParseMail() | ep/mail_parser.c
| EP_ParseText() | ep/mail_parser.c

## Global Variable EP_gpgcmd

`char EP_gpgcmd[1024]`

Visible in: |  | ep/mail_parser.c
Used in: | EP_ParseMail() | ep/mail_parser.c
| EP_ParseText() | ep/mail_parser.c

## Global Variable EP_TreeHeight

`int EP_TreeHeight`

Visible in: |  | ep/mail_parser.c
Used in: | EP_InitializeRootNode() | ep/mail_parser.c

## Global Variable EP_Node_ID

`int EP_Node_ID`

Visible in: |  | ep/mail_parser.c
Used in: | EP_InitializeRootNode() | ep/mail_parser.c

## Global Variable EP_Debug

`int EP_Debug`

Visible in: |  | ep/mail_parser.c
Used in: | EP_MIMEParse() | ep/mail_parser.c
| EP_ParseMail() | ep/mail_parser.c
| EP_ParseText() | ep/mail_parser.c

## Global Variable vS_strRC

`const char* vS_strRC[]`

Visible in: |  | ep/mail_parser.c
Used in: | EP_PrintTokens() | ep/mail_parser.c
| EP_ShowTree() | ep/mail_parser.c

## Global Function AddKeyInfo()

`EPTokenKeysPtr AddKeyInfo ( EPTokenKeysPtr keysList, const EPNodePtr p )`

Calls: | UT_malloc_real()
Called by: | EP_GetTokens() | ep/mail_parser.c

## Global Function EP_BuildFilename()

`void EP_BuildFilename ( const EPNodePtr ptr )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | sprintf(), strdup()
Called by: | EP_DefineNewNode() | ep/mail_parser.c
References Variables: | EP_outputPrefix | ep/mail_parser.c

## Global Function EP_CleanTokens()

`void EP_CleanTokens ( const EPTokenPtr head )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | free()

## Global Function EP_DefineNewNode()

`EPNodePtr EP_DefineNewNode ( const int nodeID, const short isValidPGPSignature, const t_MM_type MIMEContentType, const char* strMIMEContentType, const u32 keyID )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | EP_BuildFilename() | ep/mail_parser.c
| UT_malloc_real(), strdup()

## Global Function EP_DefineNewToken()

`EPTokenPtr EP_DefineNewToken ( const t_MM_type MIMEContentType, const char* file, const EPTokenKeysPtr keysList )`

Calls: | UT_malloc_real()
Called by: | EP_GetTokens() | ep/mail_parser.c

## Global Function EP_GetTokens()

`EPTokenPtr EP_GetTokens ( const EPNodePtr p, const EPTokenPtr head, EPTokenKeysPtr keysList )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | AddKeyInfo() | ep/mail_parser.c
| EP_DefineNewToken() | ep/mail_parser.c
| EP_GetTokens() | ep/mail_parser.c
| RemoveKeyInfo() | ep/mail_parser.c
Called by: | EP_GetTokens() | ep/mail_parser.c

## Global Function EP_InitializeNode()

`EPNodePtr EP_InitializeNode ( const char* inputFile, const int nodeID )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | UT_malloc_real(), strdup()

## Global Function EP_InitializeRootNode()

`EPNodePtr EP_InitializeRootNode ( const char* inputFile )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | UT_malloc_real(), strdup()
Called by: | EP_ParseText() | ep/mail_parser.c
| InitializeMailDescr() | ep/mail_parser.c
References Variables: | EP_Node_ID | ep/mail_parser.c
| EP_TreeHeight | ep/mail_parser.c

## Global Function EP_MIMEParse()

`EPNodePtr EP_MIMEParse ( const EPNodePtr p )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | MM_extract_mime(), MM_store(), PA_ParseMessage(), do_regex_test(), fclose(), fgets(), fopen(), sprintf()
References Variables: | EP_Debug | ep/mail_parser.c
| EP_outputPrefix | ep/mail_parser.c

## Global Function EP_MailDescrCleanUp()

`void EP_MailDescrCleanUp ( const EP_Mail_DescrPtr ptr )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | EP_TreeCleanUp() | ep/mail_parser.c
| MailHeaderFieldCleanUp() | ep/mail_parser.c
| free()

## Global Function EP_ParseMail()

`EP_Mail_DescrPtr EP_ParseMail ( const char* inputFile, const char* outputPath, const char* keyRing, const char* gpgcmd )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | InitializeMailDescr() | ep/mail_parser.c
| MM_extract_mime(), MM_store(), gethostname(), getpid(), sprintf(), strcpy()
References Variables: | EP_Debug | ep/mail_parser.c
| EP_gpgcmd | ep/mail_parser.c
| EP_keyRing | ep/mail_parser.c
| EP_outputPrefix | ep/mail_parser.c

## Global Function EP_ParseText()

`EPNodePtr EP_ParseText ( const char* inputFile, const char* outputPath, const char* keyRing, const char* gpgcmd )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | EP_InitializeRootNode() | ep/mail_parser.c
| PA_ParseMessage(), gethostname(), getpid(), sprintf(), strcpy()
References Variables: | EP_Debug | ep/mail_parser.c
| EP_gpgcmd | ep/mail_parser.c
| EP_keyRing | ep/mail_parser.c
| EP_outputPrefix | ep/mail_parser.c

## Global Function EP_PrintTokens()

`void EP_PrintTokens ( EPTokenPtr head )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | printf()
References Variables: | vS_strRC | ep/mail_parser.c

## Global Function EP_ShowTree()

`void EP_ShowTree ( const EPNodePtr p )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | EP_ShowTree() | ep/mail_parser.c
| printf()
Called by: | EP_ShowTree() | ep/mail_parser.c
References Variables: | vS_strRC | ep/mail_parser.c

## Global Function EP_TreeCleanUp()

`void EP_TreeCleanUp ( const EPNodePtr ptr )`

Prototyped in: | /home/shane/code/RIP/include/mail_parser.h
Calls: | EP_TreeCleanUp() | ep/mail_parser.c
| free(), unlink()
Called by: | EP_MailDescrCleanUp() | ep/mail_parser.c
| EP_TreeCleanUp() | ep/mail_parser.c

## Global Function InitializeMailDescr()

`EP_Mail_DescrPtr InitializeMailDescr ( const char* inputFile )`

Calls: | EP_InitializeRootNode() | ep/mail_parser.c
| MM_get_msg_headers(), UT_malloc_real()
Called by: | EP_ParseMail() | ep/mail_parser.c

## Global Function MailHeaderFieldCleanUp()

`void MailHeaderFieldCleanUp ( Mail_Header_FieldPtr p )`

Calls: | free()
Called by: | EP_MailDescrCleanUp() | ep/mail_parser.c

## Global Function RemoveKeyInfo()

`EPTokenKeysPtr RemoveKeyInfo ( const EPTokenKeysPtr keysHead )`

Calls: | free()
Called by: | EP_GetTokens() | ep/mail_parser.c

## Local Function asctime_r()

`static char* asctime_r ( const struct tm* __tm, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_asctime_r()

## Local Function ctime_r()

`static char* ctime_r ( const time_t* __time, char* __buf )`

Included from: | /usr/include/time.h
Calls: | __posix_ctime_r()

## Local Function getlogin_r()

`static int getlogin_r ( char* __name, int __len )`

Included from: | /usr/include/unistd.h
Calls: | __posix_getlogin_r()

## Local Function readdir_r()

`static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )`

Included from: | /usr/include/dirent.h
Calls: | __posix_readdir_r()

## Local Function ttyname_r()

`static int ttyname_r ( int __fildes, char* __buf, size_t __size )`

Included from: | /usr/include/unistd.h
Calls: | __posix_ttyname_r()