|
libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
|

Go to the source code of this file.
Typedefs | |
| typedef int(* | cmd_cb_t) (XPLMCommandRef ref, XPLMCommandPhase phase, void *refcon) |
Functions | |
| XPLMCommandRef | cmd_find (const char *fmt,...) |
| XPLMCommandRef | fcmd_find (const char *fmt,...) |
| XPLMCommandRef | cmd_find_v (const char *fmt, va_list ap) |
| XPLMCommandRef | fcmd_find_v (const char *fmt, va_list ap) |
| XPLMCommandRef | cmd_bind (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon,...) |
| XPLMCommandRef | cmd_bind_v (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon, va_list ap) |
| XPLMCommandRef | fcmd_bind (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon,...) |
| bool_t | cmd_unbind (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon,...) |
| bool_t | cmd_unbind_v (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon, va_list ap) |
| void | fcmd_unbind (const char *fmt, cmd_cb_t cb, bool_t before, void *refcon,...) |
This file contains convenience functions to interact with X-Plane's command handling machinery.
Definition in file cmd.h.
| typedef int(* cmd_cb_t) (XPLMCommandRef ref, XPLMCommandPhase phase, void *refcon) |
| XPLMCommandRef cmd_bind | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| ... | |||
| ) |
Performs a combination of an XPLMFindCommand followed by an XPLMRegisterCommandHandler, with support for printf-style command name construction.
| fmt | A printf-style format string that specifies the command name to search for. The variadic arguments must comply with the format string's format specifiers. |
| cb | The callback to register for the command handler. |
| before | Specifies whether the callback should be invoked before X-Plane handles the command, or after. |
| refcon | Reference constant that will be passed by X-Plane to the command handler every time cb is called. |
NULL. If the command doesn't exist, no callback registration takes place. | XPLMCommandRef cmd_bind_v | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| va_list | ap | ||
| ) |
Same as cmd_bind(), but takes a va_list for the format arguments, instead of being variadic.
| XPLMCommandRef cmd_find | ( | const char * | fmt, |
| ... | |||
| ) |
Performs the equivalent of XPLMFindCommand(), but with printf-style auto-formatting support for the command name.
| fmt | A printf-style format string that specifies the command name to search for. The remaining arguments must comply with the format string's format specifiers. |
NULL. | XPLMCommandRef cmd_find_v | ( | const char * | fmt, |
| va_list | ap | ||
| ) |
Same as cmd_find(), but takes a va_list for the format arguments, instead of being variadic.
| bool_t cmd_unbind | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| ... | |||
| ) |
Same as cmd_bind(), but instead of registering the callback, unregisters it.
| bool_t cmd_unbind_v | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| va_list | ap | ||
| ) |
Same as cmd_bind_v(), but instead of registering the callback, unregisters it.
| XPLMCommandRef fcmd_bind | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| ... | |||
| ) |
Same as cmd_bind(), but if the command doesn't exist, causes an assertion failure ("f" prefix meaning "force").
| XPLMCommandRef fcmd_find | ( | const char * | fmt, |
| ... | |||
| ) |
Same as cmd_find(), but if the command doesn't exist, causes an assertion failure ("f" prefix meaning "force").
| XPLMCommandRef fcmd_find_v | ( | const char * | fmt, |
| va_list | ap | ||
| ) |
Same as fcmd_find(), but takes a va_list for the format arguments, instead of being variadic.
| void fcmd_unbind | ( | const char * | fmt, |
| cmd_cb_t | cb, | ||
| bool_t | before, | ||
| void * | refcon, | ||
| ... | |||
| ) |
Same as fcmd_bind(), but instead of registering the callback, unregisters it.