Re: function of 'registerNode' in Performer 1.2 flt loader

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Tue, 13 Feb 1996 10:47:44 -0800


On Feb 13, 11:06am, (Mario Veraart) wrote:
> Subject: function of 'registerNode' in Performer 1.2 flt loader
> Hello Performer users,
>
> I'm working on a port of an application from performer 1.2
> to 2.0. This application uses a third party library that some
> performer calls to the flight loader. The only thing I can't find
> in the flight loader that comes with performer 2.0 is an
> equavalent of the
>
> void (*registerNode)(pfNode *,int mgOpt, COMMENTcb com)
> variable.

This global is now private to the 2.0 loader. I've been cleaning out global
variables from the loader for a while, partly to improve DSO linkage. This
function pointer is now a loader attribute in the 2.0 Converter API. One of
the examples given in the readme file is:

#include <Performer/pf.h>
#include <Performer/pfdb/pfflt.h>

extern void myCallBack
( pfNode* node, int mgOp, int* cbs, COMMENTcb* cbcom, void* userData );

int main ()
{
    fltRegisterNodeT pFunc = myCallBack;
    void* hFunc = & pFunc;

    /* NOTE: do not attempt "& myCallback" here !!!
     * the C language will ignore the "&".
     */
    pfdConverterAttr_flt ( PFFLT_REGISTER_NODE, hFunc );

    pfdLoadFile_flt ( "a_data_base.flt" );
}

> My question: what is the purpose of the function pointed at and
> how can I emmulate it's function with the
> performer 2.0 flight loader?

The function is referred to as the "Loader Callback" in the readme file. In
the example above, the loader indirectly calls myCallBack() each time an
OpenFlight record is translated into a Performer node. This allows you to do
extra work near the time of construction like: saving the pfNode for later
reference, changing initial values (based on the comment record), replacing the
given pfNode (type), or attaching user/traversal data and functions to the
pfNode. Also, not all record types have a callback.

The function is not "gone" in the 2.0 loader. It's just not a global variable
anymore.

Please see /usr/share/Performer/src/lib/libpfdb/libpfflt/README.FLT.R14_2
for a complete discussion of all loader features (and known bugs ;-) and more
examples.

> Thanks in advance
> Mario Veraart
>-- End of excerpt from (Mario Veraart)

You're welcome!

... and thanks to Lance Marrou for his helpfull response :-)

Regards.

--
    __  ___      ____  _ ______          Marcus Barnes, Member Tech. Staff
   /  |/  /_  __/ / /_( ) ____/__  ____  MultiGen Inc, 550 S. Winchester
  / /|_/ / / / / / __/ / / __/ _ \/ __ \ Blvd. STE 500, San Jose CA 95128
 / /  / / /_/ / / / / / /_/ /  __/ / / / PH:1-408-556-2654 FX:1-408-261-4102
/_/  /_/\__,_/_/\_\/_/\____/\___/_/ /_/  EMAIL: marcus++at++multigen.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:24 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.