changeset 227:a85a097bbb02

2003-7-20 Brian Masney <masneyb@gftp.org> * lib/config_file.c lib/gftp.h - added compare_function to gftp_config_vars structure. (gftp_set_global_option) use the compare function to see if the value was actually changed, and if so set the gftp_configuration_changed variable * lib/misc.c lib/gftp.h - For glib 1.2, added my version of g_build_path() since it's not there * lib/misc.c - GLIB/GTK+ 1.2 fixes * lib/protocols.c (gftp_fd_open) - cleaned up some * lib/rfc959.c (rfc959_init) - if the email address is blank, get the users address here instead of in register_module. It was being blanked out when the config file was being read * lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - mark the config variables that can show up in the bookmarks editor * src/text/gftp-text.c src/gtk/options_dialog.c - use gftp_set_global_option() to set the new configuration values * src/gtk/bookmarks.c - fixed crash in bookmarks dialog. Added notebook widget to the dialog as well. The options that can be edited for this site will show up in other tabs * src/gtk/gftp-gtk.c - fixes to the calls to gftp_set_global_option() * src/gtk/options_dialog.c - added gftp_gtk_setup_bookmark_options() to display all the editable options for this bookmark
author masneyb
date Mon, 21 Jul 2003 00:26:43 +0000
parents dbc7a0260d60
children 835a8c968264
files ChangeLog lib/config_file.c lib/gftp.h lib/misc.c lib/options.h lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c src/gtk/bookmarks.c src/gtk/gftp-gtk.c src/gtk/gftp-gtk.h src/gtk/options_dialog.c src/text/gftp-text.c
diffstat 14 files changed, 432 insertions(+), 158 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 21 00:22:46 2003 +0000
+++ b/ChangeLog	Mon Jul 21 00:26:43 2003 +0000
@@ -1,3 +1,35 @@
+2003-7-20 Brian Masney <masneyb@gftp.org>
+	* lib/config_file.c lib/gftp.h - added compare_function to 
+	gftp_config_vars structure. (gftp_set_global_option) use the compare
+	function to see if the value was actually changed, and if so set the
+	gftp_configuration_changed variable
+
+	* lib/misc.c lib/gftp.h - For glib 1.2, added my version of 
+	g_build_path() since it's not there
+
+	* lib/misc.c - GLIB/GTK+ 1.2 fixes
+
+	* lib/protocols.c (gftp_fd_open) - cleaned up some
+
+	* lib/rfc959.c (rfc959_init) - if the email address is blank, get the
+	users address here instead of in register_module. It was being blanked 
+	out when the config file was being read
+
+	* lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - mark the 
+	config variables that can show up in the bookmarks editor
+
+	* src/text/gftp-text.c src/gtk/options_dialog.c - use 
+	gftp_set_global_option() to set the new configuration values
+
+	* src/gtk/bookmarks.c - fixed crash in bookmarks dialog. Added notebook
+	widget to the dialog as well. The options that can be edited for this 
+	site will show up in other tabs
+
+	* src/gtk/gftp-gtk.c - fixes to the calls to gftp_set_global_option()
+
+	* src/gtk/options_dialog.c - added gftp_gtk_setup_bookmark_options()
+	to display all the editable options for this bookmark
+
 2003-7-11 Brian Masney <masneyb@gftp.org>
 	* lib/protocols.c (gftp_calc_kbs) - only call gettimeofday() at the
 	end only if we are throttling this connection
@@ -1272,7 +1304,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.113 2003/07/13 12:38:30 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.114 2003/07/21 00:26:41 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/config_file.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/config_file.c	Mon Jul 21 00:26:43 2003 +0000
@@ -935,6 +935,25 @@
 }
 
 
+static int
+gftp_config_file_compare_text (gftp_config_vars * cv1, gftp_config_vars * cv2)
+{
+  char *str1, *str2;
+
+  str1 = cv1->value;
+  str2 = cv2->value;
+
+  if (cv1->value == NULL && cv2->value == NULL)
+    return (0);
+
+  if ((cv1->value == NULL && cv2->value != NULL) ||
+      (cv1->value != NULL && cv2->value == NULL))
+    return (-1);
+
+  return (strcmp (str1, str2));
+}
+
+
 static void
 gftp_config_file_copy_ptr_contents (gftp_config_vars * cv, gftp_config_vars * dest_cv)
 {
@@ -958,6 +977,13 @@
 
 
 static int
+gftp_config_file_compare_int (gftp_config_vars * cv1, gftp_config_vars * cv2)
+{
+  return (GPOINTER_TO_INT(cv1->value) == GPOINTER_TO_INT(cv2->value) ? 0 : -1);
+}
+
+
+static int
 gftp_config_file_read_checkbox (char *str, gftp_config_vars * cv, int line)
 {
   cv->value = GINT_TO_POINTER(strtol (str, NULL, 10) ? 1 : 0);
@@ -988,6 +1014,17 @@
 
 
 static int
+gftp_config_file_compare_float (gftp_config_vars * cv1, gftp_config_vars * cv2)
+{
+  float f1, f2;
+
+  memcpy (&f1, &cv1->value, sizeof (f1));
+  memcpy (&f2, &cv2->value, sizeof (f2));
+  return (f1 == f2 ? 0 : -1);
+}
+
+
+static int
 gftp_config_file_read_color (char *str, gftp_config_vars * cv, int line)
 {
   char *red, *green, *blue;
@@ -1037,6 +1074,19 @@
 
 
 static int
+gftp_config_file_compare_color (gftp_config_vars * cv1, gftp_config_vars * cv2)
+{
+  gftp_color * color1, * color2;
+
+  color1 = cv1->value;
+  color2 = cv2->value;
+
+  return (color1->red == color2->red && color1->green == color2->green &&
+          color1->blue == color2->blue ? 0 : -1);
+}
+
+
+static int
 gftp_config_file_read_intcombo (char *str, gftp_config_vars * cv, int line)
 {
   char **clist;
@@ -1102,17 +1152,31 @@
 /* Note, the index numbers of this array must match up to the numbers in
    gftp_option_type_enum in gftp.h */
 gftp_option_type_var gftp_option_types[] = {
-  {gftp_config_file_read_text, gftp_config_file_write_text, gftp_config_file_copy_text, NULL, NULL, NULL},
-  {gftp_config_file_read_textcombo, gftp_config_file_write_text, gftp_config_file_copy_text, NULL, NULL, NULL},
-  {gftp_config_file_read_text, gftp_config_file_write_text, gftp_config_file_copy_text, NULL, NULL, NULL},
-  {gftp_config_file_read_text, gftp_config_file_write_hidetext, gftp_config_file_copy_text, NULL, NULL, NULL},
-  {gftp_config_file_read_int, gftp_config_file_write_int, gftp_config_file_copy_ptr_contents, NULL, NULL, NULL},
-  {gftp_config_file_read_checkbox, gftp_config_file_write_int, gftp_config_file_copy_ptr_contents, NULL, NULL, NULL},
-  {gftp_config_file_read_intcombo, gftp_config_file_write_intcombo, gftp_config_file_copy_ptr_contents, NULL, NULL, NULL},
-  {gftp_config_file_read_float, gftp_config_file_write_float, gftp_config_file_copy_ptr_contents, NULL, NULL, NULL},
-  {gftp_config_file_read_color, gftp_config_file_write_color, gftp_config_file_copy_color, NULL, NULL, NULL},
-  {NULL, NULL, NULL, NULL, NULL},
-  {NULL, NULL, NULL, NULL, NULL}
+  {gftp_config_file_read_text, gftp_config_file_write_text, 
+   gftp_config_file_copy_text, gftp_config_file_compare_text, NULL, NULL, NULL},
+  {gftp_config_file_read_textcombo, gftp_config_file_write_text, 
+   gftp_config_file_copy_text, gftp_config_file_compare_text, NULL, NULL, NULL},
+  {gftp_config_file_read_text, gftp_config_file_write_text, 
+   gftp_config_file_copy_text, gftp_config_file_compare_text, NULL, NULL, NULL},
+  {gftp_config_file_read_text, gftp_config_file_write_hidetext, 
+   gftp_config_file_copy_text, gftp_config_file_compare_text, NULL, NULL, NULL},
+  {gftp_config_file_read_int, gftp_config_file_write_int, 
+   gftp_config_file_copy_ptr_contents, gftp_config_file_compare_int, 
+   NULL, NULL, NULL},
+  {gftp_config_file_read_checkbox, gftp_config_file_write_int, 
+   gftp_config_file_copy_ptr_contents, gftp_config_file_compare_int,
+   NULL, NULL, NULL},
+  {gftp_config_file_read_intcombo, gftp_config_file_write_intcombo, 
+   gftp_config_file_copy_ptr_contents, gftp_config_file_compare_int, 
+   NULL, NULL, NULL},
+  {gftp_config_file_read_float, gftp_config_file_write_float, 
+   gftp_config_file_copy_ptr_contents, gftp_config_file_compare_float,
+   NULL, NULL, NULL},
+  {gftp_config_file_read_color, gftp_config_file_write_color, 
+   gftp_config_file_copy_color, gftp_config_file_compare_color, 
+   NULL, NULL, NULL},
+  {NULL, NULL, NULL, NULL, NULL, NULL},
+  {NULL, NULL, NULL, NULL, NULL, NULL}
 };
 
 
@@ -1152,18 +1216,29 @@
 
 
 void
-gftp_set_global_option (char * key, void *value)
+gftp_set_global_option (char * key, const void *value)
 {
-  gftp_config_vars * tmpconfigvar;
+  gftp_config_vars * tmpconfigvar, newconfigvar;
+  void *nc_ptr;
+  int ret;
 
   if (gftp_global_options_htable != NULL &&
       (tmpconfigvar = g_hash_table_lookup (gftp_global_options_htable,
                                            key)) != NULL)
     {
-      memcpy (&tmpconfigvar->value, value, sizeof (tmpconfigvar->value));
+      memcpy (&newconfigvar, tmpconfigvar, sizeof (newconfigvar));
+
+      /* Cheap warning fix for const pointer... */
+      memcpy (&nc_ptr, &value, sizeof (nc_ptr));
+      newconfigvar.value = nc_ptr;
+      newconfigvar.flags &= ~GFTP_CVARS_FLAGS_DYNMEM;
 
-      /* FIXME - only set this variable if the value has changed */
-      gftp_configuration_changed = 1;
+      ret = gftp_option_types[newconfigvar.otype].compare_function (&newconfigvar, tmpconfigvar);
+      if (ret != 0)
+        {
+          gftp_option_types[newconfigvar.otype].copy_function (&newconfigvar, tmpconfigvar);
+          gftp_configuration_changed = 1;
+        }
     }
   else
     {
@@ -1307,7 +1382,9 @@
   while (tempentry != NULL)
     {
       gftp_free_bookmark (tempentry);
-      g_free (tempentry->path);
+
+      if (tempentry->path != NULL)
+        g_free (tempentry->path);
 
       if (tempentry->children != NULL)
         {
@@ -1326,8 +1403,6 @@
       tempentry = tempentry->next;
       g_free (delentry);
     }
-
-  g_free (bookmarks);
 }
 
 
--- a/lib/gftp.h	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/gftp.h	Mon Jul 21 00:26:43 2003 +0000
@@ -274,7 +274,7 @@
 
 #define GFTP_CVARS_FLAGS_DYNMEM			(1 << 1)
 #define GFTP_CVARS_FLAGS_DYNLISTMEM		(1 << 2)
-
+#define GFTP_CVARS_FLAGS_SHOW_BOOKMARK		(1 << 3)
 
 typedef struct gftp_config_vars_tag
 {
@@ -298,6 +298,7 @@
   int (*read_function) (char *str, gftp_config_vars * cv, int line);
   int (*write_function) (gftp_config_vars * cv, FILE * fd, int to_config_file);
   void (*copy_function) (gftp_config_vars * cv, gftp_config_vars * dest_cv);
+  int (*compare_function) (gftp_config_vars * cv1, gftp_config_vars * cv2);
   void * (*ui_print_function) (gftp_config_vars * cv, void *user_data);
   void (*ui_save_function) (gftp_config_vars * cv, void *user_data);
   void (*ui_cancel_function) (gftp_config_vars * cv, void *user_data);
@@ -636,7 +637,7 @@
 					  void *value );
 
 void gftp_set_global_option 		( char * key, 
-					  void *value );
+					  const void *value );
 
 void gftp_set_request_option 		( gftp_request * request, 
 					  char * key, 
@@ -725,6 +726,14 @@
 					  GList ** list, 
 					  int *curnum );
 
+#if GLIB_MAJOR_VERSION == 1
+
+gchar * g_build_path 			( const gchar *separator, 
+					  const gchar *first_element,
+					  ... );
+
+#endif
+
 /* protocols.c */
 #define GFTP_FTP_NUM				0
 #define GFTP_HTTP_NUM				1
--- a/lib/misc.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/misc.c	Mon Jul 21 00:26:43 2003 +0000
@@ -508,11 +508,21 @@
 gftp_transfer *
 gftp_tdata_new (void)
 {
+#if GLIB_MAJOR_VERSION == 1
+  static GStaticMutex init_mutex = G_STATIC_MUTEX_INIT;
+#endif
   gftp_transfer * tdata;
 
   tdata = g_malloc0 (sizeof (*tdata));
+
+#if GLIB_MAJOR_VERSION == 1
+  tdata->statmutex = init_mutex;
+  tdata->structmutex = init_mutex;
+#else
   g_static_mutex_init (&tdata->statmutex);
   g_static_mutex_init (&tdata->structmutex);
+#endif
+
   return (tdata);
 }
 
@@ -1116,3 +1126,47 @@
 }
 
 
+#if GLIB_MAJOR_VERSION == 1
+
+char *
+g_build_path (const char *separator, const char *first_element, ...)
+{
+  const char *element;
+  size_t len, retlen;
+  int add_separator;
+  va_list args;
+  char *ret;
+
+  g_return_val_if_fail (separator != NULL, NULL);
+
+  ret = g_malloc0 (1);
+  retlen = 0;
+
+  va_start (args, first_element);
+  for (element = first_element;
+       element != NULL;
+       element = va_arg (args, char *))
+    {
+      len = strlen (element);
+
+      if (len > 0 && element[len - 1] == *separator)
+        add_separator = 0;
+      else
+        {
+          add_separator = 1;
+          len++;
+        }
+      
+      retlen += len;
+      ret = g_realloc (ret, retlen + 1);
+      strncat (ret, element, retlen);
+
+      if (add_separator)
+        strncat (ret, separator, retlen);
+    }
+
+  return (ret);
+}
+
+#endif
+
--- a/lib/options.h	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/options.h	Mon Jul 21 00:26:43 2003 +0000
@@ -31,7 +31,8 @@
 
 gftp_config_vars gftp_global_config_vars[] =
 {
-  {"", N_("General"), gftp_option_type_notebook, NULL, NULL, 0, NULL, GFTP_PORT_GTK, NULL},
+  {"", N_("General"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
 
   {"view_program", N_("View program:"), gftp_option_type_text, "", NULL, 0,
    N_("The default program used to view files. If this is blank, the internal file viewer will be used"), 
@@ -46,11 +47,12 @@
    N_("The maximum size of the log window in bytes for the GTK+ port"), 
    GFTP_PORT_GTK, NULL},
   {"remote_charsets", N_("Remote Character Sets:"), 
-   gftp_option_type_text, "", NULL, 0,
+   gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("This is a comma separated list of charsets to try to convert the remote messages to the current locale"), 
    GFTP_PORT_ALL, NULL},
   {"cache_ttl", N_("Cache TTL:"), 
-   gftp_option_type_int, GINT_TO_POINTER(3600), NULL, 0,
+   gftp_option_type_int, GINT_TO_POINTER(3600), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The number of seconds to keep cache entries before they expire."), 
    GFTP_PORT_ALL, NULL},
 
@@ -61,39 +63,48 @@
    gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
    N_("Do only one transfer at a time?"), GFTP_PORT_GTK, NULL},
   {"overwrite_default", N_("Overwrite by Default"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Overwrite files by default or set to resume file transfers"), 
    GFTP_PORT_GTK, NULL},
   {"preserve_permissions", N_("Preserve file permissions"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Preserve file permissions of transfered files"), GFTP_PORT_ALL,
    NULL},
   {"refresh_files", N_("Refresh after each file transfer"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Refresh the listbox after each file is transfered"), GFTP_PORT_GTK,
    NULL},
   {"sort_dirs_first", N_("Sort directories first"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Put the directories first then the files"), GFTP_PORT_ALL, NULL},
   {"show_hidden_files", N_("Show hidden files"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Show hidden files in the listboxes"), GFTP_PORT_ALL, NULL},
 
-  {"", N_("Network"), gftp_option_type_notebook, NULL, NULL, 0,
-   NULL, GFTP_PORT_GTK, NULL},
+  {"", N_("Network"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
   {"network_timeout", N_("Network timeout:"), 
-   gftp_option_type_int, GINT_TO_POINTER(60), NULL, 0,
+   gftp_option_type_int, GINT_TO_POINTER(60), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The timeout waiting for network input/output. This is NOT an idle timeout."), 
    GFTP_PORT_ALL, NULL},
   {"retries", N_("Connect retries:"), 
-   gftp_option_type_int, GINT_TO_POINTER(3), NULL, 0,
+   gftp_option_type_int, GINT_TO_POINTER(3), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The number of auto-retries to do. Set this to 0 to retry indefinately"), 
    GFTP_PORT_ALL, NULL},
   {"sleep_time", N_("Retry sleep time:"), 
-   gftp_option_type_int, GINT_TO_POINTER(30), NULL, 0,
+   gftp_option_type_int, GINT_TO_POINTER(30), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The number of seconds to wait between retries"), GFTP_PORT_ALL, NULL},
   {"maxkbs", N_("Max KB/S:"), 
-   gftp_option_type_float, &gftp_maxkbs, NULL, 0,
+   gftp_option_type_float, &gftp_maxkbs, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The maximum KB/s a file transfer can get. (Set to 0 to disable)"),  
    GFTP_PORT_ALL, NULL},
 
--- a/lib/protocols.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/protocols.c	Mon Jul 21 00:26:43 2003 +0000
@@ -2474,17 +2474,14 @@
 int
 gftp_fd_open (gftp_request * request, const char *pathname, int flags, mode_t mode)
 {
-  mode_t mask;
   int fd;
 
-  if (mode == 0 && (flags & O_CREAT))
-    {
-      mask = umask (0); /* FIXME - improve */
-      umask (mask);
-      mode = 0666 & ~mask;
-    }
-
-  if ((fd = open (pathname, flags, mode)) < 0)
+  if (mode == 0)
+    fd = open (pathname, flags);
+  else
+    fd = open (pathname, flags, mode);
+
+  if (fd < 0)
     {
       if (request != NULL)
         request->logging_function (gftp_logging_error, request,
--- a/lib/rfc2068.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/rfc2068.c	Mon Jul 21 00:26:43 2003 +0000
@@ -24,8 +24,8 @@
 
 static gftp_config_vars config_vars[] =
 {
-  {"", N_("HTTP"), gftp_option_type_notebook, NULL, NULL, 0, NULL, 
-   GFTP_PORT_GTK, NULL},
+  {"", N_("HTTP"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
 
   {"http_proxy_host", N_("Proxy hostname:"), 
    gftp_option_type_text, "", NULL, 0, 
@@ -41,8 +41,10 @@
    N_("Your firewall password"), GFTP_PORT_ALL, NULL},
 
   {"use_http11", N_("Use HTTP/1.1"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Do you want to use HTTP/1.1 or HTTP/1.0"), GFTP_PORT_ALL, NULL},
+
   {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL}
 };
 
--- a/lib/rfc959.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/rfc959.c	Mon Jul 21 00:26:43 2003 +0000
@@ -35,11 +35,11 @@
 
 static gftp_config_vars config_vars[] = 
 {
-  {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL, 0, NULL, 
-   GFTP_PORT_GTK, NULL},
+  {"", N_("FTP"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
 
   {"email", N_("Email address:"), 
-   gftp_option_type_text, "", NULL, 0,
+   gftp_option_type_text, "", NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("This is the password that will be used whenever you log into a remote FTP server as anonymous"), 
    GFTP_PORT_ALL, NULL},
   {"ftp_proxy_host", N_("Proxy hostname:"), 
@@ -65,15 +65,18 @@
    GFTP_PORT_ALL, NULL},
 
   {"passive_transfer", N_("Passive file transfers"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("If this is enabled, then the remote FTP server will open up a port for the data connection. If you are behind a firewall, you will need to enable this. Generally, it is a good idea to keep this enabled unless you are connecting to an older FTP server that doesn't support this. If this is disabled, then gFTP will open up a port on the client side and the remote server will attempt to connect to it."),
    GFTP_PORT_ALL, NULL},
   {"resolve_symlinks", N_("Resolve Remote Symlinks (LIST -L)"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("The remote FTP server will attempt to resolve symlinks in the directory listings. Generally, this is a good idea to leave enabled. The only time you will want to disable this is if the remote FTP server doesn't support the -L option to LIST"), 
    GFTP_PORT_ALL, NULL},
   {"ascii_transfers", N_("Transfer files in ASCII mode"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("If you are transfering a text file from Windows to UNIX box or vice versa, then you should enable this. Each system represents newlines differently for text files. If you are transfering from UNIX to UNIX, then it is safe to leave this off. If you are downloading binary data, you will want to disable this."), 
    GFTP_PORT_ALL, NULL},
 
@@ -1630,27 +1633,7 @@
 void 
 rfc959_register_module (void)
 {
-  struct hostent *hent;
-  struct utsname unme;
-  struct passwd *pw;
-  char *tempstr;
-
   gftp_register_config_vars (config_vars);
-
-  gftp_lookup_global_option ("email", &tempstr);
-  if (tempstr == NULL || *tempstr == '\0')
-    {
-      /* If there is no email address specified, then we'll just use the
-         currentuser@currenthost */
-      uname (&unme);
-      pw = getpwuid (geteuid ());
-      hent = gethostbyname (unme.nodename);
-      if (strchr (unme.nodename, '.') == NULL && hent != NULL)
-        tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL);
-      else
-        tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL);
-      gftp_set_global_option ("email", tempstr);
-    }
 }
 
 
@@ -1673,9 +1656,29 @@
 rfc959_init (gftp_request * request)
 {
   rfc959_parms * parms;
+  struct hostent *hent;
+  struct utsname unme;
+  struct passwd *pw;
+  char *tempstr;
 
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
+  gftp_lookup_global_option ("email", &tempstr);
+  if (tempstr == NULL || *tempstr == '\0')
+    {
+      /* If there is no email address specified, then we'll just use the
+         currentuser@currenthost */
+      uname (&unme);
+      pw = getpwuid (geteuid ());
+      hent = gethostbyname (unme.nodename);
+      if (strchr (unme.nodename, '.') == NULL && hent != NULL)
+        tempstr = g_strconcat (pw->pw_name, "@", hent->h_name, NULL);
+      else
+        tempstr = g_strconcat (pw->pw_name, "@", unme.nodename, NULL);
+      gftp_set_global_option ("email", tempstr);
+      g_free (tempstr);
+    }
+
   request->protonum = GFTP_FTP_NUM;
   request->init = rfc959_init;
   request->destroy = rfc959_request_destroy; 
--- a/lib/sshv2.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/lib/sshv2.c	Mon Jul 21 00:26:43 2003 +0000
@@ -25,8 +25,8 @@
 
 static gftp_config_vars config_vars[] =
 {
-  {"", N_("SSH"), gftp_option_type_notebook, NULL, NULL, 0, NULL, 
-   GFTP_PORT_GTK, NULL},
+  {"", N_("SSH"), gftp_option_type_notebook, NULL, NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK, NULL, GFTP_PORT_GTK, NULL},
 
   {"ssh_prog_name", N_("SSH Prog Name:"), 
    gftp_option_type_text, "ssh", NULL, 0,
@@ -35,20 +35,24 @@
    gftp_option_type_text, NULL, NULL, 0,  
    N_("Extra parameters to pass to the SSH program"), GFTP_PORT_ALL, NULL},
   {"ssh2_sftp_path", N_("SSH2 sftp-server path:"), 
-   gftp_option_type_text, NULL, NULL, 0,
+   gftp_option_type_text, NULL, NULL, GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Default remote SSH2 sftp-server path"), GFTP_PORT_ALL, NULL},
 
   {"ssh_need_userpass", N_("Need SSH User/Pass"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Require a username/password for SSH connections"), GFTP_PORT_ALL, NULL},
   {"ssh_use_askpass", N_("Use ssh-askpass utility"),
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Use the ssh-askpass utility to supply the remote password"), GFTP_PORT_GTK,
    NULL},
   {"sshv2_use_sftp_subsys", N_("Use SSH2 SFTP subsys"), 
-   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 0,
+   gftp_option_type_checkbox, GINT_TO_POINTER(0), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
    N_("Call ssh with the -s sftp flag. This is helpful because you won't have to know the remote path to the remote sftp-server"), 
    GFTP_PORT_GTK, NULL},
+
   {NULL, NULL, 0, NULL, NULL, 0, NULL, 0, NULL}
 };
 
--- a/src/gtk/bookmarks.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/src/gtk/bookmarks.c	Mon Jul 21 00:26:43 2003 +0000
@@ -23,8 +23,8 @@
 static GtkWidget * bm_hostedit, * bm_portedit, * bm_localdiredit,
   * bm_remotediredit, * bm_useredit, * bm_passedit, * bm_acctedit, * anon_chk,
   * bm_pathedit, * bm_protocol, * tree;
-static GHashTable * new_bookmarks_htable;
-static gftp_bookmarks_var * new_bookmarks;
+static GHashTable * new_bookmarks_htable = NULL;
+static gftp_bookmarks_var * new_bookmarks = NULL;
 static GtkItemFactory * edit_factory;
 
 
@@ -355,8 +355,11 @@
       new_bookmarks_htable = NULL;
     }
 
-  gftp_bookmarks_destroy (new_bookmarks);
-  new_bookmarks = NULL;
+  if (new_bookmarks != NULL)
+    {
+      gftp_bookmarks_destroy (new_bookmarks);
+      new_bookmarks = NULL;
+    }
 
   gtk_widget_destroy (dialog);
 }
@@ -788,7 +791,7 @@
 static void
 edit_entry (gpointer data)
 {
-  GtkWidget * table, * tempwid, * dialog, * menu;
+  GtkWidget * table, * tempwid, * dialog, * menu, * notebook;
   gftp_bookmarks_var * entry;
   int i, num;
   char *pos;
@@ -828,18 +831,22 @@
       gdk_window_set_icon_name (dialog->window, gftp_version);
     }
 
-  tempwid = gtk_frame_new (NULL);
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), tempwid, TRUE,
+  notebook = gtk_notebook_new ();
+  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE,
 		      TRUE, 0);
-  gtk_widget_show (tempwid);
+  gtk_widget_show (notebook);
 
   table = gtk_table_new (11, 2, FALSE);
   gtk_container_border_width (GTK_CONTAINER (table), 5);
   gtk_table_set_row_spacings (GTK_TABLE (table), 5);
   gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-  gtk_container_add (GTK_CONTAINER (tempwid), table);
   gtk_widget_show (table);
 
+  tempwid = gtk_label_new (_("Bookmark"));
+  gtk_widget_show (tempwid);
+
+  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), table, tempwid);
+
   tempwid = gtk_label_new (_("Description:"));
   gtk_misc_set_alignment (GTK_MISC (tempwid), 1, 0.5);
   gtk_table_attach_defaults (GTK_TABLE (table), tempwid, 0, 1, 0, 1);
@@ -1029,6 +1036,8 @@
                     G_CALLBACK (bmedit_action), (gpointer) entry);
 #endif
 
+/* FIXME gftp_gtk_setup_bookmark_options (notebook); */
+
   gtk_widget_show (dialog);
 }
 
--- a/src/gtk/gftp-gtk.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/src/gtk/gftp-gtk.c	Mon Jul 21 00:26:43 2003 +0000
@@ -62,44 +62,44 @@
   int ret;
 
   ret = GTK_WIDGET (local_frame)->allocation.width;
-  gftp_set_global_option ("listbox_local_width", &ret);
+  gftp_set_global_option ("listbox_local_width", GINT_TO_POINTER (ret));
   ret = GTK_WIDGET (remote_frame)->allocation.width;
-  gftp_set_global_option ("listbox_remote_width", &ret);
+  gftp_set_global_option ("listbox_remote_width", GINT_TO_POINTER (ret));
   ret = GTK_WIDGET (remote_frame)->allocation.height;
-  gftp_set_global_option ("listbox_file_height", &ret);
+  gftp_set_global_option ("listbox_file_height", GINT_TO_POINTER (ret));
   ret = GTK_WIDGET (log_table)->allocation.height;
-  gftp_set_global_option ("log_height", &ret);
+  gftp_set_global_option ("log_height", GINT_TO_POINTER (ret));
   ret = GTK_WIDGET (transfer_scroll)->allocation.height;
-  gftp_set_global_option ("transfer_height", &ret);
+  gftp_set_global_option ("transfer_height", GINT_TO_POINTER (ret));
 
   ret = get_column (&GTK_CLIST (dlwdw)->column[0]);
-  gftp_set_global_option ("file_trans_column", &ret);
+  gftp_set_global_option ("file_trans_column", GINT_TO_POINTER (ret));
 
   ret = get_column (&GTK_CLIST (window1.listbox)->column[1]);
-  gftp_set_global_option ("local_file_width", &ret);
+  gftp_set_global_option ("local_file_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window1.listbox)->column[2]);
-  gftp_set_global_option ("local_size_width", &ret);
+  gftp_set_global_option ("local_size_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window1.listbox)->column[3]);
-  gftp_set_global_option ("local_user_width", &ret);
+  gftp_set_global_option ("local_user_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window1.listbox)->column[4]);
-  gftp_set_global_option ("local_group_width", &ret);
+  gftp_set_global_option ("local_group_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window1.listbox)->column[5]);
-  gftp_set_global_option ("local_date_width", &ret);
+  gftp_set_global_option ("local_date_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window1.listbox)->column[6]);
-  gftp_set_global_option ("local_attribs_width", &ret);
+  gftp_set_global_option ("local_attribs_width", GINT_TO_POINTER (ret));
 
   ret = get_column (&GTK_CLIST (window2.listbox)->column[1]);
-  gftp_set_global_option ("remote_file_width", &ret);
+  gftp_set_global_option ("remote_file_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window2.listbox)->column[2]);
-  gftp_set_global_option ("remote_size_width", &ret);
+  gftp_set_global_option ("remote_size_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window2.listbox)->column[3]);
-  gftp_set_global_option ("remote_user_width", &ret);
+  gftp_set_global_option ("remote_user_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window2.listbox)->column[4]);
-  gftp_set_global_option ("remote_group_width", &ret);
+  gftp_set_global_option ("remote_group_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window2.listbox)->column[5]);
-  gftp_set_global_option ("remote_date_width", &ret);
+  gftp_set_global_option ("remote_date_width", GINT_TO_POINTER (ret));
   ret = get_column (&GTK_CLIST (window2.listbox)->column[6]);
-  gftp_set_global_option ("remote_attribs_width", &ret);
+  gftp_set_global_option ("remote_attribs_width", GINT_TO_POINTER (ret));
 
   gftp_shutdown ();
   exit (0);
@@ -988,7 +988,7 @@
   if (column == 0 || (column == sortcol && wdata->sorted))
     {
       sortasds = !sortasds;
-      gftp_set_global_option (sortasds_name, &sortasds);
+      gftp_set_global_option (sortasds_name, GINT_TO_POINTER (sortasds));
       swap_col = 1;
     }
   else
@@ -1017,7 +1017,7 @@
   else
     {
       sortcol = column;
-      gftp_set_global_option (sortcol_name, &sortcol);
+      gftp_set_global_option (sortcol_name, GINT_TO_POINTER (sortcol));
     }
 
   if (!GFTP_IS_CONNECTED (wdata->request))
--- a/src/gtk/gftp-gtk.h	Mon Jul 21 00:22:46 2003 +0000
+++ b/src/gtk/gftp-gtk.h	Mon Jul 21 00:26:43 2003 +0000
@@ -264,9 +264,9 @@
 
 void clear_cache				( gpointer data );
 
-void options_dialog (gpointer data);
-void compare_windows (gpointer data);
-void about_dialog (gpointer data);
+void compare_windows 				( gpointer data );
+
+void about_dialog 				( gpointer data );
 
 /* misc-gtk.c */
 void fix_display				( void );
@@ -360,6 +360,14 @@
 /* mkdir_dialog.c */
 void mkdir_dialog 				( gpointer data );
 
+/* options_dialog.c */
+void options_dialog 				( gpointer data );
+
+void gftp_gtk_setup_bookmark_options 		( GtkWidget * notebook );
+
+void gftp_gtk_save_bookmark_options 		( GtkWidget * widget, 
+						  gpointer data );
+
 /* rename_dialog.c */
 void rename_dialog				( gpointer data );
 
--- a/src/gtk/options_dialog.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/src/gtk/options_dialog.c	Mon Jul 21 00:26:43 2003 +0000
@@ -25,8 +25,6 @@
                  * netmask3, * netmask4, * domain_active;
 static GList * new_proxy_hosts;
 
-/* FIXME - use cancel function */
-
 static void
 _setup_option (gftp_option_type_enum otype,
                gftp_options_dialog_data * option_data, 
@@ -123,11 +121,7 @@
   option_data = user_data;
   tempstr = gtk_entry_get_text (GTK_ENTRY (cv->user_data));
 
-  if (cv->flags & GFTP_CVARS_FLAGS_DYNMEM)
-    g_free (cv->value);
-
-  cv->value = g_strdup (tempstr);
-  cv->flags |= GFTP_CVARS_FLAGS_DYNMEM;
+  gftp_set_global_option (cv->key, tempstr);
 }
 
 
@@ -206,25 +200,12 @@
 {
   gftp_options_dialog_data * option_data;
   const char *tempstr;
-  char **clist;
-  int i;
 
   option_data = user_data;
 
   tempstr = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (cv->user_data)->entry));
 
-  if (cv->listdata != NULL && tempstr != NULL)
-    {
-      clist = cv->listdata;
-      for (i=0; clist[i] != NULL; i++)
-        {
-          if (strcasecmp (tempstr, clist[i]) == 0)
-            {
-              cv->value = clist[i];
-              break;
-            }
-        }
-    }
+  gftp_set_global_option (cv->key, tempstr);
 }
 
 
@@ -545,7 +526,8 @@
 
   option_data = user_data;
   tempstr = gtk_entry_get_text (GTK_ENTRY (cv->user_data));
-  cv->value = GINT_TO_POINTER(strtol (tempstr, NULL, 10));
+
+  gftp_set_global_option (cv->key, GINT_TO_POINTER(strtol (tempstr, NULL, 10)));
 }
 
 
@@ -596,7 +578,7 @@
   gftp_options_dialog_data * option_data;
 
   option_data = user_data;
-  cv->value = GINT_TO_POINTER (GTK_TOGGLE_BUTTON (cv->user_data)->active);
+  gftp_set_global_option (cv->key, GINT_TO_POINTER (GTK_TOGGLE_BUTTON (cv->user_data)->active));
 }
 
 
@@ -623,12 +605,14 @@
 {
   gftp_options_dialog_data * option_data;
   const char *tempstr;
+  void *val;
   float f;
 
   option_data = user_data;
   tempstr = gtk_entry_get_text (GTK_ENTRY (cv->user_data));
   f = strtod (tempstr, NULL);
-  memcpy (&cv->value, &f, sizeof (cv->value));
+  memcpy (&val, &f, sizeof (val));
+  gftp_set_global_option (cv->key, val);
 }
 
 
@@ -861,6 +845,8 @@
   GList *templist;
   int num;
 
+  gftp_configuration_changed = 1; /* FIXME */
+
   if ((templist = GTK_CLIST (proxy_list)->selection) == NULL)
     return;
   num = GPOINTER_TO_INT (templist->data);
@@ -878,6 +864,8 @@
   char *tempstr, *title;
   GList *templist;
 
+  gftp_configuration_changed = 1; /* FIXME */
+
   if (data)
     {
       if ((templist = GTK_CLIST (proxy_list)->selection) == NULL)
@@ -1175,6 +1163,33 @@
 }
 
 
+static void
+_init_option_data (gftp_options_dialog_data * option_data)
+{
+  memset (option_data, 0, sizeof (*option_data));
+
+  _setup_option (gftp_option_type_text, option_data, 
+                 _print_option_type_text, _save_option_type_text, NULL);
+  _setup_option (gftp_option_type_textcombo, option_data, 
+                 _print_option_type_textcombo, _save_option_type_textcombo, 
+                 NULL);
+  _setup_option (gftp_option_type_textcomboedt, option_data, 
+                 _print_option_type_textcomboedt, 
+                 _save_option_type_textcomboedt,
+                 _cancel_option_type_textcomboedt);
+  _setup_option (gftp_option_type_hidetext, option_data, 
+                 _print_option_type_hidetext, _save_option_type_text, NULL);
+  _setup_option (gftp_option_type_int, option_data, 
+                 _print_option_type_int, _save_option_type_int, NULL);
+  _setup_option (gftp_option_type_checkbox, option_data, 
+                 _print_option_type_checkbox, _save_option_type_checkbox, NULL);
+  _setup_option (gftp_option_type_float, option_data, 
+                 _print_option_type_float, _save_option_type_float, NULL);
+  _setup_option (gftp_option_type_notebook, option_data, 
+                 _print_option_type_notebook, NULL, NULL);
+}
+
+
 void
 options_dialog (gpointer data)
 {
@@ -1186,26 +1201,7 @@
   GtkWidget * tempwid;
 #endif
 
-  memset (&option_data, 0, sizeof (option_data));
-  _setup_option (gftp_option_type_text, &option_data, 
-                 _print_option_type_text, _save_option_type_text, NULL);
-  _setup_option (gftp_option_type_textcombo, &option_data, 
-                 _print_option_type_textcombo, _save_option_type_textcombo, 
-                 NULL);
-  _setup_option (gftp_option_type_textcomboedt, &option_data, 
-                 _print_option_type_textcomboedt, 
-                 _save_option_type_textcomboedt,
-                 _cancel_option_type_textcomboedt);
-  _setup_option (gftp_option_type_hidetext, &option_data, 
-                 _print_option_type_hidetext, _save_option_type_text, NULL);
-  _setup_option (gftp_option_type_int, &option_data, 
-                 _print_option_type_int, _save_option_type_int, NULL);
-  _setup_option (gftp_option_type_checkbox, &option_data, 
-                 _print_option_type_checkbox, _save_option_type_checkbox, NULL);
-  _setup_option (gftp_option_type_float, &option_data, 
-                 _print_option_type_float, _save_option_type_float, NULL);
-  _setup_option (gftp_option_type_notebook, &option_data, 
-                 _print_option_type_notebook, NULL, NULL);
+  _init_option_data (&option_data);
 
 #if GTK_MAJOR_VERSION == 1
   option_data.dialog = gtk_dialog_new ();
@@ -1304,3 +1300,67 @@
   gtk_widget_show (option_data.dialog);
 }
 
+
+void
+gftp_gtk_setup_bookmark_options (GtkWidget * notebook)
+{
+  gftp_options_dialog_data option_data;
+  gftp_config_vars * cv;
+  GList * templist;
+  int i;
+
+  _init_option_data (&option_data);
+  option_data.notebook = notebook;
+
+  cv = gftp_options_list->data;
+  option_data.last_option = cv[0].otype;
+  for (templist = gftp_options_list; 
+       templist != NULL; 
+       templist = templist->next)
+    {
+      cv = templist->data;
+
+      for (i=0; cv[i].key != NULL; i++)
+        {
+          if (!(cv[i].flags & GFTP_CVARS_FLAGS_SHOW_BOOKMARK))
+            continue;
+
+          if (gftp_option_types[cv[i].otype].ui_print_function == NULL)
+            continue;
+
+          cv[i].user_data = gftp_option_types[cv[i].otype].ui_print_function (&cv[i], gftp_option_types[cv[i].otype].user_data);
+
+          option_data.last_option = cv[i].otype;
+        }
+    }
+}
+
+
+void
+gftp_gtk_save_bookmark_options (GtkWidget * widget, gpointer data)
+{
+/* FIXME  - implement
+  gftp_config_vars * cv;
+  GList * templist;
+  int i;
+
+  for (templist = gftp_options_list;
+       templist != NULL;
+       templist = templist->next)
+    {
+      cv = templist->data;
+
+      for (i=0; cv[i].key != NULL; i++)
+        {
+          if (!(cv[i].flags & GFTP_CVARS_FLAGS_SHOW_BOOKMARK))
+            continue;
+
+          if (gftp_option_types[cv[i].otype].ui_save_function == NULL)
+            continue;
+
+          gftp_option_types[cv[i].otype].ui_save_function (&cv[i], gftp_option_types[cv[i].otype].user_data);
+        }
+    }
+*/
+}
+
--- a/src/text/gftp-text.c	Mon Jul 21 00:22:46 2003 +0000
+++ b/src/text/gftp-text.c	Mon Jul 21 00:26:43 2003 +0000
@@ -1050,7 +1050,7 @@
 int
 gftp_text_set (gftp_request * request, char *command, gpointer *data)
 {
-  gftp_config_vars * cv;
+  gftp_config_vars * cv, newcv;
   char *pos, *backpos;
   GList * templist;
   int i;
@@ -1109,7 +1109,17 @@
         }
 
       if (gftp_option_types[cv->otype].read_function != NULL)
-        gftp_option_types[cv->otype].read_function (pos, cv, 1);
+        {
+          memcpy (&newcv, cv, sizeof (newcv));
+          newcv.flags &= ~GFTP_CVARS_FLAGS_DYNMEM;
+
+          gftp_option_types[cv->otype].read_function (pos, &newcv, 1);
+
+          gftp_set_global_option (command, newcv.value);
+
+          if (newcv.flags & GFTP_CVARS_FLAGS_DYNMEM)
+            g_free (newcv.value);
+        }
     }
 
   return (1);