-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
exported symbols: avoid wildcard #45
base: master
Are you sure you want to change the base?
Conversation
* export specific symbols instead of destroy* wildcard * order symbols alphabetically Thanks @agx for suggestions.
Hmmm...somehow github ate my comment: Thanks a lot. That looks good to me. I wonder if we shouldn't prefix those with ( One thing I don't grok yet is why those symbols are needed at all as those aren't used in the cli:
|
prefixing sounds good, even if we are not sure why these symbols are required, prefix for now? |
@anoop142 I'd go with the MR as is for the moment and then look into whether we can't drop those entirely, if not prefix. |
@subins2000 can you say which of these symbols should actually be available to users of the library (e.g. cli or phosh-osk-stub) ? From what I can tell those are "only" needed for the go-bindings of govarnam (things in govarnamgo/), correct? If so simplest thing would be to prefix them with a different prefix ( |
govarnamgo is used by The reason why those destroy* methods are there is because Go handles strings differently, a C char* string needs to be converted to a GoString, when govarnamgo accesses data from the library, the data needs to be converted to a format Go can work on (mostly char* -> GoString conversion). Later the converted data is used in the Go side, so the passed on C data is not needed anymore, hence this data is freed right after the conversion: https://github.com/varnamproject/govarnam/blob/master/govarnamgo/govarnamgo.go#L175 This is a Go specific thing and I don't see it being used in the Java bindings or Ruby bindings (because I think they handle char* directly without trouble). These functions are inside govarnam's exports because it might be useful when bindings are made from other languages. I will prefix them appropriately as said in #46 |
Yeah, if you see use with other bindings then can prefixing makes the most sense. Adding |
Thanks @agx for suggestions.