1 /* 2 * tumble: build a PDF file from image files 3 * 4 * PDF routines 5 * Copyright 2001, 2002, 2003, 2017 Eric Smith <spacewar@gmail.com> 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as 9 * published by the Free Software Foundation. Note that permission is 10 * not granted to redistribute this program under the terms of any 11 * other version of the General Public License. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA 21 */ 22 23 24 #include <assert.h> 25 26 27 void pdf_fatal (char *fmt, ...) __attribute__ ((noreturn)); 28 29 void *pdf_calloc (size_t nmemb, size_t size); 30 31 char *pdf_strdup (char *s); 32 33 #if 1 34 #define pdf_assert(cond) assert(cond) 35 #else 36 #define pdf_assert(cond) do \ 37 { \ 38 if (! (cond)) \ 39 pdf_fatal ("assert at %s(%d)\n", __FILE__, __LINE__); \ 40 } while (0) 41 #endif 42