Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * <<fsetpos>>---restore position of a stream or file
21 * int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>);
24 * int fsetpos(<[fp]>, <[pos]>)
27 * Objects of type <<FILE>> can have a ``position'' that records how much
28 * of the file your program has already read. Many of the <<stdio>> functions
29 * depend on this position, and many change it as a side effect.
30 * You can use <<fsetpos>> to return the file identified by <[fp]> to a previous
31 * position <<*<[pos]>>> (after first recording it with <<fgetpos>>).
32 * See <<fseek>> for a similar facility.
34 * <<fgetpos>> returns <<0>> when successful. If <<fgetpos>> fails, the
35 * result is <<1>>. The reason for failure is indicated in <<errno>>:
36 * either <<ESPIPE>> (the stream identified by <[fp]> doesn't support
37 * repositioning) or <<EINVAL>> (invalid file position).
39 * ANSI C requires <<fsetpos>>, but does not specify the nature of
40 * <<*<[pos]>>> beyond identifying it as written by <<fgetpos>>.
41 * Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
42 * <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
52 Reposition file pointer to a saved location.
53 @return If successful the function returns 0.
54 Otherwise it returns nonzero and sets the global variable errno to a non-zero value.
55 @param iop Pointer to an open file.
56 @param pos Position value obtained from a previous call to fgetpos that indicates
57 the position of the file pointer at that moment.
60 fsetpos (FILE * iop, const fpos_t * pos)
62 int x = fseek (iop, *pos, SEEK_SET);