pspp-dev
[Top][All Lists]
Advanced

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

[PATCH 09/11] psppire-dict: Make auto_generate_var_name() public, and re


From: Ben Pfaff
Subject: [PATCH 09/11] psppire-dict: Make auto_generate_var_name() public, and rename.
Date: Sun, 15 Apr 2012 16:58:31 -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 |    6 +++---
 src/ui/gui/psppire-dict.h |    4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c
index b3a2483..1e8beac 100644
--- a/src/ui/gui/psppire-dict.c
+++ b/src/ui/gui/psppire-dict.c
@@ -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;
diff --git a/src/ui/gui/psppire-dict.h b/src/ui/gui/psppire-dict.h
index 7987493..53b09f4 100644
--- a/src/ui/gui/psppire-dict.h
+++ b/src/ui/gui/psppire-dict.h
@@ -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,
-- 
1.7.2.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]