summaryrefslogtreecommitdiffstats
path: root/input/cmd.h
Commit message (Collapse)AuthorAgeFilesLines
* command: add a way to abort asynchronous commandswm42018-05-241-0/+4
| | | | | | | | | | | | Many asynchronous commands are potentially long running operations, such as loading something from network or running a foreign process. Obviously it shouldn't just be possible for them to freeze the player if they don't terminate as expected. Also, there will be situations where you want to explicitly stop some of those operations explicitly. So add an infrastructure for this. Commands have to support this explicitly. The next commit uses this to actually add support to a command.
* command: add a subprocess commandwm42018-05-241-0/+1
| | | | | | | This supports named arguments. It benefits from the infrastructure of async commands. The plan is to reimplement Lua's utils.subprocess() on top of it.
* input: remove unused fieldwm42018-05-241-1/+0
| | | | This was forgotten in commit fb9bbf2a0d7f8.
* command: add infrastructure for async commandswm42018-05-241-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This enables two types of command behavior: 1. Plain async behavior, like "loadfile" not completing until the file is fully loaded. 2. Running parts of the command on worker threads, e.g. for I/O, such as "sub-add" doing network accesses on a thread while the core continues. Both have no implementation yet, and most new code is actually inactive. The plan is to implement a number of useful cases in the following commits. The most tricky part is handling internal keybindings (input.conf) and the multi-command feature (concatenating commands with ";"). It requires a bunch of roundabout code to make it do the expected thing in combination with async commands. There is the question how commands should be handled that come in at a higher rate than what can be handled by the core. Currently, it will simply queue up input.conf commands as long as memory lasts. The client API is limited by the size of the reply queue per client. For commands which require a worker thread, the thread pool is limited to 30 threads, and then will queue up work in memory. The number is completely arbitrary.
* input: move an enum back to its correct placewm42018-05-241-13/+0
| | | | This was accidentally moved together with the cmd stuff.
* input: rename weirdly named functionwm42018-05-031-1/+2
|
* input: move some more cmd definitions to cmd.hwm42018-05-031-0/+64
| | | | | | Now both command "descriptions" and runtime command instances are in cmd.h, which makes sense to me. input.h is now for the actual input context.
* input: merge cmd_list.c with cmd.cwm42018-05-031-0/+32
| | | | | | It doesn't really make sense to keep a separate cmd_list.c file, which does _not_ contain a command list, but only a few minor helper functions.
* input: rename cmd_parse.h to cmd.hwm42018-05-031-0/+55