root/1.8.3/tags/p6/hdrs/match.h

Revision 919, 2.3 KB (checked in by shawnw, 19 months ago)

1.8.3p3

Line 
1/* match.h */
2
3#ifndef __MATCH_H
4#define __MATCH_H
5
6#include "copyrite.h"
7
8/* match constants */
9  /* match modifiers */
10#define MAT_CHECK_KEYS   0x000001
11#define MAT_GLOBAL       0x000002
12#define MAT_REMOTES      0x000004
13#define MAT_CONTROL      0x000008
14  /* individual things to match */
15#define MAT_ME           0x000010
16#define MAT_HERE         0x000020
17#define MAT_ABSOLUTE     0x000040
18#define MAT_PLAYER       0x000080
19#define MAT_NEIGHBOR     0x000100
20#define MAT_POSSESSION   0x000200
21#define MAT_EXIT         0x004000
22#define MAT_PMATCH       0x008000
23  /* special things to match */
24#define MAT_CARRIED_EXIT     0x010000
25#define MAT_CONTAINER        0x020000
26#define MAT_REMOTE_CONTENTS  0x040000
27#define MAT_NEAR             0x080000
28#define MAT_ENGLISH          0x100000
29  /* types of match results - used internally */
30#define MAT_NOISY                0x1000000
31#define MAT_LAST                 0x2000000
32  /* groups of things to match */
33#define MAT_EVERYTHING   (MAT_ME|MAT_HERE|MAT_ABSOLUTE|MAT_PLAYER| \
34                          MAT_NEIGHBOR|MAT_POSSESSION|MAT_EXIT|MAT_ENGLISH)
35#define MAT_NEARBY       (MAT_EVERYTHING|MAT_NEAR)
36#define MAT_OBJECTS      (MAT_ME|MAT_ABSOLUTE|MAT_PLAYER|MAT_NEIGHBOR| \
37                          MAT_POSSESSION)
38#define MAT_NEAR_THINGS  (MAT_OBJECTS|MAT_NEAR)
39#define MAT_LIMITED      (MAT_ABSOLUTE|MAT_PLAYER|MAT_NEIGHBOR)
40#define MAT_REMOTE       (MAT_ABSOLUTE|MAT_PLAYER|MAT_REMOTE_CONTENTS|MAT_EXIT)
41
42
43/* Functions we can call */
44/* These functions do the matching and return the result:
45 * match_result - returns match, NOTHING, or AMBIGUOUS
46 * noisy_match_result - notifies player, returns match or NOTHING
47 * last_match_result - returns a match or NOTHING
48 * match_controlled - returns match if player controls, or NOTHING
49 */
50extern dbref match_result
51  (const dbref who, const char *name, const int type, const long int flags);
52extern dbref noisy_match_result
53  (const dbref who, const char *name, const int type, const long int flags);
54extern dbref last_match_result
55  (const dbref who, const char *name, const int type, const long int flags);
56extern dbref match_controlled(dbref player, const char *name);
57
58#define match_thing(player,name) \
59  noisy_match_result((player), (name), NOTYPE, MAT_EVERYTHING)
60
61#endif                          /* __MATCH_H */
Note: See TracBrowser for help on using the browser.