Changeset 25
- Timestamp:
- Jul 14, 2015, 12:56:28 PM (10 years ago)
- Location:
- rxutilex/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
rxutilex/trunk/FUNCTIONS
r22 r25 490 490 491 491 ------------------------------------------------------------------------- 492 Sys2SyncBuffer 493 494 Used to synchronize buffer read/write transactions (wrapper to 495 DosResetBuffer) For external files, writes the buffer to disk. 496 For named pipes, blocks until the remote client end of the pipe has read 497 the contents. 498 499 REXX ARGUMENTS: 500 1. File handle (as returned by Sys2Open or Sys2CreateNamedPipe). 501 (REQUIRED) 502 503 REXX RETURN VALUE: 1 on success, 0 on failure 504 505 ------------------------------------------------------------------------- 492 506 Sys2Version 493 507 -
rxutilex/trunk/npsrv_w.cmd
r17 r25 12 12 if ok == 0 then say SYS2ERR 13 13 else say ok 'bytes written.' 14 /* 15 do until _cb == 0 16 PARSE VALUE Sys2CheckNamedPipe( hp ) WITH _cb _state 17 if _cb == "" then do 18 say SYS2ERR 19 leave 20 end 21 end 22 */ 14 ok = Sys2SyncBuffer( hp ) 15 if ok == 0 then say SYS2ERR 23 16 ok = Sys2DisconnectNamedPipe( hp ) 24 17 if ok == 0 then say SYS2ERR -
rxutilex/trunk/rxutilex.c
r24 r25 84 84 #define SZ_LIBRARY_NAME "RXUTILEX" // Name of this library 85 85 #define SZ_ERROR_NAME "SYS2ERR" // REXX variable used to store error codes 86 #define SZ_VERSION "0.1. 1" // Current version of this library86 #define SZ_VERSION "0.1.2" // Current version of this library 87 87 88 88 // Maximum string lengths... … … 130 130 "Sys2Seek", 131 131 "Sys2Read", 132 "Sys2SyncBuffer", 132 133 "Sys2Write", 133 134 "Sys2Version" … … 171 172 RexxFunctionHandler Sys2Read; 172 173 RexxFunctionHandler Sys2Write; 174 RexxFunctionHandler Sys2SyncBuffer; 173 175 174 176 … … 2091 2093 2092 2094 2095 /* ------------------------------------------------------------------------- * 2096 * Sys2SyncBuffer * 2097 * * 2098 * Wrapper to DosResetBuffer: for external files, write the buffer to disk; * 2099 * for pipes, block until the far end of the pipe has read the contents. * 2100 * * 2101 * REXX ARGUMENTS: * 2102 * 1. File handle (returned by Sys2Open) (REQUIRED) * 2103 * * 2104 * REXX RETURN VALUE: * 2105 * 1 on success, or 0 if an error occurred. * 2106 * ------------------------------------------------------------------------- */ 2107 ULONG APIENTRY Sys2SyncBuffer( PSZ pszName, ULONG argc, RXSTRING argv[], PSZ pszQueue, PRXSTRING prsResult ) 2108 { 2109 HFILE hf; 2110 APIRET rc; 2111 2112 // Reset the error indicator 2113 WriteErrorCode( 0, NULL ); 2114 2115 // Make sure we have exactly one valid argument (the file handle) 2116 if ( argc != 1 || ( !RXVALIDSTRING(argv[0]) )) 2117 return ( 40 ); 2118 if (( sscanf( argv[0].strptr, "%8X", &hf )) != 1 ) return ( 40 ); 2119 2120 // Sync the buffer 2121 rc = DosResetBuffer( hf ); 2122 if ( rc != NO_ERROR ) { 2123 WriteErrorCode( rc, "DosResetBuffer"); 2124 MAKERXSTRING( *prsResult, "0", 1 ); 2125 } 2126 else { 2127 MAKERXSTRING( *prsResult, "1", 1 ); 2128 } 2129 2130 return ( 0 ); 2131 } 2132 2133 2134 2093 2135 // ------------------------------------------------------------------------- 2094 2136 // INTERNAL FUNCTIONS -
rxutilex/trunk/rxutilex.def
r23 r25 1 1 LIBRARY RXUTILEX INITINSTANCE TERMINSTANCE 2 2 DATA MULTIPLE NONSHARED 3 DESCRIPTION '@#Alex Taylor:0.1. 1#@##1## 3 May 2015 22:36:07REINFORCE::::::@@Extended REXX Utility Functions'3 DESCRIPTION '@#Alex Taylor:0.1.2#@##1## 12 Jul 2015 20:07:59 REINFORCE::::::@@Extended REXX Utility Functions' 4 4 5 5 EXPORTS Sys2LoadFuncs … … 27 27 Sys2Read 28 28 Sys2Write 29 29 Sys2SyncBuffer
Note:
See TracChangeset
for help on using the changeset viewer.