File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ #include < ansi-c/ansi_c_language.h>
2
+
1
3
#include < goto-programs/goto_model.h>
2
4
#include < goto-programs/initialize_goto_model.h>
3
5
6
+ #include < langapi/mode.h>
7
+
8
+ #include < util/cmdline.h>
4
9
#include < util/message.h>
5
10
#include < util/options.h>
6
11
7
12
#include " api.h"
8
13
9
14
api_depst api_deps;
15
+ extern configt config;
10
16
11
- // Initialise API dependencies
12
17
void initialize_api () {
13
- // Initialise a null-message handler (we don't print anything yet )
18
+ // Initialise a null-message handler (we don't print anything in the API )
14
19
api_deps.msg_handler = new null_message_handlert ();
15
20
// Initialise default options
16
21
api_deps.opts = new optionst ();
22
+ // Needed to initialise the language options correctly
23
+ cmdlinet cmdline;
24
+ // config is global in config.cpp
25
+ config.set (cmdline);
26
+ // Initialise C language mode
27
+ register_language (new_ansi_c_language);
17
28
}
18
29
19
30
goto_modelt load_model_from_files (
20
31
const std::vector<std::string> &files,
21
32
const optionst &options)
22
33
{
34
+ // This could be nested inside a try/catch, but for now let's leave it alone.
23
35
return initialize_goto_model (files, *api_deps.msg_handler , options);
24
36
}
Original file line number Diff line number Diff line change 4
4
5
5
#include < util/message.h>
6
6
#include < util/options.h>
7
+ #include < util/config.h>
7
8
9
+ // A struct containing the API dependencies (some of them, at least)
8
10
struct api_depst {
9
11
message_handlert *msg_handler;
10
12
optionst *opts;
11
13
};
12
14
15
+ // / Initialise API dependencies
13
16
void initialize_api ();
14
17
18
+ // / Load a goto_model from a given vector of filenames.
19
+ // / \param files: A vector<string> containing the filenames to be loaded
20
+ // / \param options: An options object, to be passed on to analysis or transformation
21
+ // / passes.
15
22
goto_modelt load_model_from_files (
16
23
const std::vector<std::string> &files,
17
24
const optionst &options);
You can’t perform that action at this time.
0 commit comments