Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
puts.c
Go to the documentation of this file.
1
#include <
stdio.h
>
2
3
int
puts
(
const
char
* str)
4
{
5
int
r = 0;
6
7
for
(
const
char
* c = str; *c != 0; c++)
8
{
9
putchar
((
int
)*c);
10
r++;
11
}
12
13
// puts adds a newline
14
if
(r)
15
{
16
putchar
(
'\n'
);
17
r++;
18
}
19
20
return
r ? r :
EOF
;
21
}
putchar
int putchar(int c)
Requires a definition of _putchar() for your platform.
Definition:
putchar.c:4
puts
int puts(const char *str)
Definition:
puts.c:3
EOF
#define EOF
Definition:
stdio.h:23
stdio.h
src
stdio
puts.c
Generated by
1.8.15