add strtok r & non-r impl