News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Two new functions for the stdlib

Started by Randall Hyde, February 08, 2008, 05:09:47 PM

Previous topic - Next topic

Randall Hyde

Hi All,

I'm in the process of adding two new string functions to the stdlib that should have been added years ago: str.bufToStr and str.a_bufToStr.  These functions have the following prototypes:

procedure str.bufToStr( startBuf:dword; endBuf:dword; dest:string );
procedure str.a_bufToStr( startBuf:dword; endBuf:dword ); @returns( "(type string eax)" );

"startBuf" points at the beginning of some buffer (presumably containing characters in a string) and "endBuf" points one byte beyond the end of the buffer. These functions convert the sequence of characters between the two pointers into an HLA string and either store the result in "dest" or allocate a new string on the heap and store the data there (a_bufToStr).

These functions raise an exception of endBuf < startBuf, if either dest, endBuf, or startBuf are NULL (or otherwise contain illegal pointers), or if the space allocated for dest is insufficient to hold the string.

I'll be adding these functions to the source forge repository today and they will appear in the v1.101 release of HLA (whenever that appears).
hLater,
Randy Hyde