Last change
on this file since 413 was 398, checked in by coas-nagasima, 5 years ago |
mbedTLS版Azure IoT Hub接続サンプルのソースコードを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
430 bytes
|
Line | |
---|
1 | #define _GNU_SOURCE
|
---|
2 | #include "stdio_impl.h"
|
---|
3 | #include <string.h>
|
---|
4 |
|
---|
5 | char *fgetln(FILE *f, size_t *plen)
|
---|
6 | {
|
---|
7 | char *ret = 0, *z;
|
---|
8 | ssize_t l;
|
---|
9 | FLOCK(f);
|
---|
10 | ungetc(getc_unlocked(f), f);
|
---|
11 | if ((z=memchr(f->rpos, '\n', f->rend - f->rpos))) {
|
---|
12 | ret = (char *)f->rpos;
|
---|
13 | *plen = ++z - ret;
|
---|
14 | f->rpos = (void *)z;
|
---|
15 | } else if ((l = getline(&f->getln_buf, (size_t[]){0}, f)) > 0) {
|
---|
16 | *plen = l;
|
---|
17 | ret = f->getln_buf;
|
---|
18 | }
|
---|
19 | FUNLOCK(f);
|
---|
20 | return ret;
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.