[gmime] renamed BestEncoding to EncodingConstraint
- From: Jeffrey Stedfast <fejj src gnome org>
- To: svn-commits-list gnome org
- Subject: [gmime] renamed BestEncoding to EncodingConstraint
- Date: Thu, 30 Apr 2009 18:59:36 -0400 (EDT)
commit ca5e834f3df7ff51e4c3b1ee4363abff0d2319ff
Author: Jeffrey Stedfast <fejj gnome org>
Date: Thu Apr 30 18:58:43 2009 -0400
renamed BestEncoding to EncodingConstraint
2009-04-30 Jeffrey Stedfast <fejj novell com>
* gmime/gmime-filter-best.h: Renamed GMimeBestEncoding to
GMimeEncodingConstraint to make this enum more clear as to what
it's intended purpose is.
* gmime/gmime-part.c: Updated.
---
ChangeLog | 8 ++++++
TODO | 7 +++--
docs/reference/gmime-sections.txt | 2 +-
gmime/gmime-filter-best.c | 13 ++++-----
gmime/gmime-filter-best.h | 18 ++++++------
gmime/gmime-part.c | 4 +-
gmime/gmime-part.h | 2 +-
mono/GMime.metadata | 4 +-
mono/gmime-api.raw | 51 +++++++++++++++++++++++++++++++-----
tests/test-best.c | 6 ++--
10 files changed, 80 insertions(+), 35 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 35d71f5..c096f7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-04-30 Jeffrey Stedfast <fejj novell com>
+
+ * gmime/gmime-filter-best.h: Renamed GMimeBestEncoding to
+ GMimeEncodingConstraint to make this enum more clear as to what
+ it's intended purpose is.
+
+ * gmime/gmime-part.c: Updated.
+
2009-04-29 Sankar P <sankar curiosity gmail com>
* gmime.doap: Added new doap file to describe the project.
diff --git a/TODO b/TODO
index 1c12ee8..55a838c 100644
--- a/TODO
+++ b/TODO
@@ -32,9 +32,10 @@ GMime 2.6 Planning:
- Add a g_mime_part_get_best_content_encoding()? [ DONE ]
-- Rename GMimeBestEncoding enum to GMimeEncodingConstraint? This might
- be a better name for the enum to reflect what it's actually meant
- for. Maybe also move it from gmime-filter-best.h to
+- Rename GMimeBestEncoding enum to GMimeEncodingConstraint? [ DONE ]
+
+ This might be a better name for the enum to reflect what it's
+ actually meant for. Maybe also move it from gmime-filter-best.h to
gmime-encodings.h?
- How about a g_mime_part_get_best_charset()? This one could be
diff --git a/docs/reference/gmime-sections.txt b/docs/reference/gmime-sections.txt
index 7719505..2d64854 100644
--- a/docs/reference/gmime-sections.txt
+++ b/docs/reference/gmime-sections.txt
@@ -301,8 +301,8 @@ GMIME_FILTER_BASIC_GET_CLASS
<SECTION>
<FILE>gmime-filter-best</FILE>
GMimeFilterBest
-GMimeBestEncoding
GMimeFilterBestFlags
+GMimeEncodingConstraint
g_mime_filter_best_new
g_mime_filter_best_charset
g_mime_filter_best_encoding
diff --git a/gmime/gmime-filter-best.c b/gmime/gmime-filter-best.c
index f7c96be..5f21ea0 100644
--- a/gmime/gmime-filter-best.c
+++ b/gmime/gmime-filter-best.c
@@ -281,7 +281,7 @@ g_mime_filter_best_charset (GMimeFilterBest *best)
/**
* g_mime_filter_best_encoding:
* @best: a #GMimeFilterBest
- * @constraint: a #GMimeBestEncoding
+ * @constraint: a #GMimeEncodingConstraint
*
* Calculates the most efficient Content-Transfer-Encoding for the
* stream filtered through @best that fits within the encoding
@@ -290,7 +290,7 @@ g_mime_filter_best_charset (GMimeFilterBest *best)
* Returns: the best encoding for the stream filtered by @best.
**/
GMimeContentEncoding
-g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeBestEncoding constraint)
+g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeEncodingConstraint constraint)
{
GMimeContentEncoding encoding = GMIME_CONTENT_ENCODING_DEFAULT;
@@ -300,11 +300,11 @@ g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeBestEncoding constraint
return GMIME_CONTENT_ENCODING_DEFAULT;
switch (constraint) {
- case GMIME_BEST_ENCODING_7BIT:
+ case GMIME_ENCODING_CONSTRAINT_7BIT:
if (best->count0 > 0) {
encoding = GMIME_CONTENT_ENCODING_BASE64;
} else if (best->count8 > 0) {
- if (best->count8 >= (best->total * 17 / 100))
+ if (best->count8 >= (unsigned int) (best->total * (17.0 / 100.0)))
encoding = GMIME_CONTENT_ENCODING_BASE64;
else
encoding = GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE;
@@ -312,14 +312,14 @@ g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeBestEncoding constraint
encoding = GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE;
}
break;
- case GMIME_BEST_ENCODING_8BIT:
+ case GMIME_ENCODING_CONSTRAINT_8BIT:
if (best->count0 > 0) {
encoding = GMIME_CONTENT_ENCODING_BASE64;
} else if (best->maxline > 998) {
encoding = GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE;
}
break;
- case GMIME_BEST_ENCODING_BINARY:
+ case GMIME_ENCODING_CONSTRAINT_BINARY:
if (best->count0 + best->count8 > 0)
encoding = GMIME_CONTENT_ENCODING_BINARY;
break;
@@ -330,4 +330,3 @@ g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeBestEncoding constraint
return encoding;
}
-
diff --git a/gmime/gmime-filter-best.h b/gmime/gmime-filter-best.h
index d682e7d..b8094d4 100644
--- a/gmime/gmime-filter-best.h
+++ b/gmime/gmime-filter-best.h
@@ -55,20 +55,20 @@ typedef enum {
/**
- * GMimeBestEncoding:
- * @GMIME_BEST_ENCODING_7BIT: The stream data must fit within the 7bit ASCII range.
- * @GMIME_BEST_ENCODING_8BIT: The stream data may have bytes with the high bit set, but no null bytes.
- * @GMIME_BEST_ENCODING_BINARY: The stream may contain any binary data.
+ * GMimeEncodingConstraint:
+ * @GMIME_ENCODING_CONSTRAINT_7BIT: The stream data must fit within the 7bit ASCII range.
+ * @GMIME_ENCODING_CONSTRAINT_8BIT: The stream data may have bytes with the high bit set, but no null bytes.
+ * @GMIME_ENCODING_CONSTRAINT_BINARY: The stream may contain any binary data.
*
* Used with g_mime_filter_best_encoding() as the 'constraint'
* argument. These values provide a means of letting the filter know
* what the encoding constraints are for the stream.
**/
typedef enum {
- GMIME_BEST_ENCODING_7BIT,
- GMIME_BEST_ENCODING_8BIT,
- GMIME_BEST_ENCODING_BINARY
-} GMimeBestEncoding;
+ GMIME_ENCODING_CONSTRAINT_7BIT,
+ GMIME_ENCODING_CONSTRAINT_8BIT,
+ GMIME_ENCODING_CONSTRAINT_BINARY
+} GMimeEncodingConstraint;
/**
@@ -126,7 +126,7 @@ GMimeFilter *g_mime_filter_best_new (GMimeFilterBestFlags flags);
const char *g_mime_filter_best_charset (GMimeFilterBest *best);
-GMimeContentEncoding g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeBestEncoding constraint);
+GMimeContentEncoding g_mime_filter_best_encoding (GMimeFilterBest *best, GMimeEncodingConstraint constraint);
G_END_DECLS
diff --git a/gmime/gmime-part.c b/gmime/gmime-part.c
index bf8e7e5..ceede0f 100644
--- a/gmime/gmime-part.c
+++ b/gmime/gmime-part.c
@@ -733,7 +733,7 @@ g_mime_part_get_content_encoding (GMimePart *mime_part)
/**
* g_mime_part_get_best_content_encoding:
* @mime_part: a #GMimePart object
- * @constraint: a #GMimeBestEncoding
+ * @constraint: a #GMimeEncodingConstraint
*
* Calculates the most efficient content encoding for the @mime_part
* given the @constraint.
@@ -741,7 +741,7 @@ g_mime_part_get_content_encoding (GMimePart *mime_part)
* Returns: the best content encoding for the specified mime part.
**/
GMimeContentEncoding
-g_mime_part_get_best_content_encoding (GMimePart *mime_part, GMimeBestEncoding constraint)
+g_mime_part_get_best_content_encoding (GMimePart *mime_part, GMimeEncodingConstraint constraint)
{
GMimeStream *filtered, *stream;
GMimeContentEncoding encoding;
diff --git a/gmime/gmime-part.h b/gmime/gmime-part.h
index 51afd94..082d806 100644
--- a/gmime/gmime-part.h
+++ b/gmime/gmime-part.h
@@ -94,7 +94,7 @@ const char *g_mime_part_get_content_location (GMimePart *mime_part);
void g_mime_part_set_content_encoding (GMimePart *mime_part, GMimeContentEncoding encoding);
GMimeContentEncoding g_mime_part_get_content_encoding (GMimePart *mime_part);
-GMimeContentEncoding g_mime_part_get_best_content_encoding (GMimePart *mime_part, GMimeBestEncoding constraint);
+GMimeContentEncoding g_mime_part_get_best_content_encoding (GMimePart *mime_part, GMimeEncodingConstraint constraint);
void g_mime_part_set_filename (GMimePart *mime_part, const char *filename);
const char *g_mime_part_get_filename (GMimePart *mime_part);
diff --git a/mono/GMime.metadata b/mono/GMime.metadata
index 6724831..8ea1487 100644
--- a/mono/GMime.metadata
+++ b/mono/GMime.metadata
@@ -91,8 +91,8 @@
<move-node path="/api/namespace/class[ name='Global']/method[ name='yDecodeStep']">/api/namespace/struct[ name='Encoding']</move-node>
<!-- Enumerations -->
- <attr path="/api/namespace/enum/member[ cname='GMIME_BEST_ENCODING_7BIT']" name="name">SevenBit</attr>
- <attr path="/api/namespace/enum/member[ cname='GMIME_BEST_ENCODING_8BIT']" name="name">EightBit</attr>
+ <attr path="/api/namespace/enum/member[ cname='GMIME_ENCODING_CONSTRAINT_7BIT']" name="name">SevenBit</attr>
+ <attr path="/api/namespace/enum/member[ cname='GMIME_ENCODING_CONSTRAINT_8BIT']" name="name">EightBit</attr>
<attr path="/api/namespace/enum/member[ cname='GMIME_CONTENT_ENCODING_DEFAULT']" name="name">Default</attr>
<attr path="/api/namespace/enum/member[ cname='GMIME_CONTENT_ENCODING_7BIT']" name="name">SevenBit</attr>
diff --git a/mono/gmime-api.raw b/mono/gmime-api.raw
index 2bfb478..c9d1863 100644
--- a/mono/gmime-api.raw
+++ b/mono/gmime-api.raw
@@ -7,11 +7,6 @@
-->
<namespace name="GMime" library="gmime">
- <enum name="BestEncoding" cname="GMimeBestEncoding" type="enum">
- <member cname="GMIME_BEST_ENCODING_7BIT" name="7Bit" />
- <member cname="GMIME_BEST_ENCODING_8BIT" name="8Bit" />
- <member cname="GMIME_BEST_ENCODING_BINARY" name="Binary" />
- </enum>
<enum name="CipherHash" cname="GMimeCipherHash" type="enum">
<member cname="GMIME_CIPHER_HASH_DEFAULT" name="Default" />
<member cname="GMIME_CIPHER_HASH_MD2" name="Md2" />
@@ -34,6 +29,11 @@
<member cname="GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE" name="Quotedprintable" />
<member cname="GMIME_CONTENT_ENCODING_UUENCODE" name="Uuencode" />
</enum>
+ <enum name="EncodingConstraint" cname="GMimeEncodingConstraint" type="enum">
+ <member cname="GMIME_ENCODING_CONSTRAINT_7BIT" name="7Bit" />
+ <member cname="GMIME_ENCODING_CONSTRAINT_8BIT" name="8Bit" />
+ <member cname="GMIME_ENCODING_CONSTRAINT_BINARY" name="Binary" />
+ </enum>
<enum name="FilterBestFlags" cname="GMimeFilterBestFlags" type="flags">
<member cname="GMIME_FILTER_BEST_CHARSET" name="Charset" value="1 << 0" />
<member cname="GMIME_FILTER_BEST_ENCODING" name="Encoding" value="1 << 1" />
@@ -92,7 +92,7 @@
<callback name="EventCallback" cname="GMimeEventCallback">
<return-type type="void" />
<parameters>
- <parameter type="GObject*" name="sender" />
+ <parameter type="gpointer" name="sender" />
<parameter type="gpointer" name="args" />
<parameter type="gpointer" name="user_data" />
</parameters>
@@ -456,7 +456,7 @@
<method name="Encoding" cname="g_mime_filter_best_encoding">
<return-type type="GMimeContentEncoding" />
<parameters>
- <parameter type="GMimeBestEncoding" name="required" />
+ <parameter type="GMimeEncodingConstraint" name="constraint" />
</parameters>
</method>
<method name="GetType" cname="g_mime_filter_best_get_type" shared="true">
@@ -1332,6 +1332,12 @@
<parameter type="GMimeDataWrapper*" name="content" />
</parameters>
</virtual_method>
+ <method name="GetBestContentEncoding" cname="g_mime_part_get_best_content_encoding">
+ <return-type type="GMimeContentEncoding" />
+ <parameters>
+ <parameter type="GMimeEncodingConstraint" name="constraint" />
+ </parameters>
+ </method>
<method name="GetContentDescription" cname="g_mime_part_get_content_description">
<return-type type="const-char*" />
</method>
@@ -1699,6 +1705,37 @@
</parameters>
</method>
</object>
+ <object name="StreamGIO" cname="GMimeStreamGIO" parent="GMimeStream">
+ <field name="Ostream" cname="ostream" type="GOutputStream*" />
+ <field name="Istream" cname="istream" type="GInputStream*" />
+ <field name="File" cname="file" type="GFile*" />
+ <field name="Owner" cname="owner" type="gboolean" />
+ <field name="Eos" cname="eos" type="gboolean" />
+ <method name="GetOwner" cname="g_mime_stream_gio_get_owner">
+ <return-type type="gboolean" />
+ </method>
+ <method name="GetType" cname="g_mime_stream_gio_get_type" shared="true">
+ <return-type type="GType" />
+ </method>
+ <constructor cname="g_mime_stream_gio_new">
+ <parameters>
+ <parameter type="GFile*" name="file" />
+ </parameters>
+ </constructor>
+ <constructor cname="g_mime_stream_gio_new_with_bounds">
+ <parameters>
+ <parameter type="GFile*" name="file" />
+ <parameter type="gint64" name="start" />
+ <parameter type="gint64" name="end" />
+ </parameters>
+ </constructor>
+ <method name="SetOwner" cname="g_mime_stream_gio_set_owner">
+ <return-type type="void" />
+ <parameters>
+ <parameter type="gboolean" name="owner" />
+ </parameters>
+ </method>
+ </object>
<object name="StreamMem" cname="GMimeStreamMem" parent="GMimeStream">
<field name="Buffer" cname="buffer" type="GByteArray*" />
<field name="Owner" cname="owner" type="gboolean" />
diff --git a/tests/test-best.c b/tests/test-best.c
index f6dbe8d..c1eaad5 100644
--- a/tests/test-best.c
+++ b/tests/test-best.c
@@ -57,13 +57,13 @@ int main (int argc, char **argv)
printf ("\tbest charset: %s\n", g_mime_filter_best_charset (best));
printf ("\tbest encoding (7bit): %s\n",
g_mime_content_encoding_to_string (
- g_mime_filter_best_encoding (best, GMIME_BEST_ENCODING_7BIT)));
+ g_mime_filter_best_encoding (best, GMIME_ENCODING_CONSTRAINT_7BIT)));
printf ("\tbest encoding (8bit): %s\n",
g_mime_content_encoding_to_string (
- g_mime_filter_best_encoding (best, GMIME_BEST_ENCODING_8BIT)));
+ g_mime_filter_best_encoding (best, GMIME_ENCODING_CONSTRAINT_8BIT)));
printf ("\tbest encoding (binary): %s\n",
g_mime_content_encoding_to_string (
- g_mime_filter_best_encoding (best, GMIME_BEST_ENCODING_BINARY)));
+ g_mime_filter_best_encoding (best, GMIME_ENCODING_CONSTRAINT_BINARY)));
g_object_unref (istream);
g_object_unref (null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]