/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/Error.h

  • Committer: Gustav Hartvigsson
  • Date: 2015-06-04 17:36:18 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150604173618-qobcg09u33eyrpfd
* started work SBox (Untested).
* Fixed compilation errors.
* added more macros and made use of them.
* Added more documentation.
* Made s_object_get_class return a SObjectClass pointer instead.
* Reorderd S_TYPE_* enum.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 */
42
42
typedef struct SErrorPrivate SErrorPrivate;
43
43
 
44
 
 
45
44
/**
46
45
 * An SError is a data structure that inherits from SBaseObjectInstance.
47
46
 * 
61
60
  
62
61
} SErrorClass;
63
62
 
 
63
#define S_ERROR(o) (SError *)(o)
 
64
#define S_ERROR_CLASS(k) (SErrorClass *)(k)
 
65
 
64
66
/** @brief
65
67
 * The different error types.
66
68
 */
78
80
/**
79
81
 * Holds the names of the string version of SErrorType.
80
82
 */
81
 
static const char *  SErrorTypeName[] __attribute__((unused)) = {
 
83
static char *  SErrorTypeName[] __attribute__((unused)) = {
82
84
  "NONE",
83
85
  "INPUT/OUTPUT",
84
86
  "OVERFLOW",
85
 
  0x0,
86
 
  0x0,
87
 
  0x0,
 
87
  "UNUSED_0/INVALID",
 
88
  "UNUSED_1/INVALID",
 
89
  "UNUSED_2/INVALID",
88
90
  "OTHER",
89
91
  "NULL",
90
92
  0x0,
91
93
  0x0
92
94
};
93
95
 
 
96
/**
 
97
 * @brief
 
98
 * Function to get the same of an error.
 
99
 * 
 
100
 * For use in bindings.
 
101
 *
 
102
 * @param k The key to look up.
 
103
 */
 
104
char * s_error_get_name (SErrorType k);
94
105
 
95
106
/**
96
107
 * the constructor for the an SError