libcm is a C development framework with an emphasis on audio signal processing applications.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

cmSymTbl.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef cmSymTbl_h
  2. #define cmSymTbl_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //{
  7. //(
  8. // Symbol table component.
  9. //)
  10. //(
  11. typedef cmHandle_t cmSymTblH_t;
  12. extern cmSymTblH_t cmSymTblNullHandle;
  13. // Create a new symbol table.
  14. // 'parentH' is a parent table embedded in this table and is optional. Set this
  15. // value to 'cmSymTblNullHandle'. if the table does not have a parent.
  16. //
  17. // All symbol searches will include this table however all symbols registered with
  18. // this table will be inserted in this table not the parent.
  19. //
  20. // 'baseSymId' is the minimum symbol id used by this table and will be returned
  21. // as the value of the first symbol registered with this table. Subsequent symbols
  22. // will increment this value. Internal assertions prevent the symbol id range
  23. // of this table from overlapping with its parent.
  24. cmSymTblH_t cmSymTblCreate( cmSymTblH_t parentH, unsigned baseSymId, cmCtx_t* ctx );
  25. // Destroy and release the resources associated with a symbol table created by
  26. // an earlier call to cmSymTblCreate().
  27. void cmSymTblDestroy( cmSymTblH_t* hp );
  28. // Register a symbol label. Set 'staticFl' to true if the label is allocated statically.
  29. unsigned cmSymTblRegister( cmSymTblH_t h, const char* label, bool staticFl );
  30. unsigned cmSymTblRegisterSymbol( cmSymTblH_t h, const char* label );
  31. unsigned cmSymTblRegisterStaticSymbol( cmSymTblH_t h, const char* label );
  32. unsigned cmSymTblRegisterVFmt( cmSymTblH_t h, const cmChar_t* fmt, va_list vl );
  33. unsigned cmSymTblRegisterFmt( cmSymTblH_t h, const cmChar_t* fmt, ... );
  34. bool cmSymTblRemove( cmSymTblH_t h, unsigned symId );
  35. // Given a symbol id return the associated label.
  36. const char* cmSymTblLabel( cmSymTblH_t h, unsigned symId );
  37. // Given a symbol label return the associated id or cmInvalidId if the symbol could not be found.
  38. unsigned cmSymTblId( cmSymTblH_t h, const char* label );
  39. // Returns true if the symbol table handle is not valid otherwise returns false.
  40. bool cmSymTblIsValid( cmSymTblH_t h );
  41. // Returns true if 'symId' is stored in this symbol table or its parent otherwise returns false.
  42. bool cmSymTblIsValidId( cmSymTblH_t h, unsigned symId );
  43. // Print thes symbol table (but not its parent).
  44. void cmSymTblReport( cmSymTblH_t h );
  45. // Symbol table test stub.
  46. void cmSymTblTest(cmCtx_t* ctx);
  47. //)
  48. //}
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif