ChibiOS/HAL 9.0.0
chscanf.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*
18 This file was contributed by Alex Lewontin.
19 */
20
21/**
22 * @file chscanf.h
23 * @brief Mini scanf-like functionality.
24 *
25 * @addtogroup HAL_CHSCANF
26 * @{
27 */
28
29#ifndef CHSCANF_H
30#define CHSCANF_H
31
32#include <stdarg.h>
33
34#include "bufstreams.h"
35
36/**
37 * @brief Float type support.
38 */
39#if !defined(CHSCANF_USE_FLOAT) || defined(__DOXYGEN__)
40#define CHSCANF_USE_FLOAT FALSE
41#endif
42
43#if CHSCANF_USE_FLOAT
44#include <math.h>
45#endif
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50 int chvscanf(BaseBufferedStream *chp, const char *fmt, va_list ap);
51 int chscanf(BaseBufferedStream *chp, const char *fmt, ...);
52 int chsnscanf(char *str, size_t size, const char *fmt, ...);
53 int chvsnscanf(char *str, size_t size, const char *fmt, va_list ap);
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* CHSCANF_H */
59
60/** @} */
Buffered streams structures and macros.
int chscanf(BaseBufferedStream *chp, const char *fmt,...)
System formatted input function.
Definition chscanf.c:695
int chsnscanf(char *str, size_t size, const char *fmt,...)
System formatted input function.
Definition chscanf.c:734
int chvscanf(BaseBufferedStream *chp, const char *fmt, va_list ap)
System formatted input function.
Definition chscanf.c:111
int chvsnscanf(char *str, size_t size, const char *fmt, va_list ap)
System formatted input function.
Definition chscanf.c:776
Buffered stream class.