diff --git a/cmSymTbl.c b/cmSymTbl.c index c90bbb5..6d74b84 100644 --- a/cmSymTbl.c +++ b/cmSymTbl.c @@ -261,6 +261,22 @@ unsigned cmSymTblRegisterSymbol( cmSymTblH_t h, const char* label ) unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label ) { 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 ) diff --git a/cmSymTbl.h b/cmSymTbl.h index 51a3fc5..d123e3b 100644 --- a/cmSymTbl.h +++ b/cmSymTbl.h @@ -37,6 +37,9 @@ extern "C" { unsigned cmSymTblRegisterSymbol( 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 ); // Given a symbol id return the associated label.