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
ce7515fc
Commit
ce7515fc
authored
Mar 09, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #349 from jhorneman/master
Exposing Lua support functions
parents
8dd76e6e
d5a78fb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
mongoose.c
mongoose.c
+3
-3
mongoose.h
mongoose.h
+8
-0
No files found.
mongoose.c
View file @
ce7515fc
...
...
@@ -3704,19 +3704,19 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
#include <sys/mman.h>
#endif
static
void
reg_string
(
struct
lua_State
*
L
,
const
char
*
name
,
const
char
*
val
)
{
void
reg_string
(
struct
lua_State
*
L
,
const
char
*
name
,
const
char
*
val
)
{
lua_pushstring
(
L
,
name
);
lua_pushstring
(
L
,
val
);
lua_rawset
(
L
,
-
3
);
}
static
void
reg_int
(
struct
lua_State
*
L
,
const
char
*
name
,
int
val
)
{
void
reg_int
(
struct
lua_State
*
L
,
const
char
*
name
,
int
val
)
{
lua_pushstring
(
L
,
name
);
lua_pushinteger
(
L
,
val
);
lua_rawset
(
L
,
-
3
);
}
static
void
reg_function
(
struct
lua_State
*
L
,
const
char
*
name
,
void
reg_function
(
struct
lua_State
*
L
,
const
char
*
name
,
lua_CFunction
func
,
struct
mg_connection
*
conn
)
{
lua_pushstring
(
L
,
name
);
lua_pushlightuserdata
(
L
,
conn
);
...
...
mongoose.h
View file @
ce7515fc
...
...
@@ -112,6 +112,14 @@ void *mg_start_thread(void *(*func)(void *), void *param);
char
*
mg_md5
(
char
buf
[
33
],
...);
int
mg_authorize_digest
(
struct
mg_connection
*
c
,
FILE
*
fp
);
// Lua utility functions
#ifdef MONGOOSE_USE_LUA
void
reg_string
(
struct
lua_State
*
L
,
const
char
*
name
,
const
char
*
val
);
void
reg_int
(
struct
lua_State
*
L
,
const
char
*
name
,
int
val
);
void
reg_function
(
struct
lua_State
*
L
,
const
char
*
name
,
lua_CFunction
func
,
struct
mg_connection
*
conn
);
#endif
#ifdef __cplusplus
}
#endif // __cplusplus
...
...
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