Re: librados api cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 18, 2011 at 02:49:37PM -0800, Colin McCabe wrote:
> > const char *rados_conf_get(rados_t cluster, const char *option);
> 
> I would prefer something like
> int rados_conf_get(rados_t cluster, const char *option, char **buf, int len);
> 
> We have a lot of configuration options that are ints and floats. You
> can't really return a const char* pointer to an int-- you need to make
> a temporary string somewhere, and that won't be const...

The usual idiom is to have a low-level "raw" string getter, then build
rados_conf_get_uint32, rados_conf_get_bool (e.g. understands
"yes"/"true" and "no"/"false") etc on top of that.

-- 
:(){ :|:&};:
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux