[Select]

Programmer


Index

 

PathUtils

The PathUtils module provides an interface to manipulate system variables used as path variables by FileSwitch. That is, variables ending '$Path' which are used as references to multiple paths in filenames.

SWIs for PathUtils

PathUtils_EnumeratePath (SWI &56B80)
On entry
   R0 = flags :
         bit 0 = if set, return all components of the path recursively,
                 if clear, just return the leaf components
         bits 1-31 reserved (must be 0)
   R1 = pointer to path to process
   R2 = pointer to output buffer
   R3 = maximum length of buffer, or 0 to request length
   R4 = last context, or 0 for the first call
On exit
   R0-R2 preserved
   R3 = number of spare bytes, or -ve length required if 0 on entry
   R4 = new context, or -1 if complete
   R5 = variable type that this value was expanded from
   R6 = depth expanded from

This SWI is used to enumerate the components of a path variables. If R0 bit 0 is set, path components will be recursively expanded until a terminal path is found.

PathUtils_JoinPath (SWI &56B81)
On entry
   R0 = flags
         bit 0 = if set, append, if clear, prepend
         bits 1-31 reserved (must be 0)
   R1 = pointer to path variable name
   R2 = pointer to value to join
On exit
   All registers preserved

This SWI is used to add a component to a path variable. The path variable will be checked to ensure that the component is not already present. The component will be added to the end of the start of the variable, depending on the state of R0 bit 0.

PathUtils_RemovePath (SWI &56B82)
On entry
   R0 = flags (must be 0)
   R1 = pointer to path variable name
   R2 = pointer to value to remove
On exit
   All registers preserved

This SWI is used to remove a component from a path variable. If the component is not present, no error will be raised.


This documentation is copyright 3QD Developments Ltd 2013 and may not be reproduced or published in any form without the copyright holders permission. RISC OS is subject to continuous development and improvement as such all information is reproduced by 3QD Developments Ltd in good faith and is believed to be correct at the time of publication E&OE. 3QD Developments Ltd cannot accept any liability for any loss or damage arising from the use of any information provided as part of the RISC OS Documentation.

HTML document version 1.03 3rd November 2015