From 1173dd76c5e0a4f85f45cdc9d95b5be43aa552d3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 20 Mar 2012 21:28:44 -0700 Subject: [PATCH] psppire-dict: Make auto_generate_var_name() public, and rename. 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 b3a2483858..1e8beac5e3 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 7987493281..53b09f41a7 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, -- 2.30.2