Hi,
I think i can express it clearly now....
this my GeanyLexerStyle:

typedef struct GeanyLexerStyle
{
    gint    foreground;    /**< Foreground text colour, in @c 0xBBGGRR format. */
    gint    background;    /**< Background text colour, in @c 0xBBGGRR format. */
    gboolean bold;        /**< Bold. */
    gboolean italic;    /**< Italic. */
    gchar* font_perso;    /**  A font name*/
    gint font_size;
}
GeanyLexerStyle;

in get_keyfile_style, this struct is filled (as least for c)...
thanks to a gchar** list... pointing to the [styling] sections of filetypes.foo

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
when I comment out the free statement, thinhs behave logically...

what do you reckon? free the list variable later on?

jimmy

2009/5/8 Enrico Tröger <enrico.troeger@uvena.de>
On Fri, 8 May 2009 18:26:15 +0200, Jimmy wrote:

>> >functions...i'm facing pointer pbs, basically...my font name does
>> >not propagate properly through functions...
>>
>> If you need help for a specific problem, just ask.
>
>
>ok...it's probably silly, as i'm not an experienced C programmer...and
>didn't spend a lot of time on it...
>but as I told you, I expanded the GeanyLexerStyle structure....
>
>in get_keyfile_style and get_key_file_hex my adds to the filetypes.foo
>are properly read...
>and when i print out my new element of the struct it's either null or
>the fontname I've just entered in the file....
>
>but when i try to access my new entry in a another function (such as
>set_sci_style), it has been obviously been written over by something

Hard to say without any code but it sounds like the char* pointer is
either freed in between or it's a static string which is only valid
within a function. Just create a diff of your current code and send it
to the list or me or some paste bin or whatever.


Regards,
Enrico

--
Get my GPG key from http://www.uvena.de/pub.asc

_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel