/*
    ####             #    #     # #
    #   #            #    #       #          The FreeWare C library for 
    #   #  ##   ###  #  # #     # ###             RISC OS machines
    #   # #  # #     # #  #     # #  #   ___________________________________
    #   # ####  ###  ##   #     # #  #                                      
    #   # #        # # #  #     # #  #    Please refer to the accompanying
    ####   ### ####  #  # ##### # ###    documentation for conditions of use
    ________________________________________________________________________

    File:    Msgs.printf.c
    Author:  Copyright  1992 Jason Williams
    Version: 1.00 (08 Apr 1992)
    Purpose: MessageTrans-like message handling functions.
             (If you want MessageTrans, use the SWI interface, if you want
             high-level message handling, use this code...)
*/

#include <stdarg.h>
#include <stdio.h>

#include "DeskLib:Msgs.h"


extern void Msgs_printf(char *result, char *formattag, ...)
{
  va_list ap;
  char temp[1024];

  result[0] = '\0';
  if (Msgs_Lookup(formattag, temp, 1020))
  {
    va_start(ap, formattag);
    vsprintf(result, temp, ap);
    va_end(ap);
  }
}
