Skip to content

Commit d71dcf5

Browse files
committed
增加文件操作相关函数的文档注释
1 parent 925eab7 commit d71dcf5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

components/libc/compilers/armlibc/syscalls.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ long _sys_flen(FILEHANDLE fh)
339339
#endif /* DFS_USING_POSIX */
340340
}
341341

342+
/**
343+
* check whether the file is a terminal device.
344+
*
345+
* @param fh - file handle
346+
* @return 1 if is a terminal device, 0 if not
347+
*/
342348
int _sys_istty(FILEHANDLE fh)
343349
{
344350
if ((STDIN <= fh) && (fh <= STDERR))
@@ -347,6 +353,12 @@ int _sys_istty(FILEHANDLE fh)
347353
return 0;
348354
}
349355

356+
/**
357+
* remove a file
358+
*
359+
* @param filename - file name with path
360+
* @return 0 on success, -1 on failed
361+
*/
350362
int remove(const char *filename)
351363
{
352364
#ifdef DFS_USING_POSIX
@@ -360,6 +372,13 @@ int remove(const char *filename)
360372
#ifdef __MICROLIB
361373
#include <stdio.h>
362374

375+
/**
376+
* write a character to file
377+
*
378+
* @param c - character to write
379+
* @param fh - file handle
380+
* @return 1 on success, 0 on failed
381+
*/
363382
int fputc(int c, FILE *f)
364383
{
365384
#ifdef RT_USING_CONSOLE
@@ -370,6 +389,12 @@ int fputc(int c, FILE *f)
370389
#endif /* RT_USING_CONSOLE */
371390
}
372391

392+
/**
393+
* get a character from file
394+
*
395+
* @param fh - file handle
396+
* @return character read, or -1 on failed
397+
*/
373398
int fgetc(FILE *f)
374399
{
375400
#ifdef RT_USING_POSIX_STDIO

0 commit comments

Comments
 (0)