/* messages.c */

#include "stats.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 (swi (MessageTrans_Lookup,
                 R0, &mbl,
                 R1, tag,
                 R2, mess,
                 R3, 511,
               OUT,
                 R2, &res,
                 R3, &len,  END) != NULL)
        return tag;

    res[len] = 0;
    return res;
}
