Cython has moved to github.

cython-devel

view Cython/Compiler/Naming.py @ 719:e21391d5f23a

quick work-around for PEP 3121 implementation in Py3 beta
author Stefan Behnel <scoder@users.berlios.de>
date Thu Jun 12 09:28:56 2008 +0200 (3 years ago)
parents fa9975f9c1c2
children fcbaa4e5c105
line source
1 #
2 # Pyrex - C naming conventions
3 #
4 #
5 # Prefixes for generating C names.
6 # Collected here to facilitate ensuring uniqueness.
7 #
9 pyrex_prefix = "__pyx_"
11 builtin_prefix = pyrex_prefix + "builtin_"
12 arg_prefix = pyrex_prefix + "arg_"
13 funcdoc_prefix = pyrex_prefix + "doc_"
14 enum_prefix = pyrex_prefix + "e_"
15 func_prefix = pyrex_prefix + "f_"
16 pyfunc_prefix = pyrex_prefix + "pf_"
17 gstab_prefix = pyrex_prefix + "getsets_"
18 prop_get_prefix = pyrex_prefix + "getprop_"
19 const_prefix = pyrex_prefix + "k_"
20 py_const_prefix = pyrex_prefix + "kp_"
21 label_prefix = pyrex_prefix + "L"
22 pymethdef_prefix = pyrex_prefix + "mdef_"
23 methtab_prefix = pyrex_prefix + "methods_"
24 memtab_prefix = pyrex_prefix + "members_"
25 interned_num_prefix = pyrex_prefix + "int_"
26 objstruct_prefix = pyrex_prefix + "obj_"
27 typeptr_prefix = pyrex_prefix + "ptype_"
28 prop_set_prefix = pyrex_prefix + "setprop_"
29 type_prefix = pyrex_prefix + "t_"
30 typeobj_prefix = pyrex_prefix + "type_"
31 var_prefix = pyrex_prefix + "v_"
32 vtable_prefix = pyrex_prefix + "vtable_"
33 vtabptr_prefix = pyrex_prefix + "vtabptr_"
34 vtabstruct_prefix = pyrex_prefix + "vtabstruct_"
35 opt_arg_prefix = pyrex_prefix + "opt_args_"
37 args_cname = pyrex_prefix + "args"
38 kwdlist_cname = pyrex_prefix + "argnames"
39 obj_base_cname = pyrex_prefix + "base"
40 builtins_cname = pyrex_prefix + "b"
41 preimport_cname = pyrex_prefix + "i"
42 moddict_cname = pyrex_prefix + "d"
43 dummy_cname = pyrex_prefix + "dummy"
44 filename_cname = pyrex_prefix + "filename"
45 filetable_cname = pyrex_prefix + "f"
46 filenames_cname = pyrex_prefix + "filenames"
47 fileinit_cname = pyrex_prefix + "init_filenames"
48 intern_tab_cname = pyrex_prefix + "intern_tab"
49 kwds_cname = pyrex_prefix + "kwds"
50 lineno_cname = pyrex_prefix + "lineno"
51 clineno_cname = pyrex_prefix + "clineno"
52 cfilenm_cname = pyrex_prefix + "cfilenm"
53 module_cname = pyrex_prefix + "m"
54 moddoc_cname = pyrex_prefix + "mdoc"
55 methtable_cname = pyrex_prefix + "methods"
56 retval_cname = pyrex_prefix + "r"
57 reqd_kwds_cname = pyrex_prefix + "reqd_kwds"
58 self_cname = pyrex_prefix + "self"
59 stringtab_cname = pyrex_prefix + "string_tab"
60 vtabslot_cname = pyrex_prefix + "vtab"
61 c_api_tab_cname = pyrex_prefix + "c_api_tab"
62 gilstate_cname = pyrex_prefix + "state"
63 skip_dispatch_cname = pyrex_prefix + "skip_dispatch"
64 empty_tuple = pyrex_prefix + "empty_tuple"
65 print_function = pyrex_prefix + "print"
66 print_function_kwargs = pyrex_prefix + "print_kwargs"
67 cleanup_cname = pyrex_prefix + "module_cleanup"
68 pymoduledef_cname = pyrex_prefix + "moduledef"
69 optional_args_cname = pyrex_prefix + "optional_args"
70 no_opt_args = pyrex_prefix + "no_opt_args"
71 import_star = pyrex_prefix + "import_star"
72 import_star_set = pyrex_prefix + "import_star_set"
74 line_c_macro = "__LINE__"
76 file_c_macro = "__FILE__"
78 extern_c_macro = pyrex_prefix.upper() + "EXTERN_C"
80 exc_type_name = pyrex_prefix + "exc_type"
81 exc_value_name = pyrex_prefix + "exc_value"
82 exc_tb_name = pyrex_prefix + "exc_tb"
83 exc_lineno_name = pyrex_prefix + "exc_lineno"
85 exc_vars = (exc_type_name, exc_value_name, exc_tb_name)
87 api_name = pyrex_prefix + "capi__"
89 h_guard_prefix = "__PYX_HAVE__"
90 api_guard_prefix = "__PYX_HAVE_API__"
91 api_func_guard = "__PYX_HAVE_API_FUNC_"
93 def py_version_hex(major, minor=0, micro=0, release_level=0, release_serial=0):
94 return (major << 24) | (minor << 16) | (micro << 8) | (release_level << 4) | (release_serial)