]> git.pond.sub.org Git - empserver/blob - src/scripts/nightly/patches/All/emptime.c.patch
Update copyright notice
[empserver] / src / scripts / nightly / patches / All / emptime.c.patch
1 diff --git a/include/emptime.h b/include/emptime.h
2 new file mode 100644
3 index 0000000..a83b29d
4 --- /dev/null
5 +++ b/include/emptime.h
6 @@ -0,0 +1,41 @@
7 +/*
8 + *  Empire - A multi-player, client/server Internet based war game.
9 + *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
10 + *                           Ken Stevens, Steve McClure
11 + *
12 + *  This program is free software; you can redistribute it and/or modify
13 + *  it under the terms of the GNU General Public License as published by
14 + *  the Free Software Foundation; either version 2 of the License, or
15 + *  (at your option) any later version.
16 + *
17 + *  This program is distributed in the hope that it will be useful,
18 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 + *  GNU General Public License for more details.
21 + *
22 + *  You should have received a copy of the GNU General Public License
23 + *  along with this program; if not, write to the Free Software
24 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25 + *
26 + *  ---
27 + *
28 + *  See files README, COPYING and CREDITS in the root of the source
29 + *  tree for related information and legal notices.  It is expected
30 + *  that future projects/authors will amend these files as needed.
31 + *
32 + *  ---
33 + *
34 + *  emptime.h: Time functions for regression testing and
35 + *             replaying journals.
36 + *
37 + *  Known contributors to this file:
38 + *     Ron Koenderink, 2008
39 + */
40 +
41 +#ifndef EMPTIME_H
42 +#define EMPTIME_H
43 +
44 +#include <time.h>
45 +
46 +extern time_t emp_time(time_t *, const char []);
47 +#endif
48 diff --git a/src/lib/gen/emptime.c b/src/lib/gen/emptime.c
49 new file mode 100644
50 index 0000000..855de99
51 --- /dev/null
52 +++ b/src/lib/gen/emptime.c
53 @@ -0,0 +1,51 @@
54 +/*
55 + *  Empire - A multi-player, client/server Internet based war game.
56 + *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
57 + *                           Ken Stevens, Steve McClure
58 + *
59 + *  This program is free software; you can redistribute it and/or modify
60 + *  it under the terms of the GNU General Public License as published by
61 + *  the Free Software Foundation; either version 2 of the License, or
62 + *  (at your option) any later version.
63 + *
64 + *  This program is distributed in the hope that it will be useful,
65 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
66 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
67 + *  GNU General Public License for more details.
68 + *
69 + *  You should have received a copy of the GNU General Public License
70 + *  along with this program; if not, write to the Free Software
71 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
72 + *
73 + *  ---
74 + *
75 + *  See files README, COPYING and CREDITS in the root of the source
76 + *  tree for related information and legal notices.  It is expected
77 + *  that future projects/authors will amend these files as needed.
78 + *
79 + *  ---
80 + *
81 + *  emptime.c: Time functions for regression testing and
82 + *             replaying journals.
83 + *
84 + *  Known contributors to this file:
85 + *     Ron Koenderink, 2008
86 + */
87 +
88 +#include <stdio.h>
89 +#include <string.h>
90 +#include "emptime.h"
91 +
92 +time_t
93 +emp_time(time_t * time_ptr, const char function[])
94 +{
95 +    static time_t now = (time_t)100L;
96 +
97 +    if (strcmp(function, "update_main") == 0)
98 +       now += 100L;
99 +
100 +    if (time_ptr != NULL)
101 +       *time_ptr = now;
102 +
103 +    return now;
104 +}