Mercurial > octave-nkf
annotate src/zfstream.cc @ 8874:bd1b1fe9c6e9 ss-3-1-53
bump version info for snapshot
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Feb 2009 18:35:47 -0500 |
parents | 60e938e1459b |
children | eb63fbe60fab |
rev | line source |
---|---|
5269 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2005, 2007 Ludwig Schwardt, Kevin Ruland |
5269 | 4 |
5 | |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5269 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5269 | 21 |
22 */ | |
23 | |
24 /* | |
25 | |
26 This file is adapted from the zlib 1.2.2 contrib/iostream3 code, | |
27 written by | |
28 | |
29 Ludwig Schwardt <schwardt@sun.ac.za> | |
30 original version by Kevin Ruland <kevin@rodin.wustl.edu> | |
31 | |
32 */ | |
33 | |
8025
60e938e1459b
zfstream.cc: include <config.h>
John W. Eaton <jwe@octave.org>
parents:
7520
diff
changeset
|
34 #ifdef HAVE_CONFIG_H |
60e938e1459b
zfstream.cc: include <config.h>
John W. Eaton <jwe@octave.org>
parents:
7520
diff
changeset
|
35 #include <config.h> |
60e938e1459b
zfstream.cc: include <config.h>
John W. Eaton <jwe@octave.org>
parents:
7520
diff
changeset
|
36 #endif |
60e938e1459b
zfstream.cc: include <config.h>
John W. Eaton <jwe@octave.org>
parents:
7520
diff
changeset
|
37 |
5269 | 38 #include "zfstream.h" |
39 | |
40 #ifdef HAVE_ZLIB | |
41 | |
42 #include <cstring> // for strcpy, strcat, strlen (mode strings) | |
43 #include <cstdio> // for BUFSIZ | |
44 | |
45 // Internal buffer sizes (default and "unbuffered" versions) | |
6783 | 46 #define STASHED_CHARACTERS 16 |
47 #define BIGBUFSIZE (256 * 1024 + STASHED_CHARACTERS) | |
5269 | 48 #define SMALLBUFSIZE 1 |
49 | |
50 /*****************************************************************************/ | |
51 | |
52 // Default constructor | |
53 gzfilebuf::gzfilebuf() | |
7520 | 54 : file(0), io_mode(std::ios_base::openmode(0)), own_fd(false), |
55 buffer(0), buffer_size(BIGBUFSIZE), own_buffer(true) | |
5269 | 56 { |
57 // No buffers to start with | |
58 this->disable_buffer(); | |
59 } | |
60 | |
61 // Destructor | |
62 gzfilebuf::~gzfilebuf() | |
63 { | |
64 // Sync output buffer and close only if responsible for file | |
65 // (i.e. attached streams should be left open at this stage) | |
66 this->sync(); | |
67 if (own_fd) | |
68 this->close(); | |
69 // Make sure internal buffer is deallocated | |
70 this->disable_buffer(); | |
71 } | |
72 | |
73 // Set compression level and strategy | |
74 int | |
75 gzfilebuf::setcompression(int comp_level, | |
76 int comp_strategy) | |
77 { | |
78 return gzsetparams(file, comp_level, comp_strategy); | |
79 } | |
80 | |
81 // Open gzipped file | |
82 gzfilebuf* | |
83 gzfilebuf::open(const char *name, | |
84 std::ios_base::openmode mode) | |
85 { | |
86 // Fail if file already open | |
87 if (this->is_open()) | |
7520 | 88 return 0; |
5269 | 89 // Don't support simultaneous read/write access (yet) |
90 if ((mode & std::ios_base::in) && (mode & std::ios_base::out)) | |
7520 | 91 return 0; |
5269 | 92 |
93 // Build mode string for gzopen and check it [27.8.1.3.2] | |
94 char char_mode[6] = "\0\0\0\0\0"; | |
95 if (!this->open_mode(mode, char_mode)) | |
7520 | 96 return 0; |
5269 | 97 |
98 // Attempt to open file | |
7520 | 99 if ((file = gzopen(name, char_mode)) == 0) |
100 return 0; | |
5269 | 101 |
102 // On success, allocate internal buffer and set flags | |
103 this->enable_buffer(); | |
104 io_mode = mode; | |
105 own_fd = true; | |
106 return this; | |
107 } | |
108 | |
109 // Attach to gzipped file | |
110 gzfilebuf* | |
111 gzfilebuf::attach(int fd, | |
112 std::ios_base::openmode mode) | |
113 { | |
114 // Fail if file already open | |
115 if (this->is_open()) | |
7520 | 116 return 0; |
5269 | 117 // Don't support simultaneous read/write access (yet) |
118 if ((mode & std::ios_base::in) && (mode & std::ios_base::out)) | |
7520 | 119 return 0; |
5269 | 120 |
121 // Build mode string for gzdopen and check it [27.8.1.3.2] | |
122 char char_mode[6] = "\0\0\0\0\0"; | |
123 if (!this->open_mode(mode, char_mode)) | |
7520 | 124 return 0; |
5269 | 125 |
126 // Attempt to attach to file | |
7520 | 127 if ((file = gzdopen(fd, char_mode)) == 0) |
128 return 0; | |
5269 | 129 |
130 // On success, allocate internal buffer and set flags | |
131 this->enable_buffer(); | |
132 io_mode = mode; | |
133 own_fd = false; | |
134 return this; | |
135 } | |
136 | |
137 // Close gzipped file | |
138 gzfilebuf* | |
139 gzfilebuf::close() | |
140 { | |
141 // Fail immediately if no file is open | |
142 if (!this->is_open()) | |
7520 | 143 return 0; |
5269 | 144 // Assume success |
145 gzfilebuf* retval = this; | |
146 // Attempt to sync and close gzipped file | |
147 if (this->sync() == -1) | |
7520 | 148 retval = 0; |
5269 | 149 if (gzclose(file) < 0) |
7520 | 150 retval = 0; |
5269 | 151 // File is now gone anyway (postcondition [27.8.1.3.8]) |
7520 | 152 file = 0; |
5269 | 153 own_fd = false; |
154 // Destroy internal buffer if it exists | |
155 this->disable_buffer(); | |
156 return retval; | |
157 } | |
158 | |
159 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
160 | |
161 // Convert int open mode to mode string | |
162 bool | |
163 gzfilebuf::open_mode(std::ios_base::openmode mode, | |
164 char* c_mode) const | |
165 { | |
6959 | 166 // FIXME -- do we need testb? |
167 // bool testb = mode & std::ios_base::binary; | |
5269 | 168 bool testi = mode & std::ios_base::in; |
169 bool testo = mode & std::ios_base::out; | |
170 bool testt = mode & std::ios_base::trunc; | |
171 bool testa = mode & std::ios_base::app; | |
172 | |
173 // Check for valid flag combinations - see [27.8.1.3.2] (Table 92) | |
174 // Original zfstream hardcoded the compression level to maximum here... | |
175 // Double the time for less than 1% size improvement seems | |
176 // excessive though - keeping it at the default level | |
177 // To change back, just append "9" to the next three mode strings | |
178 if (!testi && testo && !testt && !testa) | |
179 strcpy(c_mode, "w"); | |
180 if (!testi && testo && !testt && testa) | |
181 strcpy(c_mode, "a"); | |
182 if (!testi && testo && testt && !testa) | |
183 strcpy(c_mode, "w"); | |
184 if (testi && !testo && !testt && !testa) | |
185 strcpy(c_mode, "r"); | |
186 // No read/write mode yet | |
187 // if (testi && testo && !testt && !testa) | |
188 // strcpy(c_mode, "r+"); | |
189 // if (testi && testo && testt && !testa) | |
190 // strcpy(c_mode, "w+"); | |
191 | |
192 // Mode string should be empty for invalid combination of flags | |
193 if (strlen(c_mode) == 0) | |
194 return false; | |
6275 | 195 |
196 strcat(c_mode, "b"); | |
197 | |
5269 | 198 return true; |
199 } | |
200 | |
201 // Determine number of characters in internal get buffer | |
202 std::streamsize | |
203 gzfilebuf::showmanyc() | |
204 { | |
205 // Calls to underflow will fail if file not opened for reading | |
206 if (!this->is_open() || !(io_mode & std::ios_base::in)) | |
207 return -1; | |
208 // Make sure get area is in use | |
209 if (this->gptr() && (this->gptr() < this->egptr())) | |
210 return std::streamsize(this->egptr() - this->gptr()); | |
211 else | |
212 return 0; | |
213 } | |
214 | |
6777 | 215 // Puts back a character to the stream in two cases. Firstly, when there |
216 // is no putback position available, and secondly when the character putback | |
217 // differs from the one in the file. We can only support the first case | |
218 // with gzipped files. | |
219 gzfilebuf::int_type | |
220 gzfilebuf::pbackfail (gzfilebuf::int_type c) | |
221 { | |
222 if (this->is_open()) | |
223 { | |
224 if (gzseek (file, this->gptr() - this->egptr() - 1, SEEK_CUR) < 0) | |
225 return traits_type::eof(); | |
226 | |
227 // Invalidates contents of the buffer | |
228 enable_buffer (); | |
229 | |
230 // Attempt to fill internal buffer from gzipped file | |
231 // (buffer must be guaranteed to exist...) | |
232 int bytes_read = gzread(file, buffer, buffer_size); | |
233 // Indicates error or EOF | |
234 if (bytes_read <= 0) | |
235 { | |
236 // Reset get area | |
237 this->setg(buffer, buffer, buffer); | |
238 return traits_type::eof(); | |
239 } | |
240 | |
241 // Make all bytes read from file available as get area | |
242 this->setg(buffer, buffer, buffer + bytes_read); | |
243 | |
244 // If next character in get area differs from putback character | |
245 // flag a failure | |
246 gzfilebuf::int_type ret = traits_type::to_int_type(*(this->gptr())); | |
247 if (ret != c) | |
248 return traits_type::eof(); | |
249 else | |
250 return ret; | |
251 } | |
252 else | |
253 return traits_type::eof(); | |
254 } | |
255 | |
5269 | 256 // Fill get area from gzipped file |
257 gzfilebuf::int_type | |
258 gzfilebuf::underflow() | |
259 { | |
260 // If something is left in the get area by chance, return it | |
261 // (this shouldn't normally happen, as underflow is only supposed | |
262 // to be called when gptr >= egptr, but it serves as error check) | |
263 if (this->gptr() && (this->gptr() < this->egptr())) | |
264 return traits_type::to_int_type(*(this->gptr())); | |
265 | |
266 // If the file hasn't been opened for reading, produce error | |
267 if (!this->is_open() || !(io_mode & std::ios_base::in)) | |
268 return traits_type::eof(); | |
269 | |
6783 | 270 // Copy the final characters to the front of the buffer |
271 int stash = 0; | |
272 if (this->eback() && buffer && buffer_size > STASHED_CHARACTERS) | |
273 { | |
274 char_type *ptr1 = buffer; | |
275 char_type *ptr2 = this->egptr() - STASHED_CHARACTERS + 1; | |
276 if (ptr2 > this->eback()) | |
277 while (stash++ <= STASHED_CHARACTERS) | |
278 *ptr1++ = *ptr2++; | |
279 } | |
280 | |
5269 | 281 // Attempt to fill internal buffer from gzipped file |
282 // (buffer must be guaranteed to exist...) | |
6783 | 283 int bytes_read = gzread(file, buffer + stash, buffer_size - stash); |
284 | |
5269 | 285 // Indicates error or EOF |
286 if (bytes_read <= 0) | |
287 { | |
288 // Reset get area | |
289 this->setg(buffer, buffer, buffer); | |
290 return traits_type::eof(); | |
291 } | |
6783 | 292 // Make all bytes read from file plus the stash available as get area |
293 this->setg(buffer, buffer + stash, buffer + bytes_read + stash); | |
5269 | 294 |
295 // Return next character in get area | |
296 return traits_type::to_int_type(*(this->gptr())); | |
297 } | |
298 | |
299 // Write put area to gzipped file | |
300 gzfilebuf::int_type | |
301 gzfilebuf::overflow(int_type c) | |
302 { | |
303 // Determine whether put area is in use | |
304 if (this->pbase()) | |
305 { | |
306 // Double-check pointer range | |
307 if (this->pptr() > this->epptr() || this->pptr() < this->pbase()) | |
308 return traits_type::eof(); | |
309 // Add extra character to buffer if not EOF | |
310 if (!traits_type::eq_int_type(c, traits_type::eof())) | |
311 { | |
312 *(this->pptr()) = traits_type::to_char_type(c); | |
313 this->pbump(1); | |
314 } | |
315 // Number of characters to write to file | |
316 int bytes_to_write = this->pptr() - this->pbase(); | |
317 // Overflow doesn't fail if nothing is to be written | |
318 if (bytes_to_write > 0) | |
319 { | |
320 // If the file hasn't been opened for writing, produce error | |
321 if (!this->is_open() || !(io_mode & std::ios_base::out)) | |
322 return traits_type::eof(); | |
323 // If gzipped file won't accept all bytes written to it, fail | |
324 if (gzwrite(file, this->pbase(), bytes_to_write) != bytes_to_write) | |
325 return traits_type::eof(); | |
326 // Reset next pointer to point to pbase on success | |
327 this->pbump(-bytes_to_write); | |
328 } | |
329 } | |
330 // Write extra character to file if not EOF | |
331 else if (!traits_type::eq_int_type(c, traits_type::eof())) | |
332 { | |
333 // If the file hasn't been opened for writing, produce error | |
334 if (!this->is_open() || !(io_mode & std::ios_base::out)) | |
335 return traits_type::eof(); | |
336 // Impromptu char buffer (allows "unbuffered" output) | |
337 char_type last_char = traits_type::to_char_type(c); | |
338 // If gzipped file won't accept this character, fail | |
339 if (gzwrite(file, &last_char, 1) != 1) | |
340 return traits_type::eof(); | |
341 } | |
342 | |
343 // If you got here, you have succeeded (even if c was EOF) | |
344 // The return value should therefore be non-EOF | |
345 if (traits_type::eq_int_type(c, traits_type::eof())) | |
346 return traits_type::not_eof(c); | |
347 else | |
348 return c; | |
349 } | |
350 | |
351 // Assign new buffer | |
352 std::streambuf* | |
353 gzfilebuf::setbuf(char_type* p, | |
354 std::streamsize n) | |
355 { | |
356 // First make sure stuff is sync'ed, for safety | |
357 if (this->sync() == -1) | |
7520 | 358 return 0; |
5269 | 359 // If buffering is turned off on purpose via setbuf(0,0), still allocate one... |
360 // "Unbuffered" only really refers to put [27.8.1.4.10], while get needs at | |
361 // least a buffer of size 1 (very inefficient though, therefore make it bigger?) | |
362 // This follows from [27.5.2.4.3]/12 (gptr needs to point at something, it seems) | |
363 if (!p || !n) | |
364 { | |
365 // Replace existing buffer (if any) with small internal buffer | |
366 this->disable_buffer(); | |
7520 | 367 buffer = 0; |
5269 | 368 buffer_size = 0; |
369 own_buffer = true; | |
370 this->enable_buffer(); | |
371 } | |
372 else | |
373 { | |
374 // Replace existing buffer (if any) with external buffer | |
375 this->disable_buffer(); | |
376 buffer = p; | |
377 buffer_size = n; | |
378 own_buffer = false; | |
379 this->enable_buffer(); | |
380 } | |
381 return this; | |
382 } | |
383 | |
384 // Write put area to gzipped file (i.e. ensures that put area is empty) | |
385 int | |
386 gzfilebuf::sync() | |
387 { | |
388 return traits_type::eq_int_type(this->overflow(), traits_type::eof()) ? -1 : 0; | |
389 } | |
390 | |
391 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
392 | |
393 // Allocate internal buffer | |
394 void | |
395 gzfilebuf::enable_buffer() | |
396 { | |
397 // If internal buffer required, allocate one | |
398 if (own_buffer && !buffer) | |
399 { | |
400 // Check for buffered vs. "unbuffered" | |
401 if (buffer_size > 0) | |
402 { | |
403 // Allocate internal buffer | |
404 buffer = new char_type[buffer_size]; | |
405 // Get area starts empty and will be expanded by underflow as need arises | |
406 this->setg(buffer, buffer, buffer); | |
407 // Setup entire internal buffer as put area. | |
408 // The one-past-end pointer actually points to the last element of the buffer, | |
409 // so that overflow(c) can safely add the extra character c to the sequence. | |
410 // These pointers remain in place for the duration of the buffer | |
411 this->setp(buffer, buffer + buffer_size - 1); | |
412 } | |
413 else | |
414 { | |
415 // Even in "unbuffered" case, (small?) get buffer is still required | |
416 buffer_size = SMALLBUFSIZE; | |
417 buffer = new char_type[buffer_size]; | |
418 this->setg(buffer, buffer, buffer); | |
419 // "Unbuffered" means no put buffer | |
420 this->setp(0, 0); | |
421 } | |
422 } | |
423 else | |
424 { | |
425 // If buffer already allocated, reset buffer pointers just to make sure no | |
426 // stale chars are lying around | |
427 this->setg(buffer, buffer, buffer); | |
428 this->setp(buffer, buffer + buffer_size - 1); | |
429 } | |
430 } | |
431 | |
432 // Destroy internal buffer | |
433 void | |
434 gzfilebuf::disable_buffer() | |
435 { | |
436 // If internal buffer exists, deallocate it | |
437 if (own_buffer && buffer) | |
438 { | |
439 // Preserve unbuffered status by zeroing size | |
440 if (!this->pbase()) | |
441 buffer_size = 0; | |
442 delete[] buffer; | |
7520 | 443 buffer = 0; |
5269 | 444 this->setg(0, 0, 0); |
445 this->setp(0, 0); | |
446 } | |
447 else | |
448 { | |
449 // Reset buffer pointers to initial state if external buffer exists | |
450 this->setg(buffer, buffer, buffer); | |
451 if (buffer) | |
452 this->setp(buffer, buffer + buffer_size - 1); | |
453 else | |
454 this->setp(0, 0); | |
455 } | |
456 } | |
457 | |
458 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
459 | |
460 // Seek functions | |
461 gzfilebuf::pos_type | |
462 gzfilebuf::seekoff(off_type off, std::ios_base::seekdir way, | |
463 std::ios_base::openmode) | |
464 { | |
465 pos_type ret = pos_type (off_type (-1)); | |
466 | |
467 if (this->is_open()) | |
468 { | |
469 off_type computed_off = off; | |
470 | |
471 if ((io_mode & std::ios_base::in) && way == std::ios_base::cur) | |
472 computed_off += this->gptr() - this->egptr(); | |
473 | |
474 if (way == std::ios_base::beg) | |
475 ret = pos_type (gzseek (file, computed_off, SEEK_SET)); | |
476 else if (way == std::ios_base::cur) | |
477 ret = pos_type (gzseek (file, computed_off, SEEK_CUR)); | |
478 else | |
479 // Can't seek from end of a gzipped file, so this will give -1 | |
480 ret = pos_type (gzseek (file, computed_off, SEEK_END)); | |
481 | |
482 if (io_mode & std::ios_base::in) | |
483 // Invalidates contents of the buffer | |
484 enable_buffer (); | |
485 else | |
486 // flush contents of buffer to file | |
487 overflow (); | |
488 } | |
489 | |
490 return ret; | |
491 } | |
492 | |
493 gzfilebuf::pos_type | |
494 gzfilebuf::seekpos(pos_type sp, std::ios_base::openmode) | |
495 { | |
496 pos_type ret = pos_type (off_type (-1)); | |
497 | |
498 if (this->is_open ()) | |
499 { | |
500 ret = pos_type (gzseek (file, sp, SEEK_SET)); | |
501 | |
502 if (io_mode & std::ios_base::in) | |
503 // Invalidates contents of the buffer | |
504 enable_buffer (); | |
505 else | |
506 // flush contents of buffer to file | |
507 overflow (); | |
508 } | |
509 | |
510 return ret; | |
511 } | |
512 | |
513 /*****************************************************************************/ | |
514 | |
515 // Default constructor initializes stream buffer | |
516 gzifstream::gzifstream() | |
7520 | 517 : std::istream(0), sb() |
5269 | 518 { this->init(&sb); } |
519 | |
520 // Initialize stream buffer and open file | |
521 gzifstream::gzifstream(const char* name, | |
522 std::ios_base::openmode mode) | |
7520 | 523 : std::istream(0), sb() |
5269 | 524 { |
525 this->init(&sb); | |
526 this->open(name, mode); | |
527 } | |
528 | |
529 // Initialize stream buffer and attach to file | |
530 gzifstream::gzifstream(int fd, | |
531 std::ios_base::openmode mode) | |
7520 | 532 : std::istream(0), sb() |
5269 | 533 { |
534 this->init(&sb); | |
535 this->attach(fd, mode); | |
536 } | |
537 | |
538 // Open file and go into fail() state if unsuccessful | |
539 void | |
540 gzifstream::open(const char* name, | |
541 std::ios_base::openmode mode) | |
542 { | |
543 if (!sb.open(name, mode | std::ios_base::in)) | |
544 this->setstate(std::ios_base::failbit); | |
545 else | |
546 this->clear(); | |
547 } | |
548 | |
549 // Attach to file and go into fail() state if unsuccessful | |
550 void | |
551 gzifstream::attach(int fd, | |
552 std::ios_base::openmode mode) | |
553 { | |
554 if (!sb.attach(fd, mode | std::ios_base::in)) | |
555 this->setstate(std::ios_base::failbit); | |
556 else | |
557 this->clear(); | |
558 } | |
559 | |
560 // Close file | |
561 void | |
562 gzifstream::close() | |
563 { | |
564 if (!sb.close()) | |
565 this->setstate(std::ios_base::failbit); | |
566 } | |
567 | |
568 /*****************************************************************************/ | |
569 | |
570 // Default constructor initializes stream buffer | |
571 gzofstream::gzofstream() | |
7520 | 572 : std::ostream(0), sb() |
5269 | 573 { this->init(&sb); } |
574 | |
575 // Initialize stream buffer and open file | |
576 gzofstream::gzofstream(const char* name, | |
577 std::ios_base::openmode mode) | |
7520 | 578 : std::ostream(0), sb() |
5269 | 579 { |
580 this->init(&sb); | |
581 this->open(name, mode); | |
582 } | |
583 | |
584 // Initialize stream buffer and attach to file | |
585 gzofstream::gzofstream(int fd, | |
586 std::ios_base::openmode mode) | |
7520 | 587 : std::ostream(0), sb() |
5269 | 588 { |
589 this->init(&sb); | |
590 this->attach(fd, mode); | |
591 } | |
592 | |
593 // Open file and go into fail() state if unsuccessful | |
594 void | |
595 gzofstream::open(const char* name, | |
596 std::ios_base::openmode mode) | |
597 { | |
598 if (!sb.open(name, mode | std::ios_base::out)) | |
599 this->setstate(std::ios_base::failbit); | |
600 else | |
601 this->clear(); | |
602 } | |
603 | |
604 // Attach to file and go into fail() state if unsuccessful | |
605 void | |
606 gzofstream::attach(int fd, | |
607 std::ios_base::openmode mode) | |
608 { | |
609 if (!sb.attach(fd, mode | std::ios_base::out)) | |
610 this->setstate(std::ios_base::failbit); | |
611 else | |
612 this->clear(); | |
613 } | |
614 | |
615 // Close file | |
616 void | |
617 gzofstream::close() | |
618 { | |
619 if (!sb.close()) | |
620 this->setstate(std::ios_base::failbit); | |
621 } | |
622 | |
623 #endif // HAVE_ZLIB | |
624 | |
625 /* | |
626 ;;; Local Variables: *** | |
627 ;;; mode: C++ *** | |
628 ;;; End: *** | |
629 */ |