
    Mh
                     p    d Z ddlZej        dk    rddlZddlmZmZmZmZm	Z	 ddl
mZmZmZ nddlZd ZdS )z
Derived from

> https://github.com/rudolfwalter/pygdbmi/blob/0.7.4.2/pygdbmi/gdbcontroller.py
> MIT License  https://github.com/rudolfwalter/pygdbmi/blob/master/LICENSE
> Copyright (c) 2016 Chad Smith <grassfedcode <at> gmail.com>
    Nnt)POINTERWinErrorbyrefwindllwintypes)BOOLDWORDHANDLEc                    t           j        dk    rt          t                    }t	          j        d          }t
          j        j        }t          |||g|_	        t          |_        t          j        |                                           }t
          j                            |t          |          dd          }|dk    rt!          t#                                dS t%          j        | t$          j        t           j                   dS )z
    make file object non-blocking

    Windows doesn't have the fcntl module, but someone on
    stack overflow supplied this code as an answer, and it works
    http://stackoverflow.com/a/34504971/2893090
    r      Nr   )osnamer   r
   r   r   kernel32SetNamedPipeHandleStater   argtypesr	   restypemsvcrtget_osfhandlefilenor   
ValueErrorr   fcntlF_SETFL
O_NONBLOCK)file_objLPDWORDPIPE_NOWAITr   hress         X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/jupyter_lsp/non_blocking.pymake_non_blockingr!      s     
w$%..nZ00"(/"I,2GWg+N(*.' !2!233o55a{9K9KTSWXX!88XZZ((( 8 	HemR];;;;;    )__doc__r   r   r   ctypesr   r   r   r   r   ctypes.wintypesr	   r
   r   r   r!    r"   r    <module>r'      s     
			7d??MMMAAAAAAAAAAAAAA33333333333LLL< < < < <r"   