gmime r1293 - in trunk: . docs/reference gmime mono
- From: fejj svn gnome org
- To: svn-commits-list gnome org
- Subject: gmime r1293 - in trunk: . docs/reference gmime mono
- Date: Wed, 28 May 2008 02:14:45 +0000 (UTC)
Author: fejj
Date: Wed May 28 02:14:45 2008
New Revision: 1293
URL: http://svn.gnome.org/viewvc/gmime?rev=1293&view=rev
Log:
2008-05-27 Jeffrey Stedfast <fejj novell com>
* gmime/gmime-content-type.c (g_mime_content_type_get_media_type):
New accessor function to ease bindings.
(g_mime_content_type_get_media_subtype): Same.
(g_mime_content_type_get_params): Same.
Modified:
trunk/ChangeLog
trunk/docs/reference/gmime-sections.txt
trunk/gmime/gmime-content-type.c
trunk/gmime/gmime-content-type.h
trunk/mono/GMime.metadata
trunk/mono/gmime-api.raw
Modified: trunk/docs/reference/gmime-sections.txt
==============================================================================
--- trunk/docs/reference/gmime-sections.txt (original)
+++ trunk/docs/reference/gmime-sections.txt Wed May 28 02:14:45 2008
@@ -596,6 +596,9 @@
g_mime_content_type_destroy
g_mime_content_type_to_string
g_mime_content_type_is_type
+g_mime_content_type_get_media_type
+g_mime_content_type_get_media_subtype
+g_mime_content_type_get_params
g_mime_content_type_set_parameter
g_mime_content_type_get_parameter
</SECTION>
Modified: trunk/gmime/gmime-content-type.c
==============================================================================
--- trunk/gmime/gmime-content-type.c (original)
+++ trunk/gmime/gmime-content-type.c Wed May 28 02:14:45 2008
@@ -100,22 +100,20 @@
/**
* g_mime_content_type_new_from_string:
- * @string: input string containing a content-type (and params)
+ * @str: input string containing a content-type (and params)
*
* Constructs a new Content-Type object based on the input string.
*
* Returns a new MIME Content-Type based on the input string.
**/
GMimeContentType *
-g_mime_content_type_new_from_string (const char *string)
+g_mime_content_type_new_from_string (const char *str)
{
GMimeContentType *mime_type;
char *type = NULL, *subtype;
- const char *inptr;
+ const char *inptr = str;
- g_return_val_if_fail (string != NULL, NULL);
-
- inptr = string;
+ g_return_val_if_fail (str != NULL, NULL);
/* get the type */
type = (char *) inptr;
@@ -256,6 +254,57 @@
/**
+ * g_mime_content_type_get_media_type:
+ * @mime_type: MIME Content-Type
+ *
+ * Gets the Content-Type's media type.
+ *
+ * Returns the Content-Type's media type.
+ **/
+const char *
+g_mime_content_type_get_media_type (const GMimeContentType *mime_type)
+{
+ g_return_val_if_fail (mime_type != NULL, NULL);
+
+ return mime_type->type;
+}
+
+
+/**
+ * g_mime_content_type_get_media_subtype:
+ * @mime_type: MIME Content-Type
+ *
+ * Gets the Content-Type's media sub-type.
+ *
+ * Returns the Content-Type's media sub-type.
+ **/
+const char *
+g_mime_content_type_get_media_subtype (const GMimeContentType *mime_type)
+{
+ g_return_val_if_fail (mime_type != NULL, NULL);
+
+ return mime_type->subtype;
+}
+
+
+/**
+ * g_mime_content_type_get_params:
+ * @mime_type: MIME Content-Type
+ *
+ * Gets the Content-Type's parameter list.
+ *
+ * Returns the Content-Type's parameter list.
+ **/
+const GMimeParam *
+g_mime_content_type_get_params (const GMimeContentType *mime_type)
+{
+ g_return_val_if_fail (mime_type != NULL, NULL);
+
+ return mime_type->params;
+}
+
+
+/**
* g_mime_content_type_set_parameter:
* @mime_type: MIME Content-Type
* @attribute: parameter name (aka attribute)
Modified: trunk/gmime/gmime-content-type.h
==============================================================================
--- trunk/gmime/gmime-content-type.h (original)
+++ trunk/gmime/gmime-content-type.h Wed May 28 02:14:45 2008
@@ -31,14 +31,14 @@
char *type;
char *subtype;
- GMimeParam *params;
GHashTable *param_hash;
+ GMimeParam *params;
};
typedef struct _GMimeContentType GMimeContentType;
GMimeContentType *g_mime_content_type_new (const char *type, const char *subtype);
-GMimeContentType *g_mime_content_type_new_from_string (const char *string);
+GMimeContentType *g_mime_content_type_new_from_string (const char *str);
void g_mime_content_type_destroy (GMimeContentType *mime_type);
@@ -46,6 +46,10 @@
gboolean g_mime_content_type_is_type (const GMimeContentType *mime_type, const char *type, const char *subtype);
+const char *g_mime_content_type_get_media_type (const GMimeContentType *mime_type);
+const char *g_mime_content_type_get_media_subtype (const GMimeContentType *mime_type);
+const GMimeParam *g_mime_content_type_get_params (const GMimeContentType *mime_type);
+
void g_mime_content_type_set_parameter (GMimeContentType *mime_type, const char *attribute, const char *value);
const char *g_mime_content_type_get_parameter (const GMimeContentType *mime_type, const char *attribute);
Modified: trunk/mono/GMime.metadata
==============================================================================
--- trunk/mono/GMime.metadata (original)
+++ trunk/mono/GMime.metadata Wed May 28 02:14:45 2008
@@ -95,8 +95,7 @@
<!-- We want to be able to get at the type and subtype fields of this
structure, so don't mark it as opaque. -->
- <attr path="/api/namespace/struct[ cname='GMimeContentType']" name="opaque">false</attr>
- <attr path="/api/namespace/struct[ cname='GMimeContentType']/field[ cname='param_hash']" name="hidden">true</attr>
+ <attr path="/api/namespace/struct[ cname='GMimeContentType']" name="opaque">true</attr>
<!-- The generator irritating always converts a method named GetType to a
GType property regardless of whether or not it's actually a glib type
Modified: trunk/mono/gmime-api.raw
==============================================================================
--- trunk/mono/gmime-api.raw (original)
+++ trunk/mono/gmime-api.raw Wed May 28 02:14:45 2008
@@ -685,7 +685,7 @@
<return-type type="void" />
<parameters>
<parameter type="char*" name="type" />
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="ForeachPart" cname="g_mime_message_foreach_part">
@@ -1613,7 +1613,7 @@
<method name="WriteString" cname="g_mime_stream_write_string">
<return-type type="ssize_t" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="WriteToStream" cname="g_mime_stream_write_to_stream">
@@ -1942,17 +1942,26 @@
<struct name="ContentType" cname="GMimeContentType" opaque="true">
<field name="Type" cname="type" type="char*" access="public" writeable="true" />
<field name="Subtype" cname="subtype" type="char*" access="public" writeable="true" />
- <field name="Params" cname="params" type="GMimeParam*" access="public" writeable="true" />
<field name="ParamHash" cname="param_hash" type="GHashTable*" access="public" writeable="true" />
+ <field name="Params" cname="params" type="GMimeParam*" access="public" writeable="true" />
<method name="Destroy" cname="g_mime_content_type_destroy">
<return-type type="void" />
</method>
+ <method name="GetMediaSubtype" cname="g_mime_content_type_get_media_subtype">
+ <return-type type="const-char*" />
+ </method>
+ <method name="GetMediaType" cname="g_mime_content_type_get_media_type">
+ <return-type type="const-char*" />
+ </method>
<method name="GetParameter" cname="g_mime_content_type_get_parameter">
<return-type type="const-char*" />
<parameters>
<parameter type="const-char*" name="attribute" />
</parameters>
</method>
+ <method name="GetParams" cname="g_mime_content_type_get_params">
+ <return-type type="const-GMimeParam*" />
+ </method>
<method name="IsType" cname="g_mime_content_type_is_type">
<return-type type="gboolean" />
<parameters>
@@ -1968,7 +1977,7 @@
</constructor>
<constructor cname="g_mime_content_type_new_from_string">
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</constructor>
<method name="SetParameter" cname="g_mime_content_type_set_parameter">
@@ -2081,14 +2090,14 @@
</constructor>
<constructor cname="g_mime_param_new_from_string">
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</constructor>
<method name="WriteToString" cname="g_mime_param_write_to_string">
<return-type type="void" />
<parameters>
<parameter type="gboolean" name="fold" />
- <parameter type="GString*" name="string" />
+ <parameter type="GString*" name="str" />
</parameters>
</method>
</struct>
@@ -2208,7 +2217,7 @@
<method name="ParseString" cname="internet_address_parse_string" shared="true">
<return-type type="InternetAddressList*" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="Ref" cname="internet_address_ref">
@@ -2351,13 +2360,13 @@
<method name="LocaleToUtf8" cname="g_mime_iconv_locale_to_utf8" shared="true">
<return-type type="char*" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="LocaleToUtf8Length" cname="g_mime_iconv_locale_to_utf8_length" shared="true">
<return-type type="char*" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
<parameter type="size_t" name="n" />
</parameters>
</method>
@@ -2375,27 +2384,27 @@
<return-type type="char*" />
<parameters>
<parameter type="iconv_t" name="cd" />
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="Strndup" cname="g_mime_iconv_strndup" shared="true">
<return-type type="char*" />
<parameters>
<parameter type="iconv_t" name="cd" />
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
<parameter type="size_t" name="n" />
</parameters>
</method>
<method name="Utf8ToLocale" cname="g_mime_iconv_utf8_to_locale" shared="true">
<return-type type="char*" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
</parameters>
</method>
<method name="Utf8ToLocaleLength" cname="g_mime_iconv_utf8_to_locale_length" shared="true">
<return-type type="char*" />
<parameters>
- <parameter type="const-char*" name="string" />
+ <parameter type="const-char*" name="str" />
<parameter type="size_t" name="n" />
</parameters>
</method>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]