Re: [Vala] using a non-glib c library

2009-09-26 Thread Jan Hudec
On Sat, Sep 26, 2009 at 11:42:01 -0500, Mr. Maxwell . wrote: > > > One more thing, a lot of the functions return C style strings, (char *) > > > are > > > they the same as vala strings? (so I can replace char * with string?) > > > > Yes, "string" in vala corresponds to "char *" in C. You will jus

Re: [Vala] using a non-glib c library

2009-09-26 Thread Mr. Maxwell .
> > One more thing, a lot of the functions return C style strings, (char *) are > > they the same as vala strings? (so I can replace char * with string?) > > Yes, "string" in vala corresponds to "char *" in C. You will just have to > find out which strings you have to free and which not and mark

Re: [Vala] using a non-glib c library

2009-09-25 Thread Jan Hudec
On Thu, Sep 24, 2009 at 18:11:59 -0500, Mr. Maxwell . wrote: > ID3Lib defines numerous enums. Here's an example > > typedef enum _ID3_TextEnc ID3_TextEnc; enum _ID3_TextEnc > { > ID3TE_NONE = -1, > ID3TE_ISO8859_1, > ID3TE_UTF16, > ID3TE_UTF16BE, > ID3TE_UTF8, > ID3TE_NUMENCODINGS, >

Re: [Vala] using a non-glib c library

2009-09-24 Thread Mr. Maxwell .
ID3Lib defines numerous enums. Here's an example typedef enum _ID3_TextEnc ID3_TextEnc; enum _ID3_TextEnc { ID3TE_NONE = -1, ID3TE_ISO8859_1, ID3TE_UTF16, ID3TE_UTF16BE, ID3TE_UTF8, ID3TE_NUMENCODINGS, ID3TE_ASCII = ID3TE_ISO8859_1, ID3TE_UNICODE = ID3TE_UTF16 }; I'm no

Re: [Vala] using a non-glib C library in vala

2009-09-17 Thread Frederik
Jan Hudec wrote: > What you describe is the meaning of struct. Structs are always allocated > statically and always passed by value (unless ref modifier is used, of > course). > > Passing by reference is indicated by declaring as 'class'. Classes are > supposed to support reference-counting, but i

Re: [Vala] using a non-glib C library in vala

2009-09-17 Thread Jan Hudec
On Wed, Sep 16, 2009 at 15:46:34 -0400, Michael B. Trausch wrote: > On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: > > Did the meaning of [SimpleType] change somewhere? I thought it meant > > "pass by value". > > And pardon me, I'm not thinking very clearly. That sounds wrong. >

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: > The bug is "memset code generation is incorrect", so I'm not sure how > you can say "Vala should not generate invalid code, but this bug is > indeed invalid". The bug is that the code generation is incorrect. > > Whether or not the bi

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jürg Billeter
On Wed, 2009-09-16 at 15:46 -0400, Michael B. Trausch wrote: > On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: > > Did the meaning of [SimpleType] change somewhere? I thought it meant > > "pass by value". > > And pardon me, I'm not thinking very clearly. That sounds wrong. > > My

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
On Wed, 2009-09-16 at 15:41 -0400, Michael B. Trausch wrote: > Did the meaning of [SimpleType] change somewhere? I thought it meant > "pass by value". And pardon me, I'm not thinking very clearly. That sounds wrong. My thought was that a SimpleType could be allocated statically, and passing it

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
On Wed, 2009-09-16 at 21:34 +0200, Jan Hudec wrote: > [...] > > However, there is one small problem: You can *not* use the structure as > > a [SimpleType], due to a bug in Vala (see bug 588280). If you attempt > > Why do you think it is a [SimpleType]. SimpleTypes are only the built-in > non-str

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Jan Hudec
On Wed, Sep 16, 2009 at 10:33:22 -0400, Michael B. Trausch wrote: > Mr. Maxwell, sorry for the dupe. Forgot to cc the list. > > On Tue, 2009-09-15 at 17:14 -0500, Mr. Maxwell . wrote: > > What do I do with the typedef struct declarations? This is what I have > > but I don't think it's right. > >

Re: [Vala] using a non-glib C library in vala

2009-09-16 Thread Michael B. Trausch
Mr. Maxwell, sorry for the dupe. Forgot to cc the list. On Tue, 2009-09-15 at 17:14 -0500, Mr. Maxwell . wrote: > What do I do with the typedef struct declarations? This is what I have > but I don't think it's right. > > c code > typedef struct { char _dummy; } ID3Tag; > > vala code > [CC

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Jan Hudec
On Tue, Sep 15, 2009 at 17:14:38 -0500, Mr. Maxwell . wrote: > > What do I do with the typedef struct declarations? This is what I have but I > don't think it's right. > > c code > typedef struct { char _dummy; } ID3Tag; They would have done better if they had typedef struct _ID3Tag ID3Tag

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Mr. Maxwell .
:14:24 -0300 Subject: Re: [Vala] using a non-glib C library in vala From: mfpuente...@gmail.com To: mr_maxw...@live.com CC: vala-list@gnome.org if the namespace will be called Id3 you can do this [Compact] [CCode (cname="ID3Tag")] public class Tag { [CCode (cname="ID3Tag_New&

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Matías De la Puente
if the namespace will be called Id3 you can do this [Compact] [CCode (cname="ID3Tag")] public class Tag { [CCode (cname="ID3Tag_New")] public Tag (); [CCode (cname="ID3Tag_HasChanged")] public bool has_changed (); // add the others } I don't remeber well how to add the free function (in

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Mr. Maxwell .
I figured out ID3_C_EXPORT and CCONV, they are irrelevant for the binding. I'm still wondering about the first highlighted line though. > From: mr_maxw...@live.com > To: vala-list@gnome.org > Date: Tue, 15 Sep 2009 15:03:01 -0500 > Subject: Re: [Vala] using a non-glib

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Mr. Maxwell .
and CCONV? > Date: Tue, 15 Sep 2009 11:15:48 +0300 > From: arkash...@gmail.com > To: vala-list@gnome.org > Subject: [Vala] using a non-glib C library in vala > > There is some guide I have found on the internet which might help you: > http://mike.trausch.us/blog/2009/02/18/vala-

[Vala] using a non-glib C library in vala

2009-09-15 Thread Arkadi Viner
There is some guide I have found on the internet which might help you: http://mike.trausch.us/blog/2009/02/18/vala-bindings-for-non-gobject-type-c-libraries/ Good luck. On Tue, Sep 15, 2009 at 10:15 AM, Jan Hudec wrote: > Hello, > > On Tue, September 15, 2009 02:13, Mr. Maxwell . wrote: > > > >

Re: [Vala] using a non-glib C library in vala

2009-09-15 Thread Jan Hudec
Hello, On Tue, September 15, 2009 02:13, Mr. Maxwell . wrote: > > I wish to use the id3lib (http://id3lib.sourceforge.net/) library in vala. > The only info I could find on writing the vapi file was for glib > libraries, could you guys help me here? I have no idea where to start. I guess you can

[Vala] using a non-glib C library in vala

2009-09-14 Thread Mr. Maxwell .
I wish to use the id3lib (http://id3lib.sourceforge.net/) library in vala. The only info I could find on writing the vapi file was for glib libraries, could you guys help me here? I have no idea where to start. _ Hotmail: Free, tru