Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
f372faf6
Commit
f372faf6
authored
Sep 09, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved hello.c example to its own dir
parent
882f3b3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
Makefile
examples/hello_world/Makefile
+19
-0
hello_world.c
examples/hello_world/hello_world.c
+6
-9
No files found.
examples/hello_world/Makefile
0 → 100644
View file @
f372faf6
# Copyright (c) 2014 Cesanta Software
# All rights reserved
PROG
=
hello_world
CFLAGS
=
-W
-Wall
-I
../..
$(CFLAGS_EXTRA)
SOURCES
=
$(PROG)
.c ../../mongoose.c
all
:
$(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
*
examples/hello.c
→
examples/hello
_world/hello_world
.c
View file @
f372faf6
...
...
@@ -3,16 +3,13 @@
#include "mongoose.h"
static
int
ev_handler
(
struct
mg_connection
*
conn
,
enum
mg_event
ev
)
{
int
result
=
MG_FALSE
;
if
(
ev
==
MG_REQUEST
)
{
switch
(
ev
)
{
case
MG_AUTH
:
return
MG_TRUE
;
case
MG_REQUEST
:
mg_printf_data
(
conn
,
"Hello! Requested URI is [%s]"
,
conn
->
uri
);
result
=
MG_TRUE
;
}
else
if
(
ev
==
MG_AUTH
)
{
result
=
MG_TRUE
;
return
MG_TRUE
;
default:
return
MG_FALSE
;
}
return
result
;
}
int
main
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment