Home | History | Annotate | Line # | Download | only in includes
      1  1.2  christos /*	$NetBSD: statement.h,v 1.3 2022/04/03 01:10:58 christos Exp $	*/
      2  1.1  christos 
      3  1.1  christos /* statement.h
      4  1.1  christos 
      5  1.1  christos    Definitions for executable statements... */
      6  1.1  christos 
      7  1.1  christos /*
      8  1.3  christos  * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
      9  1.1  christos  * Copyright (c) 1996-2003 by Internet Software Consortium
     10  1.1  christos  *
     11  1.1  christos  * This Source Code Form is subject to the terms of the Mozilla Public
     12  1.1  christos  * License, v. 2.0. If a copy of the MPL was not distributed with this
     13  1.1  christos  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     14  1.1  christos  *
     15  1.1  christos  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
     16  1.1  christos  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     17  1.1  christos  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
     18  1.1  christos  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     19  1.1  christos  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     20  1.1  christos  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     21  1.1  christos  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     22  1.1  christos  *
     23  1.1  christos  *   Internet Systems Consortium, Inc.
     24  1.3  christos  *   PO Box 360
     25  1.3  christos  *   Newmarket, NH 03857 USA
     26  1.1  christos  *   <info (at) isc.org>
     27  1.1  christos  *   https://www.isc.org/
     28  1.1  christos  *
     29  1.1  christos  */
     30  1.1  christos 
     31  1.1  christos struct executable_statement {
     32  1.1  christos 	int refcnt;
     33  1.1  christos 	struct executable_statement *next;
     34  1.1  christos 	enum statement_op {
     35  1.1  christos 		null_statement,
     36  1.1  christos 		if_statement,
     37  1.1  christos 		add_statement,
     38  1.1  christos 		eval_statement,
     39  1.1  christos 		break_statement,
     40  1.1  christos 		default_option_statement,
     41  1.1  christos 		supersede_option_statement,
     42  1.1  christos 		append_option_statement,
     43  1.1  christos 		prepend_option_statement,
     44  1.1  christos 		send_option_statement,
     45  1.1  christos 		statements_statement,
     46  1.1  christos 		on_statement,
     47  1.1  christos 		switch_statement,
     48  1.1  christos 		case_statement,
     49  1.1  christos 		default_statement,
     50  1.1  christos 		set_statement,
     51  1.1  christos 		unset_statement,
     52  1.1  christos 		let_statement,
     53  1.1  christos 		define_statement,
     54  1.1  christos 		log_statement,
     55  1.1  christos 		return_statement,
     56  1.1  christos 		execute_statement,
     57  1.1  christos 		vendor_opt_statement
     58  1.1  christos 	} op;
     59  1.1  christos 	union {
     60  1.1  christos 		struct {
     61  1.1  christos 			struct executable_statement *tc, *fc;
     62  1.1  christos 			struct expression *expr;
     63  1.1  christos 		} ie;
     64  1.1  christos 		struct expression *eval;
     65  1.1  christos 		struct expression *retval;
     66  1.1  christos 		struct class *add;
     67  1.1  christos 		struct option_cache *option;
     68  1.1  christos 		struct option_cache *supersede;
     69  1.1  christos 		struct option_cache *prepend;
     70  1.1  christos 		struct option_cache *append;
     71  1.1  christos 		struct executable_statement *statements;
     72  1.1  christos 		struct {
     73  1.1  christos 			int evtypes;
     74  1.1  christos #			define ON_COMMIT  1
     75  1.1  christos #			define ON_EXPIRY  2
     76  1.1  christos #			define ON_RELEASE 4
     77  1.1  christos #			define ON_TRANSMISSION 8
     78  1.1  christos 			struct executable_statement *statements;
     79  1.1  christos 		} on;
     80  1.1  christos 		struct {
     81  1.1  christos 			struct expression *expr;
     82  1.1  christos 			struct executable_statement *statements;
     83  1.1  christos 		} s_switch;
     84  1.1  christos 		struct expression *c_case;
     85  1.1  christos 		struct {
     86  1.1  christos 			char *name;
     87  1.1  christos 			struct expression *expr;
     88  1.1  christos 			struct executable_statement *statements;
     89  1.1  christos 		} set, let;
     90  1.1  christos 		char *unset;
     91  1.1  christos 		struct {
     92  1.1  christos 			enum {
     93  1.1  christos 				log_priority_fatal,
     94  1.1  christos 				log_priority_error,
     95  1.1  christos 				log_priority_debug,
     96  1.1  christos 				log_priority_info
     97  1.1  christos 			} priority;
     98  1.1  christos 			struct expression *expr;
     99  1.1  christos 		} log;
    100  1.1  christos 		struct {
    101  1.1  christos 			char *command;
    102  1.1  christos 			struct expression *arglist;
    103  1.1  christos 			int argc;
    104  1.1  christos 		} execute;
    105  1.1  christos 	} data;
    106  1.1  christos };
    107