GCCPY:
[official-gcc.git] / gcc / python / gpy-builtins.cc
blob6448901544eb587b20a6dfa82df06fc4ebe1d028
1 /* This file is part of GCC.
3 GCC is free software; you can redistribute it and/or modify it under
4 the terms of the GNU General Public License as published by the Free
5 Software Foundation; either version 3, or (at your option) any later
6 version.
8 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 for more details.
13 You should have received a copy of the GNU General Public License
14 along with GCC; see the file COPYING3. If not see
15 <http://www.gnu.org/licenses/>. */
17 #include "gpython.h"
19 static const char * builtins[] = {
20 "sys",
21 NULL
24 int gpy_checkBuiltin (const char * import)
26 int found = -1, c = 0;
27 const char ** i;
28 for (i = builtins; *i != NULL; ++i)
30 if (!strcmp (*i, import))
32 found = c + 1;
33 break;
35 c++;
37 return found;