diff options
author | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
---|---|---|
committer | scuri <scuri> | 2008-10-17 06:10:33 +0000 |
commit | 7b52cc13af4e85f1ca2deb6b6c77de9c95ea0dcf (patch) | |
tree | d0857278bde2eff784227c57dcaf930346ceb7ac /src/lua3/cdluapdf.c |
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'src/lua3/cdluapdf.c')
-rw-r--r-- | src/lua3/cdluapdf.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/lua3/cdluapdf.c b/src/lua3/cdluapdf.c new file mode 100644 index 0000000..1260b91 --- /dev/null +++ b/src/lua3/cdluapdf.c @@ -0,0 +1,43 @@ +/** \file + * \brief PDF Canvas Lua 3 Binding + * + * See Copyright Notice in cd.h + */ + +#include <stdlib.h> +#include <stdio.h> + +#include "cd.h" +#include "cdpdf.h" + +#include <lua.h> +#include <lauxlib.h> + +#include "cdlua.h" +#include "cdluapdf.h" +#include "cdlua3_private.h" + +static void *cdpdf_checkdata(int param) +{ + lua_Object data = lua_getparam(param); + if (!lua_isstring(data)) + lua_error("cdCreateCanvas CD_PDF: data should be of type string!"); + + return lua_getstring(data); +} + +static cdContextLUA cdluapdfctx = +{ + 0, + "CD_PDF", + cdContextPDF, + cdpdf_checkdata, + NULL, + 0 +}; + +void cdluapdf_open(void) +{ + cdlua_addcontext(&cdluapdfctx); +} + |