lib-glow-standard

lib-glow-standard is a collection of small routines, originally distributed as macros. It also includes some other minor library functions. The primary intention of this library is to allow programs that relied on the "standard" set of macros function correctly on a muck that does not have those macros defined by simply adding an include statement at the beginning of the code.

lib-glow-standard is typically registered as /glow, /glowstandard, /null, , and /true. The 'nothing' and 'null' references are there as targets for actions that need to do 'nothing' when they succeed their locks. /true is for instances when you need a lock something to a value that's always true.

Below is a list of functions that are actually useful amongst the various macros included. Anything that I believe shouldn't be used isn't listed here. The majority of the ones I've excluded are ones that can be more easily handled by using a MUF primitive or a different library. If you're debugging someone else's program and need to know what the excluded macros are intended to do (and possibly a definition if short), proceed to the _complete_ list: Complete List.

Word NamePrototype & Description
.addpropstr ( d s1 s2 -- )
Adds string s2 to database item d stored in property s1.
.archwizard? ( d -- b )
Checks database item d for the Archwizard (W3) flag.
.builder? ( d -- b )
Returns true if database item d is a builder or wizard (W1+).
.cap ( s -- s' )
Takes string 's' and capitializes the first letter.
.cleancommas ( s -- s' )
Takes string of comma delimited items and formats them nicely.
.dark? ( d -- b )
Returns true if database item d's DARK flag is set, or the _dark property is set.
.debug-line( -- )
Displays a single line of debug
.debug-off ( -- )
Turns debug off for the current program.
.debug-on ( -- )
Turns debug on for the current program.
.descwrap ( s -- )
Prettily word wraps a description string and notifies it to the user.
.endfor/endfor ( i -- )
Given counter i, decrements the counter and checks to see if the 'for' loop has ended.
.envprop ( d s -- s )
Given starting database item d, searches up the environment tree for property 's'. Returns the value of that property. Note that if you need both the database item and the valule of the property, it is better to use the muf primitive envpropstr.
.envsearch ( d s -- d )
Given starting database item d, searches up the environment tree for property 's'. Returns the dbref of the database item found. If the database item is not found it returns #-1. Note that if you need both the database item and the value of the property, it is better to use the muf primitive envpropstr.
.firstname ( d -- s )
If database item d has more than one name (separated by ; ) returns the first name of d, otherwise returns the name of d.
.for/for ( i-- )
Beginning of the for/endfor loop. Simply 'dup if begin'. i is the number of iterations.
.getprop? ( d s -- b )
Tests to see if the property is accessible returns true (1) if it is, otherwise false (0).
.guest? ( d -- b )
Checks database item d to see if the guest flag or W1+ flag is set. Returns true (1) or false (0).
.initialize ( -- )
Sets the me and loc variables by using match to insure that they are correct. Useful for programs called by other programs that may overwrite the values of me and loc.
.locate-prop ( d s -- d )
Given property name s and dbref d, finds the property, whether on the dbref itself, an environment of the dbref, or a proploc of the dbref. If the property is not found it returns #-1.
.mage? ( d -- b )
Tests database item d for the "mage" flag. Returns true (1) or false (0).
.make-loc-safe ( -- )
Sets the value of loc by using "match". Useful for programs called by other programs that may have over-written the value of loc.
.make-me-safe ( -- )
Sets the value of me by using "match". Useful for programs called by other programs that may have over-written the value of me.
.mpi? ( d -- b )
Tests whether database item d has the "meeper/mpi" flag or has a wizard flag. Returns true (1) or false (0).
.namesplit ( d -- s1 s2 )
Performs an unparseobj on database item d and splits the name from the flag string returning both as separate strings (s1 and s2).
.otell ( s -- )
Displays string s to everyone in the room except 'me'.
.pmatch/.pmatch+ ( s -- d )
Almost depecrated. Originally intended to partial matching, but the muf primitive 'match' matches partially. Now only a wrapper for 'match' which prefixes the asterisk to the match string. Returns the dbref of the database item found. See 'match' for more information.
.private? ( d -- b )
Checks database item d for the _private:yes property. If yes returns true(1), otherwise false(0).
.quote_string ( s1 -- s2 )
Puts quotes at the beginning and end of s1.
.reg-call ( s1 -- )
Finds and calls a program registered with the name s1.
.run ( s -- )
Safely runs programs and parses MPI in string s.
.safe-loc ( -- d )
Returns the dbref of the room that the user of the program is in.
.safe-me ( -- d )
Returns the dbref of the user of the program.
.secure ( -- )
Sets the me and loc variables by using match to insure that they are correct. Useful for programs called by other programs that may overwrite the values of me and loc.
.setpropstr/setpropstr ( d s1 s2 -- )
If s2 is non-null sets the property s1 on database item d. Otherwise removes property s1 from database item d.
.setpennies ( d i -- )
Sets database item d's pennies to i amount.
.showstr ( d s1 ... si i -- )
Loops through i strings, displaying each string in turn to database item d (presumably a player).
.sort ( -- )
Deprecated. Defined as 2 \sort.
.spacecut ( s1 -- s2 )
Replaces all triple spaces in s1 with double spaces.
.stringncmp/stringncmp ( s1 s2 i -- b )
Case insensitive version of strncmp.
.tell-all ( s -- )
Sends s to everyone at me's location.
.tmage?/.truemage? ( d -- )
Returns true(1) if database item d has the W1 flag.
.wizard? ( d -- b )
Checks to see if database item d has the wizard flag. Returns true(1) or false(0).
.wrapnotify ( d s -- )
Sends s wrapped nicely to database item d.
.wrapstr ( s1 ... si i -- )
Loops through i strings .wrapnotify'ing each one to 'me'.
.xor/xor ( i1 i2 -- i )
Performs an exclusive or on i1 and i2.
.yes? ( s -- b )
Returns true (1) if the string begins with 'y' otherwise returns false (0).

feaelin@kemenel.org
lib-glow-standard / Revised 2004 March 31 22:06 (Wednesday)
© 2004 Iain E. Davis

Green Web Hosting! This site hosted by DreamHost. Standards Now! Valid XHTML 1.1! Valid CSS! We rated with ICRA!