Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
86f97b17
Commit
86f97b17
authored
4 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
wplua: expose table to/from properties conversion functions
parent
b94e54c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/wplua/value.c
+6
-6
6 additions, 6 deletions
lib/wplua/value.c
lib/wplua/wplua.h
+4
-1
4 additions, 1 deletion
lib/wplua/wplua.h
with
10 additions
and
7 deletions
lib/wplua/value.c
+
6
−
6
View file @
86f97b17
...
...
@@ -10,8 +10,8 @@
#include
"private.h"
#include
<wp/wp.h>
static
WpProperties
*
table_to_properties
(
lua_State
*
L
,
int
idx
)
WpProperties
*
wplua_
table_to_properties
(
lua_State
*
L
,
int
idx
)
{
WpProperties
*
p
=
wp_properties_new_empty
();
const
gchar
*
key
,
*
value
;
...
...
@@ -29,8 +29,8 @@ table_to_properties (lua_State *L, int idx)
return
p
;
}
static
void
properties_to_table
(
lua_State
*
L
,
WpProperties
*
p
)
void
wplua_
properties_to_table
(
lua_State
*
L
,
WpProperties
*
p
)
{
lua_newtable
(
L
);
if
(
p
)
{
...
...
@@ -101,7 +101,7 @@ wplua_lua_to_gvalue (lua_State *L, int idx, GValue *v)
g_value_set_boxed
(
v
,
wplua_toboxed
(
L
,
idx
));
/* table -> WpProperties */
else
if
(
lua_istable
(
L
,
idx
)
&&
G_VALUE_TYPE
(
v
)
==
WP_TYPE_PROPERTIES
)
g_value_take_boxed
(
v
,
table_to_properties
(
L
,
idx
));
g_value_take_boxed
(
v
,
wplua_
table_to_properties
(
L
,
idx
));
break
;
case
G_TYPE_OBJECT
:
case
G_TYPE_INTERFACE
:
...
...
@@ -171,7 +171,7 @@ wplua_gvalue_to_lua (lua_State *L, const GValue *v)
break
;
case
G_TYPE_BOXED
:
if
(
G_VALUE_TYPE
(
v
)
==
WP_TYPE_PROPERTIES
)
properties_to_table
(
L
,
g_value_get_boxed
(
v
));
wplua_
properties_to_table
(
L
,
g_value_get_boxed
(
v
));
else
wplua_pushboxed
(
L
,
G_VALUE_TYPE
(
v
),
g_value_dup_boxed
(
v
));
break
;
...
...
This diff is collapsed.
Click to expand it.
lib/wplua/wplua.h
+
4
−
1
View file @
86f97b17
...
...
@@ -9,7 +9,7 @@
#ifndef __WPLUA_H__
#define __WPLUA_H__
#include
<
glib-object
.h>
#include
<
wp/wp
.h>
#include
<lua.h>
#include
<lauxlib.h>
...
...
@@ -65,6 +65,9 @@ GClosure * wplua_function_to_closure (lua_State *L, int idx);
void
wplua_lua_to_gvalue
(
lua_State
*
L
,
int
idx
,
GValue
*
v
);
int
wplua_gvalue_to_lua
(
lua_State
*
L
,
const
GValue
*
v
);
WpProperties
*
wplua_table_to_properties
(
lua_State
*
L
,
int
idx
);
void
wplua_properties_to_table
(
lua_State
*
L
,
WpProperties
*
p
);
gboolean
wplua_load_buffer
(
lua_State
*
L
,
const
gchar
*
buf
,
gsize
size
,
GError
**
error
);
gboolean
wplua_load_uri
(
lua_State
*
L
,
const
gchar
*
uri
,
GError
**
error
);
...
...
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