Moved the select stuff into its own header file for now which is now included
from both, Drivers.h, and fs_interface.h. The latter no longer includes vfs_types.h for iovecs, but <sys/uio.h> for iovec. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9140 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/uio.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <Select.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -14,20 +16,6 @@ extern "C" {
|
||||
these hooks are how the kernel accesses the device
|
||||
--- */
|
||||
|
||||
struct selectsync;
|
||||
typedef struct selectsync selectsync;
|
||||
#ifndef B_SELECT_READ
|
||||
/* those were lacking for quite some time...
|
||||
yes the select API will get deprecated, but for now that goes here. */
|
||||
#define B_SELECT_READ 1
|
||||
#define B_SELECT_WRITE 2
|
||||
#define B_SELECT_EXCEPTION 3
|
||||
// that's Be's prototype...
|
||||
//extern void notify_select_event(selectsync * sync, uint32 ref);
|
||||
// moved from current/headers/private/kernel/vfs.h
|
||||
extern status_t notify_select_event(struct selectsync *sync, uint32 ref, uint8 event);
|
||||
#endif
|
||||
|
||||
typedef status_t (*device_open_hook) (const char *name, uint32 flags, void **cookie);
|
||||
typedef status_t (*device_close_hook) (void *cookie);
|
||||
typedef status_t (*device_free_hook) (void *cookie);
|
||||
@@ -41,9 +29,9 @@ typedef status_t (*device_select_hook) (void *cookie, uint8 event, uint32 ref,
|
||||
selectsync *sync);
|
||||
typedef status_t (*device_deselect_hook) (void *cookie, uint8 event,
|
||||
selectsync *sync);
|
||||
typedef status_t (*device_read_pages_hook)(void *deviceCookie, off_t position, const iovec *vec,
|
||||
typedef status_t (*device_read_pages_hook)(void *cookie, off_t position, const iovec *vec,
|
||||
size_t count, size_t *_numBytes);
|
||||
typedef status_t (*device_write_pages_hook) (void *deviceCookie, off_t position, const iovec *vec,
|
||||
typedef status_t (*device_write_pages_hook) (void *cookie, off_t position, const iovec *vec,
|
||||
size_t count, size_t *_numBytes);
|
||||
|
||||
#define B_CUR_DRIVER_API_VERSION 2
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/* File System and Drivers select support
|
||||
**
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
#ifndef _DRIVERS_SELECT_H
|
||||
#define _DRIVERS_SELECT_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
struct selectsync;
|
||||
typedef struct selectsync selectsync;
|
||||
|
||||
enum select_events {
|
||||
B_SELECT_READ = 1, // standard select() support
|
||||
B_SELECT_WRITE,
|
||||
B_SELECT_ERROR,
|
||||
|
||||
B_SELECT_PRI_READ, // additional poll() support
|
||||
B_SELECT_PRI_WRITE,
|
||||
|
||||
B_SELECT_HIGH_PRI_READ,
|
||||
B_SELECT_HIGH_PRI_WRITE,
|
||||
|
||||
B_SELECT_DISCONNECTED
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef COMPILE_FOR_R5
|
||||
extern status_t notify_select_event(struct selectsync *sync, uint32 ref);
|
||||
#else
|
||||
extern status_t notify_select_event(struct selectsync *sync, uint32 ref, uint8 event);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _DRIVERS_SELECT_H */
|
||||
@@ -7,8 +7,10 @@
|
||||
|
||||
|
||||
#include <OS.h>
|
||||
#include <Select.h>
|
||||
#include <module.h>
|
||||
#include <vfs_types.h>
|
||||
|
||||
#include <sys/uio.h>
|
||||
|
||||
|
||||
struct dirent;
|
||||
|
||||
Reference in New Issue
Block a user