Coverage Report

Created: 2025-11-09 06:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/curl/lib/curlx/fopen.h
Line
Count
Source
1
#ifndef HEADER_CURLX_FOPEN_H
2
#define HEADER_CURLX_FOPEN_H
3
/***************************************************************************
4
 *                                  _   _ ____  _
5
 *  Project                     ___| | | |  _ \| |
6
 *                             / __| | | | |_) | |
7
 *                            | (__| |_| |  _ <| |___
8
 *                             \___|\___/|_| \_\_____|
9
 *
10
 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11
 *
12
 * This software is licensed as described in the file COPYING, which
13
 * you should have received as part of this distribution. The terms
14
 * are also available at https://curl.se/docs/copyright.html.
15
 *
16
 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17
 * copies of the Software, and permit persons to whom the Software is
18
 * furnished to do so, under the terms of the COPYING file.
19
 *
20
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
 * KIND, either express or implied.
22
 *
23
 * SPDX-License-Identifier: curl
24
 *
25
 ***************************************************************************/
26
27
#include "../curl_setup.h"
28
29
#include "multibyte.h"
30
31
#ifdef HAVE_FCNTL_H
32
#include <fcntl.h>  /* for open() and attributes */
33
#endif
34
35
int curlx_fseek(void *stream, curl_off_t offset, int whence);
36
37
#if defined(_WIN32) && !defined(UNDER_CE)
38
FILE *curlx_win32_fopen(const char *filename, const char *mode);
39
int curlx_win32_stat(const char *path, struct_stat *buffer);
40
int curlx_win32_open(const char *filename, int oflag, ...);
41
#define CURLX_FOPEN_LOW(fname, mode) curlx_win32_fopen(fname, mode)
42
#define curlx_stat(fname, stp)       curlx_win32_stat(fname, stp)
43
#define curlx_open                   curlx_win32_open
44
#else
45
12.1k
#define CURLX_FOPEN_LOW              fopen
46
0
#define curlx_stat(fname, stp)       stat(fname, stp)
47
0
#define curlx_open                   open
48
#endif
49
50
#ifdef CURLDEBUG
51
12.1k
#define curlx_fopen(file,mode)  curl_dbg_fopen(file,mode,__LINE__,__FILE__)
52
0
#define curlx_fdopen(file,mode) curl_dbg_fdopen(file,mode,__LINE__,__FILE__)
53
12.1k
#define curlx_fclose(file)      curl_dbg_fclose(file,__LINE__,__FILE__)
54
#else
55
#define curlx_fopen             CURLX_FOPEN_LOW
56
#define curlx_fdopen            fdopen
57
#define curlx_fclose            fclose
58
#endif
59
60
#endif /* HEADER_CURLX_FOPEN_H */