From 9d407d4202dd4c69d3597544e888bd6ac38f7a73 Mon Sep 17 00:00:00 2001 From: Vidisha Thapa Date: Wed, 30 Aug 2017 19:25:42 +0530 Subject: [PATCH] Fix wrong filenames This patch fixes wrong file names of the files: lib_rawinstream.c lib_rawoutstream.c lib_rawsistream.c lib_rawsostream.c Signed-off-by: Vidisha Thapa --- lib/libc/stdio/lib_rawinstream.c | 31 ++++++++-------------------- lib/libc/stdio/lib_rawoutstream.c | 43 +++++++++++++++------------------------ lib/libc/stdio/lib_rawsistream.c | 31 ++++++++++++++++++++-------- lib/libc/stdio/lib_rawsostream.c | 43 ++++++++++++++++++++++++--------------- 4 files changed, 74 insertions(+), 74 deletions(-) diff --git a/lib/libc/stdio/lib_rawinstream.c b/lib/libc/stdio/lib_rawinstream.c index b2d24f1..a343d6e 100644 --- a/lib/libc/stdio/lib_rawinstream.c +++ b/lib/libc/stdio/lib_rawinstream.c @@ -16,9 +16,9 @@ * ****************************************************************************/ /**************************************************************************** - * libc/stdio/lib_rawsistream.c + * libc/stdio/lib_rawinstream.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,12 +65,12 @@ ****************************************************************************/ /**************************************************************************** - * Name: rawsistream_getc + * Name: rawinstream_getc ****************************************************************************/ -static int rawsistream_getc(FAR struct lib_sistream_s *this) +static int rawinstream_getc(FAR struct lib_instream_s *this) { - FAR struct lib_rawsistream_s *rthis = (FAR struct lib_rawsistream_s *)this; + FAR struct lib_rawinstream_s *rthis = (FAR struct lib_rawinstream_s *)this; int nwritten; char ch; @@ -94,30 +94,18 @@ static int rawsistream_getc(FAR struct lib_sistream_s *this) } /**************************************************************************** - * Name: rawsistream_seek - ****************************************************************************/ - -static off_t rawsistream_seek(FAR struct lib_sistream_s *this, off_t offset, int whence) -{ - FAR struct lib_rawsistream_s *mthis = (FAR struct lib_rawsistream_s *)this; - - DEBUGASSERT(this); - return lseek(mthis->fd, offset, whence); -} - -/**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: lib_rawsistream + * Name: lib_rawinstream * * Description: * Initializes a stream for use with a file descriptor. * * Input parameters: * instream - User allocated, uninitialized instance of struct - * lib_rawsistream_s to be initialized. + * lib_rawinstream_s to be initialized. * fd - User provided file/socket descriptor (must have been opened * for the correct access). * @@ -126,10 +114,9 @@ static off_t rawsistream_seek(FAR struct lib_sistream_s *this, off_t offset, int * ****************************************************************************/ -void lib_rawsistream(FAR struct lib_rawsistream_s *instream, int fd) +void lib_rawinstream(FAR struct lib_rawinstream_s *instream, int fd) { - instream->public.get = rawsistream_getc; - instream->public.seek = rawsistream_seek; + instream->public.get = rawinstream_getc; instream->public.nget = 0; instream->fd = fd; } diff --git a/lib/libc/stdio/lib_rawoutstream.c b/lib/libc/stdio/lib_rawoutstream.c index d9a8f06..10d1c41 100644 --- a/lib/libc/stdio/lib_rawoutstream.c +++ b/lib/libc/stdio/lib_rawoutstream.c @@ -16,9 +16,9 @@ * ****************************************************************************/ /**************************************************************************** - * libc/stdio/lib_rawsostream.c + * libc/stdio/lib_rawoutstream.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,14 +65,15 @@ ****************************************************************************/ /**************************************************************************** - * Name: rawsostream_putc + * Name: rawoutstream_putc ****************************************************************************/ -static void rawsostream_putc(FAR struct lib_sostream_s *this, int ch) +static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch) { - FAR struct lib_rawsostream_s *rthis = (FAR struct lib_rawsostream_s *)this; - int nwritten; + FAR struct lib_rawoutstream_s *rthis = (FAR struct lib_rawoutstream_s *)this; char buffer = ch; + int nwritten; + int errcode; DEBUGASSERT(this && rthis->fd >= 0); @@ -88,24 +89,13 @@ static void rawsostream_putc(FAR struct lib_sostream_s *this, int ch) } /* The only expected error is EINTR, meaning that the write operation - * was awakened by a signal. Zero would not be a valid return value - * from write(). + * was awakened by a signal. Zero or values > 1 would not be valid + * return values from write(). */ + errcode = get_errno(); DEBUGASSERT(nwritten < 0); - } while (get_errno() == EINTR); -} - -/**************************************************************************** - * Name: rawsostream_seek - ****************************************************************************/ - -static off_t rawsostream_seek(FAR struct lib_sostream_s *this, off_t offset, int whence) -{ - FAR struct lib_rawsostream_s *mthis = (FAR struct lib_rawsostream_s *)this; - - DEBUGASSERT(this); - return lseek(mthis->fd, offset, whence); + } while (errcode == EINTR); } /**************************************************************************** @@ -113,14 +103,14 @@ static off_t rawsostream_seek(FAR struct lib_sostream_s *this, off_t offset, int ****************************************************************************/ /**************************************************************************** - * Name: lib_rawsostream + * Name: lib_rawoutstream * * Description: * Initializes a stream for use with a file descriptor. * * Input parameters: * outstream - User allocated, uninitialized instance of struct - * lib_rawsostream_s to be initialized. + * lib_rawoutstream_s to be initialized. * fd - User provided file/socket descriptor (must have been opened * for write access). * @@ -129,13 +119,12 @@ static off_t rawsostream_seek(FAR struct lib_sostream_s *this, off_t offset, int * ****************************************************************************/ -void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd) +void lib_rawoutstream(FAR struct lib_rawoutstream_s *outstream, int fd) { - outstream->public.put = rawsostream_putc; + outstream->public.put = rawoutstream_putc; #ifdef CONFIG_STDIO_LINEBUFFER - outstream->public.flush = lib_snoflush; + outstream->public.flush = lib_noflush; #endif - outstream->public.seek = rawsostream_seek; outstream->public.nput = 0; outstream->fd = fd; } diff --git a/lib/libc/stdio/lib_rawsistream.c b/lib/libc/stdio/lib_rawsistream.c index a343d6e..b2d24f1 100644 --- a/lib/libc/stdio/lib_rawsistream.c +++ b/lib/libc/stdio/lib_rawsistream.c @@ -16,9 +16,9 @@ * ****************************************************************************/ /**************************************************************************** - * libc/stdio/lib_rawinstream.c + * libc/stdio/lib_rawsistream.c * - * Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,12 +65,12 @@ ****************************************************************************/ /**************************************************************************** - * Name: rawinstream_getc + * Name: rawsistream_getc ****************************************************************************/ -static int rawinstream_getc(FAR struct lib_instream_s *this) +static int rawsistream_getc(FAR struct lib_sistream_s *this) { - FAR struct lib_rawinstream_s *rthis = (FAR struct lib_rawinstream_s *)this; + FAR struct lib_rawsistream_s *rthis = (FAR struct lib_rawsistream_s *)this; int nwritten; char ch; @@ -94,18 +94,30 @@ static int rawinstream_getc(FAR struct lib_instream_s *this) } /**************************************************************************** + * Name: rawsistream_seek + ****************************************************************************/ + +static off_t rawsistream_seek(FAR struct lib_sistream_s *this, off_t offset, int whence) +{ + FAR struct lib_rawsistream_s *mthis = (FAR struct lib_rawsistream_s *)this; + + DEBUGASSERT(this); + return lseek(mthis->fd, offset, whence); +} + +/**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: lib_rawinstream + * Name: lib_rawsistream * * Description: * Initializes a stream for use with a file descriptor. * * Input parameters: * instream - User allocated, uninitialized instance of struct - * lib_rawinstream_s to be initialized. + * lib_rawsistream_s to be initialized. * fd - User provided file/socket descriptor (must have been opened * for the correct access). * @@ -114,9 +126,10 @@ static int rawinstream_getc(FAR struct lib_instream_s *this) * ****************************************************************************/ -void lib_rawinstream(FAR struct lib_rawinstream_s *instream, int fd) +void lib_rawsistream(FAR struct lib_rawsistream_s *instream, int fd) { - instream->public.get = rawinstream_getc; + instream->public.get = rawsistream_getc; + instream->public.seek = rawsistream_seek; instream->public.nget = 0; instream->fd = fd; } diff --git a/lib/libc/stdio/lib_rawsostream.c b/lib/libc/stdio/lib_rawsostream.c index 10d1c41..d9a8f06 100644 --- a/lib/libc/stdio/lib_rawsostream.c +++ b/lib/libc/stdio/lib_rawsostream.c @@ -16,9 +16,9 @@ * ****************************************************************************/ /**************************************************************************** - * libc/stdio/lib_rawoutstream.c + * libc/stdio/lib_rawsostream.c * - * Copyright (C) 2007-2009, 2011-2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -65,15 +65,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: rawoutstream_putc + * Name: rawsostream_putc ****************************************************************************/ -static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch) +static void rawsostream_putc(FAR struct lib_sostream_s *this, int ch) { - FAR struct lib_rawoutstream_s *rthis = (FAR struct lib_rawoutstream_s *)this; - char buffer = ch; + FAR struct lib_rawsostream_s *rthis = (FAR struct lib_rawsostream_s *)this; int nwritten; - int errcode; + char buffer = ch; DEBUGASSERT(this && rthis->fd >= 0); @@ -89,13 +88,24 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch) } /* The only expected error is EINTR, meaning that the write operation - * was awakened by a signal. Zero or values > 1 would not be valid - * return values from write(). + * was awakened by a signal. Zero would not be a valid return value + * from write(). */ - errcode = get_errno(); DEBUGASSERT(nwritten < 0); - } while (errcode == EINTR); + } while (get_errno() == EINTR); +} + +/**************************************************************************** + * Name: rawsostream_seek + ****************************************************************************/ + +static off_t rawsostream_seek(FAR struct lib_sostream_s *this, off_t offset, int whence) +{ + FAR struct lib_rawsostream_s *mthis = (FAR struct lib_rawsostream_s *)this; + + DEBUGASSERT(this); + return lseek(mthis->fd, offset, whence); } /**************************************************************************** @@ -103,14 +113,14 @@ static void rawoutstream_putc(FAR struct lib_outstream_s *this, int ch) ****************************************************************************/ /**************************************************************************** - * Name: lib_rawoutstream + * Name: lib_rawsostream * * Description: * Initializes a stream for use with a file descriptor. * * Input parameters: * outstream - User allocated, uninitialized instance of struct - * lib_rawoutstream_s to be initialized. + * lib_rawsostream_s to be initialized. * fd - User provided file/socket descriptor (must have been opened * for write access). * @@ -119,12 +129,13 @@ 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_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd) { - outstream->public.put = rawoutstream_putc; + outstream->public.put = rawsostream_putc; #ifdef CONFIG_STDIO_LINEBUFFER - outstream->public.flush = lib_noflush; + outstream->public.flush = lib_snoflush; #endif + outstream->public.seek = rawsostream_seek; outstream->public.nput = 0; outstream->fd = fd; } -- 2.7.4