cmSymTbl.h/c: Added cmSymTblRegisterFmt()

This commit is contained in:
kevin 2013-03-01 17:23:46 -08:00
parent 3e3b1e2aa9
commit 66cf71e419
2 changed files with 19 additions and 0 deletions

View File

@ -261,6 +261,22 @@ unsigned cmSymTblRegisterSymbol( cmSymTblH_t h, const char* label )
unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label ) unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label )
{ return cmSymTblRegister( h, label, true ); } { return cmSymTblRegister( h, label, true ); }
unsigned cmSymTblRegisterVFmt( cmSymTblH_t h, const cmChar_t* fmt, va_list vl )
{
unsigned n = vsnprintf(NULL,0,fmt,vl);
cmChar_t b[n+1];
vsnprintf(b,n,fmt,vl);
return cmSymTblRegister(h,fmt,vl);
}
unsigned cmSymTblRegisterFmt( cmSymTblH_t h, const cmChar_t* fmt, ... )
{
va_list vl;
va_start(vl,fmt);
cmSymTblRegisterVFmt(h,fmt,vl);
va_end(vl);
}
bool cmSymTblRemove( cmSymTblH_t h, unsigned symId ) bool cmSymTblRemove( cmSymTblH_t h, unsigned symId )

View File

@ -37,6 +37,9 @@ extern "C" {
unsigned cmSymTblRegisterSymbol( cmSymTblH_t h, const char* label ); unsigned cmSymTblRegisterSymbol( cmSymTblH_t h, const char* label );
unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label ); unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label );
unsigned cmSymTblRegisterVFmt( cmSymTblH_t h, const cmChar_t* fmt, va_list vl );
unsigned cmSymTblRegisterFmt( cmSymTblH_t h, const cmChar_t* fmt, ... );
bool cmSymTblRemove( cmSymTblH_t h, unsigned symId ); bool cmSymTblRemove( cmSymTblH_t h, unsigned symId );
// Given a symbol id return the associated label. // Given a symbol id return the associated label.