Example #1
0
        public void Preprocess(Driver driver, ASTContext ctx)
        {
            ctx.IgnoreEnumWithMatchingItem("SDL_FALSE");
            ctx.IgnoreEnumWithMatchingItem("DUMMY_ENUM_VALUE");

            ctx.SetNameOfEnumWithMatchingItem("SDL_SCANCODE_UNKNOWN", "ScanCode");
            ctx.SetNameOfEnumWithMatchingItem("SDLK_UNKNOWN", "Key");
            ctx.SetNameOfEnumWithMatchingItem("KMOD_NONE", "KeyModifier");
            ctx.SetNameOfEnumWithMatchingItem("SDL_LOG_CATEGORY_CUSTOM", "LogCategory");

            ctx.GenerateEnumFromMacros("InitFlags", "SDL_INIT_(.*)").SetFlags();
            ctx.GenerateEnumFromMacros("Endianness", "SDL_(.*)_ENDIAN");
            ctx.GenerateEnumFromMacros("InputState", "SDL_RELEASED", "SDL_PRESSED");
            ctx.GenerateEnumFromMacros("AlphaState", "SDL_ALPHA_(.*)");
            ctx.GenerateEnumFromMacros("HatState", "SDL_HAT_(.*)");

            ctx.IgnoreHeadersWithName("SDL_atomic*");
            ctx.IgnoreHeadersWithName("SDL_endian*");
            ctx.IgnoreHeadersWithName("SDL_main*");
            ctx.IgnoreHeadersWithName("SDL_mutex*");
            ctx.IgnoreHeadersWithName("SDL_stdinc*");
            ctx.IgnoreHeadersWithName("SDL_error");

            ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM");
            ctx.IgnoreFunctionWithName("SDL_Error");
        }
Example #2
0
        public void Preprocess(Driver driver, ASTContext ctx)
        {
            driver.Context.TypeMaps.TypeMaps.Add("MKL_Complex8", new ComplexFloat());
            driver.Context.TypeMaps.TypeMaps.Add("MKL_Complex16", new ComplexDouble());
            driver.Context.TypeMaps.TypeMaps.Add("CBLAS_LAYOUT", new CBLAS_LAYOUT());
            driver.Context.TypeMaps.TypeMaps.Add("CBLAS_TRANSPOSE", new CBLAS_TRANSPOSE());
            driver.Context.TypeMaps.TypeMaps.Add("CBLAS_UPLO", new CBLAS_UPLO());
            driver.Context.TypeMaps.TypeMaps.Add("CBLAS_DIAG", new CBLAS_DIAG());
            driver.Context.TypeMaps.TypeMaps.Add("CBLAS_SIDE", new CBLAS_SIDE());

            driver.Context.TypeMaps.TypeMaps.Add("MKL_LAYOUT", new CBLAS_LAYOUT());
            driver.Context.TypeMaps.TypeMaps.Add("MKL_TRANSPOSE", new CBLAS_TRANSPOSE());
            driver.Context.TypeMaps.TypeMaps.Add("MKL_UPLO", new CBLAS_UPLO());
            driver.Context.TypeMaps.TypeMaps.Add("MKL_DIAG", new CBLAS_DIAG());
            driver.Context.TypeMaps.TypeMaps.Add("MKL_SIDE", new CBLAS_SIDE());

            ctx.IgnoreFunctionWithPattern("^/(?!LAPACKE|mkl|cblas)([A-Za-z0-9_]+)$");
            ctx.IgnoreFunctionWithPattern("_batch$");
            ctx.IgnoreFunctionWithPattern("_pack$");
            ctx.IgnoreFunctionWithPattern("_compute$");
            ctx.IgnoreFunctionWithPattern("_alloc$");
            ctx.IgnoreFunctionWithPattern("_free$");
            ctx.IgnoreFunctionWithPattern("_pack_get_size$");
            ctx.IgnoreFunctionWithPattern("_pack_get_size$");
            ctx.IgnoreFunctionWithPattern("_jit_");
            ctx.IgnoreFunctionWithPattern("s16s16s32");
            ctx.IgnoreFunctionWithPattern("s8u8s32");

            ctx.IgnoreEnumWithMatchingItem("CBLAS_STORAGE");
            ctx.IgnoreEnumWithMatchingItem("CBLAS_IDENTIFIER");
            ctx.IgnoreEnumWithMatchingItem("CBLAS_OFFSET");
            ctx.IgnoreEnumWithMatchingItem("MklJitStatusT");
            ctx.IgnoreEnumWithMatchingItem("MKL_COMPACT_PACK");
        }
Example #3
0
        public void Preprocess(Driver driver, ASTContext ctx)
        {
            ctx.IgnoreEnumWithMatchingItem("SDL_FALSE");
            ctx.IgnoreEnumWithMatchingItem("DUMMY_ENUM_VALUE");

            ctx.SetNameOfEnumWithMatchingItem("SDL_SCANCODE_UNKNOWN", "ScanCode");
            ctx.SetNameOfEnumWithMatchingItem("SDLK_UNKNOWN", "Key");
            ctx.SetNameOfEnumWithMatchingItem("KMOD_NONE", "KeyModifier");
            ctx.SetNameOfEnumWithMatchingItem("SDL_LOG_CATEGORY_CUSTOM", "LogCategory");

            ctx.GenerateEnumFromMacros("InitFlags", "SDL_INIT_(.*)").SetFlags();
            ctx.GenerateEnumFromMacros("Endianness", "SDL_(.*)_ENDIAN");
            ctx.GenerateEnumFromMacros("InputState", "SDL_RELEASED", "SDL_PRESSED");
            ctx.GenerateEnumFromMacros("AlphaState", "SDL_ALPHA_(.*)");
            ctx.GenerateEnumFromMacros("HatState", "SDL_HAT_(.*)");

            ctx.IgnoreHeadersWithName("SDL_atomic*");
            ctx.IgnoreHeadersWithName("SDL_endian*");
            ctx.IgnoreHeadersWithName("SDL_main*");
            ctx.IgnoreHeadersWithName("SDL_mutex*");
            ctx.IgnoreHeadersWithName("SDL_stdinc*");
            ctx.IgnoreHeadersWithName("SDL_error");

            ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM");
            ctx.IgnoreFunctionWithName("SDL_Error");
        }
Example #4
0
        public void Preprocess(Driver driver, ASTContext ctx)
        {
            ctx.IgnoreEnumWithMatchingItem("SDL_FALSE");
            ctx.IgnoreEnumWithMatchingItem("DUMMY_ENUM_VALUE");

            ctx.SetNameOfEnumWithMatchingItem("SDL_SCANCODE_UNKNOWN", "ScanCode");
            ctx.SetNameOfEnumWithMatchingItem("SDLK_UNKNOWN", "Key");
            ctx.SetNameOfEnumWithMatchingItem("KMOD_NONE", "KeyModifier");
            ctx.SetNameOfEnumWithMatchingItem("SDL_LOG_CATEGORY_CUSTOM", "LogCategory");

            ctx.GenerateEnumFromMacros("InitFlags", "SDL_INIT_(.*)").SetFlags();
            ctx.GenerateEnumFromMacros("Endianness", "SDL_(.*)_ENDIAN");
            ctx.GenerateEnumFromMacros("InputState", "SDL_RELEASED", "SDL_PRESSED");
            ctx.GenerateEnumFromMacros("AlphaState", "SDL_ALPHA_(.*)");
            ctx.GenerateEnumFromMacros("HatState", "SDL_HAT_(.*)");

            ctx.IgnoreHeadersWithName("SDL_atomic*");
            ctx.IgnoreHeadersWithName("SDLAtomic*");
            ctx.IgnoreHeadersWithName("SDL_endian*");
            ctx.IgnoreHeadersWithName("SDL_main*");
            ctx.IgnoreHeadersWithName("SDL_mutex*");
            ctx.IgnoreHeadersWithName("SDL_stdinc*");
            ctx.IgnoreHeadersWithName("SDL_error");
            ctx.IgnoreHeadersWithName("SDL_rwops");

            ctx.IgnoreEnumWithMatchingItem("SDL_ENOMEM");
            ctx.IgnoreFunctionWithName("SDL_Error");

            //ctx.SetFunctionParameterUsage("SDL_PollEvent", 1, ParameterUsage.Out);
            var pollEvent = ctx.FindFunction("SDL_PollEvent").First();

            var eventParam = pollEvent.Parameters[0];

            eventParam.Usage = ParameterUsage.Out;
            //eventParam.Kind = ParameterKind.IndirectReturnType;

            ctx.IgnoreClassWithName("Windowsio");

            //var typeDefs = ctx.TranslationUnits.SelectMany(tu => tu.Typedefs).ToList();

            //var kmType = ctx.FindTypedef("SDL_Keymod").First();
            //var keysym = ctx.FindClass("SDL_Keysym").First();
            //var modField = keysym.Fields.Find(f => f.Name == "mod");
            //modField.QualifiedType = new QualifiedType(new TypedefType(kmType));
            //ctx.SetClassAsValueType();
        }