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

rework yet again to use a 2 object system. 1) SheetControl 2) BonoboObject

2002-09-20  Jody Goldberg <jody@gnome.org>

	* corba-sheet.c : rework yet again to use a 2 object system.
	  1) SheetControl
	  2) BonoboObject based wrapper for idl interface.

2002-09-20  Jody Goldberg <jody@gnome.org>

	* src/plugin-util.c (gnumeric_mmap_error_info) : delete.

	* src/plugin-service.c (plugin_service_general_activate) : init error.
	(plugin_service_general_deactivate) : ditto.
	(gnum_plugin_file_opener_probe) : ditto.
parent a19304a8
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/plugin-util.c (gnumeric_mmap_error_info) : delete.
* src/plugin-service.c (plugin_service_general_activate) : init error.
(plugin_service_general_deactivate) : ditto.
(gnum_plugin_file_opener_probe) : ditto.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Add entries for insert hyperlink to
toolbar and insert menu.
* src/GNOME_Gnumeric.xml : ditto.
* src/sheet-control-gui.c (scg_context_menu) : Use the new link icons.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/print.c : revert to gnome-2-0 versions of gnome-print
......
......@@ -22,6 +22,10 @@ Jody:
* Fix sheet object ref counting error that Morten found.
* Fix crash when destroying unshared view.
* Start fleshing out support signals to give scripting more power
* Move the CORBA support code into a plugin and make it functional.
Michael Meeks:
* Spruce up the CORBA code to use some bonobo utils.
Morten:
* Leak plugging.
......
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/plugin-util.c (gnumeric_mmap_error_info) : delete.
* src/plugin-service.c (plugin_service_general_activate) : init error.
(plugin_service_general_deactivate) : ditto.
(gnum_plugin_file_opener_probe) : ditto.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Add entries for insert hyperlink to
toolbar and insert menu.
* src/GNOME_Gnumeric.xml : ditto.
* src/sheet-control-gui.c (scg_context_menu) : Use the new link icons.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/print.c : revert to gnome-2-0 versions of gnome-print
......
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/plugin-util.c (gnumeric_mmap_error_info) : delete.
* src/plugin-service.c (plugin_service_general_activate) : init error.
(plugin_service_general_deactivate) : ditto.
(gnum_plugin_file_opener_probe) : ditto.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c : Add entries for insert hyperlink to
toolbar and insert menu.
* src/GNOME_Gnumeric.xml : ditto.
* src/sheet-control-gui.c (scg_context_menu) : Use the new link icons.
2002-09-20 Jody Goldberg <jody@gnome.org>
* src/print.c : revert to gnome-2-0 versions of gnome-print
......
2002-09-20 Jody Goldberg <jody@gnome.org>
* corba-sheet.c : rework yet again to use a 2 object system.
1) SheetControl
2) BonoboObject based wrapper for idl interface.
2002-09-20 Michael Meeks <michael@ximian.com>
* corba-sheet.c: re-hash to use BonoboObject.
......
......@@ -9,10 +9,10 @@ gnumeric_plugin_corba_LTLIBRARIES = corba.la
corba_la_LDFLAGS = -module -avoid-version
corba_la_SOURCES = $(GNUMERIC_GENERATED) \
corba-application.c \
corba-application.h \
corba-workbook.c \
corba-workbook.h \
corba-sheet.c
corba-sheet.c \
corba-sheet.h
GNUMERIC_GENERATED = \
GNOME_Gnumeric-common.c \
......
......@@ -37,10 +37,16 @@
#include <bonobo.h>
BONOBO_TYPE_FUNC_FULL (CorbaApplication,
GNOME_Gnumeric_Application,
BONOBO_OBJECT_TYPE,
capp);
typedef struct {
BonoboObject base;
/* No need for any data */
} CorbaApplication;
typedef struct {
BonoboObjectClass parent_class;
POA_GNOME_Gnumeric_Application__epv epv;
} CorbaApplicationClass;
static GNOME_Gnumeric_Workbook
capp_workbook_open (PortableServer_Servant ignore,
......@@ -85,7 +91,7 @@ capp_workbooks (PortableServer_Servant ignore,
}
static void
capp_instance_init (CorbaApplication *capp)
capp_init (CorbaApplication *capp)
{
}
......@@ -96,6 +102,12 @@ capp_class_init (CorbaApplicationClass *capp)
capp->epv.workbook_open = capp_workbook_open;
}
BONOBO_TYPE_FUNC_FULL (CorbaApplication,
GNOME_Gnumeric_Application,
BONOBO_OBJECT_TYPE,
capp);
/***************************************************************/
static CorbaApplication *capp = NULL;
void
......@@ -110,7 +122,7 @@ plugin_init_general (ErrorInfo **ret_error)
bonobo_init (&argc, argv);
}
capp = g_object_new (CORBA_TYPE_APPLICATION, NULL);
capp = g_object_new (capp_get_type(), NULL);
bonobo_activation_active_server_register (
"OAFIID:GNOME_Gnumeric_Application",
......
#ifndef GNUMERIC_CORBA_APPLICATION_H
#define GNUMERIC_CORBA_APPLICATION_H
#define CORBA_TYPE_APPLICATION (corba_application_get_type ())
#define CORBA_APPLICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CORBA_TYPE_APPLICATION, CorbaApplication))
#define CORBA_APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CORBA_TYPE_APPLICATION, CorbaApplicationClass))
#define CORBA_IS_APPLICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CORBA_TYPE_APPLICATION))
#define CORBA_IS_APPLICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CORBA_TYPE_APPLICATION))
struct _CorbaApplication {
BonoboObject base;
/* No need for any data */
};
typedef struct {
BonoboObjectClass parent_class;
POA_GNOME_Gnumeric_Application__epv epv;
} CorbaApplicationClass;
GType corba_application_get_type (void);
#endif /* GNUMERIC_CORBA_APPLICATION_H */
......@@ -24,7 +24,6 @@
#include <gnumeric.h>
#include "corba-sheet.h"
#include "GNOME_Gnumeric.h"
#include <sheet.h>
#include <sheet-control-priv.h>
......@@ -32,18 +31,36 @@
#include <gsf/gsf-impl-utils.h>
#include <bonobo.h>
BONOBO_TYPE_FUNC_FULL (SheetControl,
GNOME_Gnumeric_Sheet,
BONOBO_OBJECT_TYPE,
csheet);
#define CORBA_SHEET_TYPE (csheet_get_type ())
#define CORBA_SHEET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CORBA_SHEET_TYPE, CorbaSheet))
#define IS_CORBA_SHEET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CORBA_SHEET_TYPE))
typedef struct _SheetControlCORBA SheetControlCORBA;
typedef struct {
BonoboObject base;
SheetControlCORBA *container;
} CorbaSheet;
typedef struct {
BonoboObjectClass parent_class;
#define SERVANT_TO_SC(s) (SHEET_CONTROL (bonobo_object (s)))
POA_GNOME_Gnumeric_Sheet__epv epv;
} CorbaSheetClass;
static GType csheet_get_type (void);
static Sheet *
servant_to_sheet (PortableServer_Servant servant)
{
CorbaSheet *cs = CORBA_SHEET (bonobo_object (servant));
return sc_sheet (SHEET_CONTROL (cs->container));
}
static CORBA_string
csheet_get_name (PortableServer_Servant servant,
CORBA_Environment *ev)
{
Sheet *sheet = sc_sheet (SERVANT_TO_SC (servant));
Sheet *sheet = servant_to_sheet (servant);
return CORBA_string_dup (sheet->name_unquoted);
}
......@@ -51,7 +68,7 @@ static void
csheet_set_name (PortableServer_Servant servant, CORBA_char const * value,
CORBA_Environment *ev)
{
Sheet *sheet = sc_sheet (SERVANT_TO_SC (servant));
Sheet *sheet = servant_to_sheet (servant);
/* DO NOT CALL sheet_rename that is too low level */
}
......@@ -60,7 +77,7 @@ static CORBA_short
csheet_get_index (PortableServer_Servant servant,
CORBA_Environment *ev)
{
Sheet *sheet = sc_sheet (SERVANT_TO_SC (servant));
Sheet *sheet = servant_to_sheet (servant);
return sheet->index_in_wb;
}
......@@ -69,44 +86,89 @@ csheet_set_index (PortableServer_Servant servant,
CORBA_short indx,
CORBA_Environment *ev)
{
Sheet *sheet = sc_sheet (SERVANT_TO_SC (servant));
Sheet *sheet = servant_to_sheet (servant);
/* FIXME: do something */
}
static void
csheet_dispose (SheetControl *sc)
csheet_dispose (GObject *obj)
{
if (sc->view) {
SheetView *v = sc->view;
sc->view = NULL;
g_object_unref (v);
}
/* FIXME : do we need to unref the container ? */
}
static void
csheet_instance_init (SheetControl *sc)
csheet_init (GObject *obg)
{
}
static void
csheet_class_init (SheetControlClass *sc_class)
csheet_class_init (GObjectClass *gobject_class)
{
GObjectClass *gobject_class = (GObjectClass *) sc_class;
CorbaSheetClass *cs_class = (CorbaSheetClass *) gobject_class;
gobject_class->dispose = csheet_dispose;
/* populate CORBA epv */
sc_class->epv._get_name = csheet_get_name;
sc_class->epv._set_name = csheet_set_name;
sc_class->epv._get_index = csheet_get_index;
sc_class->epv._set_index = csheet_set_index;
cs_class->epv._get_name = csheet_get_name;
cs_class->epv._set_name = csheet_set_name;
cs_class->epv._get_index = csheet_get_index;
cs_class->epv._set_index = csheet_set_index;
}
BONOBO_TYPE_FUNC_FULL (CorbaSheet,
GNOME_Gnumeric_Sheet,
BONOBO_OBJECT_TYPE,
csheet);
/*************************************************************************/
struct _SheetControlCORBA {
SheetControl base;
CorbaSheet *servant;
};
typedef struct {
SheetControlClass base;
} SheetControlCORBAClass;
static void
scc_finalize (GObject *obj)
{
GObjectClass *parent_class;
SheetControlCORBA *scc = SHEET_CONTROL_CORBA (obj);
if (scc->servant != NULL) {
bonobo_object_unref (BONOBO_OBJECT (scc->servant));
scc->servant = NULL;
}
parent_class = g_type_class_peek (SHEET_CONTROL_TYPE);
if (parent_class->finalize)
parent_class->finalize (obj);
}
static void
scc_class_init (GObjectClass *object_class)
{
object_class->finalize = &scc_finalize;
}
static void
scc_init (SheetControlCORBA *scc)
{
}
GSF_CLASS (SheetControlCORBA, sheet_control_corba,
scc_class_init, scc_init, SHEET_CONTROL_TYPE);
SheetControl *
sheet_control_corba_new (SheetView *sv)
{
SheetControl *sc =
g_object_new (sheet_control_corba_get_type (), NULL);
sc->view = g_object_ref (sv);
return sc;
SheetControlCORBA *scc =
g_object_new (SHEET_CONTROL_CORBA_TYPE, NULL);
scc->servant = g_object_new (CORBA_SHEET_TYPE, NULL);
scc->servant->container = scc;
sv_attach_control (sv, SHEET_CONTROL (scc));
return SHEET_CONTROL (scc);
}
#ifndef GNUMERIC_SHEET_CONTROL_CORBA_H
#define GNUMERIC_SHEET_CONTROL_CORBA_H
#include "sheet-control.h"
#include <gnumeric.h>
#include "GNOME_Gnumeric.h"
#define SHEET_TYPE_CONTROL (sheet_control_get_type ())
#define SHEET_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SHEET_TYPE_CONTROL, SheetControl))
#define SHEET_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHEET_TYPE_CONTROL, SheetControlClass))
#define SHEET_IS_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHEET_TYPE_CONTROL))
#define SHEET_IS_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SHEET_TYPE_CONTROL))
#define SHEET_CONTROL_CORBA_TYPE (sheet_control_corba_get_type ())
#define SHEET_CONTROL_CORBA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHEET_CONTROL_CORBA_TYPE, SheetControlCORBA))
#define IS_SHEET_CONTROL_CORBA(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHEET_CONTROL_CORBA_TYPE))
typedef struct _SheetControlPrivate SheetControlPrivate;
struct _SheetControl {
BonoboObject base;
/*
* Of course, proxy objects are a painful pile of
* typing, but then using CORBA types internally is
* perhaps harder ?
*/
SheetView *view;
};
typedef struct {
BonoboObjectClass parent_class;
POA_GNOME_Gnumeric_Sheet__epv epv;
} SheetControlClass;
GType sheet_control_corba_get_type (void);
SheetControl *sheet_control_corba_new (SheetView *view);
GType sheet_control_corba_get_type (void);
SheetControl *sheet_control_corba_new (SheetView *view);
GNOME_Gnumeric_Sheet sheet_control_corba_obj (SheetControl *sc);
#endif /* GNUMERIC_SHEET_CONTROL_CORBA_H */
This diff is collapsed.
......@@ -382,6 +382,11 @@
_label="_Add / Modify comment..."
_tip="Edit the selected cell's comment"/>
<menuitem name="InsertHyperLink" verb=""
pixtype="stock" pixname="Gnumeric_Link_Add"
_label="Hyper_link..."
_tip="Insert a Hyperlink"/>
<submenu name="Special" _label="S_pecial">
<menuitem name="Date" verb="InsertCurrentDate"
......@@ -715,6 +720,12 @@
<separator/>
<toolitem name="InsertHyperlink"
pixtype="stock" pixname="Gnumeric_Link_Add"
_label="Hyper_link..."
_tip="Insert a Hyperlink"
verb="InsertHyperlink"/>
<toolitem name="Sum"
pixtype="stock" pixname="Gnumeric_AutoSum"
_label="Sum"
......
......@@ -210,7 +210,7 @@ typedef struct {
static void
gnumeric_plugin_loader_module_func_init (PluginService *service, ErrorInfo **ret_error)
{
ErrorInfo *error;
ErrorInfo *error = NULL;
ServiceLoaderDataGeneral *loader_data;
g_return_if_fail (GNM_IS_PLUGIN_SERVICE_GENERAL (service));
......@@ -224,7 +224,7 @@ gnumeric_plugin_loader_module_func_init (PluginService *service, ErrorInfo **ret
static void
gnumeric_plugin_loader_module_func_cleanup (PluginService *service, ErrorInfo **ret_error)
{
ErrorInfo *error;
ErrorInfo *error = NULL;
ServiceLoaderDataGeneral *loader_data;
g_return_if_fail (GNM_IS_PLUGIN_SERVICE_GENERAL (service));
......@@ -535,7 +535,7 @@ gnumeric_plugin_loader_module_func_get_loader_type (PluginService *service,
ErrorInfo **ret_error)
{
ServiceLoaderDataPluginLoader *loader_data;
ErrorInfo *error;
ErrorInfo *error = NULL;
GType loader_type;
g_return_val_if_fail (GNM_IS_PLUGIN_SERVICE_PLUGIN_LOADER (service), 0);
......
......@@ -182,7 +182,7 @@ void
gnumeric_plugin_loader_load_base (GnumericPluginLoader *loader, ErrorInfo **ret_error)
{
GnumericPluginLoaderClass *gnumeric_plugin_loader_class;
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (IS_GNUMERIC_PLUGIN_LOADER (loader));
g_return_if_fail (!loader->is_base_loaded);
......@@ -203,7 +203,7 @@ void
gnumeric_plugin_loader_unload_base (GnumericPluginLoader *loader, ErrorInfo **ret_error)
{
GnumericPluginLoaderClass *gnumeric_plugin_loader_class;
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (IS_GNUMERIC_PLUGIN_LOADER (loader));
g_return_if_fail (loader->is_base_loaded);
......@@ -225,7 +225,7 @@ void
gnumeric_plugin_loader_load_service (GnumericPluginLoader *loader, PluginService *service, ErrorInfo **ret_error)
{
GnumericPluginLoaderClass *gnumeric_plugin_loader_class;
ErrorInfo *error;
ErrorInfo *error = NULL;
void (*load_service_method) (GnumericPluginLoader *, PluginService *, ErrorInfo **) = NULL;
g_return_if_fail (IS_GNUMERIC_PLUGIN_LOADER (loader));
......@@ -267,7 +267,7 @@ gnumeric_plugin_loader_unload_service (GnumericPluginLoader *loader, PluginServi
{
GnumericPluginLoaderClass *gnumeric_plugin_loader_class;
void (*unload_service_method) (GnumericPluginLoader *, PluginService *, ErrorInfo **) = NULL;
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (IS_GNUMERIC_PLUGIN_LOADER (loader));
g_return_if_fail (GNM_IS_PLUGIN_SERVICE (service));
......
......@@ -186,7 +186,7 @@ static void
plugin_service_general_activate (PluginService *service, ErrorInfo **ret_error)
{
PluginServiceGeneral *service_general = GNM_PLUGIN_SERVICE_GENERAL (service);
ErrorInfo *error;
ErrorInfo *error = NULL;
GNM_INIT_RET_ERROR_INFO (ret_error);
plugin_service_load (service, &error);
......@@ -211,7 +211,7 @@ static void
plugin_service_general_deactivate (PluginService *service, ErrorInfo **ret_error)
{
PluginServiceGeneral *service_general = GNM_PLUGIN_SERVICE_GENERAL (service);
ErrorInfo *error;
ErrorInfo *error = NULL;
GNM_INIT_RET_ERROR_INFO (ret_error);
g_return_if_fail (service_general->cbs.plugin_func_cleanup != NULL);
......@@ -579,7 +579,7 @@ gnum_plugin_file_opener_probe (GnumFileOpener const *fo, GsfInput *input,
}
if (service_file_opener->has_probe) {
ErrorInfo *ignored_error;
ErrorInfo *ignored_error = NULL;
plugin_service_load (pfo->service, &ignored_error);
if (ignored_error != NULL) {
......@@ -603,7 +603,7 @@ gnum_plugin_file_opener_open (GnumFileOpener const *fo, IOContext *io_context,
{
GnumPluginFileOpener *pfo = GNUM_PLUGIN_FILE_OPENER (fo);
PluginServiceFileOpener *service_file_opener = GNM_PLUGIN_SERVICE_FILE_OPENER (pfo->service);
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (GSF_IS_INPUT (input));
......@@ -874,7 +874,7 @@ gnum_plugin_file_saver_save (GnumFileSaver const *fs, IOContext *io_context,
{
GnumPluginFileSaver *pfs = GNUM_PLUGIN_FILE_SAVER (fs);
PluginServiceFileSaver *service_file_saver = GNM_PLUGIN_SERVICE_FILE_SAVER (pfs->service);
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (file_name != NULL);
......@@ -1066,7 +1066,7 @@ plugin_service_function_group_get_full_info_callback (
{
PluginService *service;
PluginServiceFunctionGroup *service_function_group;
ErrorInfo *error;
ErrorInfo *error =NULL;
g_return_val_if_fail (fn_def != NULL, FALSE);
......@@ -1213,7 +1213,7 @@ GType
plugin_service_plugin_loader_generate_type (PluginService *service, ErrorInfo **ret_error)
{
PluginServicePluginLoader *service_plugin_loader = GNM_PLUGIN_SERVICE_PLUGIN_LOADER (service);
ErrorInfo *error;
ErrorInfo *error = NULL;
GType loader_type;
GNM_INIT_RET_ERROR_INFO (ret_error);
......@@ -1362,13 +1362,13 @@ static void
ui_verb_fn (BonoboUIComponent *uic, gpointer user_data, const gchar *cname)
{
PluginService *service = GNM_PLUGIN_SERVICE (user_data);
ErrorInfo *load_error;
ErrorInfo *load_error = NULL;
plugin_service_load (service, &load_error);
if (load_error == NULL) {
PluginServiceUI *service_ui = GNM_PLUGIN_SERVICE_UI (service);
WorkbookControlGUI *wbcg;
ErrorInfo *ignored_error;
ErrorInfo *ignored_error = NULL;
g_return_if_fail (service_ui->cbs.plugin_func_exec_verb != NULL);
wbcg = g_object_get_data (
......@@ -1481,7 +1481,7 @@ plugin_service_load (PluginService *service, ErrorInfo **ret_error)
static void
plugin_service_unload (PluginService *service, ErrorInfo **ret_error)
{
ErrorInfo *error;
ErrorInfo *error = NULL;
g_return_if_fail (GNM_IS_PLUGIN_SERVICE (service));
......@@ -1514,7 +1514,7 @@ plugin_service_new (xmlNode *tree, ErrorInfo **ret_error)
{
PluginService *service = NULL;
char *id, *type_str;
ErrorInfo *service_error;
ErrorInfo *service_error = NULL;
int ti;
g_return_val_if_fail (tree != NULL, NULL);
......@@ -1615,7 +1615,7 @@ plugin_service_activate (PluginService *service, ErrorInfo **ret_error)
}
#ifdef PLUGIN_ALWAYS_LOAD
{
ErrorInfo *load_error;
ErrorInfo *load_error = NULL;
plugin_service_load (service, &load_error);
if (load_error != NULL) {
......@@ -1640,7 +1640,7 @@ plugin_service_deactivate (PluginService *service, ErrorInfo **ret_error)
}
GPS_GET_CLASS (service)->deactivate (service, ret_error);
if (*ret_error == NULL) {
ErrorInfo *ignored_error;
ErrorInfo *ignored_error = NULL;
service->is_active = FALSE;
/* FIXME */
......
......@@ -239,97 +239,3 @@ gnumeric_fopen_error_info (const char *file_name, const char *mode, ErrorInfo **
return f;
}
/**
* gnumeric_open_error_info:
* @file_name: the file to open
* @flags: the flags
* @ret_error: ErrorInfo to fill when error occurs
*
* wrapper around open (), will handle error
* reporting to the command context.
* for more info on parameters see 'man 2 open'
*
* Return value: a file descriptor on success or -1 on error
**/
gint
gnumeric_open_error_info (const gchar *file_name, gint flags, ErrorInfo **ret_error)
{
gint fd;
g_return_val_if_fail (file_name != NULL, -1);
g_return_val_if_fail (ret_error != NULL, -1);
*ret_error = NULL;
fd = open (file_name, flags);
if (fd < 0) {
if (flags & O_WRONLY) {
*ret_error = error_info_new_printf (
_("Error while opening file \"%s\" for writing."),
file_name);
} else {
*ret_error = error_info_new_printf (
_("Error while opening file \"%s\" for reading."),
file_name);
}
error_info_add_details (*ret_error, error_info_new_from_errno ());
}
return fd;
}
/**
* gnumeric_mmap_open_error_info:
* @filename: the name of the file to mmap
* @file_size: if not NULL, the file size will be returned here
* @ret_error: ErrorInfo to fill when error occurs
*
* Opens and mmaps a file into memory. Will report
* errors using ErrorInfo struct.
*
* NOTE : don't rely on the value of @file_size
* if the function fails (returns NULL).
*
* Return value: a pointer to the mmaped data or NULL on failure.
**/
guchar const *
gnumeric_mmap_error_info (const gchar *file_name, gint *file_size, ErrorInfo **ret_error)
{
gpointer mem;
gint fd;
struct stat sbuf;
ErrorInfo *error;