forked from KIDx/Judger
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlanguage.h
86 lines (75 loc) · 2.19 KB
/
language.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef _LANGUAGE_H
#define _LANGUAGE_H
#include <string>
namespace LanguageSupport
{
struct LangSupport
{
std::string Name; //编程语言名称
std::string MainFile; //待测程序源码文件
std::string TCfile; //TC模式测试文件的文件名
std::string TChead; //TC模式附加头文件的文件名
const char* const CompileCmd[20]; //编译待评测程序的命令行
const char* const RunCmd[20]; //运行待评测程序的命令行
int TimeFactor; //时间限制的倍数
int MemFactor; //内存限制的倍数
bool VMrunning; //该语言是否以虚拟机方式运行
};
const LangSupport UnknownLang = {
"unknown", "NA", "NA", "NA",
{NULL},
{NULL},
0, 0, false
};
const LangSupport CLang = {
"c", "Main.c", "tc.c", "tc.h",
#ifdef JUDGE_DEBUG
{"gcc","Main.c","-o","Main",
"-std=c11", "-O2", NULL},
#else
{"gcc", "Main.c", "-o", "Main", "-Wall", "-lm",
"--static", "-std=c11", "-DONLINE_JUDGE", "-w", NULL },
#endif
{"./Main", NULL},
1, 1, false
};
const LangSupport CppLang = {
"c++", "Main.cpp", "tc.cpp", "tc.hpp",
#ifdef JUDGE_DEBUG
{"g++","Main.cpp","-o",
"Main", "-std=c++11", "-O2",NULL},
#else
{ "g++", "Main.cpp", "-o", "Main", "-std=c++11",
"-Wall","-lm", "--static", "-DONLINE_JUDGE", "-w", NULL },
#endif
{"./Main", NULL},
1, 1, false
};
const LangSupport JavaLang = {
"java", "Main.java", "tc.java", "tch.java",
#ifdef JUDGE_DEBUG
{"javac", "Main.java", NULL },
#else
{ "javac", "-J-Xms128M", "-J-Xmx512M", "Main.java", NULL },
#endif
{ "java", "-Djava.security.manager", "-Xms128M", "-Xms512M", "-DONLINE_JUDGE=true", "Main", NULL },
2, 2, true
};
}; //End of namespace
LanguageSupport::LangSupport const *Langs[] =
{
&LanguageSupport::UnknownLang,
&LanguageSupport::CLang,
&LanguageSupport::CppLang,
&LanguageSupport::JavaLang
};
namespace judge_conf
{
//OJÓïÑÔ
const int LANG_UNKNOWN = 0;
const int LANG_C = 1;
const int LANG_CPP = 2;
const int LANG_JAVA = 3;
};
#endif
//不要忘了修改okcall.h