X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Ftagopt2tag.c;fp=lib%2Ftagopt2tag.c;h=0000000000000000000000000000000000000000;hb=db5ef3f969fc6ad34aeb5903e44d0049b2e50791;hp=7f4b6aa708e4e6870e771f930b02226d7d8782ba;hpb=95e2774070e989fe9cf9f48dae5fa054e55e2a3e;p=util-vserver.git diff --git a/lib/tagopt2tag.c b/lib/tagopt2tag.c deleted file mode 100644 index 7f4b6aa..0000000 --- a/lib/tagopt2tag.c +++ /dev/null @@ -1,57 +0,0 @@ -// $Id$ --*- c -*-- - -// Copyright (C) 2004 Enrico Scholz -// Copyright (C) 2007 Daniel Hokka Zakrisson -// -// 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. - - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include "vserver.h" -#include -#include - -static tag_t -getVserverTag(char const *id, bool honor_static, char const **err) -{ - *err = "vc_getVserverCtx"; - return vc_getVserverCtx(id, vcCFG_AUTO, honor_static, 0, vcCTX_TAG); -} - -tag_t -vc_tagopt2tag(char const *str, bool honor_static, char const **err_info) -{ - char const * err; - tag_t res = VC_NOCTX; - - err = "vc_task_tag()"; - if (strcmp(str,"self")==0) res = vc_get_task_tag(0); - else if (str[0]==':') res = getVserverTag(str+1, honor_static, &err); - else { - char * endptr; - tag_t tag = strtol(str, &endptr, 10); - - if (endptr!=str && (*endptr=='\0' || *endptr=='\n')) - res = tag; - else - res = getVserverTag(str, honor_static, &err); - } - - if (res==VC_NOCTX && err_info) *err_info = err; - - return res; -}