patch



This patch supersedes my last patch.

I have added catagorys for complex numbers matrix, trig.

Phill

I have put the complex number functions into their own catagory.
I have put trig. functions into their own catagory.
Moved CONVERT to maths.
Moved DELTA to infomation.
Moved GESTEP to information.
Moved the matrix functions that were in maths to their own catagory.

Phill

cut -----------------------------


Index: gnumeric/src/func.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/func.c,v
retrieving revision 1.103
diff -u -r1.103 func.c
--- gnumeric/src/func.c 2000/12/01 18:26:41     1.103
+++ gnumeric/src/func.c 2001/01/09 12:42:26
@@ -22,12 +22,15 @@
 static SymbolTable *global_symbol_table = NULL;
 
 extern void math_functions_init        (void);
+extern void matrix_functions_init      (void);
+extern void trig_functions_init        (void);
 extern void sheet_functions_init       (void);
 extern void date_functions_init        (void);
 extern void string_functions_init      (void);
 extern void stat_functions_init        (void);
 extern void finance_functions_init     (void);
 extern void eng_functions_init         (void);
+extern void imag_functions_init        (void);
 extern void lookup_functions_init      (void);
 extern void logical_functions_init     (void);
 extern void database_functions_init    (void);
@@ -39,12 +42,15 @@
        global_symbol_table = symbol_table_new ();
 
        math_functions_init ();
+       matrix_functions_init ();
+       trig_functions_init ();
        sheet_functions_init ();
        date_functions_init ();
        string_functions_init ();
        stat_functions_init ();
        finance_functions_init ();
        eng_functions_init ();
+       imag_functions_init ();
        lookup_functions_init ();
        logical_functions_init ();
        database_functions_init ();
Index: gnumeric/src/functions/fn-eng.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/functions/fn-eng.c,v
retrieving revision 1.54
diff -u -r1.54 fn-eng.c
--- gnumeric/src/functions/fn-eng.c     2000/12/20 21:21:15     1.54
+++ gnumeric/src/functions/fn-eng.c     2001/01/09 12:42:30
@@ -1875,12 +1875,6 @@
                cat, "bin2oct",     "?|f",  "xnum,ynum",
                &help_bin2oct, gnumeric_bin2oct);
        function_add_args  (
-               cat, "complex",     "ff|s", "real,im[,suffix]",
-               &help_complex, gnumeric_complex);
-       function_add_args  (
-               cat, "convert",     "fss",  "number,from_unit,to_unit",
-               &help_convert, gnumeric_convert);
-       function_add_args  (
                cat, "dec2bin",     "?|f",  "xnum,ynum",
                &help_dec2bin, gnumeric_dec2bin);
        function_add_args  (
@@ -1890,18 +1884,12 @@
                cat, "dec2hex",     "?|f",  "xnum,ynum",
                &help_dec2hex, gnumeric_dec2hex);
        function_add_args  (
-               cat, "delta",       "f|f",  "xnum,ynum",
-               &help_delta, gnumeric_delta);
-       function_add_args  (
                cat, "erf",         "f|f",  "lower,upper",
                &help_erf, gnumeric_erf );
        function_add_args  (
                cat, "erfc",        "f",    "number",
                &help_erfc, gnumeric_erfc);
        function_add_args  (
-               cat, "gestep",      "f|f",  "xnum,ynum",
-               &help_gestep, gnumeric_gestep);
-       function_add_args  (
                cat, "hex2bin",     "?|f",  "xnum,ynum",
                &help_hex2bin, gnumeric_hex2bin);
        function_add_args  (
@@ -1911,6 +1899,26 @@
                cat, "hex2oct",     "?|f",  "xnum,ynum",
                &help_hex2oct, gnumeric_hex2oct);
        function_add_args  (
+               cat, "oct2bin",     "?|f",  "xnum,ynum",
+               &help_oct2bin, gnumeric_oct2bin);
+       function_add_args  (
+               cat, "oct2dec",     "?",    "number",
+               &help_oct2dec, gnumeric_oct2dec);
+       function_add_args  (
+               cat, "oct2hex",     "?|f",  "xnum,ynum",
+               &help_oct2hex, gnumeric_oct2hex);
+}
+
+void imag_functions_init (void);
+void
+imag_functions_init (void)
+{
+       FunctionCategory *cat = function_get_category (_("Complex Numbers"));
+
+       function_add_args  (
+               cat, "complex",     "ff|s", "real,im[,suffix]",
+               &help_complex, gnumeric_complex);
+       function_add_args  (
                cat, "imabs",       "?",  "inumber",
                &help_imabs, gnumeric_imabs);
        function_add_args  (
@@ -1964,13 +1972,4 @@
        function_add_nodes (
                cat, "imsum",       "??", "inumber,inumber",
                &help_imsum, gnumeric_imsum);
-       function_add_args  (
-               cat, "oct2bin",     "?|f",  "xnum,ynum",
-               &help_oct2bin, gnumeric_oct2bin);
-       function_add_args  (
-               cat, "oct2dec",     "?",    "number",
-               &help_oct2dec, gnumeric_oct2dec);
-       function_add_args  (
-               cat, "oct2hex",     "?|f",  "xnum,ynum",
-               &help_oct2hex, gnumeric_oct2hex);
 }
Index: gnumeric/src/functions/fn-information.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/functions/fn-information.c,v
retrieving revision 1.50
diff -u -r1.50 fn-information.c
--- gnumeric/src/functions/fn-information.c     2001/01/02 20:08:56     1.50
+++ gnumeric/src/functions/fn-information.c     2001/01/09 12:42:32
@@ -862,10 +862,14 @@
                            &help_cell, gnumeric_cell);
         function_add_args  (cat, "countblank", "r",  "range",
                            &help_countblank, gnumeric_countblank);
-       function_add_args  (cat, "error",   "s",  "text",
+        function_add_args  (cat, "delta",       "f|f",  "xnum,ynum",
+                           &help_delta, gnumeric_delta);
+       function_add_args  (cat, "error",   "s",  "text",
                            &help_error,   gnumeric_error);
        function_add_nodes (cat, "error.type", "", "",
                            &help_error_type, gnumeric_error_type);
+        function_add_args  (cat, "gestep",      "f|f",  "xnum,ynum",
+                           &help_gestep, gnumeric_gestep);
        function_add_args  (cat, "info", "s", "info_type",
                            &help_info, gnumeric_info);
        function_add_nodes (cat, "isblank", "?", "value",
Index: gnumeric/src/functions/fn-math.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/functions/fn-math.c,v
retrieving revision 1.140
diff -u -r1.140 fn-math.c
--- gnumeric/src/functions/fn-math.c    2000/12/20 23:35:02     1.140
+++ gnumeric/src/functions/fn-math.c    2001/01/09 12:42:39
@@ -3387,30 +3387,12 @@
 math_functions_init (void)
 {
        FunctionDefinition *def;
-       FunctionCategory *cat = function_get_category (_("Maths / Trig."));
+       FunctionCategory *cat = function_get_category (_("Maths"));
 
        def = function_add_args  (cat, "abs",     "f",
                                  "number",    &help_abs,      gnumeric_abs);
        auto_format_function_result (def, AF_FIRST_ARG_FORMAT);
 
-       function_add_args  (cat, "acos",    "f",
-                           "number",    &help_acos,     gnumeric_acos);
-       function_add_args  (cat, "acosh",   "f",
-                           "number",    &help_acosh,    gnumeric_acosh);
-       function_add_args  (cat, "asin",    "f",
-                           "number",    &help_asin,     gnumeric_asin);
-       function_add_args  (cat, "asinh",   "f",
-                           "number",    &help_asinh,    gnumeric_asinh);
-       function_add_args  (cat, "atan",    "f",
-                           "number",    &help_atan,     gnumeric_atan);
-       function_add_args  (cat, "atanh",   "f",
-                           "number",    &help_atanh,    gnumeric_atanh);
-       function_add_args  (cat, "atan2",   "ff",
-                           "xnum,ynum", &help_atan2,    gnumeric_atan2);
-       function_add_args  (cat, "cos",     "f",
-                           "number",    &help_cos,      gnumeric_cos);
-       function_add_args  (cat, "cosh",    "f",
-                           "number",    &help_cosh,     gnumeric_cosh);
        function_add_args  (cat, "countif", "r?",
                            "range,criteria",
                            &help_countif,     gnumeric_countif);
@@ -3424,8 +3406,9 @@
                                  &help_ceiling,     gnumeric_ceiling);
        auto_format_function_result (def, AF_FIRST_ARG_FORMAT);
 
-       function_add_args  (cat, "degrees", "f",
-                           "number",    &help_degrees,  gnumeric_degrees);
+        function_add_args  (cat, "convert",     "fss",
+                           "number,from_unit,to_unit",
+                            &help_convert, gnumeric_convert);
        function_add_args  (cat, "even",    "f",
                            "number",    &help_even,     gnumeric_even);
        function_add_args  (cat, "exp",     "f",
@@ -3482,9 +3465,6 @@
                            "number",    &help_g_product,  gnumeric_g_product);
        function_add_args  (cat, "quotient" , "ff",
                            "num,den",   &help_quotient, gnumeric_quotient);
-       function_add_args  (cat, "radians", "f",
-                           "number",    &help_radians,
-                           gnumeric_radians);
        function_add_args  (cat, "rand",    "",
                            "",          &help_rand,     gnumeric_rand);
         function_add_args  (cat, "randbernoulli", "f",
@@ -3529,10 +3509,6 @@
                            &help_seriessum,   gnumeric_seriessum);
        function_add_args  (cat, "sign",    "f",
                            "number",    &help_sign,     gnumeric_sign);
-       function_add_args  (cat, "sin",     "f",
-                           "number",    &help_sin,      gnumeric_sin);
-       function_add_args  (cat, "sinh",    "f",
-                           "number",    &help_sinh,     gnumeric_sinh);
        function_add_args  (cat, "sqrt",    "f",
                            "number",    &help_sqrt,     gnumeric_sqrt);
        function_add_args  (cat, "sqrtpi",  "f",
@@ -3568,18 +3544,61 @@
        function_add_args  (cat, "sumxmy2",  "AA",
                            "array1,array2",
                            &help_sumxmy2,     gnumeric_sumxmy2);
-       function_add_args  (cat, "tan",     "f",
-                           "number",    &help_tan,      gnumeric_tan);
-       function_add_args  (cat, "tanh",    "f",
-                           "number",    &help_tanh,     gnumeric_tanh);
 
        def = function_add_args  (cat, "trunc",   "f|f",
                                  "number,digits",
                                  &help_trunc,       gnumeric_trunc);
        auto_format_function_result (def, AF_FIRST_ARG_FORMAT);
+}
+
+void trig_functions_init (void);
+void
+trig_functions_init (void)
+{
+       FunctionDefinition *def;
+       FunctionCategory *cat = function_get_category (_("Trig."));
 
+       function_add_args  (cat, "acos",    "f",
+                           "number",    &help_acos,     gnumeric_acos);
+       function_add_args  (cat, "acosh",   "f",
+                           "number",    &help_acosh,    gnumeric_acosh);
+       function_add_args  (cat, "asin",    "f",
+                           "number",    &help_asin,     gnumeric_asin);
+       function_add_args  (cat, "asinh",   "f",
+                           "number",    &help_asinh,    gnumeric_asinh);
+       function_add_args  (cat, "atan",    "f",
+                           "number",    &help_atan,     gnumeric_atan);
+       function_add_args  (cat, "atanh",   "f",
+                           "number",    &help_atanh,    gnumeric_atanh);
+       function_add_args  (cat, "atan2",   "ff",
+                           "xnum,ynum", &help_atan2,    gnumeric_atan2);
+       function_add_args  (cat, "cos",     "f",
+                           "number",    &help_cos,      gnumeric_cos);
+       function_add_args  (cat, "cosh",    "f",
+                           "number",    &help_cosh,     gnumeric_cosh);
+       function_add_args  (cat, "degrees", "f",
+                           "number",    &help_degrees,  gnumeric_degrees);
+       function_add_args  (cat, "radians", "f",
+                           "number",    &help_radians,  gnumeric_radians);
+       function_add_args  (cat, "sin",     "f",
+                           "number",    &help_sin,      gnumeric_sin);
+       function_add_args  (cat, "sinh",    "f",
+                           "number",    &help_sinh,     gnumeric_sinh);
+       function_add_args  (cat, "tan",     "f",
+                           "number",    &help_tan,      gnumeric_tan);
+       function_add_args  (cat, "tanh",    "f",
+                           "number",    &help_tanh,     gnumeric_tanh);
        function_add_args  (cat, "pi",      "",
                            "",          &help_pi,       gnumeric_pi);
+}
+
+void matrix_functions_init (void);
+void
+matrix_functions_init (void)
+{
+       FunctionDefinition *def;
+       FunctionCategory *cat = function_get_category (_("Matrix"));
+
        function_add_args  (cat, "mmult",   "AA",
                            "array1,array2",
                            &help_mmult,       gnumeric_mmult);



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