first commit

This commit is contained in:
Jose Caban
2025-06-07 01:59:34 -04:00
commit 388ac241f0
3558 changed files with 9116289 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
/strtok_r.c/1.1/Thu Mar 9 01:29:48 2006//
/strtok_r.h/1.1/Thu Mar 9 01:29:48 2006//
D

View File

@@ -0,0 +1,2 @@
/strtok_r.c////*///
/strtok_r.h////*///

View File

@@ -0,0 +1 @@
CS4210/Project 2/common/strtok_r

View File

@@ -0,0 +1 @@
:ext:asskoala@192.168.0.3:/usr/_CVS

View File

@@ -0,0 +1,48 @@
#include "include/strtok_r.h"
#include <stddef.h>
char *strtok_r(char *s, const char *delim, char** s3)
{
char *pR;
short bDone=0;
size_t i,j;
if(s != NULL){
*s3 = s;
}
if(**s3 == '\0'){
return NULL;
}
for(;;){
bDone = 1;
for(j=0; *(delim+j) != '\0'; j++){
if(**s3 == *(delim+j)){
**s3 = '\0';
(*s3)+=1;
bDone = 0;
break;
}
}
if(bDone == 1){
break;
}
}
for(i=0; *(*s3+i) != '\0'; i++){
for(j=0; *(delim+j) != '\0'; j++){
if(*(*s3+i) == *(delim+j)){
pR = *s3;
*(*s3+i) = '\0';
*s3 += i+1;
return pR;
}
}
}
pR = *s3;
*s3 += i;
return pR;
}

View File

@@ -0,0 +1,13 @@
#ifndef _STRTOK_R_H_
#define _STRTOK_R_H_
/*
* String Tokenizer! :)
* Toke up some strings to get
*
* s = string to toke
* delim = deliminator, thing to delim
*/
char *strtok_r(char *s, const char *delim, char** s3);
#endif