Merge pull request #176 from jemc/master

Problem: Client does not destroy chunk, frame, and msg properties
Problem: caller should own message returned by _recv

Solution: do not destroy in generated code; allow caller to do this.

This is more consistent with what we'd expect from a CLASS API and
does not cost anything in performance terms. Also since the caller
will usually consume the message in order to process it, it also
makes sense.
Merge pull request #177 from hintjens/master

Problem: caller should own message returned by _recv
Compile error 'value' may be used uninitialized

Problem: When using a hash in a codec model, code generated for "C"
errors with 'value' may be used uninitialized in this function.

Solution: Simply initialize value to NULL.
Merge pull request #178 from danriegsecker/master

Compile error 'value' may be used uninitialized
Problem: encoding message with string uses printf

This might actually have some security implications if people using the
library are not avare of this and missuse _encode function. With _encode
function one can construct whole message in one go. Tricky part is that
if it contains string, there is no way to pass additional argument, so
one would expect that contrary to _set method, string is not passed
through printf function. Contrary is true and thus one can for example
call _encode(1, "%s %s") which will try to access not existing arguments
for printf as encode calls _set function.

Solution: Use _set("%s", str) in _encode.
Merge pull request #179 from miska/master

Problem: encoding message with string uses printf
Problem: no help if app uses bad client reference

Solution: flag client log prefix in bold so if application sends
any event to a destroyed client, it shows immediately in animation.
Problem: can't handle nested state inheritence

Solution: do recursive inheritance
Problem: client lacks detail for unknown protocol command

Solution: show command name in error message.
Merge pull request #180 from hintjens/master

Improvements to client and server generators
Problem: need actor handle for polling use cases

Solution: restore _actor method, which provides actor handle.
Problem: does not support PLAIN authentication

Solution: expand configuration parsing to support this. Note that
security setting must come before any bind settings, as these are
executed in order. So:

    mlm_server
        echo = installing PLAIN security mechanism
        security
            mechanism = plain

        echo = binding mlm_client test service to 'ipc://@/malamute'
        bind
            endpoint = ipc://@/malamute
Merge pull request #181 from hintjens/master

Adding PLAIN authentication support
Problem: need way to customize client API

There are some methods which are too painful to generate, as we
don't yet have clean abstractions for them.

Solution: allow user to add custom code to generated API, using
<custom> tag in client model. Syntax:

    <custom filename = "somefile.xml" language = "C" />

where somefile.xml contains <header> and <source> sections included
into API header and API source engine respectively.
Merge pull request #182 from hintjens/master

Problem: need way to customize client API
Problem: crashed when trying to delete expired tickets

Solution: when ticket expires, there's no need to delete it, as
this is already done by zloop. Thus, clear our own ticket handle
when ticket expires.
Problem: client hands in destructor, on interrupt

As client destructor does a handshake with its background thread,
to allow a clean disconnect when possible, it hangs if the user
interrupted the process with Ctrl-C (as it never gets a reply
signal in s_accept_reply ()).

Solution: if zsys_interrupted is true, do not wait for a reply,
just return -1 immediately. The destructor then completes happily.
Merge pull request #183 from hintjens/master

Problem: crashed when trying to delete expired tickets