libcm is a C development framework with an emphasis on audio signal processing applications.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

cmCtx.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //( { file_desc:"Global application context record." kw[base] }
  2. //
  3. // cmCtx_t is used to hold application supplied cmRpt_t, cmErr_t and
  4. // other global values for easy distribution throughtout a cm based application.
  5. //
  6. // Most the libcm components need at least an application supplied cmRpt_t function
  7. // to initialize their own internal cmErr_t error class. Likewise classes which
  8. // use a cmLHeapH_t based internal heap manager require application wide memory
  9. // manager configuration information. The cmCtx_t packages this information and
  10. // allows it to be easily distributed. The applicaton and its constituent objects
  11. // then need only maintain and pass pointers to a single cmCtx_t object to have access to
  12. // all the global program information.
  13. //)
  14. #ifndef cmCtx_h
  15. #define cmCtx_h
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. //(
  20. // cmCtx_t data type.
  21. typedef struct
  22. {
  23. cmRpt_t rpt; // Application supplied global reporter. This reporter is also use by \ref err.
  24. cmErr_t err; // Application error reporter which can be used to report errors prior to the client object being initialized to the point where it can use it's own cmErr_t.
  25. unsigned guardByteCnt; // Guard byte count in use by \ref cmMallocDebug.h .
  26. unsigned alignByteCnt; // Align byte count used by the \ref cmMallocDebug.h
  27. unsigned mmFlags; // Initialization flags used by \ref cmMallocDebug.h.
  28. void* userDefPtr; // Application defined pointer.
  29. } cmCtx_t;
  30. // cmCtx_t initialization function.
  31. void cmCtxSetup(
  32. cmCtx_t* ctx, // The cmCtx_t to initialize.
  33. const cmChar_t* title, // The cmCtx_t error label. See cmErrSetup().
  34. cmRptPrintFunc_t prtFunc, // The printFunc() to assign to the cmCtx_t.rpt.
  35. cmRptPrintFunc_t errFunc, // The errFunc() to assign to cmCtx_t.rpt.
  36. void* cbPtr, // Callback data to use with prtFunc() and errFunc().
  37. unsigned guardByteCnt,// Guard byte count used to configure \ref cmMallocDebug.h
  38. unsigned alignByteCnt,// Align byte count used to configure \ref cmMallocDebug.h
  39. unsigned mmFlags // Initialization flags used to configure \ref cmMallocDebug.h
  40. );
  41. //)
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif