Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file ppx_cstubs_custom.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112# 1 "ppx_cstubs_custom.cppo.ml"(* This file is part of ppx_cstubs (https://github.com/fdopen/ppx_cstubs)
* Copyright (c) 2018-2019 fdopen
*
* This program 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, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program 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 program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)lettoplevel_env=refEnv.emptyletflib_protectfa=tryfawithFl_package_base.No_such_package(s,s')->ifs'=""thenPrintf.eprintf"error: findlib package %s not found\n%!"selsePrintf.eprintf"error: findlib package %s (%S) not found\n%!"ss';exit2letinitialized=reffalseletinit~nopervasives~pkgs~use_threads~cma_files()=match!initializedwith|true->()|false->ifnopervasivesthenClflags.nopervasives:=true;Toploop.set_paths();toplevel_env:=Compmisc.initial_env();Topfind.log:=ignore;letl=["integers";"ctypes";"ppx_cstubs";"ppx_cstubs.internal"]inCCListLabels.iterl~f:(funp->Topdirs.dir_directory@@flib_protectFindlib.package_directoryp);ifpkgs<>[]then(Topfind.add_predicates["byte"];flib_protectTopfind.don't_load_deeply["ppx_cstubs.internal"];ifuse_threadsthen(Topfind.add_predicates["mt";"mt_posix"];flib_protectTopfind.load_deeply["threads"]);flib_protectTopfind.load_deeplypkgs);ListLabels.itercma_files~f:(funs->letdir=Filename.dirnamesinifdir<>"."thenTopdirs.dir_directorydir;letb=Topdirs.load_fileFormat.str_formattersinletmsg=Format.flush_str_formatter()inifnotbthen(Printf.eprintf"fatal:failed to load %s (%s)\n%!"smsg;exit2));initialized:=true;()letevalst=letloc=matchstwith|a::_->a.Parsetree.pstr_loc|[]->!Ast_helper.default_locinTypecore.reset_delayed_checks();# 66 "ppx_cstubs_custom.cppo.ml"let(str,_sg,_sn,newenv)=Typemod.type_structure!toplevel_envstlocin# 70 "ppx_cstubs_custom.cppo.ml"letlam=Translmod.transl_toplevel_definitionstrinWarnings.check_fatal();letinit_code,fun_code=Bytegen.compile_phraselamin# 74 "ppx_cstubs_custom.cppo.ml"letcode,reloc,events=Emitcode.to_memoryinit_codefun_codein# 85 "ppx_cstubs_custom.cppo.ml"letcan_free=fun_code=[]inletinitial_symtable=Symtable.current_state()inSymtable.patch_objectcodereloc;Symtable.check_global_initializedreloc;Symtable.update_global_table();# 91 "ppx_cstubs_custom.cppo.ml"letbytecode,closure=Meta.reify_bytecodecode[|events|]Noneintryletretval=closure()inifcan_freethenMeta.release_bytecodebytecode;toplevel_env:=newenv;ignore(retval:Obj.t);()with|x->ifcan_freethenMeta.release_bytecodebytecode;Symtable.restore_stateinitial_symtable;raisex# 127 "ppx_cstubs_custom.cppo.ml"letget_top()=objectmethodinit~nopervasives~pkgs~use_threads~cma_files()=init~nopervasives~pkgs~use_threads~cma_files()methodevalst=evalstendletinit()=lettop=get_top()inPpxc__script._init(Sometop)