// Path: src/main/java/com/technofovea/hllib/enums/PackageType.java
// public enum PackageType implements JnaEnum<PackageType> {
// 
//     NONE,
//     BSP,
//     GCF,
//     PAK,
//     VBSP,
//     WAD,
//     XZP,
//     ZIP,
//     NCF,
//     VPK;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
//     public PackageType getForValue(
//             int i) {
//         for (PackageType o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
// 
//         }
//         return null;
//     }
// }
// 
// 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/methods/ManagedCalls.java
// public interface ManagedCalls {
// 
//     public int itemGetSize(DirectoryItem item);
// 
//     public int itemGetSizeOnDisk(DirectoryItem item);
// 
//     public long itemGetSizeEx(DirectoryItem item);
// 
//     public long itemGetSizeOnDiskEx(DirectoryItem item);
// 
//     public String itemGetPath(DirectoryItem item);
// 
//     public HlPackage getCurrentlyBoundPackage();
// 
//     public HlPackage createPackage(PackageType ePackageType);
// 
//     public PackageType getPackageType(File f);
// 
//     /**
//      * Replaces packageClose() and packageDelete() with a single call, primarily
//      * to make it easier to handle the safe marking of HlPackage and DirectoryItem
//      * objects as invalid.
//      * @param pkg The package to remove and close.
//      */
//     public void packageRemove(HlPackage pkg);
// 
//     public void packageRemoveAll();
// 
//     public boolean packageGetExtractable(DirectoryItem file);
// 
//     public int packageGetFileSize(DirectoryItem file);
// 
//     public int packageGetFileSizeOnDisk(DirectoryItem file);
// 
//     public HlStream packageCreateStream(DirectoryItem file);
// 
//     public HlStream fileCreateStream(DirectoryItem item);
// }


import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.ptr.ByteByReference;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.LongByReference;
import com.sun.jna.ptr.PointerByReference;
import com.technofovea.hllib.enums.PackageType;
import com.technofovea.hllib.methods.FullLibrary;
import com.technofovea.hllib.methods.ManagedCalls;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

package com.technofovea.hllib;


/**
 *
 * @author Darien Hager
 */
class ManagedCallImpl implements ManagedCalls {

    private static final Logger logger = LoggerFactory.getLogger(DirectoryItem.class);
    static final int PATH_BUFFER_SIZE = 512;
    byte[] pathBuffer = new byte[PATH_BUFFER_SIZE];
// Path: src/main/java/com/technofovea/hllib/enums/PackageType.java
// public enum PackageType implements JnaEnum<PackageType> {
// 
//     NONE,
//     BSP,
//     GCF,
//     PAK,
//     VBSP,
//     WAD,
//     XZP,
//     ZIP,
//     NCF,
//     VPK;
//     
//     private static int start = 0;
// 
//     public int getIntValue() {
//         return this.ordinal() + start;
//     }
// 
//     public PackageType getForValue(
//             int i) {
//         for (PackageType o : this.values()) {
//             if (o.getIntValue() == i) {
//                 return o;
//             }
// 
//         }
//         return null;
//     }
// }
// 
// 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/methods/ManagedCalls.java
// public interface ManagedCalls {
// 
//     public int itemGetSize(DirectoryItem item);
// 
//     public int itemGetSizeOnDisk(DirectoryItem item);
// 
//     public long itemGetSizeEx(DirectoryItem item);
// 
//     public long itemGetSizeOnDiskEx(DirectoryItem item);
// 
//     public String itemGetPath(DirectoryItem item);
// 
//     public HlPackage getCurrentlyBoundPackage();
// 
//     public HlPackage createPackage(PackageType ePackageType);
// 
//     public PackageType getPackageType(File f);
// 
//     /**
//      * Replaces packageClose() and packageDelete() with a single call, primarily
//      * to make it easier to handle the safe marking of HlPackage and DirectoryItem
//      * objects as invalid.
//      * @param pkg The package to remove and close.
//      */
//     public void packageRemove(HlPackage pkg);
// 
//     public void packageRemoveAll();
// 
//     public boolean packageGetExtractable(DirectoryItem file);
// 
//     public int packageGetFileSize(DirectoryItem file);
// 
//     public int packageGetFileSizeOnDisk(DirectoryItem file);
// 
//     public HlStream packageCreateStream(DirectoryItem file);
// 
//     public HlStream fileCreateStream(DirectoryItem item);
// }


// Path: src/main/java/com/technofovea/hllib/ManagedCallImpl.java
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.ptr.ByteByReference;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.LongByReference;
import com.sun.jna.ptr.PointerByReference;
import com.technofovea.hllib.enums.PackageType;
import com.technofovea.hllib.methods.FullLibrary;
import com.technofovea.hllib.methods.ManagedCalls;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


package com.technofovea.hllib;


/**
 *
 * @author Darien Hager
 */
class ManagedCallImpl implements ManagedCalls {

    private static final Logger logger = LoggerFactory.getLogger(DirectoryItem.class);
    static final int PATH_BUFFER_SIZE = 512;
    byte[] pathBuffer = new byte[PATH_BUFFER_SIZE];
    FullLibrary lib;