strtok.c
lib/string.h
ubixos/types.h
src/sys/lib/strtok.c
ubixos/types.h
sys/_types.h
lib/string.h
char * char* strtok (char *s, const char *delim) strtok char * s const char * delim strtok_r fopen sysMkDir unlink
char * char* strtok_r (char *s, const char *delim, char **last) strtok_r char * s const char * delim char ** last NULL strtok

    /*****************************************************************************************
    Copyright(c)2002TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,are
    permittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistof
    conditions,thefollowingdisclaimerandthelistofauthors.Redistributionsinbinary
    formmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowing
    disclaimerandthelistofauthorsinthedocumentationand/orothermaterialsprovided
    withthedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftware
    withoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANY
    EXPRESSORIMPLIEDWARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOF
    MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAREDISCLAIMED.INNOEVENTSHALL
    THECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,INCIDENTAL,
    SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENT
    OFSUBSTITUTEGOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)
    HOWEVERCAUSEDANDONANYTHEORYOFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,OR
    TORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAYOUTOFTHEUSEOFTHIS
    SOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: strtok_8c.xml 88 2016-01-12 00:11:29Z reddawg $

    *****************************************************************************************/

    #include<lib/string.h>
    #include<ubixos/types.h>

    char*strtok_r(char*s,constchar*delim,char**last){
    char*spanp;
    intc,sc;
    char*tok;

    if((s==NULL)&&((s=*last)==NULL)){
    return(NULL);
    }

    cont:
    c=*s++;
    for(spanp=(char*)delim;(sc=*spanp++)!=0;){
    if(c==sc){
    gotocont;
    }
    }
    if(c==0){
    *last=NULL;
    return(NULL);
    }
    tok=s-1;

    for(;;){
    c=*s++;
    spanp=(char*)delim;
    do{
    if((sc=*spanp++)==c){
    if(c==0){
    s=NULL;
    }
    else{
    char*w=s-1;
    *w='\0';
    }
    *last=s;
    return(tok);
    }
    }while(sc!=0);
    }
    }

    char*strtok(char*s,constchar*delim){
    staticchar*last;
    return(strtok_r(s,delim,&last));
    }

    /***
    $Log: strtok_8c.xml,v $
    Revision 1.6  2006/12/19 14:12:52  reddawg
    rtld-elf almost workign

    Revision1.1.1.12006/06/0112:46:16reddawg
    ubix2

    Revision1.22005/10/1200:13:37reddawg
    Removed

    Revision1.1.1.12005/09/2617:24:13reddawg
    nomessage

    Revision1.22004/05/1903:46:32reddawg
    AFewQuickHacksToMakeThingsWork

    Revision1.1.1.12004/04/1512:07:11reddawg
    UbixOSv1.0

    Revision1.22004/04/1316:36:33reddawg
    Changedourcopyright,itisallnowunderaBSD-Stylelicense

    END
    ***/