Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / ui / gui / compute-dialog.c
index bc2b15c16a3284d96f967b078a300244766e67d9..522ca6c3b445225e5bcddedd3bf420824232b9bd 100644 (file)
@@ -1,21 +1,18 @@
-/*
-    PSPPIRE --- A Graphical User Interface for PSPP
-    Copyright (C) 2007  Free Software Foundation
+/* PSPPIRE - a graphical user interface for PSPP.
+   Copyright (C) 2007  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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+   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
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301, USA. */
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 
 #include <gtk/gtk.h>
 #include "dialog-common.h"
 #include "dict-display.h"
 
+#include <language/expressions/public.h>
 #include <language/syntax-string-source.h>
 #include "syntax-editor.h"
 
-
-#include <language/expressions/private.h>
-#include "c-ctype.h"
-
 static void function_list_populate (GtkTreeView *tv);
 
 static void insert_function_into_syntax_area (GtkTreeIter iter,
@@ -291,12 +285,6 @@ enum {
 };
 
 
-static const struct operation fs[] =
-  {
-#include <language/expressions/parse.inc>
-  };
-
-
 static void
 function_list_populate (GtkTreeView *tv)
 {
@@ -304,25 +292,20 @@ function_list_populate (GtkTreeView *tv)
   GtkTreeIter iter;
   gint i;
 
-  const gint n_funcs = sizeof (fs) / sizeof fs[0] ;
+  const gint n_funcs = expr_get_function_cnt ();
 
   liststore = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
 
   for (i = 0 ; i < n_funcs ; ++i)
     {
-      if ( fs[i].prototype == NULL)
-       continue;
-
-      /* All the real ones seem to begin with an upper case letter */
-      if ( !c_isupper(*fs[i].prototype))
-       continue;
+      const struct operation *op = expr_get_function (i);
 
       gtk_list_store_append (liststore, &iter);
 
       gtk_list_store_set (liststore, &iter,
-                         COL_NAME, fs[i].name,
-                         COL_USAGE,fs[i].prototype,
-                         COL_ARITY, fs[i].arg_cnt,
+                         COL_NAME, expr_operation_get_name (op),
+                         COL_USAGE, expr_operation_get_prototype (op),
+                         COL_ARITY, expr_operation_get_arg_cnt (op),
                          -1);
     }