1 /******************************************************************************
2 @file fatal.h
4 @brief TIMAC 2.0 API handle fatal errors
6 Group: WCS LPC
7 $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
9 ******************************************************************************
10 $License: BSD3 2016 $
12 Copyright (c) 2015, Texas Instruments Incorporated
13 All rights reserved.
15 Redistribution and use in source and binary forms, with or without
16 modification, are permitted provided that the following conditions
17 are met:
19 * Redistributions of source code must retain the above copyright
20 notice, this list of conditions and the following disclaimer.
22 * Redistributions in binary form must reproduce the above copyright
23 notice, this list of conditions and the following disclaimer in the
24 documentation and/or other materials provided with the distribution.
26 * Neither the name of Texas Instruments Incorporated nor the names of
27 its contributors may be used to endorse or promote products derived
28 from this software without specific prior written permission.
30 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 ******************************************************************************
42 $Release Name: TI-15.4Stack Linux x64 SDK$
43 $Release Date: Sept 27, 2017 (2.04.00.13)$
44 *****************************************************************************/
46 #if !defined(FATAL_H)
47 #define FATAL_H
49 #include "compiler.h"
51 /*
52 * OVERVIEW
53 * =========
54 *
55 * These functions print (log) a message and exit the application
56 */
57 #include <stdarg.h>
59 /*!
60 * @brief print a message like the unix perror() function and exit
61 * @param msg - the message to print
62 * @returns - this function does not return it exits the application
63 *
64 * See: "man 3 perror" for more details behind the name "perror"
65 */
66 void MSVC_NO_RETURN FATAL_perror(const char *msg) GCC_NO_RETURN;
68 /*!
69 * @brief printf() a fatal error message and exit.
70 * @param fmt - the printf() format message
71 * @returns - this function does not return it exits the application
72 */
73 void MSVC_NO_RETURN FATAL_printf(_Printf_format_string_ const char *fmt, ... )
74 GCC_NO_RETURN __attribute__((format (printf,1,2)));
76 /*!
77 * @brief FATAL_printf() building block function.
78 * @param fmt - the printf() format message
79 * @returns - this function does not return it exits the application
80 */
81 void MSVC_NO_RETURN FATAL_vprintf(const char *fmt, va_list ap) GCC_NO_RETURN;
83 #endif
85 /*
86 * ========================================
87 * Texas Instruments Micro Controller Style
88 * ========================================
89 * Local Variables:
90 * mode: c
91 * c-file-style: "bsd"
92 * tab-width: 4
93 * c-basic-offset: 4
94 * indent-tabs-mode: nil
95 * End:
96 * vim:set filetype=c tabstop=4 shiftwidth=4 expandtab=true
97 */