Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2345VOR
rt-thread
提交
09c089d5
R
rt-thread
项目概览
2345VOR
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
09c089d5
编写于
12月 30, 2021
作者:
mysterywolf
提交者:
Bernard Xiong
12月 31, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[posix] remove getline
上级
cec72c92
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
161 deletion
+0
-161
components/libc/posix/Kconfig
components/libc/posix/Kconfig
+0
-6
components/libc/posix/getline/README.md
components/libc/posix/getline/README.md
+0
-20
components/libc/posix/getline/SConscript
components/libc/posix/getline/SConscript
+0
-11
components/libc/posix/getline/UNLICENSE
components/libc/posix/getline/UNLICENSE
+0
-24
components/libc/posix/getline/posix_getline.c
components/libc/posix/getline/posix_getline.c
+0
-77
components/libc/posix/getline/posix_getline.h
components/libc/posix/getline/posix_getline.h
+0
-23
未找到文件。
components/libc/posix/Kconfig
浏览文件 @
09c089d5
...
...
@@ -44,12 +44,6 @@ config RT_USING_POSIX_CLOCK
select RT_USING_POSIX_DELAY
default n
config RT_USING_POSIX_GETLINE
bool "Enable getline()/getdelim()"
select RT_USING_POSIX_FS
select RT_USING_POSIX_DEVIO
default n
config RT_USING_PTHREADS
bool "Enable pthreads APIs"
select RT_USING_POSIX_CLOCK
...
...
components/libc/posix/getline/README.md
已删除
100644 → 0
浏览文件 @
cec72c92
# getline/getdelim for RT-Thread POSIX(IEEE Std 1003.1-2008)
[
![Build Status
](
https://travis-ci.org/ivanrad/getline.svg?branch=master
)
](https://travis-ci.org/ivanrad/getline)
https://github.com/ivanrad/getline
Read a delimited record from stream.
Yet another (hopefully portable C) implementation of getline/getdelim.
These are ersatz functions, a drop-in replacement, to be used on those occasions when your C library does not already support them.
For more details, see
[
Open Group Base Specification for getdelim/getline
][
opengroup-spec
]
.
## License
This code is unlicensed -- free and released into the public domain. See
`UNLICENSE`
file for more information.
[
opengroup-spec
]:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getline.html
components/libc/posix/getline/SConscript
已删除
100644 → 0
浏览文件 @
cec72c92
# RT-Thread building script for component
from
building
import
*
cwd
=
GetCurrentDir
()
src
=
Glob
(
'*.c'
)
CPPPATH
=
[
cwd
]
group
=
DefineGroup
(
'POSIX'
,
src
,
depend
=
[
'RT_USING_POSIX_GETLINE'
],
CPPPATH
=
CPPPATH
)
Return
(
'group'
)
components/libc/posix/getline/UNLICENSE
已删除
100644 → 0
浏览文件 @
cec72c92
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
components/libc/posix/getline/posix_getline.c
已删除
100644 → 0
浏览文件 @
cec72c92
/* posix_getline.c
* RT-Thread POSIX
* getdelim(), getline() - read a delimited record from stream, ersatz implementation
* This code is unlicensed -- free and released into the public domain.
* https://man7.org/linux/man-pages/man3/getline.3.html
* Authors:
* https://github.com/ivanrad/getline
*
* Meco Man 2020-09-03 porting to RT-Thread
*/
#include "posix_getline.h"
#include <stdlib.h>
#include <limits.h>
#include <sys/errno.h>
ssize_t
getdelim
(
char
**
lineptr
,
size_t
*
n
,
int
delim
,
FILE
*
stream
)
{
char
*
cur_pos
,
*
new_lineptr
;
size_t
new_lineptr_len
;
int
c
;
if
(
lineptr
==
NULL
||
n
==
NULL
||
stream
==
NULL
)
{
errno
=
EINVAL
;
return
-
1
;
}
if
(
*
lineptr
==
NULL
)
{
*
n
=
128
;
/* init len */
if
((
*
lineptr
=
(
char
*
)
malloc
(
*
n
))
==
NULL
)
{
errno
=
ENOMEM
;
return
-
1
;
}
}
cur_pos
=
*
lineptr
;
for
(;;)
{
c
=
getc
(
stream
);
if
(
ferror
(
stream
)
||
(
c
==
EOF
&&
cur_pos
==
*
lineptr
))
return
-
1
;
if
(
c
==
EOF
)
break
;
if
((
*
lineptr
+
*
n
-
cur_pos
)
<
2
)
{
if
(
LONG_MAX
/
2
<
*
n
)
{
#ifdef EOVERFLOW
errno
=
EOVERFLOW
;
#else
errno
=
ERANGE
;
/* no EOVERFLOW defined */
#endif
return
-
1
;
}
new_lineptr_len
=
*
n
*
2
;
if
((
new_lineptr
=
(
char
*
)
realloc
(
*
lineptr
,
new_lineptr_len
))
==
NULL
)
{
errno
=
ENOMEM
;
return
-
1
;
}
cur_pos
=
new_lineptr
+
(
cur_pos
-
*
lineptr
);
*
lineptr
=
new_lineptr
;
*
n
=
new_lineptr_len
;
}
*
cur_pos
++
=
(
char
)
c
;
if
(
c
==
delim
)
break
;
}
*
cur_pos
=
'\0'
;
return
(
ssize_t
)(
cur_pos
-
*
lineptr
);
}
ssize_t
getline
(
char
**
lineptr
,
size_t
*
n
,
FILE
*
stream
)
{
return
getdelim
(
lineptr
,
n
,
'\n'
,
stream
);
}
components/libc/posix/getline/posix_getline.h
已删除
100644 → 0
浏览文件 @
cec72c92
/* posix_getline.h
* RT-Thread POSIX
* getdelim(), getline() - read a delimited record from stream, ersatz implementation
* This code is unlicensed -- free and released into the public domain.
* https://man7.org/linux/man-pages/man3/getline.3.html
* Authors:
* https://github.com/ivanrad/getline
*
* Meco Man 2020-09-03 porting to RT-Thread
*/
#ifndef POSIX_GETLINE_H
#define POSIX_GETLINE_H
#include <stdio.h>
#include <sys/types.h>
ssize_t
getdelim
(
char
**
lineptr
,
size_t
*
n
,
int
delim
,
FILE
*
stream
);
ssize_t
getline
(
char
**
lineptr
,
size_t
*
n
,
FILE
*
stream
);
#endif
/* POSIX_GETLINE_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录