/* --commands (commands.c): while pic runs a request, Pi's RPC command lines * on a descriptor (stdin) steer it. Supported: steer, follow_up (prompt * templates expanded; Pi's images field attached), clear_queue, abort (Ctrl-C's cancel), * set_steering_mode and set_follow_up_mode ("all" or "one-at-a-time"), * set_auto_compaction (Pi's compaction.enabled, saved in the user's settings). * Each gets Pi's response line on the events' out; anything else is an * error response and the run goes on. The descriptor is read only when pic * waits (net.h's side descriptor) and at each step of the loop, never inside * a transaction; accepted messages are journaled before the response. */ #ifndef PIC_COMMANDS_H #define PIC_COMMANDS_H #include "pic.h" /* expand returns a template's expansion of TEXT (malloc'd), or NULL to keep it. */ void pic_commands_start(pic_store *s, int fd, char *(*expand)(void *ctx, const char *text), void *ctx); void pic_commands_stop(void); #endif