Re: paradox support: help needed



On Tue, Oct 21, 2003 at 09:57:25AM -0400, Jody Goldberg wrote:
On Tue, Oct 21, 2003 at 03:51:14PM +0200, Uwe Steinmann wrote:
Ok, I guess I set up everything to start. I already created a new
plugin directory 'paradox' and copied the files from xbase into it.
Makefile.am, and plugin.xml.in is modified. 

sounds good.
 
It looks like in the first step I must implement a function
paradox_file_open (GnmFileOpener const *fo, IOContext *io_context,
                 WorkbookView *wb_view, GsfInput *input)

yup. open and probe are the only entry points.
Implemented both. When is probe being called? Whenever a file
is opened or only if one selects auto detection in the file
open dialog?

xbase uses gsf to read the file. My library requires an open file
pointer. First problem: how do get a file pointer from the GsfInput
struct?

You can't.  You'll need to modify your library to either
1) Use gsf
2) Support some sort of i/o abstraction layer that you can use to
   wrap gsf.
Ok. I added support for gsf to my library. Actually it's now prepared to
use any kind of io access.

After doing all the preparation work, I started to implement the plugin
and got it already working. It's been easier than I thought.
I doesn't support all the different field types yet, but can handle the
most common ones. Anyway there are still some open questions.

1. My library can use external memory management functions instead of
   usual system functions. Does gnumeric provide memory management which
         I should use.
2. The library can also call an external error handler. Same question as
   in 1. 
3. Paradox files usually have some codepage xxx encoding. The library
   can do the conversions on the fly when accessing character fields.
         Should this be preffered opposed to gnumerics own recoding functions?
4. I currently use value_new_string_nocopy(str), with str being a
   string allocated within the library. Should I rather use
         value_new_string(str) and free the memory allocated in the library
         afterwards?
5. A paradox database is usually splitted into several files, e.g. a
   primary index is put into an extra file. In general it is not
         required to read those files, but it can accelerate access.
         Is there any way to access those files in a clean way from within
         the plugin?

Thanks for your help.

  Uwe
-- 
  MMK GmbH, Universitaetsstr. 11, 58097 Hagen
  Uwe Steinmann mmk-hagen de
  Tel: +2331 840446    Fax: +2331 843920

Attachment: signature.asc
Description: Digital signature



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