splits out a component of a pathname into a buffer
Source position: amigados.pas line 1724
function SplitName( |
const name: pCHAR; |
seperator: LongWord; |
buf: pCHAR; |
oldpos: LongInt; |
size: LongInt |
):SmallInt; |
const name: string; |
seperator: LongWord; |
buf: pCHAR; |
oldpos: LongInt; |
size: LongInt |
):SmallInt; |
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.
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). |
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 |