/************************************************************
**
** Application: UnitConv
**
** Title:       c.msglink
**
*************************************************************/

/* File written by makeMsgs at Sat,11 Jun 2016.15:05:24 */

/*
* 
* Copyright (c) 2015, Chris Johnson
* All rights reserved.
* 
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*   * Redistributions of source code must retain the above copyright
*     notice, this list of conditions and the following disclaimer.
*   * Redistributions in binary form must reproduce the above
*     copyright notice, this list of conditions and the following
*     disclaimer in the documentation and/or other materials provided
*     with the distribution.
*   * Neither the name of the copyright holder nor the names of their
*     contributors may be used to endorse or promote products derived
*     from this software without specific prior written permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* 
*/

/* from C lib: */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

/* from osLib */
#include "oslib/os.h"
#include "oslib/messagetrans.h"

/* from CJLib */
#include "CJLib:message.h"

/* from app */

#include "msglink.h"

msg_tok_str msg_data[] = {
  "OCTTOOBIG","Number is more than 37777777777",NULL,
  "DECTOOBIG","Number is more than 4294967295",NULL,
  "DECTOOSMALL","Number is less than -2147483648",NULL,
  "DATANOMEM","No memory for group data",NULL,
  "SETNAMEBLANK","Set name blank",NULL,
  "NOFACTOR","Factor field blank",NULL,
  "NOUNITNAME","Unit name field blank",NULL,
  "NOGROUPNAME","Group name blank",NULL,
  "CUSTOMNOWRITE","Could not open custom data file",NULL,
  "RESTART","QUIT and RESTART UnitConv",NULL,
  "NOMOREITEMS","No more items allowed",NULL,
  "CARET","Caret must be in edit window",NULL,
  "NOMORESET","No more sets in this group",NULL,
  "GROUPNOMEM","No memory for new group",NULL,
  "NOMOREGROUP","No more groups",NULL,
  "NOTEMP","You must enter a temperature",NULL,
  "INVALTEMP","You must enter a valid temperature",NULL,
  "LOADNOMEM","Could not allocate memory",NULL,
  "LOADNOMEM2","Could not allocate memory",NULL,
  "RUNNING","UnitConv is already running",NULL,
  "GASMARK","Gas mark must be 0.25, 0.5, or 1 - 9",NULL,
  "ABSTLOW","Absolute temperature negative",NULL,
  "CTLOW","Centigrade temperature too low",NULL,
  "FTLOW","Fahrenheit temperature too low",NULL,
  "INVALHEAD","Header not recognised",NULL,
  "NOTV1","Not version 1",NULL,
  "NOSTR","String not found",NULL,
  "TOOMANYGROUP","Too many groups in unit data file",NULL,
  "NOITEM","Can't find group_item token in data file",NULL,
  "NOASPECTX","You must enter a width for the aspect",NULL,
  "NOASPECTY","You must enter a height for the aspect",NULL,
  "TOOMANYITEMS","Too many items in %s in data file.",NULL,
  "TOOMANYSETS","Too many sets in %s in data file.",NULL,
};



void Msg_Warn ( enum message_token msgtok )
{
  CJL_Message ( WARNING,
                msg_data[msgtok].token,
                NULL,
                msg_data[msgtok].defmsg );
  return;
}



osbool Msg_Query ( enum message_token msgtok )
{
  osbool  affirm;

  affirm = CJL_Message ( QUERY,
                         msg_data[msgtok].token,
                         msg_data[msgtok].buttons,
                         msg_data[msgtok].defmsg );
  return (affirm);
}



