Annotation of 43BSDReno/contrib/isode-beta/quipu/cstrings.c, revision 1.1

1.1     ! root        1: /* cstrings.c - */
        !             2: 
        !             3: #ifndef        lint
        !             4: static char *rcsid = "$Header: /f/osi/quipu/RCS/cstrings.c,v 7.1 90/07/09 14:45:33 mrose Exp $";
        !             5: #endif
        !             6: 
        !             7: /* 
        !             8:  * $Header: /f/osi/quipu/RCS/cstrings.c,v 7.1 90/07/09 14:45:33 mrose Exp $
        !             9:  *
        !            10:  *
        !            11:  * $Log:       cstrings.c,v $
        !            12:  * Revision 7.1  90/07/09  14:45:33  mrose
        !            13:  * sync
        !            14:  * 
        !            15:  * Revision 7.0  89/11/23  22:16:59  mrose
        !            16:  * Release 6.0
        !            17:  * 
        !            18:  */
        !            19: 
        !            20: /*
        !            21:  *                               NOTICE
        !            22:  *
        !            23:  *    Acquisition, use, and distribution of this module and related
        !            24:  *    materials are subject to the restrictions of a license agreement.
        !            25:  *    Consult the Preface in the User's Manual for the full terms of
        !            26:  *    this agreement.
        !            27:  *
        !            28:  */
        !            29: 
        !            30: 
        !            31: #include "psap.h"
        !            32: 
        !            33: static char arg_error [1024];
        !            34: static char arg_flag [100];
        !            35: int chase_flag = 2;
        !            36: extern char * result_sequence;
        !            37: 
        !            38: reset_arg ()
        !            39: {      
        !            40:        arg_error [0] = 0;
        !            41:        arg_flag [0] = 0;
        !            42:        chase_flag = 2;
        !            43:        if (result_sequence)
        !            44:                free (result_sequence);
        !            45:        result_sequence = NULLCP;
        !            46: }
        !            47: 
        !            48: print_arg_error (opt)
        !            49: PS opt;
        !            50: {
        !            51:        if (arg_error [0] != 0) {
        !            52:                ps_printf (opt,"'%s' ambiguous, specify\n%s",arg_flag,arg_error);
        !            53:                return (OK);
        !            54:        } else
        !            55:                return (NOTOK);
        !            56: }
        !            57: 
        !            58: 
        !            59: int test_arg (x, y, c)         
        !            60: char           *x;             
        !            61: char           *y;
        !            62: int            c;
        !            63: {
        !            64: int count = 0;
        !            65: char * top, *topx;
        !            66: 
        !            67:        top = y;
        !            68:        topx = x;
        !            69: 
        !            70:        if (*y == '-' )
        !            71:                count--;
        !            72: 
        !            73:        for (; (*y != 0) || (*x != 0); y++) {   
        !            74:                if (*x == 0) 
        !            75:                        if (count >= c)
        !            76:                                return (1);
        !            77:                        else {
        !            78:                                (void) strcat (arg_error, top);
        !            79:                                (void) strcat (arg_error, "\n");
        !            80:                                (void) strcpy (arg_flag,topx);
        !            81:                                return (0);
        !            82:                        }
        !            83:                if (chrcnv[*x] != chrcnv[*y]) 
        !            84:                        return (0);
        !            85:                        
        !            86:                count++;        
        !            87:                x++;
        !            88:        }
        !            89: 
        !            90:        if (count >= c)
        !            91:                return (1);     
        !            92:        else {
        !            93:                (void) strcat (arg_error, top);
        !            94:                (void) strcat (arg_error, "\n");
        !            95:                (void) strcpy (arg_flag, topx);
        !            96:                return (0);
        !            97:        }
        !            98: }
        !            99: 

unix.superglobalmegacorp.com

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