-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathp_db.h
1297 lines (1228 loc) · 41.3 KB
/
p_db.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** @file p_db.h
*
* Declaration of DB related primitives for MUF.
*
* This file is part of Fuzzball MUCK. Please see LICENSE.md for details.
*/
#ifndef P_DB_H
#define P_DB_H
#include "interp.h"
/**
* Implementation of MUF ADDPENNIES
*
* Consumes a dbref and an integer, and adds that value to the player or
* thing dbref. Requires MUCKER level tp_addpennies_muf_mlev for players
* and 4 for things.
*
* Needs MUCKER level 4 to bypass range checks for players.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_addpennies(PRIM_PROTOTYPE);
/**
* Implementation of MUF MOVETO
*
* Consumes two dbrefs, and moves the first object to the non-exit second.
*
* Needs MUCKER level 3 to bypass basic ownership and JUMP_OK checks, and
* also to move an exit.
*
* This code should be further reviewed, and restructured to be easier to
* understand and maintain - and match other movement logic when applicable.
* It *seems* like we may find some unexpected consequences of using
* fallthrough logic in the main switch.
*
* Here we go --
*
* Moving a player will fail if the destination is not a room or basic vehicle.
*
* Moving a player/thing will fail if it would create a parent loop.
*
* Moving a player/thing with less than MUCKER level 3 will fail if:
* - source location or destination is not JUMP_OK
* - source location or destination does not pass basic ownership checks
* - destinaton is a basic vehicle and source is not in the same room
* - source is a guest and the destination room does not accept guests
*
* Moving a player/thing/program will fail if the destination is not a player,
* thing, or room.
*
* Moving a player/thing/program with less than MUCKER level three will fail if
* the source location or destination is not JUMP_OK or does not pass basic
* ownership checks.
*
* Moving an exit will fail if the destination is not a player, thing, or
* room (as above!) - but also if the destination is HOME.
*
* Moving an exit with less that MUCKER level 3 will fail if neither source
* nor destination pass basic ownership checks.
*
* Moving a room will fail if:
* - the desintation is also not a room and tp_secure_thing_movement is off
* - the desitnation is the GLOBAL_ENVIRONMENT
*
* Moving a room with less than MUCKER level 3 will fail if the destination
* is HOME and the source and source location do not pass basic ownership
* checks. Otherwise, the source must pass basic ownership and teleport
* checks and the movement must not create a parent loop.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_moveto(PRIM_PROTOTYPE);
/**
* Implementation of MUF PENNIES
*
* Consumes a player or thing dbref and returns its value. Requires
* MUCKER level tp_pennies_muf_mlev and remote-read permissions when
* applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_pennies(PRIM_PROTOTYPE);
/**
* Implementation of MUF DBREF
*
* Consumes an integer, and returns it as a dbref - which is not guaranteed
* to be valid.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_dbref(PRIM_PROTOTYPE);
/**
* Implementation of MUF CONTENTS
*
* Consumes a dbref, and returns the first dbref in its contents chain -
* which for MUCKER level 1 only returns controlled non-DARK objects.
* Requires remote-read permissions when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_contents(PRIM_PROTOTYPE);
/**
* Implementation of MUF EXITS
*
* Consumes a dbref, and returns the first dbref in its exits chain.
* Requires remote-read privileges when applicable.
*
* Needs MUCKER level 3 to bypass basic ownership checks.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_exits(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEXT
*
* Consumes a dbref, and returns the next dbref in its contents/exits
* chain - which for MUCKER level 1 only traverses controlled non-DARK exits.
* Requires remote-read permissions when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_next(PRIM_PROTOTYPE);
/**
* Implementation of MUF NAME
*
* Consumes a dbref, and returns the associated name. Requires remote-read
* privileges when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_name(PRIM_PROTOTYPE);
/**
* Implementation of MUF SETNAME
*
* Consumes a dbref and a string, and sets the name associated with the
* object. Setting a player name requires MUCKER level 4 and the player's
* password inside the given string (delimited by a space). Also required
* to change the name of objects that don't pass basic ownership checks.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_setname(PRIM_PROTOTYPE);
/**
* Implementation of MUF PMATCH
*
* Consumes a string, and returns the player dbref with a name that matches
* the ANSI-stripped string, or NOTHING if no match. Recognizes 'me'.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_pmatch(PRIM_PROTOTYPE);
/**
* Implementation of MUF MATCH
*
* Consumes a string, and returns the dbref that matches the ANSI-stripped
* string. Recognizes registered objects, local matches, 'me', 'here',
* 'home', and 'nil'. Wizard programs and users can also match dbref
* strings and player lookups.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_match(PRIM_PROTOTYPE);
/**
* Implementation of MUF RMATCH
*
* Consumes a dbref and a string, and returns the dbref that matches one of
* the object's contents or exits. Requires remote-read privileges when
* applicable. Aborts when given an exit or program dbref.
*
* Does not ANSI-strip the string before matching.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_rmatch(PRIM_PROTOTYPE);
/**
* Implementation of MUF COPYOBJ
*
* Consumes a thing dbref, copies the object's name and properties, and
* returns the new dbref. Requires remote-read privilges when applicable.
*
* Programs below MUCKER level 3 are restricted to creating one object per
* frame. That object must pass basic ownership checks and its copy has
* its value reset to 0.
*
* Currently calls copyobj. @see copyobj
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_copyobj(PRIM_PROTOTYPE);
/**
* Implementation of MUF SET
*
* Consumes a dbref and a string, and sets or resets the flag on the object
* accoringly. Reognizes flag aliases and Requires remote-read privileges
* when applicable.
*
* Programs below MUCKER level 4 cannot act on:
* - objects that don't pass basic ownership checks
* - ABODE flags on programs
* - BUIDLER flags
* - DARK flags on exits with exit_darking sysparm = no
* - DARK flags on players
* - DARK flags on things with thing_darking sysparm = no
* - GUEST flags
* - INTERACTIVE, MUCKER, or SMUCKER ("nucker") internal flags
* - OVERT flags
* - QUELL flags
* - WIZARD flags
* - XFORCIBLE flags
* - YIELD flags
* - ZOMBIE flags on players
* - ZOMBIE flags on things if effective user is maked ZOMBIE.
*
* No program is able to:
* - reset the VEHICLE flag of a basic vehicle with polayers in it
* - interact with the OVERT flag on objects that aren't a thing or room
* - interact with the YIELD flag on objects that aren't a thing or room
*
*
* "truewizard" is merely an alias for the WIZARD flag here.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_set(PRIM_PROTOTYPE);
/**
* Implementation of MUF MLEVEL
*
* Consumes a dbref, and returns its raw MUCKER level. Objects with the
* WIZARD flag and a MUCKER level are returned as 4. Requires remote-read
* privileges when applicable.
*
* If the given dbref is NOTHING, returns the effective MUCKER level of
* the running program.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_mlevel(PRIM_PROTOTYPE);
/**
* Implementation of MUF FLAG?
*
* Consumes a dbref and a string, and returns a boolean that represents if
* the object's flag is set accordingly. Requires remote-read priviliges
* when applicable.
*
* Checking "truewizard" is the same as checking "wizard" and "!quell".
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_flagp(PRIM_PROTOTYPE);
/**
* Implementation of MUF PLAYER?
*
* Consumes a dbref, and returns a boolean that represents if the object
* is a player. Requires remote-read privilges when applicable.
*
* Any recycled object or negative dbref returns 0.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_playerp(PRIM_PROTOTYPE);
/**
* Implementation of MUF THING?
*
* Consumes a dbref, and returns a boolean that represents if the object
* is a thing. Requires remote-read privilges when applicable.
*
* Any recycled object or negative dbref returns 0.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_thingp(PRIM_PROTOTYPE);
/**
* Implementation of MUF ROOM?
*
* Consumes a dbref, and returns a boolean that represents if the object
* is a room. Requires remote-read privilges when applicable.
*
* Any recycled object, NOTHING, AMBIGUOUS, or NIL returns 0.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_roomp(PRIM_PROTOTYPE);
/**
* Implementation of MUF PROGRAM?
*
* Consumes a dbref, and returns a boolean that represents if the object
* is a program. Requires remote-read privilges when applicable.
*
* Any recycled object or negative dbref returns 0.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_programp(PRIM_PROTOTYPE);
/**
* Implementation of MUF EXIT?
*
* Consumes a dbref, and returns a boolean that represents if the object
* is an exit/action. Requires remote-read privilges when applicable.
*
* Any recycled object or negative dbref returns 0.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_exitp(PRIM_PROTOTYPE);
/**
* Implementation of MUF OK?
*
* Consumes a stack item, and returns a boolean that represents if it is an
* object that is not currently recycled.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_okp(PRIM_PROTOTYPE);
/**
* Implementation of MUF LOCATION
*
* Consumes a dbref, and returns the dbref of its location. Requires
* remote-read privileges when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_location(PRIM_PROTOTYPE);
/**
* Implementation of MUF OWNER
*
* Consumes a dbref, and returns the dbref of its owner. Requires
* remote-read privileges when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_owner(PRIM_PROTOTYPE);
/**
* Implementation of MUF CONTROLS
*
* Consumes two dbrefs, and returns a boolean representing if the first
* controls the second. Requires remote-read privileges for the second
* object when applicable.
*
* @see controls
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_controls(PRIM_PROTOTYPE);
/**
* Implementation of MUF GETLINK
*
* Consumes a dbref, and returns the dbref of its (first) link. Requires
* remote-read privileges when applicable.
*
* Currently does not work on programs.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_getlink(PRIM_PROTOTYPE);
/**
* Implementation of MUF GETLINKS
*
* Consumes a dbref, and returns a stackrange of dbrefs representing the
* object's links. Requires remote-read privileges when applicable.
*
* Currently does not work on programs.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_getlinks(PRIM_PROTOTYPE);
/**
* Implementation of MUF SETLINK
*
* Consumes two dbrefs, and sets the link of the first non-program object to
* the second object. Cannot link if it would create an exit/parent loop, or
* the source is unable to be linked to the target. @see prog_can_link_to
*
* Needs MUCKER level 4 to bypass basic ownership checks on the source.
*
* A target of NOTHING unlinks the given exit or room source. AMBIGUOUS
* is not a valid target.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_setlink(PRIM_PROTOTYPE);
/**
* Implementation of MUF SETOWN
*
* Consumes two dbrefs, and sets the owner of the first non-player object
* to the second player.
*
* Programs with a MUCKER level less than 4 cannot change the owner:
* - to other players
* - of non-chownable objects to players don't pass the chown-lock
* - of rooms that the player is not located in
* - of things that the player is not carrying
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_setown(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEWOBJECT
*
* Consumes a string and a dbref, creates a thing with the given name and
* player/room object as its home, and returns the new dbref. Requires
* remote-read privilges when applicable.
*
* Programs below MUCKER level 3 are restricted to creating one object per
* frame. The home object must pass basic ownership checks.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_newobject(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEWROOM
*
* Consumes a string and a dbref, creates a room with the given name and
* room object as its dropto, and returns the new dbref. Requires
* remote-read privilges when applicable.
*
* Programs below MUCKER level 3 are restricted to creating one object per
* frame. The dropto object must pass basic ownership checks.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_newroom(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEWEXIT
*
* Consumes a string and a dbref, creates an exit with the given name and
* object as its location, and returns the new dbref.
*
* Requires MUCKER level 3. Level 4 is needed to bypass basic ownership
* checks on the location object.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_newexit(PRIM_PROTOTYPE);
/**
* Implementation of MUF LOCKED?
*
* Consumes two dbrefs and returns a boolean representing if the first
* player/thing object is locked against the second object. Requires
* remote-read privileges for both objects when applicable.
*
* @see could_do_it
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_lockedp(PRIM_PROTOTYPE);
/**
* Implementation of MUF RECYCLE
*
* Consumes a non-player dbref, and recyles it.
*
* Requires MUCKER level 3. Level 4 is needed to bypass basic ownership
* checks.
*
* In addition, cannot use this to recycle:
* - the global environment
* - objects that are referred to by sysparm values
* - the currently-running program or those on the active call stack
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_recycle(PRIM_PROTOTYPE);
/**
* Implementation of MUF SETLOCKSTR
*
* Consumes a dbref and a string, sets the lock accordingly, and returns
* a boolean representing success or failure. Needs MUCKER level 4 to
* bypass basic ownership checks.
*
* @see setlockstr
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_setlockstr(PRIM_PROTOTYPE);
/**
* Implementation of MUF GETLOCKSTR
*
* Consumes a dbref, and returns its lock string or PROP_UNLOCKED_VAL if
* unlocked. Requires remote-read privileges when applicable.
*
* Needs MUCKER level 3 to bypass basic ownership chekcs.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_getlockstr(PRIM_PROTOTYPE);
/**
* Implementation of MUF PART_PMATCH
*
* Consumes a string, and returns the dbref of an online player that has
* a name that begins with the string. Requires MUCKER level 3.
*
* Can return NOTHING or AMBIGUOUS.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_part_pmatch(PRIM_PROTOTYPE);
/**
* Implementation of MUF CHECKPASSWORD
*
* Consumes a player dbref and a string, and returns a boolean representing
* if the given password is correct for that player. Requires MUCKER level 4.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_checkpassword(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEXTOWNED
*
* Consumes a dbref, and returns the next dbref in the database that is
* owned by the same player. If a player dbref is consumed, the entire
* database is searched. Requires MUCKER level 2.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_nextowned(PRIM_PROTOTYPE);
/**
* Implementation of MUF MOVEPENNIES
*
* Consumes two dbrefs and a non-negative integer, and moves that value from
* the first player/thing to the second. Requires MUCKER level
* tp_movepennies_muf_mlev for players and 4 for things.
*
* Needs MUCKER level 4 to bypass range checks for players.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_movepennies(PRIM_PROTOTYPE);
/**
* Implementation of MUF FINDNEXT
*
* Consumes two dbrefs (current object and an owner object) and two strings
* (name pattern and flag pattern), and returns the next object in the
* database that matches both patterns and has the specified owner.
*
* Requires MUCKER level 2. Needs MUCKER level 3 to search for objects
* with an owner other than the player (including specifying NOTHING to
* bypass the owner check.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_findnext(PRIM_PROTOTYPE);
/**
* Implementation of MUF SETLINKS_ARRAY
*
* Consumes a dbref and a sequential array of dbrefs, and sets the links of
* the single dbref to the contents of the array. The array may contain
* more than one item (up to MAX_LINKS) if the source is an exit.
*
* Needs MUCKER level 4 to bypass basic ownership checks on the source.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_setlinks_array(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEXTENTRANCE
*
* Consumes two dbrefs, and returns the next object in the database after
* the second that is linked to the first. Requires MUCKER level 3.
*
* This primitive does resolve HOME to the player's home.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_nextentrance(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEWPLAYER
*
* Consumes two strings (name and password), and returns the dbref of
* the new player created if successful. Requires MUCKER level 4.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_newplayer(PRIM_PROTOTYPE);
/**
* Implementation of MUF COPYPLAYER
*
* Consumes a dbref and two strings (name and password), and returns the
* dbref of new player created from the template object if successful.
* Requires MUCKER level 4.
*
* The new player has the flags, properties, home, and value of the template
* object - and is relocated to its home.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_copyplayer(PRIM_PROTOTYPE);
/**
* Implementation of MUF OBJMEM
*
* Consumes a dbref, and returns the number of bytes of memory it currently
* uses. This works on recycled objects.
*
* @see size_object
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_objmem(PRIM_PROTOTYPE);
/**
* Implementation of MUF INSTANCES
*
* Consumes a program dbref, and returns the number of active processes
* that are running its code.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_instances(PRIM_PROTOTYPE);
/**
* Implementation of MUF COMPILED?
*
* Consumes a program dbref, and returns the number of compiled instructions
* it has, or 0 if it is not compiled.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_compiledp(PRIM_PROTOTYPE);
/**
* Implementation of MUF NEWPROGRAM
*
* Consumes a string, creates a program with that name, and returns its
* dbref. Requires MUCKER level 4.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_newprogram(PRIM_PROTOTYPE);
/**
* Implementation of MUF CONTENTS_ARRAY
*
* Consumes a dbref, and returns an array of its contents. Only returns
* controlled non-DARK objects for MUCKER level 1. Requires remote-read
* permissions when applicable.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame
*/
void prim_contents_array(PRIM_PROTOTYPE);
/**
* Implementation of MUF EXITS_ARRAY
*
* Consumes a dbref, and returns an array of its exits. Requires
* remote-read permissions when applicable.
*
* Needs MUCKER level 3 to byp[ass basic ownership checks.
*
* @param player the player running the MUF program
* @param program the program being run
* @param mlev the effective MUCKER level
* @param pc the program counter pointer
* @param arg the argument stack
* @param top the top-most item of the stack
* @param fr the program frame