ap.c (1034B)
1 /* Copyright 2021 Jacob R. Edwards 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <https://www.gnu.org/licenses/>. 15 */ 16 17 #include <ap.h> 18 19 #include <fcntl.h> 20 #include <stdio.h> 21 22 int 23 main(int argc, char *argv[]) 24 { 25 int status; 26 27 if (argc > 2) { 28 fprintf(stderr, "usage: %s [file]\n", *argv); 29 return 1; 30 } 31 32 ao_initialize(); 33 status = ap(open(argv[1] ? argv[1] : "/dev/stdin", O_RDONLY)); 34 ao_shutdown(); 35 36 if (status) { 37 perror("ap"); 38 return 1; 39 } 40 return 0; 41 }