XForms: fl_calloc initialises memory ?

Ivan Powis (pczip@chemistry.nottingham.ac.uk)
Fri, 07 Nov 1997 16:13:53 GMT

To subscribers of the xforms list from Ivan Powis <pczip@chemistry.nottingham.ac.uk> :

I have a query about the fl_calloc() routine. Does it intialise
allocated memory to zeroes like calloc? I can't find this documented
in the manual though I could have missed it.

Why he wants to know this:

I'm using a fdesign'ed form which has many similar xyplots, and have
used the facility to name these objects as elements of an array -
which greatly simplifies my programming. Now the array indeces chosen
are related to other parts of my data and in fact are not a completely
contiguous set - so there may not be an object xyp[4] ever created on
the form, although xyp[3] and xyp[5] are.

In a callback I want to loop through the array of these xyplots making
adjustments, but need to identify those which are missing. I'd like to
be able to assume that a non-existent object will simply have a null
pointer, but since it isn't explicitly initialised by fdesign's
outputted create_form_???() it all depends on how the memory allocated
to the FD_?? structure by this create_form_??? is initialised. It
apparently uses fl_calloc to do this. So can I safely assume that this
structure is zeroed at creation, on all machines in all current and
future versions of the forms library?


    ___  ___/   _  __ /  Ivan Powis                TEL: +44-115-951-3467 |
        /         /   /  Department of Chemistry   FAX: +44-115-951-3562 |
       /         /  _/   University of Nottingham                        |
      /         ___/     Nottingham NG7 2RD                              |
     /         /         UK                                              |
    /         /                      pczip@chem.nott.ac.uk               | 
_______/  ____/                      http://www.chem.nott.ac.uk/IP.html  |

_________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuf2.usuhs.mil or see http://bob.usuf2.usuhs.mil/mailserv/xforms.html Xforms Home Page: http://bragg.phys.uwm.edu/xforms List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/