1 /* $OpenBSD: parser.h,v 1.7 2009/02/24 12:07:47 gilles Exp $ */ 2 3 /* 4 * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 enum actions { 20 NONE, 21 SHUTDOWN, 22 RELOAD, 23 MONITOR, 24 SCHEDULE, 25 SHOW_QUEUE, 26 SHOW_RUNQUEUE, 27 SHOW_STATS, 28 PAUSE_MDA, 29 PAUSE_MTA, 30 PAUSE_SMTP, 31 RESUME_MDA, 32 RESUME_MTA, 33 RESUME_SMTP, 34 }; 35 36 struct parse_result { 37 struct ctl_id id; 38 enum actions action; 39 const char *data; 40 }; 41 42 struct parse_result *parse(int, char *[]); 43 const struct token *match_token(const char *, const struct token []); 44 void show_valid_args(const struct token []); 45