// ============================================================================ // C servlet sample for the G-WAN Web Application Server (http://trustleap.ch/) // ---------------------------------------------------------------------------- // argv.c: how to list *all* URL parameters (may be useful in RESTFUL services) // without calling get_arg("name=", &pName, argc, argv) like in loan.c. // // With /?argv.c&name=Eva&amount=1000000&rate=3.5&term=1, the output is: // // main()'s argv[0-3] listed: // argv[0] 'name=Eva' // argv[1] 'amount=1000000' // argv[2] 'rate=3.5' // argv[3] 'term=1' // ============================================================================ // imported functions: // get_reply(): get a pointer on the 'reply' dynamic buffer from the server // xbuf_xcat(): like sprintf(), but it works in the specified dynamic buffer // ---------------------------------------------------------------------------- #include "gwan.h" // G-WAN exported functions int main(int argc, char *argv[]) { xbuf_t *reply = get_reply(argv); xbuf_xcat(reply, "