Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
aeed64862c9734c38764a1e7e7d7e56072c85370
[simgrid.git] / include / xbt / replay.h
1 /* xbt/replay_reader.h -- Tools to parse a replay file                */
2
3 /* Copyright (c) 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef XBT_REPLAY_H
10 #define XBT_REPLAY_H
11 #include "xbt/misc.h"           /* SG_BEGIN_DECL */
12
13 SG_BEGIN_DECL()
14
15 typedef struct s_replay_reader *xbt_replay_reader_t;
16 typedef void (*action_fun) (const char *const *args);
17
18 static xbt_dict_t action_funs;
19 static xbt_dict_t action_queues;
20
21 /* To split the file if a unique one is given (specific variable for the other case live in runner()) */
22 FILE *action_fp;
23
24
25 xbt_replay_reader_t xbt_replay_reader_new(const char*filename);
26 const char **xbt_replay_reader_get(xbt_replay_reader_t reader);
27 void xbt_replay_reader_free(xbt_replay_reader_t *reader);
28 const char *xbt_replay_reader_position(xbt_replay_reader_t reader);
29
30 int xbt_replay_action_runner(int argc, char *argv[]);
31
32 XBT_PUBLIC(void) _xbt_replay_action_init(void);
33 XBT_PUBLIC(void) _xbt_replay_action_exit(void);
34
35 XBT_PUBLIC(void) xbt_replay_action_register(const char *action_name,
36                                                           action_fun function);
37 XBT_PUBLIC(void) xbt_replay_action_unregister(const char *action_name);
38
39 SG_END_DECL()
40
41 #endif /* XBT_REPLAY_H */