|
Crossfire Server, Branch 1.12
R12190
|
Structures and functions used for the dialog system. More...

Go to the source code of this file.
Functions | |
| void | free_dialog_information (object *op) |
| Frees obj::dialog_information. | |
| int | get_dialog_message (object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply) |
| Tries to find a message matching the said text. | |
| static int | matches (const char *exp, const char *text) |
| Does the text match the expression? | |
| static void | parse_dialog_information (object *op) |
| Parse the dialog information for op, and fills in obj::dialog_information. | |
Structures and functions used for the dialog system.
Definition in file dialog.c.
| void free_dialog_information | ( | object * | op | ) |
Frees obj::dialog_information.
| op | what to clean for. |
Definition at line 39 of file dialog.c.
References CLEAR_FLAG, FLAG_DIALOG_PARSED, struct_dialog_message::match, struct_dialog_reply::message, struct_dialog_message::message, struct_dialog_reply::next, struct_dialog_message::next, QUERY_FLAG, struct_dialog_message::replies, and struct_dialog_reply::reply.
Referenced by clear_object(), copy_object(), and free_object2().

| int get_dialog_message | ( | object * | op, |
| const char * | text, | ||
| struct_dialog_message ** | message, | ||
| struct_dialog_reply ** | reply | ||
| ) |
Tries to find a message matching the said text.
| op | who is being talked to. | |
| text | what is being said. | |
| [out] | message | what op should say. Won't be NULL if return is 1. |
| [out] | reply | text the one talking should say based on the text. Can be NULL. |
Definition at line 214 of file dialog.c.
References FLAG_DIALOG_PARSED, matches(), struct_dialog_reply::next, struct_dialog_message::next, parse_dialog_information(), and QUERY_FLAG.
Referenced by do_talk_npc().


| static int matches | ( | const char * | exp, |
| const char * | text | ||
| ) | [static] |
Does the text match the expression?
| exp | expression to try to match. |
| text | what to test. |
Definition at line 86 of file dialog.c.
References re_cmp(), and strtok_r.
Referenced by get_dialog_message(), and re_cmp_step().


| static void parse_dialog_information | ( | object * | op | ) | [static] |
Parse the dialog information for op, and fills in obj::dialog_information.
Can be called safely multiple times (will just ignore the other calls).
| op | object to parse the obj::msg field. |
Definition at line 114 of file dialog.c.
References FALSE, fatal(), FLAG_DIALOG_PARSED, llevDebug, LOG(), struct_dialog_message::match, struct_dialog_reply::message, struct_dialog_message::message, struct_dialog_reply::next, struct_dialog_message::next, OUT_OF_MEMORY, QUERY_FLAG, struct_dialog_message::replies, struct_dialog_reply::reply, rt_question, rt_reply, SET_FLAG, strtok_r, TRUE, and struct_dialog_reply::type.
Referenced by get_dialog_message().


1.7.6.1