chprintf.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file chprintf.h
  15. * @brief Mini printf-like functionality.
  16. *
  17. * @addtogroup HAL_CHPRINTF
  18. * @{
  19. */
  20. #ifndef CHPRINTF_H
  21. #define CHPRINTF_H
  22. #include <stdarg.h>
  23. /**
  24. * @brief Float type support.
  25. */
  26. #if !defined(CHPRINTF_USE_FLOAT) || defined(__DOXYGEN__)
  27. #define CHPRINTF_USE_FLOAT FALSE
  28. #endif
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap);
  33. int chprintf(BaseSequentialStream *chp, const char *fmt, ...);
  34. int chsnprintf(char *str, size_t size, const char *fmt, ...);
  35. int chvsnprintf(char *str, size_t size, const char *fmt, va_list ap);
  36. #ifdef __cplusplus
  37. }
  38. #endif
  39. #endif /* CHPRINTF_H */
  40. /** @} */