Commit 5766213f authored by Olivier Aubert's avatar Olivier Aubert

python-ctypes: implement consistency checker, and fix detected errors in include files

parent d3b60bf0
...@@ -694,6 +694,10 @@ if __name__ == '__main__': ...@@ -694,6 +694,10 @@ if __name__ == '__main__':
default=False, default=False,
help="Debug mode") help="Debug mode")
opt.add_option("-c", "--check", dest="check", action="store_true",
default=False,
help="Check mode")
opt.add_option("-o", "--output", dest="output", action="store", opt.add_option("-o", "--output", dest="output", action="store",
type="str", default="-", type="str", default="-",
help="Output filename") help="Output filename")
...@@ -705,9 +709,21 @@ if __name__ == '__main__': ...@@ -705,9 +709,21 @@ if __name__ == '__main__':
sys.exit(1) sys.exit(1)
p=Parser(args) p=Parser(args)
if options.check:
# Various consistency checks.
for (rt, name, params, comment) in p.methods:
if not comment.strip():
print "No comment for %s" % name
continue
names=comment_re.findall(comment)
if len(names) != len(params):
print "Docstring comment parameters mismatch for %s" % name
if options.debug: if options.debug:
p.dump_methods() p.dump_methods()
p.dump_enums() p.dump_enums()
if options.check or options.debug:
sys.exit(0) sys.exit(0)
g=PythonGenerator(p) g=PythonGenerator(p)
......
...@@ -257,6 +257,8 @@ VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *p ...@@ -257,6 +257,8 @@ VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *p
* Frees an heap allocation (char *) returned by a LibVLC API. * Frees an heap allocation (char *) returned by a LibVLC API.
* If you know you're using the same underlying C run-time as the LibVLC * If you know you're using the same underlying C run-time as the LibVLC
* implementation, then you can call ANSI C free() directly instead. * implementation, then you can call ANSI C free() directly instead.
*
* \param ptr the pointer
*/ */
VLC_PUBLIC_API void libvlc_free( void *ptr ); VLC_PUBLIC_API void libvlc_free( void *ptr );
......
...@@ -42,6 +42,13 @@ ...@@ -42,6 +42,13 @@
typedef struct libvlc_media_library_t libvlc_media_library_t; typedef struct libvlc_media_library_t libvlc_media_library_t;
/**
* Create an new Media Library object
*
* \param p_libvlc_instance the libvlc instance
* \param p_e an initialized exception pointer
*/
VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
VLC_PUBLIC_API libvlc_media_library_t * VLC_PUBLIC_API libvlc_media_library_t *
libvlc_media_library_new( libvlc_instance_t * p_inst, libvlc_media_library_new( libvlc_instance_t * p_inst,
libvlc_exception_t * p_e ); libvlc_exception_t * p_e );
......
...@@ -222,7 +222,7 @@ VLC_PUBLIC_API libvlc_media_list_view_t * ...@@ -222,7 +222,7 @@ VLC_PUBLIC_API libvlc_media_list_view_t *
* Get a hierarchical media list view of media list items * Get a hierarchical media list view of media list items
* *
* \param p_ml a media list instance * \param p_ml a media list instance
* \param p_ex an excpetion instance * \param p_ex an exception instance
* \return hierarchical media list view instance * \return hierarchical media list view instance
*/ */
VLC_PUBLIC_API libvlc_media_list_view_t * VLC_PUBLIC_API libvlc_media_list_view_t *
......
...@@ -211,6 +211,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_ ...@@ -211,6 +211,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_
/** /**
* Get the agl handler previously set with libvlc_media_player_set_agl(). * Get the agl handler previously set with libvlc_media_player_set_agl().
* *
* \param p_mi the Media Player
* \return the agl handler or 0 if none where set * \return the agl handler or 0 if none where set
*/ */
VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi ); VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
...@@ -257,6 +258,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_m ...@@ -257,6 +258,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_m
* even if VLC is not currently using it (for instance if it is playing an * even if VLC is not currently using it (for instance if it is playing an
* audio-only input). * audio-only input).
* *
* \param p_mi the Media Player
* \return an X window ID, or 0 if none where set. * \return an X window ID, or 0 if none where set.
*/ */
VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi ); VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
...@@ -277,6 +279,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, ...@@ -277,6 +279,7 @@ VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi,
* libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
* is not currently outputting any video to it. * is not currently outputting any video to it.
* *
* \param p_mi the Media Player
* \return a window handle or NULL if there are none. * \return a window handle or NULL if there are none.
*/ */
VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi ); VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
......
...@@ -99,7 +99,7 @@ mediacontrol_exception_cleanup( mediacontrol_Exception *exception ); ...@@ -99,7 +99,7 @@ mediacontrol_exception_cleanup( mediacontrol_Exception *exception );
/** /**
* Free an exception structure created with mediacontrol_exception_create(). * Free an exception structure created with mediacontrol_exception_create().
* \return the exception * \param p_exception the exception to free.
*/ */
VLC_PUBLIC_API void mediacontrol_exception_free(mediacontrol_Exception *exception); VLC_PUBLIC_API void mediacontrol_exception_free(mediacontrol_Exception *exception);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment