From 97f9404ac08d8627f237cf081c28cbd8a2e2c3e5 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 20 Apr 2011 22:32:06 +0200 Subject: [PATCH] Define oio_err earlier --- oio.h | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/oio.h b/oio.h index a36e9d4c..2e696c2b 100644 --- a/oio.h +++ b/oio.h @@ -29,9 +29,9 @@ #include /* size_t */ +typedef struct oio_err_s oio_err; typedef struct oio_handle_s oio_handle; typedef struct oio_req_s oio_req; -typedef struct oio_err_s oio_err; /** * The status parameter is 0 if the request completed successfully, @@ -54,25 +54,6 @@ typedef void (*oio_timer_cb)(oio_req* req, int64_t skew, int status); #endif -typedef enum { - OIO_UNKNOWN_HANDLE = 0, - OIO_TCP, - OIO_NAMED_PIPE, - OIO_TTY, - OIO_FILE, -} oio_handle_type; - -typedef enum { - OIO_UNKNOWN_REQ = 0, - OIO_CONNECT, - OIO_ACCEPT, - OIO_READ, - OIO_WRITE, - OIO_SHUTDOWN, - OIO_CLOSE, - OIO_TIMEOUT -} oio_req_type; - /* Expand this list if necessary. */ typedef enum { OIO_UNKNOWN = -1, @@ -109,6 +90,32 @@ typedef enum { OIO_ETIMEDOUT } oio_err_code; +typedef enum { + OIO_UNKNOWN_HANDLE = 0, + OIO_TCP, + OIO_NAMED_PIPE, + OIO_TTY, + OIO_FILE, +} oio_handle_type; + +typedef enum { + OIO_UNKNOWN_REQ = 0, + OIO_CONNECT, + OIO_ACCEPT, + OIO_READ, + OIO_WRITE, + OIO_SHUTDOWN, + OIO_CLOSE, + OIO_TIMEOUT +} oio_req_type; + + +struct oio_err_s { + /* read-only */ + oio_err_code code; + /* private */ + int sys_errno_; +}; struct oio_handle_s { /* read-only */ @@ -131,13 +138,6 @@ struct oio_req_s { oio_req_private_fields }; -struct oio_err_s { - /* read-only */ - oio_err_code code; - /* private */ - int sys_errno_; -}; - /** * Most functions return boolean: 0 for success and -1 for failure.