(C) 1998 AROS - The Amiga Research OS


NAME
#include <proto/dos.h>

LONG SplitName (name , seperator , buf , oldpos , size)

LOCATION
In DOSBase at offset 69

SYNOPSIS
STRPTR name
ULONG seperator
STRPTR buf
LONG oldpos
LONG size

FUNCTION
Split a path into parts at the position of seperator.

INPUTS
name
Split this path
seperator
Split it at this seperator
buf
Copy the current part into this buffer
oldpos
Begin at this place with the search for seperator. If you call this function for the first time, set it to 0.
size
The size of the buffer. If the current part of the
size
1, only size-1 bytes will be copied.

RESULT
The next position to continue for the next part or -1 if there is no seperator after name+oldpos.

EXAMPLE
#    include 
#    include 

#    include 

int main (int argc, char ** argv)
{
    LONG pos;
    UBYTE buffer[256];

    if (argc < 3)
    {
	fprintf (stderr, "Usage: %s  \n", argv[0]);
	return RETURN_ERROR;
    }

    pos=0;

    do
    {
	pos = SplitName (argv[1], *(argv[2]), buffer, pos, sizeof(buffer));

	printf ("pos = %3ld  buffer = \"%s\"\n", pos, buffer);
    }
    while (pos != -1);

    return RETURN_OK;
}
SEE ALSO

NOTES

BUGS

INTERNALS

HISTORY
20.10.1998 hkiel
Amiga Research OS
11.12.1997 hkiel
Changed files to work well with cpak
04.03.1997 digulla
Filled in code
27.01.1997 ldp
Polish
09.12.1996 aros
Added empty templates for all missing functions

Moved #include's into first column