# Compiled by:
#
src/lib/c-glue-lib/internals/c-internals.lib# Functions for translating between 0-terminated C strings and native
# Mythryl strings.
#
# (C) 2001, Lucent Technologies, Bell Laboratories
#
# author: Matthias Blume (blume@research.bell-labs.com)
api Zstring {
Zstring ( C ) = c::Ptr( c::Chunk( c::Uchar, C ) );
Zstring'( C ) = c::Ptr'( c::Chunk( c::Uchar, C ) );
# The C strlen function:
length: Zstring ( C ) -> Int;
length': Zstring'( C ) -> Int;
# Make Mythryl string from 0-terminated C string:
to_ml: Zstring ( C ) -> String;
to_ml': Zstring'( C ) -> String;
# Copy contents of Mythryl string into C string and add terminating 0.
cp_ml: { from: String, to: Zstring ( c::Rw ) } -> c::Void;
cp_ml': { from: String, to: Zstring'( c::Rw ) } -> c::Void;
# Make C-duplicate of Mythryl string (allot memory and then copy).
dup_ml: String -> Zstring( C );
dup_ml': String -> Zstring'( C );
};