string-to-native

$Revision: 1.1.2.2 $

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 excl: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 excl:*default-external-format* is used.

International Allegro CL is described in iacl.htm. The foreign functions implementation is described in foreign_functions.htm.

The general documentation description is in introduction.htm. The index in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.