EU\@smddlmZmZmZddlTddlZddlZddZddZGdd d Z dS) )CDLLc_char_pc_long)*NcCs^t|jdtdtdt}|jd|jd\}}|j|jd|gS)Nstdoutstdinstderrinputzutf-8)PopensplitPIPEZ communicateencode returncodedecode)progtextZp1resulterrrO/Users/gjtorikian/Development/commonmarker/ext/commonmarker/cmark/test/cmark.pypipe_through_prog s$!rcCs=|jd}t|}d|||djddgS)Nzutf-8r)r lenr)librZ textbytesZtextlenrrr use_librarys rc@s"eZdZddddZdS)CMarkNcs|_r'fdd|_ntj}|dkrHd}n|dkr]d}nd}|rtjj||}ntjjdd |}t|}|jt _ t t g_ fd d|_dS) Ncs t|S)N)r)x)rrrsz CMark.__init__..ZDarwinzlibcmark.dylibZWindowsz cmark.dllz libcmark.soZbuildsrccs t|S)N)r)r)markdownrrr(s) rto_htmlplatformsystemospathjoinrZcmark_markdown_to_htmlrZrestyperZargtypes)selfr library_dirsysnameZlibnameZlibpathcmarkr)rrr__init__s"         zCMark.__init__)__name__ __module__ __qualname__r*rrrrrs r) Zctypesrrr subprocessr!r#rrrrrrrs