Libtrap: Internal development docs  1.16.1
trap_error.c
Go to the documentation of this file.
1 /**
2  * \file trap_error.c
3  * \brief Error handling for TRAP.
4  * \author Vaclav Bartos <ibartosv@fit.vutbr.cz>
5  * \author Tomas Cejka <cejkat@cesnet.cz>
6  * \date 2013
7  * \date 2014
8  */
9 /*
10  * Copyright (C) 2013,2014 CESNET
11  *
12  * LICENSE TERMS
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  * 1. Redistributions of source code must retain the above copyright
18  * notice, this list of conditions and the following disclaimer.
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  * 3. Neither the name of the Company nor the names of its contributors
24  * may be used to endorse or promote products derived from this
25  * software without specific prior written permission.
26  *
27  * ALTERNATIVELY, provided that this notice is retained in full, this
28  * product may be distributed under the terms of the GNU General Public
29  * License (GPL) version 2 or later, in which case the provisions
30  * of the GPL apply INSTEAD OF those given above.
31  *
32  * This software is provided ``as is'', and any express or implied
33  * warranties, including, but not limited to, the implied warranties of
34  * merchantability and fitness for a particular purpose are disclaimed.
35  * In no event shall the company or contributors be liable for any
36  * direct, indirect, incidental, special, exemplary, or consequential
37  * damages (including, but not limited to, procurement of substitute
38  * goods or services; loss of use, data, or profits; or business
39  * interruption) however caused and on any theory of liability, whether
40  * in contract, strict liability, or tort (including negligence or
41  * otherwise) arising in any way out of the use of this software, even
42  * if advised of the possibility of such damage.
43  *
44  */
45 
46 #include "trap_error.h"
47 
48 /** Default error message for each error code */
49 const char* default_err_msg[256] = {
50  "No error", // 0 TRAP_E_OK
51  "Read or write operation timeout", // 1 TRAP_E_TIMEOUT
52  0,0,0,0,0,0,0,0, // 2-9 unused
53  "TRAP library already initialized.", // 10 TRAP_E_INITIALIZED
54  "Bad parameters passed to interface initializer.", // 11 TRAP_E_BADPARAMS
55  "Interface index out of range.", // 12 TRAP_E_BAD_IFC_INDEX
56  "Bad parameters of function", // 13 TRAP_E_BAD_FPARAMS
57  "Input/Output error", // 14 TRAP_E_IO_ERROR
58  "Interface was terminated during read/write", // 15 TRAP_E_TERMINATED
59  "Interface was not selected for read/write", // 16 TRAP_E_NOT_SELECTED
60  "TLS certificate verification failed", // 17 TRAP_E_BAD_CERT
61  0,0, // 18-19 unused
62  0,0,0,0,0,0,0,0,0,0, // 20-29 unused
63  0,0,0,0,0,0,0,0,0,0, // 30-39 unused
64  0,0,0,0,0,0,0,0,0,0, // 40-49 unused
65  0,0,0,0,0,0,0,0,0,0, // 50-59 unused
66  0,0,0,0,0,0,0,0,0,0, // 60-69 unused
67  0,0,0,0,0,0,0,0,0,0, // 70-79 unused
68  0,0,0,0,0,0,0,0,0,0, // 80-89 unused
69  0,0,0,0,0,0,0,0,0,0, // 90-99 unused
70  0,0,0,0,0,0,0,0,0,0, // 100-109 unused
71  0,0,0,0,0,0,0,0,0,0, // 110-119 unused
72  0,0,0,0,0,0,0,0,0,0, // 120-129 unused
73  0,0,0,0,0,0,0,0,0,0, // 130-139 unused
74  0,0,0,0,0,0,0,0,0,0, // 140-149 unused
75  0,0,0,0,0,0,0,0,0,0, // 150-159 unused
76  0,0,0,0,0,0,0,0,0,0, // 160-169 unused
77  0,0,0,0,0,0,0,0,0,0, // 170-179 unused
78  0,0,0,0,0,0,0,0,0,0, // 180-189 unused
79  0,0,0,0,0,0,0,0,0,0, // 190-199 unused
80  0,0,0,0,0,0,0,0,0,0, // 200-209 unused
81  0,0,0,0,0,0,0,0,0,0, // 210-219 unused
82  0,0,0,0,0,0,0,0,0,0, // 220-229 unused
83  0,0,0,0,0,0,0,0,0,0, // 230-239 unused
84  0,0,0,0,0,0,0,0,0,0, // 240-249 unused
85  0,0,0,0, // 250-253 unused
86  "TRAP library not initialized", // 254 TRAP_E_NOT_INITIALIZED
87  "Memory allocation error", // 255 TRAP_E_MEMORY
88 };
89 
const char * default_err_msg[256]
Definition: trap_error.c:49
Error handling for TRAP.