Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julius Enriquez
SRB2
Commits
ae57b6ca
Commit
ae57b6ca
authored
4 years ago
by
James R.
Browse files
Options
Downloads
Patches
Plain Diff
MORE MACROS
I just can't stop myself!
parent
33132930
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lua_hook.h
+7
-3
7 additions, 3 deletions
src/lua_hook.h
src/lua_hooklib.c
+7
-5
7 additions, 5 deletions
src/lua_hooklib.c
with
14 additions
and
8 deletions
src/lua_hook.h
+
7
−
3
View file @
ae57b6ca
...
...
@@ -90,9 +90,13 @@ grepped and found in the lists above.
#define HOOK(name) hook_ ## name
#define STRING_HOOK(name) stringhook_ ## name
enum
{
MOBJ_HOOK_LIST
(
MOBJ_HOOK
)
MOBJ_HOOK
(
MAX
)
};
enum
{
HOOK_LIST
(
HOOK
)
HOOK
(
MAX
)
};
enum
{
STRING_HOOK_LIST
(
STRING_HOOK
)
STRING_HOOK
(
MAX
)
};
#define ENUM(X) enum { X ## _LIST (X) X(MAX) }
ENUM
(
MOBJ_HOOK
);
ENUM
(
HOOK
);
ENUM
(
STRING_HOOK
);
#undef ENUM
/* dead simple, LUA_HOOK(GameQuit) */
#define LUA_HOOK(type) LUA_HookVoid(HOOK(type))
...
...
This diff is collapsed.
Click to expand it.
src/lua_hooklib.c
+
7
−
5
View file @
ae57b6ca
...
...
@@ -31,12 +31,14 @@
ABSTRACTION
========================================================================= */
static
const
char
*
const
mobjHookNames
[]
=
{
MOBJ_HOOK_LIST
(
TOSTR
)
NULL
};
static
const
char
*
const
hookNames
[]
=
{
HOOK_LIST
(
TOSTR
)
NULL
}
;
#define LIST(id, M) \
static const char * const
id [] = { M
(TOSTR) NULL }
static
const
char
*
const
stringHookNames
[]
=
{
STRING_HOOK_LIST
(
TOSTR
)
NULL
};
LIST
(
mobjHookNames
,
MOBJ_HOOK_LIST
);
LIST
(
hookNames
,
HOOK_LIST
);
LIST
(
stringHookNames
,
STRING_HOOK_LIST
);
#undef LIST
typedef
struct
{
int
numHooks
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment