Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

System Utilities

Collaboration diagram for System Utilities:


Files

file  psString.h
 -*- mode: C; c-basic-indent: 4; tab-width: 8; indent-tabs-mode: nil -*- vim: set cindent ts=8 sw=4 expandtab: Contains the declarations of string utility functions

Modules

 Memory Management Utilities
 This is the generic memory management system put inbetween the user's high level code and the OS-level memory allocation routines.
 Tracing and Logging
 Error Handling
 Configure psLib

Functions

char * psStringCopy (const char *str)
 Copies the input string.
char * psStringNCopy (const char *str, psS32 nChar)
 Copies the input string up to the specified number of characters.
ssize_t psStringAppend (char **dest, const char *format,...)
 Appends a format onto a string.
ssize_t psStringPrepend (char **dest, const char *format,...)
 Prepends a format onto a string.


Function Documentation

ssize_t psStringAppend char **  dest,
const char *  format,
  ...
 

Appends a format onto a string.

This function shall allocate a new string if dest is NULL. dest shall be automatically extended to the size of the new string.

Returns:
The length of the new string (excluding '')
Parameters:
dest  existing string
format  format to append

char* psStringCopy const char *  str  ) 
 

Copies the input string.

This function shall allocate memory to the length of the input string plus one and copy the input string to the newly allocated memory.

Returns:
char* Copy of input string
Parameters:
str  Input string of characters to copy

char* psStringNCopy const char *  str,
psS32  nChar
 

Copies the input string up to the specified number of characters.

This function shall allocate memory to the length specified by nChar plus one and copy the input string to the newly allocated memory. This function will only copy nChar bytes from the input to new string, so if the input string is larger than nChar characters the copied string will be a substring of the input string. If the input string is smaller than nChar bytes then the remaining bytes allocated will be set to NULL.

Returns:
char* Copy of input string
Parameters:
str  Input string of characters to copy
nChar  Number of bytes to allocate for string copy

ssize_t psStringPrepend char **  dest,
const char *  format,
  ...
 

Prepends a format onto a string.

This function shall allocate a new string if dest is NULL. dest shall be automatically extended to the size of the new string.

Returns:
The length of the new string (excluding '')
Parameters:
dest  existing string
format  format to append


Generated on Wed Jun 15 11:01:14 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.1