1*84d9c625SLionel Sambuc /* $NetBSD: util.h,v 1.3 2012/11/04 13:08:57 christos Exp $ */ 20c3983b2SBen Gras 30c3983b2SBen Gras /*- 40c3983b2SBen Gras * Copyright (c) 1995 50c3983b2SBen Gras * The Regents of the University of California. All rights reserved. 60c3983b2SBen Gras * 70c3983b2SBen Gras * Redistribution and use in source and binary forms, with or without 80c3983b2SBen Gras * modification, are permitted provided that the following conditions 90c3983b2SBen Gras * are met: 100c3983b2SBen Gras * 1. Redistributions of source code must retain the above copyright 110c3983b2SBen Gras * notice, this list of conditions and the following disclaimer. 120c3983b2SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 130c3983b2SBen Gras * notice, this list of conditions and the following disclaimer in the 140c3983b2SBen Gras * documentation and/or other materials provided with the distribution. 150c3983b2SBen Gras * 3. Neither the name of the University nor the names of its contributors 160c3983b2SBen Gras * may be used to endorse or promote products derived from this software 170c3983b2SBen Gras * without specific prior written permission. 180c3983b2SBen Gras * 190c3983b2SBen Gras * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 200c3983b2SBen Gras * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 210c3983b2SBen Gras * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 220c3983b2SBen Gras * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 230c3983b2SBen Gras * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 240c3983b2SBen Gras * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 250c3983b2SBen Gras * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 260c3983b2SBen Gras * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 270c3983b2SBen Gras * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 280c3983b2SBen Gras * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 290c3983b2SBen Gras * SUCH DAMAGE. 300c3983b2SBen Gras */ 310c3983b2SBen Gras 320c3983b2SBen Gras #ifndef _COMPAT_UTIL_H_ 330c3983b2SBen Gras #define _COMPAT_UTIL_H_ 340c3983b2SBen Gras 350c3983b2SBen Gras #include <sys/cdefs.h> 360c3983b2SBen Gras #include <sys/types.h> 37*84d9c625SLionel Sambuc #include <sys/inttypes.h> 38*84d9c625SLionel Sambuc #include <sys/ansi.h> 39*84d9c625SLionel Sambuc 40*84d9c625SLionel Sambuc struct utmp50; 41*84d9c625SLionel Sambuc struct utmpx50; 42*84d9c625SLionel Sambuc struct passwd50; 43*84d9c625SLionel Sambuc struct utmp; 44*84d9c625SLionel Sambuc struct utmpx; 45*84d9c625SLionel Sambuc struct passwd; 460c3983b2SBen Gras 470c3983b2SBen Gras void login(const struct utmp50 *); 480c3983b2SBen Gras void loginx(const struct utmpx50 *); 490c3983b2SBen Gras 500c3983b2SBen Gras int32_t parsedate(const char *, const int32_t *, const int *); 510c3983b2SBen Gras 520c3983b2SBen Gras void pw_copy(int, int, struct passwd50 *, struct passwd50 *); 530c3983b2SBen Gras int pw_copyx(int, int, struct passwd50 *, struct passwd50 *, 540c3983b2SBen Gras char *, size_t); 550c3983b2SBen Gras void pw_getpwconf(char *, size_t, const struct passwd50 *, 560c3983b2SBen Gras const char *); 570c3983b2SBen Gras 580c3983b2SBen Gras void __login50(const struct utmp *); 590c3983b2SBen Gras void __loginx50(const struct utmpx *); 600c3983b2SBen Gras 610c3983b2SBen Gras time_t __parsedate50(const char *, const time_t *, const int *); 620c3983b2SBen Gras 630c3983b2SBen Gras void __pw_copy50(int, int, struct passwd *, struct passwd *); 640c3983b2SBen Gras int __pw_copyx50(int, int, struct passwd *, struct passwd *, 650c3983b2SBen Gras char *, size_t); 660c3983b2SBen Gras void __pw_getpwconf50(char *, size_t, const struct passwd *, 670c3983b2SBen Gras const char *); 680c3983b2SBen Gras #endif /* !_COMPAT_UTIL_H_ */ 69