|
From: | Paolo Bonzini |
Subject: | Re: [Help-smalltalk] ncurses calls |
Date: | Mon, 02 Oct 2006 07:12:24 +0200 |
User-agent: | Thunderbird 1.5.0.7 (Macintosh/20060909) |
Brad Watson wrote:
Is it better to use the dynamic library linking mechanism or the dynamic module linking system for ncurses ?
I don't know it very well, but the possibilities are:- use a module only: ok if the library is very small and a lot of functions need wrappers; see examples/gdbm.st for an example, or the regex module in 2.2 (now it's in the main image).
- use a library only: ok if the library is possibly complicated, but its interface is such that it needs no wrappers; an example is when you use functions from libc, or in the MD5 package.
- use a module *and* a library: ok if the library is quite big, and it has an interface that is quite complicated so that it is necessary to manipulate Smalltalk objects in the wrapper. The most obvious example is GTK.
I think that ncurses fits in case 2 -- only a library -- especially because it is simple and its interface does not involve callbacks from ncurses into user code. Maybe you will need some C code in order to run some initialization code or to handle SIGWINCH. In this case you may have a very thin module just to implement this (you have a very handy place to set up the initialization code in gst_initModule), but still most of the functionality would be provided by linking the ncurses library.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |