missing NULL terminator in set_config_x
[geda-gaf.git] / gschem / src / x_integerls.c
bloba369c85541dc57506c45f0dd20c4394c3030dadf
1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*! \file x_integerls.c
22 * \brief A GtkListStore for the integer combo box (gschem_integer_combo_box.c).
24 #include <config.h>
26 #ifdef HAVE_ERRNO_H
27 #include <errno.h>
28 #endif
29 #include <stdio.h>
30 #ifdef HAVE_STDLIB_H
31 #include <stdlib.h>
32 #endif
33 #ifdef HAVE_STRING_H
34 #include <string.h>
35 #endif
37 #include "gschem.h"
42 /*! \brief The columns in the GtkListStore
44 enum
46 COLUMN_VALUE,
47 COLUMN_COUNT
52 /*! \brief Create a list for routine values
54 * \return An empty list of routine values
56 GtkListStore*
57 x_integerls_new ()
59 return gtk_list_store_new (COLUMN_COUNT, G_TYPE_STRING);
64 /*! \brief Create a list for routine values
66 * \param
67 * \return A list of routine values
69 GtkListStore*
70 x_integerls_new_with_values (const char *value[], int count)
72 int index;
73 GtkListStore *store = x_integerls_new ();
75 if (value != NULL) {
76 for (index=0; index < count; index++) {
77 x_integerls_add_value (store, value[index]);
81 return store;
86 /*! \brief Add a value to the list
88 * \param [in,out] store The GtkListStore
89 * \param [in] value The value to add to the list
91 void
92 x_integerls_add_value (GtkListStore *store, const char *value)
94 GtkTreeIter iter;
96 g_return_if_fail (store != NULL);
97 g_return_if_fail (value != NULL);
99 gtk_list_store_append (store, &iter);
101 gtk_list_store_set (store, &iter,
102 COLUMN_VALUE, value,
109 /*! \brief Get the column index of the value
111 * \return The column index of the value
114 x_integerls_get_value_column ()
116 return COLUMN_VALUE;