On 4/3/20 6:39 PM, Yann Ylavic wrote:
> On Thu, Apr 2, 2020 at 11:28 AM Ruediger Pluem <rpl...@apache.org> wrote:
>>
>> So how about
>>
>> #define AP_BUCKET_HAS_UNKNOWN_LENGTH(e) ((e)->length == (apr_size_t)-1)
>
> Still quite mouthful..
>
> What about? :
> /**
> * Determine if a bucket is opaque, i.e. of unknown data length and type
> * @param e The bucket to inspect
> * @return true or false
> */
> #define AP_BUCKET_IS_OPAQUE(e) ((e)->length == (apr_size_t)-1)
>
> Unlike FILE buckets with struct apr_bucket_file where we can get the
> ->fd, PIPE and SOCKET buckets don't expose their data type in the API,
> relying on (apr_{file,socket}_t *)e->data is not really API/ABI safe
> (though APR is unlikely to change that). I mean, while buckets are
> generally quite opaque and should be manipulated with the API methods,
> these "->length == -1" once are particularly opaque :)
I am undecided. I am not entirely convinced that it is a good name although all
you said above is true, but on the other hand it
is not that bad that I see a need to spend a lot of further time on this name
searching topic :-). So +0.
What do others think about the name?
Regards
RĂ¼diger