Commit dcf2a876 authored by Jody Goldberg's avatar Jody Goldberg

Add a command line flag to enable extra checking in libole, and disable

the checking by default.
parent f463f0e9
1999-10-07 Jody Goldberg <jgoldberg@home.com>
* src/main.c : Add new command line parameter. --debug_ole
1999-10-07 Miguel de Icaza <miguel@gnu.org>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
......
1999-10-07 Jody Goldberg <jgoldberg@home.com>
* src/main.c : Add new command line parameter. --debug_ole
1999-10-07 Miguel de Icaza <miguel@gnu.org>
* src/gnumeric-sheet.c (gnumeric_sheet_compute_visible_ranges):
......
1999-10-07 Jody Goldberg <jgoldberg@home.com>
* ms-ole.c : Add a libole2_debug debug flag which can optionally
enable calles to check_stream.
1999-10-05 Arturo Tena <arturo@directmail.org>
* ms-ole.c: Add a comment regarding check_stream performance issue
......
......@@ -80,6 +80,12 @@ struct _MsOle
/* end if memory mapped */
};
/* A global variable to enable calles to check_stream,
* applications should optionally enable due to the performance penalty.
* of 30-50 % of load time.
*/
gboolean libole2_debug = FALSE;
typedef guint32 PPS_IDX ;
#if OLE_DEBUG > 0
......@@ -1766,7 +1772,8 @@ ms_ole_read_ptr_bb (MsOleStream *s, MsOlePos length)
ans = BB_R_PTR(s->file, ms_array_index (s->blocks, BLP, s->position/BB_BLOCK_SIZE))
+ s->position%BB_BLOCK_SIZE;
ms_ole_lseek (s, length, MsOleSeekCur);
check_stream (s);
if (libole2_debug)
check_stream (s);
return ans;
}
......@@ -1803,7 +1810,8 @@ ms_ole_read_ptr_sb (MsOleStream *s, MsOlePos length)
ans = GET_SB_R_PTR(s->file, ms_array_index (s->blocks, BLP, s->position/SB_BLOCK_SIZE))
+ s->position%SB_BLOCK_SIZE;
ms_ole_lseek (s, length, MsOleSeekCur);
check_stream (s);
if (libole2_debug)
check_stream (s);
return ans;
}
......@@ -1856,7 +1864,8 @@ ms_ole_read_copy_bb (MsOleStream *s, guint8 *ptr, MsOlePos length)
blkidx++;
s->position+=cpylen;
}
check_stream (s);
if (libole2_debug)
check_stream (s);
return 1;
}
......@@ -1902,7 +1911,8 @@ ms_ole_read_copy_sb (MsOleStream *s, guint8 *ptr, MsOlePos length)
blkidx++;
s->position+=cpylen;
}
check_stream (s);
if (libole2_debug)
check_stream (s);
return 1;
}
......@@ -2013,7 +2023,9 @@ ms_ole_write_bb (MsOleStream *s, guint8 *ptr, MsOlePos length)
s->size += lengthen;
s->lseek (s, length, MsOleSeekCur);
check_stream (s);
if (libole2_debug)
check_stream (s);
return length;
}
......@@ -2100,7 +2112,9 @@ ms_ole_write_sb (MsOleStream *s, guint8 *ptr, MsOlePos length)
offset = 0;
blkidx++;
check_stream (s);
if (libole2_debug)
check_stream (s);
}
s->lseek (s, length, MsOleSeekCur);
......
......@@ -32,6 +32,7 @@ extern int ms_excel_read_debug;
extern int ms_excel_formula_debug;
extern int ms_excel_color_debug;
extern int ms_excel_chart_debug;
extern gboolean libole2_debug;
static char *dump_file_name = NULL;
static char *startup_glade_file = NULL;
......@@ -61,6 +62,10 @@ const struct poptOption gnumeric_popt_options [] = {
&ms_excel_chart_debug, 0,
N_("Enables debugging mesgs while reading excel charts"),
N_("LEVEL") },
{ "debug_ole", '\0', POPT_ARG_NONE,
&libole2_debug, 0,
N_("Enables extra consistancy checking while reading ole files"),
N_("LEVEL") },
{ NULL, '\0', 0, NULL, 0 }
};
......
......@@ -32,6 +32,7 @@ extern int ms_excel_read_debug;
extern int ms_excel_formula_debug;
extern int ms_excel_color_debug;
extern int ms_excel_chart_debug;
extern gboolean libole2_debug;
static char *dump_file_name = NULL;
static char *startup_glade_file = NULL;
......@@ -61,6 +62,10 @@ const struct poptOption gnumeric_popt_options [] = {
&ms_excel_chart_debug, 0,
N_("Enables debugging mesgs while reading excel charts"),
N_("LEVEL") },
{ "debug_ole", '\0', POPT_ARG_NONE,
&libole2_debug, 0,
N_("Enables extra consistancy checking while reading ole files"),
N_("LEVEL") },
{ NULL, '\0', 0, NULL, 0 }
};
......
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