Skip to content
sls.hh 1.63 KiB
Newer Older
Seblu's avatar
Seblu committed
//
// sls.hh for sls
//
// Made by Seblu
// Login   <seblu@epita.fr>
//
// Started on  Mon Jun  4 14:32:04 2007 Seblu
// Last update Sat Dec 22 23:21:48 2007 Sebastien Luttringer
//

#ifndef SLS_HH
# define SLS_HH

# define _REENTRANT

# include <cassert>
# include <ios>
# include <iostream>
# include <fstream>
# include <sstream>
# include <map>

typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
typedef std::ifstream ifstream;
typedef std::ofstream ofstream;

enum {
  ERR_NO = 0,
  ERR_USAGE = 1,
  ERR_BADPARAM = 2,
  ERR_FILE = 3,
  ERR_NET = 4,
  ERR_PROTO = 5,
  ERR_AUTH = 6,
  ERR_SCREENSZ = 7,
  ERR_NOMEM = 41,
  ERR_UNKNOWN = 42
};

// -----------------------------------------------------------------------------
// Gonstant
// -----------------------------------------------------------------------------

static const string VERSION = "1";
static const int MAX_LINE_SIZE = 512;

// -----------------------------------------------------------------------------
// SLSERVER CLASS
// -----------------------------------------------------------------------------

// class Server
// {

//   static const int backlog;

//   struct AccessData
//   {
//     string client_pw;
//     string server_pw;
//     int privilege;
//   };

//   typedef std::map<string, AccessData *> AccessMap;

// public:
//   SLServer(int port);
//   int run();

//   void add_access(const char *login, const char *pw_server,
// 		 const char *pw_client, int priv);
//   void del_access(const string &login);
//   void print_access() const;
// protected:
//   int port_;
//   AccessMap accessDB_;

//   void connect();

// };

#endif