summaryrefslogtreecommitdiff
path: root/src/expand.h
blob: b353f3910d6de39364548dd0ecb22102c19f6900 (plain)
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
# pragma once

#include "preproc.h"
#include "utils.h"

typedef enum {
     SLOT_STR,
     SLOT_SPEC,
     SLOT_PROC_IN,
     SLOT_PROC_OUT,
} SlotKind;

typedef struct {
    SlotKind kind;
    union {
        char* str;
        SpecialToken spec;
        Region* proc_reg;
    } as;
} Slot;

DECLARE_VEC(Slot, SlotVec)

typedef struct {
    SlotVec cmd_slots;
    Connector conn;
} ExpandedPipelineElement;

DECLARE_VEC(ExpandedPipelineElement, ExpandedPipeline)

ExpandedPipeline expand_pipeline(Pipeline* pl, ShellState* shstate);