# Automatically generated by tasks/ffi_codegen.rb

# :nodoc: namespace
module Smartcard::PCSC

# :nodoc: auto-generated
module FFILib
  # Constant values extracted from headers.
  module Consts
    SCARD_S_SUCCESS = 0x00000000
    SCARD_E_CANCELLED = 0x80100002
    SCARD_E_INVALID_HANDLE = 0x80100003
    SCARD_E_INVALID_PARAMETER = 0x80100004
    SCARD_E_INVALID_TARGET = 0x80100005
    SCARD_E_NO_MEMORY = 0x80100006
    SCARD_E_INSUFFICIENT_BUFFER = 0x80100008
    SCARD_E_UNKNOWN_READER = 0x80100009
    SCARD_E_TIMEOUT = 0x8010000A
    SCARD_E_SHARING_VIOLATION = 0x8010000B
    SCARD_E_NO_SMARTCARD = 0x8010000C
    SCARD_E_UNKNOWN_CARD = 0x8010000D
    SCARD_E_CANT_DISPOSE = 0x8010000E
    SCARD_E_PROTO_MISMATCH = 0x8010000F
    SCARD_E_NOT_READY = 0x80100010
    SCARD_E_INVALID_VALUE = 0x80100011
    SCARD_E_SYSTEM_CANCELLED = 0x80100012
    SCARD_E_INVALID_ATR = 0x80100015
    SCARD_E_NOT_TRANSACTED = 0x80100016
    SCARD_E_READER_UNAVAILABLE = 0x80100017
    SCARD_E_PCI_TOO_SMALL = 0x80100019
    SCARD_E_READER_UNSUPPORTED = 0x8010001A
    SCARD_E_DUPLICATE_READER = 0x8010001B
    SCARD_E_CARD_UNSUPPORTED = 0x8010001C
    SCARD_E_NO_SERVICE = 0x8010001D
    SCARD_E_SERVICE_STOPPED = 0x8010001E
    SCARD_E_UNEXPECTED = 0x8010001F
    SCARD_E_UNSUPPORTED_FEATURE = 0x8010001F
    SCARD_E_ICC_INSTALLATION = 0x80100020
    SCARD_E_ICC_CREATEORDER = 0x80100021
    SCARD_E_DIR_NOT_FOUND = 0x80100023
    SCARD_E_FILE_NOT_FOUND = 0x80100024
    SCARD_E_NO_DIR = 0x80100025
    SCARD_E_NO_FILE = 0x80100026
    SCARD_E_NO_ACCESS = 0x80100027
    SCARD_E_WRITE_TOO_MANY = 0x80100028
    SCARD_E_BAD_SEEK = 0x80100029
    SCARD_E_INVALID_CHV = 0x8010002A
    SCARD_E_UNKNOWN_RES_MNG = 0x8010002B
    SCARD_E_NO_SUCH_CERTIFICATE = 0x8010002C
    SCARD_E_CERTIFICATE_UNAVAILABLE = 0x8010002D
    SCARD_E_NO_READERS_AVAILABLE = 0x8010002E
    SCARD_E_COMM_DATA_LOST = 0x8010002F
    SCARD_E_NO_KEY_CONTAINER = 0x80100030
    SCARD_E_SERVER_TOO_BUSY = 0x80100031
    SCARD_W_UNSUPPORTED_CARD = 0x80100065
    SCARD_W_UNRESPONSIVE_CARD = 0x80100066
    SCARD_W_UNPOWERED_CARD = 0x80100067
    SCARD_W_RESET_CARD = 0x80100068
    SCARD_W_REMOVED_CARD = 0x80100069
    SCARD_W_SECURITY_VIOLATION = 0x8010006A
    SCARD_W_WRONG_CHV = 0x8010006B
    SCARD_W_CHV_BLOCKED = 0x8010006C
    SCARD_W_EOF = 0x8010006D
    SCARD_W_CANCELLED_BY_USER = 0x8010006E
    SCARD_W_CARD_NOT_AUTHENTICATED = 0x8010006F
    SCARD_SCOPE_USER = 0x00000000
    SCARD_SCOPE_TERMINAL = 0x00000001
    SCARD_SCOPE_SYSTEM = 0x00000002
    SCARD_PROTOCOL_UNDEFINED = 0x00000000
    SCARD_PROTOCOL_UNSET = 0x00000000
    SCARD_PROTOCOL_T0 = 0x00000001
    SCARD_PROTOCOL_T1 = 0x00000002
    SCARD_PROTOCOL_RAW = 0x00000004
    SCARD_PROTOCOL_T15 = 0x00000008
    SCARD_PROTOCOL_ANY = 0x00000003
    SCARD_SHARE_EXCLUSIVE = 0x00000001
    SCARD_SHARE_SHARED = 0x00000002
    SCARD_SHARE_DIRECT = 0x00000003
    SCARD_LEAVE_CARD = 0x00000000
    SCARD_RESET_CARD = 0x00000001
    SCARD_UNPOWER_CARD = 0x00000002
    SCARD_EJECT_CARD = 0x00000003
    SCARD_ATTR_VENDOR_NAME = 0x00010100
    SCARD_ATTR_VENDOR_IFD_TYPE = 0x00010101
    SCARD_ATTR_VENDOR_IFD_VERSION = 0x00010102
    SCARD_ATTR_VENDOR_IFD_SERIAL_NO = 0x00010103
    SCARD_ATTR_CHANNEL_ID = 0x00020110
    SCARD_ATTR_ASYNC_PROTOCOL_TYPES = 0x00030120
    SCARD_ATTR_DEFAULT_CLK = 0x00030121
    SCARD_ATTR_MAX_CLK = 0x00030122
    SCARD_ATTR_DEFAULT_DATA_RATE = 0x00030123
    SCARD_ATTR_MAX_DATA_RATE = 0x00030124
    SCARD_ATTR_MAX_IFSD = 0x00030125
    SCARD_ATTR_SYNC_PROTOCOL_TYPES = 0x00030126
    SCARD_ATTR_POWER_MGMT_SUPPORT = 0x00040131
    SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE = 0x00050140
    SCARD_ATTR_USER_AUTH_INPUT_DEVICE = 0x00050142
    SCARD_ATTR_CHARACTERISTICS = 0x00060150
    SCARD_ATTR_CURRENT_PROTOCOL_TYPE = 0x00080201
    SCARD_ATTR_CURRENT_CLK = 0x00080202
    SCARD_ATTR_CURRENT_F = 0x00080203
    SCARD_ATTR_CURRENT_D = 0x00080204
    SCARD_ATTR_CURRENT_N = 0x00080205
    SCARD_ATTR_CURRENT_W = 0x00080206
    SCARD_ATTR_CURRENT_IFSC = 0x00080207
    SCARD_ATTR_CURRENT_IFSD = 0x00080208
    SCARD_ATTR_CURRENT_BWT = 0x00080209
    SCARD_ATTR_CURRENT_CWT = 0x0008020A
    SCARD_ATTR_CURRENT_EBC_ENCODING = 0x0008020B
    SCARD_ATTR_EXTENDED_BWT = 0x0008020C
    SCARD_ATTR_ICC_PRESENCE = 0x00090300
    SCARD_ATTR_ICC_INTERFACE_STATUS = 0x00090301
    SCARD_ATTR_CURRENT_IO_STATE = 0x00090302
    SCARD_ATTR_ATR_STRING = 0x00090303
    SCARD_ATTR_ICC_TYPE_PER_ATR = 0x00090304
    SCARD_ATTR_ESC_RESET = 0x0007A000
    SCARD_ATTR_ESC_CANCEL = 0x0007A003
    SCARD_ATTR_ESC_AUTHREQUEST = 0x0007A005
    SCARD_ATTR_MAXINPUT = 0x0007A007
    SCARD_ATTR_DEVICE_UNIT = 0x7FFF0001
    SCARD_ATTR_DEVICE_IN_USE = 0x7FFF0002
    SCARD_ATTR_DEVICE_FRIENDLY_NAME_A = 0x7FFF0003
    SCARD_ATTR_DEVICE_SYSTEM_NAME_A = 0x7FFF0004
    SCARD_ATTR_DEVICE_FRIENDLY_NAME_W = 0x7FFF0005
    SCARD_ATTR_DEVICE_SYSTEM_NAME_W = 0x7FFF0006
    SCARD_ATTR_SUPRESS_T1_IFS_REQUEST = 0x7FFF0007
    SCARD_ATTR_DEVICE_FRIENDLY_NAME = 0x7FFF0003
    SCARD_ATTR_DEVICE_SYSTEM_NAME = 0x7FFF0004
    SCARD_STATE_UNAWARE = 0x00000000
    SCARD_STATE_IGNORE = 0x00000001
    SCARD_STATE_CHANGED = 0x00000002
    SCARD_STATE_UNKNOWN = 0x00000004
    SCARD_STATE_UNAVAILABLE = 0x00000008
    SCARD_STATE_EMPTY = 0x00000010
    SCARD_STATE_PRESENT = 0x00000020
    SCARD_STATE_ATRMATCH = 0x00000040
    SCARD_STATE_EXCLUSIVE = 0x00000080
    SCARD_STATE_INUSE = 0x00000100
    SCARD_STATE_MUTE = 0x00000200
    SCARD_STATE_UNPOWERED = 0x00000400
    SCARD_AUTOALLOCATE = 0xFFFFFFFF
    SCARD_UNKNOWN = 0x00000001
    SCARD_ABSENT = 0x00000002
    SCARD_PRESENT = 0x00000004
    SCARD_SWALLOWED = 0x00000008
    SCARD_POWERED = 0x00000010
    SCARD_NEGOTIABLE = 0x00000020
    SCARD_SPECIFIC = 0x00000040
    MAX_ATR_SIZE = 0x00000021
    INFINITE = 0xFFFFFFFF
  end  # module Smartcard::PCSC::FFILib::Consts

  # Error codes returned by the PCSC functions.
  Status = enum [
    :success, Consts::SCARD_S_SUCCESS,
    :cancelled, Consts::SCARD_E_CANCELLED,
    :invalid_handle, Consts::SCARD_E_INVALID_HANDLE,
    :invalid_parameter, Consts::SCARD_E_INVALID_PARAMETER,
    :invalid_target, Consts::SCARD_E_INVALID_TARGET,
    :no_memory, Consts::SCARD_E_NO_MEMORY,
    :insufficient_buffer, Consts::SCARD_E_INSUFFICIENT_BUFFER,
    :unknown_reader, Consts::SCARD_E_UNKNOWN_READER,
    :timeout, Consts::SCARD_E_TIMEOUT,
    :sharing_violation, Consts::SCARD_E_SHARING_VIOLATION,
    :no_smartcard, Consts::SCARD_E_NO_SMARTCARD,
    :unknown_card, Consts::SCARD_E_UNKNOWN_CARD,
    :cant_dispose, Consts::SCARD_E_CANT_DISPOSE,
    :proto_mismatch, Consts::SCARD_E_PROTO_MISMATCH,
    :not_ready, Consts::SCARD_E_NOT_READY,
    :invalid_value, Consts::SCARD_E_INVALID_VALUE,
    :system_cancelled, Consts::SCARD_E_SYSTEM_CANCELLED,
    :invalid_atr, Consts::SCARD_E_INVALID_ATR,
    :not_transacted, Consts::SCARD_E_NOT_TRANSACTED,
    :reader_unavailable, Consts::SCARD_E_READER_UNAVAILABLE,
    :pci_too_small, Consts::SCARD_E_PCI_TOO_SMALL,
    :reader_unsupported, Consts::SCARD_E_READER_UNSUPPORTED,
    :duplicate_reader, Consts::SCARD_E_DUPLICATE_READER,
    :card_unsupported, Consts::SCARD_E_CARD_UNSUPPORTED,
    :no_service, Consts::SCARD_E_NO_SERVICE,
    :service_stopped, Consts::SCARD_E_SERVICE_STOPPED,
    :unexpected, Consts::SCARD_E_UNEXPECTED,
    :unsupported_feature, Consts::SCARD_E_UNSUPPORTED_FEATURE,
    :icc_installation, Consts::SCARD_E_ICC_INSTALLATION,
    :icc_createorder, Consts::SCARD_E_ICC_CREATEORDER,
    :dir_not_found, Consts::SCARD_E_DIR_NOT_FOUND,
    :file_not_found, Consts::SCARD_E_FILE_NOT_FOUND,
    :no_dir, Consts::SCARD_E_NO_DIR,
    :no_file, Consts::SCARD_E_NO_FILE,
    :no_access, Consts::SCARD_E_NO_ACCESS,
    :write_too_many, Consts::SCARD_E_WRITE_TOO_MANY,
    :bad_seek, Consts::SCARD_E_BAD_SEEK,
    :invalid_chv, Consts::SCARD_E_INVALID_CHV,
    :unknown_res_mng, Consts::SCARD_E_UNKNOWN_RES_MNG,
    :no_such_certificate, Consts::SCARD_E_NO_SUCH_CERTIFICATE,
    :certificate_unavailable, Consts::SCARD_E_CERTIFICATE_UNAVAILABLE,
    :no_readers_available, Consts::SCARD_E_NO_READERS_AVAILABLE,
    :comm_data_lost, Consts::SCARD_E_COMM_DATA_LOST,
    :no_key_container, Consts::SCARD_E_NO_KEY_CONTAINER,
    :server_too_busy, Consts::SCARD_E_SERVER_TOO_BUSY,
    :unsupported_card, Consts::SCARD_W_UNSUPPORTED_CARD,
    :unresponsive_card, Consts::SCARD_W_UNRESPONSIVE_CARD,
    :unpowered_card, Consts::SCARD_W_UNPOWERED_CARD,
    :reset_card, Consts::SCARD_W_RESET_CARD,
    :removed_card, Consts::SCARD_W_REMOVED_CARD,
    :security_violation, Consts::SCARD_W_SECURITY_VIOLATION,
    :wrong_chv, Consts::SCARD_W_WRONG_CHV,
    :chv_blocked, Consts::SCARD_W_CHV_BLOCKED,
    :eof, Consts::SCARD_W_EOF,
    :cancelled_by_user, Consts::SCARD_W_CANCELLED_BY_USER,
    :card_not_authenticated, Consts::SCARD_W_CARD_NOT_AUTHENTICATED,
  ]

  # Values for the context's scope.
  Scope = enum [
    :user, Consts::SCARD_SCOPE_USER,
    :terminal, Consts::SCARD_SCOPE_TERMINAL,
    :system, Consts::SCARD_SCOPE_SYSTEM,
  ]

  # Smart-card communication protocols.
  Protocol = enum [
    :undefined, Consts::SCARD_PROTOCOL_UNDEFINED,
    :unset, Consts::SCARD_PROTOCOL_UNSET,
    :t0, Consts::SCARD_PROTOCOL_T0,
    :t1, Consts::SCARD_PROTOCOL_T1,
    :raw, Consts::SCARD_PROTOCOL_RAW,
    :t15, Consts::SCARD_PROTOCOL_T15,
    :any, Consts::SCARD_PROTOCOL_ANY,
  ]

  # Smart-card sharing modes.
  Share = enum [
    :exclusive, Consts::SCARD_SHARE_EXCLUSIVE,
    :shared, Consts::SCARD_SHARE_SHARED,
    :direct, Consts::SCARD_SHARE_DIRECT,
  ]

  # Smart-card dispositions.
  Disposition = enum [
    :leave, Consts::SCARD_LEAVE_CARD,
    :reset, Consts::SCARD_RESET_CARD,
    :unpower, Consts::SCARD_UNPOWER_CARD,
    :eject, Consts::SCARD_EJECT_CARD,
  ]

  # Smart-card reader attributes.
  Attribute = enum [
    :vendor_name, Consts::SCARD_ATTR_VENDOR_NAME,
    :vendor_ifd_type, Consts::SCARD_ATTR_VENDOR_IFD_TYPE,
    :vendor_ifd_version, Consts::SCARD_ATTR_VENDOR_IFD_VERSION,
    :vendor_ifd_serial_no, Consts::SCARD_ATTR_VENDOR_IFD_SERIAL_NO,
    :channel_id, Consts::SCARD_ATTR_CHANNEL_ID,
    :async_protocol_types, Consts::SCARD_ATTR_ASYNC_PROTOCOL_TYPES,
    :default_clk, Consts::SCARD_ATTR_DEFAULT_CLK,
    :max_clk, Consts::SCARD_ATTR_MAX_CLK,
    :default_data_rate, Consts::SCARD_ATTR_DEFAULT_DATA_RATE,
    :max_data_rate, Consts::SCARD_ATTR_MAX_DATA_RATE,
    :max_ifsd, Consts::SCARD_ATTR_MAX_IFSD,
    :sync_protocol_types, Consts::SCARD_ATTR_SYNC_PROTOCOL_TYPES,
    :power_mgmt_support, Consts::SCARD_ATTR_POWER_MGMT_SUPPORT,
    :user_to_card_auth_device, Consts::SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE,
    :user_auth_input_device, Consts::SCARD_ATTR_USER_AUTH_INPUT_DEVICE,
    :characteristics, Consts::SCARD_ATTR_CHARACTERISTICS,
    :current_protocol_type, Consts::SCARD_ATTR_CURRENT_PROTOCOL_TYPE,
    :current_clk, Consts::SCARD_ATTR_CURRENT_CLK,
    :current_f, Consts::SCARD_ATTR_CURRENT_F,
    :current_d, Consts::SCARD_ATTR_CURRENT_D,
    :current_n, Consts::SCARD_ATTR_CURRENT_N,
    :current_w, Consts::SCARD_ATTR_CURRENT_W,
    :current_ifsc, Consts::SCARD_ATTR_CURRENT_IFSC,
    :current_ifsd, Consts::SCARD_ATTR_CURRENT_IFSD,
    :current_bwt, Consts::SCARD_ATTR_CURRENT_BWT,
    :current_cwt, Consts::SCARD_ATTR_CURRENT_CWT,
    :current_ebc_encoding, Consts::SCARD_ATTR_CURRENT_EBC_ENCODING,
    :extended_bwt, Consts::SCARD_ATTR_EXTENDED_BWT,
    :icc_presence, Consts::SCARD_ATTR_ICC_PRESENCE,
    :icc_interface_status, Consts::SCARD_ATTR_ICC_INTERFACE_STATUS,
    :current_io_state, Consts::SCARD_ATTR_CURRENT_IO_STATE,
    :atr_string, Consts::SCARD_ATTR_ATR_STRING,
    :icc_type_per_atr, Consts::SCARD_ATTR_ICC_TYPE_PER_ATR,
    :esc_reset, Consts::SCARD_ATTR_ESC_RESET,
    :esc_cancel, Consts::SCARD_ATTR_ESC_CANCEL,
    :esc_authrequest, Consts::SCARD_ATTR_ESC_AUTHREQUEST,
    :maxinput, Consts::SCARD_ATTR_MAXINPUT,
    :device_unit, Consts::SCARD_ATTR_DEVICE_UNIT,
    :device_in_use, Consts::SCARD_ATTR_DEVICE_IN_USE,
    :device_friendly_name_a, Consts::SCARD_ATTR_DEVICE_FRIENDLY_NAME_A,
    :device_system_name_a, Consts::SCARD_ATTR_DEVICE_SYSTEM_NAME_A,
    :device_friendly_name_w, Consts::SCARD_ATTR_DEVICE_FRIENDLY_NAME_W,
    :device_system_name_w, Consts::SCARD_ATTR_DEVICE_SYSTEM_NAME_W,
    :supress_t1_ifs_request, Consts::SCARD_ATTR_SUPRESS_T1_IFS_REQUEST,
    :device_friendly_name, Consts::SCARD_ATTR_DEVICE_FRIENDLY_NAME,
    :device_system_name, Consts::SCARD_ATTR_DEVICE_SYSTEM_NAME,
  ]

  # Smart-card states.
  CardState = enum [
    :unaware, Consts::SCARD_STATE_UNAWARE,
    :ignore, Consts::SCARD_STATE_IGNORE,
    :changed, Consts::SCARD_STATE_CHANGED,
    :unknown, Consts::SCARD_STATE_UNKNOWN,
    :unavailable, Consts::SCARD_STATE_UNAVAILABLE,
    :empty, Consts::SCARD_STATE_EMPTY,
    :present, Consts::SCARD_STATE_PRESENT,
    :atrmatch, Consts::SCARD_STATE_ATRMATCH,
    :exclusive, Consts::SCARD_STATE_EXCLUSIVE,
    :inuse, Consts::SCARD_STATE_INUSE,
    :mute, Consts::SCARD_STATE_MUTE,
    :unpowered, Consts::SCARD_STATE_UNPOWERED,
  ]

  # Smart-card reader states.
  State = enum [
    :autoallocate, Consts::SCARD_AUTOALLOCATE,
    :unknown, Consts::SCARD_UNKNOWN,
    :absent, Consts::SCARD_ABSENT,
    :present, Consts::SCARD_PRESENT,
    :swallowed, Consts::SCARD_SWALLOWED,
    :powered, Consts::SCARD_POWERED,
    :negotiable, Consts::SCARD_NEGOTIABLE,
    :specific, Consts::SCARD_SPECIFIC,
  ]

end  # module Smartcard::PCSC::FFILib
end  # namespace Smartcard::PCSC
