PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
TextDevices
libsimpletext
scan.c
1
/*
2
* Super-simple text I/O for PropGCC, stripped of all stdio overhead.
3
* Copyright (c) 2013, Parallax Inc
4
* MIT licensed (see terms at end of file)
5
*/
6
#include <stdlib.h>
7
#include "
simpletext.h
"
8
9
int
scan
(
const
char
*fmt, ...)
10
{
11
char
str[257];
12
va_list args;
13
getStr
(str, 256);
14
va_start(args, fmt);
15
int
blocks = _doscanf(str, fmt, args);
16
va_end(args);
17
return
blocks;
18
}
19
20
/* +--------------------------------------------------------------------
21
* | TERMS OF USE: MIT License
22
* +--------------------------------------------------------------------
23
* Permission is hereby granted, free of charge, to any person obtaining
24
* a copy of this software and associated documentation files
25
* (the "Software"), to deal in the Software without restriction,
26
* including without limitation the rights to use, copy, modify, merge,
27
* publish, distribute, sublicense, and/or sell copies of the Software,
28
* and to permit persons to whom the Software is furnished to do so,
29
* subject to the following conditions:
30
*
31
* The above copyright notice and this permission notice shall be
32
* included in all copies or substantial portions of the Software.
33
*
34
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
38
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
* +--------------------------------------------------------------------
42
*/
43
getStr
char * getStr(char *buffer, int max)
Get string of chars from the debug port.
Definition:
getStr.c:19
simpletext.h
This library provides a collection of functions for communicating with text devices such as SimpleIDE...
scan
int int scan(const char *fmt,...) __attribute__((format(printf
Convert formatted simple terminal input to the "..." args. The input is limited to 256 bytes.
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17