/* * Copyright (C) 2008 Tsukasa Hamano * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Id: TCC.xs,v 1.1 2008-03-17 04:04:17 hamano Exp $ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include MODULE = C::TCC PACKAGE = C::TCC int tcc_add_file(s, filename) TCCState * s const char * filename int tcc_add_include_path(s, pathname) TCCState * s const char * pathname int tcc_add_library(s, libraryname) TCCState * s const char * libraryname int tcc_add_library_path(s, pathname) TCCState * s const char * pathname int tcc_add_symbol(s, name, val) TCCState * s const char * name unsigned long val int tcc_add_sysinclude_path(s, pathname) TCCState * s const char * pathname int tcc_compile_string(s, buf) TCCState * s const char * buf void tcc_define_symbol(s, sym, value) TCCState * s const char * sym const char * value void tcc_delete(s) TCCState * s #void #tcc_enable_debug(s) # TCCState * s int tcc_get_symbol(s, pval, name) TCCState * s unsigned long * pval const char * name TCCState * tcc_new() int tcc_output_file(s, filename) TCCState * s const char * filename int tcc_relocate(s) TCCState * s int tcc_run(s, args) TCCState * s AV* args PREINIT: CODE: int i, ret; char *arg; int argc = av_len(args) + 1; STRLEN arg_len; char **argv; if(argc > 0){ argv = malloc(sizeof(char*) * argc); // printf("argc = %d\n", argc); for(i=0; i