/* this file is a part of amp software12util.c: created by Andrew Richards34*/56#define AMP_UTIL7#include "amp.h"89#include <stdio.h>10#include <stdarg.h>11#include <string.h>1213#include "audio.h"1415/* die - for terminal conditions prints the error message and exits */16/* can not be suppressed with -q,-quiet */17void18die(char *fmt, ...)19{20#if 021va_list ap;22va_start(ap,fmt);23vfprintf(stderr, fmt, ap);24#endif25_exit(-1);26}272829/* warn - for warning messages. Can be suppressed by -q,-quiet */30void31warn(char *fmt, ...)32{33#if 034va_list ap;35va_start(ap,fmt);36if (!A_QUIET) {37fprintf(stderr,"Warning: ");38vfprintf(stderr, fmt, ap);39}40#endif41}424344/* msg - for general output. Can be suppressed by -q,-quiet. Output */45/* goes to stderr so it doesn't conflict with stdout output */46void47msg(char *fmt, ...)48{49#if 050va_list ap;51va_start(ap,fmt);5253if (!A_QUIET)54if (A_MSG_STDOUT) {55vfprintf(stdout, fmt, ap);56fflush(stdout);57} else {58vfprintf(stderr, fmt, ap);59fflush(stderr);60}61#endif62}63646566