source: golgotha/src/i4/device/event.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.7 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "error/error.hh"
10#include "device/event.hh"
11
12i4_do_command_event_class::i4_do_command_event_class(char *_command, int command_id)
13  : command_id(command_id)
14{
15  int len=strlen(_command);
16  if (len>=sizeof(command))
17    i4_error("command too long");
18  strcpy(command, _command);
19}
20
21i4_do_command_event_class::i4_do_command_event_class(char *_command, int command_id, i4_time_class &time)
22  : command_id(command_id), time(time)
23{
24  int len=strlen(_command);
25  if (len>=sizeof(command))
26    i4_error("command too long");
27  strcpy(command, _command);
28}
29
30i4_event  *i4_do_command_event_class::copy()
31{
32  return new i4_do_command_event_class(command, command_id);
33}
34
35
36
37i4_end_command_event_class::i4_end_command_event_class(char *_command, int command_id, i4_time_class &time)
38    : command_id(command_id), time(time)
39{
40  int len=strlen(_command);
41  if (len>=sizeof(command))
42    i4_error("command too long");
43  strcpy(command, _command);
44}
45
46i4_end_command_event_class::i4_end_command_event_class(char *_command, int command_id)
47  : command_id(command_id)
48{
49  int len=strlen(_command);
50  if (len>=sizeof(command))
51    i4_error("command too long");
52  strcpy(command, _command);
53}
Note: See TracBrowser for help on using the repository browser.