ladishd: return project name in recent project list
[ladish.git] / daemon / load.h
blobbb93b88075fc4f86e2ebce00edb3554fdffad377
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
55 #define MAX_STACK_DEPTH 10
56 #define MAX_DATA_SIZE 10240
58 struct ladish_parse_context
60 XML_Bool error;
61 unsigned int element[MAX_STACK_DEPTH];
62 signed int depth;
63 char data[MAX_DATA_SIZE];
64 int data_used;
65 char * str;
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;
71 bool terminal;
72 bool autorun;
73 uint8_t level;
74 void * parser;
77 void ladish_dump_element_stack(struct ladish_parse_context * context_ptr);
78 const char * ladish_get_string_attribute(const char * const * attr, const char * key);
79 const char * ladish_get_uuid_attribute(const char * const * attr, const char * key, uuid_t uuid, bool optional);
80 const char * ladish_get_bool_attribute(const char * const * attr, const char * key, bool * bool_value_ptr);
81 const char * ladish_get_byte_attribute(const char * const * attr, const char * key, uint8_t * byte_value_ptr);
83 bool
84 ladish_get_name_and_uuid_attributes(
85 const char * element_description,
86 const char * const * attr,
87 const char ** name_str_ptr,
88 const char ** uuid_str_ptr,
89 uuid_t uuid);
91 bool
92 ladish_parse_port_type_and_direction_attributes(
93 const char * element_description,
94 const char * const * attr,
95 uint32_t * type_ptr,
96 uint32_t * flags_ptr);
98 void ladish_interlink_clients(ladish_graph_handle vgraph, ladish_app_supervisor_handle app_supervisor);
100 #endif /* #ifndef LOAD_H__43B1ECB8_247F_4868_AE95_563DD968D7B0__INCLUDED */