]> git.sesse.net Git - vlc/commitdiff
python-ctypes: implement consistency checker, and fix detected errors in include...
authorOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Thu, 3 Sep 2009 15:33:43 +0000 (17:33 +0200)
committerOlivier Aubert <olivier.aubert@liris.cnrs.fr>
Thu, 3 Sep 2009 15:33:43 +0000 (17:33 +0200)
bindings/python-ctypes/generate.py
include/vlc/libvlc.h
include/vlc/libvlc_media_library.h
include/vlc/libvlc_media_list.h
include/vlc/libvlc_media_player.h
include/vlc/mediacontrol.h

index 05f39a7f2af4a176c660c9be018ae81d9c6db7cc..abeadf88acd4496988f78b3b567e79853e8f45a8 100755 (executable)
@@ -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)
index 31e11d3d3b0c583b8f27581cd8ed82edff879969..3e45bfe4c7eaeef9539065ca6fcba8905a46be58 100644 (file)
@@ -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 );
 
index d2192bc788e8bce7b33a2f1f05826b5e95d21676..0dfbb4d6a1c33fa924493ef04d491fbf1f369974 100644 (file)
 
 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 );
index b9cc188e1e627e9cee7fd0fe708487b7220254a7..1274df2dd94d64575ca855b0b703f95a51c892c0 100644 (file)
@@ -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 *
index 4bf4b67b3b0034960af6ef2842db9ae4b905dee8..9e54525cdd88cc1fbb34a3072fb6ad298c0ef8c5 100644 (file)
@@ -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 );
index 7f044554b5d3b83dd51f79b59622297bf8b38abf..5b4f45d4cd002702530cdc2ed0185d5d51d0374c 100644 (file)
@@ -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);