Thread: [Gambas-user] gb.mime segfault 11
Brought to you by:
gambas
|
From: roberto <rh...@ya...> - 2014-11-24 14:11:38
Attachments:
GetPart.tar.gz
|
As discuss in other thread , I have a problem with a segment fault 11 using gb.mime Find attachment with project. Inside the tar.gz is a eml file that caused the seg fault. I have parsed the same eml file in a procedure in c using libgmime-2.6 without problem. Other question: if I wanted to use the libgmime as external library, how do I go and / or create specific types of structure that need functions? ' Gambas class file Library "libgmime-2.6:0" Private Extern g_mime_part_get_content_object(GMimePart As Pointer) As Pointer In C I have call the function with: GMimeDataWrapper *mycontent = g_mime_part_get_content_object(GMIME_PART(part)); mycontent is a pointer to a struct type GMimeDataWrapper In Gambas3 I must declare a structure as GMimeDataWrapper? Regards |
|
From: Benoît M. <ga...@us...> - 2014-11-24 14:29:30
|
Le 24/11/2014 15:11, roberto a écrit : > As discuss in other thread , I have a problem with a segment fault 11 > using gb.mime > > Find attachment with project. Inside the tar.gz is a eml file that > caused the seg fault. > > I have parsed the same eml file in a procedure in c using libgmime-2.6 > without problem. Fixed in revision #6677. > > Other question: > > if I wanted to use the libgmime as external library, how do I go and / > or create specific types of structure that need functions? > > ' Gambas class file > Library "libgmime-2.6:0" > Private Extern g_mime_part_get_content_object(GMimePart As Pointer) As > Pointer > > > In C I have call the function with: > > GMimeDataWrapper *mycontent = > g_mime_part_get_content_object(GMIME_PART(part)); > > mycontent is a pointer to a struct type GMimeDataWrapper > In Gambas3 I must declare a structure as GMimeDataWrapper? > > Regards > GMimeDataWrapper is a GObject, so you can replace it by a Gambas Pointer, unless you need to access its structure: then you have to mimic in Gambas the C declaration of the structure from the header file, which may be a pain. You should better tell exactly what you need, and maybe we could add that to the component directly. Regards, -- Benoît Minisini |
|
From: roberto <rh...@ya...> - 2014-11-24 21:03:08
|
Thank you very mych for the fast resolution of the problem wait tomorrow for the revision #6677 revision, which is already available in svn but has a version 2.6.62 , while i have installed the version 6.2.99 and revision 6671 from the daily repository. For inquiries concerning the use of the library was to use the function g_mime_object_get_content_type() to take value of charset that I know are in structure GMimeParam. I don't know if you've seen, but I've tried to implement in the code that I posted, but I do not think that is compliance with the rfc822 Best Regards Il 24/11/2014 15:29, Benoît Minisini ha scritto: > Le 24/11/2014 15:11, roberto a écrit : >> As discuss in other thread , I have a problem with a segment fault 11 >> using gb.mime >> >> Find attachment with project. Inside the tar.gz is a eml file that >> caused the seg fault. >> >> I have parsed the same eml file in a procedure in c using libgmime-2.6 >> without problem. > Fixed in revision #6677. > >> Other question: >> >> if I wanted to use the libgmime as external library, how do I go and / >> or create specific types of structure that need functions? >> >> ' Gambas class file >> Library "libgmime-2.6:0" >> Private Extern g_mime_part_get_content_object(GMimePart As Pointer) As >> Pointer >> >> >> In C I have call the function with: >> >> GMimeDataWrapper *mycontent = >> g_mime_part_get_content_object(GMIME_PART(part)); >> >> mycontent is a pointer to a struct type GMimeDataWrapper >> In Gambas3 I must declare a structure as GMimeDataWrapper? >> >> Regards >> > GMimeDataWrapper is a GObject, so you can replace it by a Gambas > Pointer, unless you need to access its structure: then you have to mimic > in Gambas the C declaration of the structure from the header file, which > may be a pain. > > You should better tell exactly what you need, and maybe we could add > that to the component directly. > > Regards, > |
|
From: Benoît M. <ga...@us...> - 2014-11-24 22:33:08
|
Le 24/11/2014 22:02, roberto a écrit : > Thank you very mych for the fast resolution of the problem > wait tomorrow for the revision #6677 revision, which is already > available in svn but has a version 2.6.62 , while i have installed the > version 6.2.99 and revision 6671 from the daily repository. > > For inquiries concerning the use of the library was to use the function > g_mime_object_get_content_type() to take value of charset that I know > are in structure GMimeParam. > > I don't know if you've seen, but I've tried to implement in the code > that I posted, but I do not think that is compliance with the rfc822 > > Best Regards > Isn't it enough to parse the ContentType string? sContentType = hPart.ContentType aScan = Scan(sContentType,"*;charset=*") If aScan.Count = 2 Then sCharset = aScan[1] If Left(sCharset) = Chr$(34) Then sCharset = Unquote(sCharset) Print "Charset is "; sCharset Else Print "Charset is unknown" Endif -- Benoît Minisini |