From 1bda4c835e2fb1c8a9088f9d1011ae404ab8cd85 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 5 Jun 2001 19:59:08 +0000 Subject: - stevesk@cvs.openbsd.org 2001/05/19 19:43:57 [misc.c misc.h servconf.c sshd.8 sshd.c] sshd command-line arguments and configuration file options that specify time may be expressed using a sequence of the form: time[qualifier], where time is a positive integer value and qualifier is one of the following: ,s,m,h,d,w Examples: 600 600 seconds (10 minutes) 10m 10 minutes 1h30m 1 hour 30 minutes (90 minutes) ok markus@ --- misc.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'misc.h') diff --git a/misc.h b/misc.h index 01a736c03..086f98e0f 100644 --- a/misc.h +++ b/misc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.h,v 1.7 2001/05/11 14:59:56 markus Exp $ */ +/* $OpenBSD: misc.h,v 1.8 2001/05/19 19:43:57 stevesk Exp $ */ /* * Author: Tatu Ylonen @@ -34,6 +34,30 @@ int a2port(const char *s); char *cleanhostname(char *host); char *colon(char *cp); +/* + * Convert a time string into seconds; format is + * a sequence of: + * time[qualifier] + * + * Valid time qualifiers are: + * seconds + * s|S seconds + * m|M minutes + * h|H hours + * d|D days + * w|W weeks + * + * Examples: + * 90m 90 minutes + * 1h30m 90 minutes + * 2d 2 days + * 1w 1 week + * + * Return -1 if time string is invalid. + */ + +long convtime(const char *s); + /* function to assist building execv() arguments */ typedef struct arglist arglist; struct arglist { -- cgit v1.2.3