File mail.c

MUD MAIL SYSTEM MAIN FILE ***************************************
Written by Jeremy Elson (jelson@cs.jhu.edu)


Included Files

  • #include "conf.h"
  • #include "sysdep.h"
  • #include <stdio.h>
  • #include <ctype.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <sys/types.h>
  • #include <unistd.h>
  • #include <limits.h>
  • #include <sys/time.h>
  • #include <assert.h>
  • #include "structs.h"
  • #include "utils.h"
  • #include "comm.h"
  • #include "db.h"
  • #include "interpreter.h"
  • #include "handler.h"
  • #include "mail.h"

  • Global Variable mail_index

    mail_index_type* mail_index
    Visible in:
  • mail.c
  • Used in:
  • find_char_in_index() : mail.c
  • index_mail() : mail.c
  • read_delete() : mail.c

  • Global Variable free_list

    position_list_type* free_list
    Visible in:
  • mail.c
  • Used in:
  • pop_free_list() : mail.c
  • push_free_list() : mail.c

  • Global Variable file_end_pos

    long file_end_pos
    Visible in:
  • mail.c
  • Used in:
  • pop_free_list() : mail.c
  • scan_file() : mail.c
  • write_to_file() : mail.c

  • External Variables

    world
    extern struct room_data* world
    Defined in:
  • db.c
  • mob_index
    extern struct index_data* mob_index

    Defined in:
  • db.c
  • no_mail
    extern int no_mail

    Defined in:
  • db.c

  • Global Function find_char_in_index()

    mail_index_type* find_char_in_index ( long searchee )
    Calls:
  • basic_mud_log() : utils.c
  • Called by:
  • has_mail() : mail.c
  • index_mail() : mail.c
  • read_delete() : mail.c
  • References Variables:
  • mail_index : mail.c

  • Global Function has_mail()

    int has_mail ( long recipient )
    Prototyped in:
  • mail.h
  • Calls:
  • find_char_in_index() : mail.c
  • Called by:
  • nanny() : interpreter.c
  • postmaster_check_mail() : mail.c
  • postmaster_receive_mail() : mail.c

  • Global Function index_mail()

    void index_mail ( long id_to_index, long pos )
    Calls:
  • basic_mud_log() : utils.c
  • find_char_in_index() : mail.c
  • __gnu_calloc(), abort(), perror()
  • Called by:
  • scan_file() : mail.c
  • store_mail() : mail.c
  • References Variables:
  • mail_index : mail.c

  • Global Function pop_free_list()

    long pop_free_list ( void )
    Calls:
  • free()
  • Called by:
  • store_mail() : mail.c
  • References Variables:
  • file_end_pos : mail.c
  • free_list : mail.c

  • Global Function postmaster()

    int ( postmaster) ( struct char_data* ch, void* me, int cmd, char* argument )
    Calls:
  • postmaster_check_mail() : mail.c
  • postmaster_receive_mail() : mail.c
  • postmaster_send_mail() : mail.c
  • send_to_char() : comm.c
  • strcmp()
  • References Variables:
  • cmd_info : interpreter.c
  • no_mail : db.c

  • Global Function postmaster_check_mail()

    void postmaster_check_mail ( struct char_data* ch, struct char_data* mailman, int cmd, char* arg )
    Prototyped in:
  • mail.c
  • Calls:
  • act() : comm.c
  • has_mail() : mail.c
  • sprintf()
  • Called by:
  • postmaster() : mail.c

  • Global Function postmaster_receive_mail()

    void postmaster_receive_mail ( struct char_data* ch, struct char_data* mailman, int cmd, char* arg )
    Prototyped in:
  • mail.c
  • Calls:
  • act() : comm.c
  • create_obj() : db.c
  • has_mail() : mail.c
  • obj_to_char() : handler.c
  • read_delete() : mail.c
  • str_dup() : utils.c
  • sprintf()
  • Called by:
  • postmaster() : mail.c

  • Global Function postmaster_send_mail()

    void postmaster_send_mail ( struct char_data* ch, struct char_data* mailman, int cmd, char* arg )
    Prototyped in:
  • mail.c
  • Calls:
  • act() : comm.c
  • get_id_by_name() : db.c
  • one_argument() : interpreter.c
  • __gnu_malloc(), sprintf()
  • Called by:
  • postmaster() : mail.c

  • Global Function push_free_list()

    void push_free_list ( long pos )
    Calls:
  • __gnu_calloc(), abort(), perror()
  • Called by:
  • read_delete() : mail.c
  • scan_file() : mail.c
  • References Variables:
  • free_list : mail.c

  • Global Function read_delete()

    char* read_delete ( long recipient )
    Prototyped in:
  • mail.h
  • Calls:
  • basic_mud_log() : utils.c
  • find_char_in_index() : mail.c
  • get_name_by_id() : db.c
  • push_free_list() : mail.c
  • read_from_file() : mail.c
  • write_to_file() : mail.c
  • __gnu_calloc(), abort(), asctime(), free(), localtime(), perror(), realloc(), sprintf(), strcat(), strcpy(), strlen()
  • Called by:
  • postmaster_receive_mail() : mail.c
  • References Variables:
  • mail_index : mail.c
  • no_mail : db.c

  • Global Function read_from_file()

    void read_from_file ( void* buf, int size, long filepos )
    Calls:
  • basic_mud_log() : utils.c
  • fclose(), fopen(), fread(), fseek()
  • Called by:
  • read_delete() : mail.c
  • References Variables:
  • no_mail : db.c

  • Global Function scan_file()

    int scan_file ( void )
    Prototyped in:
  • mail.h
  • Calls:
  • basic_mud_log() : utils.c
  • index_mail() : mail.c
  • push_free_list() : mail.c
  • fclose(), fopen(), fread(), ftell(), sprintf()
  • Called by:
  • boot_db() : db.c
  • References Variables:
  • file_end_pos : mail.c

  • Global Function store_mail()

    void store_mail ( long to, long from, char* message_pointer )
    Prototyped in:
  • mail.h
  • Calls:
  • basic_mud_log() : utils.c
  • index_mail() : mail.c
  • pop_free_list() : mail.c
  • write_to_file() : mail.c
  • __eprintf(), memset(), strlen(), strncpy(), time()
  • Called by:
  • string_add() : modify.c

  • Global Function write_to_file()

    void write_to_file ( void* buf, int size, long filepos )
    Calls:
  • basic_mud_log() : utils.c
  • fclose(), fopen(), fseek(), ftell(), fwrite()
  • Called by:
  • read_delete() : mail.c
  • store_mail() : mail.c
  • References Variables:
  • file_end_pos : mail.c
  • no_mail : db.c