char *nxtarg (p,brk);
char **p,*brk;
When you have a string which you wish to parse, you should declare a pointer and point to the start of the string:
Then, each call to nxtarg will fetch the next argument:
Each call to nxtarg will space the pointer up to one of the delimiters or the end of the string, whichever comes first. Then, the string will be chopped into two pieces: the part containing the argument just parsed, and the rest of the string. The address of the first part will be returned; the pointer will be left pointing to the second part, all ready for the next call to nxtarg. Note that the pointer must not be in a register, since it is passed by address.
The delimiter character (or null character at the end of the string) encountered is placed into the external variable called, _argbreak. You may look at this value to see what delimiter was encountered. If no delimiters were encountered before the end of the string, then the null character will be placed into _argbreak.
If brk, the list of break characters, is 0, then the space character will be used as the only delimiter.