[vlc-devel] commit: python-ctypes: implement consistency checker, and fix detected errors in include files (Olivier Aubert )
git version control
git at videolan.org
Thu Sep 3 17:34:29 CEST 2009
vlc | branch: master | Olivier Aubert <olivier.aubert at liris.cnrs.fr> | Thu Sep 3 17:33:43 2009 +0200| [5766213f77a685253976323373e9b11998c8aa0a] | committer: Olivier Aubert
python-ctypes: implement consistency checker, and fix detected errors in include files
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5766213f77a685253976323373e9b11998c8aa0a
---
bindings/python-ctypes/generate.py | 16 ++++++++++++++++
include/vlc/libvlc.h | 2 ++
include/vlc/libvlc_media_library.h | 7 +++++++
include/vlc/libvlc_media_list.h | 2 +-
include/vlc/libvlc_media_player.h | 3 +++
include/vlc/mediacontrol.h | 2 +-
6 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/bindings/python-ctypes/generate.py b/bindings/python-ctypes/generate.py
index 05f39a7..abeadf8 100755
--- a/bindings/python-ctypes/generate.py
+++ b/bindings/python-ctypes/generate.py
@@ -694,6 +694,10 @@ if __name__ == '__main__':
default=False,
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",
type="str", default="-",
help="Output filename")
@@ -705,9 +709,21 @@ if __name__ == '__main__':
sys.exit(1)
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:
p.dump_methods()
p.dump_enums()
+
+ if options.check or options.debug:
sys.exit(0)
g=PythonGenerator(p)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 31e11d3..3e45bfe 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -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.
* 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.
+ *
+ * \param ptr the pointer
*/
VLC_PUBLIC_API void libvlc_free( void *ptr );
diff --git a/include/vlc/libvlc_media_library.h b/include/vlc/libvlc_media_library.h
index d2192bc..0dfbb4d 100644
--- a/include/vlc/libvlc_media_library.h
+++ b/include/vlc/libvlc_media_library.h
@@ -42,6 +42,13 @@
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 *
libvlc_media_library_new( libvlc_instance_t * p_inst,
libvlc_exception_t * p_e );
diff --git a/include/vlc/libvlc_media_list.h b/include/vlc/libvlc_media_list.h
index b9cc188..1274df2 100644
--- a/include/vlc/libvlc_media_list.h
+++ b/include/vlc/libvlc_media_list.h
@@ -222,7 +222,7 @@ VLC_PUBLIC_API libvlc_media_list_view_t *
* Get a hierarchical media list view of media list items
*
* \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
*/
VLC_PUBLIC_API libvlc_media_list_view_t *
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 4bf4b67..9e54525 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -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().
*
+ * \param p_mi the Media Player
* \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 );
@@ -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
* audio-only input).
*
+ * \param p_mi the Media Player
* \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 );
@@ -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
* is not currently outputting any video to it.
*
+ * \param p_mi the Media Player
* \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 );
diff --git a/include/vlc/mediacontrol.h b/include/vlc/mediacontrol.h
index 7f04455..5b4f45d 100644
--- a/include/vlc/mediacontrol.h
+++ b/include/vlc/mediacontrol.h
@@ -99,7 +99,7 @@ mediacontrol_exception_cleanup( mediacontrol_Exception *exception );
/**
* 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);
More information about the vlc-devel
mailing list