parameters: (hook)
docstring: Set up things for the interpreter to call our function like GNU readline.
docstring_summary: Set up things for the interpreter to call our function like GNU readline.
docstring_tokens: Set up things for the interpreter to call our function like GNU readline .
function: def install_readline(hook):
      '''Set up things for the interpreter to call our function like GNU readline.'''
      global readline_hook, readline_ref
      # save the hook so the wrapper can call it
      readline_hook = hook
      # get the address of PyOS_ReadlineFunctionPointer so we can update it
      PyOS_RFP = c_int.from_address(Console.GetProcAddress(sys.dllhandle,
                                                   "PyOS_ReadlineFunctionPointer"))
      # save a reference to the generated C-callable so it doesn't go away
      if sys.version < '2.3':
          readline_ref = HOOKFUNC22(hook_wrapper)
      else:
          readline_ref = HOOKFUNC23(hook_wrapper_23)
      # get the address of the function
      func_start = c_int.from_address(addressof(readline_ref)).value
      # write the function address into PyOS_ReadlineFunctionPointer
      PyOS_RFP.value = func_start
function_tokens: def install_readline ( hook ) : global readline_hook , readline_ref # save the hook so the wrapper can call it readline_hook = hook # get the address of PyOS_ReadlineFunctionPointer so we can update it PyOS_RFP = c_int . from_address ( Console . GetProcAddress ( sys . dllhandle , "PyOS_ReadlineFunctionPointer" ) ) # save a reference to the generated C-callable so it doesn't go away if sys . version < '2.3' : readline_ref = HOOKFUNC22 ( hook_wrapper ) else : readline_ref = HOOKFUNC23 ( hook_wrapper_23 ) # get the address of the function func_start = c_int . from_address ( addressof ( readline_ref ) ) . value # write the function address into PyOS_ReadlineFunctionPointer PyOS_RFP . value = func_start