Changeset 25 for rxutilex/trunk/rxutilex.c
- Timestamp:
- Jul 14, 2015, 12:56:28 PM (10 years ago)
- File:
-
- 1 edited
-
rxutilex/trunk/rxutilex.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
