<commit_before>package org.libvirt.jna;

import com.sun.jna.Callback;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.LongByReference;

/**
 * The libvirt interface which is exposed via JNA.
 */
public interface Libvirt extends Library {
    // Callbacks
    /**
     * Callback interface for authorization
     */
    interface VirConnectAuthCallback extends Callback {
        public int authCallback(virConnectCredential cred, int ncred, Pointer cbdata);
    }

    Libvirt INSTANCE = (Libvirt) Native.loadLibrary("libvirt", Libvirt.class);
    
    // Constants we need
    public static int VIR_UUID_BUFLEN = 16;
    public static int VIR_UUID_STRING_BUFLEN = (36 + 1);
    public static int VIR_DOMAIN_SCHED_FIELD_LENGTH = 80;

    // Connection Functions
    public int virConnCopyLastError(ConnectionPointer virConnectPtr, virError to);
    public int virConnectClose(ConnectionPointer virConnectPtr);
    //TODO Post 0.5.1
    //public String virConnectDomainXMLFromNative(ConnectionPointer virConnectPtr, String nativeFormat, String nativeConfig, int flags) ;
    //public String virConnectDomainXMLToNative(ConnectionPointer virConnectPtr, String nativeFormat, String domainXML, int flags) ;
    public String virConnectFindStoragePoolSources(ConnectionPointer virConnectPtr, String type, String srcSpec, int flags) ;
    public String virConnectGetCapabilities(ConnectionPointer virConnectPtr);
    public String virConnectGetHostname(ConnectionPointer virConnectPtr);
    public int virConnectGetMaxVcpus(ConnectionPointer virConnectPtr, String type);
    public String virConnectGetType(ConnectionPointer virConnectPtr);
    public String virConnectGetURI(ConnectionPointer virConnectPtr);
    public int virConnectGetVersion(ConnectionPointer virConnectPtr, LongByReference hvVer);
    public int virConnectListDefinedDomains(ConnectionPointer virConnectPtr, String[] name, int maxnames);
    public int virConnectListDefinedNetworks(ConnectionPointer virConnectPtr, String[] name, int maxnames);
    public int virConnectListDefinedStoragePools(ConnectionPointer virConnectPtr, String[] names, int maxnames);
    public int virConnectListDomains(ConnectionPointer virConnectPtr, int[] ids, int maxnames);
    //TODO Post 0.5.1
    //public int virConnectListInterfaces(ConnectionPointer virConnectPtr, String[] name, int maxnames);    <commit_msg>Drop the leading lib from libvirt. Based on testing by <EMAIL> this is a better way to load the libarary since the JNA framework will attempt to add the lib onto the front of the library name.<commit_after>package org.libvirt.jna;

import com.sun.jna.Callback;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.LongByReference;

/**
 * The libvirt interface which is exposed via JNA.
 */
public interface Libvirt extends Library {
    // Callbacks
    /**
     * Callback interface for authorization
     */
    interface VirConnectAuthCallback extends Callback {
        public int authCallback(virConnectCredential cred, int ncred, Pointer cbdata);
    }

    Libvirt INSTANCE = (Libvirt) Native.loadLibrary("virt", Libvirt.class);
    
    // Constants we need
    public static int VIR_UUID_BUFLEN = 16;
    public static int VIR_UUID_STRING_BUFLEN = (36 + 1);
    public static int VIR_DOMAIN_SCHED_FIELD_LENGTH = 80;

    // Connection Functions
    public int virConnCopyLastError(ConnectionPointer virConnectPtr, virError to);
    public int virConnectClose(ConnectionPointer virConnectPtr);
    //TODO Post 0.5.1
    //public String virConnectDomainXMLFromNative(ConnectionPointer virConnectPtr, String nativeFormat, String nativeConfig, int flags) ;
    //public String virConnectDomainXMLToNative(ConnectionPointer virConnectPtr, String nativeFormat, String domainXML, int flags) ;
    public String virConnectFindStoragePoolSources(ConnectionPointer virConnectPtr, String type, String srcSpec, int flags) ;
    public String virConnectGetCapabilities(ConnectionPointer virConnectPtr);
    public String virConnectGetHostname(ConnectionPointer virConnectPtr);
    public int virConnectGetMaxVcpus(ConnectionPointer virConnectPtr, String type);
    public String virConnectGetType(ConnectionPointer virConnectPtr);
    public String virConnectGetURI(ConnectionPointer virConnectPtr);
    public int virConnectGetVersion(ConnectionPointer virConnectPtr, LongByReference hvVer);
    public int virConnectListDefinedDomains(ConnectionPointer virConnectPtr, String[] name, int maxnames);
    public int virConnectListDefinedNetworks(ConnectionPointer virConnectPtr, String[] name, int maxnames);
    public int virConnectListDefinedStoragePools(ConnectionPointer virConnectPtr, String[] names, int maxnames);
    public int virConnectListDomains(ConnectionPointer virConnectPtr, int[] ids, int maxnames);
    //TODO Post 0.5.1
    //public int virConnectListInterfaces(ConnectionPointer virConnectPtr, String[] name, int maxnames);    
{'fraction_non_alphanumeric': 0.06940674680108569, 'fraction_numerical': 0.005040713454827452, 'mean_word_length': 5.119810201660735, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4615532', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1361, 'n_words': 408}