$include (..\lib\compStch.ext) /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ simpleNameModule: do; $if not noID declare IDString (*) byte data ( '@(#)smplName.p86 $Author: rmgillmore $ $Date:: 2025-05-04 19:35:39#$:', 0 ); $endif $set ( simpleExecSource ) $include (..\lib\comnDefs.ext) /* * this procedure can not be reentrant since it returns a local string */ simpleExecName: procedure ( fullNamePtr ) pointer public; declare fullNamePtr pointer, fullNameStr based fullNamePtr (*) byte, simpleNamePtr pointer, simpleNameStr based simpleNamePtr (*) byte; declare nameLength word, delimiterIndex word, dotIndex word, returnString (127) byte; nameLength = findb( fullNamePtr, NUL, MAX_PATH + 1 ); delimiterIndex = findrb( fullNamePtr, PATH_DELIM, nameLength ); simpleNamePtr = @fullNameStr( delimiterIndex + 1 ); nameLength = findb( simpleNamePtr, NUL, nameLength ); dotIndex = findb( simpleNamePtr, '.', nameLength ); call movb( simpleNamePtr, @returnString, dotIndex ); returnString( dotIndex ) = 0; return @returnString; end simpleExecName; simpleFileName: procedure ( fullNamePtr ) pointer public; declare fullNamePtr pointer, fullNameStr based fullNamePtr (*) byte, simpleNamePtr pointer, simpleNameStr based simpleNamePtr (*) byte; declare nameLength word, delimiterIndex word, dotIndex word, returnString (127) byte; nameLength = findb( fullNamePtr, NUL, MAX_PATH + 1 ); delimiterIndex = findrb( fullNamePtr, PATH_DELIM, nameLength ); simpleNamePtr = @fullNameStr( delimiterIndex + 1 ); nameLength = findb( simpleNamePtr, NUL, nameLength ); call movb( simpleNamePtr, @returnString, nameLength ); return @returnString; end simpleFileName; end simpleNameModule;