delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/26/11:29:14

Message-Id: <3.0.1.32.19971126103254.007ec100@yacker.xiotech.com>
Date: Wed, 26 Nov 1997 10:32:54 -0600
To: djgpp-workers AT delorie DOT com
From: Randy Maas <randym AT acm DOT org>
Subject: patch for fsext.txh
Mime-Version: 1.0

--=====================_880583574==_
Content-Type: text/plain; charset="us-ascii"


--=====================_880583574==_
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: attachment; filename="fsext-t.dif"

*** src/libc/fsext/fsext.txh~1	Sun Aug 31 16:39:52 1997
--- src/libc/fsext/fsext.txh	Wed Nov 26 09:53:48 1997
***************
*** 15,19 ****
  
  @example
!   int function(__FSEXT_Fnumber func_number, int *rv, va_list args);
  @end example
  
--- 15,19 ----
  
  @example
!   int function(__FSEXT_Fnumber func_number, int *rv, va_list args, void* state);
  @end example
  
***************
*** 73,76 ****
--- 73,103 ----
  A close handler.  Called when the ``file'' should be closed.
  
+ @item __FSEXT_fcntl
+ 
+ A file fcntl handler.
+ 
+ @item __FSEXT_ioctl
+ 
+ A file ioctl handler.
+ 
+ @item __FSEXT_lseek
+ 
+ A file lseek handler (@pxref{lseek}).
+ 
+ @item __FSEXT_link
+ 
+ A file link handler (@pxref{link}).  This is most relevant to
+ file system extensions that emulate a directory structure.
+ 
+ @item __FSEXT_unlink
+ 
+ A file unlink handler (@pxref{unlink}).  This is most relevant to
+ file system extensions that emulate a directory structure.
+ 
+ @item __FSEXT_dup2
+ 
+ A file dup2 handler (@pxref{dup2}).  This is called when two different
+ file descriptors are used to refer to the same open file.
+ 
  @end table
  
***************
*** 153,156 ****
--- 180,184 ----
  #include <sys/fsext.h>
  
+ int __FSEXT_set_function(__FSEXT_Function *_function, void* state)
  int __FSEXT_set_function(int _fd, __FSEXT_Function *_function);
  @end example
***************
*** 162,166 ****
  for I/O.  One situation where you might need this is when you must catch
  output to the terminal and play some tricks with it, like colorize it or
! redirect it to another device.
  
  @subheading Return Value
--- 190,195 ----
  for I/O.  One situation where you might need this is when you must catch
  output to the terminal and play some tricks with it, like colorize it or
! redirect it to another device.  The @var{state} is an additional pointer to
! the handlers' specific data for the file descriptor.
  
  @subheading Return Value
***************
*** 208,212 ****
  @end example
  
- 
  @c ----------------------------------------------------------------------
  @node __FSEXT_get_function, file system
--- 237,240 ----
***************
*** 216,226 ****
  #include <sys/fsext.h>
  
! __FSEXT_Function *__FSEXT_get_function(int _fd);
  @end example
  
  This function is part of the @ref{File System Extensions}.  It is used
  internal to libc.a to redirect I/O requests to the appropriate
  extensions.
  
  @subheading Example
  
--- 244,259 ----
  #include <sys/fsext.h>
  
! int __FSEXT_get_function(int _fd, __FSEXT_Function** func, void** state)
  @end example
  
+ @subheading Description
+ 
  This function is part of the @ref{File System Extensions}.  It is used
  internal to libc.a to redirect I/O requests to the appropriate
  extensions.
  
+ @subheading Return Value
+ 1 if the file descriptor has a handler associated with it, 0 otherwise.
+ 
  @subheading Example
  
***************
*** 228,239 ****
  _read(int fd, void *buf, int len)
  @{
!   __FSEXT_Function *func = __FSEXT_get_function(fd);
!   if (func)
!   @{
!     int rv;
!     if (func(__FSEXT_read, &rv, &fd))
!       return rv;
!   @}
!   /* rest of read() */
  @}
  @end example
--- 261,273 ----
  _read(int fd, void *buf, int len)
  @{
!    void* state;
!    __FSEXT_Function *func;
! 
!    if (__FSEXT_get_function(fd, &func, &state) && func)
!     @{
!        int rv;
!        if (func(__FSEXT_read, &rv, &fd, state)) return rv;
!     @}
!    /@* rest of read() *@/
  @}
  @end example

--=====================_880583574==_
Content-Type: text/plain; charset="us-ascii"



--=====================_880583574==_--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019