Annotation of 43BSDTahoe/ucb/dbx/mkdate.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1983 Regents of the University of California.
        !             3:  * All rights reserved.  The Berkeley software License Agreement
        !             4:  * specifies the terms and conditions for redistribution.
        !             5:  */
        !             6: 
        !             7: #ifndef lint
        !             8: static char sccsid[] = "@(#)mkdate.c   5.3 (Berkeley) 1/12/88";
        !             9: #endif not lint
        !            10: 
        !            11: static char rcsid[] = "$Header: mkdate.c,v 1.2 87/03/26 19:56:22 donn Exp $";
        !            12: 
        !            13: #include <stdio.h>
        !            14: #ifdef IRIS
        !            15: #   include <time.h>
        !            16: #else
        !            17: #   include <sys/time.h>
        !            18: #endif
        !            19: 
        !            20: main()
        !            21: {
        !            22:     struct tm *t;
        !            23:     long clock;
        !            24:     char name[100];
        !            25:     int namelen;
        !            26: 
        !            27:     printf("char *date = \"");
        !            28:     clock = time(0);
        !            29:     t = localtime(&clock);
        !            30:     printf("%d/%d/%d ", t->tm_mon + 1, t->tm_mday, t->tm_year % 100);
        !            31:     printf("%d:%02d", t->tm_hour, t->tm_min);
        !            32: #   ifndef IRIS
        !            33:        gethostname(name, &namelen);
        !            34:        printf(" (%s)", name);
        !            35: #   endif
        !            36:     printf("\";\n");
        !            37:     exit(0);
        !            38: }

unix.superglobalmegacorp.com

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