1*0a6a1f1dSLionel Sambuc /* $NetBSD: ssl.h,v 1.3 2015/09/12 19:38:42 wiz Exp $ */ 204203a83SThomas Cort 304203a83SThomas Cort /*- 404203a83SThomas Cort * Copyright (c) 2012 The NetBSD Foundation, Inc. 504203a83SThomas Cort * All rights reserved. 604203a83SThomas Cort * 704203a83SThomas Cort * Redistribution and use in source and binary forms, with or without 804203a83SThomas Cort * modification, are permitted provided that the following conditions 904203a83SThomas Cort * are met: 1004203a83SThomas Cort * 1. Redistributions of source code must retain the above copyright 1104203a83SThomas Cort * notice, this list of conditions and the following disclaimer. 1204203a83SThomas Cort * 2. Redistributions in binary form must reproduce the above copyright 1304203a83SThomas Cort * notice, this list of conditions and the following disclaimer in the 1404203a83SThomas Cort * documentation and/or other materials provided with the distribution. 1504203a83SThomas Cort * 1604203a83SThomas Cort * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 1704203a83SThomas Cort * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 1804203a83SThomas Cort * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1904203a83SThomas Cort * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2004203a83SThomas Cort * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2104203a83SThomas Cort * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2204203a83SThomas Cort * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2304203a83SThomas Cort * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2404203a83SThomas Cort * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2504203a83SThomas Cort * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2604203a83SThomas Cort * POSSIBILITY OF SUCH DAMAGE. 2704203a83SThomas Cort */ 2804203a83SThomas Cort #ifdef WITH_SSL 2904203a83SThomas Cort 3004203a83SThomas Cort #define FETCH struct fetch_connect 3104203a83SThomas Cort struct fetch_connect; 3204203a83SThomas Cort 33*0a6a1f1dSLionel Sambuc int fetch_printf(struct fetch_connect *, const char *fmt, ...) 34*0a6a1f1dSLionel Sambuc __printflike(2, 3); 3504203a83SThomas Cort int fetch_fileno(struct fetch_connect *); 3604203a83SThomas Cort int fetch_error(struct fetch_connect *); 3704203a83SThomas Cort int fetch_flush(struct fetch_connect *); 3804203a83SThomas Cort struct fetch_connect *fetch_open(const char *, const char *); 3904203a83SThomas Cort struct fetch_connect *fetch_fdopen(int, const char *); 4004203a83SThomas Cort int fetch_close(struct fetch_connect *); 4104203a83SThomas Cort ssize_t fetch_read(void *, size_t, size_t, struct fetch_connect *); 4204203a83SThomas Cort char *fetch_getln(char *, int, struct fetch_connect *); 4304203a83SThomas Cort int fetch_getline(struct fetch_connect *, char *, size_t, const char **); 4404203a83SThomas Cort void fetch_set_ssl(struct fetch_connect *, void *); 45*0a6a1f1dSLionel Sambuc void *fetch_start_ssl(int, const char *); 4604203a83SThomas Cort 4704203a83SThomas Cort #else /* !WITH_SSL */ 4804203a83SThomas Cort 4904203a83SThomas Cort #define FETCH FILE 5004203a83SThomas Cort 5104203a83SThomas Cort #define fetch_printf fprintf 5204203a83SThomas Cort #define fetch_fileno fileno 5304203a83SThomas Cort #define fetch_error ferror 5404203a83SThomas Cort #define fetch_flush fflush 5504203a83SThomas Cort #define fetch_open fopen 5604203a83SThomas Cort #define fetch_fdopen fdopen 5704203a83SThomas Cort #define fetch_close fclose 5804203a83SThomas Cort #define fetch_read fread 5904203a83SThomas Cort #define fetch_getln fgets 6004203a83SThomas Cort #define fetch_getline get_line 6104203a83SThomas Cort #define fetch_set_ssl(a, b) 6204203a83SThomas Cort 6304203a83SThomas Cort #endif /* !WITH_SSL */ 64