Reorganize some stuff in oio.h

This commit is contained in:
Bert Belder 2011-05-03 02:01:59 +02:00
parent 1a76881cb0
commit 61c91120e5

35
oio.h
View File

@ -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