Annotation of 43BSDReno/usr.bin/find/newsyntax.c, revision 1.1

1.1     ! root        1: /*-
        !             2:  * Copyright (c) 1990 The Regents of the University of California.
        !             3:  * All rights reserved.
        !             4:  *
        !             5:  * Redistribution and use in source and binary forms are permitted provided
        !             6:  * that: (1) source distributions retain this entire copyright notice and
        !             7:  * comment, and (2) distributions including binaries display the following
        !             8:  * acknowledgement:  ``This product includes software developed by the
        !             9:  * University of California, Berkeley and its contributors'' in the
        !            10:  * documentation or other materials provided with the distribution and in
        !            11:  * all advertising materials mentioning features or use of this software.
        !            12:  * Neither the name of the University nor the names of its contributors may
        !            13:  * be used to endorse or promote products derived from this software without
        !            14:  * specific prior written permission.
        !            15:  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
        !            16:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
        !            17:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            18:  */
        !            19: 
        !            20: #ifndef lint
        !            21: static char sccsid[] = "@(#)newsyntax.c        5.2 (Berkeley) 5/22/90";
        !            22: #endif /* not lint */
        !            23: 
        !            24: #include <sys/types.h>
        !            25: #include <sys/stat.h>
        !            26: #include <stdio.h>
        !            27: #include <fts.h>
        !            28: #include "find.h"
        !            29: 
        !            30: newsyntax(argc, argvp)
        !            31:        int argc;
        !            32:        char ***argvp;
        !            33: {
        !            34:        extern char *optarg;
        !            35:        extern int depth, optind;
        !            36:        int ch;
        !            37:        char **argv, **cur;
        !            38: 
        !            39:        cur = argv = *argvp;
        !            40:        while ((ch = getopt(argc, argv, "df:sx")) != EOF)
        !            41:                switch(ch) {
        !            42:                case 'd':
        !            43:                        depth = 1;
        !            44:                        break;
        !            45:                case 'f':
        !            46:                        *cur++ = optarg;
        !            47:                        break;
        !            48:                case 's':
        !            49:                        ftsoptions &= ~FTS_PHYSICAL;
        !            50:                        ftsoptions |= FTS_LOGICAL;
        !            51:                        break;
        !            52:                case 'x':
        !            53:                        ftsoptions &= ~FTS_NOSTAT;
        !            54:                        ftsoptions |= FTS_XDEV;
        !            55:                        break;
        !            56:                case '?':
        !            57:                default:
        !            58:                        usage();
        !            59:                }
        !            60: 
        !            61:        *argvp += optind;
        !            62:        if (cur == argv) {
        !            63:                if (!**argvp)
        !            64:                        usage();
        !            65:                *cur++ = **argvp;
        !            66:                ++*argvp;
        !            67:        }
        !            68:        *cur = NULL;
        !            69: }

unix.superglobalmegacorp.com

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