| 1 | /* |
| 2 | * |
| 3 | * Test pattern generator for Gutenprint |
| 4 | * |
| 5 | * Copyright 2014 Robert Krawitz <[email protected]> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify it |
| 8 | * under the terms of the GNU General Public License as published by the Free |
| 9 | * Software Foundation; either version 2 of the License, or (at your option) |
| 10 | * any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 14 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 15 | * for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | */ |
| 20 | |
| 21 | /* |
| 22 | * Generate list of printers for supported printer list |
| 23 | */ |
| 24 | |
| 25 | #ifdef HAVE_CONFIG_H |
| 26 | #include <config.h> |
| 27 | #endif |
| 28 | #include <stdio.h> |
| 29 | #include <gutenprint/gutenprint.h> |
| 30 | #include <string.h> |
| 31 | |
| 32 | int |
| 33 | main(int argc, char **argv) |
| 34 | { |
| 35 | int i; |
| 36 | |
| 37 | (void)argc; |
| 38 | (void)argv; |
| 39 | |
| 40 | stp_init(); |
| 41 | for (i = 0; i < stp_printer_model_count(); i++) |
| 42 | { |
| 43 | const stp_printer_t *p = stp_get_printer_by_index(i); |
| 44 | if (strcmp(stp_printer_get_family(p), "ps") && |
| 45 | strcmp(stp_printer_get_family(p), "raw")) |
| 46 | printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n", |
| 47 | stp_printer_get_long_name(p), |
| 48 | stp_printer_get_driver(p), |
| 49 | stp_printer_get_comment(p) ? stp_printer_get_comment(p) : ""); |
| 50 | } |
| 51 | return 0; |
| 52 | } |