| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

open_message_file

#include "sflmesg.h"
int
open_message_file (const char *filename)

Synopsis

Opens the specified error message file for reading. Returns 0 if the file exists and is readable, otherwise returns -1. Use this function before calling print message(). You can keep just one message file open at once; this function closes any previously-opened message file. This was done on purpose: it is common to open a message file for an entire application in the main function, then refer to it at other points in the code. It is a pain to pass file handles around the entire application, and global variables are generally a bad idea.

Source Code - (sflmesg.c)

{
    int feedback;

    close message file ();
    msgfile = file open (filename, 'r');

    if (msgfile)
        feedback = 0;
    else
        feedback = -1;

    return (feedback);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation