[Prev][Next][Index][Thread]

# Re: register_function line

- Date: Wed, 29 May 1996 15:06:50 PDT
- From:
- Cc: Diana L Harris <dlh5226@erc.jscc.cc.tn.us>, moo-cows@parc.xerox.com
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- In-Reply-To: <Pine.LNX.3.91.960529192149.494A-100000@ralin.mistral.co.uk>

    	The appropriate format for a built-in function is

    package bf???(Var, Byte, void *, Objid)

    	The other respondant was correct in that an fnum is actually a
    pointer to a double, but this is a significant consideration as well...

    	Look through some of the relatively simple built-ins to get an
    idea of what you need to do.  Particualrly, you can safely ignore the Byte
    and void *, which become important only when your built-in calls verbs.
    Also, you can ignore the Objid unless you need to do permission checking.
    You are left with a Var and a package to return.  If you aren't familiar
    with the Var type or the way lists are represented in-DB, you should be to
    write this builtin.  If you are, the Var is a list, the list of arguments
    given to the builtin.  The package is created by make_error_pack or
    make_var_pack (or something like that), two functions you will see very
    often in built-in functions...for your purposes, it is simply a way of
    passing a return value to the server.  Also, be *very* *careful* about
    freeing your Var that you're passed, or you'll get a memory leak, about
    136 bytes every time you call the built-in...

    --Nick Ingolia

    ningolia@[oxygen|neon|stu].ci.lexington.ma.us
    ingolia@molbio.mgh.harvard.edu

References:

- Re: register_function line

- From: bartmoss@mistral.co.uk

- Prev: Re: register_function line
- Next: Re: register_function line
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index