PennMUSH Community

Ticket #7668 (new suggested feature)

Opened 1 month ago

function flags to replace called_as

Reported by: Talvo Assigned to:
Priority: minor Milestone:
Keywords: Cc:
Visibility: Public

Description

Hey,

The patch below adds a new element to the struct softcode functions are stored in in the hardcode, storing a set of flags to be passed to the hardcoded functions which run them. Those flags can then be used, instead of checking called_as, to determine exactly what the hardcoded function should do, when it's used by more than one softcode function (like fun_search, fun_pemit, etc).

The benefit to doing that is that any built-in function can be aliased in alias.cnf, either for simple renaming or for localization. Currently, for instance, if you do:

function_alias nspemit spam
@set me=nospoof
th spam(me,test)

you'll still see the nospoof info, because fun_pemit checks for "NS" in the function name to decide whether it should show nospoof info or not, and actually runs pemit() not nspemit(). Similar for the lkids() function that someone was trying to softcode in another ticket on here to alias children(); with this, you can just use a function_alias of children(), where currently it'd incorrectly alias lsearch() instead.

(This adds a new argument to function_add() and alias_function(), so anyone using those in funlocal.c would need to update them.)

Mike

Attachments

function-args.patch.txt (77.9 kB) - added by Talvo on 07/18/08 15:10:47.

Change History

07/18/08 15:10:47 changed by Talvo

  • attachment function-args.patch.txt added.