Wrapper functions?

I heard something about wrapper function...
How dies that work?
or what is will do?
i searchesd at wiki but found nothing...
think i can put some functions in and set it than but dont know how...

wrapper function

A wrapper function is usually a short code snippet which is wrapped around something. In Hackwars it is usually something like this:

void fmessage(string ip, string mes){ message(ip,mes); }

Such a wrapper looks pretty useless but if the code in HW calls fmessage more than one time then this wrapper saved you a little bit cash and one CPU cost. The reason is that EACH time an API function occurs in the script it adds to the compile cost. But by using that wrapper above message() will only occur one time in the script. Now think of other functions which cost even more then one single CPU.
But before you write a wrapper for every function: the general and the FileIO functions don't cost money or CPU so you save no money or CPU by writing wrappers for these.

Usually when you want to call a HS function in more than one place of the script AND if that function costs money and CPU you will use a wrapper. But if that function is used only once or one of the free functions then don't bother to use a wrapper.

Another issue of using these wrappers is for bug fixing and error checking (even in real life computing).
For example message() will fail if the message string is longer than 255 chars, which will cancel the execution of the script.
Thanks to the wrapper you need to add the fix only at one place: inside the wrapper.

void fmessage(string ip, string mes)
{
if (strlen(mes)>255) mes = substr(mes,0,255);
message(ip,mes);
}

The message will be cut off - but at least the script will work on.