summaryrefslogtreecommitdiff
path: root/src/cmd.c
blob: 7608d7319f9e310b1385996ac0dc2eee9e59d39c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <string.h>

#include "cmd.h"


struct cmd eval(char *str)
{
  struct cmd ret;
  ret.params = NULL;
  ret.selector = NULL;
  if (!strncmp(str, "GET", 3)) {
    ret.type = GET;
  } else if (!strncmp(str, "SET", 3)) {
    ret.type = SET;
  } else if (!strncmp(str, "DEL", 3)) {
    ret.type = DEL;
  } else {
    ret.type = ERR;
  }

  return ret;
}