summaryrefslogtreecommitdiff
path: root/svdrp.h
blob: 674639e1e9662fdf37ce729432d9151aa7e23e7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * svdrp.h: Simple Video Disk Recorder Protocol
 *
 * See the main source file 'vdr.c' for copyright information and
 * how to reach the author.
 *
 * $Id: svdrp.h 1.3 2000/09/16 11:48:36 kls Exp $
 */

#ifndef __SVDRP_H
#define __SVDRP_H

#include "tools.h"

class cSocket {
private:
  int port;
  int sock;
  int queue;
  void Close(void);
public:
  cSocket(int Port, int Queue = 1);
  ~cSocket();
  bool Open(void);
  int Accept(void);
  };

class cSVDRP {
private:
  cSocket socket;
  cFile file;
  void Close(void);
  bool Send(const char *s, int length = -1);
  void Reply(int Code, const char *fmt, ...);
  void CmdChan(const char *Option);
  void CmdDelc(const char *Option);
  void CmdDelt(const char *Option);
  void CmdHelp(const char *Option);
  void CmdLstc(const char *Option);
  void CmdLstt(const char *Option);
  void CmdModc(const char *Option);
  void CmdModt(const char *Option);
  void CmdMovc(const char *Option);
  void CmdMovt(const char *Option);
  void CmdNewc(const char *Option);
  void CmdNewt(const char *Option);
  void CmdUpdt(const char *Option);
  void Execute(char *Cmd);
public:
  cSVDRP(int Port);
  ~cSVDRP();
  void Process(void);
  };

#endif //__SVDRP_H