📄 apr__file__io_8h-source.html
字号:
00465 <span class="comment">/**</span>
00466 <span class="comment"> * Put a character back onto a specified stream.</span>
00467 <span class="comment"> * @param ch The character to write.</span>
00468 <span class="comment"> * @param thefile The file descriptor to write to</span>
00469 <span class="comment"> */</span>
00470 APR_DECLARE(apr_status_t) apr_file_ungetc(<span class="keywordtype">char</span> ch, apr_file_t *thefile);
00471 <span class="comment"></span>
00472 <span class="comment">/**</span>
00473 <span class="comment"> * Read a string from the specified file.</span>
00474 <span class="comment"> * @param str The buffer to store the string in. </span>
00475 <span class="comment"> * @param len The length of the string</span>
00476 <span class="comment"> * @param thefile The file descriptor to read from</span>
00477 <span class="comment"> * @remark The buffer will be NUL-terminated if any characters are stored.</span>
00478 <span class="comment"> */</span>
00479 APR_DECLARE(apr_status_t) apr_file_gets(<span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> len,
00480 apr_file_t *thefile);
00481 <span class="comment"></span>
00482 <span class="comment">/**</span>
00483 <span class="comment"> * Write the string into the specified file.</span>
00484 <span class="comment"> * @param str The string to write. </span>
00485 <span class="comment"> * @param thefile The file descriptor to write to</span>
00486 <span class="comment"> */</span>
00487 APR_DECLARE(apr_status_t) apr_file_puts(const <span class="keywordtype">char</span> *str, apr_file_t *thefile);
00488 <span class="comment"></span>
00489 <span class="comment">/**</span>
00490 <span class="comment"> * Flush the file's buffer.</span>
00491 <span class="comment"> * @param thefile The file descriptor to flush</span>
00492 <span class="comment"> */</span>
00493 APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile);
00494 <span class="comment"></span>
00495 <span class="comment">/**</span>
00496 <span class="comment"> * Duplicate the specified file descriptor.</span>
00497 <span class="comment"> * @param new_file The structure to duplicate into. </span>
00498 <span class="comment"> * @param old_file The file to duplicate.</span>
00499 <span class="comment"> * @param p The pool to use for the new file.</span>
00500 <span class="comment"> * @remark *new_file must point to a valid apr_file_t, or point to NULL.</span>
00501 <span class="comment"> */</span>
00502 APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file,
00503 apr_file_t *old_file,
00504 apr_pool_t *p);
00505 <span class="comment"></span>
00506 <span class="comment">/**</span>
00507 <span class="comment"> * Duplicate the specified file descriptor and close the original</span>
00508 <span class="comment"> * @param new_file The old file that is to be closed and reused</span>
00509 <span class="comment"> * @param old_file The file to duplicate</span>
00510 <span class="comment"> * @param p The pool to use for the new file</span>
00511 <span class="comment"> *</span>
00512 <span class="comment"> * @remark new_file MUST point at a valid apr_file_t. It cannot be NULL.</span>
00513 <span class="comment"> */</span>
00514 APR_DECLARE(apr_status_t) apr_file_dup2(apr_file_t *new_file,
00515 apr_file_t *old_file,
00516 apr_pool_t *p);
00517 <span class="comment"></span>
00518 <span class="comment">/**</span>
00519 <span class="comment"> * Move the specified file descriptor to a new pool</span>
00520 <span class="comment"> * @param new_file Pointer in which to return the new apr_file_t</span>
00521 <span class="comment"> * @param old_file The file to move</span>
00522 <span class="comment"> * @param p The pool to which the descriptor is to be moved</span>
00523 <span class="comment"> * @remark Unlike apr_file_dup2(), this function doesn't do an</span>
00524 <span class="comment"> * OS dup() operation on the underlying descriptor; it just</span>
00525 <span class="comment"> * moves the descriptor's apr_file_t wrapper to a new pool.</span>
00526 <span class="comment"> * @remark The new pool need not be an ancestor of old_file's pool.</span>
00527 <span class="comment"> * @remark After calling this function, old_file may not be used</span>
00528 <span class="comment"> */</span>
00529 APR_DECLARE(apr_status_t) apr_file_setaside(apr_file_t **new_file,
00530 apr_file_t *old_file,
00531 apr_pool_t *p);
00532 <span class="comment"></span>
00533 <span class="comment">/**</span>
00534 <span class="comment"> * Move the read/write file offset to a specified byte within a file.</span>
00535 <span class="comment"> * @param thefile The file descriptor</span>
00536 <span class="comment"> * @param where How to move the pointer, one of:</span>
00537 <span class="comment"> * <PRE></span>
00538 <span class="comment"> * APR_SET -- set the offset to offset</span>
00539 <span class="comment"> * APR_CUR -- add the offset to the current position </span>
00540 <span class="comment"> * APR_END -- add the offset to the current file size </span>
00541 <span class="comment"> * </PRE></span>
00542 <span class="comment"> * @param offset The offset to move the pointer to.</span>
00543 <span class="comment"> * @remark The third argument is modified to be the offset the pointer</span>
00544 <span class="comment"> was actually moved to.</span>
00545 <span class="comment"> */</span>
00546 APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile,
00547 apr_seek_where_t where,
00548 apr_off_t *offset);
00549 <span class="comment"></span>
00550 <span class="comment">/**</span>
00551 <span class="comment"> * Create an anonymous pipe.</span>
00552 <span class="comment"> * @param in The file descriptor to use as input to the pipe.</span>
00553 <span class="comment"> * @param out The file descriptor to use as output from the pipe.</span>
00554 <span class="comment"> * @param pool The pool to operate on.</span>
00555 <span class="comment"> */</span>
00556 APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in,
00557 apr_file_t **out,
00558 apr_pool_t *pool);
00559 <span class="comment"></span>
00560 <span class="comment">/**</span>
00561 <span class="comment"> * Create a named pipe.</span>
00562 <span class="comment"> * @param filename The filename of the named pipe</span>
00563 <span class="comment"> * @param perm The permissions for the newly created pipe.</span>
00564 <span class="comment"> * @param pool The pool to operate on.</span>
00565 <span class="comment"> */</span>
00566 APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const <span class="keywordtype">char</span> *filename,
00567 apr_fileperms_t perm,
00568 apr_pool_t *pool);
00569 <span class="comment"></span>
00570 <span class="comment">/**</span>
00571 <span class="comment"> * Get the timeout value for a pipe or manipulate the blocking state.</span>
00572 <span class="comment"> * @param thepipe The pipe we are getting a timeout for.</span>
00573 <span class="comment"> * @param timeout The current timeout value in microseconds. </span>
00574 <span class="comment"> */</span>
00575 APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe,
00576 <a class="code" href="group__apr__time.html#ga3">apr_interval_time_t</a> *timeout);
00577 <span class="comment"></span>
00578 <span class="comment">/**</span>
00579 <span class="comment"> * Set the timeout value for a pipe or manipulate the blocking state.</span>
00580 <span class="comment"> * @param thepipe The pipe we are setting a timeout on.</span>
00581 <span class="comment"> * @param timeout The timeout value in microseconds. Values < 0 mean wait </span>
00582 <span class="comment"> * forever, 0 means do not wait at all.</span>
00583 <span class="comment"> */</span>
00584 APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe,
00585 apr_interval_time_t timeout);
00586 <span class="comment"></span>
00587 <span class="comment">/** file (un)locking functions. */</span>
00588 <span class="comment"></span>
00589 <span class="comment">/**</span>
00590 <span class="comment"> * Establish a lock on the specified, open file. The lock may be advisory</span>
00591 <span class="comment"> * or mandatory, at the discretion of the platform. The lock applies to</span>
00592 <span class="comment"> * the file as a whole, rather than a specific range. Locks are established</span>
00593 <span class="comment"> * on a per-thread/process basis; a second lock by the same thread will not</span>
00594 <span class="comment"> * block.</span>
00595 <span class="comment"> * @param thefile The file to lock.</span>
00596 <span class="comment"> * @param type The type of lock to establish on the file.</span>
00597 <span class="comment"> */</span>
00598 APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, <span class="keywordtype">int</span> type);
00599 <span class="comment"></span>
00600 <span class="comment">/**</span>
00601 <span class="comment"> * Remove any outstanding locks on the file.</span>
00602 <span class="comment"> * @param thefile The file to unlock.</span>
00603 <span class="comment"> */</span>
00604 APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile);
00605 <span class="comment"></span>
00606 <span class="comment">/**accessor and general file_io functions. */</span>
00607 <span class="comment"></span>
00608 <span class="comment">/**</span>
00609 <span class="comment"> * return the file name of the current file.</span>
00610 <span class="comment"> * @param new_path The path of the file. </span>
00611 <span class="comment"> * @param thefile The currently open file.</span>
00612 <span class="comment"> */</span>
00613 APR_DECLARE(apr_status_t) apr_file_name_get(const <span class="keywordtype">char</span> **new_path,
00614 apr_file_t *thefile);
00615 <span class="comment"></span>
00616 <span class="comment">/**</span>
00617 <span class="comment"> * Return the data associated with the current file.</span>
00618 <span class="comment"> * @param data The user data associated with the file. </span>
00619 <span class="comment"> * @param key The key to use for retreiving data associated with this file.</span>
00620 <span class="comment"> * @param file The currently open file.</span>
00621 <span class="comment"> */</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -