diff options
author | 2015-11-04 18:55:36 +0100 | |
---|---|---|
committer | 2015-11-04 18:55:36 +0100 | |
commit | b6707c3bb53c931e9ec3c5c6630149b7121bbcf5 (patch) | |
tree | 2d9c880bb21242c3fb4619977fe9a71658b3d06e /3rdparty/mongoose/examples/array_vars | |
parent | 2a067f08a4582cdff841dc27b661a9e48fac419a (diff) |
Removed mongoose due to restricted license and webserver wip till code is restructured (nw)
Diffstat (limited to '3rdparty/mongoose/examples/array_vars')
-rw-r--r-- | 3rdparty/mongoose/examples/array_vars/Makefile | 21 | ||||
-rw-r--r-- | 3rdparty/mongoose/examples/array_vars/array_vars.c | 45 |
2 files changed, 0 insertions, 66 deletions
diff --git a/3rdparty/mongoose/examples/array_vars/Makefile b/3rdparty/mongoose/examples/array_vars/Makefile deleted file mode 100644 index 5ce2d1db6cb..00000000000 --- a/3rdparty/mongoose/examples/array_vars/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2014 Cesanta Software -# All rights reserved - -PROG = array_vars -CFLAGS = -W -Wall -I../.. -pthread -g -O0 $(CFLAGS_EXTRA) -SOURCES = $(PROG).c ../../mongoose.c - -all: $(PROG) - -run: $(PROG) - ./$(PROG) - -$(PROG): $(SOURCES) Makefile - $(CC) -o $(PROG) $(SOURCES) $(CFLAGS) - -win: - wine cl $(SOURCES) /MD /nologo /DNDEBUG /O1 /I../.. /Fe$(PROG).exe - wine $(PROG).exe - -clean: - rm -rf $(PROG) *.exe *.dSYM *.obj *.exp .*o *.lib *.gc* diff --git a/3rdparty/mongoose/examples/array_vars/array_vars.c b/3rdparty/mongoose/examples/array_vars/array_vars.c deleted file mode 100644 index d631a7b0c79..00000000000 --- a/3rdparty/mongoose/examples/array_vars/array_vars.c +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2014 Cesanta Software -// All rights reserved -// -// This example demostrates how to use array get variables using mg_get_n_var -// $Date: 2014-09-09 22:20:23 UTC $ - -#include <stdio.h> -#include <string.h> -#include "mongoose.h" - -static int ev_handler(struct mg_connection *conn, enum mg_event ev) { - switch (ev) { - case MG_AUTH: return MG_TRUE; - case MG_REQUEST: - { - mg_printf_data(conn, "Hello! Requested URI is [%s] ", conn->uri); - char buffer[1024]; - int i, ret; - for(i=0; (ret = mg_get_var_n(conn, "foo[]", buffer, 1024, i)) > 0; i++) - mg_printf_data(conn, "\nfoo[%d] = %s", i, buffer); - - return MG_TRUE; - } - default: return MG_FALSE; - } -} - -int main(void) { - struct mg_server *server; - - // Create and configure the server - server = mg_create_server(NULL, ev_handler); - mg_set_option(server, "listening_port", "8080"); - - // Serve request. Hit Ctrl-C to terminate the program - printf("Starting on port %s\n", mg_get_option(server, "listening_port")); - for (;;) { - mg_poll_server(server, 1000); - } - - // Cleanup, and free server instance - mg_destroy_server(&server); - - return 0; -} |