Rev 4874 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * Copyright (c) 1990 The Regents of the University of California. |
||
3 | * All rights reserved. |
||
4 | * |
||
5 | * Redistribution and use in source and binary forms are permitted |
||
6 | * provided that the above copyright notice and this paragraph are |
||
7 | * duplicated in all such forms and that any documentation, |
||
8 | * advertising materials, and other materials related to such |
||
9 | * distribution and use acknowledge that the software was developed |
||
10 | * by the University of California, Berkeley. The name of the |
||
11 | * University may not be used to endorse or promote products derived |
||
12 | * from this software without specific prior written permission. |
||
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR |
||
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED |
||
15 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
||
16 | */ |
||
17 | |||
18 | /* |
||
19 | FUNCTION |
||
20 | < |
||
21 | |||
22 | INDEX |
||
23 | fseek |
||
24 | INDEX |
||
25 | fseeko |
||
26 | INDEX |
||
27 | _fseek_r |
||
28 | INDEX |
||
29 | _fseeko_r |
||
30 | |||
31 | ANSI_SYNOPSIS |
||
32 | #include |
||
33 | int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>) |
||
34 | int fseeko(FILE *<[fp]>, off_t <[offset]>, int <[whence]>) |
||
35 | int _fseek_r(struct _reent *<[ptr]>, FILE *<[fp]>, |
||
36 | long <[offset]>, int <[whence]>) |
||
37 | int _fseeko_r(struct _reent *<[ptr]>, FILE *<[fp]>, |
||
38 | off_t <[offset]>, int <[whence]>) |
||
39 | |||
40 | TRAD_SYNOPSIS |
||
41 | #include |
||
42 | int fseek(<[fp]>, <[offset]>, <[whence]>) |
||
43 | FILE *<[fp]>; |
||
44 | long <[offset]>; |
||
45 | int <[whence]>; |
||
46 | |||
47 | int fseeko(<[fp]>, <[offset]>, <[whence]>) |
||
48 | FILE *<[fp]>; |
||
49 | off_t <[offset]>; |
||
50 | int <[whence]>; |
||
51 | |||
52 | int _fseek_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>) |
||
53 | struct _reent *<[ptr]>; |
||
54 | FILE *<[fp]>; |
||
55 | long <[offset]>; |
||
56 | int <[whence]>; |
||
57 | |||
58 | int _fseeko_r(<[ptr]>, <[fp]>, <[offset]>, <[whence]>) |
||
59 | struct _reent *<[ptr]>; |
||
60 | FILE *<[fp]>; |
||
61 | off_t <[offset]>; |
||
62 | int <[whence]>; |
||
63 | |||
64 | DESCRIPTION |
||
65 | Objects of type < |
||
66 | of the file your program has already read. Many of the < |
||
67 | depend on this position, and many change it as a side effect. |
||
68 | |||
69 | You can use < |
||
70 | <[fp]>. The value of <[offset]> determines the new position, in one |
||
71 | of three ways selected by the value of <[whence]> (defined as macros |
||
72 | in `< |
||
73 | |||
74 | < |
||
75 | from the beginning of the file) desired. <[offset]> must be positive. |
||
76 | |||
77 | < |
||
78 | <[offset]> can meaningfully be either positive or negative. |
||
79 | |||
80 | < |
||
81 | <[offset]> can meaningfully be either positive (to increase the size |
||
82 | of the file) or negative. |
||
83 | |||
84 | See < |
||
85 | |||
86 | RETURNS |
||
87 | < |
||
88 | result is < |
||
89 | either < |
||
90 | repositioning) or < |
||
91 | |||
92 | PORTABILITY |
||
93 | ANSI C requires < |
||
94 | |||
95 | < |
||
96 | |||
97 | Supporting OS subroutines required: < |
||
98 | < |
||
99 | */ |
||
100 | |||
101 | #include <_ansi.h> |
||
102 | #include |
||
103 | #include |
||
104 | #include |
||
105 | #include "local.h" |
||
106 | |||
107 | int |
||
108 | _DEFUN(_fseek_r, (ptr, fp, offset, whence), |
||
109 | struct _reent *ptr _AND |
||
110 | register FILE *fp _AND |
||
111 | long offset _AND |
||
112 | int whence) |
||
113 | { |
||
4921 | Serge | 114 | return _fseeko_r (ptr, fp, offset, whence); |
4349 | Serge | 115 | } |
116 | |||
117 | #ifndef _REENT_ONLY |
||
118 | |||
119 | int |
||
120 | _DEFUN(fseek, (fp, offset, whence), |
||
121 | register FILE *fp _AND |
||
122 | long offset _AND |
||
123 | int whence) |
||
124 | { |
||
125 | return _fseek_r (_REENT, fp, offset, whence); |
||
126 | } |
||
127 | |||
128 | #endif /* !_REENT_ONLY */ |