-#define GET_C_CHARPTR_EXT_DATA_ALLOCA(ptr, fmt, ptr_out) do \
-{ \
- Extcount gcceda_ignored_len; \
- CONST Bufbyte *gcceda_ptr_in = (CONST Bufbyte *) (ptr); \
- Extbyte *gcceda_ptr_out; \
- \
- GET_CHARPTR_EXT_DATA_ALLOCA (gcceda_ptr_in, \
- strlen ((char *) gcceda_ptr_in), \
- fmt, \
- gcceda_ptr_out, \
- gcceda_ignored_len); \
- (ptr_out) = (char *) gcceda_ptr_out; \
-} while (0)
-
-#define GET_C_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out)
-#define GET_CHARPTR_EXT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out)
-
-#define GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out)
-#define GET_CHARPTR_EXT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out)
-
-#define GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_EXT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out)
-#define GET_CHARPTR_EXT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_EXT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out)
-
-/* Maybe convert external charptr's data into internal format and store
- the result in alloca()'ed space.
-
- You may wonder why this is written in this fashion and not as a
- function call. With a little trickery it could certainly be
- written this way, but it won't work because of those DAMN GCC WANKERS
- who couldn't be bothered to handle alloca() properly on the x86
- architecture. (If you put a call to alloca() in the argument to
- a function call, the stack space gets allocated right in the
- middle of the arguments to the function call and you are unbelievably
- hosed.) */
-
-#ifdef MULE
-
-#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \
-{ \
- Extcount gcida_len_in = (Extcount) (len); \
- Bytecount gcida_len_out; \
- CONST Extbyte *gcida_ptr_in = (ptr); \
- Bufbyte *gcida_ptr_out = \
- convert_from_external_format (gcida_ptr_in, gcida_len_in, \
- &gcida_len_out, fmt); \
- /* If the new string is identical to the old (will be the case most \
- of the time), just return the same string back. This saves \
- on alloca()ing, which can be useful on C alloca() machines and \
- on stack-space-challenged environments. */ \
- \
- if (gcida_len_in == gcida_len_out && \
- !memcmp (gcida_ptr_in, gcida_ptr_out, gcida_len_out)) \
- { \
- (ptr_out) = (Bufbyte *) gcida_ptr_in; \
- } \
- else \
- { \
- (ptr_out) = (Extbyte *) alloca (1 + gcida_len_out); \
- memcpy ((void *) ptr_out, gcida_ptr_out, 1 + gcida_len_out); \
- } \
- (len_out) = gcida_len_out; \
-} while (0)
-
-#else /* ! MULE */
-
-#define GET_CHARPTR_INT_DATA_ALLOCA(ptr, len, fmt, ptr_out, len_out) do \
-{ \
- (ptr_out) = (Bufbyte *) (ptr); \
- (len_out) = (Bytecount) (len); \
-} while (0)
-
-#endif /* ! MULE */
-
-#define GET_C_CHARPTR_INT_DATA_ALLOCA(ptr, fmt, ptr_out) do \
-{ \
- Bytecount gccida_ignored_len; \
- CONST Extbyte *gccida_ptr_in = (CONST Extbyte *) (ptr); \
- Bufbyte *gccida_ptr_out; \
- \
- GET_CHARPTR_INT_DATA_ALLOCA (gccida_ptr_in, \
- strlen ((char *) gccida_ptr_in), \
- fmt, \
- gccida_ptr_out, \
- gccida_ignored_len); \
- (ptr_out) = gccida_ptr_out; \
-} while (0)
-
-#define GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_BINARY, ptr_out)
-#define GET_CHARPTR_INT_BINARY_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_BINARY, ptr_out, len_out)
-
-#define GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_FILENAME, ptr_out)
-#define GET_CHARPTR_INT_FILENAME_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_FILENAME, ptr_out, len_out)
-
-#define GET_C_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, ptr_out) \
- GET_C_CHARPTR_INT_DATA_ALLOCA (ptr, FORMAT_CTEXT, ptr_out)
-#define GET_CHARPTR_INT_CTEXT_DATA_ALLOCA(ptr, len, ptr_out, len_out) \
- GET_CHARPTR_INT_DATA_ALLOCA (ptr, len, FORMAT_CTEXT, ptr_out, len_out)
-
-
-/* Maybe convert Lisp string's data into ext-format and store the result in
- alloca()'ed space.
-
- You may wonder why this is written in this fashion and not as a
- function call. With a little trickery it could certainly be
- written this way, but it won't work because of those DAMN GCC WANKERS
- who couldn't be bothered to handle alloca() properly on the x86
- architecture. (If you put a call to alloca() in the argument to
- a function call, the stack space gets allocated right in the
- middle of the arguments to the function call and you are unbelievably
- hosed.) */
-
-#define GET_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out, len_out) do \
-{ \
- Extcount gseda_len_out; \
- struct Lisp_String *gseda_s = XSTRING (s); \
- Extbyte * gseda_ptr_out = \
- convert_to_external_format (string_data (gseda_s), \
- string_length (gseda_s), \
- &gseda_len_out, fmt); \
- (ptr_out) = (Extbyte *) alloca (1 + gseda_len_out); \
- memcpy ((void *) ptr_out, gseda_ptr_out, 1 + gseda_len_out); \
- (len_out) = gseda_len_out; \
-} while (0)
-
-
-#define GET_C_STRING_EXT_DATA_ALLOCA(s, fmt, ptr_out) do \
-{ \
- Extcount gcseda_ignored_len; \
- Extbyte *gcseda_ptr_out; \
- \
- GET_STRING_EXT_DATA_ALLOCA (s, fmt, gcseda_ptr_out, \
- gcseda_ignored_len); \
- (ptr_out) = (char *) gcseda_ptr_out; \
-} while (0)
-
-#define GET_STRING_BINARY_DATA_ALLOCA(s, ptr_out, len_out) \
- GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out, len_out)
-#define GET_C_STRING_BINARY_DATA_ALLOCA(s, ptr_out) \
- GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_BINARY, ptr_out)
-
-#define GET_STRING_FILENAME_DATA_ALLOCA(s, ptr_out, len_out) \
- GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out, len_out)
-#define GET_C_STRING_FILENAME_DATA_ALLOCA(s, ptr_out) \
- GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_FILENAME, ptr_out)
-
-#define GET_STRING_OS_DATA_ALLOCA(s, ptr_out, len_out) \
- GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out, len_out)
-#define GET_C_STRING_OS_DATA_ALLOCA(s, ptr_out) \
- GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_OS, ptr_out)
-
-#define GET_STRING_CTEXT_DATA_ALLOCA(s, ptr_out, len_out) \
- GET_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out, len_out)
-#define GET_C_STRING_CTEXT_DATA_ALLOCA(s, ptr_out) \
- GET_C_STRING_EXT_DATA_ALLOCA (s, FORMAT_CTEXT, ptr_out)
-