diff options
author | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:56:41 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:59:33 -0800 |
commit | d577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch) | |
tree | 590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /cd/src/lua3/cdluapdf.c |
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'cd/src/lua3/cdluapdf.c')
-rwxr-xr-x | cd/src/lua3/cdluapdf.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/cd/src/lua3/cdluapdf.c b/cd/src/lua3/cdluapdf.c new file mode 100755 index 0000000..1260b91 --- /dev/null +++ b/cd/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); +} + |