Make public headers usable with C++
authorTomas Mlcoch <tmlcoch@redhat.com>
Thu, 19 Jul 2012 09:25:15 +0000 (11:25 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Thu, 19 Jul 2012 09:25:15 +0000 (11:25 +0200)
13 files changed:
src/cmd_parser.h
src/compression_wrapper.h
src/constants.h
src/load_metadata.h
src/locate_metadata.h
src/misc.h
src/package.h
src/parsehdr.h
src/parsepkg.h
src/repomd.h
src/sqlite.h
src/version.h
src/xml_dump.h

index 87353ed..d0a156c 100644 (file)
@@ -13,7 +13,8 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_CMD_PARSER_H__
@@ -31,7 +32,8 @@ struct CmdOptions {
 
     // Items filled by hand (from createrepo_c.c)
 
-    char *input_dir;            /*!< Input directory (the mandatory argument of createrepo) */
+    char *input_dir;            /*!< Input directory (the mandatory argument
+                                     of createrepo) */
 
     // Items filled by cmd option parser
 
@@ -42,28 +44,35 @@ struct CmdOptions {
     char **includepkg;          /*!< list of files to include */
     char *groupfile;            /*!< groupfile path or URL */
     gboolean quiet;             /*!< quiet mode */
-    gboolean verbose;           /*!< verbosely more than usual (enable debug output) */
+    gboolean verbose;           /*!< verbosely more than usual (debug) */
     gboolean update;            /*!< update repo if metadata already exists */
-    char **update_md_paths;     /*!< list of paths to repositories which should be used for update */
+    char **update_md_paths;     /*!< list of paths to repositories which should
+                                     be used for update */
     gboolean skip_stat;         /*!< skip stat() call during --update */
     gboolean version;           /*!< print program version */
-    gboolean database;          /*!< create sqlite database metadata - Not implemented yet!!! :( */
-    gboolean no_database;       /*!< do not create database - Implemented ;) */
+    gboolean database;          /*!< create sqlite database metadata */
+    gboolean no_database;       /*!< do not create database */
     char *checksum;             /*!< type of checksum */
     char *compress_type;        /*!< which compression type to use */
     gboolean skip_symlinks;     /*!< ignore symlinks of packages */
-    int changelog_limit;        /*!< number of changelog messages in other.(xml|sqlite) */
-    gboolean unique_md_filenames;       /*!< include the file checksums in the filenames */
-    gboolean simple_md_filenames;       /*!< simple filenames (Name does not contain checksum) */
+    int changelog_limit;        /*!< number of changelog messages in
+                                     other.(xml|sqlite) */
+    gboolean unique_md_filenames;       /*!< include the file checksums in
+                                             the filenames */
+    gboolean simple_md_filenames;       /*!< simple filenames (names without
+                                             checksums) */
     int workers;                /*!< number of threads to spawn */
     gboolean xz_compression;    /*!< use xz for repodata compression */
 
     // Items filled by check_arguments()
 
     char *groupfile_fullpath;   /*!< full path to groupfile */
-    GSList *exclude_masks;      /*!< list of exclude masks (list of GPatternSpec pointers) */
-    GSList *include_pkgs;       /*!< list of packages to include (build from includepkg options and pkglist file) */
-    GSList *l_update_md_paths;  /*!< list of repos from update_md_paths (remote repos are downloaded) */
+    GSList *exclude_masks;      /*!< list of exclude masks
+                                     (list of GPatternSpec pointers) */
+    GSList *include_pkgs;       /*!< list of packages to include (build from
+                                     includepkg options and pkglist file) */
+    GSList *l_update_md_paths;  /*!< list of repos from update_md_paths
+                                     (remote repos are downloaded) */
     ChecksumType checksum_type; /*!< checksum type */
     CompressionType compression_type; /*!< compression type */
 
index 9f4c729..e140176 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__
 #define __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \defgroup   compression_wrapper     Wrapper for compressed file.
  */
 
@@ -95,7 +100,7 @@ int cw_read(CW_FILE *cw_file, void *buffer, unsigned int len);
  * @param cw_file       CW_FILE pointer
  * @param buffer        source buffer
  * @param len           number of bytes to read
- * @return              number of uncompressed bytes readed (0 for EOF) or CW_ERR
+ * @return              number of uncompressed bytes readed (0 = EOF) or CW_ERR
  */
 int cw_write(CW_FILE *cw_file, const void *buffer, unsigned int len);
 
@@ -123,5 +128,8 @@ int cw_printf(CW_FILE *cw_file, const char *format, ...);
  */
 int cw_close(CW_FILE *cw_file);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __C_CREATEREPOLIB_COMPRESSION_WRAPPER_H__ */
index 72df7cd..8b73f1e 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_CONSTANTS_H__
 #define __C_CREATEREPOLIB_CONSTANTS_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Checksum type.
  */
@@ -28,4 +33,8 @@ typedef enum {
     PKG_CHECKSUM_SHA256         /*!< SHA256 checksum */
 } ChecksumType;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_CONSTANTS_H__ */
index 074060c..919f6ad 100644 (file)
@@ -13,7 +13,8 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_LOAD_METADATA_H__
 #include <glib.h>
 #include "locate_metadata.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \defgroup   load_metadata   Load metadata API.
  */
 
  * Package attribute used as key in the hashtable.
  */
 typedef enum {
-    HT_KEY_DEFAULT,                     /*!< default = package hash (Package ->pkgId) */
-    HT_KEY_HASH = HT_KEY_DEFAULT,       /*!< package hash (Package ->pkgId) */
-    HT_KEY_NAME,                        /*!< package name (Package ->name) */
-    HT_KEY_FILENAME                     /*!< package filename (Package ->location_href) */
+    HT_KEY_DEFAULT,               /*!< default = pkg hash */
+    HT_KEY_HASH = HT_KEY_DEFAULT, /*!< pkg hash (Package ->pkgId) */
+    HT_KEY_NAME,                  /*!< pkg name (Package ->name) */
+    HT_KEY_FILENAME               /*!< pkg filename (Package ->location_href) */
 } HashTableKey;
 
 /**@{*/
-#define LOAD_METADATA_OK        0       /*!< Return value - Metadata loaded successfully */
-#define LOAD_METADATA_ERR       1       /*!< Return value - Error while loading metadata */
+#define LOAD_METADATA_OK        0  /*!< Metadata loaded successfully */
+#define LOAD_METADATA_ERR       1  /*!< Error while loading metadata */
 /**@}*/
 
 /** \ingroup load_metadata
@@ -47,7 +52,8 @@ typedef enum {
 GHashTable *new_metadata_hashtable();
 
 /** \ingroup load_metadata
- * Destroys all keys and values in the metadata hash table and decrements its reference count by 1.
+ * Destroys all keys and values in the metadata hash table and decrements
+ * its reference count by 1.
  * @param hashtable     metadata hashtable
  */
 void destroy_metadata_hashtable(GHashTable *hashtable);
@@ -70,4 +76,8 @@ int load_xml_metadata(GHashTable *hashtable, struct MetadataLocation *ml, HashTa
  */
 int locate_and_load_xml_metadata(GHashTable *hashtable, const char *repopath, HashTableKey key);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_LOAD_METADATA_H__ */
index 5c73485..a09c7d5 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_LOCATE_METADATA_H__
 #define __C_CREATEREPOLIB_LOCATE_METADATA_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** \defgroup   locate_metadata Locate metadata API.
  */
 
@@ -35,9 +40,11 @@ struct MetadataLocation {
     char *groupfile_href;       /*!< path to groupfile */
     char *cgroupfile_href;      /*!< path to compressed groupfile */
     char *repomd;               /*!< path to repomd.xml */
-    char *original_url;         /*!< original path of repo from commandline param */
+    char *original_url;         /*!< original path of repo from commandline
+                                     param */
     char *local_path;           /*!< local path to repo */
-    char *tmp_dir;              /*!< path to dir where metadata are stored if metadata were downloaded */
+    char *tmp_dir;              /*!< path to dir where metadata are stored if
+                                     metadata were downloaded */
 };
 
 /** \ingroup locate_metadata
@@ -60,12 +67,16 @@ void free_metadata_location(struct MetadataLocation *ml);
 
 /** \ingroup locate_metadata
  * Remove files related to repodata from the specified path.
- * Files not listed in repomd.xml and with nonstandard names
- * (standard names are names with suffixes like primary.xml.*, primary.sqlite.*,
- * other.xml.*, etc.) are keep untouched (repodata/ subdirectory IS NOT removed!).
+ * Files not listed in repomd.xml and with nonstandard names (standard names
+ * are names with suffixes like primary.xml.*, primary.sqlite.*, other.xml.*,
+ * etc.) are keep untouched (repodata/ subdirectory IS NOT removed!).
  * @param repopath      path to directory with repodata/ subdirectory
  * @return              number of removed files
  */
 int remove_metadata(const char *repopath);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_LOCATE_METADATA_H__ */
index 193d060..9200b10 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_MISC_H__
 #define __C_CREATEREPOLIB_MISC_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <glib.h>
 #include <curl/curl.h>
 #include "compression_wrapper.h"
@@ -63,9 +68,10 @@ struct Version {
 /** \ingroup misc
  * Convert epoch-version-release string into EVR structure.
  * If no GStringChunk passed, all non NULL items in returned structure
- * are malloced and in that case, you have to free all non-NULL element yourself.
+ * are malloced and in that case, you have to free all non-NULL element
+ * yourself.
  * @param string        NULL terminated n-v-r string
- * @param chunk         string chunk for store strings (optional, could be NULL)
+ * @param chunk         string chunk for strings (optional - could be NULL)
  * @return              filled NVR
  */
 struct EVR string_to_version(const char *string, GStringChunk *chunk);
@@ -160,10 +166,12 @@ int copy_file(const char *src, const char *dst);
  *                      If dst is NULL, src + compression suffix is used)
  * @return              CR_COPY_OK or CR_COPY_ERR on error
  */
-int compress_file(const char *src, const char *dst, CompressionType compression);
+int compress_file(const char *src,
+                  const char *dst,
+                  CompressionType compression);
 
 /** \ingroup misc
- * Better copy file. Source (src) could be remote address ("http://" or "ftp://").
+ * Better copy file. Source (src) could be remote address (http:// or ftp://).
  * @param src           source filename
  * @param dst           destination (if dst is dir, filename of src is used)
  * @return              CR_COPY_OK or CR_COPY_ERR on error
@@ -207,8 +215,10 @@ int cmp_version_string(const char* str1, const char *str2);
  * @param message       message
  * @param user_data     user data
  */
-void black_hole_log_function (const gchar *log_domain, GLogLevelFlags log_level,
-                              const gchar *message, gpointer user_data);
+void black_hole_log_function (const gchar *log_domain,
+                              GLogLevelFlags log_level,
+                              const gchar *message,
+                              gpointer user_data);
 
 /** \ingroup misc
  * Createrepo_c library standard logging function.
@@ -220,4 +230,8 @@ void black_hole_log_function (const gchar *log_domain, GLogLevelFlags log_level,
 void log_function (const gchar *log_domain, GLogLevelFlags log_level,
                    const gchar *message, gpointer user_data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_MISC_H__ */
index 5f591ef..e76db0e 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_PACKAGE_H__
 #define __C_CREATEREPOLIB_PACKAGE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <glib.h>
 
 /** \defgroup   package         Package representation.
@@ -29,7 +34,8 @@
  */
 typedef struct {
     char *name;                 /*!< name */
-    char *flags;                /*!< flags (value returned by flag_to_string() from misc module) */
+    char *flags;                /*!< flags (value returned by flag_to_string()
+                                     from misc module) */
     char *epoch;                /*!< epoch */
     char *version;              /*!< version */
     char *release;              /*!< release */
@@ -50,7 +56,7 @@ typedef struct {
  */
 typedef struct {
     char *author;               /*!< author of changelog */
-    gint64 date;                /*!< date of changelog in seconds since epoch */
+    gint64 date;                /*!< date of changelog - seconds since epoch */
     char *changelog;            /*!< text of changelog */
 } ChangelogEntry;
 
@@ -72,28 +78,35 @@ typedef struct {
     gint64 time_build;          /*!< build time (from rpm header) */
     char *rpm_license;          /*!< license */
     char *rpm_vendor;           /*!< vendor */
-    char *rpm_group;            /*!< group (one value from /usr/share/doc/rpm-(your_rpm_version)/GROUPS) */
-    char *rpm_buildhost;        /*!< hostname of machine which builds the package */
+    char *rpm_group;            /*!< group (one value from /usr/share/doc/rpm-
+                                     (your_rpm_version)/GROUPS) */
+    char *rpm_buildhost;        /*!< hostname of machine which builds
+                                     the package */
     char *rpm_sourcerpm;        /*!< name of srpms */
     gint64 rpm_header_start;    /*!< start byte of header in rpm */
     gint64 rpm_header_end;      /*!< end byte of header in rpm */
     char *rpm_packager;         /*!< packager of package */
     gint64 size_package;        /*!< size of rpm package */
     gint64 size_installed;      /*!< size of installed files */
-    gint64 size_archive;        /*!< size of archive (I have no idea what does it mean) */
+    gint64 size_archive;        /*!< size of archive (I have no idea what does
+                                     it mean) */
     char *location_href;        /*!< file location inside repository */
     char *location_base;        /*!< location (url) of repository */
-    char *checksum_type;        /*!< type of checksum used ("sha1", "sha256", "md5", ..) */
+    char *checksum_type;        /*!< type of checksum used ("sha1", "sha256",
+                                     "md5", ..) */
 
     GSList *requires;           /*!< requires (list of Dependency structs) */
     GSList *provides;           /*!< provides (list of Dependency structs) */
     GSList *conflicts;          /*!< conflicts (list of Dependency structs) */
     GSList *obsoletes;          /*!< obsoletes (list of Dependency structs) */
 
-    GSList *files;              /*!< files in the package (list of PackageFile structs) */
-    GSList *changelogs;         /*!< changelogs (list of ChangelogEntry structs) */
+    GSList *files;              /*!< files in the package (list of PackageFile
+                                     structs) */
+    GSList *changelogs;         /*!< changelogs (list of ChangelogEntry
+                                     structs) */
 
-    GStringChunk *chunk;        /*!< string chunk for store all package strings on the single place */
+    GStringChunk *chunk;        /*!< string chunk for store all package strings
+                                     on the single place */
 } Package;
 
 typedef void (*PackageFn) (Package *pkg, gpointer data);
@@ -128,4 +141,8 @@ Package        *package_new         (void);
  */
 void            package_free        (Package *package);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_PACKAGE_H__ */
index 2a9d534..8c081fc 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_PARSEHDR_H__
 #define __C_CREATEREPOLIB_PARSEHDR_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rpm/rpmlib.h>
 #include <glib.h>
 #include "package.h"
@@ -58,11 +63,16 @@ Package *parse_header(Header hdr, gint64 mtime, gint64 size,
  * @param changelog_limit       number of changelog entries
  * @param hdr_start             start byte of header
  * @param hdr_end               last byte of header
- * @return                      XML chunks for primary, filelists and other (in struct XmlStruct)
+ * @return                      XML chunks for primary, filelists and other
+ *                              (in struct XmlStruct)
  */
 struct XmlStruct xml_from_header(Header hdr, gint64 mtime, gint64 size,
                         const char *checksum, const char *checksum_type,
                         const char *location_href, const char *location_base,
                         int changelog_limit, gint64 hdr_start, gint64 hdr_end);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_PARSEHDR_H__ */
index 24a0ea1..baab7a0 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_PARSEPKG_H__
 #define __C_CREATEREPOLIB_PARSEPKG_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rpm/rpmlib.h>
 #include <glib.h>
 #include "constants.h"
@@ -52,7 +57,8 @@ void package_parser_shutdown();
  * @param location_href         package location inside repository
  * @param location_base         location (url) of repository
  * @param changelog_limit       number of changelog entries
- * @param stat_buf              struct stat of the filename (optional - could be NULL)
+ * @param stat_buf              struct stat of the filename
+ *                              (optional - could be NULL)
  */
 Package *package_from_file(const char *filename, ChecksumType checksum_type,
                         const char *location_href, const char *location_base,
@@ -65,10 +71,15 @@ Package *package_from_file(const char *filename, ChecksumType checksum_type,
  * @param location_href         package location inside repository
  * @param location_base         location (url) of repository
  * @param changelog_limit       number of changelog entries
- * @param stat_buf              struct stat of the filename (optional - could be NULL)
+ * @param stat_buf              struct stat of the filename
+ *                              (optional - could be NULL)
  */
 struct XmlStruct xml_from_package_file(const char *filename, ChecksumType checksum_type,
                         const char *location_href, const char *location_base,
                         int changelog_limit, struct stat *stat_buf);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_PARSEPKG_H__ */
index b43f2b4..6f29640 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_REPOMD_H__
 #define __C_CREATEREPOLIB_REPOMD_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <libxml/encoding.h>
 #include <libxml/xmlwriter.h>
 #include "compression_wrapper.h"
@@ -46,7 +51,7 @@ struct _RepomdRecord {
     long size_open;             /*!< size of uncompressed file in bytes */
     int db_ver;                 /*!< version of database */
 
-    GStringChunk *chunk;        /*!< string chunk for string from this structure*/
+    GStringChunk *chunk;        /*!< string chunk */
 };
 
 /** \ingroup repomd
@@ -69,41 +74,57 @@ void free_repomdrecord(RepomdRecord record);
  * @param record                RepomdRecord object
  * @param checksum_type         type of checksum to use
  */
-int fill_missing_data(const char *base_path, RepomdRecord record, ChecksumType *checksum_type);
+int fill_missing_data(const char *base_path,
+                      RepomdRecord record,
+                      ChecksumType *checksum_type);
 
 /** \ingroup repomd
  * Analogue of fill_missing_data but for groupfile.
  * Groupfile must be set with the path to existing non compressed groupfile.
- * Compressed group file will be created and compressed_groupfile record updated.
+ * Compressed group file will be created and compressed_groupfile record
+ * updated.
  * @param base_path             path to repo (to directory with repodata subdir)
- * @groupfile                   RepomdRecord initialized to an existing groupfile
- * @compressed_groupfile        RepomdRecord object that will by filled
+ * @groupfile                   RepomdRecord initialized to anexisting groupfile
+ * @compressed_groupfile        RepomdRecord object that will by filled
  * @checksum_type               type of checksums
  * @compression                 type of compression
  */
-void process_groupfile(const char *base_path, RepomdRecord groupfile,
-                       RepomdRecord compressed_groupfile, ChecksumType *checksum_type,
+void process_groupfile(const char *base_path,
+                       RepomdRecord groupfile,
+                       RepomdRecord compressed_groupfile,
+                       ChecksumType *checksum_type,
                        CompressionType compression);
 
 /** \ingroup repomd
  * Add a hash as prefix to the filename.
- * @base_path                   path to repo (to directory with repodata subdir)
+ * @base_path                   path to repo (to directory with repodata/
+ *                              subdir)
  * @record                      RepomdRecord of file to be renamed
  */
 void rename_file(const char *base_path, RepomdRecord record);
 
 /** \ingroup repomd
  * Generate repomd.xml content.
- * @param path                  path to repository (to the directory contains repodata/ subdir)
- * @param pri_xml               RepomdRecord of primary.xml.gz (relative towards to the path param)
- * @param fil_xml               RepomdRecord of filelists.xml.gz (relative towards to the path param)
- * @param oth_xml               RepomdRecord of other.xml.gz (relative towards to the path param)
- * @param pri_sqlite            RepomdRecord of primary.sqlite.* (relative towards to the path param)
- * @param fil_sqlite            RepomdRecord of filelists.sqlite.* (relative towards to the path param)
- * @param oth_sqlite            RepomdRecord of other.sqlite.* (relative towards to the path param)
- * @param groupfile             RepomdRecord of *.xml (relative towards to the path param)
- * @param cgroupfile            RepomdRecord of *.xml.* (relative towards to the path param)
- * @param update_info           RepomdRecord of updateinfo.xml.* (relative towards to the path param)
+ * @param path                  path to repository (to the directory contains
+ *                              repodata/ subdir)
+ * @param pri_xml               RepomdRecord of primary.xml.gz (relative
+ *                              towards to the path param)
+ * @param fil_xml               RepomdRecord of filelists.xml.gz (relative
+ *                              towards to the path param)
+ * @param oth_xml               RepomdRecord of other.xml.gz (relative towards
+ *                              to the path param)
+ * @param pri_sqlite            RepomdRecord of primary.sqlite.* (relative
+ *                              towards to the path param)
+ * @param fil_sqlite            RepomdRecord of filelists.sqlite.* (relative
+ *                              towards to the path param)
+ * @param oth_sqlite            RepomdRecord of other.sqlite.* (relative
+ *                              towards to the path param)
+ * @param groupfile             RepomdRecord of *.xml (relative towards to
+ *                              the path param)
+ * @param cgroupfile            RepomdRecord of *.xml.* (relative towards to
+ *                              the path param)
+ * @param update_info           RepomdRecord of updateinfo.xml.* (relative
+ *                              towards to the path param)
  * @return                      string with repomd.xml content
  */
 gchar * xml_repomd(const char *path, RepomdRecord pri_xml,
@@ -112,4 +133,8 @@ gchar * xml_repomd(const char *path, RepomdRecord pri_xml,
                    RepomdRecord oth_sqlite, RepomdRecord groupfile,
                    RepomdRecord cgroupfile, RepomdRecord update_info);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_REPOMD_H__ */
index fa83552..a48b591 100644 (file)
@@ -13,7 +13,8 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_SQLITE_H__
@@ -23,6 +24,9 @@
 #include <sqlite3.h>
 #include "package.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /** \defgroup   sqlite        SQLite metadata API.
  */
@@ -140,7 +144,8 @@ DbPrimaryStatements prepare_primary_db_statements(sqlite3 *db, GError **err);
  * @param err                   **GError
  * @return                      DbFilelistsStatements object
  */
-DbFilelistsStatements prepare_filelists_db_statements(sqlite3 *db, GError **err);
+DbFilelistsStatements prepare_filelists_db_statements(sqlite3 *db,
+                                                      GError **err);
 
 /** \ingroup sqlite
  * Prepare compiled statements for use in the add_other_pkg_db function.
@@ -208,4 +213,8 @@ void dbinfo_update(sqlite3 *db, const char *checksum, GError **err);
  */
 void close_db(sqlite3 *db, DatabaseType db_type, GError **err);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_SQLITE_H__ */
index f2ea38f..50a3360 100644 (file)
@@ -13,7 +13,8 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_VERSION_H__
 /** \defgroup version   Library version information.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**@{*/
 #define MAJOR_VERSION   0
 #define MINOR_VERSION   1
 #define PATCH_VERSION   5
 /**@}*/
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_VERSION_H__ */
index 134a65a..d25abd1 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
+ * USA
  */
 
 #ifndef __C_CREATEREPOLIB_XML_DUMP_H__
 #define __C_CREATEREPOLIB_XML_DUMP_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <libxml/encoding.h>
 #include <libxml/xmlwriter.h>
 #include "package.h"
  */
 
 /**@{*/
-#define XML_COMMON_NS           "http://linux.duke.edu/metadata/common"         /*!< Default namespace for primary.xml */
-#define XML_FILELISTS_NS        "http://linux.duke.edu/metadata/filelists"      /*!< Default namespace for filelists.xml */
-#define XML_OTHER_NS            "http://linux.duke.edu/metadata/other"          /*!< Default namespace for other.xml */
-#define XML_RPM_NS              "http://linux.duke.edu/metadata/rpm"            /*!< Namespace used in primary.xml */
+/** Default namespace for primary.xml */
+#define XML_COMMON_NS           "http://linux.duke.edu/metadata/common"
+/** Default namespace for filelists.xml */
+#define XML_FILELISTS_NS        "http://linux.duke.edu/metadata/filelists"
+/** Default namespace for other.xml */
+#define XML_OTHER_NS            "http://linux.duke.edu/metadata/other"
+/** Namespace used in primary.xml */
+#define XML_RPM_NS              "http://linux.duke.edu/metadata/rpm"
 /**@}*/
 
 
@@ -47,7 +56,8 @@ struct XmlStruct{
  * Dump files from the package and append them to the node as childrens.
  * @param node          parent xml node
  * @param package       Package
- * @param primary       process only primary files (see is_primary() function in the misc module)
+ * @param primary       process only primary files (see is_primary() function
+ *                      in the misc module)
  */
 void dump_files(xmlNodePtr node, Package *package, int primary);
 
@@ -79,4 +89,8 @@ char *xml_dump_other(Package *package);
  */
 struct XmlStruct xml_dump(Package *package);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __C_CREATEREPOLIB_XML_DUMP_H__ */