Cython has moved to github.

cython-devel

view Cython/Compiler/Naming.py @ 3659:63c67976adc6

Restore special method docstrings.
author Robert Bradshaw <robertwb@math.washington.edu>
date Sun Aug 15 00:12:36 2010 -0700 (21 months ago)
parents d0fabe43775f
children
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_"
12 codewriter_temp_prefix = pyrex_prefix + "t_"
14 temp_prefix = u"__cyt_"
16 builtin_prefix = pyrex_prefix + "builtin_"
17 arg_prefix = pyrex_prefix + "arg_"
18 funcdoc_prefix = pyrex_prefix + "doc_"
19 enum_prefix = pyrex_prefix + "e_"
20 func_prefix = pyrex_prefix + "f_"
21 pyfunc_prefix = pyrex_prefix + "pf_"
22 gstab_prefix = pyrex_prefix + "getsets_"
23 prop_get_prefix = pyrex_prefix + "getprop_"
24 const_prefix = pyrex_prefix + "k_"
25 py_const_prefix = pyrex_prefix + "kp_"
26 label_prefix = pyrex_prefix + "L"
27 pymethdef_prefix = pyrex_prefix + "mdef_"
28 methtab_prefix = pyrex_prefix + "methods_"
29 memtab_prefix = pyrex_prefix + "members_"
30 interned_str_prefix = pyrex_prefix + "n_"
31 interned_num_prefix = pyrex_prefix + "int_"
32 objstruct_prefix = pyrex_prefix + "obj_"
33 typeptr_prefix = pyrex_prefix + "ptype_"
34 prop_set_prefix = pyrex_prefix + "setprop_"
35 type_prefix = pyrex_prefix + "t_"
36 typeobj_prefix = pyrex_prefix + "type_"
37 var_prefix = pyrex_prefix + "v_"
38 wrapperbase_prefix= pyrex_prefix + "wrapperbase_"
39 bufstruct_prefix = pyrex_prefix + "bstruct_"
40 bufstride_prefix = pyrex_prefix + "bstride_"
41 bufshape_prefix = pyrex_prefix + "bshape_"
42 bufsuboffset_prefix = pyrex_prefix + "boffset_"
43 vtable_prefix = pyrex_prefix + "vtable_"
44 vtabptr_prefix = pyrex_prefix + "vtabptr_"
45 vtabstruct_prefix = pyrex_prefix + "vtabstruct_"
46 opt_arg_prefix = pyrex_prefix + "opt_args_"
47 convert_func_prefix = pyrex_prefix + "convert_"
48 closure_scope_prefix = pyrex_prefix + "scope_"
49 closure_class_prefix = pyrex_prefix + "scope_struct_"
50 lambda_func_prefix = pyrex_prefix + "lambda_"
51 module_is_main = pyrex_prefix + "module_is_main_"
53 args_cname = pyrex_prefix + "args"
54 pykwdlist_cname = pyrex_prefix + "pyargnames"
55 obj_base_cname = pyrex_prefix + "base"
56 builtins_cname = pyrex_prefix + "b"
57 preimport_cname = pyrex_prefix + "i"
58 moddict_cname = pyrex_prefix + "d"
59 dummy_cname = pyrex_prefix + "dummy"
60 filename_cname = pyrex_prefix + "filename"
61 modulename_cname = pyrex_prefix + "modulename"
62 filetable_cname = pyrex_prefix + "f"
63 intern_tab_cname = pyrex_prefix + "intern_tab"
64 kwds_cname = pyrex_prefix + "kwds"
65 lineno_cname = pyrex_prefix + "lineno"
66 clineno_cname = pyrex_prefix + "clineno"
67 cfilenm_cname = pyrex_prefix + "cfilenm"
68 module_cname = pyrex_prefix + "m"
69 moddoc_cname = pyrex_prefix + "mdoc"
70 methtable_cname = pyrex_prefix + "methods"
71 retval_cname = pyrex_prefix + "r"
72 reqd_kwds_cname = pyrex_prefix + "reqd_kwds"
73 self_cname = pyrex_prefix + "self"
74 stringtab_cname = pyrex_prefix + "string_tab"
75 vtabslot_cname = pyrex_prefix + "vtab"
76 c_api_tab_cname = pyrex_prefix + "c_api_tab"
77 gilstate_cname = pyrex_prefix + "state"
78 skip_dispatch_cname = pyrex_prefix + "skip_dispatch"
79 empty_tuple = pyrex_prefix + "empty_tuple"
80 empty_bytes = pyrex_prefix + "empty_bytes"
81 print_function = pyrex_prefix + "print"
82 print_function_kwargs = pyrex_prefix + "print_kwargs"
83 cleanup_cname = pyrex_prefix + "module_cleanup"
84 pymoduledef_cname = pyrex_prefix + "moduledef"
85 optional_args_cname = pyrex_prefix + "optional_args"
86 import_star = pyrex_prefix + "import_star"
87 import_star_set = pyrex_prefix + "import_star_set"
88 outer_scope_cname= pyrex_prefix + "outer_scope"
89 cur_scope_cname = pyrex_prefix + "cur_scope"
90 enc_scope_cname = pyrex_prefix + "enc_scope"
91 frame_cname = pyrex_prefix + "frame"
92 frame_code_cname = pyrex_prefix + "frame_code"
93 binding_cfunc = pyrex_prefix + "binding_PyCFunctionType"
95 genexpr_id_ref = 'genexpr'
97 line_c_macro = "__LINE__"
99 file_c_macro = "__FILE__"
101 extern_c_macro = pyrex_prefix.upper() + "EXTERN_C"
103 exc_type_name = pyrex_prefix + "exc_type"
104 exc_value_name = pyrex_prefix + "exc_value"
105 exc_tb_name = pyrex_prefix + "exc_tb"
106 exc_lineno_name = pyrex_prefix + "exc_lineno"
108 exc_vars = (exc_type_name, exc_value_name, exc_tb_name)
110 exc_save_vars = (pyrex_prefix + 'save_exc_type',
111 pyrex_prefix + 'save_exc_value',
112 pyrex_prefix + 'save_exc_tb')
114 api_name = pyrex_prefix + "capi__"
116 h_guard_prefix = "__PYX_HAVE__"
117 api_guard_prefix = "__PYX_HAVE_API__"
118 api_func_guard = "__PYX_HAVE_API_FUNC_"
120 def py_version_hex(major, minor=0, micro=0, release_level=0, release_serial=0):
121 return (major << 24) | (minor << 16) | (micro << 8) | (release_level << 4) | (release_serial)