Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

PERM_STRDUP

The PERM_STRDUP macro is a platform-independent substitute for the C library routine strdup. This macro creates a new copy of a string in memory that persists after the request that is being processed has been completed. If pooled memory has been disabled in the configuration file with the pool-init built-in SAF, PERM_STRDUP and STRDUP both obtain their memory from the system heap.

The PERM_STRDUP routine is functionally equivalent to:


newstr = (char *) PERM_MALLOC(strlen(str) + 1);strcpy(newstr, str);

         

A string created with PERM_STRDUP should be disposed with PERM_FREE.

Syntax

char *PERM_STRDUP(char *ptr);

Returns

A pointer to the new string.

Parameters

char *ptr is a pointer to a string.

See Also

PERM_MALLOC,PERM_FREE, PERM_CALLOC, PERM_REALLOC, MALLOC, FREE, STRDUP, CALLOC, REALLOC