nevermind...just used a strcpy...went just fine...<br>i'll probably make decent advances now...<br>cheers<br>j<br><br><div class="gmail_quote">2009/5/8 Jimmy Paillet <span dir="ltr"><<a href="mailto:jimmy.paillet@gmail.com">jimmy.paillet@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>I think i can express it clearly now....<br>this my GeanyLexerStyle:<br><br>typedef struct GeanyLexerStyle<br>
{<br>    gint    foreground;    /**< Foreground text colour, in @c 0xBBGGRR format. */<br>    gint    background;    /**< Background text colour, in @c 0xBBGGRR format. */<br>
    gboolean bold;        /**< Bold. */<br>    gboolean italic;    /**< Italic. */<br>    gchar* font_perso;    /**  A font name*/<br>    gint font_size;<br>}<br>GeanyLexerStyle;<br><br>in get_keyfile_style, this struct is filled (as least for c)...<br>

thanks to a gchar** list... pointing to the [styling] sections of filetypes.foo <br><br>of course at the end of this function, list is free'd....so my pointer font_perso points to crap outside the func...hence my pb... :D<br>

when I comment out the free statement, thinhs behave logically...<br><br>what do you reckon? free the list variable later on?<br><br>jimmy <br><br><div class="gmail_quote">2009/5/8 Enrico Tröger <span dir="ltr"><<a href="mailto:enrico.troeger@uvena.de" target="_blank">enrico.troeger@uvena.de</a>></span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5"><div>On Fri, 8 May 2009 18:26:15 +0200, Jimmy wrote:<br>
<br>
>> >functions...i'm facing pointer pbs, basically...my font name does<br>
>> >not propagate properly through functions...<br>
>><br>
>> If you need help for a specific problem, just ask.<br>
><br>
><br>
>ok...it's probably silly, as i'm not an experienced C programmer...and<br>
>didn't spend a lot of time on it...<br>
>but as I told you, I expanded the GeanyLexerStyle structure....<br>
><br>
>in get_keyfile_style and get_key_file_hex my adds to the filetypes.foo<br>
>are properly read...<br>
>and when i print out my new element of the struct it's either null or<br>
>the fontname I've just entered in the file....<br>
><br>
>but when i try to access my new entry in a another function (such as<br>
>set_sci_style), it has been obviously been written over by something<br>
<br>
</div>Hard to say without any code but it sounds like the char* pointer is<br>
either freed in between or it's a static string which is only valid<br>
within a function. Just create a diff of your current code and send it<br>
to the list or me or some paste bin or whatever.<br>
<div><div></div><div><br>
<br>
Regards,<br>
Enrico<br>
<br>
--<br>
Get my GPG key from <a href="http://www.uvena.de/pub.asc" target="_blank">http://www.uvena.de/pub.asc</a><br>
</div></div><br></div></div><div class="im">_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de" target="_blank">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>