code: def unpack_glist(glist_ptr, cffi_type, transfer_full=True):
      
  
      current = glist_ptr
      while current:
          yield ffi.cast(cffi_type, current.data)
          if transfer_full:
              free(current.data)
          current = current.next
      if transfer_full:
          lib.g_list_free(glist_ptr)
docs: Takes a glist ptr, copies the values casted to type_ in to a list
      and frees all items and the list.
  
      If an item is returned all yielded before are invalid.