psppire-dict: Make auto_generate_var_name() public, and rename.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 21 Mar 2012 04:28:44 +0000 (21:28 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 17 Apr 2012 02:22:16 +0000 (19:22 -0700)
This function will acquire a few users in upcoming commits.

This commit renames it to have the same prefix as other public
functions in this file.

src/ui/gui/psppire-dict.c
src/ui/gui/psppire-dict.h

index b3a24838580ea5d45fe10a06f39408c78eefc4ce..1e8beac5e3f1f1023ebb7d13f763596554915dd3 100644 (file)
@@ -352,8 +352,8 @@ psppire_dict_replace_dictionary (PsppireDict *dict, struct dictionary *d)
 
 /* Stores a valid name for a new variable in DICT into the SIZE bytes in NAME.
    Returns true if successful, false if SIZE is insufficient. */
-static bool
-auto_generate_var_name (const PsppireDict *dict, char *name, size_t size)
+bool
+psppire_dict_generate_name (const PsppireDict *dict, char *name, size_t size)
 {
   gint d;
 
@@ -394,7 +394,7 @@ psppire_dict_insert_variable (PsppireDict *d, gint idx, const gchar *name)
 
   if ( ! name )
     {
-      if (!auto_generate_var_name (d, tmpname, sizeof tmpname))
+      if (!psppire_dict_generate_name (d, tmpname, sizeof tmpname))
         g_return_if_reached ();
 
       name = tmpname;
index 798749328101be104f8f704030716cb87814280c..53b09f41a74d39a0165acfa77f83285a5499e248 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2004, 2009  Free Software Foundation
+   Copyright (C) 2004, 2009, 2011  Free Software Foundation
 
    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
@@ -99,6 +99,8 @@ void psppire_dict_resize_variable (PsppireDict *,
 gboolean psppire_dict_check_name (const PsppireDict *dict,
                              const gchar *name, gboolean report);
 
+bool psppire_dict_generate_name (const PsppireDict *, char *name, size_t size);
+
 gint psppire_dict_get_next_value_idx (const PsppireDict *dict);
 
 gboolean psppire_dict_rename_var (PsppireDict *dict, struct variable *v,