libcm is a C development framework with an emphasis on audio signal processing applications.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

cmRpt.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef cmRpt_h
  2. #define cmRpt_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //( { file_desc: "The cmRpt class provides console style output for all objects in the cm system." kw:[base]}
  7. //
  8. //
  9. // The cmRpt class provides console output style output, like stdout and stderr
  10. // for most of the classes in the cm library.
  11. //
  12. // By wrapping this functionality in a class it is possible to easily
  13. // redirect output to one or more possible console targets.
  14. //
  15. //)
  16. //(
  17. // Application supplied callback function which is called to deliver text
  18. // to the destination terminal or GUI.
  19. typedef void (*cmRptPrintFunc_t)(void* cmRptUserPtr, const cmChar_t* text);
  20. // Data record used to hold the state information.
  21. typedef struct
  22. {
  23. cmRptPrintFunc_t printFuncPtr; //< Application supplied callback text printing function as set from printFunc argument to cmRptSetup().
  24. cmRptPrintFunc_t errorFuncPtr; //< Application supplied callback error printing function as set from the errFunc argument to cmRptSetup().
  25. void* userPtr; //< Application supplied callback argument (cmRptUserPtr in cmRptPrintFunc_t) to be passed back to the application with each call to printFuncPtr() or errorFuncPtr().
  26. } cmRpt_t;
  27. // A global cmRpt_t object which can be used to initialze another cmRpt_t.
  28. extern cmRpt_t cmRptNull;
  29. // The host application calls cmRptSetup() to initialize a cmRpt object.
  30. void cmRptSetup( cmRpt_t* rpt, cmRptPrintFunc_t printFunc, cmRptPrintFunc_t errFunc, void* userPtr );
  31. // Text output functions:
  32. // Functions to print text to the application console.
  33. void cmRptPrint( cmRpt_t* rpt, const cmChar_t* text );
  34. void cmRptVPrintf( cmRpt_t* rpt, const cmChar_t* fmt, va_list vl );
  35. void cmRptPrintf( cmRpt_t* rpt, const cmChar_t* fmt, ... );
  36. // Error reporting functions:
  37. // Functions to print error messages to the application error console,
  38. void cmRptError( cmRpt_t* rpt, const cmChar_t* text );
  39. void cmRptVErrorf( cmRpt_t* rpt, const cmChar_t* fmt, va_list vl );
  40. void cmRptErrorf( cmRpt_t* rpt, const cmChar_t* fmt, ... );
  41. //)
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif