| PLEX86 | ||
Thou shalt have no other gods before the ANSI C standard 1593David Wagner You haven't gone far enough. Your proposal involves exposing the makeup of struct buf, without which the user can't access the size, and thus can't allocate the storage. It is better to only define a pointer to the opaque structure, and ensure the buffer module proper does any storage allocation. The resultant data will still be in the users data space. For an example of this see how the fundamental structure is allocated and maneuvered in my hashlib: This breakup provides complete freedom to redesign the structures in question without affecting the user code (although relinking may be needed). Reduction of interconnections is always good, in my book. Thou shalt have no other gods before the ANSI C standard 1594 Tom Linden If you mean elaborate in terms of your PL-I point, I'm not sure. I'll try, but... Again in hashlib, note how specific performance data is returned in a structure, and how that structure is returned from an access function. That means that there is no way for a user to harm the data in the hashlib module. It also means that modification of that structure will require user recompilation, but that is easily controlled via the date of the .h file. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson
|
||||
Thou shalt have no other gods before the ANSI C standard 1594 Alt Folklore Computers from Newsgroups The #1 Usenet Provider on the Internet
Thou shalt have no other gods before the ANSI C standard 1592 |
||||