<commit_before>import ctypes

#Import handy globals
from _spotify import libspotify, callback


#Structure definitions
class callbacks(ctypes.Structure):
    pass


#Callbacks
cb_playlist_added = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p
)

cb_playlist_removed = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p
)

cb_playlist_moved = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p,
    ctypes.c_int, ctypes.c_int,
    ctypes.c_void_p
)

cb_container_loaded = callback(None, ctypes.c_void_p)


#Completion of structure defs
callbacks._fields_ = [
    ("playlist_added", cb_playlist_added),
    ("playlist_removed", cb_playlist_removed),
    ("playlist_moved", cb_playlist_moved),
    ("container_loaded", cb_container_loaded),
]


add_callbacks = libspotify.sp_playlistcontainer_add_callbacks
add_callbacks.argtypes = [ctypes.c_void_p, callbacks, ctypes.c_void_p]

remove_callbacks = libspotify.sp_playlistcontainer_remove_callbacks
remove_callbacks.argtypes = [ctypes.c_void_p, callbacks, ctypes.c_void_p]

num_playlists = libspotify.sp_playlistcontainer_num_playlists
num_playlists.argtypes = [ctypes.c_void_p]
num_playlists.restype = ctypes.c_int
<commit_msg>_spotify: playlistcontainer: Some fixes in callback prototypes.<commit_after>import ctypes

#Import handy globals
from _spotify import libspotify, callback


#Structure definitions
class callbacks(ctypes.Structure):
    pass


#Callbacks
cb_playlist_added = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p
)

cb_playlist_removed = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p
)

cb_playlist_moved = callback(
    None,
    ctypes.c_void_p, ctypes.c_void_p,
    ctypes.c_int, ctypes.c_int,
    ctypes.c_void_p
)

cb_container_loaded = callback(None, ctypes.c_void_p, ctypes.c_void_p)


#Completion of structure defs
callbacks._fields_ = [
    ("playlist_added", cb_playlist_added),
    ("playlist_removed", cb_playlist_removed),
    ("playlist_moved", cb_playlist_moved),
    ("container_loaded", cb_container_loaded),
]


add_callbacks = libspotify.sp_playlistcontainer_add_callbacks
add_callbacks.argtypes = [ctypes.c_void_p, ctypes.POINTER(callbacks), ctypes.c_void_p]

remove_callbacks = libspotify.sp_playlistcontainer_remove_callbacks
remove_callbacks.argtypes = [ctypes.c_void_p, ctypes.POINTER(callbacks), ctypes.c_void_p]

num_playlists = libspotify.sp_playlistcontainer_num_playlists
num_playlists.argtypes = [ctypes.c_void_p]
num_playlists.restype = ctypes.c_int

{'fraction_non_alphanumeric': 0.08840413318025259, 'fraction_numerical': 0.0, 'mean_word_length': 5.878947368421053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3377792', 'n_tokens_mistral': 1001, 'n_tokens_neox': 1014, 'n_words': 151}