libc/stream: Rename [lib_stream_](put|get) to [lib_stream_](putc|getc)

to make the naming style consistent with each other

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-04 17:35:13 +08:00 committed by Petro Karashchenko
parent 4be9ec774b
commit 055f1f33eb
41 changed files with 104 additions and 104 deletions

View File

@ -908,7 +908,7 @@ static ssize_t slcd_write(struct file *filep,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = slcd_getstream; instream.stream.getc = slcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = len; instream.nbytes = len;

View File

@ -1175,7 +1175,7 @@ static ssize_t slcd_write(struct file *filep,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = slcd_getstream; instream.stream.getc = slcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = len; instream.nbytes = len;

View File

@ -837,7 +837,7 @@ static ssize_t lcd_write(struct file *filep, const char *buffer,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = lcd_getstream; instream.stream.getc = lcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = len; instream.nbytes = len;

View File

@ -808,7 +808,7 @@ static ssize_t ht16k33_write(FAR struct file *filep, FAR const char *buffer,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = lcd_getstream; instream.stream.getc = lcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = buflen; instream.nbytes = buflen;

View File

@ -1226,7 +1226,7 @@ static ssize_t pcf8574_lcd_write(FAR struct file *filep,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = lcd_getstream; instream.stream.getc = lcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = buflen; instream.nbytes = buflen;

View File

@ -730,7 +730,7 @@ static ssize_t st7032_write(FAR struct file *filep, FAR const char *buffer,
/* Initialize the stream for use with the SLCD CODEC */ /* Initialize the stream for use with the SLCD CODEC */
instream.stream.get = lcd_getstream; instream.stream.getc = lcd_getstream;
instream.stream.nget = 0; instream.stream.nget = 0;
instream.buffer = buffer; instream.buffer = buffer;
instream.nbytes = buflen; instream.nbytes = buflen;

View File

@ -126,7 +126,7 @@ void lib_rttoutstream_open(FAR struct lib_rttoutstream_s *stream,
bufsize, SEGGER_RTT_MODE_DEFAULT); bufsize, SEGGER_RTT_MODE_DEFAULT);
} }
stream->public.put = rttstream_putc; stream->public.putc = rttstream_putc;
stream->public.puts = rttstream_puts; stream->public.puts = rttstream_puts;
stream->public.flush = lib_noflush; stream->public.flush = lib_noflush;
stream->public.nput = 0; stream->public.nput = 0;
@ -174,7 +174,7 @@ void lib_rttinstream_open(FAR struct lib_rttinstream_s *stream,
bufsize, SEGGER_RTT_MODE_DEFAULT); bufsize, SEGGER_RTT_MODE_DEFAULT);
} }
stream->public.get = rttstream_getc; stream->public.getc = rttstream_getc;
stream->public.gets = rttstream_gets; stream->public.gets = rttstream_gets;
stream->public.nget = 0; stream->public.nget = 0;
stream->channel = channel; stream->channel = channel;

View File

@ -129,7 +129,7 @@ static int syslog_stream_putc(FAR struct syslog_channel_s *channel, int ch)
irqstate_t flags; irqstate_t flags;
flags = enter_critical_section(); flags = enter_critical_section();
lib_stream_put(chan->stream, ch); lib_stream_putc(chan->stream, ch);
leave_critical_section(flags); leave_critical_section(flags);
return OK; return OK;
@ -156,7 +156,7 @@ static int syslog_stream_force(FAR struct syslog_channel_s *channel, int ch)
FAR struct syslog_stream_s *chan = FAR struct syslog_stream_s *chan =
(FAR struct syslog_stream_s *)channel; (FAR struct syslog_stream_s *)channel;
lib_stream_put(chan->stream, ch); lib_stream_putc(chan->stream, ch);
return OK; return OK;
} }

View File

@ -965,7 +965,7 @@ static inline void usbhost_encodescancode(FAR struct usbhost_state_s *priv,
/* And it does correspond to a special function key */ /* And it does correspond to a special function key */
usbstream.stream.put = usbhost_putstream; usbstream.stream.putc = usbhost_putstream;
usbstream.stream.nput = 0; usbstream.stream.nput = 0;
usbstream.priv = priv; usbstream.priv = priv;

View File

@ -223,7 +223,7 @@ extern "C"
* *
****************************************************************************/ ****************************************************************************/
#define kbd_press(ch, stream) (stream)->put((stream), (int)(ch)) #define kbd_press(ch, stream) lib_stream_putc(stream, ch)
/**************************************************************************** /****************************************************************************
* Name: kbd_release * Name: kbd_release

View File

@ -128,7 +128,7 @@ extern "C"
* *
****************************************************************************/ ****************************************************************************/
#define slcd_put(ch, stream) (stream)->put((stream), (int)(ch)) #define slcd_put(ch, stream) lib_stream_putc(stream, ch)
/**************************************************************************** /****************************************************************************
* Name: slcd_encode * Name: slcd_encode

View File

@ -40,14 +40,14 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#define lib_stream_putc(stream, ch) \
((FAR struct lib_outstream_s *)(stream))->putc( \
(FAR struct lib_outstream_s *)(stream), ch)
#define lib_stream_puts(stream, buf, len) \ #define lib_stream_puts(stream, buf, len) \
((FAR struct lib_outstream_s *)(stream))->puts( \ ((FAR struct lib_outstream_s *)(stream))->puts( \
(FAR struct lib_outstream_s *)(stream), buf, len) (FAR struct lib_outstream_s *)(stream), buf, len)
#define lib_stream_put(stream, ch) \ #define lib_stream_getc(stream) \
((FAR struct lib_outstream_s *)(stream))->put( \ ((FAR struct lib_instream_s *)(stream))->getc( \
(FAR struct lib_outstream_s *)(stream), ch)
#define lib_stream_get(stream) \
((FAR struct lib_instream_s *)(stream))->get( \
(FAR struct lib_instream_s *)(stream)) (FAR struct lib_instream_s *)(stream))
#define lib_stream_gets(stream, buf, len) \ #define lib_stream_gets(stream, buf, len) \
((FAR struct lib_instream_s *)(stream))->gets( \ ((FAR struct lib_instream_s *)(stream))->gets( \
@ -84,7 +84,7 @@ struct lib_instream_s
{ {
int nget; /* Total number of characters gotten. Written int nget; /* Total number of characters gotten. Written
* by get method, readable by user */ * by get method, readable by user */
lib_getc_t get; /* Get one character from the instream */ lib_getc_t getc; /* Get one character from the instream */
lib_gets_t gets; /* Get the string from the instream */ lib_gets_t gets; /* Get the string from the instream */
}; };
@ -92,7 +92,7 @@ struct lib_outstream_s
{ {
int nput; /* Total number of characters put. Written int nput; /* Total number of characters put. Written
* by put method, readable by user */ * by put method, readable by user */
lib_putc_t put; /* Put one character to the outstream */ lib_putc_t putc; /* Put one character to the outstream */
lib_puts_t puts; /* Writes the string to the outstream */ lib_puts_t puts; /* Writes the string to the outstream */
lib_flush_t flush; /* Flush any buffered characters in the outstream */ lib_flush_t flush; /* Flush any buffered characters in the outstream */
}; };
@ -118,7 +118,7 @@ struct lib_sistream_s
{ {
int nget; /* Total number of characters gotten. Written int nget; /* Total number of characters gotten. Written
* by get method, readable by user */ * by get method, readable by user */
lib_sigetc_t get; /* Get one character from the instream */ lib_sigetc_t getc; /* Get one character from the instream */
lib_gets_t gets; /* Get the string from the instream */ lib_gets_t gets; /* Get the string from the instream */
lib_siseek_t seek; /* Seek to a position in the instream */ lib_siseek_t seek; /* Seek to a position in the instream */
}; };
@ -127,7 +127,7 @@ struct lib_sostream_s
{ {
int nput; /* Total number of characters put. Written int nput; /* Total number of characters put. Written
* by put method, readable by user */ * by put method, readable by user */
lib_soputc_t put; /* Put one character to the outstream */ lib_soputc_t putc; /* Put one character to the outstream */
lib_soputs_t puts; /* Writes the string to the outstream */ lib_soputs_t puts; /* Writes the string to the outstream */
lib_soflush_t flush; /* Flush any buffered characters in the outstream */ lib_soflush_t flush; /* Flush any buffered characters in the outstream */
lib_soseek_t seek; /* Seek a position in the output stream */ lib_soseek_t seek; /* Seek a position in the output stream */

View File

@ -247,17 +247,17 @@ static int readstream(FAR struct lib_instream_s *instream,
/* Skip until the beginning of line start code is encountered */ /* Skip until the beginning of line start code is encountered */
ch = lib_stream_get(instream); ch = lib_stream_getc(instream);
while (ch != RECORD_STARTCODE && ch != EOF) while (ch != RECORD_STARTCODE && ch != EOF)
{ {
ch = lib_stream_get(instream); ch = lib_stream_getc(instream);
} }
/* Skip over the startcode */ /* Skip over the startcode */
if (ch != EOF) if (ch != EOF)
{ {
ch = lib_stream_get(instream); ch = lib_stream_getc(instream);
} }
/* Then read, verify, and buffer until the end of line is encountered */ /* Then read, verify, and buffer until the end of line is encountered */
@ -286,7 +286,7 @@ static int readstream(FAR struct lib_instream_s *instream,
/* Read the next character from the input stream */ /* Read the next character from the input stream */
ch = lib_stream_get(instream); ch = lib_stream_getc(instream);
} }
/* Some error occurred: Unexpected EOF, line too long, or bad character in /* Some error occurred: Unexpected EOF, line too long, or bad character in
@ -339,7 +339,7 @@ static inline void writedata(FAR struct lib_sostream_s *outstream,
{ {
for (; bytecount > 0; bytecount--) for (; bytecount > 0; bytecount--)
{ {
outstream->put(outstream, *data++); lib_stream_putc(outstream, *data++);
} }
} }

View File

@ -139,7 +139,7 @@ int kbd_decode(FAR struct lib_instream_s *stream,
/* No, ungotten characters. Check for the beginning of an ESC sequence. */ /* No, ungotten characters. Check for the beginning of an ESC sequence. */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream */ /* End of file/stream */
@ -163,7 +163,7 @@ int kbd_decode(FAR struct lib_instream_s *stream,
/* Check for ESC-[ */ /* Check for ESC-[ */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Return the escape character now. We will /* End of file/stream. Return the escape character now. We will
@ -189,7 +189,7 @@ int kbd_decode(FAR struct lib_instream_s *stream,
/* Get and verify the special keyboard data to decode */ /* Get and verify the special keyboard data to decode */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Unget everything and return the ESC character. /* End of file/stream. Unget everything and return the ESC character.
@ -216,7 +216,7 @@ int kbd_decode(FAR struct lib_instream_s *stream,
/* Check for the final semicolon */ /* Check for the final semicolon */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Unget everything and return the ESC character. /* End of file/stream. Unget everything and return the ESC character.

View File

@ -55,10 +55,10 @@
static void kbd_encode(uint8_t keycode, FAR struct lib_outstream_s *stream, static void kbd_encode(uint8_t keycode, FAR struct lib_outstream_s *stream,
uint8_t terminator) uint8_t terminator)
{ {
stream->put(stream, ASCII_ESC); lib_stream_putc(stream, ASCII_ESC);
stream->put(stream, '['); lib_stream_putc(stream, '[');
stream->put(stream, (int)keycode); lib_stream_putc(stream, (int)keycode);
stream->put(stream, terminator); lib_stream_putc(stream, terminator);
} }
/**************************************************************************** /****************************************************************************

View File

@ -177,7 +177,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* No, ungotten characters. Get the next character from the buffer. */ /* No, ungotten characters. Get the next character from the buffer. */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream (or perhaps an I/O error) */ /* End of file/stream (or perhaps an I/O error) */
@ -201,7 +201,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */ /* Get the next character from the buffer */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Return the escape character now. We will /* End of file/stream. Return the escape character now. We will
@ -230,7 +230,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */ /* Get the next character from the buffer */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Return the ESC now; return the following /* End of file/stream. Return the ESC now; return the following
@ -278,7 +278,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */ /* Get the next character from the buffer */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Return the ESC now; return the following /* End of file/stream. Return the ESC now; return the following
@ -311,7 +311,7 @@ enum slcdret_e slcd_decode(FAR struct lib_instream_s *stream,
/* Get the next character from the buffer */ /* Get the next character from the buffer */
ch = lib_stream_get(stream); ch = lib_stream_getc(stream);
if (ch == EOF) if (ch == EOF)
{ {
/* End of file/stream. Return the ESC now; return the following /* End of file/stream. Return the ESC now; return the following

View File

@ -86,9 +86,9 @@ static inline void slcd_put3(uint8_t slcdcode,
{ {
/* Put the 3-byte escape sequences into the output buffer */ /* Put the 3-byte escape sequences into the output buffer */
stream->put(stream, ASCII_ESC); lib_stream_putc(stream, ASCII_ESC);
stream->put(stream, '['); lib_stream_putc(stream, '[');
stream->put(stream, 'A' + (int)slcdcode); lib_stream_putc(stream, 'A' + (int)slcdcode);
} }
/**************************************************************************** /****************************************************************************
@ -114,11 +114,11 @@ static inline void slcd_put5(uint8_t slcdcode, uint8_t count,
{ {
/* Put the 5-byte escape sequences into the output buffer */ /* Put the 5-byte escape sequences into the output buffer */
stream->put(stream, ASCII_ESC); lib_stream_putc(stream, ASCII_ESC);
stream->put(stream, '['); lib_stream_putc(stream, '[');
stream->put(stream, slcd_nibble(count >> 4)); lib_stream_putc(stream, slcd_nibble(count >> 4));
stream->put(stream, slcd_nibble(count)); lib_stream_putc(stream, slcd_nibble(count));
stream->put(stream, 'A' + (int)slcdcode); lib_stream_putc(stream, 'A' + (int)slcdcode);
} }
/**************************************************************************** /****************************************************************************

View File

@ -87,7 +87,7 @@ int obstack_vprintf(FAR struct obstack *h, FAR const char *fmt, va_list ap)
{ {
struct obstack_stream outstream; struct obstack_stream outstream;
outstream.public.put = obstack_putc; outstream.public.putc = obstack_putc;
outstream.public.puts = obstack_puts; outstream.public.puts = obstack_puts;
outstream.public.flush = lib_noflush; outstream.public.flush = lib_noflush;
outstream.public.nput = 0; outstream.public.nput = 0;

View File

@ -97,7 +97,7 @@ static void zeroes(FAR struct lib_outstream_s *obj, int nzeroes)
for (i = nzeroes; i > 0; i--) for (i = nzeroes; i > 0; i--)
{ {
obj->put(obj, '0'); lib_stream_putc(obj, '0');
} }
} }
@ -131,7 +131,7 @@ static void lib_dtoa_string(FAR struct lib_outstream_s *obj, const char *str)
{ {
while (*str) while (*str)
{ {
obj->put(obj, *str++); lib_stream_putc(obj, *str++);
} }
} }
@ -197,7 +197,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
{ {
if (value < 0.0) if (value < 0.0)
{ {
obj->put(obj, '-'); lib_stream_putc(obj, '-');
} }
lib_dtoa_string(obj, "Infinity"); lib_dtoa_string(obj, "Infinity");
@ -245,11 +245,11 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
if (IS_NEGATE(flags)) if (IS_NEGATE(flags))
{ {
obj->put(obj, '-'); lib_stream_putc(obj, '-');
} }
else if (IS_SHOWPLUS(flags)) else if (IS_SHOWPLUS(flags))
{ {
obj->put(obj, '+'); lib_stream_putc(obj, '+');
} }
/* Special case exact zero or the case where the number is smaller than /* Special case exact zero or the case where the number is smaller than
@ -260,7 +260,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
{ {
/* kludge for __dtoa irregularity */ /* kludge for __dtoa irregularity */
obj->put(obj, '0'); lib_stream_putc(obj, '0');
/* A decimal point is printed only in the alternate form or if a /* A decimal point is printed only in the alternate form or if a
* particular precision is requested. * particular precision is requested.
@ -268,7 +268,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
if ((prec > 0 && !notrailing) || IS_ALTFORM(flags)) if ((prec > 0 && !notrailing) || IS_ALTFORM(flags))
{ {
obj->put(obj, '.'); lib_stream_putc(obj, '.');
/* Always print at least one digit to the right of the decimal /* Always print at least one digit to the right of the decimal
* point. * point.
@ -297,11 +297,11 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
{ {
/* Print a single zero to the left of the decimal point */ /* Print a single zero to the left of the decimal point */
obj->put(obj, '0'); lib_stream_putc(obj, '0');
/* Print the decimal point */ /* Print the decimal point */
obj->put(obj, '.'); lib_stream_putc(obj, '.');
/* Print any leading zeros to the right of the decimal point */ /* Print any leading zeros to the right of the decimal point */
@ -325,12 +325,12 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
{ {
if (*digits != '\0') if (*digits != '\0')
{ {
obj->put(obj, *digits); lib_stream_putc(obj, *digits);
digits++; digits++;
} }
else else
{ {
obj->put(obj, '0'); lib_stream_putc(obj, '0');
} }
} }
@ -348,7 +348,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
{ {
/* Print the decimal point */ /* Print the decimal point */
obj->put(obj, '.'); lib_stream_putc(obj, '.');
/* Always print at least one digit to the right of the decimal /* Always print at least one digit to the right of the decimal
* point. * point.
@ -382,7 +382,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec,
for (i = nchars; i > 0; i--) for (i = nchars; i > 0; i--)
{ {
obj->put(obj, *digits); lib_stream_putc(obj, *digits);
digits++; digits++;
} }

View File

@ -256,7 +256,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
/* Get first character, we keep always the next character in c */ /* Get first character, we keep always the next character in c */
c = lib_stream_get(obj); c = lib_stream_getc(obj);
while (fmt_char(fmt)) while (fmt_char(fmt))
{ {
@ -266,7 +266,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
{ {
while (isspace(c)) while (isspace(c))
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -366,7 +366,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
while (isspace(c)) while (isspace(c))
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
/* But we only perform the data conversion is we still have /* But we only perform the data conversion is we still have
@ -390,7 +390,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
} }
fwidth++; fwidth++;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
if (!noassign) if (!noassign)
@ -445,7 +445,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
} }
fwidth++; fwidth++;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
if (!fwidth) if (!fwidth)
@ -509,7 +509,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
} }
fwidth++; fwidth++;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
if (fwidth != width) if (fwidth != width)
@ -582,7 +582,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
while (isspace(c)) while (isspace(c))
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
/* But we only perform the data conversion if we still have /* But we only perform the data conversion if we still have
@ -641,7 +641,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -691,7 +691,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -716,7 +716,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -741,7 +741,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -796,7 +796,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
break; break;
@ -954,7 +954,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
while (isspace(c)) while (isspace(c))
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
/* But we only perform the data conversion is we still have /* But we only perform the data conversion is we still have
@ -1038,7 +1038,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
if (!stopconv) if (!stopconv)
{ {
tmp[fwidth++] = c; tmp[fwidth++] = c;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -1168,7 +1168,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
} }
else else
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
@ -1188,7 +1188,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
while (isspace(c)) while (isspace(c))
{ {
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
#endif #endif
@ -1201,7 +1201,7 @@ int lib_vscanf(FAR struct lib_instream_s *obj, FAR int *lastc,
else else
{ {
fmt++; fmt++;
c = lib_stream_get(obj); c = lib_stream_getc(obj);
} }
} }
else else

View File

@ -67,7 +67,7 @@
# undef CONFIG_LIBC_LONG_LONG # undef CONFIG_LIBC_LONG_LONG
#endif #endif
#define stream_putc(c,stream) (total_len++, lib_stream_put(stream, c)) #define stream_putc(c,stream) (total_len++, lib_stream_putc(stream, c))
/* Order is relevant here and matches order in format string */ /* Order is relevant here and matches order in format string */

View File

@ -227,7 +227,7 @@ int lib_blkoutstream_open(FAR struct lib_blkoutstream_s *stream,
} }
stream->inode = inode; stream->inode = inode;
stream->public.put = blkoutstream_putc; stream->public.putc = blkoutstream_putc;
stream->public.puts = blkoutstream_puts; stream->public.puts = blkoutstream_puts;
stream->public.flush = blkoutstream_flush; stream->public.flush = blkoutstream_flush;

View File

@ -72,7 +72,7 @@ static void lowoutstream_putc(FAR struct lib_outstream_s *this, int ch)
void lib_lowoutstream(FAR struct lib_outstream_s *stream) void lib_lowoutstream(FAR struct lib_outstream_s *stream)
{ {
stream->put = lowoutstream_putc; stream->putc = lowoutstream_putc;
stream->flush = lib_noflush; stream->flush = lib_noflush;
stream->nput = 0; stream->nput = 0;
} }

View File

@ -49,13 +49,13 @@ static int lzfoutstream_flush(FAR struct lib_outstream_s *this)
stream->offset, stream->state, &header); stream->offset, stream->state, &header);
if (outlen > 0) if (outlen > 0)
{ {
stream->backend->puts(stream->backend, header, outlen); lib_stream_puts(stream->backend, header, outlen);
} }
stream->offset = 0; stream->offset = 0;
} }
return stream->backend->flush(stream->backend); return lib_stream_flush(stream->backend);
} }
/**************************************************************************** /****************************************************************************
@ -94,7 +94,7 @@ static int lzfoutstream_puts(FAR struct lib_outstream_s *this,
&header); &header);
if (outlen > 0) if (outlen > 0)
{ {
ret = stream->backend->puts(stream->backend, header, outlen); ret = lib_stream_puts(stream->backend, header, outlen);
if (ret < 0) if (ret < 0)
{ {
return ret; return ret;

View File

@ -80,7 +80,7 @@ static int meminstream_getc(FAR struct lib_instream_s *this)
void lib_meminstream(FAR struct lib_meminstream_s *instream, void lib_meminstream(FAR struct lib_meminstream_s *instream,
FAR const char *bufstart, int buflen) FAR const char *bufstart, int buflen)
{ {
instream->public.get = meminstream_getc; instream->public.getc = meminstream_getc;
instream->public.nget = 0; /* Will be buffer index */ instream->public.nget = 0; /* Will be buffer index */
instream->buffer = bufstart; /* Start of buffer */ instream->buffer = bufstart; /* Start of buffer */
instream->buflen = buflen; /* Length of the buffer */ instream->buflen = buflen; /* Length of the buffer */

View File

@ -94,7 +94,7 @@ static void memoutstream_putc(FAR struct lib_outstream_s *this, int ch)
void lib_memoutstream(FAR struct lib_memoutstream_s *outstream, void lib_memoutstream(FAR struct lib_memoutstream_s *outstream,
FAR char *bufstart, int buflen) FAR char *bufstart, int buflen)
{ {
outstream->public.put = memoutstream_putc; outstream->public.putc = memoutstream_putc;
outstream->public.puts = memoutstream_puts; outstream->public.puts = memoutstream_puts;
outstream->public.flush = lib_noflush; outstream->public.flush = lib_noflush;
outstream->public.nput = 0; /* Will be buffer index */ outstream->public.nput = 0; /* Will be buffer index */

View File

@ -124,7 +124,7 @@ static off_t memsistream_seek(FAR struct lib_sistream_s *this, off_t offset,
void lib_memsistream(FAR struct lib_memsistream_s *instream, void lib_memsistream(FAR struct lib_memsistream_s *instream,
FAR const char *bufstart, int buflen) FAR const char *bufstart, int buflen)
{ {
instream->public.get = memsistream_getc; instream->public.getc = memsistream_getc;
instream->public.seek = memsistream_seek; instream->public.seek = memsistream_seek;
instream->public.nget = 0; /* Total number of characters read */ instream->public.nget = 0; /* Total number of characters read */
instream->buffer = bufstart; /* Start of buffer */ instream->buffer = bufstart; /* Start of buffer */

View File

@ -121,7 +121,7 @@ static off_t memsostream_seek(FAR struct lib_sostream_s *this, off_t offset,
void lib_memsostream(FAR struct lib_memsostream_s *outstream, void lib_memsostream(FAR struct lib_memsostream_s *outstream,
FAR char *bufstart, int buflen) FAR char *bufstart, int buflen)
{ {
outstream->public.put = memsostream_putc; outstream->public.putc = memsostream_putc;
outstream->public.flush = lib_snoflush; outstream->public.flush = lib_snoflush;
outstream->public.seek = memsostream_seek; outstream->public.seek = memsostream_seek;
outstream->public.nput = 0; /* Total number of characters written */ outstream->public.nput = 0; /* Total number of characters written */

View File

@ -302,7 +302,7 @@ int lib_mtdoutstream_open(FAR struct lib_mtdoutstream_s *stream,
} }
stream->inode = node; stream->inode = node;
stream->public.put = mtdoutstream_putc; stream->public.putc = mtdoutstream_putc;
stream->public.puts = mtdoutstream_puts; stream->public.puts = mtdoutstream_puts;
stream->public.flush = mtdoutstream_flush; stream->public.flush = mtdoutstream_flush;

View File

@ -59,6 +59,6 @@ static int nullinstream_getc(FAR struct lib_instream_s *this)
void lib_nullinstream(FAR struct lib_instream_s *nullinstream) void lib_nullinstream(FAR struct lib_instream_s *nullinstream)
{ {
nullinstream->get = nullinstream_getc; nullinstream->getc = nullinstream_getc;
nullinstream->nget = 0; nullinstream->nget = 0;
} }

View File

@ -61,7 +61,7 @@ static void nulloutstream_putc(FAR struct lib_outstream_s *this, int ch)
void lib_nulloutstream(FAR struct lib_outstream_s *nulloutstream) void lib_nulloutstream(FAR struct lib_outstream_s *nulloutstream)
{ {
nulloutstream->put = nulloutstream_putc; nulloutstream->putc = nulloutstream_putc;
nulloutstream->flush = lib_noflush; nulloutstream->flush = lib_noflush;
nulloutstream->nput = 0; nulloutstream->nput = 0;
} }

View File

@ -89,7 +89,7 @@ static int rawinstream_getc(FAR struct lib_instream_s *this)
void lib_rawinstream(FAR struct lib_rawinstream_s *instream, int fd) void lib_rawinstream(FAR struct lib_rawinstream_s *instream, int fd)
{ {
instream->public.get = rawinstream_getc; instream->public.getc = rawinstream_getc;
instream->public.nget = 0; instream->public.nget = 0;
instream->fd = fd; instream->fd = fd;
} }

View File

@ -109,7 +109,7 @@ static off_t rawsostream_seek(FAR struct lib_sostream_s *this, off_t offset,
void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd) void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd)
{ {
outstream->public.put = rawsostream_putc; outstream->public.putc = rawsostream_putc;
outstream->public.flush = lib_snoflush; outstream->public.flush = lib_snoflush;
outstream->public.seek = rawsostream_seek; outstream->public.seek = rawsostream_seek;
outstream->public.nput = 0; outstream->public.nput = 0;

View File

@ -102,7 +102,7 @@ static off_t rawsistream_seek(FAR struct lib_sistream_s *this, off_t offset,
void lib_rawsistream(FAR struct lib_rawsistream_s *instream, int fd) void lib_rawsistream(FAR struct lib_rawsistream_s *instream, int fd)
{ {
instream->public.get = rawsistream_getc; instream->public.getc = rawsistream_getc;
instream->public.seek = rawsistream_seek; instream->public.seek = rawsistream_seek;
instream->public.nget = 0; instream->public.nget = 0;
instream->fd = fd; instream->fd = fd;

View File

@ -102,7 +102,7 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch)
void lib_rawoutstream(FAR struct lib_rawoutstream_s *outstream, int fd) void lib_rawoutstream(FAR struct lib_rawoutstream_s *outstream, int fd)
{ {
outstream->public.put = rawoutstream_putc; outstream->public.putc = rawoutstream_putc;
outstream->public.puts = rawoutstream_puts; outstream->public.puts = rawoutstream_puts;
outstream->public.flush = lib_noflush; outstream->public.flush = lib_noflush;
outstream->public.nput = 0; outstream->public.nput = 0;

View File

@ -76,7 +76,7 @@ static int stdinstream_getc(FAR struct lib_instream_s *this)
void lib_stdinstream(FAR struct lib_stdinstream_s *instream, void lib_stdinstream(FAR struct lib_stdinstream_s *instream,
FAR FILE *stream) FAR FILE *stream)
{ {
instream->public.get = stdinstream_getc; instream->public.getc = stdinstream_getc;
instream->public.nget = 0; instream->public.nget = 0;
instream->stream = stream; instream->stream = stream;
} }

View File

@ -103,9 +103,9 @@ static int stdoutstream_flush(FAR struct lib_outstream_s *this)
void lib_stdoutstream(FAR struct lib_stdoutstream_s *outstream, void lib_stdoutstream(FAR struct lib_stdoutstream_s *outstream,
FAR FILE *stream) FAR FILE *stream)
{ {
/* Select the put operation */ /* Select the putc operation */
outstream->public.put = stdoutstream_putc; outstream->public.putc = stdoutstream_putc;
/* Select the correct flush operation. This flush is only called when /* Select the correct flush operation. This flush is only called when
* a newline is encountered in the output stream. However, we do not * a newline is encountered in the output stream. However, we do not

View File

@ -89,7 +89,7 @@ static off_t stdsistream_seek(FAR struct lib_sistream_s *this, off_t offset,
void lib_stdsistream(FAR struct lib_stdsistream_s *instream, void lib_stdsistream(FAR struct lib_stdsistream_s *instream,
FAR FILE *stream) FAR FILE *stream)
{ {
instream->public.get = stdsistream_getc; instream->public.getc = stdsistream_getc;
instream->public.seek = stdsistream_seek; instream->public.seek = stdsistream_seek;
instream->public.nget = 0; instream->public.nget = 0;
instream->stream = stream; instream->stream = stream;

View File

@ -114,9 +114,9 @@ static off_t stdsostream_seek(FAR struct lib_sostream_s *this, off_t offset,
void lib_stdsostream(FAR struct lib_stdsostream_s *outstream, void lib_stdsostream(FAR struct lib_stdsostream_s *outstream,
FAR FILE *stream) FAR FILE *stream)
{ {
/* Select the put operation */ /* Select the putc operation */
outstream->public.put = stdsostream_putc; outstream->public.putc = stdsostream_putc;
/* Select the correct flush operation. This flush is only called when /* Select the correct flush operation. This flush is only called when
* a newline is encountered in the output stream. However, we do not * a newline is encountered in the output stream. However, we do not

View File

@ -191,7 +191,7 @@ void lib_syslogstream_open(FAR struct lib_syslogstream_s *stream)
/* Initialize the common fields */ /* Initialize the common fields */
stream->public.put = syslogstream_putc; stream->public.putc = syslogstream_putc;
stream->public.flush = lib_noflush; stream->public.flush = lib_noflush;
stream->public.nput = 0; stream->public.nput = 0;

View File

@ -58,6 +58,6 @@ static int zeroinstream_getc(FAR struct lib_instream_s *this)
void lib_zeroinstream(FAR struct lib_instream_s *zeroinstream) void lib_zeroinstream(FAR struct lib_instream_s *zeroinstream)
{ {
zeroinstream->get = zeroinstream_getc; zeroinstream->getc = zeroinstream_getc;
zeroinstream->nget = 0; zeroinstream->nget = 0;
} }