arguments.c

changeset 34
fa9bda32de17
parent 33
1a2d7298bc82
child 35
35120de6ee53
     1.1 --- a/arguments.c	Tue Oct 02 10:49:25 2012 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,45 +0,0 @@
     1.4 -/*
     1.5 - * arguments.c
     1.6 - *
     1.7 - *  Created on: 15.09.2011
     1.8 - *      Author: Mike
     1.9 - */
    1.10 -
    1.11 -#include "arguments.h"
    1.12 -
    1.13 -int checkArgument(const char* arg, const char* expected) {
    1.14 -  int len = strlen(expected);
    1.15 -  int ret = 0;
    1.16 -
    1.17 -  if (arg[0] == '-') {
    1.18 -    if (arg[1] != '-') {
    1.19 -      for (int t = 0 ; t < len ; t++) {
    1.20 -        ret |= (strchr(arg, expected[t]) > 0) << t;
    1.21 -      }
    1.22 -    }
    1.23 -  }
    1.24 -
    1.25 -  return ret;
    1.26 -}
    1.27 -
    1.28 -bool registerArgument(int* reg, int mask) {
    1.29 -  bool ret = (*reg & mask) > 0;
    1.30 -  *reg |= mask;
    1.31 -  return ret;
    1.32 -}
    1.33 -
    1.34 -bool checkParamOpt(int* paropt) {
    1.35 -  bool ret = *paropt == 0;
    1.36 -  *paropt = 1;
    1.37 -  return ret;
    1.38 -}
    1.39 -
    1.40 -void parseCSL(char* csl, string_list_t* list) {
    1.41 -  if (csl != NULL) {
    1.42 -    char* finder = strtok(csl, ",");
    1.43 -    while (finder != NULL) {
    1.44 -      add_string(list, finder);
    1.45 -      finder = strtok(NULL, ",");
    1.46 -    }
    1.47 -  }
    1.48 -}

mercurial