xref: /netbsd-src/external/bsd/cron/dist/funcs.h (revision c38e7cc395b1472a774ff828e46123de44c628e9)
1 /*	$NetBSD: funcs.h,v 1.5 2017/08/17 08:53:00 christos Exp $	*/
2 
3 /*
4  * Id: funcs.h,v 1.9 2004/01/23 18:56:42 vixie Exp
5  */
6 
7 /*
8  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
9  * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
10  *
11  * Permission to use, copy, modify, and distribute this software for any
12  * purpose with or without fee is hereby granted, provided that the above
13  * copyright notice and this permission notice appear in all copies.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
16  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
18  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  */
23 
24 /* Notes:
25  *	This file has to be included by cron.h after data structure defs.
26  *	We should reorg this into sections by module.
27  */
28 
29 void		set_cron_uid(void),
30 		set_cron_cwd(void),
31 		load_database(cron_db *),
32 		open_logfile(void),
33 		sigpipe_func(void),
34 		job_add(entry *, user *, time_t),
35 		do_command(entry *, user *),
36 		link_user(cron_db *, user *),
37 		unlink_user(cron_db *, user *),
38 		free_user(user *),
39 		env_free(char **),
40 		unget_char(int, FILE *),
41 		free_entry(entry *),
42 		acquire_daemonlock(int),
43 		skip_comments(FILE *),
44 		log_it(const char *, int, const char *, const char *),
45 		log_close(void);
46 
47 
48 void
49 		log_itx(const char *, int, const char *, const char *, ...)
50 		    __printflike(4, 5);
51 
52 int		job_runqueue(void),
53 		set_debug_flags(const char *),
54 		get_char(FILE *),
55 		get_string(char *, int, FILE *, const char *),
56 		load_env(char *, FILE *),
57 		cron_pclose(FILE *),
58 		glue_strings(char *, size_t, const char *, const char *, char),
59 		strcmp_until(const char *, const char *, char),
60 		strdtb(char *);
61 
62 size_t		strlens(const char *, ...);
63 
64 char		*env_get(const char *, char **),
65 		*arpadate(time_t *),
66 		*mkprints(char *, size_t),
67 		**env_init(void),
68 		**env_copy(char **),
69 		**env_set(char **, char *);
70 
71 user		*load_user(int, struct passwd *, const char *),
72 		*find_user(cron_db *, const char *);
73 
74 entry		*load_entry(FILE *, void (*)(const char *), struct passwd *, char **);
75 
76 FILE		*cron_popen(char *, const char *, struct passwd *);
77 
78 struct passwd	*pw_dup(const struct passwd *);
79 
80 #ifndef HAVE_TM_GMTOFF
81 long		get_gmtoff(time_t *, struct tm *);
82 #endif
83 
84 extern int close_all(int);
85 #ifdef USE_PAM
86 extern int cron_pam_start (const char *user);
87 extern int cron_pam_setcred (void);
88 extern void cron_pam_finish (void);
89 extern void cron_pam_child_close (void);
90 extern char **cron_pam_getenvlist (char **envp);
91 #endif
92