5. Records and Macros

5 Records and Macros

Larger programs are usually written as a collection of files with a well-defined interface between the various parts.

5.1 The Larger Example Divided into Several Files

To illustrate this, the messenger example from the previous section is divided into the following five files:

  • mess_config.hrl

    Header file for configuration data

  • mess_interface.hrl

    Interface definitions between the client and the messenger

  • user_interface.erl

    Functions for the user interface

  • mess_client.erl

    Functions for the client side of the messenger

  • mess_server.erl

    Functions for the server side of the messenger

While doing this, the message passing interface between the shell