<s> import xcffib <EOL> import struct <EOL> import six <EOL> _events = { } <EOL> _errors = { } <EOL> class STR ( xcffib . Struct ) : <EOL> def __init__ ( self , unpacker ) : <EOL> if isinstance ( unpacker , xcffib . Protobj ) : <EOL> unpacker = xcffib . MemoryUnpacker ( unpacker . pack ( ) ) <EOL> xcffib . Struct . __init__ ( self , unpacker ) <EOL> base = unpacker . offset <EOL> self . name_len , = unpacker . unpack ( "<STR_LIT:B>" ) <EOL> self . name = xcffib . List ( unpacker , "<STR_LIT:c>" , self . name_len ) <EOL> self . bufsize = unpacker . offset - base <EOL> def pack ( self ) : <EOL> buf = six . BytesIO ( ) <EOL> buf . write ( struct . pack ( "<STR_LIT>" , self . name_len ) ) <EOL> buf . write ( xcffib . pack_list ( self . name , "<STR_LIT:c>" ) ) <EOL> return buf . getvalue ( ) <EOL> @ classmethod <EOL> def synthetic ( cls , name_len , name ) : <EOL> self = cls . __new__ ( cls ) <EOL> self . name_len = name_len <EOL> self . name = name <EOL> return self <EOL> class ListExtensionsReply ( xcffib . Reply ) : <EOL> def __init__ ( self , unpacker ) : <EOL> if isinstance ( unpacker , xcffib . Protobj ) : <EOL> unpacker = xcffib . MemoryUnpacker ( unpacker . pack ( ) ) <EOL> xcffib . Reply . __init__ ( self , unpacker ) <EOL> base = unpacker . offset <EOL> self . names_len , = unpacker . unpack ( "<STR_LIT>" ) <EOL> self . names = xcffib . List ( unpacker , STR , self . names_len ) <EOL> self . bufsize = unpacker . offset - base <EOL> class ListExtensionsCookie ( xcffib . Cookie ) : <EOL> reply_type = ListExtensionsReply <EOL> class request_replyExtension ( xcffib . Extension ) : <EOL> def ListExtensions ( self , is_checked = True ) : <EOL> buf = six . BytesIO ( ) <EOL> buf . write ( struct . pack ( "<STR_LIT>" ) ) <EOL> return self . send_request ( <NUM_LIT> , buf , ListExtensionsCookie , is_checked = is_checked ) <EOL> xcffib . _add_ext ( key , request_replyExtension , _events , _errors ) </s>
