00001 00002 /* match.h */ 00003 00004 /* $Id: match.h,v 1.3 2005/06/23 02:59:58 murrayma Exp $ */ 00005 00006 #include "copyright.h" 00007 00008 #ifndef M_MATCH_H 00009 #define M_MATCH_H 00010 00011 #include "db.h" 00012 00013 typedef struct match_state MSTATE; 00014 struct match_state { 00015 int confidence; /* How confident are we? CON_xx */ 00016 int count; /* # of matches at this confidence */ 00017 int pref_type; /* The preferred object type */ 00018 int check_keys; /* Should we test locks? */ 00019 dbref absolute_form; /* If #num, then the number */ 00020 dbref match; /* What I've found so far */ 00021 dbref player; /* Who is performing match */ 00022 char *string; /* The string to search for */ 00023 }; 00024 00025 /* Match functions 00026 * Usage: 00027 * init_match(player, name, type); 00028 * match_this(); 00029 * match_that(); 00030 * ... 00031 * thing = match_result() 00032 */ 00033 00034 extern void init_match(dbref, char *, int); 00035 extern void init_match_check_keys(dbref, char *, int); 00036 extern void match_player(void); 00037 extern void match_absolute(void); 00038 extern void match_numeric(void); 00039 extern void match_me(void); 00040 extern void match_here(void); 00041 extern void match_home(void); 00042 extern void match_possession(void); 00043 extern void match_neighbor(void); 00044 extern void match_exit(void); 00045 extern void match_exit_with_parents(void); 00046 extern void match_carried_exit(void); 00047 extern void match_carried_exit_with_parents(void); 00048 extern void match_master_exit(void); 00049 extern void match_everything(int); 00050 extern dbref match_result(void); 00051 extern dbref last_match_result(void); 00052 extern dbref match_status(dbref, dbref); 00053 extern dbref noisy_match_result(void); 00054 extern dbref dispatched_match_result(dbref); 00055 extern int matched_locally(void); 00056 extern void save_match_state(MSTATE *); 00057 extern void restore_match_state(MSTATE *); 00058 extern dbref match_controlled_quiet(dbref player, char *name); 00059 extern void match_zone_exit(void); 00060 00061 #define NOMATCH_MESSAGE "I don't see that here." 00062 #define AMBIGUOUS_MESSAGE "I don't know which one you mean!" 00063 #define NOPERM_MESSAGE "Permission denied." 00064 00065 #define MAT_NO_EXITS 1 /* Don't check for exits */ 00066 #define MAT_EXIT_PARENTS 2 /* Check for exits in parents */ 00067 #define MAT_NUMERIC 4 /* Check for un-#ified dbrefs */ 00068 #define MAT_HOME 8 /* Check for 'home' */ 00069 00070 #endif