All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jnr.posix.POSIXFunctionMapper Maven / Gradle / Ivy

The newest version!

package jnr.posix;

import jnr.ffi.mapper.FunctionMapper;

final class POSIXFunctionMapper implements FunctionMapper {
    public static final FunctionMapper INSTANCE = new POSIXFunctionMapper();

    private POSIXFunctionMapper() {}
  
    public String mapFunctionName(String name, Context ctx) {
        if (ctx.getLibrary().getName().equals("msvcrt")) {
            // FIXME: We should either always _ name for msvcrt or get good list of _ methods
            if (name.equals("getpid") || name.equals("chmod")) {
                name = "_" + name;
            }
        }
        return name;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy