/**************************************************************/
/* MATRIX.JAVA                                                */
/* Matrix Class Implementation for Java                       */
/*                                                            */
/* Copyright (C) TDi GmbH                                     */
/**************************************************************/

//-------------------------------------------------------------
// If you need to use class packaging, uncomment the following 
// line, but do not change the package name.
// Using class packaging, the Matrix.class have to be placed 
// in: CLASSPATH/de/matrixlock
//-------------------------------------------------------------
//package de.matrixlock;


import java.io.IOException;

public class Matrix   // Do not change this Class name
{

    private static String libName;

    static {
        libName = System.mapLibraryName("matrix32");
        try {
            System.loadLibrary("matrix32");
        }
        catch(UnsatisfiedLinkError e) {
            System.err.println("Unable to load library [" + libName + "]");
            throw e;
        }
    }

    public static native short Init_MatrixAPI();

    public static native short Release_MatrixAPI();

    public static native int GetVersionAPI();

    public static native int GetVersionDRV();

    public static native int GetVersionDRV_USB();

    public static native void SetW95Access(short modus);

    public static native short GetPortAdr(short p);

    public static native short PausePrinterActivity();

    public static native short ResumePrinterActivity();

    public static native short Dongle_Find();

    public static native short Dongle_FindEx(short[] DNG_Info);

    public static native short Dongle_Count(short PortNr);

    public static native int Dongle_Version(short DongleNr, short PortNr);

    public static native int Dongle_Model(short DongleNr, short PortNr);

    public static native short Dongle_MemSize(short DongleNr, short PortNr);

    public static native int Dongle_MemSizeEx(short DongleNr, short PortNr);

    public static native short Dongle_ReadData(int UserCode, int[] pDataIn, short Count,
                                                             short DongleNr, short PortNr);

    public static native short Dongle_ReadDataEx(int UserCode, int[] pDataIn, short Fpos, short Count,
                                                               short DongleNr, short PortNr);

    public static native int Dongle_ReadSerNr(int UserCode, short DongleNr, short PortNr);

    public static native short Dongle_WriteData(int UserCode, int[] pDataOut, short Count,
                                                              short DongleNr, short PortNr);

    public static native short Dongle_WriteDataEx(int UserCode, int[] DataOut, short Fpos, short Count,
                                                                short DongleNr, short PortNr);

    public static native short Dongle_WriteKey(int UserCode, int[] pKeyData, short DongleNr, short PortNr);

    public static native short Dongle_GetKeyFlag(int UserCode, short DongleNr, short PortNr);

    public static native short Dongle_EncryptData(int UserCode, int[] pDataBlock,
                                                                short DongleNr, short PortNr);

    public static native short Dongle_DecryptData(int UserCode, int[] pDataBlock,
                                                                short DongleNr, short PortNr);

    
    public static native short SetConfig_MatrixNet(short nAccess, String nFile);

    public static native int GetConfig_MatrixNet(short Category);

    public static native short LogIn_MatrixNet(int UserCode, short AppSlot, short DongleNr);

    public static native short LogOut_MatrixNet(int UserCode, short AppSlot, short DongleNr);

}

