1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #include "language/command.h"
22 #include "language/lexer/lexer.h"
23 #include "libpspp/assertion.h"
24 #include "libpspp/string-map.h"
25 #include "output/measure.h"
27 /* Executes the DEBUG PAPER SIZE command. */
29 cmd_debug_paper_size (struct lexer *lexer, struct dataset *ds UNUSED)
31 const char *paper_size;
34 if (!lex_force_string (lexer))
36 paper_size = lex_tokcstr (lexer);
38 printf ("\"%s\" => ", paper_size);
39 if (measure_paper (paper_size, &h, &v))
40 printf ("%.1f x %.1f in, %.0f x %.0f mm\n",
41 h / 72000., v / 72000.,
42 h / (72000 / 25.4), v / (72000 / 25.4));