string.c
lib/string.h
src/sys/lib/string.c
ubixos/types.h
sys/_types.h
lib/string.h
int int memcmp (const void *dst, const void *src, size_t length) memcmp const void * dst const void * src size_t length
void * void* memcpyold (const void *dst, const void *src, size_t length) memcpyold const void * dst const void * src size_t length
int int strcmp (const char *str1, const char *str2) strcmp const char * str1 const char * str2
int int strncmp (const char *a, const char *b, size_t c) strncmp const char * a const char * b size_t c strstr
void void strncpy (char *dest, const char *src, size_t size) strncpy char * dest const char * src size_t size
char * char* strstr (const char *s, char *find) strstr const char * s char * find NULL strlen strncmp fopen sysChDir sysMkDir

    /*****************************************************************************************
    Copyright(c)2002-2004TheUbixOSProject
    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: string_8c.xml 88 2016-01-12 00:11:29Z reddawg $

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

    #include<lib/string.h>

    intstrcmp(constchar*str1,constchar*str2){
    while((*str1==*str2)&&(*str1!=0x0)&&(*str2!=0x0)){
    str1++;
    str2++;
    }
    if(*str1==*str2){
    return(0);
    }
    elseif(*str1>*str2){
    return(1);
    }
    else{
    return(-1);
    }
    }

    intstrncmp(constchar*a,constchar*b,size_tc){
    inti=0;
    while(i<c){
    if((a[i]!=b[i])||(a[i]=='\0')||(b[i]=='\0'))
    returna[i]-b[i];
    i++;
    }
    return0;
    }

    void*memcpyold(constvoid*dst,constvoid*src,size_tlength){
    //size_tx=length>>2;
    //size_ty=length;//&0xf;
    size_ti;
    /*
    for(i=0;i<x;i++){
    ((unsignedlong*)dst)[i]=((unsignedlong*)src)[i];
    }
    */
    /*
    for(i=0;i<y;i++){
    ((char*)dst)[length-y+i]=((char*)src)[length-y+i];
    }
    */
    for(i=0x0;i<length;i++)
    ((char*)dst)[i]=((char*)src)[i];

    return((void*)dst);
    }

    intmemcmp(constvoid*dst,constvoid*src,size_tlength)
    {
    size_tx=length>>2;
    size_ty=length&0xf;
    size_ti;

    for(i=0;i<x;i++)
    {
    if(((unsignedlong*)dst)[i]>((unsignedlong*)src)[i])
    return1;
    if(((unsignedlong*)dst)[i]<((unsignedlong*)src)[i])
    return-1;
    }

    for(i=0;i<y;i++)
    {
    if(((char*)dst)[length-y+i]>((char*)src)[length-y+i])
    return1;
    if(((char*)dst)[length-y+i]<((char*)src)[length-y+i])
    return-1;
    }

    return0;
    }

    voidstrncpy(char*dest,constchar*src,size_tsize)
    {
    if(size==0)
    return;
    do
    {
    *dest=*src;
    dest++;src++;
    size--;
    }
    while(('\0'!=*(src-1))&&(size));
    }

    char*strstr(constchar*s,char*find){
    charc,sc;
    size_tlen;

    if((c=*find++)!=0){
    len=strlen(find);
    do{
    do{
    if((sc=*s++)==0)
    return(NULL);
    }while(sc!=c);
    }while(strncmp(s,find,len)!=0);
    s--;
    }
    return((char*)s);
    }

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

    Revision1.32006/12/1214:09:18reddawg
    Changes

    Revision1.22006/12/0514:10:21reddawg
    WorkignDistro

    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.62004/07/2815:05:43reddawg
    Major:
    Pagesnowhavestrictsecurityenforcement.
    Manynulldereferenceshavebeenresolved.
    Whenappsloadedpermissionssetforpagesrwandro

    Revision1.52004/07/2018:42:41flameshadow
    add:strcpy()
    chg:modifieddirCache.ctousestrcpy()

    Revision1.42004/07/0523:06:32reddawg
    Fixens

    Revision1.32004/06/2823:12:58reddawg
    fileformatnowcontainer:/path/to/file

    Revision1.22004/05/1914:40:58reddawg
    Cleanedupsomewarningfromleavingouttypedefs

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

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

    END
    ***/