/* Copyright (c) 2021 nytpu * SPDX-License-Identifier: GPL-3.0-only * For more license details, see LICENSE or . */ #pragma once #ifndef _COMMAND_H #define _COMMAND_H #include "common.h" #include struct command { // addresses // TODO: add mark support and regex. should marks and regex be // evaluated when parsing or by the command loop? int cnt; // Number of addresses in command: 0, 1, or 2 RowNum start; // start of range RowNum end; // end of range. also use for individual addresses, as // single-addr commands should use end if range is given // commands char command; // \0 is the so-called "null" command char suffix; // \0 if no suffix // should be determinable which is in use via command union { char *name; // filename given to `f`, `e`, and `r` RowNum target_addr; // address given to `m` and `t` // TODO: add additional parameters for searches and such }; }; int parse_command(struct command *c, char *l); #endif // _COMMAND_H