From: Tomas Mlcoch Date: Thu, 13 Jun 2013 11:55:32 +0000 (+0200) Subject: compression_wrapper: cr_open_with_stat renamed to cr_sopen. X-Git-Tag: upstream/0.2.1~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=78590b4f052e13bca1d52f3e8617f4a6ba2ab45e;p=services%2Fcreaterepo_c.git compression_wrapper: cr_open_with_stat renamed to cr_sopen. --- diff --git a/src/compression_wrapper.c b/src/compression_wrapper.c index 990c80c..95cf12f 100644 --- a/src/compression_wrapper.c +++ b/src/compression_wrapper.c @@ -264,11 +264,11 @@ cr_gz_strerror(gzFile f) CR_FILE * -cr_open_with_stat(const char *filename, - cr_OpenMode mode, - cr_CompressionType comtype, - cr_ContentStat *stat, - GError **err) +cr_sopen(const char *filename, + cr_OpenMode mode, + cr_CompressionType comtype, + cr_ContentStat *stat, + GError **err) { CR_FILE *file = NULL; cr_CompressionType type = comtype; diff --git a/src/compression_wrapper.h b/src/compression_wrapper.h index 8dfc577..992dcbb 100644 --- a/src/compression_wrapper.h +++ b/src/compression_wrapper.h @@ -106,9 +106,9 @@ cr_CompressionType cr_detect_compression(const char* filename, GError **err); * @return pointer to a CR_FILE or NULL */ #define cr_open(FILENAME, MODE, COMTYPE, ERR) \ - cr_open_with_stat(FILENAME, MODE, COMTYPE, NULL, ERR) + cr_sopen(FILENAME, MODE, COMTYPE, NULL, ERR) -/** Open/Create the specified file. For writting is possible pass +/** Open/Create the specified file. If opened for writting, you can pass * a cr_ContentStat object and after cr_close() get stats of * an open content (stats of uncompressed content). * @param filename filename @@ -118,11 +118,11 @@ cr_CompressionType cr_detect_compression(const char* filename, GError **err); * @param err GError ** * @return pointer to a CR_FILE or NULL */ -CR_FILE *cr_open_with_stat(const char *filename, - cr_OpenMode mode, - cr_CompressionType comtype, - cr_ContentStat *stat, - GError **err); +CR_FILE *cr_sopen(const char *filename, + cr_OpenMode mode, + cr_CompressionType comtype, + cr_ContentStat *stat, + GError **err); /** Reads an array of len bytes from the CR_FILE. * @param cr_file CR_FILE pointer diff --git a/src/misc.c b/src/misc.c index 6210dd5..4ea08fc 100644 --- a/src/misc.c +++ b/src/misc.c @@ -468,7 +468,7 @@ cr_compress_file_with_stat(const char *src, goto compress_file_cleanup; } - new = cr_open_with_stat(dst, CR_CW_MODE_WRITE, compression, stat, &tmp_err); + new = cr_sopen(dst, CR_CW_MODE_WRITE, compression, stat, &tmp_err); if (tmp_err) { g_debug("%s: Cannot open destination file %s", __func__, dst); g_propagate_prefixed_error(err, tmp_err, "Cannot open %s: ", dst); diff --git a/src/python/compression_wrapper-py.c b/src/python/compression_wrapper-py.c index 4a8a823..6a47f03 100644 --- a/src/python/compression_wrapper-py.c +++ b/src/python/compression_wrapper-py.c @@ -151,7 +151,7 @@ crfile_init(_CrFileObject *self, PyObject *args, PyObject *kwds) } /* Init */ - self->f = cr_open_with_stat(path, mode, comtype, stat, &err); + self->f = cr_sopen(path, mode, comtype, stat, &err); if (err) { PyErr_Format(CrErr_Exception, "CrFile initialization failed: %s", err->message); g_clear_error(&err); diff --git a/src/xml_file.c b/src/xml_file.c index af945d4..ff55b67 100644 --- a/src/xml_file.c +++ b/src/xml_file.c @@ -61,11 +61,11 @@ cr_xmlfile_sopen(const char *filename, return NULL; } - CR_FILE *cr_f = cr_open_with_stat(filename, - CR_CW_MODE_WRITE, - comtype, - stat, - &tmp_err); + CR_FILE *cr_f = cr_sopen(filename, + CR_CW_MODE_WRITE, + comtype, + stat, + &tmp_err); if (tmp_err) { g_propagate_prefixed_error(err, tmp_err, "Cannot open %s: ", filename); return NULL; diff --git a/tests/test_compression_wrapper.c b/tests/test_compression_wrapper.c index 3879c05..e625a73 100644 --- a/tests/test_compression_wrapper.c +++ b/tests/test_compression_wrapper.c @@ -553,11 +553,11 @@ test_contentstating_singlewrite(Outputtest *outputtest, gconstpointer test_data) g_assert(stat); g_assert(!tmp_err); - f = cr_open_with_stat(outputtest->tmp_filename, - CR_CW_MODE_WRITE, - CR_CW_NO_COMPRESSION, - stat, - &tmp_err); + f = cr_sopen(outputtest->tmp_filename, + CR_CW_MODE_WRITE, + CR_CW_NO_COMPRESSION, + stat, + &tmp_err); g_assert(f); g_assert(!tmp_err); @@ -579,11 +579,11 @@ test_contentstating_singlewrite(Outputtest *outputtest, gconstpointer test_data) g_assert(stat); g_assert(!tmp_err); - f = cr_open_with_stat(outputtest->tmp_filename, - CR_CW_MODE_WRITE, - CR_CW_GZ_COMPRESSION, - stat, - &tmp_err); + f = cr_sopen(outputtest->tmp_filename, + CR_CW_MODE_WRITE, + CR_CW_GZ_COMPRESSION, + stat, + &tmp_err); g_assert(f); g_assert(!tmp_err); @@ -605,11 +605,11 @@ test_contentstating_singlewrite(Outputtest *outputtest, gconstpointer test_data) g_assert(stat); g_assert(!tmp_err); - f = cr_open_with_stat(outputtest->tmp_filename, - CR_CW_MODE_WRITE, - CR_CW_BZ2_COMPRESSION, - stat, - &tmp_err); + f = cr_sopen(outputtest->tmp_filename, + CR_CW_MODE_WRITE, + CR_CW_BZ2_COMPRESSION, + stat, + &tmp_err); g_assert(f); g_assert(!tmp_err); @@ -631,11 +631,11 @@ test_contentstating_singlewrite(Outputtest *outputtest, gconstpointer test_data) g_assert(stat); g_assert(!tmp_err); - f = cr_open_with_stat(outputtest->tmp_filename, - CR_CW_MODE_WRITE, - CR_CW_XZ_COMPRESSION, - stat, - &tmp_err); + f = cr_sopen(outputtest->tmp_filename, + CR_CW_MODE_WRITE, + CR_CW_XZ_COMPRESSION, + stat, + &tmp_err); g_assert(f); g_assert(!tmp_err); @@ -673,11 +673,11 @@ test_contentstating_multiwrite(Outputtest *outputtest, gconstpointer test_data) g_assert(stat); g_assert(!tmp_err); - f = cr_open_with_stat(outputtest->tmp_filename, - CR_CW_MODE_WRITE, - CR_CW_GZ_COMPRESSION, - stat, - &tmp_err); + f = cr_sopen(outputtest->tmp_filename, + CR_CW_MODE_WRITE, + CR_CW_GZ_COMPRESSION, + stat, + &tmp_err); g_assert(f); g_assert(!tmp_err);