Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support 64-bit integer and/or unsigned 32-bit integer configuration types #11

Open
cmcqueen opened this issue Jun 30, 2014 · 10 comments
Open

Comments

@cmcqueen
Copy link
Contributor

It seems that on 32-bit *nix OS, the CFG_INT config type is signed 32-bit. I've got a config type that needs to be 64-bit. I've got another config type that needs to be unsigned 32-bit. I had been using CFG_INT fine on my 64-bit OS (CFG_INT type is evidently signed 64-bit in that case), but it didn't work when I tried to cross-compile for a 32-bit ARM embedded Linux platform.

For the unsigned 32-bit case, I guess I can do a custom validator and some typecasting to make it handle unsigned 32-bit. It would be nice for libconfuse to provide for unsigned 32-bit.

For the 64-bit values, it would be great if libconfuse would add support for 64-bit integer config types.

@troglobit
Copy link
Collaborator

Maybe we could model this on top of stdint.h? With CFG_INT remaining a platform/compiler specific int.

  • CFG_INT32
  • CFG_INT64
  • CFG_UINT32
  • CFG_UINT64

@cmcqueen
Copy link
Contributor Author

That sounds good to me. What about 16 and 8 variants?

@troglobit
Copy link
Collaborator

Sure, the list could go on, and on, and on ... 😃

@troglobit troglobit added this to the v3.0 milestone Oct 28, 2015
@troglobit troglobit modified the milestones: v3.1, v3.0 Mar 2, 2016
@troglobit troglobit removed this from the v3.1 milestone May 14, 2017
@troglobit
Copy link
Collaborator

Postponing for a future release.

@chli
Copy link

chli commented Mar 25, 2022

Any update on this ? I need to store a 32-bit unsigned int and my only option at the moment is store it as a string, add a validation function to check that only valid uint32 can be set and do the conversion were appropriate.

@troglobit
Copy link
Collaborator

No update. Like most Open Source projects, libConfuse is driven by contributions from its users. Pull requests are welcome.

@bharsaklemukesh975
Copy link

Can I work on this?

@troglobit
Copy link
Collaborator

@bharsaklemukesh975 Sure, just outline first your ideas for the new API here. There are quite a few things to consider. Maybe have a look at, e.g., https://hyperrealm.github.io/libconfig/libconfig_manual.html for inspiration?

@bharsaklemukesh975
Copy link

so we have defines and types with CFG_INT, now we should add to support other integer type like CFG_UINT32, right?
There is also CFG_INT_LIST, do also need to add support for int list?

@troglobit
Copy link
Collaborator

Essentially, yes. I'd just like first time contributors to elaborate a bit on their approach before they get a'crackin'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants