-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsers.h
49 lines (36 loc) · 1.13 KB
/
parsers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __HEADER_PARSERS_H__
#define __HEADER_PARSERS_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include <unistd.h>
#include <ncurses.h>
#include "mystring.h"
#include "utils.h"
#include "parsers.h"
#include "main.h"
#include "commands.h"
#define MAX_TOKENS 1024
extern String buf;
extern String outbuf;
extern String clip;
extern String pipebuf;
extern char *filename;
extern int is_saved;
char *skip_space(char *cmd);
/* read a token from the input line (with/without quotes)
returns a pointer to the end of the token */
char *readtok(char *cmd);
/* split the input line into tokens. The last token is NULL. '\' is handled in tokens */
int split(char *cmd, char *res[]);
/* parse the find pattern with wildcards */
void parsestr_wildcard(char *cmd);
/* parse a single extracted token without considering * as a special character */
void parsestr(char *cmd);
/* parse a single command (not including pipes) */
int parse_command(char *split_cmd[], int pipe_mode);
/* parse one line of input and handle pipes between commands */
int parse_line(char *cmd);
#endif // __HEADER_PARSERS_H__