aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-03-13 19:22:39 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-03-13 19:22:39 +0300
commitac5114fdf74099a8ce8b9c154231e226e6883b94 (patch)
treee4224c1c37507366896470ce4e8e3467e8e407af /examples
parent8f1e6faa7f548c9a8bcbcac71c8f239a6540b926 (diff)
downloadmagi-ac5114fdf74099a8ce8b9c154231e226e6883b94.tar
magi-ac5114fdf74099a8ce8b9c154231e226e6883b94.tar.xz
magi-ac5114fdf74099a8ce8b9c154231e226e6883b94.zip
[magi]
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile2
-rw-r--r--examples/echo.c13
2 files changed, 11 insertions, 4 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 88af46d..4bf9eac 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -16,7 +16,7 @@ CFLAGS = -xc -ansi -pedantic -Wall -Wextra
ifeq '$(DEBUG)' 'yes'
CFLAGS += -g -O0
else
-CFLAGS += -O3
+CFLAGS += -O3 -static
endif
# Including magi library headers and setting linker to use it:
diff --git a/examples/echo.c b/examples/echo.c
index 7c840e2..52089d9 100644
--- a/examples/echo.c
+++ b/examples/echo.c
@@ -28,7 +28,11 @@ void list_params(magi_request *r, magi_params *current)
{
for (; current; current = current->next) {
magi_param *p = &current->item;
- magi_response_format(r, "[%s] is [%s]<br/>", p->name, p->data);
+ magi_response(r, "[");
+ magi_response(r, p->name);
+ magi_response(r, "] is [");
+ magi_response(r, p->data);
+ magi_response(r, "]<br/>");
}
}
@@ -37,8 +41,11 @@ void list_files(magi_request *r)
magi_files *current;
for (current = r->files; current; current = current->next) {
magi_file *f = &current->item;
- magi_response_format(r, "[%s] was [%s] on clientside<br/>",
- f->field, f->filename);
+ magi_response(r, "[");
+ magi_response(r, f->field);
+ magi_response(r, "] was [");
+ magi_response(r, f->filename);
+ magi_response(r, "] on clientside<br/>");
}
}