src/url_handlers.c: Re-work the URI handling

Introduce a map_uri() function that takes the URI to check and the
URI handler function to run for the given URI.

e.g

    uri_map("/overview/", overview);

If the request URI is for /overview/ then the overview() function will
be called. This replaces

    if (URI("/overview/")) {
        overview();
        goto out;
    }

Due to map_uri being a function, we can't do the goto out; bit. However
we can use longjmp(3) to achieve the same thing, by using setjmp(3)
before calling the map_uri functions we will return to that setjmp with
a return value of 1 (in this case) to signal that we have matched a URI
and should skip the rest of the URI matching.

We do a setjmp before the map_uri's for the URIs that don't require
authentication and another setjmp before the map_uri's that do, as we
need to do some slightly different things in the two cases.

While this does result in nice code reduction and certainly makes things
quite a bit cleaner and simpler going forward, it did require a slight
change to how the paypal_ipn() function is called. Previously it was
called with a copy of the post buffer (it beeds to send this back to
PayPal). However because the uri_map() function is specified as

    uri_map(const char *uri, void (uri_handler)(void))

we can't pass any arguments through to it. Seeing as paypal_ipn() was
the only URI handling function that took a parameter it seemed better to
not pass it the post buffer and have it available globally than change
all the other URI handler's to take a void * rather than a void and have
a generally redundant 3rd argument to map_uri().

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
src/urL_handlers.c: Remove the no longer used URI() macro

This has been replaced by map_uri() from commit 45900db
("src/url_handlers.c: Re-work the URI handling")

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
src/url_handlers.c: Enhance a comment

Enhance the comment about the POST buffer in handle_request()

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
src/url_handlers.c: Cleanup match_uri() a little

Move the definition of request_uri to above this function and remove the
request_uri parameter.

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
src/url_handlers.c: Cleanup match_uri() a little more

Rename the match parameter to uri, this reads a little more clearly.

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>