Kod: Zaznacz cały
MyWidgets *widgets;
widgets = g_slice_new (MyWidgets);
widgets->settings=g_malloc(sizeof(SSH_Settings));
widgets->settings->id_rsa_dir=(gchar*)g_malloc(sizeof(gchar)*256);
Kod: Zaznacz cały
void *read_conf_file(void *args)
{
MyWidgets *widgets;
widgets = (MyWidgets *)args;
g_free(widgets->settings);
g_free(widgets->settings->id_rsa_dir);
widgets->settings=g_malloc(sizeof(SSH_Settings));
widgets->settings->id_rsa_dir=(gchar*)g_malloc(sizeof(gchar)*256);
}
Kod: Zaznacz cały
read_conf_file(widgets);
Kod: Zaznacz cały
typedef struct
{
GladeXML *gxml;
GtkWidget *window2;
GtkWidget *window;
GtkWidget *entry;
GtkWidget *setting_entry_id_rsa;
GtkWidget *setting_entry_login;
GtkWidget *setting_entry_ssh_config;
GtkWidget *textview;
GtkWidget *radio1;
GtkWidget *radio2;
GtkWidget *radio3;
GtkWidget *radio4;
GtkWidget *radio5;
GtkWidget *radio6;
GtkWidget *toggle1;
GtkWidget *toggle2;
GtkWidget *toggle3;
GtkWidget *toggle4;
GtkWidget *toggle5;
GtkWidget *toggle6;
GtkWidget *toggleButton;
GtkWidget *progress_bar;
GtkWidget *connection;
SSH_Settings *settings;
gchar *filename;
GError *error;
} MyWidgets;
Kod: Zaznacz cały
typedef struct
{
gchar *id_rsa_dir;
gchar *login;
gchar *ssh_config_dir;
} SSH_Settings;
Kod: Zaznacz cały
widgets->settings->id_rsa_dir=(gchar*)g_malloc(sizeof(gchar)*256);