libc: Add IPTR for puts/fputs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I2a83afb4d934a44ad1b56ec6dd72e654f4e112a3
This commit is contained in:
parent
4fbbd2e3bf
commit
43d7c1e807
@ -153,7 +153,7 @@ FAR char *fgets(FAR char *s, int n, FAR FILE *stream);
|
||||
FAR FILE *fopen(FAR const char *path, FAR const char *type);
|
||||
int fprintf(FAR FILE *stream, FAR const IPTR char *format, ...);
|
||||
int fputc(int c, FAR FILE *stream);
|
||||
int fputs(FAR const char *s, FAR FILE *stream);
|
||||
int fputs(FAR const IPTR char *s, FAR FILE *stream);
|
||||
size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream);
|
||||
FAR FILE *freopen(FAR const char *path, FAR const char *mode,
|
||||
FAR FILE *stream);
|
||||
@ -178,7 +178,7 @@ int ungetc(int c, FAR FILE *stream);
|
||||
|
||||
void perror(FAR const char *s);
|
||||
int printf(FAR const IPTR char *fmt, ...);
|
||||
int puts(FAR const char *s);
|
||||
int puts(FAR const IPTR char *s);
|
||||
int rename(FAR const char *oldpath, FAR const char *newpath);
|
||||
int sprintf(FAR char *buf, FAR const IPTR char *fmt, ...);
|
||||
int asprintf(FAR char **ptr, FAR const IPTR char *fmt, ...);
|
||||
|
@ -44,7 +44,7 @@
|
||||
"fopen","stdio.h","CONFIG_NFILE_STREAMS > 0","FAR FILE *","FAR const char *","FAR const char *"
|
||||
"fprintf","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","FAR const IPTR char *","..."
|
||||
"fputc","stdio.h","CONFIG_NFILE_STREAMS > 0","int","int","FAR FILE *"
|
||||
"fputs","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *","FAR FILE *"
|
||||
"fputs","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const IPTR char *","FAR FILE *"
|
||||
"fread","stdio.h","CONFIG_NFILE_STREAMS > 0","size_t","FAR void *","size_t","size_t","FAR FILE *"
|
||||
"free","stdlib.h","","void","FAR void *"
|
||||
"fseek","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR FILE *","long int","int"
|
||||
@ -136,7 +136,7 @@
|
||||
"pthread_mutexattr_settype","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_PTHREAD_MUTEX_TYPES)","int","FAR pthread_mutexattr_t *","int"
|
||||
"pthread_once","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_once_t*","CODE void (*)(void)"
|
||||
"pthread_yield","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void"
|
||||
"puts","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const char *"
|
||||
"puts","stdio.h","CONFIG_NFILE_STREAMS > 0","int","FAR const IPTR char *"
|
||||
"qsort","stdlib.h","","void","FAR void *","size_t","size_t","int(*)(FAR const void *","FAR const void *)"
|
||||
"rand","stdlib.h","","int"
|
||||
"readdir_r","dirent.h","","int","FAR DIR *","FAR struct dirent *","FAR struct dirent **"
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -1,7 +1,8 @@
|
||||
/****************************************************************************
|
||||
* libs/libc/stdio/lib_fputs.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2011-2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008, 2011-2012, 2017 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -60,7 +61,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARCH_ROMGETC)
|
||||
int fputs(FAR const char *s, FAR FILE *stream)
|
||||
int fputs(FAR const IPTR char *s, FAR FILE *stream)
|
||||
{
|
||||
int nput;
|
||||
int ret;
|
||||
@ -104,7 +105,7 @@ int fputs(FAR const char *s, FAR FILE *stream)
|
||||
}
|
||||
|
||||
#else
|
||||
int fputs(FAR const char *s, FAR FILE *stream)
|
||||
int fputs(FAR const IPTR char *s, FAR FILE *stream)
|
||||
{
|
||||
int nput;
|
||||
|
||||
@ -151,7 +152,7 @@ int fputs(FAR const char *s, FAR FILE *stream)
|
||||
}
|
||||
}
|
||||
|
||||
/* Without line buffering, we can write the whole string in one operation. */
|
||||
/* We can write the whole string in one operation without line buffering */
|
||||
|
||||
else
|
||||
{
|
||||
@ -172,7 +173,6 @@ int fputs(FAR const char *s, FAR FILE *stream)
|
||||
{
|
||||
return EOF;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nput;
|
||||
|
@ -52,7 +52,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int puts(FAR const char *s)
|
||||
int puts(FAR const IPTR char *s)
|
||||
{
|
||||
FILE *stream = stdout;
|
||||
int nwritten;
|
||||
|
Loading…
Reference in New Issue
Block a user