PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
TextDevices
libsimpletext
writeStrDigits.c
Go to the documentation of this file.
1
8
#include <ctype.h>
9
#include "
simpletext.h
"
10
11
int
writeStrLen
(
text_t
*p,
char
*str,
int
width)
12
{
13
int
n;
14
for
(n = 0;
isalnum
(*(str+n)); n++)
15
;
16
for
( ; n < width; n++)
17
writeChar
(p,
' '
);
18
while
(*str && width--)
19
{
20
writeChar
(p, *str);
21
str++;
22
}
23
return
n;
24
}
25
26
/*
27
+--------------------------------------------------------------------
28
| TERMS OF USE: MIT License
29
+--------------------------------------------------------------------
30
Permission is hereby granted, free of charge, to any person obtaining
31
a copy of this software and associated documentation files
32
(the "Software"), to deal in the Software without restriction,
33
including without limitation the rights to use, copy, modify, merge,
34
publish, distribute, sublicense, and/or sell copies of the Software,
35
and to permit persons to whom the Software is furnished to do so,
36
subject to the following conditions:
37
38
The above copyright notice and this permission notice shall be
39
included in all copies or substantial portions of the Software.
40
41
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
44
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
45
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
46
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
47
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
48
+--------------------------------------------------------------------
49
*/
50
writeStrLen
int writeStrLen(text_t *p, char *str, int width)
Send a string to the device.
Definition:
writeStrDigits.c:11
isalnum
#define isalnum(c)
Definition:
ctype.h:57
simpletext.h
This library provides a collection of functions for communicating with text devices such as SimpleIDE...
writeChar
void writeChar(text_t *device, char c)
Send a character to the device.
Definition:
writeChar.c:11
text_struct
Structure that contains data used by simple text device libraries.
Definition:
simpletext.h:81
Generated on Fri May 20 2022 16:48:05 for PropWare by
1.8.17