7#ifndef SHELL_KEYWORDS_H
8#define SHELL_KEYWORDS_H
10#include "shell_languages.h"
com_parameters * com_make_parameters(com_command *, com_parameters *)
Adds a new parameter to a parameters chain.
Definition shell_keywords.c:435
string_chain * com_make_string_chain(char *, string_chain *)
Adds another link to a string chain.
Definition shell_keywords.c:427
bool check_varname(const char *str)
Check if a variable name is valid: it is not a keyword.
Definition shell_keywords.c:278
bool com_israw(const com_command *com)
Check if a command is raw text.
Definition shell_keywords.c:354
com_keyword key_from_string_chain_single(const string_chain *strchain)
Get the keyword associated with a single link string chain.
Definition shell_keywords.c:414
com_type
The two kinds of commands.
Definition shell_keywords.h:192
@ CMT_KEY
Standard command (with parameters, with chain).
Definition shell_keywords.h:195
@ CMT_RAW
Raw text command (no parameters, no chain)
Definition shell_keywords.h:193
@ CMT_IND
Indexed command (no parameters, with chain).
Definition shell_keywords.h:194
com_keyword key_from_string_chain(const string_chain *strchain)
Get the keyword associated with the first link in a string chain.
Definition shell_keywords.c:403
com_command * com_make_command(char *, com_command *)
Adds a new link to a command.
Definition shell_keywords.c:449
com_keyword string_to_keyword(const char *str)
Convert a string to a keyword.
Definition shell_keywords.c:269
com_keyword
The keywords.
Definition shell_keywords.h:19
com_command * com_init_command(char *, com_parameters *)
Initializes a single link command.
Definition shell_keywords.c:462
bool com_isclass(com_command *com)
Check if a command is a class.
Definition shell_keywords.c:294
com_command * com_getparam(const com_parameters *com, int i)
Gets the n-th parameter of a command.
Definition shell_keywords.c:384
void com_free_string_chain(string_chain *)
Frees a string chain.
Definition shell_keywords.c:509
com_command * com_init_rawcommand(char *)
Initializes a raw text command.
Definition shell_keywords.c:475
void com_free_command(com_command *)
Frees a command.
Definition shell_keywords.c:525
bool com_single(const com_command *com)
Check if a command is a single link without parameters.
Definition shell_keywords.c:361
void keywords_add_all_keys(void)
Initialization of all the keywords.
Definition shell_keywords.c:27
int com_nbparams(const com_parameters *pars)
Computes the number of parameters of a command.
Definition shell_keywords.c:375
bool com_single_par(const com_command *com)
Check if a command is a single link with or without parameters.
Definition shell_keywords.c:368
const char * keywordtostring(com_keyword key)
Convert a keyword to the associated string.
Definition shell_keywords.c:260
void print_string_chain(const string_chain *stchain, FILE *out)
Display a string chain.
Definition shell_keywords.c:190
void keywords_add_key(com_keyword key, const char *str)
Initialization of a single keyword.
Definition shell_keywords.c:18
com_command * com_init_indexing(char *, char *)
Initializes an indexed command.
Definition shell_keywords.c:488
void com_free_parameters(com_parameters *)
Frees the parameters of a command.
Definition shell_keywords.c:517
void print_command(com_command *com, FILE *out)
Display a command.
Definition shell_keywords.c:204
A command.
Definition shell_keywords.h:221
uint ind
The index of the command (when it is of indexed type).
Definition shell_keywords.h:224
string_chain * main
The string chain of the command.
Definition shell_keywords.h:223
com_parameters * params
The parameters of the command.
Definition shell_keywords.h:225
com_type thetype
The type of the command.
Definition shell_keywords.h:222
Parameters of a command.
Definition shell_keywords.h:211
struct com_parameters * next
The next parameters.
Definition shell_keywords.h:214
struct com_command * param
The first parameter.
Definition shell_keywords.h:213
uchar count
Number of parameters.
Definition shell_keywords.h:212
Chain of strings in a command.
Definition shell_keywords.h:202
char * string
The string.
Definition shell_keywords.h:203
struct string_chain * next
The next link in the chain.
Definition shell_keywords.h:204