ckdate.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * CDDL HEADER START
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * The contents of this file are subject to the terms of the
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * Common Development and Distribution License, Version 1.0 only
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * (the "License"). You may not use this file except in compliance
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * with the License.
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * See the License for the specific language governing permissions
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * and limitations under the License.
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * When distributing Covered Code, include this CDDL HEADER in each
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * If applicable, add the following below this CDDL HEADER, with the
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * fields enclosed by brackets "[]" replaced with your own identifying
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * information: Portions Copyright [yyyy] [name of copyright owner]
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * CDDL HEADER END
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam/* All Rights Reserved */
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * Copyright (c) 1997,1998 by Sun Microsystems, Inc.
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam * All rights reserved.
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslam/*LINTLIBRARY*/
bd0f52d78d701efcad2c460df61b45677d041c35jhaslam#pragma ident "%Z%%M% %I% %E% SMI"
b8fac8e162eda7e98db13dfa3e439e43f90f41d9jhaslamstatic int fmtcheck(char *);
static char *p_ndigit(char *, int *, int);
static char *p_date(char *, int, int, int);
static char *p_eday(char *, int, int);
static char *p_dlm(char *, char);
#define LY 00
char *ptr;
int accum = 0;
if (!string)
return (NULL);
return (NULL);
return (NULL);
return (ptr);
char *ptr;
return (NULL);
return (ptr);
return (NULL);
int iday = 0;
string++;
idaymax--;
iday++;
if (iday == 0)
return (NULL);
return (NULL);
return (ptr);
return (NULL);
static char *fmonth[] = {
static char *amonth[] = {
char *copy;
int mlen;
int imnth = 0;
int legit = 0;
imnth++;
if (legit) {
string++;
return (string);
return (NULL);
char dlm;
if (! string)
return (NULL);
int percent = 0;
while (*fmt) {
switch (*fmt++) {
if (percent == 0)
percent = 0;
case BLANK:
case DELIM1:
case DELIM2:
return (percent);
fmt++;
switch (*fmt) {
if (!input)
valid = 0;
if (!input)
valid = 0;
if (!input)
valid = 0;
if (!input)
valid = 0;
if (!input)
valid = 0;
if (!input) {
valid = 0;
if (!input) {
valid = 0;
if (!input) {
valid = 0;
if (!input) {
valid = 0;
if (!input)
valid = 0;
if (!input)
valid = 0;
if (!input)
valid = 0;
input++;
input++;
fmt++;
valid = 0;
return ((valid == 0));
char *prompt)
if (!prompt)
if (defstr) {
goto start;
goto start;
goto start;