Changes between Version 4 and Version 5 of Packages/LUA


Ignore:
Timestamp:
Dec 11, 2014, 2:32:40 AM (5 years ago)
Author:
Chris Johns
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Packages/LUA

    v4 v5  
    99
    1010This operates exactly as it would in the host operating system.
    11 <tt>
     11{{{
    1212        #include <rtems/lua.h>
    1313        #include <rtems/lualib.h>
     
    2929          lua_close(L);
    3030       }
    31 </tt>= Spawning a Lua Shell =
     31}}}
     32= Spawning a Lua Shell =
    3233
    33 <tt>_Lua_Main(int argc, char** argv)</tt> is a standard <tt>C</tt> main function.  Lua spawns a shell whenever
     34`_Lua_Main(int argc, char** argv)` is a standard `C` main function.  Lua spawns a shell whenever
    3435it is called without a script as an argument.  Therefore, the end user can spawn a lua shell by modifying the
    3536code below:
    36 <tt>
     37{{{
    3738        #include <rtems/lua.h>
    3839        #include <rtems/lualib.h>
     
    4546          _Lua_spawn_shell();
    4647        }
    47 </tt>
     48}}}
    4849
    4950= Spawning a RTEMS Shell =
    5051
    5152This creates a lua shell that allows for the execution of RTEMS commands.
    52 <tt>
     53{{{
    5354        #include <rtems/lua.h>
    5455        #include <rtems/lualib.h>
     
    6162          _Lua_spawn_RTEMS_shell();
    6263        }
    63 </tt>
     64}}}
    6465
    6566= Executing a Standalone Lua Script =
    6667
    67 Since <tt>_Lua_Main(int argc, char** argv)</tt> is a standard <tt>C</tt> main function, executing lua scripts are
     68Since `_Lua_Main(int argc, char** argv)` is a standard `C` main function, executing lua scripts are
    6869as simple as notifying the interpreter where the file is located.
    6970
     
    7172agnostic to the underlying filesystem.
    7273
    73 <tt>
     74{{{
    7475        #include <rtems/lua.h>
    7576        #include <rtems/lualib.h>
     
    8687          _Lua_run_script("path-to-program.lua", num_arguments, program_args);
    8788        }
    88 </tt>
     89}}}