News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

HLA stdlib v3.x update

Started by Randall Hyde, February 06, 2008, 07:12:28 PM

Previous topic - Next topic

Randall Hyde

Hi All,
For those who are interested, I've just made an update to the HLA stdlib v3.x project on sourceforge (https://sourceforge.net/projects/hla-stdlib). I've just finished polishing off all the filesys path/filename string functions and uploaded new documentation for them. These file/pathname string functions were moved from the strings module to filesys (because of their obvious filesystem dependencies). They are largely based on the functions that Sevag wrote for the strings module (I've added a few new functions, renamed many of them, tweaked some of the existing ones, wrote a lot more test cases, and fixed some defects I've found). Here are the prototypes (from filesys.hhf) for the new functions:

   
   // Filename predicate functions:
   
   procedure hasDriveLetter( pathname:string );
      @returns( "@c" );   // and AL
      @external( "FILESYS_HASDRIVELETTER" );
      
   procedure hasExtension( pathname:string );
      @returns( "@c" );  // and EAX
      @external( "FILESYS_HASEXTENSION" );

   procedure hasUncName( pathname:string );
      @returns( "@c" );   // and EAX
      @external( "FILESYS_HASUNCNAME" );
      
   procedure hasPath( pathname:string );
      @returns( "@c" );
      @external( "FILESYS_HASPATH" );
      

   // pathname component extraction functions:
   
   procedure a_extractBase( pathname:string );
      @returns( "@c" );   // and EAX
      @external( "FILESYS_A_EXTRACTBASE" );

   procedure a_extractExt( pathname:string );
      @returns( "@c" ); // and eax
      @external( "FILESYS_A_EXTRACTEXT" );
      
   procedure a_extractFilename( pathname:string );
      @returns( "@c" );   // and EAX
      @external( "FILESYS_A_EXTRACTFILENAME" );
      
   procedure a_extractPath( pathname:string );
      @returns( "@c" );   // and EAX
      @external( "FILESYS_A_EXTRACTPATH" );
      
   procedure extractBase( pathname:string; base:string );
      @returns( "@c" );
      @external( "FILESYS_EXTRACTBASE" );
      
   procedure extractExt( pathname:string; dest:string );
      @returns( "@c" );
      @external( "FILESYS_EXTRACTEXT" );

   procedure extractFilename( pathname:string; fName:string );
      @returns( "@c" );
      @external( "FILESYS_EXTRACTFILENAME" );
      
   procedure extractPath( pathname:string; dest:string );
      @returns( "@c" );
      @external( "FILESYS_EXTRACTPATH" );



   // Pathname conversion and manipulation functions:
   
   procedure a_joinPaths( leftPath:string; rightPath:string );
      @returns( "eax" );
      @external( "FILESYS_A_JOINPATHS" );

   procedure a_normalize( path:string );
      @returns( "eax" );
      @external( "FILESYS_A_NORMALIZE" );
      
   procedure a_toUnixPath( pathname:string );
      @returns( "eax" );
      @external( "FILESYS_A_TOUNIXPATH" );

   procedure a_toWin32Path( pathname:string );
      @returns( "eax" );
      @external( "FILESYS_A_TOWIN32PATH" );

   procedure joinPaths( leftPath:string; rightPath:string; dest:string );
      @external( "FILESYS_JOINPATHS" );

   procedure normalize1( pathname:string );
      @returns( "@c" );
      @external( "FILESYS_NORMALIZE1" );
      
   procedure normalize2( pathname:string; dest:string );
      @returns( "@c" );
      @external( "FILESYS_NORMALIZE2" );
      
   procedure toUnixPath1( pathname:string );
      @external( "FILESYS_TOUNIXPATH1" );

   procedure toUnixPath2( pathname:string; dest:string );
      @external( "FILESYS_TOUNIXPATH2" );

   procedure toWin32Path1( pathname:string );
      @external( "FILESYS_TOWIN32PATH1" );

   procedure toWin32Path2( pathname:string; dest:string );
      @external( "FILESYS_TOWIN32PATH2" );

   #if( @global:os.win32 )
      
      const
         toNativePath1   :text := "toWin32Path1";
         toNativePath2   :text := "toWin32Path2";
          a_toNativePath   :text := "a_toWin32Path";

   #else
      
      const
         toNativePath1   :text := "toUnixPath1";
         toNativePath2   :text := "toUnixPath2";
          a_toNativePath   :text := "a_toUnixPath";

   #endif


hLater,
Randy Hyde