protected void autoConfigure() { JNAeratorConfigUtils.autoConfigure(config); }
public static File getFrameworkHeaderDirectory(String framework, List<String> frameworksPath) throws IOException { return new File(getFrameworkDirectory(framework, frameworksPath), "Headers"); }
private static Collection<? extends String> getDefaultIncludePath(boolean verbose) { return Arrays.asList(getProp("JNAERATOR_INCLUDE_PATH", StringUtils.implode(DEFAULT_INCLUDE_PATH, File.pathSeparator), verbose).split(File.pathSeparator)); }
addCPlusPlus(config.preprocessorConfig); defaultMacro(config, "__BIG_ENDIAN__", "1"); defaultMacro(config, "G_BYTE_ORDER", "4321"); //glibc: #define G_BIG_ENDIAN 4321 } else { defaultMacro(config, "__LITTLE_ENDIAN__", "1"); defaultMacro(config, "G_BYTE_ORDER", "1234"); //glibc: #define G_LITTLE_ENDIAN 1234 config.preprocessorConfig.implicitMacros.put("STDC_HEADERS", null); config.preprocessorConfig.implicitIncludes.addAll(getDefaultIncludePath(config.verbose));//JNAeratorConfigUtils.DEFAULT_INCLUDE_PATH); config.preprocessorConfig.frameworksPath.addAll(getDefaultFrameworkPath(config.verbose));//JNAeratorConfigUtils.DEFAULT_FRAMEWORKS_PATH); if (SystemUtils.isWindows()) { config.preprocessorConfig.implicitMacros.put("_NATIVE_WCHAR_T_DEFINED", null); defaultMacro(config, "_MSC_VER", "1100"); defaultMacro(config, "WINAPI", "__stdcall"); JNAeratorConfigUtils.autoConfigureArchitecture(config);
if (file.isDirectory() && fn.endsWith(".xcode") || file.isFile() && fn.toLowerCase().endsWith(".sln")) { JNAeratorConfigUtils.readProjectConfig(file, null, config); } else { parsedActualFile(file, true);
addCPlusPlus(config.preprocessorConfig); defaultMacro(config, "__BIG_ENDIAN__", "1"); defaultMacro(config, "G_BYTE_ORDER", "4321"); //glibc: #define G_BIG_ENDIAN 4321 } else { defaultMacro(config, "__LITTLE_ENDIAN__", "1"); defaultMacro(config, "G_BYTE_ORDER", "1234"); //glibc: #define G_LITTLE_ENDIAN 1234 config.preprocessorConfig.implicitMacros.put("STDC_HEADERS", null); config.preprocessorConfig.implicitIncludes.addAll(getDefaultIncludePath(config.verbose));//JNAeratorConfigUtils.DEFAULT_INCLUDE_PATH); config.preprocessorConfig.frameworksPath.addAll(getDefaultFrameworkPath(config.verbose));//JNAeratorConfigUtils.DEFAULT_FRAMEWORKS_PATH); if (SystemUtils.isWindows()) { config.preprocessorConfig.implicitMacros.put("_NATIVE_WCHAR_T_DEFINED", null); defaultMacro(config, "_MSC_VER", "1100"); defaultMacro(config, "WINAPI", "__stdcall"); JNAeratorConfigUtils.autoConfigureArchitecture(config);
if (file.isDirectory() && fn.endsWith(".xcode") || file.isFile() && fn.toLowerCase().endsWith(".sln")) { JNAeratorConfigUtils.readProjectConfig(file, null, config); } else { parsedActualFile(file, true);
protected void autoConfigure() { JNAeratorConfigUtils.autoConfigure(config); }
private static Collection<? extends String> getDefaultIncludePath(boolean verbose) { return Arrays.asList(getProp("JNAERATOR_INCLUDE_PATH", StringUtils.implode(DEFAULT_INCLUDE_PATH, File.pathSeparator), verbose).split(File.pathSeparator)); }
public static File getFrameworkHeaderDirectory(String framework, List<String> frameworksPath) throws IOException { return new File(getFrameworkDirectory(framework, frameworksPath), "Headers"); }
JNAeratorConfigUtils.readProjectConfig(a.getFileParam(0), a.getStringParam(1), config); break; case RootPackage:
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
private static Collection<? extends String> getDefaultFrameworkPath(boolean verbose) { return Arrays.asList(getProp("JNAERATOR_FRAMEWORKS_PATH", StringUtils.implode(DEFAULT_FRAMEWORKS_PATH, File.pathSeparator), verbose).split(File.pathSeparator)); }
public void addFramework(String framework) throws IOException { File file = JNAeratorConfigUtils.getFrameworkDirectory(framework, preprocessorConfig.frameworksPath); frameworks.add(framework); File headers = new File(file, "Headers"); if (headers.exists()) { preprocessorConfig.implicitIncludes.add(headers.getAbsolutePath()); File mainHeader = new File(headers, framework + ".h"); if (mainHeader.exists()) { addSourceFile(mainHeader, framework, true, true, false); } else { addSourceFile(headers, framework, true, true, false); } } else { new IOException("No Headers subdirectory in framework '" + framework + "' found here : " + file).printStackTrace(); } File naturalDir = new File(file, "Resources/BridgeSupport"); File f; f = new File(naturalDir, framework + ".bridgesupport"); if (!f.exists()) { f = new File(naturalDir, framework + "Full.bridgesupport"); } if (f.exists()) { bridgeSupportFiles.add(f); } }
JNAeratorConfigUtils.readProjectConfig(a.getFileParam(0), a.getStringParam(1), config); break; case RootPackage:
static String preprocess(File source) throws IOException, LexerException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft SDKs\\Windows\\v7.0A\\Include"); config.preprocessorConfig.implicitIncludes.add("C:\\program files\\Microsoft Visual Studio 10.0\\VC\\include"); //config.preprocessorConfig.includeStrings.add(source); config.addSourceFile(source, null, false, true, true); Result result = new Result(config, null, null); String pre = PreprocessorUtils.preprocessSources(config, Collections.EMPTY_LIST, false, result.typeConverter, null); return pre; }
private static Collection<? extends String> getDefaultFrameworkPath(boolean verbose) { return Arrays.asList(getProp("JNAERATOR_FRAMEWORKS_PATH", StringUtils.implode(DEFAULT_FRAMEWORKS_PATH, File.pathSeparator), verbose).split(File.pathSeparator)); }
public void addFramework(String framework) throws IOException { File file = JNAeratorConfigUtils.getFrameworkDirectory(framework, preprocessorConfig.frameworksPath); frameworks.add(framework); File headers = new File(file, "Headers"); if (headers.exists()) { preprocessorConfig.implicitIncludes.add(headers.getAbsolutePath()); File mainHeader = new File(headers, framework + ".h"); if (mainHeader.exists()) { addSourceFile(mainHeader, framework, true, true, false); } else { addSourceFile(headers, framework, true, true, false); } } else { new IOException("No Headers subdirectory in framework '" + framework + "' found here : " + file).printStackTrace(); } File naturalDir = new File(file, "Resources/BridgeSupport"); File f; f = new File(naturalDir, framework + ".bridgesupport"); if (!f.exists()) { f = new File(naturalDir, framework + "Full.bridgesupport"); } if (f.exists()) { bridgeSupportFiles.add(f); } }
static List<Declaration> parseDeclarations(String source) throws IOException, LexerException, InterruptedException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); //config.noCPlusPlus = true; config.preprocessorConfig.includeStrings.add(source); Result result = new Result(config, null, null); SourceFiles parse = new JNAeratorParser().parse(config, result.typeConverter, null); List<Declaration> ret = new ArrayList<Declaration>(); flatten(parse, ret); return ret; }
static List<Declaration> parseDeclarations(String source) throws IOException, LexerException, InterruptedException { JNAeratorConfig config = new JNAeratorConfig(); JNAeratorConfigUtils.autoConfigure(config); //config.noCPlusPlus = true; config.preprocessorConfig.includeStrings.add(source); Result result = new Result(config, null, null); SourceFiles parse = new JNAeratorParser().parse(config, result.typeConverter, null); List<Declaration> ret = new ArrayList<Declaration>(); flatten(parse, ret); return ret; }