File: lua_try.c

package info (click to toggle)
lmod 8.7.60-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,008 kB
  • sloc: sh: 6,266; makefile: 2,837; ansic: 1,513; tcl: 1,382; python: 1,050; csh: 112
file content (24 lines) | stat: -rw-r--r-- 505 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#define MYNAME   "rtm"
#define MYVERSION	MYNAME " library for " LUA_VERSION " / Mar 2019"

static int rtm_string(lua_State* L)
{
  const char * my_string  = "Now is the time!";
  const char * my_string2 = "for this to work!";
  lua_pushstring(L, my_string);
  lua_pushstring(L, my_string2);
  return 2;
}



int luaopen_rtm (lua_State *L)
{
  lua_newtable(L);
  lua_pushcfunction(L, rtm_string);
  lua_setfield(L, -2, "rtm_string");
  return 1;
}