Converts a filename between space-terminated and null-terminated format.
call 'CBL_FILENAME_CONVERT' using fnc-func filename-in filename-out by value fnc-in-length by value fnc-out-length returning fnc-ret
Using call prototype (see Library Routines - Key) | Picture (32-bit systems) | |
---|---|---|
fnc-func | cblt-x1-compx | pic x comp-x. |
filename-in | pic x(n). | pic x(n). |
filename-out | pic x(n). | pic x(n). |
fnc-in-length | cblt-os-size | pic x(4) comp-5. |
fnc-out-length | cblt-os-size | pic x(4) comp-5. |
fnc-ret | cblt-rtncode |
fnc-func | Defines how the conversion will proceed:
| ||||||||||||||||||||||||||||
filename-in | Input filename. | ||||||||||||||||||||||||||||
filename-out | If bit 3 of fnc-func is set to 1, a list of characters that if encountered unquoted terminate the filename. If there are no additional characters, then a null pointer should be passed. | ||||||||||||||||||||||||||||
filename-in-length | Length of filename-in. | ||||||||||||||||||||||||||||
filename-out-length | If bit 3 of fnc-func is set to 0, the size of the buffer for the converted
filename.
If bit 3 of fnc-func is set to 1, the number of characters in filename-out (if supplied). |
filename-out | If bit 3 of fnc-func is set to 0, the converted filename. If filename-in is invalid, this parameter is set to an empty filename (a null if bit 0 was set to 0, else a space). |
fnc-ret | If 0, an error occurred, otherwise, the length of the space terminated name that was either input or output. |
A space-terminated filename consists of a filename terminated by a space character. If the filename contains any embedded spaces then they should be escaped by including the whole filename between a pair of double quotes.
A null-terminated filename has any double quotes stripped out, but retains any embedded spaces.