Annotation of 43BSDTahoe/new/xns/examples/filing_common/misc.c, revision 1.1

1.1     ! root        1: #ifndef lint
        !             2: static char *rcsid = "$Header: misc.c,v 1.2 87/03/31 14:29:13 ed Exp $";
        !             3: #endif lint
        !             4: 
        !             5: /*
        !             6:  * Copyright (c) 1986, 1987 Xerox Corporation.
        !             7:  */
        !             8: 
        !             9: /* $Log:       misc.c,v $
        !            10:  * Revision 1.2  87/03/31  14:29:13  ed
        !            11:  * Minor change.
        !            12:  * 
        !            13:  * Revision 1.1  87/01/14  11:26:10  ed
        !            14:  * Initial revision
        !            15:  * 
        !            16:  *
        !            17:  */
        !            18: 
        !            19: #include <ctype.h>
        !            20: 
        !            21: /* change case to upper*/
        !            22: char *uppercase(string1)
        !            23: char   *string1;
        !            24: 
        !            25: {
        !            26:        register char *string2 = string1;
        !            27: 
        !            28: 
        !            29:        while (*string2) {
        !            30:                if (islower(*string2))
        !            31:                        *string2 = *string2 - 040;
        !            32:                string2++;
        !            33:        }
        !            34: 
        !            35:        return (string1);
        !            36: }
        !            37: 
        !            38: /* change counted string to upper */
        !            39: char *uppercasen(string1, count)
        !            40: char *string1;
        !            41: int count;
        !            42: 
        !            43: {
        !            44:        register char *string2= string1;
        !            45: 
        !            46:        while (count--) {
        !            47:                if (islower(*string2))
        !            48:                        *string2= *string2 - 040;
        !            49:                string2++;
        !            50:        }
        !            51: 
        !            52:        return(string1);
        !            53: }
        !            54: 
        !            55: /* change case to lower */
        !            56: char *lowercase(string1)
        !            57: char   *string1;
        !            58: 
        !            59: {
        !            60:        register char *string2 = string1;
        !            61: 
        !            62: 
        !            63:        while (*string2) {
        !            64:                if (isupper(*string2))
        !            65:                        *string2 = *string2 + 040;
        !            66:                string2++;
        !            67:        }
        !            68: 
        !            69:        return (string1);
        !            70: 
        !            71: }
        !            72: 
        !            73: /* change counted string to lower */
        !            74: char *lowercasen(string1, count)
        !            75: char *string1;
        !            76: int count;
        !            77: 
        !            78: {
        !            79:        register char *string2= string1;
        !            80: 
        !            81:        while (count--) {
        !            82:                if (isupper(*string2))
        !            83:                        *string2= *string2 + 040;
        !            84:                string2++;
        !            85:        }
        !            86: 
        !            87:        return(string1);
        !            88: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.