1 /*
2 * madir.c
3 *
4 * madir direction
5 *
6 * Copyright (c) 1988-1993 Miguel Santana
7 * Copyright (c) 1995-1999 Akim Demaille, Miguel Santana
8 * $Id: madir.c,v 1.3 1998/08/27 09:44:23 demaille Exp $
9 */
10
11 /*
12 * This file is part of a2ps.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; see the file COPYING. If not, write to
26 * the Free Software Foundation, 59 Temple Place - Suite 330,
27 * Boston, MA 02111-1307, USA.
28 */
29
30 #include "a2ps.h"
31 #include "madir.h"
32 #include "argmatch.h"
33
34 /*
35 * Return a madir mode
36 */
37 static const char *const madir_args[] =
38 {
39 "rows", "columns", 0
40 };
41
42 static madir_t madir_types[] =
43 {
44 madir_rows, madir_columns
45 };
46
47 madir_t
madir_argmatch(const char * option,const char * arg)48 madir_argmatch (const char * option, const char * arg)
49 {
50 return XARGCASEMATCH (option, arg, madir_args, madir_types);
51 }
52
53 const char *
madir_to_string(madir_t madir)54 madir_to_string (madir_t madir)
55 {
56 switch (madir)
57 {
58 case madir_rows:
59 return _("rows first");
60
61 case madir_columns:
62 return _("columns first");
63
64 default:
65 abort ();
66 }
67 }
68