Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-flow-parser.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include <stdbool.h>
22 
23 #include "sol-buffer.h"
24 #include "sol-flow.h"
25 #include "sol-flow-resolver.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
55 struct sol_flow_parser;
57 
61 typedef struct sol_flow_parser_client {
62 #ifndef SOL_NO_API_VERSION
63 #define SOL_FLOW_PARSER_CLIENT_API_VERSION (1)
64  uint16_t api_version;
65 #endif
66  void *data;
81  int (*read_file)(void *data, const char *name, struct sol_buffer *buf);
83 
95  const struct sol_flow_parser_client *client,
96  const struct sol_flow_resolver *resolver);
97 
106  struct sol_flow_parser *parser);
107 
119  struct sol_flow_parser *parser,
120  const struct sol_buffer *buf,
121  const char *filename);
122 
136  struct sol_flow_parser *parser,
137  const char *str,
138  const char *filename);
139 
151  struct sol_flow_parser *parser,
152  const char *metatype,
153  const struct sol_buffer *buf,
154  const char *filename);
155 
170  struct sol_flow_parser *parser,
171  const char *metatype,
172  const char *str,
173  const char *filename);
174 
179 #ifdef __cplusplus
180 }
181 #endif
These routines are used for Soletta flow language's .conf file entries resolving. ...
struct sol_flow_node_type * sol_flow_parse_string_metatype(struct sol_flow_parser *parser, const char *metatype, const char *str, const char *filename)
Similar to sol_flow_parse_buffer_metatype but accepts C string.
uint16_t api_version
API version.
Definition: sol-flow-parser.h:64
struct sol_flow_parser sol_flow_parser
Flow Parser handle.
Definition: sol-flow-parser.h:56
void * data
Client data.
Definition: sol-flow-parser.h:66
Resolver's structure.
Definition: sol-flow-resolver.h:54
struct sol_flow_parser * sol_flow_parser_new(const struct sol_flow_parser_client *client, const struct sol_flow_resolver *resolver)
Creates a new instance of sol_flow_parser.
These are routines that Soletta provides for its buffer implementation.
struct sol_flow_node_type * sol_flow_parse_buffer_metatype(struct sol_flow_parser *parser, const char *metatype, const struct sol_buffer *buf, const char *filename)
Parsers a buf of a given metatype and returns the resulting node type.
The node type describes the capabilities and operations of a node.
Definition: sol-flow.h:796
Flow Parser's client structure.
Definition: sol-flow-parser.h:61
int(* read_file)(void *data, const char *name, struct sol_buffer *buf)
Parser's read callback.
Definition: sol-flow-parser.h:81
struct sol_flow_node_type * sol_flow_parse_buffer(struct sol_flow_parser *parser, const struct sol_buffer *buf, const char *filename)
Parses a flow description contained in buf and returns the resulting node type.
These routines are used for Soletta flows manipulation.
int sol_flow_parser_del(struct sol_flow_parser *parser)
Destroy a sol_flow_parser instance.
struct sol_flow_node_type * sol_flow_parse_string(struct sol_flow_parser *parser, const char *str, const char *filename)
Similar to sol_flow_parse_buffer but accepts C string.
A sol_buffer is a dynamic array, that can be resized if needed.
Definition: sol-buffer.h:130
struct sol_flow_parser_client sol_flow_parser_client
Flow Parser's client structure.