Cross reference for modules/mm/mm.c of index.

# File modules/mm/mm.c

      $Revision: 1.7 $

      mm - MIME Parser module. Functions to parse a mail message,
      find if it is MIME-encapsulated, and return the parts of
      the message which are supported by the UP module.

      Status: NOT REVUED

      Design and implementation by: Daniele Arena

## Included Files

- `#include <stdio.h>`

- `#include <signal.h>`

- `#include <string.h>`

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

- `#include <libgen.h>`

- `#include "modules/mm/mm.h"`
  - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/linkage.h"`
  - `#include "/home/daniele/downloads/solaris/imap-4.7b/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 "/home/daniele/downloads/solaris/imap-4.7b/c-client/env_unix.h"`
      - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/env.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/fs.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/ftl.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/nl.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/tcp.h"`
    - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/lockfix.h"`
  - `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/misc.h"`

- `#include "/home/daniele/downloads/solaris/imap-4.7b/c-client/linkage.c"`

## Preprocessor definitions

`#define LINESIZE STR_S`

`#define REGEXP "^From "`

`#define FIRSTCHARS 10`

## Global Function MM_bs_list_init()

`void MM_bs_list_init ( MM_bs_list* section_list )`

Prototyped in: | modules/mm/mm.h
Called by: | mm() | modules/mm/mm.c

## Global Function MM_bs_list_ins_last()

`void MM_bs_list_ins_last ( MM_bs_list* section_list, MM_b_section* newsection )`

Prototyped in: | modules/mm/mm.h
Called by: | get_body_info() | modules/mm/mm.c

## Global Function MM_cleanup()

`void MM_cleanup ( MM_xmp_list* part_list, long debug )`

Prototyped in: | modules/mm/mm.h
Calls: | printf(), remove()

## Global Function MM_decode()

`int MM_decode ( char* mail_file, MM_header* mail_header, MM_xmp_list* part_list, long mesgno, long debug )`

Prototyped in: | modules/mm/mm.h
Calls: | mm() | modules/mm/mm.c
| status() | modules/mm/mm.c
| auth_link(), mail_link(), mail_open(), printf(), sprintf()
References Variables: | auth_log, auth_md5, dummydriver, imapdriver, mboxdriver, mbxdriver, mhdriver, mmdfdriver, mtxdriver, mxdriver, newsdriver, nntpdriver, philedriver, pop3driver, tenexdriver, unixdriver

## Global Function MM_store()

`void MM_store ( char* destination_file, long debug )`

Prototyped in: | modules/mm/mm.h
Calls: | perform_regex_test() | modules/mm/mm.c
| __filbuf(), __flsbuf(), ctime(), fclose(), fopen(), fprintf(), printf(), sprintf(), time()

## Global Function MM_xmp_list_init()

`void MM_xmp_list_init ( MM_xmp_list* part_list )`

Prototyped in: | modules/mm/mm.h

## Global Function MM_xmp_list_ins_last()

`void MM_xmp_list_ins_last ( MM_xmp_list* part_list, MM_xmp* newpart )`

Prototyped in: | modules/mm/mm.h
Called by: | mm() | modules/mm/mm.c

## Global Function get_body_info()

`void get_body_info ( struct mail_bodystruct* body, char* pfx, long i, MM_bs_list* section_list, long debug )`

Prototyped in: | modules/mm/mm.h
Calls: | MM_bs_list_ins_last() | modules/mm/mm.c
| get_body_info() | modules/mm/mm.c
| malloc(), printf(), puts(), sprintf(), strlen()
Called by: | get_body_info() | modules/mm/mm.c
| mm() | modules/mm/mm.c
References Variables: | body_types

## Global Function get_header_line()

`char* get_header_line ( MAILSTREAM* stream, long mesgno, struct string_list* cur, char* hdr_title )`

Prototyped in: | modules/mm/mm.h
Calls: | cpystr(), mail_fetch_header(), malloc(), sprintf(), strlen()
Called by: | mm() | modules/mm/mm.c

## Global Function mm()

`int mm ( MAILSTREAM* stream, MM_header* hdr, MM_xmp_list* part_list, long mesgno, long debug )`

Prototyped in: | modules/mm/mm.h
Calls: | MM_bs_list_init() | modules/mm/mm.c
| MM_xmp_list_ins_last() | modules/mm/mm.c
| get_body_info() | modules/mm/mm.c
| get_header_line() | modules/mm/mm.c
| put_in_file() | modules/mm/mm.c
| getpid(), gettimeofday(), mail_fetch_mime(), mail_fetch_structure(), mail_fetch_text(), mail_free_stringlist(), mail_newstringlist(), malloc(), printf(), puts(), sprintf(), strcmp(), strlen(), strncpy()
Called by: | MM_decode() | modules/mm/mm.c
References Variables: | body_types

## Global Function mm_critical()

`void mm_critical ( MAILSTREAM* stream )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_diskerror()

`long mm_diskerror ( MAILSTREAM* stream, long errcode, long serious )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h
Calls: | abort()

## Global Function mm_dlog()

`void mm_dlog ( char* string )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h
Calls: | puts()

## Global Function mm_exists()

`void mm_exists ( MAILSTREAM* stream, unsigned long number )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_expunged()

`void mm_expunged ( MAILSTREAM* stream, unsigned long number )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_fatal()

`void mm_fatal ( char* string )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h
Calls: | printf()

## Global Function mm_flags()

`void mm_flags ( MAILSTREAM* stream, unsigned long number )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_list()

`void mm_list ( MAILSTREAM* stream, int delimiter, char* mailbox, long attributes )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_log()

`void mm_log ( char* string, long errflg )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h
Calls: | printf()

## Global Function mm_login()

`void mm_login ( NETMBX* mb, char* user, char* pwd, long trial )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_lsub()

`void mm_lsub ( MAILSTREAM* stream, int delimiter, char* mailbox, long attributes )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_nocritical()

`void mm_nocritical ( MAILSTREAM* stream )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_notify()

`void mm_notify ( MAILSTREAM* stream, char* string, long errflg )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_searched()

`void mm_searched ( MAILSTREAM* stream, unsigned long number )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function mm_status()

`void mm_status ( MAILSTREAM* stream, char* mailbox, MAILSTATUS* status )`

Prototyped in: | /home/daniele/downloads/solaris/imap-4.7b/c-client/mail.h

## Global Function put_in_file()

`void put_in_file ( char* fileprefix, char* extension, char* text, size_t text_size )`

Prototyped in: | modules/mm/mm.h
Calls: | write_file() | modules/mm/mm.c
| sprintf()
Called by: | mm() | modules/mm/mm.c

## Global Function read_file()

`void read_file ( char* filename )`

Prototyped in: | modules/mm/mm.h
Calls: | __filbuf(), __flsbuf(), fclose(), fopen(), printf()

## Global Function status()

`void status ( MAILSTREAM* stream )`

Prototyped in: | modules/mm/mm.h
Calls: | printf(), puts(), rfc822_date()
Called by: | MM_decode() | modules/mm/mm.c

## Global Function write_file()

`void write_file ( char* filename, char* text, size_t text_size )`

Prototyped in: | modules/mm/mm.h
Calls: | fclose(), fopen(), fprintf(), printf()
Called by: | put_in_file() | modules/mm/mm.c

## Local Function perform_regex_test()

`static int perform_regex_test ( const char* pattern, char* string )`

Prototyped in: | modules/mm/mm.h
Calls: | free(), regcmp(), regex()
Called by: | MM_store() | modules/mm/mm.c