U
    •uÄc˜
  ã                
   @   s´   d dl Z d dlmZ eƒ Ze d¡ de jkrBe jd dkrBdZndZee j 	e j 
e¡d¡ƒ�,Ze ¡ Zejd	eg d
ddddged� W 5 Q R X G dd„ dƒZedkr°e ¡  dS )é    N)ÚFFIa1  
    void* nvx_utf8vld_new ();

    void nvx_utf8vld_reset (void* utf8vld);

    int nvx_utf8vld_validate (void* utf8vld, const uint8_t* data, size_t length);

    void nvx_utf8vld_free (void* utf8vld);

    int nvx_utf8vld_set_impl(void* utf8vld, int impl);

    int nvx_utf8vld_get_impl(void* utf8vld);
ÚAUTOBAHN_USE_NVX)Ú1ÚtrueFTz_utf8validator.cÚ_nvx_utf8validatorz-std=c99z-Wallz-Wno-strict-prototypesz-O3z-march=native)Ú	librariesÚextra_compile_argsÚoptionalc                   @   s(   e Zd ZdZdd„ Zdd„ Zdd„ ZdS )	ÚUtf8Validatorz
    :noindex:
    c                 C   s6   t | _ ddlm} || _| j  | j ¡ | jj¡| _d S )Nr   )Úlib)Úffir   r   ÚgcZnvx_utf8vld_newZnvx_utf8vld_freeÚ_vld)Úselfr   © r   ú^/var/www/html/VPFITNESS/school/venv/lib/python3.8/site-packages/autobahn/nvx/_utf8validator.pyÚ__init__D   s    zUtf8Validator.__init__c                 C   s   | j  | j¡ d S )N)r   Znvx_utf8vld_resetr   )r   r   r   r   ÚresetM   s    zUtf8Validator.resetc                 C   s*   | j  | j|t|ƒ¡}|dk|dkd d fS )Nr   )r   Znvx_utf8vld_validater   Úlen)r   ÚbaÚresr   r   r   ÚvalidateP   s    zUtf8Validator.validateN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r
   ?   s   	r
   Ú__main__)ÚosÚcffir   r   ÚcdefÚenvironr	   ÚopenÚpathÚjoinÚdirnameÚ__file__ÚfdÚreadZc_sourceÚ
set_sourcer
   r   Úcompiler   r   r   r   Ú<module>   s$   
û	