xref: /openbsd-src/usr.sbin/cron/funcs.h (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1 /*	$OpenBSD: funcs.h,v 1.15 2013/04/17 15:58:45 deraadt 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		set_cron_uid(void),
26 		set_cron_cwd(void),
27 		load_database(cron_db *),
28 		open_logfile(void),
29 		sigpipe_func(void),
30 		job_add(entry *, user *),
31 		do_command(entry *, user *),
32 		link_user(cron_db *, user *),
33 		unlink_user(cron_db *, user *),
34 		free_user(user *),
35 		env_free(char **),
36 		unget_char(int, FILE *),
37 		free_entry(entry *),
38 		acquire_daemonlock(int),
39 		skip_comments(FILE *),
40 		log_it(const char *, int, const char *, const char *),
41 		log_close(void),
42 		poke_daemon(const char *, unsigned char),
43 		atrun(at_db *, double, time_t);
44 
45 int		job_runqueue(void),
46 		set_debug_flags(const char *),
47 		get_char(FILE *),
48 		get_string(char *, int, FILE *, char *),
49 		swap_gids(void),
50 		swap_gids_back(void),
51 		load_env(char *, FILE *),
52 		cron_pclose(FILE *),
53 		glue_strings(char *, size_t, const char *, const char *, char),
54 		strcmp_until(const char *, const char *, char),
55 		allowed(const char *, const char *, const char *),
56 		open_socket(void),
57 		safe_p(const char *, const char *),
58 		scan_atjobs(at_db *, struct timeval *);
59 
60 int		strtot(const char *nptr, char **endptr, time_t *tp);
61 
62 char		*env_get(char *, char **),
63 		*arpadate(time_t *),
64 		*mkprints(unsigned char *, unsigned int),
65 		*first_word(char *, char *),
66 		**env_init(void),
67 		**env_copy(char **),
68 		**env_set(char **, char *);
69 
70 void		mkprint(char *, unsigned char *, int);
71 
72 user		*load_user(int, struct passwd *, const char *),
73 		*find_user(cron_db *, const char *);
74 
75 entry		*load_entry(FILE *,
76 		    void (*)(const char *), struct passwd *, char **);
77 
78 FILE		*cron_popen(char *, char *, struct passwd *);
79 
80 #ifndef HAVE_TM_GMTOFF
81 long		get_gmtoff(time_t *, struct tm *);
82 #endif
83