fish/fish_shell/fish_types.h

60 lines
832 B
C
Raw Normal View History

//
// Created by Antoine Bartuccio on 14/05/2017.
//
#ifndef FISH_FISH_TYPES_H
#define FISH_FISH_TYPES_H
2017-05-29 14:19:42 +00:00
#include <sys/types.h>
#include <unistd.h>
#include <pwd.h>
#define EXIT_SIGNAL -100
2017-05-29 13:19:52 +00:00
#define ERROR_STRING "\n"
/* Custom types */
typedef enum {
NONE,
PIPE,
BACKGROUND_PROCESS,
AND,
OR,
REVERSE_AND
} shell_operator ;
typedef struct {
2017-05-15 09:22:53 +00:00
char ** words;
int size;
} WordArray;
2017-05-15 13:02:58 +00:00
typedef struct elem {
char * word;
struct elem * previous;
struct elem * next;
} WordListElement;
typedef struct {
int size;
WordListElement * first;
WordListElement * last;
} WordList;
2017-05-29 13:19:52 +00:00
typedef struct {
2017-05-15 09:22:53 +00:00
char *PS1;
2017-05-29 14:19:42 +00:00
char *PS2;
2017-05-29 17:42:02 +00:00
struct passwd* passwd;
} Settings;
typedef struct {
int to_use;
int read;
int tmp_file;
char * file_name;
} pipe_redirection;
typedef int (builtinCommand) (WordArray*);
#endif //FISH_FISH_TYPES_H