sprintf.h File Reference

Macros for typed block memory copy operations. More...

Go to the source code of this file.

Defines

#define INC_OSKI_SPRINTF_H
 oski/sprintf.h included.

Functions

char * oski_StringPrintf (const char *fmt,...)
 Safe implementation of 'sprintf' which returns a newly allocated string of the appropriate length to contain the desired formatted string.


Detailed Description

Macros for typed block memory copy operations.


Define Documentation

#define INC_OSKI_SPRINTF_H

oski/sprintf.h included.


Function Documentation

char* oski_StringPrintf ( const char *  fmt,
  ... 
)

Safe implementation of 'sprintf' which returns a newly allocated string of the appropriate length to contain the desired formatted string.

Safe implementation of 'sprintf' which returns a newly allocated string of the appropriate length to contain the desired formatted string.

Returns NULL on error. Otherwise, returns a newly allocated string containing the formatted output.

Note:
From David Martin at Berkeley: On AIX, Linux, and Solaris, vsnprintf() returns a value < len if the string buffer is sufficiently large to contain the formatted string, while the usual Irix implementation returns 0. Other systems are rumored to return a negative value on error. The 'if' condition below catches all 3 cases.

Here, we use 'len-1' to include the terminating NULL character.

References oski_Free, oski_Malloc, oski_StringPrintf(), and oski_ZeroMem().

Referenced by BCSR_GetKernel(), MBCSR_GetSubmatKernel(), oski_MakeModuleDesc(), oski_MakeModuleName(), and oski_StringPrintf().


Generated on Fri Apr 8 22:35:19 2011 for BeBOP Optimized Sparse Kernel Interface Library by  doxygen 1.5.9