libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. bool cmSymTblRemove( cmSymTblH_t h, unsigned symId );
  33. // Given a symbol id return the associated label.
  34. const char* cmSymTblLabel( cmSymTblH_t h, unsigned symId );
  35. // Given a symbol label return the associated id or cmInvalidId if the symbol could not be found.
  36. unsigned cmSymTblId( cmSymTblH_t h, const char* label );
  37. // Returns true if the symbol table handle is not valid otherwise returns false.
  38. bool cmSymTblIsValid( cmSymTblH_t h );
  39. // Returns true if 'symId' is stored in this symbol table or its parent otherwise returns false.
  40. bool cmSymTblIsValidId( cmSymTblH_t h, unsigned symId );
  41. // Print thes symbol table (but not its parent).
  42. void cmSymTblReport( cmSymTblH_t h );
  43. // Symbol table test stub.
  44. void cmSymTblTest(cmCtx_t* ctx);
  45. //)
  46. //}
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif