mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
updates for rpms lots o bug fixes, index stuff
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
SUBDIRS = help gladefiles pixmaps
|
||||
bin_PROGRAMS = gmdb2
|
||||
include_HEADERS = gmdb.h debug.xpm forms.xpm macros.xpm pk.xpm \
|
||||
table.xpm query.xpm code.xpm reports.xpm
|
||||
gmdb2_SOURCES = main2.c file.c util.c table.c query.c module.c macro.c report.c form.c info.c table_def.c table_data.c table_export.c debug.c sql.c schema.c
|
||||
include_HEADERS = gmdb.h
|
||||
gmdb2_SOURCES = main2.c file.c util.c table.c query.c module.c macro.c report.c form.c info.c table_def.c table_data.c table_export.c debug.c sql.c schema.c prefs.c
|
||||
LIBS = -rdynamic $(GNOME_LIBS) @LEXLIB@
|
||||
INCLUDES = -I$(top_srcdir)/include $(GNOME_CFLAGS)
|
||||
INCLUDES = -I$(top_srcdir)/include \
|
||||
$(GNOME_CFLAGS) \
|
||||
-DDATADIR=\""$(datadir)"\" \
|
||||
-DGMDB_ICONDIR=\""$(datadir)/gmdb/pixmaps/"\" \
|
||||
-DGMDB_GLADEDIR=\""$(datadir)/gmdb/glade/"\"
|
||||
|
||||
#LDADD = ../libmdb/libmdb.la
|
||||
LDADD = ../libmdb/libmdb.la ../sql/libmdbsql.la
|
||||
#if SQL
|
||||
|
||||
@@ -887,7 +887,7 @@ gchar text[20];
|
||||
GladeXML *debugwin_xml;
|
||||
|
||||
/* load the interface */
|
||||
debugwin_xml = glade_xml_new("gladefiles/gmdb-debug.glade", NULL, NULL);
|
||||
debugwin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-debug.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(debugwin_xml);
|
||||
|
||||
@@ -942,8 +942,8 @@ GladeXML *debugwin_xml;
|
||||
GTK_SIGNAL_FUNC (gmdb_debug_delete_cb), debugwin_xml);
|
||||
|
||||
/* this should be a preference, needs to be fixed width */
|
||||
textview = glade_xml_get_widget (debugwin_xml, "debug_textview");
|
||||
gtk_widget_modify_font(textview,
|
||||
textview = (GtkTextView *) glade_xml_get_widget (debugwin_xml, "debug_textview");
|
||||
gtk_widget_modify_font(GTK_WIDGET(textview),
|
||||
pango_font_description_from_string("Courier"));
|
||||
|
||||
/* set up treeview, libglade only gives us the empty widget */
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
GtkWidget *file_selector;
|
||||
MdbHandle *mdb;
|
||||
extern int main_show_debug;
|
||||
extern GladeXML *mainwin_xml;
|
||||
|
||||
void gmdb_file_open_recent_1() { gmdb_file_open_recent("menu_recent1"); }
|
||||
void gmdb_file_open_recent_2() { gmdb_file_open_recent("menu_recent2"); }
|
||||
@@ -100,6 +101,11 @@ gmdb_file_add_recent(gchar *file_path)
|
||||
void
|
||||
gmdb_file_open(gchar *file_path)
|
||||
{
|
||||
GtkWidget *win;
|
||||
gchar *file_name;
|
||||
gchar title[100];
|
||||
int i;
|
||||
|
||||
gmdb_reset_widgets();
|
||||
mdb = mdb_open(file_path);
|
||||
if (!mdb) {
|
||||
@@ -118,13 +124,22 @@ gmdb_file_open(gchar *file_path)
|
||||
gmdb_macro_populate(mdb);
|
||||
gmdb_module_populate(mdb);
|
||||
//if (main_show_debug) gmdb_debug_init(mdb);
|
||||
|
||||
for (i=strlen(file_path);i>0 && file_path[i-1]!='/';i--);
|
||||
file_name=&file_path[i];
|
||||
|
||||
win = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "gmdb");
|
||||
g_snprintf(title, 100, "%s - MDB File Viewer",file_name);
|
||||
gtk_window_set_title(GTK_WINDOW(win), title);
|
||||
|
||||
gmdb_set_sensitive(TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_file_open_cb(GtkWidget *selector, gpointer data)
|
||||
{
|
||||
gchar *file_path;
|
||||
file_path = gtk_file_selection_get_filename (GTK_FILE_SELECTION(file_selector));
|
||||
file_path = (gchar *) gtk_file_selection_get_filename (GTK_FILE_SELECTION(file_selector));
|
||||
gmdb_file_open(file_path);
|
||||
gmdb_load_recent_files();
|
||||
}
|
||||
|
||||
@@ -26,8 +26,8 @@ gmdb_form_add_icon(gchar *text)
|
||||
{
|
||||
GnomeIconList *gil;
|
||||
|
||||
gil = glade_xml_get_widget(mainwin_xml, "form_iconlist");
|
||||
gnome_icon_list_append(gil, "form_big.xpm", text);
|
||||
gil = (GnomeIconList *) glade_xml_get_widget(mainwin_xml, "form_iconlist");
|
||||
gnome_icon_list_append(gil, GMDB_ICONDIR "form_big.xpm", text);
|
||||
}
|
||||
|
||||
void gmdb_form_populate(MdbHandle *mdb)
|
||||
|
||||
13
src/gmdb2/gladefiles/Makefile.am
Normal file
13
src/gmdb2/gladefiles/Makefile.am
Normal file
@@ -0,0 +1,13 @@
|
||||
gladedir = $(datadir)/gmdb/glade/
|
||||
|
||||
glade_DATA = \
|
||||
gmdb.glade \
|
||||
gmdb-sql.glade \
|
||||
gmdb-debug.glade \
|
||||
gmdb-export.glade \
|
||||
gmdb-schema.glade \
|
||||
gmdb-prefs.glade \
|
||||
gmdb-props.glade
|
||||
|
||||
EXTRA_DIST = $(glade_DATA)
|
||||
|
||||
124
src/gmdb2/gladefiles/gmdb-prefs.glade
Normal file
124
src/gmdb2/gladefiles/gmdb-prefs.glade
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkDialog" id="prefs_dialog">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">Preferences</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="cancel_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">-6</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="ok_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="response_id">-5</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTable" id="table1">
|
||||
<property name="border_width">10</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">1</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="row_spacing">0</property>
|
||||
<property name="column_spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes"><b>Maximum Rows to Display:</b></property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">True</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="maxrows_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char" translatable="yes">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="bottom_attach">1</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
||||
@@ -84,7 +84,7 @@
|
||||
<property name="label" translatable="yes">_Execute</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_execute1_activate" last_modification_time="Sat, 21 Dec 2002 15:31:44 GMT"/>
|
||||
<accelerator key="X" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
<accelerator key="E" modifiers="GDK_CONTROL_MASK" signal="activate"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image1">
|
||||
@@ -127,34 +127,23 @@
|
||||
<widget class="GtkMenu" id="edit1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="cut1">
|
||||
<widget class="GtkImageMenuItem" id="cut_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_CUT_ITEM</property>
|
||||
<signal name="activate" handler="on_cut1_activate" last_modification_time="Sat, 21 Dec 2002 15:25:07 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="copy1">
|
||||
<widget class="GtkImageMenuItem" id="copy_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_COPY_ITEM</property>
|
||||
<signal name="activate" handler="on_copy1_activate" last_modification_time="Sat, 21 Dec 2002 15:25:07 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="paste1">
|
||||
<widget class="GtkImageMenuItem" id="paste_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_PASTE_ITEM</property>
|
||||
<signal name="activate" handler="on_paste1_activate" last_modification_time="Sat, 21 Dec 2002 15:25:07 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="clear1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_CLEAR_ITEM</property>
|
||||
<signal name="activate" handler="on_clear1_activate" last_modification_time="Sat, 21 Dec 2002 15:25:07 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="information1">
|
||||
<widget class="GtkImageMenuItem" id="info_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_PROPERTIES_ITEM</property>
|
||||
<signal name="activate" handler="gmdb_info_cb" last_modification_time="Sat, 21 Dec 2002 16:17:18 GMT"/>
|
||||
@@ -149,7 +149,7 @@
|
||||
<widget class="GtkImageMenuItem" id="preferences1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_PREFERENCES_ITEM</property>
|
||||
<signal name="activate" handler="a_callback" last_modification_time="Fri, 20 Dec 2002 16:38:48 GMT"/>
|
||||
<signal name="activate" handler="gmdb_prefs_cb" last_modification_time="Fri, 10 Jan 2003 23:14:44 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -167,7 +167,7 @@
|
||||
<widget class="GtkMenu" id="tools1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="sql_window1">
|
||||
<widget class="GtkMenuItem" id="sql_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">S_QL Window</property>
|
||||
<property name="use_underline">True</property>
|
||||
@@ -177,14 +177,14 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="debug_window1">
|
||||
<widget class="GtkImageMenuItem" id="debug_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Debug Window</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="gmdb_debug_new_cb" last_modification_time="Sat, 21 Dec 2002 17:41:42 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image49">
|
||||
<widget class="GtkImage" id="debug_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">debug.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -197,14 +197,14 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="export_schema1">
|
||||
<widget class="GtkImageMenuItem" id="schema_menu">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">E_xport Schema</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="gmdb_schema_new_cb" last_modification_time="Sun, 29 Dec 2002 20:35:14 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image50">
|
||||
<widget class="GtkImage" id="image57">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-convert</property>
|
||||
<property name="icon_size">1</property>
|
||||
@@ -244,11 +244,23 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="contents1">
|
||||
<widget class="GtkImageMenuItem" id="contents1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Contents</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="a_callback" last_modification_time="Fri, 20 Dec 2002 16:38:48 GMT"/>
|
||||
<signal name="activate" handler="gmdb_help_cb" last_modification_time="Sat, 11 Jan 2003 14:22:04 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image58">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-help</property>
|
||||
<property name="icon_size">1</property>
|
||||
<property name="xalign">0.5</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -291,7 +303,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="button3">
|
||||
<widget class="button" id="info_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">View database file properties</property>
|
||||
<property name="label">gtk-properties</property>
|
||||
@@ -324,7 +336,7 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="button5">
|
||||
<widget class="button" id="schema_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Export schema definition</property>
|
||||
<property name="label" translatable="yes">Export Schema</property>
|
||||
@@ -406,6 +418,7 @@
|
||||
<property name="text_editable">False</property>
|
||||
<property name="text_static">True</property>
|
||||
<signal name="select_icon" handler="gmdb_table_select_cb" after="yes" last_modification_time="Fri, 20 Dec 2002 16:45:49 GMT"/>
|
||||
<signal name="unselect_icon" handler="gmdb_table_unselect_cb" after="yes" last_modification_time="Sat, 11 Jan 2003 18:27:12 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -496,7 +509,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="Tables">
|
||||
<widget class="GtkImage" id="table_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">table.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -617,7 +630,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image2">
|
||||
<widget class="GtkImage" id="query_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">query.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -738,7 +751,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image3">
|
||||
<widget class="GtkImage" id="form_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">forms.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -859,7 +872,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image4">
|
||||
<widget class="GtkImage" id="report_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">reports.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -980,7 +993,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image5">
|
||||
<widget class="GtkImage" id="macro_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">macros.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
@@ -1101,7 +1114,7 @@
|
||||
<property name="spacing">2</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImage" id="image6">
|
||||
<widget class="GtkImage" id="module_icon">
|
||||
<property name="visible">True</property>
|
||||
<property name="pixbuf">code.xpm</property>
|
||||
<property name="xalign">0.5</property>
|
||||
|
||||
@@ -18,15 +18,18 @@ extern "C" {
|
||||
void gmdb_info_msg(gchar *message);
|
||||
|
||||
GtkWidget *gmdb_info_new();
|
||||
void gmdb_set_sensitive(gboolean b);
|
||||
|
||||
GtkWidget *gmdb_table_data_new(MdbCatalogEntry *entry);
|
||||
GtkWidget *gmdb_table_def_new(MdbCatalogEntry *entry);
|
||||
GtkWidget *gmdb_table_export_new(MdbCatalogEntry *entry);
|
||||
void gmdb_table_export(MdbCatalogEntry *entry) ;
|
||||
|
||||
void gmdb_file_select_cb(GtkWidget *w, gpointer data);
|
||||
void gmdb_file_open_cb(GtkWidget *w, gpointer data);
|
||||
void gmdb_file_close_cb(GtkWidget *w, gpointer data);
|
||||
void gmdb_file_open(gchar *file_path);
|
||||
void gmdb_file_open_recent(gchar *menuname);
|
||||
|
||||
void gmdb_sql_new_window_cb(GtkWidget *w, gpointer data);
|
||||
|
||||
@@ -39,6 +42,11 @@ void gmdb_module_populate(MdbHandle *mdb);
|
||||
|
||||
void gmdb_table_add_tab(GtkWidget *notebook);
|
||||
void gmdb_debug_tab_new(GtkWidget *notebook);
|
||||
void gmdb_debug_new_cb(GtkWidget *w, gpointer *data);
|
||||
|
||||
unsigned long gmdb_prefs_get_maxrows();
|
||||
|
||||
extern GtkWidget *gmdb_prefs_new();
|
||||
|
||||
extern GtkWidget *table_list;
|
||||
extern GtkWidget *form_list;
|
||||
|
||||
8
src/gmdb2/help/C/Makefile.am
Normal file
8
src/gmdb2/help/C/Makefile.am
Normal file
@@ -0,0 +1,8 @@
|
||||
figs = \
|
||||
figures/gmdb2_window.png
|
||||
docname = gmdb
|
||||
lang = C
|
||||
omffile = gmdb-C.omf
|
||||
entities = legal.xml
|
||||
include xmldocs.make
|
||||
dist-hook: app-dist-hook
|
||||
BIN
src/gmdb2/help/C/figures/gmdb2_window.png
Normal file
BIN
src/gmdb2/help/C/figures/gmdb2_window.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
32
src/gmdb2/help/C/gmdb-C.omf
Normal file
32
src/gmdb2/help/C/gmdb-C.omf
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<omf>
|
||||
<resource>
|
||||
<creator>
|
||||
camber@ais.org (Brian Bruns)
|
||||
</creator>
|
||||
<maintainer>
|
||||
camber@ais.org (Brian Bruns)
|
||||
</maintainer>
|
||||
<title>
|
||||
gmdb Manual V1.0
|
||||
</title>
|
||||
<date>
|
||||
2003-01-10
|
||||
</date>
|
||||
<version identifier="1.0" date="2003-01-10"
|
||||
description="Inital revision, program version 0.2"/>
|
||||
<subject category="GNOME|Applications"/>
|
||||
<description>
|
||||
User manual for gmdb2.
|
||||
</description>
|
||||
<type>
|
||||
user's guide
|
||||
</type>
|
||||
<format mime="text/xml" dtd="-//OASIS//DTD DocBook XML V4.1.2//EN"/>
|
||||
<identifier url="gmdb.xml"/>
|
||||
<language code="C"/>
|
||||
<relation seriesid="081c7e56-2acd-11d6-819f-e6a1118e62db"/>
|
||||
<rights type="GNU FDL" license.version="1.1"
|
||||
holder="Brian Bruns"/>
|
||||
</resource>
|
||||
</omf>
|
||||
310
src/gmdb2/help/C/gmdb.xml
Normal file
310
src/gmdb2/help/C/gmdb.xml
Normal file
@@ -0,0 +1,310 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
|
||||
[
|
||||
<!ENTITY legal SYSTEM "legal.xml">
|
||||
<!ENTITY appversion "0.5">
|
||||
<!ENTITY manrevision "1.0">
|
||||
<!ENTITY date "January 2003">
|
||||
<!ENTITY app "gmdb2">
|
||||
]>
|
||||
<!--
|
||||
<!DOCTYPE Book PUBLIC "-//GNOME//DTD DocBook PNG Variant
|
||||
V1.1//EN"
|
||||
-->
|
||||
<!--
|
||||
(Do not remove this comment block.)
|
||||
Maintained by the GNOME Documentation Project
|
||||
http://developer.GNOME.org/projects/gdp
|
||||
Template version: 2.0 beta
|
||||
Template last modified Jan 30, 2002
|
||||
-->
|
||||
<!-- =============Document Header ============================= -->
|
||||
<article id="index" lang="en">
|
||||
<!-- please do not change the id; for translations, change lang to -->
|
||||
<!-- appropriate code -->
|
||||
<articleinfo>
|
||||
<title>&app; Manual V&manrevision;</title>
|
||||
<copyright>
|
||||
<year>2003</year>
|
||||
<holder>Brian Bruns</holder> </copyright>
|
||||
|
||||
<!-- translators: uncomment this:
|
||||
|
||||
<copyright>
|
||||
<year>2002</year>
|
||||
<holder>ME-THE-TRANSLATOR (Latin translation)</holder>
|
||||
</copyright>
|
||||
|
||||
-->
|
||||
<publisher>
|
||||
<publishername> MDB Tools Project </publishername>
|
||||
</publisher>
|
||||
&legal;
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Brian</firstname>
|
||||
<surname>Bruns</surname>
|
||||
<affiliation>
|
||||
<orgname>MDB Tools Project</orgname>
|
||||
<address> <email>camber@ais.org</email> </address>
|
||||
</affiliation>
|
||||
</author>
|
||||
<!-- This is appropriate place for other contributors: translators,
|
||||
maintainers, etc. Commented out by default.
|
||||
<othercredit role="translator">
|
||||
<firstname>Latin</firstname>
|
||||
<surname>Translator 1</surname>
|
||||
<affiliation>
|
||||
<orgname>Latin Translation Team</orgname>
|
||||
<address> <email>translator@gnome.org</email> </address>
|
||||
</affiliation>
|
||||
<contrib>Latin translation</contrib>
|
||||
</othercredit>
|
||||
-->
|
||||
</authorgroup>
|
||||
|
||||
|
||||
<!-- According to GNU FDL, revision history is mandatory if you are -->
|
||||
<!-- modifying/reusing someone else's document. If not, you can omit it. -->
|
||||
<revhistory>
|
||||
<!-- Remember to remove the &manrevision; entity from the revision entries other
|
||||
than the current revision. -->
|
||||
<revision>
|
||||
<revnumber>gmdb V0.5</revnumber>
|
||||
<date>2000</date>
|
||||
<revdescription>
|
||||
<para role="author">Brian Bruns<email>camber@ais.org</email>
|
||||
</para>
|
||||
<para role="publisher">MDB Tools Project</para>
|
||||
</revdescription>
|
||||
</revision>
|
||||
</revhistory>
|
||||
<releaseinfo> This manual describes version &appversion; of &app;.
|
||||
</releaseinfo>
|
||||
<legalnotice>
|
||||
<title>Feedback</title>
|
||||
<para> To report a bug or make a suggestion regarding this application or
|
||||
this manual, follow the directions in this
|
||||
<ulink url="ghelp:gnome-feedback" type="help">document</ulink>. </para>
|
||||
<!-- Translators may also add here feedback address for translations -->
|
||||
</legalnotice>
|
||||
</articleinfo>
|
||||
<indexterm><primary>gmdb2</primary></indexterm>
|
||||
|
||||
<!-- ============= Document Body ============================= -->
|
||||
<!-- ============= Introduction ============================== -->
|
||||
<sect1 id="gmdb-intro">
|
||||
<title>Introduction</title>
|
||||
<para>The <application>&app;</application> application is the graphical
|
||||
interface to MDB Tools. You can use <application>&app;</application>
|
||||
to view and export data and schema from MDB databases.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- ============= Getting Started =========================== -->
|
||||
<sect1 id="gmdb-getting-started">
|
||||
<title>Getting Started</title>
|
||||
|
||||
<!-- ============= To Start gmdb2 ============================ -->
|
||||
<sect2 id="gmdb-to-start">
|
||||
<title>To Start &app; from the Command Line</title>
|
||||
<para>To start <application>&app;</application> from the command line, type the following command, then press <keycap>Return</keycap>:</para>
|
||||
<para><command>gmdb2 </command></para>
|
||||
|
||||
<!-- ==== Figure ==== -->
|
||||
<figure id="gmdb-window">
|
||||
<title>&app; Window</title>
|
||||
<screenshot>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="figures/gmdb2_window.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<textobject> <phrase>Screenshot of the gmdb2 main window.</phrase>
|
||||
</textobject> </mediaobject>
|
||||
</screenshot>
|
||||
</figure>
|
||||
<!-- ==== End of Figure ==== -->
|
||||
<para>The <application>&app;</application> window contains the following
|
||||
elements: </para>
|
||||
<variablelist>
|
||||
<varlistentry> <term>Menubar. </term>
|
||||
<listitem>
|
||||
<para>The menus on the menubar contain all of the commands you need
|
||||
to work with databases in <application>&app;</application>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry> <term>Toolbar. </term>
|
||||
<listitem>
|
||||
<para> The toolbar contains a subset of the commands that you can
|
||||
access from the menubar.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry> <term>Tabbed window. </term>
|
||||
<listitem>
|
||||
<para>
|
||||
The tabbed window contains a tab for each type of object in the database. Within
|
||||
these, a listing of those objects will be displayed along with buttons along the
|
||||
left hand side for performing common actions specific to that type of object.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry> <term>Statusbar. </term>
|
||||
<listitem>
|
||||
<para>The statusbar displays information about current
|
||||
<application>&app; </application> activity and contextual information about the
|
||||
menu items. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
When you right-click on any icon in the <application>&app;</application>
|
||||
icon list, the application displays a popup menu. The popup menu contains the
|
||||
full list of available actions that may be performed on that object.
|
||||
</para>
|
||||
</sect2>
|
||||
<!-- ============= To Open a File ============================= -->
|
||||
<sect2 id="gmdb-open-file">
|
||||
<title>To Open a File</title>
|
||||
<para>To open a file, choose
|
||||
<menuchoice> <guimenu>File</guimenu> <guimenuitem>Open</guimenuitem>
|
||||
</menuchoice>
|
||||
to display the <guilabel>Open File</guilabel> dialog. Select the file
|
||||
that you want to open, then click <guibutton>OK</guibutton>. The file is
|
||||
displayed in the <application>&app;</application> window. </para>
|
||||
<para>The application also records the paths and file names of the last
|
||||
four files that you edited and displays them as menu items on the <guimenu>File
|
||||
</guimenu> menu. To open one of the last four files, choose for example
|
||||
<menuchoice> <guimenu>File</guimenu> <guimenuitem>1.
|
||||
<replaceable>/path/filename</replaceable></guimenuitem> </menuchoice>.</para>
|
||||
</sect2>
|
||||
<!-- ============= To Open Multiple Files from the Command Line ========= -->
|
||||
<sect2 id="gmdb-run-from-cmd-line">
|
||||
<title>To Open Files from a Command Line</title>
|
||||
<para>You can run <application>&app;</application> from a command line
|
||||
and open a file. To open a file from a command
|
||||
line, type the following command, then press <keycap>Return</keycap>:</para>
|
||||
<para><command>gmdb2 file1.mdb</command></para>
|
||||
<para>When the application starts, the file that you specified is
|
||||
displayed in the <application>&app;</application> window.</para>
|
||||
<para><application>&app;</application> uses the environment variable MDBPATH when looking for the specified file. If set <application>&app;</application>will search each directory component until the file is found.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- ================ Usage ================================ -->
|
||||
<sect1 id="gmdb-usage">
|
||||
<title>Usage</title>
|
||||
|
||||
<!-- ============= Get the Properties of a File ======================= -->
|
||||
<sect2 id="gmdb-props">
|
||||
<title>To Display the Properties of a Database</title>
|
||||
<para>To display the properties of a database, perform
|
||||
the following steps:</para>
|
||||
<orderedlist>
|
||||
<listitem><para>Choose
|
||||
<menuchoice> <guimenu>File</guimenu> <guimenuitem>Properties </guimenuitem> </menuchoice></para></listitem>
|
||||
</orderedlist>
|
||||
</sect2>
|
||||
<!-- ============= Exporting Schema ======================= -->
|
||||
<sect2 id="gmdb-schema">
|
||||
<title>To Export the Schema of a Database</title>
|
||||
<para>To export the schema of the current database,
|
||||
Choose <menuchoice> <guimenu>Tools</guimenu> <guimenuitem>Export Schema </guimenuitem> </menuchoice> and perform the following steps:</para>
|
||||
<orderedlist>
|
||||
<listitem><para>Select the filename to save the schema in.</para></listitem>
|
||||
<listitem><para>If you want to only export one table, select it.</para></listitem>
|
||||
<listitem><para>Choose the SQL dialect of the target database backend.</para></listitem>
|
||||
<listitem><para>Check desired schema options.</para></listitem>
|
||||
<listitem><para>Click <guibutton>Export</guibutton>.</para></listitem>
|
||||
</orderedlist>
|
||||
<para>Checking the <guilabel>Include Relationships</guilabel> box will generate foreign key relationships if they are supported by the database.</para>
|
||||
<para>Checking the <guilabel>Include Drop Table commands</guilabel> will generate the commands to drop the tables before creating new tables.</para>
|
||||
</sect2>
|
||||
<!-- ============= Opening SQL Window ======================= -->
|
||||
<sect2 id="gmdb-sql">
|
||||
<title>To Open a SQL Query Window</title>
|
||||
<para>The <guilabel>SQL Query</guilabel> window allows you enter SQL queries and to execute and view the results.</para>
|
||||
<para>To open the <guilabel>SQL Query</guilabel> window, perform the following steps.</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Choose <menuchoice> <guimenu>Tools</guimenu> <guimenuitem>SQL Window </guimenuitem> </menuchoice>
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</sect2>
|
||||
<!-- ============= Opening Debug Window ======================= -->
|
||||
<sect2 id="gmdb-debug">
|
||||
<title>To Open a File Debugger Window</title>
|
||||
<para>The <guilabel>File Debugger</guilabel> window allows you enter SQL queries and to execute and view the results.</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Choose <menuchoice> <guimenu>Tools</guimenu> <guimenuitem>Debug Window </guimenuitem> </menuchoice>
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- ============= Tables Window ============================= -->
|
||||
<sect1 id="gmdb-tables">
|
||||
<title>Table Actions</title>
|
||||
<para>To perform actions on a table choose the <guilabel>Tables</guilabel> tab from the main window.</para>
|
||||
|
||||
<sect2 id="gmdb-tables-def">
|
||||
<title>Table Definition</title>
|
||||
<para>To view the definition of a table, perform the following actions</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Locate the desired table in the tables icon list.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Select the tables icon.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Click on the <guibutton>Definition</guibutton> button from the right hand side of the icon list.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
<para>
|
||||
Columns participating in a Primary Key will have an icon of a gold key and the letters PK at the left side of the column.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="gmdb-table-data">
|
||||
<title>Data View</title>
|
||||
<para>The <guilabel>Data</guilabel> view displays a grid of the data in a table.</para>
|
||||
<para>To display the table data, perform the following steps</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Locate the desired table in the tables icon list.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Select the tables icon.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Click on the <guibutton>Data</guibutton> button from the right hand side of the icon list.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
</sect2>
|
||||
<sect2 id="gmdb-table-export">
|
||||
<title>Data Export</title>
|
||||
<para>The <guilabel>Export</guilabel> button creates a text file containing the data from a single data.</para>
|
||||
<para>To export the table data, perform the following steps</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Locate the desired table in the tables icon list.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Select the tables icon.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Click on the <guibutton>Export</guibutton> button from the right hand side of the icon list to display the <guilabel>Export Table</guilabel> window.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Select the filename to save the data in.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Fill in dialog with desired characteristics of the export file.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Click <guibutton>Export</guibutton>.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
<para>Checking the <guilabel>Include Headers</guilabel> box will write a single row at the top of the file with the names of the columns.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</article>
|
||||
76
src/gmdb2/help/C/legal.xml
Normal file
76
src/gmdb2/help/C/legal.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<legalnotice id="legalnotice">
|
||||
<para>
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation
|
||||
License (GFDL), Version 1.1 or any later version published
|
||||
by the Free Software Foundation with no Invariant Sections,
|
||||
no Front-Cover Texts, and no Back-Cover Texts. You can find
|
||||
a copy of the GFDL at this <ulink type="help"
|
||||
url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS
|
||||
distributed with this manual.
|
||||
</para>
|
||||
<para> This manual is part of a collection of GNOME manuals
|
||||
distributed under the GFDL. If you want to distribute this
|
||||
manual separately from the collection, you can do so by
|
||||
adding a copy of the license to the manual, as described in
|
||||
section 6 of the license.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Many of the names used by companies to distinguish their
|
||||
products and services are claimed as trademarks. Where those
|
||||
names appear in any GNOME documentation, and the members of
|
||||
the GNOME Documentation Project are made aware of those
|
||||
trademarks, then the names are in capital letters or initial
|
||||
capital letters.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED
|
||||
UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE
|
||||
WITH THE FURTHER UNDERSTANDING THAT:
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
|
||||
IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
|
||||
THAT THE DOCUMENT OR MODIFIED VERSION OF THE
|
||||
DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR
|
||||
A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
|
||||
RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE
|
||||
OF THE DOCUMENT OR MODIFIED VERSION OF THE
|
||||
DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR
|
||||
MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,
|
||||
YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY
|
||||
CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
|
||||
SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
|
||||
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
|
||||
LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED
|
||||
VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER
|
||||
EXCEPT UNDER THIS DISCLAIMER; AND
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
|
||||
THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE),
|
||||
CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
|
||||
INITIAL WRITER, ANY CONTRIBUTOR, OR ANY
|
||||
DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
|
||||
OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
|
||||
PARTIES, BE LIABLE TO ANY PERSON FOR ANY
|
||||
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
|
||||
CONSEQUENTIAL DAMAGES OF ANY CHARACTER
|
||||
INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
|
||||
OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
|
||||
MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
|
||||
LOSSES ARISING OUT OF OR RELATING TO USE OF THE
|
||||
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT,
|
||||
EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGES.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
</legalnotice>
|
||||
|
||||
86
src/gmdb2/help/C/xmldocs.make
Normal file
86
src/gmdb2/help/C/xmldocs.make
Normal file
@@ -0,0 +1,86 @@
|
||||
# To use this template:
|
||||
# 1) Define: figs, docname, lang, omffile, entities although figs,
|
||||
# omffile, and entities may be empty in your Makefile.am which
|
||||
# will "include" this one
|
||||
# 2) Figures must go under figures/ and be in PNG format
|
||||
# 3) You should only have one document per directory
|
||||
#
|
||||
# Note that this makefile forces the directory name under
|
||||
# $prefix/share/gnome/help/ to be the same as the XML filename
|
||||
# of the document. This is required by GNOME. eg:
|
||||
# $prefix/share/gnome/help/fish_applet/C/fish_applet.xml
|
||||
# ^^^^^^^^^^^ ^^^^^^^^^^^
|
||||
# Definitions:
|
||||
# figs A list of screenshots which will be included in EXTRA_DIST
|
||||
# Note that these should reside in figures/ and should be .png
|
||||
# files, or you will have to make modifications below.
|
||||
# docname This is the name of the XML file: <docname>.xml
|
||||
# lang This is the document locale
|
||||
# omffile This is the name of the OMF file. Convention is to name
|
||||
# it <docname>-<locale>.omf.
|
||||
# entities This is a list of XML entities which must be installed
|
||||
# with the main XML file and included in EXTRA_DIST.
|
||||
# eg:
|
||||
# figs = \
|
||||
# figures/fig1.png \
|
||||
# figures/fig2.png
|
||||
# docname = scrollkeeper-manual
|
||||
# lang = C
|
||||
# omffile=scrollkeeper-manual-C.omf
|
||||
# entities = fdl.xml
|
||||
# include $(top_srcdir)/help/xmldocs.make
|
||||
# dist-hook: app-dist-hook
|
||||
#
|
||||
|
||||
docdir = $(datadir)/gnome/help/$(docname)/$(lang)
|
||||
|
||||
xml_files = $(entities) $(docname).xml
|
||||
|
||||
omf_dir=$(top_srcdir)/omf-install
|
||||
|
||||
EXTRA_DIST = xmldocs.make $(xml_files) $(omffile) $(figs)
|
||||
|
||||
CLEANFILES = omf_timestamp
|
||||
|
||||
all: omf
|
||||
|
||||
omf: omf_timestamp
|
||||
|
||||
omf_timestamp: $(omffile)
|
||||
-for file in $(omffile); do \
|
||||
scrollkeeper-preinstall $(docdir)/`awk 'BEGIN {RS = ">" } /identifier/ {print $$0}' $${file} | awk 'BEGIN {FS="\""} /url/ {print $$2}'` $${file} $(omf_dir)/$${file}; \
|
||||
done
|
||||
touch omf_timestamp
|
||||
|
||||
$(docname).xml: $(entities)
|
||||
ourdir=`pwd`; \
|
||||
cd $(srcdir); \
|
||||
cp $(entities) $$ourdir
|
||||
|
||||
app-dist-hook:
|
||||
-$(mkinstalldirs) $(distdir)/figures
|
||||
-if [ -e topic.dat ]; then \
|
||||
cp $(srcdir)/topic.dat $(distdir); \
|
||||
fi
|
||||
|
||||
install-data-am: omf
|
||||
-$(mkinstalldirs) $(DESTDIR)$(docdir)/figures
|
||||
-cp $(srcdir)/$(xml_files) $(DESTDIR)$(docdir)
|
||||
-for file in $(srcdir)/figures/*.png; do \
|
||||
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/figures/$$basefile; \
|
||||
done
|
||||
-if [ -e $(srcdir)/topic.dat ]; then \
|
||||
$(INSTALL_DATA) $(srcdir)/topic.dat $(DESTDIR)$(docdir); \
|
||||
fi
|
||||
|
||||
uninstall-local:
|
||||
-for file in $(srcdir)/figures/*.png; do \
|
||||
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
|
||||
rm -f $(docdir)/figures/$$basefile; \
|
||||
done
|
||||
-for file in $(xml_files); do \
|
||||
rm -f $(DESTDIR)$(docdir)/$$file; \
|
||||
done
|
||||
-rmdir $(DESTDIR)$(docdir)/figures
|
||||
-rmdir $(DESTDIR)$(docdir)
|
||||
3
src/gmdb2/help/Makefile.am
Normal file
3
src/gmdb2/help/Makefile.am
Normal file
@@ -0,0 +1,3 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
SUBDIRS = C
|
||||
@@ -39,7 +39,7 @@ int i;
|
||||
struct stat st;
|
||||
|
||||
/* load the interface */
|
||||
propswin_xml = glade_xml_new("gladefiles/gmdb-props.glade", NULL, NULL);
|
||||
propswin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-props.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(propswin_xml);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ gmdb_macro_add_icon(gchar *text)
|
||||
GnomeIconList *gil;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "macro_iconlist");
|
||||
gnome_icon_list_append(gil, "macro_big.xpm", text);
|
||||
gnome_icon_list_append(gil, GMDB_ICONDIR "macro_big.xpm", text);
|
||||
}
|
||||
|
||||
void gmdb_macro_populate(MdbHandle *mdb)
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include <gnome.h>
|
||||
#include <libgnome/gnome-help.h>
|
||||
#include <glade/glade.h>
|
||||
#include <mdbtools.h>
|
||||
#include <mdbsql.h>
|
||||
#include "gmdb.h"
|
||||
|
||||
GtkWidget *app;
|
||||
GladeXML *mainwin_xml;
|
||||
@@ -48,7 +50,7 @@ const gchar *documenters[] = {
|
||||
};
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file ("logo.xpm", NULL);
|
||||
pixbuf = gdk_pixbuf_new_from_file (GMDB_ICONDIR "logo.xpm", NULL);
|
||||
|
||||
gtk_widget_show (gnome_about_new ("Gnome MDB Viewer", "0.2",
|
||||
"Copyright 2002-2003 Brian Bruns",
|
||||
@@ -56,11 +58,16 @@ gtk_widget_show (gnome_about_new ("Gnome MDB Viewer", "0.2",
|
||||
"MDB Tools. It lets you view and export data and schema"
|
||||
"from MDB files produced by MS Access 97/2000/XP."),
|
||||
(const gchar **) authors,
|
||||
(const gchar **) authors,
|
||||
(const gchar **) documenters,
|
||||
NULL,
|
||||
pixbuf));
|
||||
}
|
||||
void
|
||||
gmdb_prefs_cb(GtkWidget *button, gpointer data)
|
||||
{
|
||||
gmdb_prefs_new();
|
||||
}
|
||||
void
|
||||
gmdb_info_cb(GtkWidget *button, gpointer data)
|
||||
{
|
||||
gmdb_info_new();
|
||||
@@ -75,6 +82,19 @@ a_callback(GtkWidget *button, gpointer data)
|
||||
/*just print a string so that we know we got there*/
|
||||
g_print("Inside Callback\n");
|
||||
}
|
||||
void
|
||||
gmdb_help_cb(GtkWidget *button, gpointer data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_print("got here\n");
|
||||
gnome_help_display("gmdb.xml", NULL, &error);
|
||||
if (error != NULL) {
|
||||
g_warning (error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void gmdb_load_recent_files()
|
||||
{
|
||||
@@ -106,11 +126,12 @@ gchar *text, *text2;
|
||||
void
|
||||
gmdb_reset_widgets()
|
||||
{
|
||||
GnomeIconList *gil;
|
||||
int pos;
|
||||
GnomeIconList *gil;
|
||||
GtkWidget *win;
|
||||
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "table_iconlist");
|
||||
gnome_icon_list_clear(gil);
|
||||
gmdb_table_set_sensitive(FALSE);
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "query_iconlist");
|
||||
gnome_icon_list_clear(gil);
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "form_iconlist");
|
||||
@@ -121,6 +142,38 @@ int pos;
|
||||
gnome_icon_list_clear(gil);
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "module_iconlist");
|
||||
gnome_icon_list_clear(gil);
|
||||
|
||||
win = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "gmdb");
|
||||
gtk_window_set_title(GTK_WINDOW(win), "MDB File Viewer");
|
||||
gmdb_set_sensitive(FALSE);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_set_sensitive(gboolean b)
|
||||
{
|
||||
GtkWidget *mi, *button;
|
||||
|
||||
mi = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "sql_menu");
|
||||
gtk_widget_set_sensitive(mi,b);
|
||||
|
||||
mi = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "debug_menu");
|
||||
gtk_widget_set_sensitive(mi,b);
|
||||
|
||||
mi = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "schema_menu");
|
||||
gtk_widget_set_sensitive(mi,b);
|
||||
|
||||
mi = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "info_menu");
|
||||
gtk_widget_set_sensitive(mi,b);
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "sql_button");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "schema_button");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "info_button");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
}
|
||||
|
||||
void gmdb_init_popups()
|
||||
@@ -128,9 +181,50 @@ void gmdb_init_popups()
|
||||
gmdb_table_init_popup();
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_load_icons(GladeXML *xml)
|
||||
{
|
||||
GtkWidget *icon;
|
||||
char file[256];
|
||||
GValue value = { 0, };
|
||||
int i = 0;
|
||||
|
||||
char *icons[] = {
|
||||
"table_icon",
|
||||
"query_icon",
|
||||
"form_icon",
|
||||
"report_icon",
|
||||
"macro_icon",
|
||||
"module_icon",
|
||||
"debug_icon",
|
||||
NULL
|
||||
};
|
||||
char *files[] = {
|
||||
"table.xpm",
|
||||
"query.xpm",
|
||||
"forms.xpm",
|
||||
"reports.xpm",
|
||||
"macros.xpm",
|
||||
"code.xpm",
|
||||
"debug.xpm",
|
||||
NULL
|
||||
};
|
||||
|
||||
while (icons[i]) {
|
||||
icon = glade_xml_get_widget (xml, icons[i]);
|
||||
|
||||
g_value_init (&value, G_TYPE_STRING);
|
||||
g_snprintf(file,256,"%s%s", GMDB_ICONDIR, files[i]);
|
||||
g_value_set_static_string (&value, file);
|
||||
g_object_set_property (G_OBJECT (icon), "file" , &value);
|
||||
g_value_unset (&value);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GtkWidget *gmdb;
|
||||
GnomeProgram *program;
|
||||
|
||||
#ifdef SQL
|
||||
/* initialize the SQL engine */
|
||||
@@ -140,13 +234,21 @@ GtkWidget *gmdb;
|
||||
mdb_init();
|
||||
|
||||
/* Initialize GNOME */
|
||||
gnome_init ("gmdb2", "0.2", argc, argv);
|
||||
app = gnome_app_new ("gmdb2", "Gnome-MDB File Viewer");
|
||||
/* Initialize gnome program */
|
||||
program = gnome_program_init ("gmdb", "0.2",
|
||||
LIBGNOMEUI_MODULE, argc, argv,
|
||||
GNOME_PARAM_POPT_TABLE, NULL,
|
||||
GNOME_PARAM_HUMAN_READABLE_NAME,
|
||||
_("Gnome-MDB File Viewer"),
|
||||
GNOME_PARAM_APP_DATADIR, DATADIR,
|
||||
NULL);
|
||||
//gnome_init ("gmdb", "0.2", argc, argv);
|
||||
//app = gnome_app_new ("gmdb", "Gnome-MDB File Viewer");
|
||||
|
||||
glade_init();
|
||||
|
||||
/* load the interface */
|
||||
mainwin_xml = glade_xml_new("gladefiles/gmdb.glade", NULL, NULL);
|
||||
mainwin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(mainwin_xml);
|
||||
|
||||
@@ -154,8 +256,12 @@ GtkWidget *gmdb;
|
||||
gtk_signal_connect (GTK_OBJECT (gmdb), "delete_event",
|
||||
GTK_SIGNAL_FUNC (delete_event), NULL);
|
||||
|
||||
gmdb_load_icons(mainwin_xml);
|
||||
|
||||
if (argc>1) {
|
||||
gmdb_file_open(argv[1]);
|
||||
} else {
|
||||
gmdb_reset_widgets();
|
||||
}
|
||||
|
||||
gmdb_load_recent_files();
|
||||
|
||||
@@ -27,7 +27,7 @@ gmdb_module_add_icon(gchar *text)
|
||||
GnomeIconList *gil;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "module_iconlist");
|
||||
gnome_icon_list_append(gil, "module_big.xpm", text);
|
||||
gnome_icon_list_append(gil, GMDB_ICONDIR "module_big.xpm", text);
|
||||
}
|
||||
|
||||
void gmdb_module_populate(MdbHandle *mdb)
|
||||
|
||||
21
src/gmdb2/pixmaps/Makefile.am
Normal file
21
src/gmdb2/pixmaps/Makefile.am
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
appicondir = $(datadir)/gmdb/pixmaps
|
||||
|
||||
appicon_DATA = \
|
||||
pk.xpm \
|
||||
logo.xpm \
|
||||
debug.xpm \
|
||||
table.xpm \
|
||||
query.xpm \
|
||||
forms.xpm \
|
||||
reports.xpm \
|
||||
macros.xpm \
|
||||
code.xpm \
|
||||
table_big.xpm \
|
||||
query_big.xpm \
|
||||
form_big.xpm \
|
||||
report_big.xpm \
|
||||
macro_big.xpm \
|
||||
module_big.xpm
|
||||
|
||||
EXTRA_DIST = $(appicon_DATA)
|
||||
92
src/gmdb2/prefs.c
Normal file
92
src/gmdb2/prefs.c
Normal file
@@ -0,0 +1,92 @@
|
||||
/* MDB Tools - A library for reading MS Access database file
|
||||
* Copyright (C) 2000 Brian Bruns
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "gmdb.h"
|
||||
|
||||
extern GtkWidget *app;
|
||||
extern MdbHandle *mdb;
|
||||
|
||||
GladeXML *prefswin_xml;
|
||||
|
||||
unsigned long
|
||||
gmdb_prefs_get_maxrows()
|
||||
{
|
||||
gchar *str;
|
||||
|
||||
str = gnome_config_get_string("/gmdb/prefs/maxrows");
|
||||
if (!str || !strlen(str))
|
||||
return 1000;
|
||||
else
|
||||
return atol(str);
|
||||
}
|
||||
|
||||
/* callbacks */
|
||||
void
|
||||
gmdb_prefs_save_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkWidget *entry;
|
||||
GtkWidget *win;
|
||||
gchar *str;
|
||||
|
||||
entry = glade_xml_get_widget (xml, "maxrows_entry");
|
||||
str = (gchar *) gtk_entry_get_text(GTK_ENTRY(entry));
|
||||
printf("str = %s\n",str);
|
||||
gnome_config_set_string("/gmdb/prefs/maxrows", str);
|
||||
gnome_config_sync();
|
||||
win = glade_xml_get_widget (xml, "prefs_dialog");
|
||||
if (win) gtk_widget_destroy(win);
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_prefs_cancel_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkWidget *win;
|
||||
|
||||
win = glade_xml_get_widget (xml, "prefs_dialog");
|
||||
if (win) gtk_widget_destroy(win);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gmdb_prefs_new()
|
||||
{
|
||||
GtkWidget *prefswin, *button;
|
||||
GtkWidget *entry;
|
||||
gchar *str;
|
||||
|
||||
/* load the interface */
|
||||
prefswin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-prefs.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(prefswin_xml);
|
||||
|
||||
entry = glade_xml_get_widget (prefswin_xml, "maxrows_entry");
|
||||
|
||||
button = glade_xml_get_widget (prefswin_xml, "cancel_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (gmdb_prefs_cancel_cb), prefswin_xml);
|
||||
|
||||
button = glade_xml_get_widget (prefswin_xml, "ok_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (gmdb_prefs_save_cb), prefswin_xml);
|
||||
|
||||
str = gnome_config_get_string("/gmdb/prefs/maxrows");
|
||||
if (!str || !strlen(str)) {
|
||||
str = "1000";
|
||||
gnome_config_set_string("/gmdb/prefs/maxrows", str);
|
||||
gnome_config_sync();
|
||||
}
|
||||
gtk_entry_set_text(GTK_ENTRY(entry), str);
|
||||
}
|
||||
@@ -28,7 +28,7 @@ gmdb_query_add_icon(gchar *text)
|
||||
GnomeIconList *gil;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "query_iconlist");
|
||||
gnome_icon_list_append(gil, "query_big.xpm", text);
|
||||
gnome_icon_list_append(gil, GMDB_ICONDIR "query_big.xpm", text);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ gmdb_report_add_icon(gchar *text)
|
||||
{
|
||||
GnomeIconList *gil;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "report_iconlist");
|
||||
gnome_icon_list_append(gil, "report_big.xpm", text);
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "report_iconlist");
|
||||
gnome_icon_list_append(gil, GMDB_ICONDIR "report_big.xpm", text);
|
||||
}
|
||||
|
||||
void gmdb_report_populate(MdbHandle *mdb)
|
||||
|
||||
@@ -163,7 +163,7 @@ MdbCatalogEntry *entry;
|
||||
int i;
|
||||
|
||||
/* load the interface */
|
||||
schemawin_xml = glade_xml_new("gladefiles/gmdb-schema.glade", NULL, NULL);
|
||||
schemawin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-schema.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(schemawin_xml);
|
||||
|
||||
|
||||
@@ -53,6 +53,42 @@ gmdb_sql_close_all()
|
||||
|
||||
/* callbacks */
|
||||
void
|
||||
gmdb_sql_copy_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkTextBuffer *txtbuffer;
|
||||
GtkClipboard *clipboard;
|
||||
GtkWidget *textview;
|
||||
|
||||
textview = glade_xml_get_widget(xml, "sql_textview");
|
||||
clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
txtbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||
gtk_text_buffer_copy_clipboard(txtbuffer, clipboard);
|
||||
}
|
||||
void
|
||||
gmdb_sql_cut_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkTextBuffer *txtbuffer;
|
||||
GtkClipboard *clipboard;
|
||||
GtkWidget *textview;
|
||||
|
||||
textview = glade_xml_get_widget(xml, "sql_textview");
|
||||
clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
txtbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||
gtk_text_buffer_cut_clipboard(txtbuffer, clipboard, TRUE);
|
||||
}
|
||||
void
|
||||
gmdb_sql_paste_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkTextBuffer *txtbuffer;
|
||||
GtkClipboard *clipboard;
|
||||
GtkWidget *textview;
|
||||
|
||||
textview = glade_xml_get_widget(xml, "sql_textview");
|
||||
clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
txtbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
|
||||
gtk_text_buffer_paste_clipboard(txtbuffer, clipboard, NULL, TRUE);
|
||||
}
|
||||
void
|
||||
gmdb_sql_close_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkWidget *win;
|
||||
@@ -73,7 +109,7 @@ gchar *name;
|
||||
GtkTreeSelection *select;
|
||||
GtkTreeStore *store;
|
||||
GtkTreeView *tree;
|
||||
GtkTreeIter *iter, iter2;
|
||||
GtkTreeIter iter2;
|
||||
|
||||
tree = (GtkTreeView *) glade_xml_get_widget(xml, "sql_treeview");
|
||||
select = gtk_tree_view_get_selection(GTK_TREE_VIEW (tree));
|
||||
@@ -99,10 +135,9 @@ void gmdb_sql_dnd_datareceived_cb(
|
||||
guint info, guint t,
|
||||
GladeXML *xml)
|
||||
{
|
||||
gchar *buf, *lastbuf;
|
||||
GtkTextIter iter, start, end;
|
||||
gchar *buf;
|
||||
GtkTextIter iter;
|
||||
GtkTextBuffer *txtbuffer;
|
||||
int len;
|
||||
GtkWidget *textview;
|
||||
|
||||
textview = glade_xml_get_widget(xml, "sql_textview");
|
||||
@@ -144,6 +179,7 @@ GList *history;
|
||||
GType *gtypes;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeViewColumn *column;
|
||||
long row, maxrow;
|
||||
|
||||
/* stuff this query on the history */
|
||||
textview = glade_xml_get_widget(xml, "sql_textview");
|
||||
@@ -177,7 +213,7 @@ GtkTreeViewColumn *column;
|
||||
for (i=0;i<sql->num_columns;i++)
|
||||
gtypes[i]=G_TYPE_STRING;
|
||||
|
||||
store = gtk_tree_view_get_model(treeview);
|
||||
store = (GtkTreeStore *) gtk_tree_view_get_model(treeview);
|
||||
if (store) {
|
||||
i=0;
|
||||
while (column = gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), i)) {
|
||||
@@ -202,7 +238,12 @@ GtkTreeViewColumn *column;
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW (treeview), column);
|
||||
}
|
||||
|
||||
while(mdb_fetch_row(sql->cur_table)) {
|
||||
maxrow = gmdb_prefs_get_maxrows();
|
||||
|
||||
row = 0;
|
||||
while(mdb_fetch_row(sql->cur_table) &&
|
||||
(!maxrow || (row < maxrow))) {
|
||||
row++;
|
||||
gtk_list_store_append(GTK_LIST_STORE(store), &iter);
|
||||
for (i=0;i<sql->num_columns;i++) {
|
||||
gtk_list_store_set(GTK_LIST_STORE(store),
|
||||
@@ -228,12 +269,24 @@ GtkWidget *mi, *but;
|
||||
GladeXML *sqlwin_xml;
|
||||
|
||||
/* load the interface */
|
||||
sqlwin_xml = glade_xml_new("gladefiles/gmdb-sql.glade", NULL, NULL);
|
||||
sqlwin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-sql.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(sqlwin_xml);
|
||||
|
||||
sql_list = g_list_append(sql_list, sqlwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (sqlwin_xml, "paste_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_sql_paste_cb), sqlwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (sqlwin_xml, "cut_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_sql_cut_cb), sqlwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (sqlwin_xml, "copy_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_sql_copy_cb), sqlwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (sqlwin_xml, "close_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_sql_close_cb), sqlwin_xml);
|
||||
@@ -295,7 +348,7 @@ gmdb_sql_tree_populate(MdbHandle *mdb, GladeXML *xml)
|
||||
{
|
||||
int i;
|
||||
MdbCatalogEntry *entry;
|
||||
GtkTreeIter *iter1, *iter2;
|
||||
GtkTreeIter *iter2;
|
||||
|
||||
GtkWidget *tree = glade_xml_get_widget(xml, "sql_treeview");
|
||||
GtkTreeStore *store = (GtkTreeStore *) gtk_tree_view_get_model(GTK_TREE_VIEW(tree));
|
||||
|
||||
@@ -27,12 +27,13 @@ extern MdbHandle *mdb;
|
||||
int selected_table = -1;
|
||||
extern char *mdb_access_types[];
|
||||
|
||||
void gmdb_table_set_sensitive(gboolean b);
|
||||
|
||||
/* callbacks */
|
||||
void
|
||||
gmdb_table_debug_cb(GtkList *list, GtkWidget *w, gpointer data)
|
||||
{
|
||||
MdbCatalogEntry *entry;
|
||||
guint32 page;
|
||||
|
||||
/* nothing selected yet? */
|
||||
if (selected_table==-1) {
|
||||
@@ -85,15 +86,22 @@ MdbCatalogEntry *entry;
|
||||
gmdb_table_data_new(entry);
|
||||
}
|
||||
void
|
||||
gmdb_table_unselect_cb(GnomeIconList *gil, int num, GdkEvent *ev, gpointer data)
|
||||
{
|
||||
selected_table = -1;
|
||||
gmdb_table_set_sensitive(FALSE);
|
||||
}
|
||||
void
|
||||
gmdb_table_select_cb(GnomeIconList *gil, int num, GdkEvent *ev, gpointer data)
|
||||
{
|
||||
int child_num;
|
||||
int i,j=0;
|
||||
int i;
|
||||
MdbCatalogEntry *entry;
|
||||
gchar *text;
|
||||
|
||||
text = (gchar *) gnome_icon_list_get_icon_data(gil, num);
|
||||
|
||||
selected_table = -1;
|
||||
|
||||
for (i=0;i<mdb->num_catalog;i++) {
|
||||
entry = g_ptr_array_index(mdb->catalog,i);
|
||||
if (entry->object_type==MDB_TABLE &&
|
||||
@@ -101,6 +109,12 @@ gchar *text;
|
||||
selected_table = i;
|
||||
}
|
||||
}
|
||||
if (selected_table>0) {
|
||||
gmdb_table_set_sensitive(TRUE);
|
||||
} else {
|
||||
gmdb_table_set_sensitive(FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
gmdb_table_popup_cb(GtkWidget *menu, GdkEvent *event)
|
||||
{
|
||||
@@ -119,12 +133,26 @@ GdkEventButton *event_button;
|
||||
}
|
||||
/* functions */
|
||||
void
|
||||
gmdb_table_set_sensitive(gboolean b)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "table_definition");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "table_data");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
|
||||
button = (GtkWidget *) glade_xml_get_widget (mainwin_xml, "table_export");
|
||||
gtk_widget_set_sensitive(button,b);
|
||||
}
|
||||
void
|
||||
gmdb_table_init_popup()
|
||||
{
|
||||
GnomeIconList *gil;
|
||||
GtkWidget *menu, *mi;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "table_iconlist");
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "table_iconlist");
|
||||
|
||||
menu = gtk_menu_new();
|
||||
gtk_widget_show(menu);
|
||||
@@ -151,9 +179,9 @@ GtkWidget *menu, *mi;
|
||||
g_signal_connect_swapped (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_table_debug_cb), gil);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
|
||||
mi = gtk_menu_item_new_with_label("Usage Map");
|
||||
gtk_widget_show(mi);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
|
||||
//mi = gtk_menu_item_new_with_label("Usage Map");
|
||||
//gtk_widget_show(mi);
|
||||
//gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
|
||||
|
||||
g_signal_connect_swapped (GTK_OBJECT (gil), "button_press_event",
|
||||
G_CALLBACK (gmdb_table_popup_cb), GTK_OBJECT(menu));
|
||||
@@ -164,9 +192,9 @@ gmdb_table_add_icon(gchar *text)
|
||||
GnomeIconList *gil;
|
||||
int pos;
|
||||
|
||||
gil = glade_xml_get_widget (mainwin_xml, "table_iconlist");
|
||||
gil = (GnomeIconList *) glade_xml_get_widget (mainwin_xml, "table_iconlist");
|
||||
|
||||
pos = gnome_icon_list_append(gil, "table_big.xpm", text);
|
||||
pos = gnome_icon_list_append(gil, GMDB_ICONDIR "table_big.xpm", text);
|
||||
gnome_icon_list_set_icon_data(gil, pos, text);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ MdbColumn *col;
|
||||
GtkWidget *clist;
|
||||
GtkWidget *scroll;
|
||||
int i, rownum;
|
||||
long row, maxrow;
|
||||
gchar *bound_data[256];
|
||||
GMdbDataWindow *dataw = NULL;
|
||||
|
||||
@@ -97,8 +98,13 @@ GMdbDataWindow *dataw = NULL;
|
||||
}
|
||||
gtk_clist_column_titles_show(GTK_CLIST(clist));
|
||||
|
||||
maxrow = gmdb_prefs_get_maxrows();
|
||||
|
||||
/* fetch those rows! */
|
||||
while(mdb_fetch_row(table)) {
|
||||
row = 0;
|
||||
while(mdb_fetch_row(table) &&
|
||||
(!maxrow || (row < maxrow))) {
|
||||
row++;
|
||||
rownum = gtk_clist_append(GTK_CLIST(clist), bound_data);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
#include "gmdb.h"
|
||||
#include "pk.xpm"
|
||||
#include "pixmaps/pk.xpm"
|
||||
|
||||
extern GtkWidget *app;
|
||||
extern MdbHandle *mdb;
|
||||
|
||||
@@ -160,7 +160,8 @@ GtkWidget *exportwin;
|
||||
sprintf(msg,"%d Rows exported successfully.\n", rows);
|
||||
gmdb_info_msg(msg);
|
||||
}
|
||||
void gmdb_table_export(MdbCatalogEntry *entry) {
|
||||
void gmdb_table_export(MdbCatalogEntry *entry)
|
||||
{
|
||||
GtkWidget *export_button;
|
||||
GtkWidget *close_button;
|
||||
GList *glist = NULL;
|
||||
@@ -169,7 +170,7 @@ GtkWidget *combo;
|
||||
cat_entry = entry;
|
||||
|
||||
/* load the interface */
|
||||
exportwin_xml = glade_xml_new("gladefiles/gmdb-export.glade", NULL, NULL);
|
||||
exportwin_xml = glade_xml_new(GMDB_GLADEDIR "gmdb-export.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(exportwin_xml);
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
char *mdb_get_objtype_string(int obj_type)
|
||||
char *
|
||||
mdb_get_objtype_string(int obj_type)
|
||||
{
|
||||
static char *type_name[] = {"Form",
|
||||
"Table",
|
||||
@@ -43,13 +44,10 @@ static char *type_name[] = {"Form",
|
||||
}
|
||||
|
||||
/* new method */
|
||||
#if 1
|
||||
GPtrArray *mdb_read_catalog (MdbHandle *mdb, int objtype)
|
||||
{
|
||||
int i, j, k;
|
||||
MdbCatalogEntry entry, msysobj, *data;
|
||||
MdbTableDef *table;
|
||||
MdbColumn *col;
|
||||
char parentid[256];
|
||||
char objname[256];
|
||||
char tobjtype[256];
|
||||
@@ -98,7 +96,7 @@ int type;
|
||||
|
||||
/* old method */
|
||||
|
||||
#else
|
||||
#if 0
|
||||
|
||||
MdbCatalogEntry *mdb_read_catalog_entry(MdbHandle *mdb, int rowid, MdbCatalogEntry *entry)
|
||||
{
|
||||
@@ -146,7 +144,8 @@ int mdb_catalog_rows(MdbHandle *mdb)
|
||||
{
|
||||
return mdb_get_int16(mdb, mdb->row_count_offset);
|
||||
}
|
||||
GArray *mdb_read_catalog(MdbHandle *mdb, int obj_type)
|
||||
GPtrArray *
|
||||
mdb_read_catalog(MdbHandle *mdb, int obj_type)
|
||||
{
|
||||
int i;
|
||||
int rows;
|
||||
@@ -192,7 +191,7 @@ int next_pg, next_pg_off;
|
||||
mdb_free_catalog(mdb);
|
||||
mdb->num_catalog = 0;
|
||||
|
||||
mdb->catalog = g_array_new(FALSE,FALSE,sizeof(MdbCatalogEntry));
|
||||
mdb->catalog = g_ptr_array_new();
|
||||
next_pg=0;
|
||||
while (mdb_read_pg(mdb,next_pg)) {
|
||||
if (mdb->pg_buf[0]==0x01 &&
|
||||
@@ -205,7 +204,7 @@ int next_pg, next_pg_off;
|
||||
if (mdb_read_catalog_entry(mdb, i, &entry)) {
|
||||
//printf("page %d\n",next_pg);
|
||||
mdb->num_catalog++;
|
||||
mdb->catalog = g_array_append_val(mdb->catalog, entry);
|
||||
g_ptr_array_add(mdb->catalog, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,10 +212,11 @@ int next_pg, next_pg_off;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void mdb_dump_catalog(MdbHandle *mdb, int obj_type)
|
||||
void
|
||||
mdb_dump_catalog(MdbHandle *mdb, int obj_type)
|
||||
{
|
||||
int rows, i;
|
||||
MdbCatalogEntry *entry;
|
||||
int i;
|
||||
MdbCatalogEntry *entry;
|
||||
|
||||
mdb_read_catalog(mdb, obj_type);
|
||||
for (i=0;i<mdb->num_catalog;i++) {
|
||||
@@ -225,8 +225,8 @@ MdbCatalogEntry *entry;
|
||||
fprintf(stdout,"Type: %-10s Name: %-18s T pg: %04x KKD pg: %04x row: %2d\n",
|
||||
mdb_get_objtype_string(entry->object_type),
|
||||
entry->object_name,
|
||||
entry->table_pg,
|
||||
entry->kkd_pg,
|
||||
(unsigned int) entry->table_pg,
|
||||
(unsigned int) entry->kkd_pg,
|
||||
entry->kkd_rowid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,11 @@ MdbColumn *col;
|
||||
col=g_ptr_array_index(table->columns, col_num - 1);
|
||||
col->len_ptr = len_ptr;
|
||||
}
|
||||
int mdb_find_end_of_row(MdbHandle *mdb, int row)
|
||||
int
|
||||
mdb_find_end_of_row(MdbHandle *mdb, int row)
|
||||
{
|
||||
MdbFormatConstants *fmt = mdb->fmt;
|
||||
int row_end;
|
||||
MdbFormatConstants *fmt = mdb->fmt;
|
||||
int row_end;
|
||||
|
||||
/* Search the previous "row start" values for the first non-deleted one.
|
||||
* If we don't find one, then the end of the page is the correct value.
|
||||
|
||||
@@ -64,7 +64,7 @@ int ret;
|
||||
return 0;
|
||||
}
|
||||
g_free(tmpfname);
|
||||
} while (dir = strtok(NULL, ":"));
|
||||
} while ((dir = strtok(NULL, ":")));
|
||||
return -1;
|
||||
}
|
||||
MdbHandle *_mdb_open(char *filename, gboolean writable)
|
||||
@@ -154,10 +154,10 @@ MdbHandle *mdb_clone_handle(MdbHandle *mdb)
|
||||
newmdb = mdb_alloc_handle();
|
||||
memcpy(newmdb, mdb, sizeof(MdbHandle));
|
||||
newmdb->stats = NULL;
|
||||
newmdb->catalog = g_array_new(FALSE,FALSE,sizeof(MdbCatalogEntry));
|
||||
newmdb->catalog = g_ptr_array_new();
|
||||
for (i=0;i<mdb->num_catalog;i++) {
|
||||
entry = g_ptr_array_index(mdb->catalog,i);
|
||||
newmdb->catalog = g_array_append_val(newmdb->catalog, entry);
|
||||
g_ptr_array_add(newmdb->catalog, entry);
|
||||
}
|
||||
mdb->backend_name = NULL;
|
||||
if (mdb->f) {
|
||||
@@ -227,13 +227,14 @@ unsigned char c;
|
||||
mdb->cur_pos++;
|
||||
return c;
|
||||
}
|
||||
int _mdb_get_int16(unsigned char *buf, int offset)
|
||||
int
|
||||
_mdb_get_int16(unsigned char *buf, int offset)
|
||||
{
|
||||
return buf[offset+1]*256+buf[offset];
|
||||
}
|
||||
int mdb_get_int16(MdbHandle *mdb, int offset)
|
||||
int
|
||||
mdb_get_int16(MdbHandle *mdb, int offset)
|
||||
{
|
||||
unsigned char *c;
|
||||
int i;
|
||||
|
||||
if (offset < 0 || offset+2 > mdb->fmt->pg_size) return -1;
|
||||
@@ -244,7 +245,8 @@ int i;
|
||||
return i;
|
||||
|
||||
}
|
||||
gint32 mdb_get_int24_msb(MdbHandle *mdb, int offset)
|
||||
gint32
|
||||
mdb_get_int24_msb(MdbHandle *mdb, int offset)
|
||||
{
|
||||
gint32 l;
|
||||
unsigned char *c;
|
||||
@@ -295,11 +297,15 @@ long l;
|
||||
mdb->cur_pos+=4;
|
||||
return l;
|
||||
}
|
||||
float mdb_get_single(MdbHandle *mdb, int offset)
|
||||
float
|
||||
mdb_get_single(MdbHandle *mdb, int offset)
|
||||
{
|
||||
float f, f2;
|
||||
unsigned char *c;
|
||||
int i;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
float f2;
|
||||
int i;
|
||||
unsigned char *c;
|
||||
#endif
|
||||
float f;
|
||||
|
||||
if (offset <0 || offset+4 > mdb->fmt->pg_size) return -1;
|
||||
|
||||
@@ -316,11 +322,15 @@ int i;
|
||||
return f;
|
||||
}
|
||||
|
||||
double mdb_get_double(MdbHandle *mdb, int offset)
|
||||
double
|
||||
mdb_get_double(MdbHandle *mdb, int offset)
|
||||
{
|
||||
double d, d2;
|
||||
unsigned char *c;
|
||||
int i;
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
double d2;
|
||||
int i;
|
||||
unsigned char *c;
|
||||
#endif
|
||||
double d;
|
||||
|
||||
if (offset <0 || offset+4 > mdb->fmt->pg_size) return -1;
|
||||
|
||||
@@ -337,7 +347,8 @@ int i;
|
||||
return d;
|
||||
|
||||
}
|
||||
int mdb_set_pos(MdbHandle *mdb, int pos)
|
||||
int
|
||||
mdb_set_pos(MdbHandle *mdb, int pos)
|
||||
{
|
||||
if (pos<0 || pos >= mdb->fmt->pg_size) return 0;
|
||||
|
||||
|
||||
@@ -53,7 +53,8 @@ char idx_to_text[] = {
|
||||
0x81, 0x00, 0x00, 0x00, 'x', 0x00, 0x00, 0x00, /* 0xf8-0xff */
|
||||
};
|
||||
|
||||
GPtrArray *mdb_read_indices(MdbTableDef *table)
|
||||
GPtrArray *
|
||||
mdb_read_indices(MdbTableDef *table)
|
||||
{
|
||||
MdbHandle *mdb = table->entry->mdb;
|
||||
MdbIndex idx, *pidx;
|
||||
@@ -170,7 +171,7 @@ void mdb_index_cache_sarg(MdbColumn *col, MdbSarg *sarg, MdbSarg *idx_sarg)
|
||||
//cache_int = sarg->value.i * -1;
|
||||
c = &(idx_sarg->value.i);
|
||||
c[0] |= 0x80;
|
||||
printf("int %08x %02x %02x %02x %02x\n", sarg->value.i, c[0], c[1], c[2], c[3]);
|
||||
//printf("int %08x %02x %02x %02x %02x\n", sarg->value.i, c[0], c[1], c[2], c[3]);
|
||||
break;
|
||||
|
||||
case MDB_INT:
|
||||
@@ -200,7 +201,7 @@ mdb_index_test_sargs(MdbHandle *mdb, MdbIndex *idx, int offset, int len)
|
||||
c_len = strlen(&mdb->pg_buf[offset + c_offset]);
|
||||
} else {
|
||||
c_len = col->col_size;
|
||||
fprintf(stderr,"Only text types currently supported. How did we get here?\n");
|
||||
//fprintf(stderr,"Only text types currently supported. How did we get here?\n");
|
||||
}
|
||||
/*
|
||||
* If we have no cached index values for this column,
|
||||
@@ -211,7 +212,7 @@ mdb_index_test_sargs(MdbHandle *mdb, MdbIndex *idx, int offset, int len)
|
||||
for (j=0;j<col->num_sargs;j++) {
|
||||
sarg = g_ptr_array_index (col->sargs, j);
|
||||
idx_sarg = g_memdup(sarg,sizeof(MdbSarg));
|
||||
printf("calling mdb_index_cache_sarg\n");
|
||||
//printf("calling mdb_index_cache_sarg\n");
|
||||
mdb_index_cache_sarg(col, sarg, idx_sarg);
|
||||
g_ptr_array_add(col->idx_sarg_cache, idx_sarg);
|
||||
}
|
||||
@@ -227,6 +228,10 @@ mdb_index_test_sargs(MdbHandle *mdb, MdbIndex *idx, int offset, int len)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/*
|
||||
* find the next entry on a page (either index or leaf). Uses state information
|
||||
* stored in the MdbIndexPage across calls.
|
||||
*/
|
||||
int
|
||||
mdb_index_find_next_on_page(MdbHandle *mdb, MdbIndexPage *ipg)
|
||||
{
|
||||
@@ -249,45 +254,93 @@ mdb_index_find_next_on_page(MdbHandle *mdb, MdbIndexPage *ipg)
|
||||
}
|
||||
void mdb_index_page_init(MdbIndexPage *ipg)
|
||||
{
|
||||
memset(ipg, 0, sizeof(MdbIndexPage));
|
||||
ipg->offset = 0xf8; /* start byte of the index entries */
|
||||
ipg->mask_pos = 0x16;
|
||||
ipg->mask_bit=0;
|
||||
ipg->len = 0;
|
||||
}
|
||||
int
|
||||
/*
|
||||
* find the next leaf page if any given a chain. Assumes any exhausted leaf
|
||||
* pages at the end of the chain have been peeled off before the call.
|
||||
*/
|
||||
MdbIndexPage *
|
||||
mdb_find_next_leaf(MdbHandle *mdb, MdbIndexChain *chain)
|
||||
{
|
||||
MdbIndexPage *ipg;
|
||||
MdbIndexPage *ipg, *newipg;
|
||||
guint32 pg;
|
||||
guint passed = 0;
|
||||
|
||||
ipg = &(chain->pages[chain->cur_depth - 1]);
|
||||
|
||||
/*
|
||||
* If we are at the first page deep and it's not an index page then
|
||||
* we are simply done. (there is no page to find
|
||||
*/
|
||||
if (chain->cur_depth==1) {
|
||||
ipg = &(chain->pages[0]);
|
||||
if (mdb->pg_buf[0]==MDB_PAGE_LEAF ||
|
||||
mdb->pg_buf[0]==MDB_PAGE_DATA) {
|
||||
return ipg->pg;
|
||||
|
||||
mdb_read_pg(mdb, ipg->pg);
|
||||
if (mdb->pg_buf[0]==MDB_PAGE_LEAF)
|
||||
return ipg;
|
||||
|
||||
/*
|
||||
* apply sargs here, currently we don't
|
||||
*/
|
||||
do {
|
||||
ipg->len = 0;
|
||||
//printf("finding next on pg %lu\n", ipg->pg);
|
||||
if (!mdb_index_find_next_on_page(mdb, ipg))
|
||||
return 0;
|
||||
pg = mdb_get_int24_msb(mdb, ipg->offset + ipg->len - 3);
|
||||
//printf("Looking at pg %lu at %lu %d\n", pg, ipg->offset, ipg->len);
|
||||
ipg->offset += ipg->len;
|
||||
|
||||
/*
|
||||
* add to the chain and call this function
|
||||
* recursively.
|
||||
*/
|
||||
chain->cur_depth++;
|
||||
if (chain->cur_depth > MDB_MAX_INDEX_DEPTH) {
|
||||
fprintf(stderr,"Error! maximum index depth of %d exceeded. This is probably due to a programming bug, If you are confident that your indexes really are this deep, adjust MDB_MAX_INDEX_DEPTH in mdbtools.h and recompile.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
ipg = &(chain->pages[chain->cur_depth - 1]);
|
||||
|
||||
newipg = &(chain->pages[chain->cur_depth - 1]);
|
||||
mdb_index_page_init(newipg);
|
||||
newipg->pg = pg;
|
||||
newipg = mdb_find_next_leaf(mdb, chain);
|
||||
//printf("returning pg %lu\n",newipg->pg);
|
||||
return newipg;
|
||||
} while (!passed);
|
||||
/* no more pages */
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
}
|
||||
/*
|
||||
* the main index function.
|
||||
* caller provides an index chain which is the current traversal of index
|
||||
* pages from the root page to the leaf. Initially passed as blank,
|
||||
* mdb_index_find_next will store it's state information here. Each invocation
|
||||
* then picks up where the last one left off, allowing us to scroll through
|
||||
* the index one by one.
|
||||
*
|
||||
* Sargs are applied here but also need to be applied on the whole row b/c
|
||||
* text columns may return false positives due to hashing and non-index
|
||||
* columns with sarg values can't be tested here.
|
||||
*/
|
||||
int
|
||||
mdb_index_find_next(MdbHandle *mdb, MdbIndex *idx, MdbIndexChain *chain, guint32 *pg, guint16 *row)
|
||||
{
|
||||
MdbIndexPage *ipg;
|
||||
int passed = 0;
|
||||
|
||||
/*
|
||||
* if it's new use the root index page (idx->first_pg)
|
||||
*/
|
||||
if (!chain->cur_depth) {
|
||||
ipg = &(chain->pages[0]);
|
||||
mdb_index_page_init(ipg);
|
||||
chain->cur_depth = 1;
|
||||
ipg->pg = idx->first_pg;
|
||||
if (!mdb_find_next_leaf(mdb, chain))
|
||||
if (!(ipg = mdb_find_next_leaf(mdb, chain)))
|
||||
return 0;
|
||||
} else {
|
||||
ipg = &(chain->pages[chain->cur_depth - 1]);
|
||||
@@ -296,10 +349,31 @@ mdb_index_find_next(MdbHandle *mdb, MdbIndex *idx, MdbIndexChain *chain, guint32
|
||||
|
||||
mdb_read_pg(mdb, ipg->pg);
|
||||
|
||||
/*
|
||||
* loop while the sargs don't match
|
||||
*/
|
||||
do {
|
||||
ipg->len = 0;
|
||||
if (!mdb_index_find_next_on_page(mdb, ipg))
|
||||
return 0;
|
||||
/*
|
||||
* if no more rows on this leaf, try to find a new leaf
|
||||
*/
|
||||
if (!mdb_index_find_next_on_page(mdb, ipg)) {
|
||||
//printf("page %lu finished\n",ipg->pg);
|
||||
if (chain->cur_depth==1)
|
||||
return 0;
|
||||
/*
|
||||
* unwind the stack until we find something or reach
|
||||
* the top.
|
||||
*/
|
||||
while (chain->cur_depth>1) {
|
||||
chain->cur_depth--;
|
||||
if (!(ipg = mdb_find_next_leaf(mdb, chain)))
|
||||
return 0;
|
||||
mdb_index_find_next_on_page(mdb, ipg);
|
||||
}
|
||||
if (chain->cur_depth==1)
|
||||
return 0;
|
||||
}
|
||||
*row = mdb->pg_buf[ipg->offset + ipg->len - 1];
|
||||
*pg = mdb_get_int24_msb(mdb, ipg->offset + ipg->len - 4);
|
||||
|
||||
@@ -332,10 +406,11 @@ int i;
|
||||
printf("column %d coltype %d col_size %d (%d)\n",i,col->col_type, mdb_col_fixed_size(col), col->col_size);
|
||||
}
|
||||
}
|
||||
void mdb_index_dump(MdbTableDef *table, MdbIndex *idx)
|
||||
void
|
||||
mdb_index_dump(MdbTableDef *table, MdbIndex *idx)
|
||||
{
|
||||
int i;
|
||||
MdbColumn *col;
|
||||
int i;
|
||||
MdbColumn *col;
|
||||
|
||||
fprintf(stdout,"index number %d\n", idx->index_num);
|
||||
fprintf(stdout,"index name %s\n", idx->name);
|
||||
|
||||
@@ -27,10 +27,9 @@
|
||||
|
||||
GArray *mdb_get_column_props(MdbCatalogEntry *entry, int start)
|
||||
{
|
||||
int i, j=0, pos, cnt=0;
|
||||
int pos, cnt=0;
|
||||
int len, tmp, cplen;
|
||||
MdbColumnProp prop;
|
||||
char name[MDB_MAX_OBJ_NAME+1];
|
||||
MdbHandle *mdb = entry->mdb;
|
||||
|
||||
entry->props = g_array_new(FALSE,FALSE,sizeof(MdbColumnProp));
|
||||
@@ -100,13 +99,8 @@ void mdb_kkd_dump(MdbCatalogEntry *entry)
|
||||
{
|
||||
int rows;
|
||||
int kkd_start, kkd_end;
|
||||
int i, j, tmp, pos, row_type, hdrpos=0, datapos=0;
|
||||
int len;
|
||||
int col_type, col_num, val_len;
|
||||
int start;
|
||||
unsigned char c;
|
||||
int i, tmp, pos, row_type, datapos=0;
|
||||
MdbColumnProp prop;
|
||||
char name[MDB_MAX_OBJ_NAME+1];
|
||||
MdbHandle *mdb = entry->mdb;
|
||||
int rowid = entry->kkd_rowid;
|
||||
|
||||
|
||||
@@ -35,20 +35,24 @@ MdbStatistics *mdb_alloc_stats(MdbHandle *mdb)
|
||||
mdb->stats = g_malloc0(sizeof(MdbStatistics));
|
||||
return mdb->stats;
|
||||
}
|
||||
void mdb_free_stats(MdbHandle *mdb)
|
||||
void
|
||||
mdb_free_stats(MdbHandle *mdb)
|
||||
{
|
||||
g_free(mdb->stats);
|
||||
mdb->stats = NULL;
|
||||
}
|
||||
MdbFile *mdb_alloc_file()
|
||||
MdbFile *
|
||||
mdb_alloc_file()
|
||||
{
|
||||
MdbHandle *f;
|
||||
MdbFile *f;
|
||||
|
||||
f = (MdbFile *) malloc(sizeof(MdbFile));
|
||||
memset(f, '\0', sizeof(MdbFile));
|
||||
|
||||
return f;
|
||||
}
|
||||
void mdb_free_file(MdbFile *f)
|
||||
void
|
||||
mdb_free_file(MdbFile *f)
|
||||
{
|
||||
if (!f) return;
|
||||
if (f->fd) close(f->fd);
|
||||
@@ -82,9 +86,6 @@ void mdb_alloc_catalog(MdbHandle *mdb)
|
||||
}
|
||||
void mdb_free_catalog(MdbHandle *mdb)
|
||||
{
|
||||
GList *l;
|
||||
MdbCatalogEntry entry;
|
||||
|
||||
//g_ptr_array_free(mdb->catalog, FALSE);
|
||||
mdb->catalog = NULL;
|
||||
}
|
||||
@@ -99,11 +100,13 @@ MdbTableDef *table;
|
||||
|
||||
return table;
|
||||
}
|
||||
void mdb_free_tabledef(MdbTableDef *table)
|
||||
void
|
||||
mdb_free_tabledef(MdbTableDef *table)
|
||||
{
|
||||
if (table->usage_map) free(table->usage_map);
|
||||
if (table) free(table);
|
||||
}
|
||||
void
|
||||
mdb_append_column(GPtrArray *columns, MdbColumn *in_col)
|
||||
{
|
||||
MdbColumn *col;
|
||||
@@ -111,10 +114,12 @@ MdbColumn *col;
|
||||
col = g_memdup(in_col,sizeof(MdbColumn));
|
||||
g_ptr_array_add(columns, col);
|
||||
}
|
||||
void
|
||||
mdb_free_columns(GPtrArray *columns)
|
||||
{
|
||||
g_ptr_array_free(columns, TRUE);
|
||||
}
|
||||
void
|
||||
mdb_append_index(GPtrArray *indices, MdbIndex *in_idx)
|
||||
{
|
||||
MdbIndex *idx;
|
||||
@@ -122,6 +127,7 @@ MdbIndex *idx;
|
||||
idx = g_memdup(in_idx,sizeof(MdbIndex));
|
||||
g_ptr_array_add(indices, idx);
|
||||
}
|
||||
void
|
||||
mdb_free_indices(GPtrArray *indices)
|
||||
{
|
||||
g_ptr_array_free(indices, TRUE);
|
||||
|
||||
@@ -45,7 +45,7 @@ MdbTableDef *mdb_read_table(MdbCatalogEntry *entry)
|
||||
MdbTableDef *table;
|
||||
MdbHandle *mdb = entry->mdb;
|
||||
MdbFormatConstants *fmt = mdb->fmt;
|
||||
int len, i;
|
||||
int len;
|
||||
int rownum, row_start, row_end;
|
||||
|
||||
table = mdb_alloc_tabledef(entry);
|
||||
@@ -104,9 +104,7 @@ MdbColumn col, *pcol;
|
||||
int len, i,j;
|
||||
unsigned char low_byte, high_byte;
|
||||
int cur_col, cur_name;
|
||||
int col_type, col_size;
|
||||
char name[MDB_MAX_OBJ_NAME+1];
|
||||
int name_sz, col_num;
|
||||
int name_sz;
|
||||
GSList *slist = NULL;
|
||||
|
||||
table->columns = g_ptr_array_new();
|
||||
@@ -238,11 +236,11 @@ int i,bitn;
|
||||
int pgnum;
|
||||
|
||||
table = mdb_read_table(entry);
|
||||
fprintf(stdout,"definition page = %d\n",entry->table_pg);
|
||||
fprintf(stdout,"definition page = %lu\n",entry->table_pg);
|
||||
fprintf(stdout,"number of datarows = %d\n",table->num_rows);
|
||||
fprintf(stdout,"number of columns = %d\n",table->num_cols);
|
||||
fprintf(stdout,"number of indices = %d\n",table->num_real_idxs);
|
||||
fprintf(stdout,"first data page = %d\n",table->first_data_pg);
|
||||
fprintf(stdout,"first data page = %lu\n",table->first_data_pg);
|
||||
|
||||
mdb_read_columns(table);
|
||||
mdb_read_indices(table);
|
||||
|
||||
@@ -26,12 +26,10 @@ main(int argc, char **argv)
|
||||
{
|
||||
int rows;
|
||||
int i, j;
|
||||
unsigned char buf[2048];
|
||||
MdbHandle *mdb;
|
||||
MdbCatalogEntry *entry;
|
||||
MdbTableDef *table;
|
||||
MdbIndex *idx;
|
||||
GList *l;
|
||||
int found = 0;
|
||||
|
||||
|
||||
@@ -92,10 +90,10 @@ void check_row(MdbHandle *mdb, MdbIndex *idx, guint32 pg, int row, unsigned char
|
||||
{
|
||||
MdbField fields[256];
|
||||
MdbFormatConstants *fmt;
|
||||
int num_fields, i, j, k;
|
||||
int num_fields, i, j;
|
||||
int row_start, row_end;
|
||||
MdbColumn *col;
|
||||
guchar buf[256], key[256], mykey[256];
|
||||
guchar buf[256], key[256];
|
||||
int elem, pos;
|
||||
MdbTableDef *table = idx->table;
|
||||
|
||||
@@ -119,25 +117,26 @@ void check_row(MdbHandle *mdb, MdbIndex *idx, guint32 pg, int row, unsigned char
|
||||
//j = idx->key_col_num[i];
|
||||
strncpy(buf, fields[elem].value, fields[elem].siz);
|
||||
buf[fields[elem].siz]=0;
|
||||
fprintf(stdout, "elem %d %d column %d %s %s\n",elem, fields[elem].colnum, idx->key_col_num[i], col->name, buf);
|
||||
//fprintf(stdout, "elem %d %d column %d %s %s\n",elem, fields[elem].colnum, idx->key_col_num[i], col->name, buf);
|
||||
if (col->col_type == MDB_TEXT) {
|
||||
fprintf(stdout, "%s = %s \n", buf, key);
|
||||
// fprintf(stdout, "%s = %s \n", buf, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
void
|
||||
walk_index(MdbHandle *mdb, MdbIndex *idx)
|
||||
{
|
||||
int i, j, start, len;
|
||||
int start, len;
|
||||
unsigned char byte;
|
||||
guint32 pg;
|
||||
guint16 row;
|
||||
MdbHandle *mdbidx;
|
||||
MdbIndexChain chain;
|
||||
|
||||
#if 0
|
||||
MdbTableDef *table = idx->table;
|
||||
MdbSarg sarg;
|
||||
|
||||
#if 1
|
||||
sarg.op = MDB_EQUAL;
|
||||
//strcpy(sarg.value.s, "SP");
|
||||
sarg.value.i = 2;
|
||||
@@ -151,33 +150,10 @@ walk_index(MdbHandle *mdb, MdbIndex *idx)
|
||||
* the data */
|
||||
mdbidx = mdb_clone_handle(mdb);
|
||||
mdb_read_pg(mdbidx, idx->first_pg);
|
||||
printf("page type %02x %s\n", mdbidx->pg_buf[0], page_name(mdbidx->pg_buf[0]));
|
||||
//printf("page type %02x %s\n", mdbidx->pg_buf[0], page_name(mdbidx->pg_buf[0]));
|
||||
while (mdb_index_find_next(mdbidx, idx, &chain, &pg, &row)) {
|
||||
printf("row = %d pg = %lu\n", row, pg);
|
||||
check_row(mdb, idx, pg, row, &mdbidx->pg_buf[start], len - 4);
|
||||
}
|
||||
#if 0
|
||||
if (mdbidx->pg_buf[0]!=MDB_PAGE_LEAF) {
|
||||
return;
|
||||
}
|
||||
start = 0xf8; /* start byte of the index entries */
|
||||
len = -1;
|
||||
for (i=0x16;i<0xf8;i++) {
|
||||
byte = mdbidx->pg_buf[i];
|
||||
//printf("%02x ",byte);
|
||||
for (j=0;j<8;j++) {
|
||||
len++;
|
||||
if ((1 << j) & byte) {
|
||||
// printf("start = %04x len = %d\n", start, len);
|
||||
buffer_dump(mdbidx->pg_buf, start, start+len-1);
|
||||
row = mdbidx->pg_buf[start+len-1];
|
||||
pg = mdb_get_int24_msb(mdbidx, start+len-4);
|
||||
start += len;
|
||||
len = 0;
|
||||
// printf("\nbit %d set\n", j);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mdb_close(mdbidx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user