xref: /openbsd-src/usr.sbin/cron/funcs.h (revision 2e6cac80faa0839600eabf86f0b60f68c98b4e81)
1 /*	$OpenBSD: funcs.h,v 1.30 2020/04/16 17:51:56 millert Exp $	*/
2 
3 /*
4  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
17  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /* Notes:
21  *	This file has to be included by cron.h after data structure defs.
22  *	We should reorg this into sections by module.
23  */
24 
25 void		load_database(cron_db **),
26 		job_add(entry *, user *),
27 		job_remove(entry *, user *),
28 		job_exit(pid_t),
29 		free_user(user *),
30 		env_free(char **),
31 		unget_char(int, FILE *),
32 		free_entry(entry *),
33 		skip_comments(FILE *),
34 		poke_daemon(unsigned char),
35 		atrun(at_db *, double, time_t);
36 
37 pid_t		do_command(entry *, user *);
38 
39 int		job_runqueue(void),
40 		get_char(FILE *),
41 		get_string(char *, int, FILE *, char *),
42 		load_env(char *, FILE *),
43 		cron_pclose(FILE *, pid_t),
44 		allowed(const char *, const char *, const char *),
45 		safe_p(const char *, const char *),
46 		scan_atjobs(at_db **, struct timespec *);
47 
48 char		*env_get(char *, char **),
49 		*first_word(char *, char *),
50 		**env_init(void),
51 		**env_copy(char **),
52 		**env_set(char **, char *);
53 
54 user		*load_user(FILE *, struct passwd *, const char *),
55 		*find_user(cron_db *, const char *);
56 
57 entry		*load_entry(FILE *,
58 		    void (*)(const char *), struct passwd *, char **);
59 
60 FILE		*cron_popen(char *, char *, struct passwd *, pid_t *);
61