splits out a component of a pathname into a buffer
Source position: amigados.pas line 2268
function SplitName( |
const Name: PChar; |
Seperator: LongWord; |
Buf: PChar; |
OldPos: LongInt; |
Size: LongInt |
):LongInt; |
Name |
|
Filename being parsed. |
Seperator |
|
Separator charactor to split by. |
Buf |
|
Buffer to hold separated name. |
OldPos |
|
Current position in the file. |
Size |
|
Size of buf in bytes (including null termination). |
New position for next call to splitname. -1 for last one.
This routine splits out the next piece of a name from a given file name. Each piece is copied into the buffer, truncating at size-1 characters. The new position is then returned so that it may be passed in to the next call to splitname. If the separator is not found within size characters, then size-1 characters plus a null will be put into the buffer, and the position of the next separator will be returned.
If a a separator cannot be found, -1 is returned (but the characters from the old position to the end of the string are copied into the buffer, up to a maximum of size-1 characters). Both strings are null-terminated.
This function is mainly intended to support handlers.
|
Returns the last component of a path |
|
|
Returns a pointer to the end of the next-to-last component of a path. |
|
|
Appends a file/dir to the end of a path |