ソースを参照

libdpkg: Document deb-version module

Guillem Jover 13 年 前
コミット
c1b63899f2
共有2 個のファイルを変更した26 個の追加2 個の削除を含む
  1. 14 1
      lib/dpkg/deb-version.c
  2. 12 1
      lib/dpkg/deb-version.h

+ 14 - 1
lib/dpkg/deb-version.c

@@ -2,7 +2,7 @@
  * libdpkg - Debian packaging suite library routines
  * deb-version.c - deb format version handling routines
  *
- * Copyright © 2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2012-2013 Guillem Jover <guillem@debian.org>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,6 +28,19 @@
 #include <dpkg/dpkg.h>
 #include <dpkg/deb-version.h>
 
+/**
+ * Parse a .deb format version.
+ *
+ * It takes a string and parses a .deb archive format version in the form
+ * of "X.Y", without any leading whitespace, and ending in either a newline
+ * or a NUL. If there is any syntax error a descriptive error string is
+ * returned.
+ *
+ * @param version The version to return.
+ * @param str     The string to parse.
+ *
+ * @return        An error string, or NULL if there was no error.
+ */
 const char *
 deb_version_parse(struct deb_version *version, const char *str)
 {

+ 12 - 1
lib/dpkg/deb-version.h

@@ -2,7 +2,7 @@
  * libdpkg - Debian packaging suite library routines
  * deb-version.h - deb format version handling routines
  *
- * Copyright © 2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2012-2013 Guillem Jover <guillem@debian.org>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -25,6 +25,15 @@
 
 DPKG_BEGIN_DECLS
 
+/**
+ * @defgroup deb-version .deb format version handling
+ * @ingroup dpkg-public
+ * @{
+ */
+
+/**
+ * Data structure representing a .deb format version.
+ */
 struct deb_version {
 	int major;
 	int minor;
@@ -32,6 +41,8 @@ struct deb_version {
 
 const char *deb_version_parse(struct deb_version *version, const char *str);
 
+/** @} */
+
 DPKG_END_DECLS
 
 #endif /* LIBDPKG_DEB_VERSION_H */