1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2014 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #include "config_data.h"
9 #include "../../common/memory.h"
11 void config_data::add_host(char *group_name
, char *host_name
)
13 group_list
= (group_item
*)Realloc(group_list
,
14 ++group_list_len
* sizeof(group_item
));
15 // We take copies because the same group_name pointer may be supplied
16 // more than once (group:host is a one-to-many relationship).
17 // This would result in double-free.
18 // Copying the host_name is not strictly necessary; done for symmetry.
19 group_list
[group_list_len
-1].group_name
= mcopystr(group_name
);
20 // We need NULL here, not empty string.
21 group_list
[group_list_len
-1].host_name
= host_name
? mcopystr(host_name
) : NULL
;
24 void config_data::add_component(char *host_or_grp
, char *comp
)
26 component_list
= (component_item
*)Realloc(component_list
,
27 ++component_list_len
* sizeof(component_item
));
28 component_list
[component_list_len
-1].host_or_group
= host_or_grp
;
29 component_list
[component_list_len
-1].component
= comp
;
32 void config_data::add_exec(const execute_list_item
& exec_item
)
34 execute_list
= (execute_list_item
*)Realloc(execute_list
,
35 (execute_list_len
+ 1) * sizeof(*execute_list
));
36 execute_list
[execute_list_len
++] = exec_item
;
39 void config_data::set_log_file(char *f
)
41 if (log_file_name
!= NULL
)
46 void config_data::clear()
48 Free(config_read_buffer
);
49 config_read_buffer
= NULL
;
54 for(int r
= 0; r
< execute_list_len
; r
++) {
55 Free(execute_list
[r
].module_name
);
56 Free(execute_list
[r
].testcase_name
);
62 for(int r
= 0; r
< group_list_len
; r
++) {
63 Free(group_list
[r
].group_name
);
64 Free(group_list
[r
].host_name
);
70 for(int r
= 0; r
< component_list_len
; r
++) {
71 Free(component_list
[r
].host_or_group
);
72 Free(component_list
[r
].component
);
75 component_list
= NULL
;
76 component_list_len
= 0;
84 unix_sockets_enabled
=
86 false // Unix domain socket communication on Cygwin is painfully slow
This page took 0.091089 seconds and 5 git commands to generate.