Skip to content

FFI: add *_count() functions for some FFI enumerators - #5232

Merged
reneme merged 1 commit into
randombit:masterfrom
Rohde-Schwarz:feature/ffi_count_functions
Jan 13, 2026
Merged

FFI: add *_count() functions for some FFI enumerators#5232
reneme merged 1 commit into
randombit:masterfrom
Rohde-Schwarz:feature/ffi_count_functions

Conversation

@reneme

@reneme reneme commented Jan 12, 2026

Copy link
Copy Markdown
Collaborator

This adds functions to query the number of entries in index-based enumerator functions that were introduced recently in #5220 and #5217 as suggested.

This adds functions to query the number of entries in index-based
enumerator functions that were introduced recently.

This comment was marked as resolved.

@randombit randombit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about asking about this in the original PR but thought maybe the usage pattern would be to just realloc as you go until you get the no-more-data error code. But knowing the count in advance allows preallocation which probably makes life a bit easier for the C programmers...

@arckoor

arckoor commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

While you're at it, could you add botan_x509_cert_get_issuer_dn_count and botan_x509_cert_get_subject_dn_count? These two were introduced in 2.0, and also have that behaviour, but aren't exposed in botan-rs yet so I still have the chance to use the nicer api there :p

@reneme

reneme commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator Author

While you're at it, could you add botan_x509_cert_get_issuer_dn_count and botan_x509_cert_get_subject_dn_count?

I'll do a follow-up PR. Edit: #5234.

@reneme
reneme merged commit cc836e3 into randombit:master Jan 13, 2026
52 checks passed
@reneme
reneme deleted the feature/ffi_count_functions branch January 13, 2026 07:45
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

Successfully merging this pull request may close these issues.

4 participants