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

Buffer output size determination for DasDs_toStr() #7

Open
carrieag opened this issue Mar 5, 2024 · 1 comment
Open

Buffer output size determination for DasDs_toStr() #7

carrieag opened this issue Mar 5, 2024 · 1 comment

Comments

@carrieag
Copy link

carrieag commented Mar 5, 2024

Currently, there is no way to know how many bytes are needed to retrieve the string representation of a dataset returned
by DasDs_toStr(). The write-up for this function just says to provide a good sized buffer. Would it be possible to modify
this routine in order to return the number of characters needed to print the description so that the appropriate amount of
space could be allocated? Or perhaps another routine created to do precisely this function?

@cpiker cpiker changed the title Added functionality for DasDs_toStr() Buffer output size determination for DasDs_toStr() Mar 5, 2024
@cpiker
Copy link
Member

cpiker commented Mar 5, 2024

That's a good point.

Currently it's impossible to know how big to make the buffer. For datasets with just a few variables a few K buffer will always work, but large sets of co-variant housekeeping variables with a lot of meta-data properties, it could be a many 10's of KB, so providing feed-back for dynamic memory is essential.

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

2 participants