#ifndef _H_CLISTVARS
#define _H_CLISTVARS

#include "CList.h"
#include "CString.h"
#include "defines.h"

class CNetServer;

class CListVars : private CList {
public:

  CListVars (CNetServer *);
  ~CListVars (void);

  struct var_type {
    CString name;
    void (*handler)(CNetServer *, c_char, char *, size_t);
    var_type (c_char n, void (*h)(CNetServer *, c_char, char *, size_t)) :
      name (n, VAR_SIZE), handler (h) {}
  };

  bool var_add (c_char, void (*)(CNetServer *, c_char, char *, size_t));
  bool var_del (c_char);
  bool var_get (c_char, char *, size_t);
  bool var_set (c_char, char *);

private:

  struct var_type *var_exist (c_char);
  void var_delall (void);

  CNetServer *s;

};

#include "mbot.h"

#endif
