Const variables in prototypes don't add much value, but make the code
larger and redundant. Remove these const keywords.
Note, this doesn't apply to pointers to const memory.
Introduced UNUSED macro with cast to void in commoh.h for internal
use. Used cast to void directly in those files which do not
include common.h. Although this change doesn't fix semantic issues
with unused function parameters, it does explicitly mark all those
places, which might require attention in future.
@sjaeckel integrated clang-format with formal coding style. Run his
script and commit changes.
There are pros and cons of this commit.
Mixed coding style is a "broken window". A good single style simplifies
reading and writing code.
On the other hand, this is a big change which will lead to conflicts.
XEP-0077 will not be implemented as part of libstrophe's API, but an
example is provided. The example shows how to use the "raw" connection
to register a user.
Closes#54.
If interface function returns char* the result must be freed with
xmpp_free().
In case of const char* the result must not be changed by user. Also, the
result is valid only during stanza lifetime.
Store keepalive parameters in conn object. This allows call the function
with a disconnected conn. Also, the parameters are not cleared on
reconnect and applied once a socket is created.
xmpp_conn_set_flags() and xmpp_conn_get_flags() unify interface of
connection configuration.
This interface allows compile-time check of supported features or even
run-time check. Therefore, applications can be built with older
libstrophe which doesn't support some optional flags.
Having debugging on by default in the example seems to help
people trying out the library, and with the default_logger()
call it's not too much extra complication.
We should also write an example/complex.c that exercises
all the callback options, a custom allocator and so on.
(a filtered version of) the default logger which we implemented in
the library but was no longer accessible. This makes it much easier
for the caller to turn logging on by just passing this default
log handler callback pointer into xmpp_ctx_new() instead of having
to always implement boilerplate.
Another option would have been xmpp_get_default_log_level(ctx, level)
to change the filter level of the build in logger, which is installed
if you pass NULL to xmpp_ctx_new(). In this method the logger would
filter everything by default.
Defining static data in the header causes warnings on Apple gcc, and in general
this should be the client's responsibility. The names are obvious from the
log_level enum, which is public, and it's only one line of boilerplate to
copy in implementing a custom logging function.
now derives the domain from the jid.
Is it reasonable to just remove the 'domain' (more properly server) argument directly?
The library should always handle this and I can't think why you'd want to override unless
maybe if you have a proxy.