/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.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-07-12 19:04:18 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150712190418-yi9rfito5ovnf6dy
* Made the code more easy to read.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
  char * message;
34
34
};
35
35
 
36
 
char * error_to_string_method (SObject * self);
37
 
void error_free_method (SError * self);
 
36
char *
 
37
error_to_string_method (SObject * self);
 
38
void
 
39
error_free_method (SError * self);
38
40
 
39
 
SError * s_error_new (SErrorType error, char * message) {
 
41
SError *
 
42
s_error_new (SErrorType error, char * message) {
40
43
  SError * self = malloc (sizeof (SError));
41
44
  SErrorClass * klass = malloc (sizeof (SErrorClass));
42
45
  self->priv = malloc (sizeof (SErrorPrivate));
51
54
  return self;
52
55
}
53
56
 
54
 
void s_error_free (SError * self) {
 
57
void
 
58
s_error_free (SError * self) {
55
59
  s_object_free (S_OBJECT (self));
56
60
}
57
61
 
58
 
char * error_to_string_method (SObject * obj) {
 
62
char *
 
63
error_to_string_method (SObject * obj) {
59
64
  SError * self = S_ERROR (obj);
60
65
  char * ret_val = NULL;
61
66
  char * error_type_str = NULL;
66
71
  return ret_val;
67
72
}
68
73
 
69
 
void error_free_method (SError * self) {
 
74
void
 
75
error_free_method (SError * self) {
70
76
  free (self->priv->message);
71
77
  free (self->priv);
72
78
  SErrorClass * klass = S_ERROR_CLASS (s_object_get_class (S_OBJECT (self)));
74
80
  free (self);
75
81
}
76
82
 
77
 
char * s_error_get_name (SErrorType k) {
 
83
char *
 
84
s_error_get_name (SErrorType k) {
78
85
  return SErrorTypeName[k];
79
86
}
80
87