2003-08-19 15:19:38 -04:00
|
|
|
/* These must be defined as macros, because they use Alloca().
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define Get_String_Stack(_from,_to) {\
|
|
|
|
int _len;\
|
|
|
|
Check_Type(_from, T_String);\
|
|
|
|
_len = STRING(_from)->size;\
|
|
|
|
Alloca ((_to), char*, _len+1);\
|
2003-08-19 15:24:23 -04:00
|
|
|
memcpy ((_to), STRING(_from)->data, _len);\
|
2003-08-19 15:19:38 -04:00
|
|
|
(_to)[_len] = '\0';\
|
|
|
|
}
|
|
|
|
|
|
|
|
#define Get_Strsym_Stack(_from,_to) {\
|
|
|
|
int _len;\
|
|
|
|
if (TYPE(_from) == T_Symbol)\
|
|
|
|
(_from) = SYMBOL(_from)->name;\
|
|
|
|
else if (TYPE(_from) != T_String)\
|
|
|
|
Wrong_Type_Combination ((_from), "string or symbol");\
|
|
|
|
_len = STRING(_from)->size;\
|
|
|
|
Alloca ((_to), char*, _len+1);\
|
2003-08-19 15:24:23 -04:00
|
|
|
memcpy ((_to), STRING(_from)->data, _len);\
|
2003-08-19 15:19:38 -04:00
|
|
|
(_to)[_len] = '\0';\
|
|
|
|
}
|