forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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_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,7 +278,7 @@ rtems_stdio_redirect_close(rtems_stdio_redirect_t* sr)
|
||||
}
|
||||
|
||||
ssize_t
|
||||
rtems_stdio_redirect_read(rtems_stdio_redirect_t* sr,
|
||||
rtems_stdio_redirect_read(rtems_stdio_redirect* sr,
|
||||
char* buffer,
|
||||
ssize_t length)
|
||||
{
|
||||
|
||||
@@ -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,7 +83,7 @@ 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_stdio_redirect* rtems_stdio_redirect_open(int fd,
|
||||
rtems_task_priority priority,
|
||||
size_t stack_size,
|
||||
ssize_t input_size,
|
||||
@@ -94,7 +94,7 @@ rtems_stdio_redirect_t* rtems_stdio_redirect_open(int f
|
||||
/*
|
||||
* 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,7 +104,7 @@ 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,
|
||||
ssize_t rtems_stdio_redirect_read(rtems_stdio_redirect* sr,
|
||||
char* buffer,
|
||||
ssize_t length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user