uLib  User mode C/C++ extended API library for Win32 programmers.
String Allocation and Duplication

Module Description

String duplication/allocation.
Preferred alternatives to strdup().

Note: These string duplicators add two NUL terminator TCHARs.
The second is added so the strings can be easily used as multi-sz arguments.

Note
mem_ADupWStr(), mem_WDupAStr(), and mem_AllocUniStr()
also belong in this group, but doxygen can't include them in multiple groups.

Macros

#define mem_DupStr   mem_DupAStr
 
#define mem_AllocStr   mem_AllocAStr
 

Functions

CSTR newStr (CSTR Src)
 
TSTR newStrBuf (WORD nChar)
 
CSTR deleteStr (CSTR Dup)
 
WCSTR newWStr (WCSTR Src)
 
WCSTR deleteWStr (WCSTR Dup)
 
ASTR mem_DupAStr (ACSTR Src)
 
WSTR mem_DupWStr (WCSTR Src)
 
ASTR mem_AllocAStr (WORD nChar)
 
WSTR mem_AllocWStr (WORD nChar)
 
CSTR mem_FreeStr (CSTR Dup)
 

Macro Definition Documentation

◆ mem_DupStr

#define mem_DupStr   mem_DupAStr

Definition at line 141 of file StrFunc.h.

◆ mem_AllocStr

#define mem_AllocStr   mem_AllocAStr

Definition at line 142 of file StrFunc.h.

Function Documentation

◆ newStr()

CSTR newStr ( CSTR  Src)

Transmutable string new duplicate.

Definition at line 167 of file StrFunc.cpp.

◆ newStrBuf()

TSTR newStrBuf ( WORD  nChar)

Transmutable new string buffer.

Definition at line 183 of file StrFunc.cpp.

◆ deleteStr()

CSTR deleteStr ( CSTR  Dup)

Delete duplicate, rtn NULL on success.

Definition at line 191 of file StrFunc.cpp.

◆ newWStr()

WCSTR newWStr ( WCSTR  Src)

Duplicate wide (unicode) string.

Definition at line 206 of file StrFunc.cpp.

◆ deleteWStr()

WCSTR deleteWStr ( WCSTR  Dup)

Delete duplicate, rtn NULL on success.

Definition at line 219 of file StrFunc.cpp.

◆ mem_DupAStr()

ASTR mem_DupAStr ( ACSTR  Src)

Ansi/MB string mem_Alloc() duplicate.

Definition at line 237 of file StrFunc.cpp.

◆ mem_DupWStr()

WSTR mem_DupWStr ( WCSTR  Src)

Unicode string mem_Alloc() duplicate.

Definition at line 250 of file StrFunc.cpp.

◆ mem_AllocAStr()

ASTR mem_AllocAStr ( WORD  nChar)

mem_Alloc() ANSI/MB buffer.

Definition at line 258 of file StrFunc.cpp.

◆ mem_AllocWStr()

WSTR mem_AllocWStr ( WORD  nChar)

mem_Alloc() wide-string buffer.

Definition at line 264 of file StrFunc.cpp.

◆ mem_FreeStr()

CSTR mem_FreeStr ( CSTR  Dup)

Delete duplicate, rtn NULL on success.

Definition at line 270 of file StrFunc.cpp.