⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apr__file__io_8h-source.html

📁 apr函数库使用手册
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00308 <span class="comment"> * open standard output as an apr file pointer.</span>
00309 <span class="comment"> * @param thefile The apr file to use as stdout.</span>
00310 <span class="comment"> * @param pool The pool to allocate the file out of.</span>
00311 <span class="comment"> * </span>
00312 <span class="comment"> * @remark See remarks for apr_file_open_stdout.</span>
00313 <span class="comment"> */</span>
00314 APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
00315                                                apr_pool_t *pool);
00316 <span class="comment"></span>
00317 <span class="comment">/**</span>
00318 <span class="comment"> * open standard input as an apr file pointer.</span>
00319 <span class="comment"> * @param thefile The apr file to use as stdin.</span>
00320 <span class="comment"> * @param pool The pool to allocate the file out of.</span>
00321 <span class="comment"> * </span>
00322 <span class="comment"> * @remark See remarks for apr_file_open_stdout.</span>
00323 <span class="comment"> */</span>
00324 APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
00325                                               apr_pool_t *pool);
00326 <span class="comment"></span>
00327 <span class="comment">/**</span>
00328 <span class="comment"> * Read data from the specified file.</span>
00329 <span class="comment"> * @param thefile The file descriptor to read from.</span>
00330 <span class="comment"> * @param buf The buffer to store the data to.</span>
00331 <span class="comment"> * @param nbytes On entry, the number of bytes to read; on exit, the number</span>
00332 <span class="comment"> * of bytes read.</span>
00333 <span class="comment"> *</span>
00334 <span class="comment"> * @remark apr_file_read will read up to the specified number of</span>
00335 <span class="comment"> * bytes, but never more.  If there isn't enough data to fill that</span>
00336 <span class="comment"> * number of bytes, all of the available data is read.  The third</span>
00337 <span class="comment"> * argument is modified to reflect the number of bytes read.  If a</span>
00338 <span class="comment"> * char was put back into the stream via ungetc, it will be the first</span>
00339 <span class="comment"> * character returned.</span>
00340 <span class="comment"> *</span>
00341 <span class="comment"> * @remark It is not possible for both bytes to be read and an APR_EOF</span>
00342 <span class="comment"> * or other error to be returned.  APR_EINTR is never returned.</span>
00343 <span class="comment"> */</span>
00344 APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, <span class="keywordtype">void</span> *buf,
00345                                         apr_size_t *nbytes);
00346 <span class="comment"></span>
00347 <span class="comment">/**</span>
00348 <span class="comment"> * Write data to the specified file.</span>
00349 <span class="comment"> * @param thefile The file descriptor to write to.</span>
00350 <span class="comment"> * @param buf The buffer which contains the data.</span>
00351 <span class="comment"> * @param nbytes On entry, the number of bytes to write; on exit, the number </span>
00352 <span class="comment"> *               of bytes written.</span>
00353 <span class="comment"> *</span>
00354 <span class="comment"> * @remark apr_file_write will write up to the specified number of</span>
00355 <span class="comment"> * bytes, but never more.  If the OS cannot write that many bytes, it</span>
00356 <span class="comment"> * will write as many as it can.  The third argument is modified to</span>
00357 <span class="comment"> * reflect the * number of bytes written.</span>
00358 <span class="comment"> *</span>
00359 <span class="comment"> * @remark It is possible for both bytes to be written and an error to</span>
00360 <span class="comment"> * be returned.  APR_EINTR is never returned.</span>
00361 <span class="comment"> */</span>
00362 APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const <span class="keywordtype">void</span> *buf,
00363                                          apr_size_t *nbytes);
00364 <span class="comment"></span>
00365 <span class="comment">/**</span>
00366 <span class="comment"> * Write data from iovec array to the specified file.</span>
00367 <span class="comment"> * @param thefile The file descriptor to write to.</span>
00368 <span class="comment"> * @param vec The array from which to get the data to write to the file.</span>
00369 <span class="comment"> * @param nvec The number of elements in the struct iovec array. This must </span>
00370 <span class="comment"> *             be smaller than APR_MAX_IOVEC_SIZE.  If it isn't, the function </span>
00371 <span class="comment"> *             will fail with APR_EINVAL.</span>
00372 <span class="comment"> * @param nbytes The number of bytes written.</span>
00373 <span class="comment"> *</span>
00374 <span class="comment"> * @remark It is possible for both bytes to be written and an error to</span>
00375 <span class="comment"> * be returned.  APR_EINTR is never returned.</span>
00376 <span class="comment"> *</span>
00377 <span class="comment"> * @remark apr_file_writev is available even if the underlying</span>
00378 <span class="comment"> * operating system doesn't provide writev().</span>
00379 <span class="comment"> */</span>
00380 APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile,
00381                                           const struct iovec *vec,
00382                                           apr_size_t nvec, apr_size_t *nbytes);
00383 <span class="comment"></span>
00384 <span class="comment">/**</span>
00385 <span class="comment"> * Read data from the specified file, ensuring that the buffer is filled</span>
00386 <span class="comment"> * before returning.</span>
00387 <span class="comment"> * @param thefile The file descriptor to read from.</span>
00388 <span class="comment"> * @param buf The buffer to store the data to.</span>
00389 <span class="comment"> * @param nbytes The number of bytes to read.</span>
00390 <span class="comment"> * @param bytes_read If non-NULL, this will contain the number of bytes read.</span>
00391 <span class="comment"> *</span>
00392 <span class="comment"> * @remark apr_file_read will read up to the specified number of</span>
00393 <span class="comment"> * bytes, but never more.  If there isn't enough data to fill that</span>
00394 <span class="comment"> * number of bytes, then the process/thread will block until it is</span>
00395 <span class="comment"> * available or EOF is reached.  If a char was put back into the</span>
00396 <span class="comment"> * stream via ungetc, it will be the first character returned.</span>
00397 <span class="comment"> *</span>
00398 <span class="comment"> * @remark It is possible for both bytes to be read and an error to be</span>
00399 <span class="comment"> * returned.  And if *bytes_read is less than nbytes, an accompanying</span>
00400 <span class="comment"> * error is _always_ returned.</span>
00401 <span class="comment"> *</span>
00402 <span class="comment"> * @remark APR_EINTR is never returned.</span>
00403 <span class="comment"> */</span>
00404 APR_DECLARE(apr_status_t) apr_file_read_full(apr_file_t *thefile, <span class="keywordtype">void</span> *buf,
00405                                              apr_size_t nbytes,
00406                                              apr_size_t *bytes_read);
00407 <span class="comment"></span>
00408 <span class="comment">/**</span>
00409 <span class="comment"> * Write data to the specified file, ensuring that all of the data is</span>
00410 <span class="comment"> * written before returning.</span>
00411 <span class="comment"> * @param thefile The file descriptor to write to.</span>
00412 <span class="comment"> * @param buf The buffer which contains the data.</span>
00413 <span class="comment"> * @param nbytes The number of bytes to write.</span>
00414 <span class="comment"> * @param bytes_written If non-NULL, set to the number of bytes written.</span>
00415 <span class="comment"> * </span>
00416 <span class="comment"> * @remark apr_file_write will write up to the specified number of</span>
00417 <span class="comment"> * bytes, but never more.  If the OS cannot write that many bytes, the</span>
00418 <span class="comment"> * process/thread will block until they can be written. Exceptional</span>
00419 <span class="comment"> * error such as "out of space" or "pipe closed" will terminate with</span>
00420 <span class="comment"> * an error.</span>
00421 <span class="comment"> *</span>
00422 <span class="comment"> * @remark It is possible for both bytes to be written and an error to</span>
00423 <span class="comment"> * be returned.  And if *bytes_written is less than nbytes, an</span>
00424 <span class="comment"> * accompanying error is _always_ returned.</span>
00425 <span class="comment"> *</span>
00426 <span class="comment"> * @remark APR_EINTR is never returned.</span>
00427 <span class="comment"> */</span>
00428 APR_DECLARE(apr_status_t) apr_file_write_full(apr_file_t *thefile, 
00429                                               const <span class="keywordtype">void</span> *buf,
00430                                               apr_size_t nbytes, 
00431                                               apr_size_t *bytes_written);
00432 
00433 <span class="comment"></span>
00434 <span class="comment">/**</span>
00435 <span class="comment"> * Write data from iovec array to the specified file, ensuring that all of the</span>
00436 <span class="comment"> * data is written before returning.</span>
00437 <span class="comment"> * @param thefile The file descriptor to write to.</span>
00438 <span class="comment"> * @param vec The array from which to get the data to write to the file.</span>
00439 <span class="comment"> * @param nvec The number of elements in the struct iovec array. This must </span>
00440 <span class="comment"> *             be smaller than APR_MAX_IOVEC_SIZE.  If it isn't, the function </span>
00441 <span class="comment"> *             will fail with APR_EINVAL.</span>
00442 <span class="comment"> * @param nbytes The number of bytes written.</span>
00443 <span class="comment"> *</span>
00444 <span class="comment"> * @remark apr_file_writev_full is available even if the underlying</span>
00445 <span class="comment"> * operating system doesn't provide writev().</span>
00446 <span class="comment"> */</span>
00447 APR_DECLARE(apr_status_t) apr_file_writev_full(apr_file_t *thefile,
00448                                                const struct iovec *vec,
00449                                                apr_size_t nvec,
00450                                                apr_size_t *nbytes);<span class="comment"></span>
00451 <span class="comment">/**</span>
00452 <span class="comment"> * Write a character into the specified file.</span>
00453 <span class="comment"> * @param ch The character to write.</span>
00454 <span class="comment"> * @param thefile The file descriptor to write to</span>
00455 <span class="comment"> */</span>
00456 APR_DECLARE(apr_status_t) apr_file_putc(<span class="keywordtype">char</span> ch, apr_file_t *thefile);
00457 <span class="comment"></span>
00458 <span class="comment">/**</span>
00459 <span class="comment"> * Read a character from the specified file.</span>
00460 <span class="comment"> * @param ch The character to read into</span>
00461 <span class="comment"> * @param thefile The file descriptor to read from</span>
00462 <span class="comment"> */</span>
00463 APR_DECLARE(apr_status_t) apr_file_getc(<span class="keywordtype">char</span> *ch, apr_file_t *thefile);
00464 <span class="comment"></span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -