Changeset 29
- Timestamp:
- Jan 26, 2016, 4:13:36 PM (10 years ago)
- Location:
- rxutilex/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
rxutilex/trunk/FUNCTIONS
r25 r29 25 25 Sys2ReplaceModule - Unlock a DLL (DosReplaceModule wrapper) 26 26 Sys2Seek - Set file read/write pointer (with >2GB support) 27 Sys2SyncBuffer - synchronize read/write (DosResetBuffer wrapper) 27 28 Sys2Version - Get the version of this library 28 29 Sys2Write - Write bytes to a file or named pipe … … 278 279 279 280 If a DLL with the given name is currently loaded, that instance of the 280 DLL will be returned. Otherwise, standard DLL loading rules (according 281 to the current LIBPATH and/or extended LIBPATH configuration) are used to 282 search for a DLL whose module name matches the one specified. 281 DLL will be returned. Otherwise, unless 'L' is specified in the second 282 parameter, standard DLL loading rules (which will be governed by the 283 current LIBPATH and/or extended LIBPATH configuration) are used to 284 search for a loadable DLL whose module name matches the one specified. 285 (A loadable DLL is one whose runtime dependencies are also loadable, 286 and whose initialization routine can be executed successfully.) 283 287 284 288 REXX ARGUMENTS: 285 289 1. The name of the DLL to search for. (REQUIRED) 290 2. Flag to limit search context, must be one of: 291 A : 'All', search for both loaded and loadable DLLs (DEFAULT) 292 L : 'Loaded', search only for currently-loaded DLLs 286 293 287 294 … … 490 497 491 498 ------------------------------------------------------------------------- 492 Sys2SyncBuffer 499 Sys2SyncBuffer 493 500 494 501 Used to synchronize buffer read/write transactions (wrapper to 495 DosResetBuffer) For external files, writes the buffer to disk.502 DosResetBuffer). For external files, writes the buffer to disk. 496 503 For named pipes, blocks until the remote client end of the pipe has read 497 504 the contents. -
rxutilex/trunk/rxutilex.c
r26 r29 1382 1382 * * 1383 1383 * REXX ARGUMENTS: * 1384 * 1. The name of the DLL to search for. (REQUIRED) * 1384 * 1. The name of the DLL to search for. (REQUIRED) * 1385 * 2. Flag to limit search context, must be one of: * 1386 * ALL : Search for both loaded and loadable DLLs (DEFAULT) * 1387 * LOADEDONLY: Search only for currently-loaded DLLs * 1388 * Only the first letter (A/L) is significant. * 1385 1389 * * 1386 1390 * REXX RETURN VALUE: * … … 1391 1395 HMODULE hmod; 1392 1396 CHAR achModuleName[ CCHMAXPATH ]; 1393 BOOL bUnload = FALSE; 1397 BOOL bLoadedOnly = FALSE, 1398 bUnload = FALSE; 1394 1399 APIRET rc; 1395 1400 … … 1397 1402 WriteErrorCode( 0, NULL ); 1398 1403 1399 if ( !(argc == 1 && RXVALIDSTRING(argv[0])) ) return ( 40 ); 1404 if ( argc < 1 || ( !RXVALIDSTRING(argv[0]) )) return ( 40 ); 1405 1406 // Second argument: flag 1407 if ( argc >= 2 && RXVALIDSTRING(argv[1]) ) { 1408 strupr( argv[1].strptr ); 1409 if ( strcspn(argv[1].strptr, "AL") > 0 ) return ( 40 ); 1410 switch ( argv[1].strptr[0] ) { 1411 case 'A': bLoadedOnly = FALSE; break; 1412 case 'L': bLoadedOnly = TRUE; break; 1413 default : return ( 40 ); 1414 } 1415 } 1400 1416 1401 1417 // See if the DLL is already loaded 1402 1418 rc = DosQueryModuleHandle( argv[0].strptr, &hmod ); 1403 1419 if ( rc ) { 1404 // Guess not; try to load it now 1420 // Guess not... 1421 if ( bLoadedOnly ) { 1422 // Just return 1423 MAKERXSTRING( *prsResult, "", 0 ); 1424 return 0; 1425 } 1426 // Try to load it now 1405 1427 rc = DosLoadModule( NULL, 0, argv[0].strptr, &hmod ); 1406 1428 if ( rc ) { … … 2384 2406 // REXX API does not free this kind of buffer 2385 2407 ulBytes = strlen( pszValue ); 2386 2408 } 2387 2409 MAKERXSTRING( shvVar.shvname, szCompoundName, strlen(szCompoundName) ); 2388 2410 shvVar.shvvalue.strptr = pszValue; -
rxutilex/trunk/rxutilex.def
r26 r29 1 1 LIBRARY RXUTILEX INITINSTANCE TERMINSTANCE 2 2 DATA MULTIPLE NONSHARED 3 DESCRIPTION '@#Alex Taylor:0.1.2#@##1## 15 Jul 2015 00:14:13REINFORCE::::::@@Extended REXX Utility Functions'3 DESCRIPTION '@#Alex Taylor:0.1.2#@##1## 27 Jan 2016 00:11:55 REINFORCE::::::@@Extended REXX Utility Functions' 4 4 5 5 EXPORTS Sys2LoadFuncs -
rxutilex/trunk/testlib.cmd
r22 r29 36 36 37 37 say Sys2LocateDLL('ehxdlmri') 38 say Sys2LocateDLL('ehxdlmri', 'a') 39 say Sys2LocateDLL('ehxdlmri', 'l') 40 say Sys2LocateDLL('gcc1', 'l') 41 38 42 39 43 call Sys2DropFuncs
Note:
See TracChangeset
for help on using the changeset viewer.