Next: , Previous: , Up: Library   [Contents][Index]


5.43 Informative Functions

These functions convert numeric identifiers of various MFL entities to strings and vice-versa.

Built-in Function: string milter_state_name (number code)

Convert the numeric identifier of a milter state to textual form. It is normally used to convert the milter_state variable (see milter state) to string, e.g.:

milter_state_name(5) ⇒ "connect"

If code does not refer to a valid milter state, the e_inval exception is raised.

Built-in Function: number milter_state_code (string name)

Returns numeric code of the milter state name. If name does not refer to a valid milter state, returns 0 (milter_state_none from the milter.mfl module).

Built-in Function: string milter_action_name (number code)

Convert the numeric identifier of a reply action (see reply actions) to textual name.

If code does not refer to a valid reply action, the e_inval exception is raised.

milter_state_code("connect") ⇒ 5

This function is useful in action hooks. See action hook, for details.

Built-in Function: number milter_action_name (string name)

Returns numeric code of the reply action identified by name. If name does not refer to a valid action, returns -1.