apr_brigade_puts

「apr_brigade_puts」の編集履歴(バックアップ)一覧はこちら

apr_brigade_puts」(2009/01/05 (月) 22:40:57) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

srclib/apr-util/include/apr_buckets.h /** * This function writes a string into a bucket brigade. * @param bb The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str); APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str) { apr_size_t len = strlen(str); apr_bucket *bkt = APR_BRIGADE_LAST(bb); if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) { /* If there is enough space available in a heap bucket * at the end of the brigade, copy the string directly * into the heap bucket */ apr_bucket_heap *h = bkt->data; apr_size_t bytes_avail = h->alloc_len - bkt->length; if (bytes_avail >= len) { char *buf = h->base + bkt->start + bkt->length; memcpy(buf, str, len); bkt->length += len; return APR_SUCCESS; } } /* If the string could not be copied into an existing heap * bucket, delegate the work to apr_brigade_write(), which * knows how to grow the brigade */ return apr_brigade_write(bb, flush, ctx, str, len); }
srclib/apr-util/include/apr_buckets.h /** * This function writes a string into a bucket brigade. * @param bb The bucket brigade to add to * @param flush The flush function to use if the brigade is full * @param ctx The structure to pass to the flush function * @param str The string to add * @return APR_SUCCESS or error code */ APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str); srclib/apr-util/buckets/apr_brigade.c APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str) { apr_size_t len = strlen(str); apr_bucket *bkt = APR_BRIGADE_LAST(bb); if (!APR_BRIGADE_EMPTY(bb) && APR_BUCKET_IS_HEAP(bkt)) { /* If there is enough space available in a heap bucket * at the end of the brigade, copy the string directly * into the heap bucket */ apr_bucket_heap *h = bkt->data; apr_size_t bytes_avail = h->alloc_len - bkt->length; if (bytes_avail >= len) { char *buf = h->base + bkt->start + bkt->length; memcpy(buf, str, len); bkt->length += len; return APR_SUCCESS; } } /* If the string could not be copied into an existing heap * bucket, delegate the work to apr_brigade_write(), which * knows how to grow the brigade */ return apr_brigade_write(bb, flush, ctx, str, len); }

表示オプション

横に並べて表示:
変化行の前後のみ表示: