/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* that will select today's and tomorrow's
* calendar entries, with special weekend provisions
* used by calendar command
*/
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <locale.h>
#include <errno.h>
static char *file;
static int old_behavior;
static time_t t;
static char *errlst[] = {
/* 0 */ "error on open of \"%s\", errno = %d",
/* 1 */ "could not malloc enough memory",
/* 2 */ "error on stat of \"%s\", errno = %d",
/* 3 */ "file \"%s\" is not a regular file",
/* 4 */ "error in reading the file \"%s\"",
/* 5 */ "\"%s\" file: error on line %d",
/* 6 */ "\"%s\" file: format descriptions are missing"
};
static
char *month[] = {
"[Jj]an",
"[Ff]eb",
"[Mm]ar",
"[Aa]pr",
"[Mm]ay",
"[Jj]un",
"[Jj]ul",
"[Aa]ug",
"[Ss]ep",
"[Oo]ct",
"[Nn]ov",
"[Dd]ec"
};
static void read_tmpl(void);
static void generate(char *);
static void
{
(void) printf
("(^|[ \t(,;])((%s[^ ]* *|0*%d/|\\*/)0*%d)([^0123456789]|$)\n",
}
int
{
(void) time(&t);
old_behavior = 1;
if (old_behavior)
tprint(t);
else
read_tmpl();
case 5:
t += DAY;
if (old_behavior)
tprint(t);
else
read_tmpl();
case 6:
t += DAY;
if (old_behavior)
tprint(t);
else
read_tmpl();
default:
t += DAY;
if (old_behavior)
tprint(t);
else
read_tmpl();
}
return (0);
}
static void
read_tmpl(void)
{
char *clean_line();
int no_empty = 0;
for (;;) {
}
break;
}
{
}
{
no_empty++;
}
linenum++;
}
if (!no_empty)
}
char *
clean_line(char *s)
{
char *ns;
if (!strlen(s))
return (s);
*ns = (char)0; /* delete terminating spaces */
--ns;
}
while (*s) /* delete beginning white spaces */
if (isspace(*s))
++s;
else
break;
return (s);
}
static void
{
exit(1);
}
static void
{
int space = 0;
while (*tb)
++tb;
space++;
}
else
{
if (space) {
*ob++ = '[';
*ob++ = ' ';
*ob++ = '\t';
*ob++ = ']';
*ob++ = '*';
space = 0;
continue;
}
*ob++ = '[';
*ob++ = ']';
continue;
}
else
*ob++ = '*';
}
*ob = '\0';
}