/* messages.c */

#include "main.h"

MessagesFD mbl;
static char mess[512];  /* should be big enough */

/*
 * Lookup tag in message file, returning pointer to the string - this is a
 *  read-only area.
 *
 * If there's an error, just return a pointer to the original tag.
 */

char *message_lookup (char *tag)

{
    char *res = NULL;
    int len;
             
    if (_swix (MessageTrans_Lookup, I0|I1|I2|I3|O2|O3,
                            &mbl, tag, mess, 511, &res, &len) != NULL)
        return tag;

    res[len] = 0;
    return res;
}
