Commit a8292a16 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

dump the functions in alphabetical order. FIXME : when we have translated

2001-09-16  Jody Goldberg <jgoldberg@home.com>

	* src/func.c (function_dump_defs) : dump the functions in alphabetical
	  order.  FIXME : when we have translated names we should use them.
parent e2b84d4e
2001-09-16 Jody Goldberg <jgoldberg@home.com>
* src/func.c (function_dump_defs) : dump the functions in alphabetical
order. FIXME : when we have translated names we should use them.
2001-09-14 Jody Goldberg <jgoldberg@home.com>
* gnumeric.xsd : reference v8, and make Max{Col,Row} optional.
......
2001-09-16 Jody Goldberg <jgoldberg@home.com>
* src/func.c (function_dump_defs) : dump the functions in alphabetical
order. FIXME : when we have translated names we should use them.
2001-09-14 Jody Goldberg <jgoldberg@home.com>
* gnumeric.xsd : reference v8, and make Max{Col,Row} optional.
......
2001-09-16 Jody Goldberg <jgoldberg@home.com>
* src/func.c (function_dump_defs) : dump the functions in alphabetical
order. FIXME : when we have translated names we should use them.
2001-09-14 Jody Goldberg <jgoldberg@home.com>
* gnumeric.xsd : reference v8, and make Max{Col,Row} optional.
......
2001-09-16 Jody Goldberg <jgoldberg@home.com>
* src/func.c (function_dump_defs) : dump the functions in alphabetical
order. FIXME : when we have translated names we should use them.
2001-09-14 Jody Goldberg <jgoldberg@home.com>
* gnumeric.xsd : reference v8, and make Max{Col,Row} optional.
......
......@@ -3,25 +3,25 @@
typedef enum
{
FMT_UNKNOWN = -1,
FMT_GENERAL = 0,
FMT_NUMBER = 1,
FMT_CURRENCY = 2,
FMT_ACCOUNT = 3,
FMT_DATE = 4,
FMT_TIME = 5,
FMT_PERCENT = 6,
FMT_FRACTION = 7,
FMT_SCIENCE = 8,
FMT_TEXT = 9,
FMT_SPECIAL = 10
FMT_UNKNOWN = -1,
FMT_GENERAL = 0,
FMT_NUMBER = 1,
FMT_CURRENCY = 2,
FMT_ACCOUNT = 3,
FMT_DATE = 4,
FMT_TIME = 5,
FMT_PERCENT = 6,
FMT_FRACTION = 7,
FMT_SCIENCE = 8,
FMT_TEXT = 9,
FMT_SPECIAL = 10
} FormatFamily;
typedef struct
{
char const *symbol;
char const *description;
char const * const symbol;
char const * const description;
} CurrencySymbol;
typedef struct
......@@ -33,7 +33,7 @@ typedef struct
gint list_element;
} FormatCharacteristics;
FormatFamily cell_format_classify (char const * const fmt, FormatCharacteristics *info);
FormatFamily cell_format_classify (char const * const fmt, FormatCharacteristics *info);
/* Indexed by FormatCharacteristics */
extern char const * const * const cell_formats [];
......
......@@ -8,11 +8,6 @@
* Jody Goldberg (jgoldberg@home.org)
*/
#include <config.h>
#include <string.h>
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <math.h>
#include "func.h"
#include "portability.h"
#include "parse-util.h"
......@@ -23,6 +18,12 @@
#include "workbook.h"
#include "sheet.h"
#include <string.h>
#include <glib.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <stdlib.h>
/* These are not supported yet */
typedef enum {
FUNCTION_RETURNS_ARRAY = 0x01, /* eg transpose(), mmult() */
......@@ -92,23 +93,30 @@ functions_init (void)
}
static void
dump_func_help (gpointer key, gpointer value, void *output_file)
copy_hash_table_to_ptr_array (gpointer key, gpointer value, gpointer array)
{
Symbol *sym = value;
FunctionDefinition *fn_def;
FunctionDefinition *fd = sym->data;
if (sym->type == SYMBOL_FUNCTION &&
fd->help != NULL && fd->name != NULL)
g_ptr_array_add (array, fd);
}
if (sym->type != SYMBOL_FUNCTION)
return;
fn_def = sym->data;
static int
func_def_cmp (gconstpointer a, gconstpointer b)
{
FunctionDefinition const *fda = *(FunctionDefinition const **)a ;
FunctionDefinition const *fdb = *(FunctionDefinition const **)b ;
if (fn_def->help)
fprintf (output_file, "%s\n\n", _( *(fn_def->help) ) );
return g_strcasecmp (fda->name, fdb->name);
}
void
function_dump_defs (const char *filename)
{
FILE *output_file;
unsigned i;
GPtrArray *ordered;
g_return_if_fail (filename != NULL);
......@@ -117,11 +125,25 @@ function_dump_defs (const char *filename)
exit (1);
}
/* TODO : Use the translated names and split by category. */
ordered = g_ptr_array_new ();
g_hash_table_foreach (global_symbol_table->hash,
&dump_func_help, output_file);
copy_hash_table_to_ptr_array, ordered);
if (ordered->len > 0)
qsort (&g_ptr_array_index (ordered, 0),
ordered->len, sizeof (gpointer),
func_def_cmp);
for (i = 0; i < ordered->len; i++) {
FunctionDefinition const *fd = g_ptr_array_index (ordered, i);
fprintf (output_file, "%s\n\n", _( *(fd->help) ) );
}
g_ptr_array_free (ordered,TRUE);
fclose (output_file);
}
/* ------------------------------------------------------------------------- */
static gint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment