X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fui%2Fgui%2Fcompute-dialog.c;h=7125442d347e5f93b68c0d5106a664106cf1fabe;hb=b37457e4db3d02fbf1e41b24baf3248bf34a02d8;hp=bc2b15c16a3284d96f967b078a300244766e67d9;hpb=146997e1690f055481e2003529eaa4f8848ca4a8;p=pspp-builds.git diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index bc2b15c1..7125442d 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -29,13 +29,10 @@ #include "dialog-common.h" #include "dict-display.h" +#include #include #include "syntax-editor.h" - -#include -#include "c-ctype.h" - static void function_list_populate (GtkTreeView *tv); static void insert_function_into_syntax_area (GtkTreeIter iter, @@ -291,12 +288,6 @@ enum { }; -static const struct operation fs[] = - { -#include - }; - - static void function_list_populate (GtkTreeView *tv) { @@ -304,25 +295,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); }