summaryrefslogtreecommitdiff
path: root/expand.h
blob: 8d00a720bbfe3f934efa03a7c142e862c1b262da (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
32
# pragma once

#include "exec.h"
#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);