From 61c91120e5707e1678a3f6e87a5ab45f44be1059 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 3 May 2011 02:01:59 +0200 Subject: [PATCH] Reorganize some stuff in oio.h --- oio.h | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/oio.h b/oio.h index 7f68fcab..e630786c 100644 --- a/oio.h +++ b/oio.h @@ -32,6 +32,14 @@ typedef struct oio_err_s oio_err; typedef struct oio_handle_s oio_handle; typedef struct oio_req_s oio_req; + +#if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__) +# include "oio-unix.h" +#else +# include "oio-win.h" +#endif + + /* The status parameter is 0 if the request completed successfully, * and should be -1 if the request was cancelled or failed. * For oio_close_cb, -1 means that the handle was closed due to an error. @@ -49,13 +57,6 @@ typedef void (*oio_close_cb)(oio_handle* handle, int status); typedef void (*oio_timer_cb)(oio_req* req, int64_t skew, int status); -#if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__) -# include "oio-unix.h" -#else -# include "oio-win.h" -#endif - - /* Expand this list if necessary. */ typedef enum { OIO_UNKNOWN = -1, @@ -120,15 +121,6 @@ struct oio_err_s { int sys_errno_; }; -struct oio_handle_s { - /* read-only */ - oio_handle_type type; - /* public */ - oio_close_cb close_cb; - void* data; - /* private */ - oio_handle_private_fields -}; struct oio_req_s { /* read-only */ @@ -142,6 +134,17 @@ struct oio_req_s { }; +struct oio_handle_s { + /* read-only */ + oio_handle_type type; + /* public */ + oio_close_cb close_cb; + void* data; + /* private */ + oio_handle_private_fields +}; + + /** * Most functions return boolean: 0 for success and -1 for failure. * On error the user should then call oio_last_error() to determine