diff mbox series

[3/7] Lua: Publicize notify_progress()

Message ID 20220602091147.53323-3-christian.storm@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series [1/7] channel_curl: Map response code for file:// protocol | expand

Commit Message

Storm, Christian June 2, 2022, 9:11 a.m. UTC
Commit 2a85ebd introduced swupdate.progress() to
Lua handlers. Make it public so that Lua suricatta
modules can make use of it as well.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 corelib/lua_interface.c | 4 ++--
 include/lua_util.h      | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Stefano Babic June 10, 2022, 9:35 a.m. UTC | #1
Hi Christian,

On 02.06.22 11:11, Christian Storm wrote:
> Commit 2a85ebd introduced swupdate.progress() to
> Lua handlers. Make it public so that Lua suricatta
> modules can make use of it as well.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   corelib/lua_interface.c | 4 ++--
>   include/lua_util.h      | 1 +
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
> index b1ad514..b7cc175 100644
> --- a/corelib/lua_interface.c
> +++ b/corelib/lua_interface.c
> @@ -978,7 +978,7 @@ int lua_get_swupdate_version(lua_State *L)
>    * @param [Lua] Message to dispatch to progress interface.
>    * @return [Lua] nil.
>    */
> -static int l_notify_progress(lua_State *L) {
> +int lua_notify_progress(lua_State *L) {
>     /*
>      * NOTE: level is INFOLEVEL for the sake of specifying a level.
>      * It is unused in core/notifier.c :: progress_notifier() as the
> @@ -1003,7 +1003,7 @@ static const luaL_Reg l_swupdate[] = {
>           { "umount", l_umount },
>           { "getroot", l_getroot },
>           { "getversion", lua_get_swupdate_version },
> -        { "progress", l_notify_progress },
> +        { "progress", lua_notify_progress },
>           { NULL, NULL }
>   };
>   
> diff --git a/include/lua_util.h b/include/lua_util.h
> index 13cffc0..4974eeb 100644
> --- a/include/lua_util.h
> +++ b/include/lua_util.h
> @@ -33,6 +33,7 @@ int lua_notify_error(lua_State *L);
>   int lua_notify_info(lua_State *L);
>   int lua_notify_warn(lua_State *L);
>   int lua_notify_debug(lua_State *L);
> +int lua_notify_progress(lua_State *L);
>   
>   int lua_get_swupdate_version(lua_State *L);
>   

Same comment as previous one: we have extended the API, but it is 
undocumented.

Best regards,
Stefano
Stefano Babic June 16, 2022, 6:42 a.m. UTC | #2
On 02.06.22 11:11, Christian Storm wrote:
> Commit 2a85ebd introduced swupdate.progress() to
> Lua handlers. Make it public so that Lua suricatta
> modules can make use of it as well.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>   corelib/lua_interface.c | 4 ++--
>   include/lua_util.h      | 1 +
>   2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
> index b1ad514..b7cc175 100644
> --- a/corelib/lua_interface.c
> +++ b/corelib/lua_interface.c
> @@ -978,7 +978,7 @@ int lua_get_swupdate_version(lua_State *L)
>    * @param [Lua] Message to dispatch to progress interface.
>    * @return [Lua] nil.
>    */
> -static int l_notify_progress(lua_State *L) {
> +int lua_notify_progress(lua_State *L) {
>     /*
>      * NOTE: level is INFOLEVEL for the sake of specifying a level.
>      * It is unused in core/notifier.c :: progress_notifier() as the
> @@ -1003,7 +1003,7 @@ static const luaL_Reg l_swupdate[] = {
>           { "umount", l_umount },
>           { "getroot", l_getroot },
>           { "getversion", lua_get_swupdate_version },
> -        { "progress", l_notify_progress },
> +        { "progress", lua_notify_progress },
>           { NULL, NULL }
>   };
>   
> diff --git a/include/lua_util.h b/include/lua_util.h
> index 13cffc0..4974eeb 100644
> --- a/include/lua_util.h
> +++ b/include/lua_util.h
> @@ -33,6 +33,7 @@ int lua_notify_error(lua_State *L);
>   int lua_notify_info(lua_State *L);
>   int lua_notify_warn(lua_State *L);
>   int lua_notify_debug(lua_State *L);
> +int lua_notify_progress(lua_State *L);
>   
>   int lua_get_swupdate_version(lua_State *L);
>   

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c
index b1ad514..b7cc175 100644
--- a/corelib/lua_interface.c
+++ b/corelib/lua_interface.c
@@ -978,7 +978,7 @@  int lua_get_swupdate_version(lua_State *L)
  * @param [Lua] Message to dispatch to progress interface.
  * @return [Lua] nil.
  */
-static int l_notify_progress(lua_State *L) {
+int lua_notify_progress(lua_State *L) {
   /*
    * NOTE: level is INFOLEVEL for the sake of specifying a level.
    * It is unused in core/notifier.c :: progress_notifier() as the
@@ -1003,7 +1003,7 @@  static const luaL_Reg l_swupdate[] = {
         { "umount", l_umount },
         { "getroot", l_getroot },
         { "getversion", lua_get_swupdate_version },
-        { "progress", l_notify_progress },
+        { "progress", lua_notify_progress },
         { NULL, NULL }
 };
 
diff --git a/include/lua_util.h b/include/lua_util.h
index 13cffc0..4974eeb 100644
--- a/include/lua_util.h
+++ b/include/lua_util.h
@@ -33,6 +33,7 @@  int lua_notify_error(lua_State *L);
 int lua_notify_info(lua_State *L);
 int lua_notify_warn(lua_State *L);
 int lua_notify_debug(lua_State *L);
+int lua_notify_progress(lua_State *L);
 
 int lua_get_swupdate_version(lua_State *L);