19 # define MASK_DOLLAR '\x02'
20 # define MASK_STAR '\x01'
81 void expand_wildcards(
t_token **head);
83 int wildcard_match(
char *pattern,
char *str);
85 void print_ambig(
char *name);
87 void sort_matches(
char **arr,
int count);
89 char *build_chain_pattern(
t_token *start,
int *has_wildcard);
91 void replace_chain(
char **m,
int cnt,
t_wild_ctx *ctx);
Central type definitions for mandatory part.
t_token_type
Token types produced by Lexer.
t_quote_type
Quote context of a token.
Environment variable (doubly linked list)
Lexer token (singly linked list)
char * expand_variables(char *str, t_env *env_list, t_quote_type quote_type, int exit_status)
Expand all $VARIABLE in a string.
int process_word_token(char *s, t_token **head)
Process a word token composed of quoted and unquoted chunks.
int is_word_end(char c)
Check if a character ends a word token.
void free_token_list(t_token *head)
Free the entire token linked list.
char * expand_full(char *str, t_env *env, t_quote_type qt, int exit_status)
Handles variable expansion and tilde expansion.
int is_var_char(char c)
Check if a character is valid in a variable name.
void add_token(t_token **head, t_token *new_token)
Add a token to the end of a linked list.
t_token * tokenize(char *input)
Tokenize the input string into a linked list of tokens.
void free_token(t_token *token)
Free a single token and its value str.
int is_whitespace(char c)
Check if a character is whitespace.
char * extract_var_name(char *str, int *len)
Extract a variable name from after the $
char * append_str(char *s1, char *s2)
Concatenates 2 strings and frees the first.
int process_operator_token(char *input, t_token **head)
Process an operator token.
t_token_type get_operator_token_type(char *str, int *len)
Determine operator token type and its length in characters.
int is_operator(char c)
Check if a character is a shell operator.
int expand_all_tokens(t_token *tokens, t_shell *shell)
Expand all token values before parsing.
char * append_char(char *str, char c)
Append a single character to an allocated string.
t_token * create_token(t_token_type type, char *value)
Allocate and initialize a new token.
int is_dollar_quote(t_token *tok)
Check if a token is a $ connected to a quoted token.