Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Delta Between Two Patch Sets: Modules/readline.c

Issue 3871: cross and native build of python for mingw32 with distutils
Left Patch Set: Created 9 years, 5 months ago
Right Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Modules/python.c ('k') | Modules/selectmodule.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 /* This module makes GNU readline available to Python. It has ideas 1 /* This module makes GNU readline available to Python. It has ideas
2 * contributed by Lee Busby, LLNL, and William Magro, Cornell Theory 2 * contributed by Lee Busby, LLNL, and William Magro, Cornell Theory
3 * Center. The completer interface was inspired by Lele Gaifax. More 3 * Center. The completer interface was inspired by Lele Gaifax. More
4 * recently, it was largely rewritten by Guido van Rossum. 4 * recently, it was largely rewritten by Guido van Rossum.
5 */ 5 */
6 6
7 /* Standard definitions */ 7 /* Standard definitions */
8 #include "Python.h" 8 #include "Python.h"
9 #include <setjmp.h> 9 #include <setjmp.h>
10 #include <signal.h> 10 #include <signal.h>
11 #include <errno.h> 11 #include <errno.h>
12 #include <sys/time.h> 12 #include <sys/time.h>
13
14 #ifdef MS_WINDOWS
15 /* on windows select don't work on files */
16 #undef HAVE_SELECT
17 #endif
13 18
14 #if defined(HAVE_SETLOCALE) 19 #if defined(HAVE_SETLOCALE)
15 /* GNU readline() mistakenly sets the LC_CTYPE locale. 20 /* GNU readline() mistakenly sets the LC_CTYPE locale.
16 * This is evil. Only the user or the app's main() should do this! 21 * This is evil. Only the user or the app's main() should do this!
17 * We must save and restore the locale around the rl_initialize() call. 22 * We must save and restore the locale around the rl_initialize() call.
18 */ 23 */
19 #define SAVE_LOCALE 24 #define SAVE_LOCALE
20 #include <locale.h> 25 #include <locale.h>
21 #endif 26 #endif
22 27
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 rl_initialize(); 903 rl_initialize();
899 #endif /* __APPLE__ */ 904 #endif /* __APPLE__ */
900 905
901 using_history(); 906 using_history();
902 907
903 rl_readline_name = "python"; 908 rl_readline_name = "python";
904 #if defined(PYOS_OS2) && defined(PYCC_GCC) 909 #if defined(PYOS_OS2) && defined(PYCC_GCC)
905 /* Allow $if term= in .inputrc to work */ 910 /* Allow $if term= in .inputrc to work */
906 rl_terminal_name = getenv("TERM"); 911 rl_terminal_name = getenv("TERM");
907 #endif 912 #endif
913 #ifdef MS_WINDOWS
914 /* FIXME: need more test before to skip this hack */
915 rl_terminal_name = "dumb";
916 #endif
908 /* Force rebind of TAB to insert-tab */ 917 /* Force rebind of TAB to insert-tab */
909 rl_bind_key('\t', rl_insert); 918 rl_bind_key('\t', rl_insert);
910 /* Bind both ESC-TAB and ESC-ESC to the completion function */ 919 /* Bind both ESC-TAB and ESC-ESC to the completion function */
911 rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap); 920 rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
912 rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap); 921 rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
913 /* Set our hook functions */ 922 /* Set our hook functions */
914 rl_startup_hook = (Function *)on_startup_hook; 923 rl_startup_hook = (Function *)on_startup_hook;
915 #ifdef HAVE_RL_PRE_INPUT_HOOK 924 #ifdef HAVE_RL_PRE_INPUT_HOOK
916 rl_pre_input_hook = (Function *)on_pre_input_hook; 925 rl_pre_input_hook = (Function *)on_pre_input_hook;
917 #endif 926 #endif
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 1178
1170 #endif /* __APPLE__ */ 1179 #endif /* __APPLE__ */
1171 1180
1172 m = PyModule_Create(&readlinemodule); 1181 m = PyModule_Create(&readlinemodule);
1173 1182
1174 if (m == NULL) 1183 if (m == NULL)
1175 return NULL; 1184 return NULL;
1176 1185
1177 1186
1178 1187
1188 #ifndef MS_WINDOWS
1189 /* FIXME: windows readline(prompt) may not work ? */
1179 PyOS_ReadlineFunctionPointer = call_readline; 1190 PyOS_ReadlineFunctionPointer = call_readline;
1191 #endif
1180 setup_readline(); 1192 setup_readline();
1181 return m; 1193 return m;
1182 } 1194 }
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+