gladish: rename "Run..." menu entries to "New Application..."
[ladish.git] / daemon / load.h
blob0722ac8a1724ce9997cf0e68205ddd19e3918164
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
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
30 #include <expat.h>
31 #include "common.h"
32 #include "client.h"
33 #include "port.h"
34 #include "room.h"
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
54 #define PARSE_CONTEXT_DESCRIPTION 18
55 #define PARSE_CONTEXT_NOTES 19
57 #define MAX_STACK_DEPTH 10
58 #define MAX_DATA_SIZE 10240
60 struct ladish_parse_context
62 XML_Bool error;
63 unsigned int element[MAX_STACK_DEPTH];
64 signed int depth;
65 char data[MAX_DATA_SIZE];
66 int data_used;
67 char * str;
68 ladish_client_handle client;
69 ladish_port_handle port;
70 ladish_dict_handle dict;
71 ladish_room_handle room;
72 uint64_t connection_id;
73 bool terminal;
74 bool autorun;
75 uint8_t level;
76 void * parser;
79 void ladish_dump_element_stack(struct ladish_parse_context * context_ptr);
80 const char * ladish_get_string_attribute(const char * const * attr, const char * key);
81 const char * ladish_get_uuid_attribute(const char * const * attr, const char * key, uuid_t uuid, bool optional);
82 const char * ladish_get_bool_attribute(const char * const * attr, const char * key, bool * bool_value_ptr);
83 const char * ladish_get_byte_attribute(const char * const * attr, const char * key, uint8_t * byte_value_ptr);
85 bool
86 ladish_get_name_and_uuid_attributes(
87 const char * element_description,
88 const char * const * attr,
89 const char ** name_str_ptr,
90 const char ** uuid_str_ptr,
91 uuid_t uuid);
93 bool
94 ladish_parse_port_type_and_direction_attributes(
95 const char * element_description,
96 const char * const * attr,
97 uint32_t * type_ptr,
98 uint32_t * flags_ptr);
100 void ladish_interlink_clients(ladish_graph_handle vgraph, ladish_app_supervisor_handle app_supervisor);
102 #endif /* #ifndef LOAD_H__43B1ECB8_247F_4868_AE95_563DD968D7B0__INCLUDED */