File: //opt/alt/python37/lib/python3.7/site-packages/asn1crypto/__pycache__/_ffi.cpython-37.pyc
B
    B�W�  �               @   sf   d Z ddlmZmZmZmZ ddlmZ dd� Zddd�Z	d	d
� Z
G dd� de�ZG d
d� de�Z
dS )z�
FFI helper compatibility functions. Exports the following items:
 - LibraryNotFoundError
 - FFIEngineError
 - bytes_from_buffer()
 - buffer_from_bytes()
 - null()
�    )�unicode_literals�division�absolute_import�print_function)�create_string_bufferc             C   s   t | �S )N)r   )Zinitializer� r   �@/opt/alt/python37/lib/python3.7/site-packages/asn1crypto/_ffi.py�buffer_from_bytes   s    r	   Nc             C   s   | j S )N)�raw)�buffer�maxlenr   r   r   �bytes_from_buffer   s    r
   c               C   s   d S )Nr   r   r   r   r   �null   s    r   c               @   s   e Zd ZdZdS )�LibraryNotFoundErrorz;
    An exception when trying to find a shared library
    N)�__name__�
__module__�__qualname__�__doc__r   r   r   r   r      s   r   c               @   s   e Zd ZdZdS )�FFIEngineErrorz@
    An exception when trying to instantiate ctypes or cffi
    N)r   r   r   r   r   r   r   r   r   '