PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
TextDevices
libsimpletext
sscanAfterStr.c
1
/*
2
* Super-simple text I/O for PropGCC, stripped of all stdio overhead.
3
* Copyright (c) 2012, Ted Stefanik. Concept inspired by:
4
*
5
* very simple printf, adapted from one written by me [Eric Smith]
6
* for the MiNT OS long ago
7
* placed in the public domain
8
* - Eric Smith
9
* Propeller specific adaptations
10
* Copyright (c) 2011 Parallax, Inc.
11
* Written by Eric R. Smith, Total Spectrum Software Inc.
12
*
13
* MIT licensed (see terms at end of file)
14
*/
15
16
#include <stdlib.h>
17
#include "
simpletext.h
"
18
19
//int sscanAfterStr(char *str, char *strAfter, char *fmt, ...)
20
int
sscanAfterStr
(
char
*buffer,
char
*str,
char
*fmt, ...){
21
char
*loc = strstr(buffer, str);
22
loc += strlen(str);
23
va_list args;
24
va_start(args, fmt);
25
int
blocks = _doscanf(loc, fmt, args);
26
va_end(args);
27
return
blocks;
28
}
29
30
/* +--------------------------------------------------------------------
31
* | TERMS OF USE: MIT License
32
* +--------------------------------------------------------------------
33
* Permission is hereby granted, free of charge, to any person obtaining
34
* a copy of this software and associated documentation files
35
* (the "Software"), to deal in the Software without restriction,
36
* including without limitation the rights to use, copy, modify, merge,
37
* publish, distribute, sublicense, and/or sell copies of the Software,
38
* and to permit persons to whom the Software is furnished to do so,
39
* subject to the following conditions:
40
*
41
* The above copyright notice and this permission notice shall be
42
* included in all copies or substantial portions of the Software.
43
*
44
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
45
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
* +--------------------------------------------------------------------
52
*/
53
sscanAfterStr
int int int int int sscanAfterStr(char *buffer, char *str, char *fmt,...) __attribute__((format(printf
Store values represented by characters in a buffer in variable list using "..." args.
simpletext.h
This library provides a collection of functions for communicating with text devices such as SimpleIDE...
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17