// Path: src/main/java/com/technofovea/hllib/methods/FullLibrary.java
// public interface FullLibrary extends BasicLibrary {
// 
//     /**
//      * Called to initialize the DLL library.
//      */
//     public void initialize();
// 
//     /**
//      * Called to shut down the DLL library.
//      */
//     public void shutdown();
// 
//     public boolean itemGetSize(DirectoryItem item, IntByReference size);
// 
//     public boolean itemGetSizeEx(DirectoryItem item, LongByReference size);
// 
//     public boolean itemGetSizeOnDisk(DirectoryItem item, IntByReference size);
// 
//     public boolean itemGetSizeOnDiskEx(DirectoryItem item, LongByReference size);
// 
//     public void itemGetPath(DirectoryItem item, byte[] buffer, int bufsize);
// 
//     public boolean createPackage(PackageType ePackageType, IntByReference packageId);
// 
//     public void packageClose();
// 
//     public void deletePackage(HlPackage pkg);
// 
//     public boolean packageGetExtractable(DirectoryItem file, ByteByReference extractable);
// 
//     public boolean packageGetFileSize(DirectoryItem file, IntByReference size);
// 
//     public boolean packageGetFileSizeOnDisk(DirectoryItem file, IntByReference size);
// 
//     public boolean packageCreateStream(DirectoryItem file, PointerByReference stream);
// 
//     public boolean fileCreateStream(DirectoryItem item, PointerByReference stream);
// }
// 
// Path: src/main/java/com/technofovea/hllib/enums/HlOption.java
// public enum HlOption implements JnaEnum<HlOption> {
// 
//     VERSION,
//     ERROR,
//     ERROR_SYSTEM,
//     ERROR_SHORT_FORMATED,
//     ERROR_LONG_FORMATED,
//     PROC_OPEN,
//     PROC_CLOSE,
//     PROC_READ,
//     PROC_WRITE,
//     PROC_SEEK,
//     PROC_TELL,
//     PROC_SIZE,
//     PROC_EXTRACT_ITEM_START,
//     PROC_EXTRACT_ITEM_END,
//     PROC_EXTRACT_FILE_PROGRESS,
//     PROC_VALIDATE_FILE_PROGRESS,
//     OVERWRITE_FILES,
//     PACKAGE_BOUND,
//     PACKAGE_ID,
//     PACKAGE_SIZE,
//     PACKAGE_TOTAL_ALLOCATIONS,
//     PACKAGE_TOTAL_MEMORY_ALLOCATED,
//     PACKAGE_TOTAL_MEMORY_USED,
//     READ_ENCRYPTED,
//     FORCE_DEFRAGMENT,
//     PROC_DEFRAGMENT_PROGRESS,
//     PROC_DEFRAGMENT_PROGRESS_EX,;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
// 
//     public HlOption getForValue(int i) {
//         for (HlOption o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
//         }
//         return null;
//     }
//     
// }
// 
// Path: src/main/java/com/technofovea/hllib/methods/ManagedLibrary.java
// public interface ManagedLibrary extends BasicLibrary, ManagedCalls{       
// 
// }


import com.sun.jna.FunctionMapper;
import com.sun.jna.NativeLibrary;
import com.technofovea.hllib.methods.FullLibrary;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.technofovea.hllib.enums.HlOption;
import com.technofovea.hllib.methods.ManagedLibrary;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
        options.put(Library.OPTION_TYPE_MAPPER, new HlTypeMapper());
        options.put(Library.OPTION_FUNCTION_MAPPER, func_mapper);

        logger.debug("Detecting architecture from property {}", ARCH_PROPERTY);
        String arch = System.getProperty(ARCH_PROPERTY);
        final String libName;
        if (ARCH_32.equals(arch)) {
            libName = LIBRARY_NAME + ARCH_32_SUFFIX;
        } else if (ARCH_64.equals(arch)) {
            libName = LIBRARY_NAME + ARCH_64_SUFFIX;
        } else {
            logger.warn("Unable to determine architecture (32-bit vs 64-bit) for HlLib. Defaulting to 32bit.");
            libName = LIBRARY_NAME + ARCH_32_SUFFIX;
        }
        logger.info("Loading native library: {}", libName);
        rawInstance = (FullLibrary) Native.loadLibrary(libName, FullLibrary.class, options);

        logger.debug("Calling library initialization function");
        rawInstance.initialize();

        logger.debug("Creating dynamic proxy for library access");
        handler = new InvocationManager(rawInstance);
        ManagedLibrary proxy = (ManagedLibrary) Proxy.newProxyInstance(
                FullLibrary.class.getClassLoader(),
                new Class[]{ManagedLibrary.class},
                handler);

        instance = proxy;


// Path: src/main/java/com/technofovea/hllib/methods/FullLibrary.java
// public interface FullLibrary extends BasicLibrary {
// 
//     /**
//      * Called to initialize the DLL library.
//      */
//     public void initialize();
// 
//     /**
//      * Called to shut down the DLL library.
//      */
//     public void shutdown();
// 
//     public boolean itemGetSize(DirectoryItem item, IntByReference size);
// 
//     public boolean itemGetSizeEx(DirectoryItem item, LongByReference size);
// 
//     public boolean itemGetSizeOnDisk(DirectoryItem item, IntByReference size);
// 
//     public boolean itemGetSizeOnDiskEx(DirectoryItem item, LongByReference size);
// 
//     public void itemGetPath(DirectoryItem item, byte[] buffer, int bufsize);
// 
//     public boolean createPackage(PackageType ePackageType, IntByReference packageId);
// 
//     public void packageClose();
// 
//     public void deletePackage(HlPackage pkg);
// 
//     public boolean packageGetExtractable(DirectoryItem file, ByteByReference extractable);
// 
//     public boolean packageGetFileSize(DirectoryItem file, IntByReference size);
// 
//     public boolean packageGetFileSizeOnDisk(DirectoryItem file, IntByReference size);
// 
//     public boolean packageCreateStream(DirectoryItem file, PointerByReference stream);
// 
//     public boolean fileCreateStream(DirectoryItem item, PointerByReference stream);
// }
// 
// Path: src/main/java/com/technofovea/hllib/enums/HlOption.java
// public enum HlOption implements JnaEnum<HlOption> {
// 
//     VERSION,
//     ERROR,
//     ERROR_SYSTEM,
//     ERROR_SHORT_FORMATED,
//     ERROR_LONG_FORMATED,
//     PROC_OPEN,
//     PROC_CLOSE,
//     PROC_READ,
//     PROC_WRITE,
//     PROC_SEEK,
//     PROC_TELL,
//     PROC_SIZE,
//     PROC_EXTRACT_ITEM_START,
//     PROC_EXTRACT_ITEM_END,
//     PROC_EXTRACT_FILE_PROGRESS,
//     PROC_VALIDATE_FILE_PROGRESS,
//     OVERWRITE_FILES,
//     PACKAGE_BOUND,
//     PACKAGE_ID,
//     PACKAGE_SIZE,
//     PACKAGE_TOTAL_ALLOCATIONS,
//     PACKAGE_TOTAL_MEMORY_ALLOCATED,
//     PACKAGE_TOTAL_MEMORY_USED,
//     READ_ENCRYPTED,
//     FORCE_DEFRAGMENT,
//     PROC_DEFRAGMENT_PROGRESS,
//     PROC_DEFRAGMENT_PROGRESS_EX,;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
// 
//     public HlOption getForValue(int i) {
//         for (HlOption o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
//         }
//         return null;
//     }
//     
// }
// 
// Path: src/main/java/com/technofovea/hllib/methods/ManagedLibrary.java
// public interface ManagedLibrary extends BasicLibrary, ManagedCalls{       
// 
// }


// Path: src/main/java/com/technofovea/hllib/HlLib.java
import com.sun.jna.FunctionMapper;
import com.sun.jna.NativeLibrary;
import com.technofovea.hllib.methods.FullLibrary;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.technofovea.hllib.enums.HlOption;
import com.technofovea.hllib.methods.ManagedLibrary;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

        options.put(Library.OPTION_TYPE_MAPPER, new HlTypeMapper());
        options.put(Library.OPTION_FUNCTION_MAPPER, func_mapper);

        logger.debug("Detecting architecture from property {}", ARCH_PROPERTY);
        String arch = System.getProperty(ARCH_PROPERTY);
        final String libName;
        if (ARCH_32.equals(arch)) {
            libName = LIBRARY_NAME + ARCH_32_SUFFIX;
        } else if (ARCH_64.equals(arch)) {
            libName = LIBRARY_NAME + ARCH_64_SUFFIX;
        } else {
            logger.warn("Unable to determine architecture (32-bit vs 64-bit) for HlLib. Defaulting to 32bit.");
            libName = LIBRARY_NAME + ARCH_32_SUFFIX;
        }
        logger.info("Loading native library: {}", libName);
        rawInstance = (FullLibrary) Native.loadLibrary(libName, FullLibrary.class, options);

        logger.debug("Calling library initialization function");
        rawInstance.initialize();

        logger.debug("Creating dynamic proxy for library access");
        handler = new InvocationManager(rawInstance);
        ManagedLibrary proxy = (ManagedLibrary) Proxy.newProxyInstance(
                FullLibrary.class.getClassLoader(),
                new Class[]{ManagedLibrary.class},
                handler);

        instance = proxy;


        String version = instance.getString(HlOption.VERSION);