Re: timer API (was Re: [AD] Screen update API again)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Evert Glebbeek wrote:
Well, I like "install" also now, but I'm open to change. What do other people think?

The way I see it, you use "create" if you're making something that didn't exist before the function call, "allocate" if you're taking from a pool of pre-existing memory, and "install" if you're plugging something in to an already active module. Some examples: create_bitmap because it's allocating a bitmap (at the very least the structure, if not the actual bmp data area), allocate_voice because it takes from a pool of pre-existing voice structs, and install_int because it's plugging a function in to an already-running timer callback.

Now, when a function has overlapping functionality (creates and installs, for example), you should go with how it appears to the programmer/user.. in this case creating, since it doesn't appear to be dependant on any other system the user deals with directly. It just returns a newly allocated structure that runs more or less independant from the other structures.

- Kitty Cat




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/