Beispiel #1
0
        public unsafe static int DoCompile(COMPILE_IN i_compileIn, ref COMPILED_INFO o_compiled)
        {
            if (bIsCompilerDllLoaded == false)
            {
                if (Compiler.LoadCompilerDll() == false)
                {
                    return(1); //missing library
                }
            }

            COMPILED_INFO info    = new COMPILED_INFO();
            int           retCode = compile(&i_compileIn, &info);

            o_compiled = info;
            return(retCode);
        }
Beispiel #2
0
        //Get DLL version
        public static int GetVersion(out double i_version)
        {
            i_version = 0.0;
            if (bIsCompilerDllLoaded == false)
            {
                if (Compiler.LoadCompilerDll() == false)
                {
                    return(1); //missing library
                }
            }

            unsafe
            {
                //in data init
                COMPILE_IN compileIn = new COMPILE_IN();
                compileIn.cCompileMode = Compiler.COMPILE_OPTION__version;

                COMPILED_INFO info    = new COMPILED_INFO();
                int           retCode = compile(&compileIn, &info);
                if (retCode != 0)
                {
                    return(1);
                }

                string version = GetStringFromMemory(info.czCompiled + 1);
                Double.TryParse(version, System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out i_version);
                if (i_version > 0)
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
        }