Annotation of 43BSD/contrib/notes/utility/fieldzero.c, revision 1.1

1.1     ! root        1: #define        MAINLINE
        !             2: 
        !             3: /*
        !             4:  *     fieldchange
        !             5:  *
        !             6:  *     This simple program runs through the specified notesfiles
        !             7:  *     and sets some fields in the descriptor to default
        !             8:  *     values.  You'll have to pick which fields you actually
        !             9:  *     want to change, this will depend on how recent your code is.
        !            10:  *
        !            11:  *
        !            12:  *     Ray Essick      September 6, 1983
        !            13:  *
        !            14:  * $Header: /mntb/3/srg/notes/work/utility/RCS/fieldzero.c,v 1.6 84/03/07 19:04:34 notes Exp $
        !            15:  */
        !            16: 
        !            17: #include "../src/parms.h"
        !            18: #include "../src/structs.h"
        !            19: 
        !            20: main (argc, argv)
        !            21: char  **argv;
        !            22: {
        !            23:     int     i,
        !            24:             j,
        !            25:             k;
        !            26:     int     c;
        !            27:     int     start,
        !            28:             verbose;
        !            29:     char   *p,
        !            30:            *q,
        !            31:            *r;
        !            32:     char    cmdline[CMDLEN];
        !            33:     struct io_f io;
        !            34: 
        !            35:     startup (argc, argv);                              /* common initialization */
        !            36: 
        !            37: 
        !            38:     verbose = 0;
        !            39:     start = 1;
        !            40:     if (!strcmp (argv[1], "-v"))
        !            41:     {
        !            42:        verbose++;
        !            43:        start++;
        !            44:     }
        !            45: 
        !            46:     for (i = start; i < argc; i++)                     /* for each notesfile  */
        !            47:     {
        !            48:        if (init (&io, argv[i]) < 0)
        !            49:        {
        !            50:            printf ("bong %s\n", argv[i]);
        !            51:            continue;
        !            52:        }
        !            53:        if (verbose)
        !            54:            printf ("%s\n", argv[i]);
        !            55: 
        !            56:        locknf (&io, 'n');
        !            57:        getdscr (&io, &io.descr);                       /* grab up to date */
        !            58: /*
        !            59:  *     the next few statements initialize a number of the
        !            60:  *     new fields in the notesfile descriptor.  You may not want
        !            61:  *     to use all of them at this time.
        !            62:  */
        !            63:        io.descr.d_archtime = 0;                        /* expiration threshold */
        !            64:        io.descr.d_workset = 0;                         /* min notes to keep in nf */
        !            65:        io.descr.d_dmesgstat = DIRDFLT;                 /* expire w/wo dirmsg */
        !            66:        io.descr.d_archkeep = KEEPDFLT;                 /* delete or archive */
        !            67:        io.descr.d_adopted = 0;                         /* adopted orphans */
        !            68: 
        !            69:        io.descr.d_longnote = MAXMSG;                   /* long messages */
        !            70: 
        !            71:        putdscr (&io, &io.descr);
        !            72:        unlocknf (&io, 'n');
        !            73:        finish (&io);
        !            74: 
        !            75:     }
        !            76:     exit (GOOD);
        !            77: }

unix.superglobalmegacorp.com

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