version 1.47, 2013/03/29 10:30:32
|
version 1.48, 2013/03/29 11:05:59
|
Line 960
|
Line 960
|
#define setString(object, string) do { \ |
#define setString(object, string) do { \ |
ifIsString(object) \ |
ifIsString(object) \ |
{ \ |
{ \ |
if ((*object).nombre_occurrences > 1) \ |
if (string == NULL) executionError("Nullified string"); else \ |
{ \ |
{ \ |
struct_objet *__tmp_object; \ |
if ((*object).nombre_occurrences > 1) \ |
if ((__tmp_object = copie_objet(object, 'O')) == NULL) \ |
{ \ |
|
struct_objet *__tmp_object; \ |
|
if ((__tmp_object = copie_objet(object, 'O')) == NULL) \ |
|
systemError("Memory allocation error"); \ |
|
liberation(object); \ |
|
object = __tmp_object; \ |
|
} \ |
|
free((unsigned char *) (*object).objet); \ |
|
if (((*object).objet = malloc((strlen(string) + 1) * \ |
|
sizeof(unsigned char))) == NULL) \ |
systemError("Memory allocation error"); \ |
systemError("Memory allocation error"); \ |
liberation(object); \ |
strcpy((char *) (*object).objet, string); \ |
object = __tmp_object; \ |
|
} \ |
} \ |
free((unsigned char *) (*object).objet); \ |
|
if (((*object).objet = malloc((strlen(string) + 1) * \ |
|
sizeof(unsigned char))) == NULL) \ |
|
systemError("Memory allocation error"); \ |
|
strcpy((char *) (*object).objet, string); \ |
|
} \ |
} \ |
else executionError("Type mistmatch error"); } while(0) |
else executionError("Type mistmatch error"); } while(0) |
|
|