strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

library API's exported but missing from header #189

Closed sjaeckel closed 2 years ago

sjaeckel commented 2 years ago

The exported list of functions is generated by

https://github.com/strophe/libstrophe/blob/07a4f778d380f3ed4f251e4cffec228e4f5ba564/Makefile.am#L29

Problem

There are several functions that start with xmpp_ but are not in strophe.h.

... I guess the following shows them all ...

https://github.com/strophe/libstrophe/blob/07a4f778d380f3ed4f251e4cffec228e4f5ba564/src/util.h#L29 https://github.com/strophe/libstrophe/blob/07a4f778d380f3ed4f251e4cffec228e4f5ba564/src/common.h#L91-L108 https://github.com/strophe/libstrophe/blob/07a4f778d380f3ed4f251e4cffec228e4f5ba564/src/rand.h#L37-L63

Solution options

We have two choices

  1. put them in strophe.h
  2. rename them (and break the ABI and therefor eventually bump the SONAME)

I could live with both but have a slight preference for 2, but I'd like to have your opinion on this as well.

In theory we could also go with 2 and not do the bump, but I'm not sure if some package maintainers would then come and complain ... which brings me to another point ... #190

pasis commented 2 years ago

There is also the 3rd option: put explicit list of exported API to a file and update when necessary. Or generate it from strophe.h with a script.

If we come with the renaming choice, xmpp_ can be renamed to util_ for example. And for the log wrappers to log_.... However, I would prefer to keep current names. I'm concerned of dropping the code quality with the renaming.

As for the random number generator, it can be exported to user.

sjaeckel commented 2 years ago

There is also the 3rd option: put explicit list of exported API to a file and update when necessary. Or generate it from strophe.h with a script.

yeah, that's another way of defining the exported function, but I think it's sufficient with the xmpp_ prefix!

If we come with the renaming choice, xmpp_ can be renamed to util_ for example. And for the log wrappers to log_.... However, I would prefer to keep current names. I'm concerned of dropping the code quality with the renaming.

194 does the renaming and IMO the code quality/readability hasn't dropped.

I decided to go with log_ for the logging and strophe_ for all the rest.

As for the random number generator, it can be exported to user.

done