3 // Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; version 2 of the License.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 createSkeleton(char const *name)
24 app_dir = vc_getVserverAppDir(name, vcCFG_AUTO, "vunify");
26 vc_createSkeleton(name, vcCFG_AUTO, vcSKEL_FILESYSTEM|vcSKEL_PKGMGMT)==-1) {
27 perror("vc_createSkeleton()");
32 app_dir = vc_getVserverAppDir(name, vcCFG_AUTO, "");
40 .l = sizeof("vunify")-1
43 char p_buf[ENSC_PI_APPSZ(path, rhs_path)];
44 PathInfo_append(&path, &rhs_path, p_buf);
49 free(const_cast(char *)(app_dir));
54 initModeManually(int argc, char *argv[])
59 WRITE_MSG(2, "Bad arguments; try '--help' for more information\n");
63 MatchList_initManually(&global_info.dst_list, 0, strdup(argv[0]), argv[1]);
64 MatchList_initManually(&global_info.src_list, 0, strdup(argv[2]), argv[3]);
69 initModeVserver(int argc, char *argv[])
72 struct MatchVserverInfo src_vserver = {
77 if (!MatchVserverInfo_init(&src_vserver)) {
78 WRITE_MSG(2, "Failed to initialize unification for source-vserver\n");
83 WRITE_MSG(2, "Bad arguments; try '--help' for more information\n");
87 if (!MatchList_initByVserver(&global_info.src_list, &src_vserver)) {
88 WRITE_MSG(2, "unification not configured for source vserver\n");
92 MatchVserverInfo_free(&src_vserver);
96 struct MatchVserverInfo dst_vserver = {
101 if (!global_args->is_strict)
102 createSkeleton(dst_vserver.name);
104 if (!MatchVserverInfo_init(&dst_vserver)) {
105 WRITE_MSG(2, "Failed to initialize unification for destination-vserver\n");
109 if (!MatchList_initByVserver(&global_info.dst_list, &dst_vserver)) {
110 WRITE_MSG(2, "unification not configured for destination vserver\n");
114 MatchVserverInfo_free(&dst_vserver);