[rtems commit] redirector: Rename rtems_stdio_redirect_t

Sebastian Huber sebh at rtems.org
Wed Sep 17 06:13:08 UTC 2014


Module:    rtems
Branch:    master
Commit:    c040b113daec7e72210681e7ebd157738e58e1ca
Changeset: http://git.rtems.org/rtems/commit/?id=c040b113daec7e72210681e7ebd157738e58e1ca

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 17 07:21:35 2014 +0200

redirector: Rename rtems_stdio_redirect_t

Rename rtems_stdio_redirect_t to rtems_stdio_redirect since the
namespace *_t is reserved by POSIX, see also The Open Group Base
Specifications Issue 6 IEEE Std 1003.1, 2004 Edition, 2.2.2 The Name
Space.

---

 cpukit/libmisc/redirector/stdio-redirect.c |   26 +++++++++++++-------------
 cpukit/libmisc/redirector/stdio-redirect.h |   24 ++++++++++++------------
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/cpukit/libmisc/redirector/stdio-redirect.c b/cpukit/libmisc/redirector/stdio-redirect.c
index e6610cb..05a263d 100644
--- a/cpukit/libmisc/redirector/stdio-redirect.c
+++ b/cpukit/libmisc/redirector/stdio-redirect.c
@@ -31,7 +31,7 @@
 #define RTEMS_STDIO_REDIRECT_FINISHED (1 << 1)
 
 static bool
-rtems_stdio_redirect_lock(rtems_stdio_redirect_t* sr)
+rtems_stdio_redirect_lock(rtems_stdio_redirect* sr)
 {
   rtems_status_code sc = rtems_semaphore_obtain (sr->lock,
                                                  RTEMS_WAIT,
@@ -45,7 +45,7 @@ rtems_stdio_redirect_lock(rtems_stdio_redirect_t* sr)
 }
 
 static bool
-rtems_stdio_redirect_unlock(rtems_stdio_redirect_t* sr)
+rtems_stdio_redirect_unlock(rtems_stdio_redirect* sr)
 {
   rtems_status_code sc = rtems_semaphore_release (sr->lock);
   if (sc != RTEMS_SUCCESSFUL)
@@ -57,7 +57,7 @@ rtems_stdio_redirect_unlock(rtems_stdio_redirect_t* sr)
 }
 
 static bool
-rtems_stdio_redirect_write (rtems_stdio_redirect_t* sr, const char* buf, ssize_t len)
+rtems_stdio_redirect_write (rtems_stdio_redirect* sr, const char* buf, ssize_t len)
 {
   if (!rtems_stdio_redirect_lock(sr))
     return false;
@@ -99,7 +99,7 @@ rtems_stdio_redirect_write (rtems_stdio_redirect_t* sr, const char* buf, ssize_t
 static rtems_task
 rtems_stdio_redirect_reader(rtems_task_argument arg)
 {
-  rtems_stdio_redirect_t* sr = (rtems_stdio_redirect_t*) arg;
+  rtems_stdio_redirect* sr = (rtems_stdio_redirect*) arg;
 
   while (sr->state & RTEMS_STDIO_REDIRECT_RUNNING)
   {
@@ -120,7 +120,7 @@ rtems_stdio_redirect_reader(rtems_task_argument arg)
   rtems_task_delete(RTEMS_SELF);
 }
 
-rtems_stdio_redirect_t*
+rtems_stdio_redirect*
 rtems_stdio_redirect_open(int                          fd,
                           rtems_task_priority          priority,
                           size_t                       stack_size,
@@ -129,11 +129,11 @@ rtems_stdio_redirect_open(int                          fd,
                           bool                         echo,
                           rtems_stdio_redirect_handler handler)
 {
-  rtems_stdio_redirect_t* sr;
-  rtems_name              name;
-  rtems_status_code       sc;
+  rtems_stdio_redirect* sr;
+  rtems_name            name;
+  rtems_status_code     sc;
 
-  sr = malloc(sizeof(rtems_stdio_redirect_t));
+  sr = malloc(sizeof(*sr));
   if (!sr)
   {
     fprintf(stderr, "error: stdio-redirect: no memory\n");
@@ -248,7 +248,7 @@ rtems_stdio_redirect_open(int                          fd,
 }
 
 void
-rtems_stdio_redirect_close(rtems_stdio_redirect_t* sr)
+rtems_stdio_redirect_close(rtems_stdio_redirect* sr)
 {
   if (rtems_stdio_redirect_lock(sr))
   {
@@ -278,9 +278,9 @@ rtems_stdio_redirect_close(rtems_stdio_redirect_t* sr)
 }
 
 ssize_t
-rtems_stdio_redirect_read(rtems_stdio_redirect_t* sr,
-                          char*                   buffer,
-                          ssize_t                 length)
+rtems_stdio_redirect_read(rtems_stdio_redirect* sr,
+                          char*                 buffer,
+                          ssize_t               length)
 {
   ssize_t written = 0;
 
diff --git a/cpukit/libmisc/redirector/stdio-redirect.h b/cpukit/libmisc/redirector/stdio-redirect.h
index cf3d0cf..6f1d4cd 100644
--- a/cpukit/libmisc/redirector/stdio-redirect.h
+++ b/cpukit/libmisc/redirector/stdio-redirect.h
@@ -75,7 +75,7 @@ typedef struct
   bool                         full;        /**< The buffer is full. */
   bool                         echo;        /**< Echo the data out the existing path. */
   rtems_stdio_redirect_handler handler;     /**< Redirected data handler. */
-} rtems_stdio_redirect_t;
+} rtems_stdio_redirect;
 
 /*
  * Open a redirector returning the handle to it.
@@ -83,18 +83,18 @@ typedef struct
  * @param fd The file descriptor to redirect.
  * @param priority The priority of the reader thread.
  */
-rtems_stdio_redirect_t* rtems_stdio_redirect_open(int                          fd,
-                                                  rtems_task_priority          priority,
-                                                  size_t                       stack_size,
-                                                  ssize_t                      input_size,
-                                                  ssize_t                      buffer_size,
-                                                  bool                         echo,
-                                                  rtems_stdio_redirect_handler handler);
+rtems_stdio_redirect* rtems_stdio_redirect_open(int                          fd,
+                                                rtems_task_priority          priority,
+                                                size_t                       stack_size,
+                                                ssize_t                      input_size,
+                                                ssize_t                      buffer_size,
+                                                bool                         echo,
+                                                rtems_stdio_redirect_handler handler);
 
 /*
  * Close the redirector.
  */
-void rtems_stdio_redirect_close(rtems_stdio_redirect_t* sr);
+void rtems_stdio_redirect_close(rtems_stdio_redirect* sr);
 
 /*
  * Get data from the capture buffer. Data read is removed from the buffer.
@@ -104,9 +104,9 @@ void rtems_stdio_redirect_close(rtems_stdio_redirect_t* sr);
  * @param length The size of the buffer.
  * @return ssize_t The amount of data written and -1 or an error.
  */
-ssize_t rtems_stdio_redirect_read(rtems_stdio_redirect_t* sr,
-                                  char*                   buffer,
-                                  ssize_t                 length);
+ssize_t rtems_stdio_redirect_read(rtems_stdio_redirect* sr,
+                                  char*                 buffer,
+                                  ssize_t               length);
 
 #ifdef __cplusplus
 }



More information about the vc mailing list