home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / include / sys / fsext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-12  |  1.5 KB  |  60 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_sys_fsext_h_
  3. #define __dj_include_sys_fsext_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #ifndef _POSIX_SOURCE
  14.  
  15. #include <stdarg.h>
  16.  
  17. typedef enum {
  18.   __FSEXT_nop,
  19.   __FSEXT_open,
  20.   __FSEXT_creat,
  21.   __FSEXT_read,
  22.   __FSEXT_write,
  23.   __FSEXT_ready,
  24.   __FSEXT_close,
  25.   __FSEXT_fcntl,
  26.   __FSEXT_ioctl,
  27. } __FSEXT_Fnumber;
  28.  
  29. /* _ready gets passed a fd and should return a mask of these,
  30.    as if we were emulating "int ready(int fd)" */
  31. #define __FSEXT_ready_read    1
  32. #define __FSEXT_ready_write    2
  33. #define __FSEXT_ready_error    4
  34.  
  35. /* The return value is nonzero if the function has overridden the
  36.    caller's functionality. */
  37. typedef int (__FSEXT_Function)(__FSEXT_Fnumber _function_number,
  38.                    int *_rv, va_list _args);
  39.  
  40. int               __FSEXT_alloc_fd(__FSEXT_Function *_function);
  41. int               __FSEXT_set_function(int _fd, __FSEXT_Function *_function);
  42. __FSEXT_Function *__FSEXT_get_function(int _fd);
  43.  
  44. int               __FSEXT_add_open_handler(__FSEXT_Function *_function);
  45. int               __FSEXT_call_open_handlers(__FSEXT_Fnumber _function_number,
  46.                          int *rv, va_list _args);
  47.  
  48. #endif /* !_POSIX_SOURCE */
  49. #endif /* !__STRICT_ANSI__ */
  50. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  51.  
  52. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  53. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  54.  
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58.  
  59. #endif /* !__dj_include_sys_fsext_h_ */
  60.