#NEWLINE# def struct_from_buffer( library , name , buffer ) : #NEWLINE# #INDENT# ffi_obj = _get_ffi ( library ) #NEWLINE# new_struct_pointer = ffi_obj . new ( ( '%s *' % name ) ) #NEWLINE# new_struct = new_struct_pointer [ 0 ] #NEWLINE# struct_size = sizeof ( library , new_struct ) #NEWLINE# struct_buffer = ffi_obj . buffer ( new_struct_pointer ) #NEWLINE# struct_buffer [ : ] = ffi_obj . buffer ( buffer , struct_size ) [ : ] #NEWLINE# return new_struct_pointer