You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							35 lines
						
					
					
						
							423 B
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							35 lines
						
					
					
						
							423 B
						
					
					
				| /* | |
|  * public domain strtok_r() | |
|  */ | |
| 
 | |
| #include <string.h> | |
|  | |
| char* strtok_r( char* str, const char* delim, char** nextp ) | |
| { | |
|     char* ret; | |
| 
 | |
|     if( str == NULL ) | |
|     { | |
|         str = *nextp; | |
|     } | |
| 
 | |
|     str += strspn( str, delim ); | |
| 
 | |
|     if( *str == '\0' ) | |
|     { | |
|         return NULL; | |
|     } | |
| 
 | |
|     ret = str; | |
| 
 | |
|     str += strcspn( str, delim ); | |
| 
 | |
|     if( *str ) | |
|     { | |
|         *str++ = '\0'; | |
|     } | |
| 
 | |
|     *nextp = str; | |
| 
 | |
|     return ret; | |
| }
 |