X-Git-Url: http://git.onelab.eu/?p=util-vserver.git;a=blobdiff_plain;f=src%2Fvunify-init.hc;fp=src%2Fvunify-init.hc;h=da55f3fe1132db93ce0f89e597d5e561416403da;hp=0000000000000000000000000000000000000000;hb=8cf13bb177d92c93eb73dc8939777150536c2d00;hpb=6bf3f95de36c804c97716b2d0bdf10680c559044 diff --git a/src/vunify-init.hc b/src/vunify-init.hc new file mode 100644 index 0000000..da55f3f --- /dev/null +++ b/src/vunify-init.hc @@ -0,0 +1,75 @@ +// $Id: vunify-init.hc,v 1.7 2005/03/18 00:24:27 ensc Exp $ --*- c -*-- + +// Copyright (C) 2004 Enrico Scholz +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "pathconfig.h" + +static void +initModeManually(struct Arguments const UNUSED *args, int argc, char *argv[]) +{ + int i, count=argc/2; + + if (argc%2) { + WRITE_MSG(2, "Odd number of (path,excludelist) arguments\n"); + exit(1); + } + + if (count<2) { + WRITE_MSG(2, "No reference path(s) given\n"); + exit(1); + } + + MatchList_initManually(&global_info.dst_list, 0, strdup(argv[0]), argv[1]); + + --count; + global_info.src_lists.v = Emalloc(sizeof(struct MatchList) * count); + global_info.src_lists.l = count; + + for (i=0; i