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.

cmStrStream.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //| Copyright: (C) 2009-2020 Kevin Larke <contact AT larke DOT org>
  2. //| License: GNU GPL version 3.0 or above. See the accompanying LICENSE file.
  3. #ifndef cmStrStream_h
  4. #define cmStrStream_h
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. //( { file_desc:"String stream text sink." kw:[text] }
  9. enum
  10. {
  11. kOkSsRC = cmOkRC,
  12. kLHeapMemFailSsRC
  13. };
  14. typedef cmHandle_t cmStrStreamH_t;
  15. typedef cmRC_t cmSsRC_t;
  16. extern cmStrStreamH_t cmStrStreamNullHandle;
  17. // If 'dfltBlkByteCnt' 'is set to 0 then the dfltBlkByteCnt is internally set to 4096.
  18. cmSsRC_t cmOStrStreamCreate( cmCtx_t* ctx, cmStrStreamH_t* hp, unsigned dfltBlkByteCnt );
  19. cmSsRC_t cmOStrStreamDestroy( cmStrStreamH_t* hp );
  20. bool cmOStrStreamIsValid( cmStrStreamH_t h );
  21. cmSsRC_t cmOStrStreamWrite( cmStrStreamH_t h, const void* dp, unsigned byteCnt );
  22. cmSsRC_t cmOStrStreamWriteStr( cmStrStreamH_t h, const cmChar_t* str );
  23. cmSsRC_t cmOStrStreamWriteStrN( cmStrStreamH_t h, const cmChar_t* str, unsigned n );
  24. cmSsRC_t cmOStrStreamVPrintf( cmStrStreamH_t h, const cmChar_t* fmt, va_list vl );
  25. cmSsRC_t cmOStrStreamPrintf( cmStrStreamH_t h, const cmChar_t* fmt, ... );
  26. unsigned cmOStrStreamByteCount( cmStrStreamH_t h );
  27. void* cmOStrStreamAllocBuf( cmStrStreamH_t h );
  28. cmChar_t* cmOStrStreamAllocText( cmStrStreamH_t h );
  29. //)
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif