Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
thread safe dynarray concept implementation
[simgrid.git] / win32_test_app / include / TErrno.h
1 #ifndef __ERRNO_H__
2 #define __ERRNO_H__
3
4 #include <TDefs.h>
5 #include <string.h>
6 #include <windows.h>
7
8 #define E_SUCCESS                                                                                       ((errno_t)0)                    /* Success                                                                                                                      */
9 #define E_TEST_RUNNER_ALLOCATION_FAILED                                         ((errno_t)1)                    /* Test runner allocation failed                                                                        */
10 #define E_TEST_CASE_CONTEXT_ALLOCATION_FAILED                           ((errno_t)2)                    /* Test case context allocation failed                                                          */
11 #define E_BUFFER_ALLOCATION_FAILED                                                      ((errno_t)3)                    /* Buffer allocation failed                                                                                     */
12 #define E_BUFFER_DATA_ALLOCATION_FAILED                                         ((errno_t)4)                    /* Buffer data allocation failed                                                                        */
13 #define E_TEST_SUITE_ALLOCATION_FAILED                                          ((errno_t)5)                    /* Test suite allocation failed                                                                         */
14 #define E_FILE_NOT_FOUND                                                                        ((errno_t)6)                    /* Ffile not found                                                                                                              */
15 #define E_BAD_USAGE                                                                                     ((errno_t)7)                    /* Bad usage                                                                                                            */
16 #define E_INVALID_FILE_Stream                                                           ((errno_t)8)                    /* Invalid file stream                  */
17 #define E_STREAM_ALLOCATION_FAILED                                                      ((errno_t)9)                    /* Stream allocation failed                                     */
18 #define E_Buffer_DATA_REALLOCATION_FAILED                                       ((errno_t)10)                   /* Buffer data reallocation failed                                                                      */
19 #define E_STREAM_LINE_ALLOCATION_FAILED                                         ((errno_t)11)                   /* Stream line allocation failed */
20 #define E_STREAM_LINE_REALLOCATION_FAILED                                       ((errno_t)12)                   /* Stream line reallocation failed */
21 #define E_STREAM_EMPTY                                                                          ((errno_t)13)                   /* File empty   */
22 #define E_STREAM_ERROR                                                                          ((errno_t)14)                   /* File error   */
23 #define E_UNKWN_META_COMMAND                                                            ((errno_t)15)                   /* Unknown meta command detected */
24 #define E_INVALID_TIMEOUT_VALUE                                                         ((errno_t)16)                   /* Invalid timeout value                        */
25 #define E_INVALID_EXIT_CODE_VALUE                                                       ((errno_t)17)                   /* Invalid exit code                            */
26 #define E_INVALID_EXPORT                                                                        ((errno_t)18)                   /* Invalid export meta command          */
27 #define E_INVALID_UNSET                                                                         ((errno_t)19)                   /* Invalid unset meta command           */
28 #define E_EXPORT_FAILED                                                                         ((errno_t)20)                   /* Export failed*/
29 #define E_UNSET_FAILED                                                                          ((errno_t)21)                   /* Unset failed*/
30 #define E_SYNC_TEST_CASE_ALLOCATION_FAILED                                      ((errno_t)22)                   /* Synchrone test case allocation failed        */
31 #define E_CANNOT_CREATE_CHILD_STDOUT_READ_HANDLE                        ((errno_t)23)                   /* Can't create the child std output read handle */
32 #define E_CANNOT_CREATE_CHILD_STDERR_READ_HANDLE                        ((errno_t)24)                   /* Can't create the child std error read handle */ 
33 #define E_CANNOT_CREATE_CHILD_STDIN_WRITE_HANDLE                        ((errno_t)25)                   /* Can't create the child std input write handle*/
34 #define E_CANNOT_CREATE_STDOUT_READ_HANDLE                                      ((errno_t)26)                   /* Can't create the std output handle                   */
35 #define E_CANNOT_CREATE_STDIN_WRITE_HANDLE                                      ((errno_t)27)                   /* Can't create the std input handle                    */
36 #define E_CANNOT_CLOSE_CHILD_STDIN_TEMPORY_HANDLE                       ((errno_t)28)                   /* Can't close the tempory child std input handle*/
37 #define E_CANNOT_CLOSE_CHILD_STDOUT_TEMPORY_HANDLE                      ((errno_t)29)                   /* Can't close the tempory child std output handle*/
38 #define E_CANNOT_CREATE_CHILD_PROCESS                                           ((errno_t)30)                   /* Can't create the child process                                       */
39 #define E_CANNOT_CLOSE_PROCESS_THREAD_HANDLE                            ((errno_t)31)                   /* Can't close the child process handle                         */
40 #define E_CANNOT_CLOSE_CHILD_STDOUT_HANDLE                                      ((errno_t)32)                   /* Can't close the child std output handle                      */
41 #define E_CANNOT_CLOSE_CHILD_STDIN_HANDLE                                       ((errno_t)33)                   /* Can't close the child std input handle                       */
42 #define E_CANNOT_CLOSE_CHILD_STDERR_HANDLE                                      ((errno_t)34)                   /* Can't close the child std error handle                       */
43 #define E_CANNOT_WRITE_ON_CHILD_STDIN                                           ((errno_t)35)                   /* Can't write on child std output                                      */
44 #define E_CANNOT_CREATE_READ_CHILD_OUTPUT_THREAD                        ((errno_t)36)                   /* Can't create the read child output thread            */
45 #define E_WAIT_THREAD_FAILED                                                            ((errno_t)37)                   /* Wait thread failed                                                           */
46 #define E_CANNOT_CLOSE_THREAD_HANDLE                                            ((errno_t)38)                   /* Can't close thread handle                                            */
47 #define E_CANNOT_CLOSE_READ_HANDLE                                                      ((errno_t)39)                   /* Can't close the read handle                                          */
48 #define E_CANNOT_CLOSE_WRITE_HANDLE                                                     ((errno_t)40)                   /* Can't close the write handle                                         */
49 #define E_WAIT_FAILURE                                                                          ((errno_t)41)                   /* Wait failure                                                                         */
50 #define E_CANNOT_CLOSE_PROCESS_HANDLE                                           ((errno_t)42)                   /* Can't close the process handle                                       */
51 #define E_OUTPUT_DONT_MATCH                                                                     ((errno_t)43)                   /* Output don't match                                                           */
52 #define E_OPEN_FILE_FAILED                                  ((errno_t)44)           /* Open file failed*/
53 #define E_INVALID_TOKEN                                     ((errno_t)45)           /* Invalid token*/
54 #define E_WAIT_TIMEOUT                                      ((errno_t)46)           /* Wait timeout detected  */
55 #define E_EXIT_CODE_DONT_MATCH                              ((errno_t)47)           /* Exit code don't match    */
56 #define E_CHANGE_DIRECTORY_FAILED                           ((errno_t)48)           /* Change directory failed  */
57
58 /* error message list */
59 static const char * __errlist[ ] =
60 {
61         "Success",
62         "Test runner allocation failed",
63         "Test case context allocation failed",
64         "Buffer allocation failed",
65         "Buffer data allocation failed",
66         "Test suite allocation failed",
67         "File not found",
68         "Bad usage",
69         "Invalid file stream",
70         "Stream allocation failed",
71         "Buffer data reallocation failed",
72         "Stream line allocation failed",
73         "Stream line reallocation failed",
74         "File empty",
75         "File error",
76         "Unknown meta command detected",
77         "Invalid timeout value",
78         "Invalid exit code",
79         "Invalid export meta command",
80         "Invalid unset meta command",
81         "Export failed",
82         "Unset failed",
83         "Synchrone test case allocation failed",
84         "Can't create the child std output read handle",
85         "Can't create the child std error read handle",
86         "Can't create the child std input write handle",
87         "Can't create the std output handle",
88         "Can't create the std input handle",
89         "Can't close the tempory child std input handle",
90         "Can't close the tempory child std output handle",
91         "Can't create the child process",
92         "Can't close the child process handle",
93         "Can't close the child std output handle",
94         "Can't close the child std input handle",
95         "Can't close the child std error handle",
96         "Can't write on child std output",
97         "Can't create the read child output thread",
98         "Wait thread failed",
99         "Can't close thread handle",
100         "Can't close the read handle",
101         "Can't close the write handle",
102         "Wait failure",
103         "Can't close the process handle",
104         "Output don't match",
105         "Open file failed",
106         "Invalid token",
107         "Wait timeout detected",
108         "Exit code don't match",
109     "Change directory failed"
110 };
111
112 extern void initializeErrno(void);
113
114 extern void terminateErrno(void);
115
116 extern void setErrno(errno_t e);
117
118 extern errno_t getErrno(void);
119
120 #endif /* #ifndef __ERRNO_H__ */