Re: [PATCH] X-Operating System in outgoing mail's header



I've reworked my patch against today cvs.

The code is more gnomified.
I've used the powerfull g_strdup_printf function (thanks ali).

Despite ali's advice I've remove 
	if (pointer) g_free(pointer);
in favor of
	g_free(pointer)
after greeping balsa source code.
If you see warning (I see no warning) then I believe that something is
wrong in my code.

Christophe

Le 2001.08.28 19:58:09 +0200, christophe barbe a écrit :
> Le 2001.08.28 10:54:09 +0200, Ali Akcaagac a écrit :
> > hello,
> > 
> > i am just playing around with your patch and gonna apply
> > that one within the next minutes but here a comment as far.
> > 
> 
> Cool.
> 
> > 
> > 
> > > +    gchar * tmp, *format;
> > > +
> > > +    format=g_strdup(gtk_entry_get_text(GTK_ENTRY(pui->SystemIdFormat)));
> > > +    tmp=get_SystemId(format);
> > > +    gtk_label_set_text(GTK_LABEL (pui->SystemId_preview), tmp);
> > > +    g_free(tmp);
> > > +    g_free(format);
> > 
> > gchar *tmp = NULL;
> > gchar *format = NULL;
> > 
> > ...
> > ...
> > ...
> > 
> > if (tmp == NULL)
> >     g_free (tmp);
> > if (format == NULL)
> >     g_free (format);
> 
> here you mean tmp !=NULL    (-;
>  
> > would be the better solution in case if one of them failed.
> > e.g. if g_strdup failed or if get_SystemId failed. if one of
> > the pointers arent getting initialized then you free an
> > already empty pointer. this causes a warning printed out on
> > console.
> 
> I will change this.
> 
> > > +    result=(char *)malloc((len+1)*sizeof(char));
> > > +    if (result==NULL) {
> > > +        fprintf(stderr, "unable to allocate memory\n");
> > > +        return NULL;
> > > +    }
> > 
> > g_malloc in case of compatibility.
> 
> If I need to gnomify my mind too.
> 
> > > +    snprintf(tooltip_str, TOOLTIPSZ,
> > > +        "You can use the following sustitutions" \
> > > +        " to describe your system :\n" \
> > > +        "%%m machine type (%s)\n" \
> > > +        "%%h machine's hostname (%s)\n"  \
> > > +        "%%s operating system name (%s)\n" \
> > > +        "%%r operating system release (%s)\n" \
> > > +        "%%v operating system version (%s)\n" \
> > > +        ,balsa_app.uname.machine,
> > > +        balsa_app.uname.nodename,
> > > +        balsa_app.uname.sysname,
> > > +        balsa_app.uname.release,
> > > +        balsa_app.uname.version
> > > +        );
> > 
> > this one too. placing the string into an array is quite evil,
> > since you don't know how long the array is and if everything
> > fits inside. i recommend you use g_strdup_printf as far as i
> > remember theres a more equivalent version of what i recommend
> > but i am not sure right now this gives you a pointer to a string
> > back that is more accurate.
> 
> This sound good to me. I will try it.
> 
> > at least there are quite a lot of standard 'C' functions used
> > this works but it would be better to GNOMIFY them with the
> > replacement gnome functions. this also offers special compatibility
> > on other plattforms etc.
> 
> Fully agree but I need to find out what is available in g stuff.
> 
> Thank you for your review.
> Christophe
> 
> > -- 
> > Name....: Ali Akcaagac
> > Status..: Student Of Computer & Economic Science
> > E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
> > WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
> > 
> > _______________________________________________
> > balsa-list mailing list
> > balsa-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/balsa-list
> > 
> -- 
> Christophe Barbé <christophe.barbe@online.fr>
> GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8  F67A 8F45 2F1E D72C B41E
> 
> _______________________________________________
> balsa-list mailing list
> balsa-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/balsa-list
> 
-- 
Christophe Barbé <christophe.barbe@online.fr>
GnuPG FingerPrint: E0F6 FADF 2A5C F072 6AF8  F67A 8F45 2F1E D72C B41E
diff -u -N -r balsa/libbalsa/message.h balsa-new/libbalsa/message.h
--- balsa/libbalsa/message.h	Tue Aug 28 23:21:00 2001
+++ balsa/libbalsa/message.h	Tue Aug 28 23:21:00 2001
@@ -188,7 +188,7 @@
 			       LibBalsaMailbox* fccbox,
 			       gint encoding, gchar* smtp_server,
 			       auth_context_t smtp_authctx,
-			       gint tls_mode);
+			       gint tls_mode, gchar* system_id);
 #else
 gboolean libbalsa_message_send(LibBalsaMessage* message,
 			       LibBalsaMailbox* outbox,  
diff -u -N -r balsa/libbalsa/misc.h balsa-new/libbalsa/misc.h
--- balsa/libbalsa/misc.h	Tue Aug 28 23:21:00 2001
+++ balsa/libbalsa/misc.h	Tue Aug 28 23:21:00 2001
@@ -47,7 +47,7 @@
 #if ENABLE_ESMTP
 gboolean libbalsa_process_queue(LibBalsaMailbox* outbox, gint encoding,
 				gchar* smtp_server,
-				auth_context_t smtp_authctx, gint tls_mode);
+				auth_context_t smtp_authctx, gint tls_mode, gchar* system_id);
 #else
 gboolean libbalsa_process_queue(LibBalsaMailbox* outbox, gint encoding);
 #endif
diff -u -N -r balsa/libbalsa/send.c balsa-new/libbalsa/send.c
--- balsa/libbalsa/send.c	Tue Aug 28 23:21:01 2001
+++ balsa/libbalsa/send.c	Tue Aug 28 23:21:01 2001
@@ -1,4 +1,5 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  *
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
@@ -347,12 +348,12 @@
 libbalsa_message_send(LibBalsaMessage* message, LibBalsaMailbox* outbox,
 		      LibBalsaMailbox* fccbox, gint encoding,
 		      gchar* smtp_server, auth_context_t smtp_authctx,
-		      gint tls_mode)
+		      gint tls_mode, gchar* system_id)
 {
     if (message != NULL)
 	libbalsa_message_queue(message, outbox, fccbox, encoding);
     return libbalsa_process_queue(outbox, encoding, smtp_server, smtp_authctx,
-                                  tls_mode);
+                                  tls_mode, system_id);
 }
 #else
 gboolean
@@ -433,7 +434,7 @@
 gboolean 
 libbalsa_process_queue(LibBalsaMailbox* outbox, gint encoding, 
 		       gchar* smtp_server, auth_context_t smtp_authctx,
-		       gint tls_mode)
+		       gint tls_mode, gchar* system_id)
 {
     MessageQueueItem *new_message;
     SendMessageInfo *send_message_info;
@@ -563,6 +564,14 @@
 		if (bcc_message)
 		    smtp_set_header (bcc_message, "Disposition-Notification-To",
 		    	             phrase, mailbox);
+	    }
+
+		 if ((system_id!=NULL) && (system_id[0]!=0)) {
+		phrase = libbalsa_address_get_phrase(queu->dispnotify_to);
+		mailbox = libbalsa_address_get_mailbox(queu->dispnotify_to, 0);
+		smtp_set_header (message, "X-Operating-System", system_id);
+		if (bcc_message)
+		    smtp_set_header (bcc_message, "X-Operating-System", system_id);
 	    }
 #endif
 
diff -u -N -r balsa/src/Makefile.am balsa-new/src/Makefile.am
--- balsa/src/Makefile.am	Tue Aug 28 23:21:01 2001
+++ balsa/src/Makefile.am	Tue Aug 28 23:21:01 2001
@@ -54,7 +54,9 @@
 	toolbar-prefs.c		\
 	toolbar-prefs.h		\
 	toolbar-factory.c	\
-	toolbar-factory.h
+	toolbar-factory.h \
+	system-id.c	\
+	system-id.h
 
 balsa_IDL_SOURCES = \
 	balsa-common.c		\
diff -u -N -r balsa/src/balsa-app.c balsa-new/src/balsa-app.c
--- balsa/src/balsa-app.c	Tue Aug 28 23:21:01 2001
+++ balsa/src/balsa-app.c	Tue Aug 28 23:21:01 2001
@@ -1,4 +1,5 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -340,6 +341,10 @@
 
     balsa_app.notify_new_mail_sound = 1;
     balsa_app.notify_new_mail_dialog = 0;
+
+    /* System Identification */
+    balsa_app.system_id_format=NULL;
+    balsa_app.system_id=NULL;
 
     /* Tooltips */
     balsa_app.tooltips = gtk_tooltips_new();
diff -u -N -r balsa/src/balsa-app.h balsa-new/src/balsa-app.h
--- balsa/src/balsa-app.h	Tue Aug 28 23:21:01 2001
+++ balsa/src/balsa-app.h	Tue Aug 28 23:21:01 2001
@@ -22,6 +22,8 @@
 #ifndef __BALSA_APP_H__
 #define __BALSA_APP_H__
 
+#include <sys/utsname.h>
+
 #include <gnome.h>
 #include "libbalsa.h"
 #include "identity.h"
@@ -323,6 +325,11 @@
 
     /* Tooltips */
     GtkTooltips *tooltips;
+
+	 /* System Identification */
+    struct utsname uname;
+    char * system_id_format;
+    char * system_id;
 
 #ifdef BALSA_MDN_REPLY
     /* how to act if a MDN request is received */
diff -u -N -r balsa/src/balsa-message.c balsa-new/src/balsa-message.c
--- balsa/src/balsa-message.c	Tue Aug 28 23:21:01 2001
+++ balsa/src/balsa-message.c	Tue Aug 28 23:21:01 2001
@@ -2454,7 +2454,8 @@
 			      balsa_app.encoding_style,  
 			      balsa_app.smtp_server,
 			      balsa_app.smtp_authctx,
-			      balsa_app.smtp_tls_mode);
+			      balsa_app.smtp_tls_mode,
+					balsa_app.system_id);
 #else
 	libbalsa_message_send(mdn, balsa_app.outbox, NULL,
 			      balsa_app.encoding_style);
@@ -2614,7 +2615,8 @@
 			  balsa_app.encoding_style,  
 			  balsa_app.smtp_server,
 			  balsa_app.smtp_authctx,
-			  balsa_app.smtp_tls_mode);
+			  balsa_app.smtp_tls_mode,
+			  balsa_app.system_id);
 #else
     libbalsa_message_send(send_msg, balsa_app.outbox, NULL,
 			  balsa_app.encoding_style);  
diff -u -N -r balsa/src/main-window.c balsa-new/src/main-window.c
--- balsa/src/main-window.c	Tue Aug 28 23:21:02 2001
+++ balsa/src/main-window.c	Tue Aug 28 23:21:02 2001
@@ -1604,7 +1604,7 @@
 #if ENABLE_ESMTP
     libbalsa_process_queue(balsa_app.outbox, balsa_app.encoding_style,
 			   balsa_app.smtp_server, balsa_app.smtp_authctx,
-			   balsa_app.smtp_tls_mode);
+			   balsa_app.smtp_tls_mode, balsa_app.system_id);
 #else
     libbalsa_process_queue(balsa_app.outbox, balsa_app.encoding_style);
 #endif
diff -u -N -r balsa/src/main.c balsa-new/src/main.c
--- balsa/src/main.c	Tue Aug 28 23:21:02 2001
+++ balsa/src/main.c	Tue Aug 28 23:21:02 2001
@@ -1,4 +1,5 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -54,6 +55,7 @@
 #include "main.h"
 #include "information.h"
 #include "pop3.h"
+#include "system-id.h"
 
 #include "libinit_balsa/init_balsa.h"
 
@@ -301,6 +303,10 @@
 
     /* checking for valid config files */
     config_init();
+
+    /* set X-Operating-System string */
+    init_system_id();
+    update_system_id();
 
     /* load mailboxes */
     mailboxes_init();
diff -u -N -r balsa/src/pref-manager.c balsa-new/src/pref-manager.c
--- balsa/src/pref-manager.c	Tue Aug 28 23:21:02 2001
+++ balsa/src/pref-manager.c	Tue Aug 28 23:21:02 2001
@@ -1,4 +1,5 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -33,6 +34,7 @@
 #include "spell-check.h"
 #include "address-book-config.h"
 #include "quote-color.h"
+#include "system-id.h"
 
 /* FIXME: Mutt dependency for ENC7BIT ENC8BIT ENCQUOTEDPRINTABLE consts*/
 #include "../libmutt/mime.h"
@@ -99,6 +101,10 @@
     GtkWidget *debug_message_menu;
     GtkWidget *fatal_message_menu;
 
+    /* System Identification */
+    GtkWidget *system_id_format;
+    GtkWidget *system_id_preview;
+
     /* arp */
     GtkWidget *quote_str;
 
@@ -173,6 +179,7 @@
 static void mailbox_timer_modified_cb(GtkWidget * widget, GtkWidget * pbox);
 static void wrap_modified_cb(GtkWidget * widget, GtkWidget * pbox);
 static void pgdown_modified_cb(GtkWidget * widget, GtkWidget * pbox);
+static void system_id_preview_cb(GtkWidget * widget, GtkWidget * pbox);
 static void spelling_optionmenu_cb(GtkItem * menuitem, gpointer data);
 static void set_default_address_book_cb(GtkWidget * button, gpointer data);
 static void imap_toggled_cb(GtkWidget * widget, GtkWidget * pbox);
@@ -382,6 +389,10 @@
     gtk_signal_connect(GTK_OBJECT(pui->reply_strip_html_parts), "toggled",
 		       GTK_SIGNAL_FUNC(properties_modified_cb), property_box);
 
+    /* System Identification */
+    gtk_signal_connect(GTK_OBJECT(pui->system_id_format), "changed",
+		       GTK_SIGNAL_FUNC(system_id_preview_cb), property_box);
+
     /* arp */
     gtk_signal_connect(GTK_OBJECT(pui->quote_str), "changed",
 		       GTK_SIGNAL_FUNC(properties_modified_cb),
@@ -698,6 +709,15 @@
 	GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(menu_item)));
 
     /*
+     * System information
+     */
+    tmp=balsa_app.system_id_format;
+    balsa_app.system_id_format=g_strdup(gtk_entry_get_text(
+                GTK_ENTRY(pui->system_id_format)));
+    update_system_id();
+    g_free(tmp);
+
+    /*
      * close window and free memory
      */
     config_save();
@@ -911,6 +931,17 @@
     gtk_menu_set_active(GTK_MENU(pui->debug_message_menu),
 			balsa_app.debug_message);
 
+    /* System information */
+    gtk_entry_set_text(GTK_ENTRY(pui->system_id_format),
+			   balsa_app.system_id_format);
+    tmp=get_system_id_tooltip(balsa_app.system_id_format);
+    gtk_tooltips_set_tip(balsa_app.tooltips, pui->system_id_format,
+           tmp, "set X-Operating-System field in outgoing mail");
+    g_free(tmp);
+    tmp=get_system_id(balsa_app.system_id_format);
+    gtk_label_set_text(GTK_LABEL (pui->system_id_preview), tmp);
+    g_free(tmp);
+
 }
 
 static void
@@ -1452,6 +1483,8 @@
     GtkWidget *frame2;
     GtkWidget *table;
     GtkTable  *table2;
+    GtkTable  *table3;
+    GtkTable  *table4;
     GtkObject *spinbutton_adj;
     GtkWidget *label;
     GtkWidget *vbox1, *vbox2;
@@ -1508,6 +1541,16 @@
 	gtk_box_pack_start(GTK_BOX(vbox2), pui->always_queue_sent_mail,
 				FALSE, TRUE, 0);
 
+	table3 = GTK_TABLE(gtk_table_new(3, 2, FALSE));
+    gtk_container_add(GTK_CONTAINER(vbox2), GTK_WIDGET(table3));
+    gtk_container_set_border_width(GTK_CONTAINER(table3), 2);
+    pui->system_id_format = attach_entry(_("System identification :"),
+			 4, table3);
+
+    pui->system_id_preview = gtk_label_new("");
+    gtk_box_pack_start(GTK_BOX(vbox2), pui->system_id_preview,
+		       FALSE, TRUE, 0);
+
     frame2 = gtk_frame_new(_("Encoding"));
     gtk_box_pack_start(GTK_BOX(vbox1), frame2, FALSE, FALSE, 0);
     gtk_container_set_border_width(GTK_CONTAINER(frame2), 5);
@@ -2251,6 +2294,20 @@
 	gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(pui->pgdownmod));
 
     gtk_widget_set_sensitive(GTK_WIDGET(pui->pgdown_percent), newstate);
+    properties_modified_cb(widget, pbox);
+}
+
+static void
+system_id_preview_cb(GtkWidget * widget, GtkWidget * pbox)
+{
+    gchar * tmp, *format;
+
+    format=g_strdup(gtk_entry_get_text(GTK_ENTRY(pui->system_id_format)));
+    tmp=get_system_id(format);
+    gtk_label_set_text(GTK_LABEL (pui->system_id_preview), tmp);
+    g_free(tmp);
+    g_free(format);
+
     properties_modified_cb(widget, pbox);
 }
 
diff -u -N -r balsa/src/save-restore.c balsa-new/src/save-restore.c
--- balsa/src/save-restore.c	Tue Aug 28 23:21:02 2001
+++ balsa/src/save-restore.c	Tue Aug 28 23:21:02 2001
@@ -1,4 +1,5 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -659,6 +660,7 @@
 	gnome_config_get_bool("StripHtmlInReply=true");
 
 	balsa_app.always_queue_sent_mail = d_get_gint("AlwaysQueueSentMail", 0);
+    balsa_app.system_id_format = gnome_config_get_string("SystemIdFormat=%s %r");
 
     gnome_config_pop_prefix();
 
@@ -889,6 +891,8 @@
     gnome_config_set_bool("StripHtmlInReply", balsa_app.reply_strip_html);
 
 	gnome_config_set_int("AlwaysQueueSentMail", balsa_app.always_queue_sent_mail);
+    gnome_config_set_string("SystemIdFormat", balsa_app.system_id_format);
+
     gnome_config_pop_prefix();
 
     /* Compose window ... */
diff -u -N -r balsa/src/sendmsg-window.c balsa-new/src/sendmsg-window.c
--- balsa/src/sendmsg-window.c	Tue Aug 28 23:21:02 2001
+++ balsa/src/sendmsg-window.c	Tue Aug 28 23:21:02 2001
@@ -2043,7 +2043,8 @@
 					   balsa_app.encoding_style,  
 			   		   balsa_app.smtp_server,
 			   		   balsa_app.smtp_authctx,
-			   		   balsa_app.smtp_tls_mode);
+			   		   balsa_app.smtp_tls_mode,
+							balsa_app.system_id);
 #else
         successful = libbalsa_message_send(message, balsa_app.outbox, fcc,
 					   balsa_app.encoding_style); 
diff -u -N -r balsa/src/system-id.c balsa-new/src/system-id.c
--- balsa/src/system-id.c	Thu Jan  1 01:00:00 1970
+++ balsa/src/system-id.c	Tue Aug 28 23:21:02 2001
@@ -0,0 +1,130 @@
+/* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
+/* vim:set ts=4 sw=4 ai et: */
+/* Balsa E-Mail Client
+ * Copyright (C) 1997-2001 Stuart Parmenter and others,
+ *                         See the file AUTHORS for a list.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option) 
+ * any later version.
+ *  
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * GNU General Public License for more details.
+ *  
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * 02111-1307, USA.
+ */
+
+#include <stdio.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+#include "balsa-app.h"
+
+#include <gnome.h>
+#include <glib.h>
+
+gint init_system_id(void)
+{
+    if (uname(&balsa_app.uname)==-1) {
+        perror("uname");
+        return 1;
+    }
+    return 0;
+}
+
+gchar * get_system_id(char * format)
+{
+    gchar ** fields;
+    gint len, i, previous, insert;
+    gchar *s, *result, *incstr=NULL;
+
+    if ((len=strlen(format))==0) return g_strdup("");
+
+    fields=g_strsplit((gchar *)format, "%", 0);
+
+    for (i=1; fields[i]!=NULL; i++) {
+        switch(fields[i][0]) {
+            case 'm': len+=strlen(balsa_app.uname.machine)-2; break;
+            case 'n': len+=strlen(balsa_app.uname.nodename)-2; break;
+            case 'r': len+=strlen(balsa_app.uname.release)-2; break;
+            case 's': len+=strlen(balsa_app.uname.sysname)-2; break;
+            case 'v': len+=strlen(balsa_app.uname.version)-2; break;
+            default:
+                break;
+        }
+    }
+
+    result=(gchar *)g_malloc((len+1)*sizeof(gchar));
+    if (result==NULL) {
+        fprintf(stderr, "unable to allocate memory\n");
+        return NULL;
+    }
+
+    previous=0;
+    s=result;
+    for (i=1; fields[i-1]!=NULL; i++) {
+        insert=1;
+        if (fields[i]!=NULL) {
+            switch(fields[i][0]) {
+                case 'm': incstr=balsa_app.uname.machine; break;
+                case 'n': incstr=balsa_app.uname.nodename; break;
+                case 'r': incstr=balsa_app.uname.release; break;
+                case 's': incstr=balsa_app.uname.sysname; break;
+                case 'v': incstr=balsa_app.uname.version; break;
+                default: insert=0; break;
+            }
+        } else insert=0;
+        if ((len=strlen(fields[i-1])-previous) > 0) {
+            s=strncpy(s, fields[i-1]+previous, len)+len;
+        }
+        if (insert==1) {
+            s=strncpy(s, incstr, strlen(incstr));
+            s+=strlen(incstr);
+        }
+        previous=insert;
+    }
+    *s=0;
+
+    g_strfreev(fields);
+    return result;
+}
+
+gchar * get_system_id_tooltip(char * format)
+{
+    return g_strdup_printf(
+        "You can use the following sustitutions" \
+        " to describe your system :\n" \
+        "%%m machine type (%s)\n" \
+        "%%h machine's hostname (%s)\n"  \
+        "%%s operating system name (%s)\n" \
+        "%%r operating system release (%s)\n" \
+        "%%v operating system version (%s)\n" \
+        ,balsa_app.uname.machine,
+        balsa_app.uname.nodename,
+        balsa_app.uname.sysname,
+        balsa_app.uname.release,
+        balsa_app.uname.version
+        );
+}
+
+void update_system_id(void)
+{
+    gchar *sysid, *tmp;
+
+    sysid=get_system_id(balsa_app.system_id_format);
+    if (sysid==NULL) return;
+
+    tmp=balsa_app.system_id;
+    balsa_app.system_id=sysid;
+    g_free(tmp);
+}
+
diff -u -N -r balsa/src/system-id.h balsa-new/src/system-id.h
--- balsa/src/system-id.h	Thu Jan  1 01:00:00 1970
+++ balsa/src/system-id.h	Tue Aug 28 23:21:03 2001
@@ -0,0 +1,5 @@
+int init_system_id(void);
+void update_system_id(void);
+char * get_system_id_tooltip(char * format);
+char * get_system_id(char * format);
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]