1 /* 2 * Copyright (C) 2007, 2012, 2016 David Shaw <dshaw@jabberwocky.com> 3 * 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 2 of the License, or 7 * (at your option) any later version. 8 * 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. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 */ 18 19 #ifndef _OUTPUT_H_ 20 #define _OUTPUT_H_ 21 22 #include <sys/types.h> 23 24 enum data_type {AUTO,BASE16,RAW}; 25 26 #define CRC24_INIT 0xB704CEL 27 28 void do_crc24(unsigned long *crc,const unsigned char *buf,size_t len); 29 void print_bytes(FILE *stream,const unsigned char *buf,size_t length); 30 void output_file_format(FILE *stream,const char *prefix); 31 int output_start(const char *name,enum data_type type, 32 unsigned char fingerprint[20]); 33 ssize_t output_bytes(const unsigned char *buf,size_t length); 34 #define output_packet(_packet) output_bytes((_packet)->buf,(_packet)->len) 35 ssize_t output_length16(size_t length); 36 ssize_t output_openpgp_header(unsigned char tag,size_t length); 37 void output_finish(void); 38 void set_binary_mode(FILE *stream); 39 40 #endif /* !_OUTPUT_H_ */ 41