string-to-native

Function

Package: excl

Arguments: string &key (start 0) (end (length string)) address (external-format :default)

Return values are an address and bytes-copied.

This function converts (according to the external-format argument) and copies the string data from indices specified by start to end out of the Lisp string into static (ie, non-lisp heap) memory and returns an address to the first character of that data.

If the address argument is specified, then its value will be used (and returned) as the destination address and new memory will not be allocated. If the address argument is not specified, then the resulting memory address (first returned value) must be passed to aclfree to be reclaimed.

The copied string data will be null-terminated, ie, the byte following the last data element is 0. The number of 8-bit bytes copied including the null-terminator is returned as the second value of this function.

By default, this function will convert to the native representation assumed for foreign function strings. Under International Allegro CL, this conversion is to EUC (ie, external-format :euc) under Unix, and to Windows MultiByte (ie, external-format :mb) under Windows. Overriding the default external-format is not supported in this Allegro CL release. When :default is specified, the value of *default-external-format* is used.

See also iacl.htm for general information on international character set support in Allegro CL. See foreign-functions.htm for information on foreign functions.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.