1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2010 Nedko Arnaudov <nedko@arnaudov.name>
7 **************************************************************************
8 * This file contains inteface for the load helper functions
9 **************************************************************************
11 * LADI Session Handler is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * LADI Session Handler is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
23 * or write to the Free Software Foundation, Inc.,
24 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef LOAD_H__43B1ECB8_247F_4868_AE95_563DD968D7B0__INCLUDED
28 #define LOAD_H__43B1ECB8_247F_4868_AE95_563DD968D7B0__INCLUDED
36 #define PARSE_CONTEXT_ROOT 0
37 #define PARSE_CONTEXT_STUDIO 1
38 #define PARSE_CONTEXT_JACK 2
39 #define PARSE_CONTEXT_CONF 3
40 #define PARSE_CONTEXT_PARAMETER 4
41 #define PARSE_CONTEXT_CLIENTS 5
42 #define PARSE_CONTEXT_CLIENT 6
43 #define PARSE_CONTEXT_PORTS 7
44 #define PARSE_CONTEXT_PORT 8
45 #define PARSE_CONTEXT_DICT 9
46 #define PARSE_CONTEXT_KEY 10
47 #define PARSE_CONTEXT_CONNECTIONS 11
48 #define PARSE_CONTEXT_CONNECTION 12
49 #define PARSE_CONTEXT_APPLICATIONS 13
50 #define PARSE_CONTEXT_APPLICATION 14
51 #define PARSE_CONTEXT_ROOMS 15
52 #define PARSE_CONTEXT_ROOM 16
53 #define PARSE_CONTEXT_PROJECT 17
55 #define MAX_STACK_DEPTH 10
56 #define MAX_DATA_SIZE 10240
58 struct ladish_parse_context
61 unsigned int element
[MAX_STACK_DEPTH
];
63 char data
[MAX_DATA_SIZE
];
66 ladish_client_handle client
;
67 ladish_port_handle port
;
68 ladish_dict_handle dict
;
69 ladish_room_handle room
;
70 uint64_t connection_id
;
76 void ladish_dump_element_stack(struct ladish_parse_context
* context_ptr
);
77 const char * ladish_get_string_attribute(const char * const * attr
, const char * key
);
78 const char * ladish_get_uuid_attribute(const char * const * attr
, const char * key
, uuid_t uuid
, bool optional
);
79 const char * ladish_get_bool_attribute(const char * const * attr
, const char * key
, bool * bool_value_ptr
);
80 const char * ladish_get_byte_attribute(const char * const * attr
, const char * key
, uint8_t * byte_value_ptr
);
83 ladish_get_name_and_uuid_attributes(
84 const char * element_description
,
85 const char * const * attr
,
86 const char ** name_str_ptr
,
87 const char ** uuid_str_ptr
,
91 ladish_parse_port_type_and_direction_attributes(
92 const char * element_description
,
93 const char * const * attr
,
95 uint32_t * flags_ptr
);
97 void ladish_interlink_clients(ladish_graph_handle vgraph
, ladish_app_supervisor_handle app_supervisor
);
99 #endif /* #ifndef LOAD_H__43B1ECB8_247F_4868_AE95_563DD968D7B0__INCLUDED */