bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
1 |
/*
|
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
2 |
Copyright (c) 2013-2014 Gustav Hartvigsson
|
3 |
||
4 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5 |
of this software and associated documentation files (the "Software"), to deal
|
|
6 |
in the Software without restriction, including without limitation the rights
|
|
7 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8 |
copies of the Software, and to permit persons to whom the Software is
|
|
9 |
furnished to do so, subject to the following conditions:
|
|
10 |
||
11 |
The above copyright notice and this permission notice shall be included in
|
|
12 |
all copies or substantial portions of the Software.
|
|
13 |
||
14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20 |
THE SOFTWARE.
|
|
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
21 |
*/
|
22 |
||
23 |
/** @file */
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
24 |
|
25 |
#ifndef __H_ERROR__
|
|
26 |
#define __H_ERROR__
|
|
27 |
||
28 |
#include "baseobject.h" |
|
|
5.2.8
by Gustav Hartvigsson
* Copied over LinkedList and DynamicArray from c_sdl_js |
29 |
#include "defs.h" |
30 |
#include "utils" |
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
31 |
#include <limits.h> |
32 |
#include <stdlib.h> |
|
33 |
#include <stdio.h> |
|
34 |
#include <string.h> |
|
35 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
36 |
/**
|
37 |
* An opaque datastructure that holds the SError's private data.
|
|
38 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
39 |
typedef struct _SErrorPrivate SErrorPrivate; |
40 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
41 |
|
42 |
/**
|
|
|
19
by Gustav Hartvigsson
* Woops |
43 |
* An SError is a data structure that inherits from SBaseObjectInstance.
|
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
44 |
*
|
45 |
* An SError represents an error that can occur.
|
|
46 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
47 |
typedef struct _SError { |
48 |
SBaseObjectInstance parent; |
|
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
49 |
SErrorPrivate * priv; /** Pimple pointer to the private data. */ |
|
3
by Gustav Hartvigsson
Fixed a few things... |
50 |
|
51 |
} SError; |
|
52 |
||
53 |
/**
|
|
54 |
* The error class is not changed, no extra methods are needed.
|
|
55 |
*/
|
|
56 |
typedef struct _SErrorClass { |
|
57 |
SBaseObjectClass parent_class; |
|
58 |
|
|
59 |
} SErrorClass; |
|
60 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
61 |
/** @brief
|
62 |
* The different error types.
|
|
63 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
64 |
typedef enum { |
|
8
by Gustav Hartvigsson
* Fixed a DoxyGen error documentation error of an enum. |
65 |
S_ERROR_NONE = 0, /**< Not on error */ |
66 |
S_ERROR_INPUT_OUTPUT, /**< An I/O error */ |
|
67 |
S_ERROR_OVERFLOW, /**< An Overflow error */ |
|
68 |
S_ERROR_OTHER = INT_MAX - 1, /**< Some unknowned error */ |
|
69 |
S_ERROR_NULL = INT_MAX /**< An NULL error */ |
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
70 |
} SErrorType; |
71 |
||
72 |
||
73 |
/**
|
|
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
74 |
* the constructor for the an SError
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
75 |
*/
|
76 |
SError * s_error_new (SErrorType error, char * message); |
|
77 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
78 |
/**
|
79 |
* This function calles the deinitize method of the object.
|
|
80 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
81 |
void s_error_free (SError * self); |
82 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
83 |
/**
|
84 |
* This function returns the ErrorType of on object.
|
|
85 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
86 |
SErrorType s_error_get_error_type (SError * self); |
87 |
||
|
5.1.1
by Gustav Hartvigsson
* Started work on making the code more prasable by DoxyGen. |
88 |
/**
|
89 |
* This function prints the current error to stdout.
|
|
90 |
*/
|
|
|
3
by Gustav Hartvigsson
Fixed a few things... |
91 |
void s_error_print_error (SError * self); |
92 |
||
93 |
#endif
|