zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohammad Shamma <mohammadsha...@gmail.com>
Subject Re: C API question
Date Wed, 31 Jul 2013 04:55:04 GMT
I think the const in this case would cause the pointer to be fixed. The
data referred to by the pointer can still be updated.

This is a similar question on stackoverflow:

On Tue, Jul 30, 2013 at 7:06 PM, Marios Hadjieleftheriou

> The string_completiion_t callback signature of the Zookeeper C API is:
> typedef void(* string_completion_t)(int rc, const char *value, const void
> *data)
> That means that when the callback is called, the user provided data is
> returned as a const void and cannot be modified by client code, which
> kind of defeats the purpose of passing any data in the first place.
> Is there any reason why this parameter needs to be const?

Mohammad Shamma

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message