Home Building DHTML Scripting Using Diaperglu Documention Key Script Commands Reference C Library API Reference Handy References About License Contact Forth Draft Standard
C Functions dg_catchbadmemoryerror dg_trycatchbadmemoryerror dg_endtrycatchbadmemoryerror dg_catchbadmemoryerrorwithfullframe dg_trycatchbadmemoryerrorwithfullframe dg_fstat dg_write
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_catchbadmemoryerror
//
// C prototype: 
//  void dg_catchbadmemoryerror (
//   int signum, 
//   siginfo_t* pinfo, 
//   void* pcontext)
//
// Inputs:
//  int                 signum
//  siginfo_t*          pinfo, 
//   void*              pcontext
//                              
//
// Outputs:
//  none
//                              
// Action:
//  Signal handler invoked during a memory exception from subroutines with a standard
//   diaperglu x86 stack frame. This routine sets the return vector to
//   dg_catchbadmemoryexit
//
// Notes:
//  standard diaperglu x86 subroutine stack frame
//   parameter n
//   ...
//   parameter 2
//   parameter 1
//   parameter 0
//   return address
//   saved parent subroutine frame pointer ebp
//   saved register ebx
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_trycatchbadmemoryerror
//
// C prototype: 
//  void dg_trycatchbadmemoryerror ()
//
// Inputs:
//  none                         
//
// Outputs:
//  none
//                              
// Action:
//  Sets the memory exception signal handlers to dg_catchbadmemoryerror which enables
//   trapping of memory access errors for subroutines with a standard diaperglu
//   x86 stack frame
//
// Notes:
//  standard diaperglu x86 subroutine stack frame
//   parameter n
//   ...
//   parameter 2
//   parameter 1
//   parameter 0
//   return address
//   saved parent subroutine frame pointer ebp
//   saved register ebx
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_endtrycatchbadmemoryerror
//
// C prototype: 
//  void dg_endtrycatchbadmemoryerror ()
//
// Inputs:
//  none                         
//
// Outputs:
//  none
//                              
// Action:
//  Resets the memory exception signal handlers to the system default handlers 
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_catchbadmemoryerrorwithfullframe
//
// C prototype: 
//  void dg_catchbadmemoryerrorwithfullframe (
//   int signum, 
//   siginfo_t* pinfo, 
//   void* pcontext)
//
// Inputs:
//  int                 signum
//  siginfo_t*          pinfo, 
//   void*              pcontext
//                              
//
// Outputs:
//  none
//                              
// Action:
//  Signal handler invoked during a memory exception from subroutines with a full
//   diaperglu x86 stack frame. This routine sets the return vector to
//   dg_catchbadmemoryexitwithfullframe
//
// Notes:
//  full diaperglu x86 subroutine stack frame
//   parameter n
//   ...
//   parameter 2
//   parameter 1
//   parameter 0
//   return address
//   saved parent subroutine frame pointer ebp
//   saved register ebx
//   saved register esi
//   saved register edi
//   saved register eflags (to save the value of the direction flag)
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_trycatchbadmemoryerrorwithfullframe
//
// C prototype: 
//  void dg_trycatchbadmemoryerrorwithfullframe ()
//
// Inputs:
//  none                         
//
// Outputs:
//  none
//                              
// Action:
//  Sets the memory exception signal handlers to dg_catchbadmemoryerror which enables
//   trapping of memory access errors for subroutines with a standard diaperglu x86
//    stack frame
//
// Notes:
//  full diaperglu x86 subroutine stack frame
//   parameter n
//   ...
//   parameter 2
//   parameter 1
//   parameter 0
//   return address
//   saved parent subroutine frame pointer ebp
//   saved register ebx
//   saved register esi
//   saved register edi
//   saved register eflags (to save the value of the direction flag)
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_fstat
//
// C prototype: 
//  UINT64 dg_fstat(
//   UINT64 fileid,
//   UINT64 pstat)
//
// Inputs:
//  UINT64      fileid          file id of an open file
//  UINT64      pstat           pointer to a stat stucture which will be filled with
//                               information about the file
//
// Outputs:
//  UINT64      return          0 on success, -1 on error
//                              
// Action:
//  fills a stat structure with information about file fileid
//  see manpage for stat for more information 
// 
// //////////////////////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////////////////////
//
// dg_write
//
// C prototype: 
//  UINT64 dg_write(
//   UINT64 fileid,
//   UINT64 pbuf,
//   UINT64 length)
//
// Inputs:
//  UINT64      fileid          file id of an open file
//  UINT64      pbuf            pointer to a buffer containing bytes to write
//  UINT64      length          number of bytes to write
//
// Outputs:
//  UINT64      return          0 on success, -1 on error
//                              
// Action:
//  attempts to write length bytes to the file fileid 
// 
// //////////////////////////////////////////////////////////////////////////////////////