ReactOS
0.4.16-dev-2110-ge3521eb
fgetpos.cpp
Go to the documentation of this file.
1
//
2
// fgetpos.cpp
3
//
4
// Copyright (c) Microsoft Corporation. All rights reserved.
5
//
6
// Defines fgetpos(), which gets the file position in an opaque internal format.
7
//
8
#include <
corecrt_internal_stdio.h
>
9
10
11
12
// Gets the file position in the internal fpos_t format. The returned value
13
// should only be used in a call to fsetpos(). Our implementation happens to
14
// just wrap _ftelli64() and _fseeki64(). Return zero on success; returns -1
15
// and sets errno on failure.
16
extern
"C"
int
__cdecl
fgetpos
(
FILE
*
const
stream
,
fpos_t
*
const
position)
17
{
18
_VALIDATE_RETURN
(
stream
!=
nullptr
,
EINVAL
, -1);
19
_VALIDATE_RETURN
(position !=
nullptr
,
EINVAL
, -1);
20
21
*position =
_ftelli64
(
stream
);
22
if
(*position == -1)
23
return
-1;
24
25
return
0;
26
}
corecrt_internal_stdio.h
_VALIDATE_RETURN
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
Definition:
corecrt_internal_strtox.h:38
_ftelli64
__int64 CDECL _ftelli64(FILE *file)
Definition:
file.c:4672
__cdecl
#define __cdecl
Definition:
corecrt.h:121
EINVAL
#define EINVAL
Definition:
errno.h:44
fgetpos
int __cdecl fgetpos(FILE *const stream, fpos_t *const position)
Definition:
fgetpos.cpp:16
fpos_t
__int64 fpos_t
Definition:
stdio.h:73
_iobuf
Definition:
corecrt_wstdio.h:27
stream
Definition:
parse.h:23
sdk
lib
ucrt
stdio
fgetpos.cpp
Generated on Thu Jan 8 2026 06:16:17 for ReactOS by
1.9.6