
#include "messages.h"
#include <stream.h>

// The welcome message should be 20 lines or less so that the
// entire initial screen is 25 lines or less.
// (It is not neccessary to end with a new line.)
char *default_welcome_message =
#include "Help/Welcome.txt"
;

char *welcome_message = default_welcome_message;

char* general_help_message =
#include "Help/Emma.txt"
;

char* barton_help_message =
#include "Help/Barton.txt"
;

// ----------------------------
// -  Random other messages
// -

char *redialing_message = "<Repeating contact attempt...>\n";
	  
char *library_closed_message =
  "Type \\q<RETURN> to quit, or \\\\<RETURN> to continue.\n";

char *cant_refresh_message =
  "Unable to automatically refresh screen.
You might try typing <RETURN> or a command.
";


char* system_bug_encountered_message =
  "Sorry.  A bug just occured in this program.
Perhaps you might try again in a little while.";

int update_messages()
{
    istream in_file("/mit/mitlibs/info/welcome.barton", "r");
    char temp_char = NULL;
    char *buffer = NULL;
    int i = 0;

    if (in_file.is_open()) {
	while(!in_file.eof() &&
	      in_file.get(temp_char)) {
	    if (buffer == NULL) buffer = malloc(1);
	    else buffer = realloc(buffer, i + 1);

	    buffer[i] = temp_char;
	    i += 1;
	}
    }

    if (buffer != NULL) {
	buffer = realloc(buffer, i + 1);
	buffer[i] = 0;
	welcome_message = buffer;
    }
};





