2 // Copyright (c) 2017 Intel Corporation
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef __INCLUDE_PIPELINE_H__
18 #define __INCLUDE_PIPELINE_H__
20 #include <cmdline_parse.h>
22 #include "pipeline_be.h"
25 * Pipeline type front-end operations
28 typedef void* (*pipeline_fe_op_init)(struct pipeline_params *params, void *arg);
30 typedef int (*pipeline_fe_op_free)(void *pipeline);
32 struct pipeline_fe_ops {
33 pipeline_fe_op_init f_init;
34 pipeline_fe_op_free f_free;
35 cmdline_parse_ctx_t *cmds;
42 struct pipeline_type {
45 /* pipeline back-end */
46 struct pipeline_be_ops *be_ops;
48 /* pipeline front-end */
49 struct pipeline_fe_ops *fe_ops;
52 static inline uint32_t
53 pipeline_type_cmds_count(struct pipeline_type *ptype)
55 cmdline_parse_ctx_t *cmds;
58 if (ptype->fe_ops == NULL)
61 cmds = ptype->fe_ops->cmds;
65 for (n_cmds = 0; cmds[n_cmds]; n_cmds++);
71 parse_pipeline_core(uint32_t *socket,