Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 2 | #include <trace.h> |
| 3 | |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 4 | string traceprefix(string prefix) |
| 5 | string traceprefix(int dummy) |
| 6 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 7 | DESCRIPTION |
| 8 | If called with a string, only objects matching this prefix will |
| 9 | be traced. The string must not contain a leading "/" because |
| 10 | the object names are stored internally without it. If called |
| 11 | with a number, the traceprefix will be ignored and all objects |
| 12 | will be traced. Returns the last traceprefix or 0 if there |
| 13 | wasn't any. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 14 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 15 | The master-lfun valid_trace() is called with ("traceprefix", prefix) |
| 16 | as arguments to verify the use of this efun. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 18 | EXAMPLES |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 19 | object obj; |
| 20 | string prefix; |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 21 | obj = find_player("wessex"); |
| 22 | prefix = object_name(obj); |
| 23 | prefix = prefix[1..]; /* cut off the leading "/" */ |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 24 | traceprefix(prefix); |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 25 | /* From here on, only code in the object "std/player#69" |
| 26 | * will be traced. |
| 27 | */ |
| 28 | trace(TRACE_CALL | TRACE_CALL_OTHER | TRACE_RETURN | TRACE_ARGS); |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 29 | ... |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 30 | trace(TRACE_NOTHING); |
| 31 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 32 | HISTORY |
| 33 | LDMud 3.2.9 passes the <prefix> argument to the valid_trace() |
| 34 | apply as well. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 35 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 36 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 37 | trace(E) |