ReactOS 0.4.16-dev-2110-ge3521eb
fsetpos.cpp
Go to the documentation of this file.
1//
2// fsetpos.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Defines fsetpos(), which sets the file position using a position previously
7// returned by fgetpos().
8//
10
11
12
13// Sets the file position to the given position. The position value must have
14// been returned by a prior call to fgetpos(). Returns 0 on success; returns
15// nonzero on failure.
16extern "C" int __cdecl fsetpos(FILE* const stream, fpos_t const* const position)
17{
18 _VALIDATE_RETURN(stream != nullptr, EINVAL, -1);
19 _VALIDATE_RETURN(position != nullptr, EINVAL, -1);
20
21 return _fseeki64(stream, *position, SEEK_SET);
22}
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
int CDECL _fseeki64(FILE *file, __int64 offset, int whence)
Definition: file.c:1571
#define __cdecl
Definition: corecrt.h:121
#define EINVAL
Definition: errno.h:44
int __cdecl fsetpos(FILE *const stream, fpos_t const *const position)
Definition: fsetpos.cpp:16
#define SEEK_SET
Definition: jmemansi.c:26
__int64 fpos_t
Definition: stdio.h:73
Definition: parse.h:23