forked from ldmud/ldmud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackend.h
67 lines (53 loc) · 1.99 KB
/
backend.h
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
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef BACKEND_H__
#define BACKEND_H__ 1
#include "driver.h"
#include "typedefs.h"
#include "main.h" /* max_time */
/* --- Types --- */
/* struct statistic_s: Aggregate data for statistics.
*
* In particular the structures is used with update_statistic() in order
* to calculate a weighted average of the last period of time.
*/
struct statistic_s
{
mp_int last_time; /* Time of last weighted-average calculation. */
long sum; /* Sum since last weighted-average calculation. */
double weighted_avg; /* The current weighted average. */
};
/* --- Variables --- */
extern mp_int current_time;
extern Bool time_to_call_heart_beat;
extern volatile Bool comm_time_to_call_heart_beat;
extern volatile Bool comm_return_to_backend;
extern uint32 total_player_commands;
extern volatile mp_int total_alarms;
extern uint num_listed_objs;
extern uint num_last_processed;
extern uint num_last_data_cleaned;
extern statistic_t stat_last_processed;
extern statistic_t stat_last_data_cleaned;
extern statistic_t stat_in_list;
extern Bool extra_jobs_to_do;
extern volatile bool interrupt_execution;
typedef enum { gcDont = 0, gcMalloc, gcEfun } GC_Request;
extern GC_Request gc_request;
extern statistic_t stat_load;
extern statistic_t stat_compile;
extern Bool mud_is_up;
extern char sigaction_sighup, sigaction_sigint, sigaction_sigusr1, sigaction_sigusr2;
/* --- Prototypes --- */
extern void clear_state (void);
extern void check_alarm (void);
extern void install_signal_handlers();
extern void backend (void);
extern void preload_objects (int eflag);
extern svalue_t *f_debug_message (svalue_t *sp);
ALARM_HANDLER_PROT(catch_alarm);
extern void update_statistic (statistic_t * pStat, long number);
extern void update_statistic_avg (statistic_t * pStat, long number);
extern double relate_statistics (statistic_t sStat, statistic_t sRef);
extern void update_compile_av (int lines);
extern svalue_t *v_garbage_collection(svalue_t *sp, int num_arg);
/* --- Macros --- */
#endif /* BACKEND_H__ */