1. 29 Aug, 2013 1 commit
    • Eli Zaretskii's avatar
      A possible fix for bug #14333 with hanging at exit on MS-Windows. · 3f940c5a
      Eli Zaretskii authored
       src/w32.c (term_winsock): Call release_listen_threads before calling
       WSACleanup.
       (_sys_wait_accept): Wait for accept event in a loop with a finite
       timeout, instead of waiting indefinitely.  Will hopefully avoid
       hanging during exit because WSACleanup deadlocks waiting for the
       event object to be released.
       src/w32proc.c (release_listen_threads): New function, signals all
       the reader threads that listen for connections to stop waiting.
       src/w32.h (release_listen_threads): Add prototype.
      3f940c5a
  2. 07 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Make file descriptors close-on-exec when possible. · 067428c1
      Paul Eggert authored
      This simplifies Emacs a bit, since it no longer needs to worry
      about closing file descriptors by hand in some cases.
      It also fixes some unlikely races.  Not all such races, as
      libraries often open files internally without setting
      close-on-exec, but it's an improvement.
      * admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
      (GNULIB_TOOL_FLAGS): Avoid binary-io, close.  Do not avoid fcntl.
      * configure.ac (mkostemp): New function to check for.
      (PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
      * lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
      * m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
      otherwise, gnulib-tool complains given close-on-exec changes.
      * nt/inc/ms-w32.h (pipe): Remove.
      * nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
      (gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
      * src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
      * src/callproc.c (Fcall_process) [!MSDOS]:
      * src/emacs.c (main) [!DOS_NT]:
      * src/nsterm.m (ns_term_init):
      * src/process.c (create_process):
      Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
      * src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
      * src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
      Prefer mkostemp with O_CLOEXEC to mkstemp.
      * src/callproc.c (relocate_fd) [!WINDOWSNT]:
      * src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
      No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
      now using pipe2.
      * src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
      Make the resulting file descriptor close-on-exec.
      * src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
      * src/lread.c (load_descriptor_list, load_descriptor_unwind):
      Remove; no longer needed.  All uses removed.
      * src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
      (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
      New functions.
      (socket) [!SOCK_CLOEXEC]: Supply a substitute.
      (Fmake_network_process, Fnetwork_interface_list):
      (Fnetwork_interface_info, server_accept_connection):
      Make newly-created socket close-on-exec.
      * src/sysdep.c (emacs_open, emacs_fopen):
      Make new-created descriptor close-on-exec.
      * src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
      * src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
      
      Fixes: debbugs:14803
      067428c1
  3. 05 Mar, 2013 1 commit
    • Paul Eggert's avatar
      FILE's lock is now always .#FILE and may be a regular file. · 70743157
      Paul Eggert authored
      * etc/NEWS: Document this.
      * nt/inc/unistd.h (O_NOFOLLOW): New macro.
      * src/filelock.c: Include <c-ctype.h>.
      (MAX_LFINFO): New top-level constant.
      (lock_info_type): Remove members pid, boot_time.  Add members at,
      dot, colon.  Change user member to be the entire buffer, not a
      pointer.  This allows us to handle the case where a foreign
      pid or boot time exceeds the local range.  All uses changed.
      (LINKS_MIGHT_NOT_WORK): New constant.
      (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
      (defined_WINDOWSNT): Remove.
      (MAKE_LOCK_NAME, file_in_lock_file_name):
      Always use .#FILE (not .#-FILE) for the file lock,
      even if it is a regular file.
      (rename_lock_file): New function.
      (create_lock_file): Use it.
      (create_lock_file, read_lock_data):
      Prefer a symbolic link for the lock file, falling back on a
      regular file if symlinks don't work.  Do not try to create
      symlinks on MS-Windows, due to security hassles.  Stick with
      POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
      link, rename, unlink, mkstemp) when creating locks, as a GNUish
      host may be using a Windowsish file system, and cannot use
      MS-Windows-only system calls.  Fall back on mktemp if mkstemp
      doesn't work.  Don't fail merely because of a symlink-contents
      length limit in the current file system; fall back on regular
      files.  Increase the symlink contents length limit to 8 KiB, this
      should be big enough for any real use and doesn't crunch the
      stack.
      (create_lock_file, lock_file_1, read_lock_data):
      Simplify allocation of lock file buffers now that they fit in 8 KiB.
      (lock_file_1): Return error number, not bool.  All callers changed.
      (ELOOP): New macro, if not already defined.
      (read_lock_data): Return size of lock file contents, not Lisp object.
      All callers changed.  Handle a race condition if some other process
      replaces a regular-file lock with a symlink lock or vice versa,
      while we're trying to read the lock.
      (current_lock_owner): Parse contents more carefully, to help avoid
      confusing a regular-file lock with some other application's use
      of the file.  Check for lock file contents being too long, or
      not parsing correctly.
      (current_lock_owner, lock_file):
      Allow foreign pid and boot times that exceed the local range.
      (current_lock_owner, lock_if_free, lock_file):
      Simplify allocation of lock file contents.
      * src/w32.c (sys_rename_replace): New function, containing most of
      the contents of the old sys_rename.
      (sys_rename): Use it.
      (fchmod): New dummy function.
      * src/w32.h (sys_rename_replace, fchmod): New decls.
      
      Fixes: debbugs:13807
      70743157
  4. 02 Feb, 2013 1 commit
    • Eli Zaretskii's avatar
      Avoid encoding file names run through dostounix_filename on MS-Windows. · e7ac588e
      Eli Zaretskii authored
       src/w32.c (normalize_filename): Accept an additional argument
       MULTIBYTE; if non-zero, traverse the file name by bytes and don't
       downcase it even if w32-downcase-file-names is non-nil.
       (dostounix_filename): Accept an additional argument MULTIBYTE and
       pass it to normalize_filename.
       (emacs_root_dir): Adjust.
       src/msdos.h (dostounix_filename): Adjust prototype.
       src/w32.h (dostounix_filename): Adjust prototype.
       src/msdos.c (dostounix_filename): Accept an additional argument and
       ignore it.
       (init_environment): Adjust callers of dostounix_filename.
       src/fileio.c (Ffile_name_directory, file_name_as_directory)
       (directory_file_name, Fexpand_file_name)
       (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
       dostounix_filename.
       [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
       non-nil.
       (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
       variables, as egetenv is case-insensitive for DOS_NT.
       src/dired.c (file_name_completion): Don't call Fdirectory_file_name
       with an encoded file name.
       src/w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
       calls to dostounix_filename.
       src/w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
       src/unexw32.c (unexec): Adjust call to dostounix_filename.
       src/termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
       src/emacs.c (decode_env_path) [DOS_NT]: Adjust call to
       dostounix_filename.
       src/callproc.c (Fcall_process) [MSDOS]: Adjust call to
       dostounix_filename.
      e7ac588e
  5. 01 Jan, 2013 1 commit
  6. 15 Dec, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix bug #13079 on MS-Windows with temp files not being deleted. · b0728617
      Eli Zaretskii authored
       src/w32.h (_child_process): New members input_file and
       pending_deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New prototypes.
       src/w32proc.c (new_child): Initialize input_file and
       pending_deletion members of the child.
       (delete_child): Delete the child's temporary input file, if any,
       that is pending deletion.
       (register_child): First argument is now pid_t.
       (record_infile, record_pending_deletion): New functions.
       (reap_subprocess): Fix a typo in DebPrint string.
       (sys_spawnve, sys_kill): Use pid_t for PID arguments.
       src/fileio.c (internal_delete_file): Return an int again: non-zero
       if delete-file succeeds, zero otherwise.
       src/lisp.h (internal_delete_file): Adjust prototype.
       src/callproc.c (Fcall_process): Don't overwrite infile with result
       of DECODE_FILE.
       [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
       asynchronous subprocess, record the name of the input file name,
       if any.
       (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
       delete the file, record it as pending deletion when the subprocess
       exits.
      
       nt/inc/ms-w32.h (sys_unlink): Provide prototype.
      b0728617
    • Eli Zaretskii's avatar
  7. 21 Nov, 2012 1 commit
    • Paul Eggert's avatar
      Assume POSIX 1003.1-1988 or later for unistd.h. · 9239d970
      Paul Eggert authored
      * admin/CPP-DEFINES (BROKEN_GETWD, HAVE_GETCWD, HAVE_GETWD, HAVE_SIZE_T)
      (HAVE_UNISTD_H): Remove.
      * configure.ac: Do not check for getcwd or getwd.
      * lib-src/emacsclient.c (getcwd): Remove decl.
      (get_current_dir_name): Assume getcwd exists.
      * lib-src/etags.c (HAVE_GETCWD): Remove.
      (getcwd): Remove decl.
      (NO_LONG_OPTIONS): Remove this.  All uses removed.
      Emacs always has GNU getopt.
      (etags_getcwd): Assume getcwd exists.
      * lib-src/movemail.c (F_OK, X_OK, W_OK, R_OK): Remove.
      * nt/config.nt (HAVE_GETCWD): Remove.
      * src/alloc.c: Assume unistd.h exists.
      * src/fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
      * src/sysdep.c (get_current_dir_name): Assume getcwd exists.
      (getwd) [USG]: Remove; no longer needed.
      (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
      * src/w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
      * src/w32.h (getcwd): Remove decl.
      
      Fixes: debbugs:12945
      9239d970
  8. 17 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix warnings when compiling on MS-Windows with -std=gnu99. · a68089e4
      Eli Zaretskii authored
       src/makefile.w32-in ($(BLD)/w32.$(O)): 
       ($(BLD)/vm-limit.$(O)): 
       ($(BLD)/term.$(O)): 
       ($(BLD)/unexw32.$(O)): 
       ($(BLD)/fileio.$(O)): 
       ($(BLD)/dispnew.$(O)): Update dependencies.
       src/w32term.h (w32_initialize_display_info, initialize_w32_display):
       Add prototypes.
       src/w32proc.c: Include ctype.h.
       src/w32.h (init_environment, check_windows_init_file)
       (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
       (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
       (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
       (sys_link): Add prototypes.
       src/w32.c: Include w32select.h.
       (sys_access, e_malloc, sys_select): Add prototypes.
       (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
       src/vm-limit.c [WINDOWSNT]: Include w32heap.h.
       src/unexw32.c: Include lisp.h and w32.h.
       src/term.c [WINDOWSNT]: Include w32term.h.
       src/process.c [WINDOWSNT]: Add prototype of sys_select.
       src/fileio.c [WINDOWSNT]: Include w32.h.
       src/dispnew.c [WINDOWSNT]: Include w32.h.
      
       nt/inc/pwd.h (getuid, geteuid): Add prototypes.
       nt/inc/ms-w32.h (sys_wait, _getpid, gmtgime_r, localtime_r)
       (signal_handler, sys_signal, sigemptyset, sigfillset, sigprocmask)
       (pthread_sigmask, sigismember, setpgrp, sigaction, alarm)
       (sys_kill, getpagesize): Add prototypes for emulated functions.
       nt/inc/grp.h (getgid, getegid): Add prototypes.
       nt/gmake.defs (DEBUG_CFLAGS) [NOOPT]: Add -std=gnu99.
       nt/configure.bat (chkapiN): Avoid compiler warning in junk.c when
       compiling with -std=gnu99.
       nt/config.nt (CHECK_LISP_OBJECT_TYPE): Don't undef, so that it
       could be used via --cflags switch to configure.bat.
      a68089e4
  9. 30 Sep, 2012 1 commit
    • Eli Zaretskii's avatar
      Support atimers and CPU profiler via profile.c on MS-Windows. · c06c382a
      Eli Zaretskii authored
       src/w32proc.c (sig_mask, crit_sig): New static variables.
       (sys_signal): Support SIGALRM and SIGPROF.
       (sigemptyset, sigaddset, sigfillset, sigprocmask)
       (pthread_sigmask, setpgrp): Moved here from w32.c.  sigaddset,
       sigfillset, and sigprocmask are no longer no-ops.
       (sigismember): New function.
       (struct itimer_data): New definition.
       (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
       (crit_prof): New static variables.
       (MAX_SINGLE_SLEEP): New definition.
       (timer_loop, stop_timer_thread, term_timers, init_timers)
       (start_timer_thread, getitimer, setitimer): New functions.
       (alarm): No longer a no-op, calls setitimer.
       src/w32.c (term_ntproc): Call term_timers.
       (init_ntproc): Make sure all signals are unblocked at startup, to
       erase any traces of dumping.  Call init_timers.
       src/w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
       Windows-specific code to display the hourglass mouse pointer is no
       longer used.
       (w32_wnd_proc): Remove code that handled the WM_TIMER message due
       to hourglass timer expiration.
       (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
       Remove, no longer used.
       (w32_note_current_window, show_hourglass, hide_hourglass): New
       functions, in support of hourglass cursor display similar to other
       window systems.
       (syms_of_w32fns): Don't initialize hourglass_timer.
       src/xdisp.c (start_hourglass, cancel_hourglass): Now used on
       WINDOWSNT as well.
       (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
       src/w32.h (init_timers, term_timers): Add prototypes.
      
       nt/inc/sys/time.h (ITIMER_REAL, ITIMER_PROF): Define.
       (struct itimerval): Define.
       (getitimer, setitimer): Add prototypes.
       nt/inc/ms-w32.h <sigset_t> [_MSVC_VER]: Make the typedef consistent
       with MinGW.
       (SA_RESTART, SIGPROF): Define.
       nt/config.nt (HAVE_SETITIMER): Define to 1.
      c06c382a
  10. 25 Sep, 2012 2 commits
    • Juanma Barranquero's avatar
      Move Vlibrary_cache to emacs.c and reset before dumping. · aa15c6bb
      Juanma Barranquero authored
      * src/lisp.h (reset_image_types): Declare.
      [WINDOWSNT] (Vlibrary_cache): Declare.
      
      * src/image.c (reset_image_types): New function.
      
      * src/emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
      (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
      (Fdump_emacs): Reset Vlibrary_cache and image_types.
      
      * src/w32.c (Vlibrary_cache): Do not define; moved to emacs.c
      (globals_of_w32) <Vlibrary_cache>: Do not initialize.
      
      * src/w32.h (Vlibrary_cache): Do not declare.
      aa15c6bb
    • Eli Zaretskii's avatar
      Fix handling of fatal signals and exceptions on MS-Windows. · 16b22fef
      Eli Zaretskii authored
       src/w32proc.c (sys_signal): Handle all signals defined by the
       MS-Windows runtime, not just SIGCHLD.  Actually install the signal
       handlers for signals supported by Windows.  Don't override
       term_ntproc as the handler for SIGABRT.
       (sigaction): Rewrite to call sys_signal instead of duplicating its
       code.
       (sys_kill): Improve commentary.
       src/w32.c (term_ntproc): Accept (and ignore) one argument, for
       consistency with a signature of a signal handler.  All callers
       changed.
       (init_ntproc): Accept an argument DUMPING.  If dumping, don't
       install term_ntproc as a signal handler for SIGABRT, as that
       should be done by the dumped Emacs.
       src/w32.h (init_ntproc, term_ntproc): Adjust prototypes.
       src/w32select.c (term_w32select): Protect against repeated
       invocation by setting clipboard_owner to NULL after calling
       DestroyWindow.
       src/emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
       and term_ntproc to their modified signatures.
      16b22fef
  11. 23 Sep, 2012 1 commit
    • Chong Yidong's avatar
      Remove LIBRARIES arg from w32_delayed_load and friends. · d07ff9db
      Chong Yidong authored
      These always use Vdynamic_library_alist anyway.
      
      * src/image.c (Finit_image_library, lookup_image_type)
      (define_image_type): Remove now-unneeded second arg.
      (init_xpm_functions, init_png_functions, init_jpeg_functions)
      (init_tiff_functions, init_gif_functions, init_svg_functions):
      Arglist and w32_delayed_load calling convention changed.
      (gs_type): Remove init_gs_functions; there is no such function.
      
      * src/gnutls.c (init_gnutls_functions): Caller changed; remove arg.
      (Fgnutls_available_p): Caller changed.
      
      * src/xml.c (init_libxml2_functions, Flibxml_parse_html_region)
      (Flibxml_parse_xml_region): Likewise.
      
      * src/dispextern.h (struct image_type): Remove arg from init function.
      
      * src/w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
      Vdynamic_library_alist.
      
      * lisp/image.el (image-type-available-p): Change caller to
      init-image-library.
      d07ff9db
  12. 17 Sep, 2012 1 commit
    • Daniel Colascione's avatar
      Implement cygw32 · 0fda9b75
      Daniel Colascione authored
      Here, we use the generic window-system configuration system we just
      implemented to support the w32 window-system in the mainline build
      under Cygwin.  (Previously, the w32 window system could only be
      compiled as part of the NT-native Emacs build process.)
      
      The changes in this patch need to be applied atomically in order to
      avoid breaking Emacs.  The changes include:
      
        - Changes throughout the Lisp and C code to not assume that
            NT Emacs and the w32 window system are synonymous.
      
        - Wiring up the regular select(2) event loop to Windows messages
      
        - Cleaning up the w32 drag-and-drop receiving code.
      
        - Exposing Cygwin path conversion functions to elisp.
      
        - Unicode file dialog support when compiling for Cygwin.
      
        - Splitting the w32 term lisp initialization code into code
          applicable to any w32 window-system and code specific to
          system-type windows-nt.
      
        - Integrating the old and new w32 code into the build system.
      0fda9b75
  13. 04 Aug, 2012 1 commit
    • Eli Zaretskii's avatar
      Fix bug #11959 with startup warnings on MS-Windows about ../site-lisp. · 76151e2c
      Eli Zaretskii authored
       src/w32.c (init_environment): Change the default values of many
       environment variables in dflt_envvars[] to NULL, to avoid pushing
       them into environment when they were not already defined.  Remove
       the code that deletes site-lisp subdirectories from the default
       value of EMACSLOADPATH, as it is no longer needed.
       (check_windows_init_file): Now external, not static.  Use
       Vload_path as is, without adding anything, as this function is now
       called when Vload_path is already set up.
       src/w32.h (check_windows_init_file): Add prototype.
       src/emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
       directory, ignore the /*/i386/ tail in Vinvocation_directory, for
       compatibility with Posix platforms.
       (main): Move the call to check_windows_init_file to here from
       w32.c.
       (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
       any, in the DEFALT argument into the root of the Emacs build or
       installation tree, as appropriate.
       src/callproc.c (init_callproc_1): Call decode_env_path instead of
       doing its equivalent by hand.
       (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
       the code that sets Vexec_path run on MS-Windows.
       src/lread.c (init_lread): Add comments to #ifdef's.
      
       nt/paths.h (PATH_LOADSEARCH, PATH_SITELOADSEARCH, PATH_EXEC)
       (PATH_DATA, PATH_DOC): Replace dummy directory names with
       directories relative to %emacs_dir%.
       (PATH_EXEC): Add lib-src/oo-spd/i386 and lib-src/oo/i386, to cater
       to the use case of running un-installed Emacs.
      76151e2c
  14. 11 Jan, 2012 1 commit
  15. 05 Jan, 2012 1 commit
  16. 28 Oct, 2011 1 commit
    • Eli Zaretskii's avatar
      Fix bug #8562 with Emacs display on Windows 9X. · db4f02f2
      Eli Zaretskii authored
      Thanks to oslsachem <oslsachem@gmail.com> for helping to debug this.
      
       src/w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
       (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
       (g_b_init_get_glyph_outline_w): New static variables.
       (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
       (GetGlyphOutlineW_Proc): New typedefs.
       (w32_load_unicows_or_gdi32, get_outline_metrics_w)
       (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font): New
       functions.
       (w32font_open_internal, compute_metrics): Call
       get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
       instead of calling the "wide" APIs directly.
       src/emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
       src/w32.h (syms_of_w32font): Add prototype.
      db4f02f2
  17. 04 May, 2011 1 commit
    • Juanma Barranquero's avatar
      Implement dynamic loading of GnuTLS on Windows. · 0898ca10
      Juanma Barranquero authored
      * lisp/term/w32-win.el (dynamic-library-alist): Add `gnutls'.
      
      * nt/INSTALL: Clarify GnuTLS support.
      
      * src/callproc.c, src/emacs.c: Include lisp.h before src/w32.h, not after.
      
      * src/gnutls.c (Qgnutls_dll): Define.
        (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
        (gnutls_*): Declare function pointers.
        (init_gnutls_functions): New function to initialize function pointers.
        (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
        (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
        (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
        Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
        (emacs_gnutls_write, emacs_gnutls_read)
        (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
        (Fgnutls_available_p): New function.
        (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
        (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
        (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
      
      * src/gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
        (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
        (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
        Declare.
      
      * src/w32.c (QCloaded_from, Vlibrary_cache): Define.
        (w32_delayed_load): Move from image.c.  When loading a library, record
        its filename in the :loaded-from property of the library id.
        (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
        Initialize and staticpro them.
        (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
      
      * src/image.c: Include w32.h.
        (Vimage_type_cache): Delete.
        (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
        (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
        (w32_delayed_load): Move to w32.c.
      
      * src/process.c: Include lisp.h before src/w32.h, not after.
        (wait_reading_process_output): Call emacs_gnutls_record_check_pending
        instead of gnutls_record_check_pending.
      
      * src/w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
      0898ca10
  18. 25 Apr, 2011 1 commit
    • Ted Zlatanov's avatar
      Add GnuTLS support for W32 and certificate and hostname verification in GnuTLS. · e061a11b
      Ted Zlatanov authored
      * src/gnutls.c: Renamed global_initialized to
      gnutls_global_initialized.  Added internals for the
      :verify-hostname-error, :verify-error, and :verify-flags
      parameters of `gnutls-boot' and documented those parameters in the
      docstring.  Start callback support.
      (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
      unless a fatal error occured. Call gnutls_alert_send_appropriate
      on error. Return error code.
      (emacs_gnutls_write): Call emacs_gnutls_handle_error.
      (emacs_gnutls_read): Likewise.
      (Fgnutls_boot): Return handshake error code.
      (emacs_gnutls_handle_error): New function.
      (wsaerror_to_errno): Likewise.
      
      * src/gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
      callbacks stage.
      
      * src/w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
      (emacs_gnutls_push): Likewise.
      
      * src/w32.h (emacs_gnutls_pull): Add prototype.
      (emacs_gnutls_push): Likewise.
      e061a11b
  19. 25 Jan, 2011 1 commit
  20. 15 Jan, 2011 1 commit
  21. 02 Jan, 2011 1 commit
  22. 13 Jan, 2010 1 commit
  23. 08 Jan, 2009 1 commit
  24. 13 Jun, 2008 1 commit
    • Glenn Morris's avatar
      Daniel Engeler <engeler at gmail.com> · d888760c
      Glenn Morris authored
      These changes add serial port access.
      * process.c: Add HAVE_SERIAL.
      (Fdelete_process, Fprocess_status, Fset_process_buffer)
      (Fset_process_filter, Fset_process_sentinel, Fprocess_contact)
      (list_processes_1, select_wrapper, Fstop_process)
      (Fcontinue_process, Fprocess_send_eof, kill_buffer_processes)
      (status_notify): Modify to handle serial processes.
      [HAVE_SERIAL] (Fserial_process_configure)
      [HAVE_SERIAL] (make_serial_process_unwind, Fmake_serial_process):
      New functions.
      * process.h (struct Lisp_Process): Add `type'.
      * sysdep.c [HAVE_TERMIOS] (serial_open, serial_configure):
      New functions.
      * w32.c (_sys_read_ahead, sys_read, sys_write): Modify to handle serial ports.
      (serial_open, serial_configure) New functions.
      * w32.h: Add FILE_SERIAL.
      (struct _child_process): Add ovl_read, ovl_write.
      d888760c
  25. 15 May, 2008 1 commit
  26. 08 Jan, 2008 1 commit
  27. 25 Jul, 2007 1 commit
  28. 14 Jan, 2007 1 commit
  29. 05 Aug, 2006 1 commit
  30. 14 Jul, 2006 2 commits
  31. 06 Feb, 2006 1 commit
  32. 07 Aug, 2005 1 commit
  33. 04 Jul, 2005 1 commit
  34. 15 Feb, 2005 1 commit
    • Jason Rumney's avatar
      2004-11-08 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> · 52c7f9ee
      Jason Rumney authored
              * w32select.c: Summary: Thorough rework to implement Unicode
              clipboard operations and delayed rendering.
      
              Drop last_clipboard_text and related code, keep track of
              ownership via clipboard_owner instead.  Drop old #if0
              sections.
      
              (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP)
              (clipboard_owner, modifying_clipboard, cfg_coding_system)
              (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text)
              (current_coding_system, current_requires_encoding)
              (current_num_nls, current_clipboard_type, current_lcid): New
              static variables.
      
              (convert_to_handle_as_ascii, convert_to_handle_as_coded)
              (render, render_all, run_protected, lisp_error_handler)
              (owner_callback, create_owner, setup_config)
              (enum_locale_callback, cp_from_locale, coding_from_cp): New
              local functions.
      
              (term_w32select, globals_of_w32select): New global functions.
      
              (Fw32_set_clipboard_data): Ignore parameter FRAME, use
              clipboard_owner instead.  Use delayed rendering and provide
              all text formats.  Provide CF_LOCALE if necessary.
      
              (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and
              CF_LOCALE.  Fall back to CF_TEXT, if CF_UNICODETEXT is not
              available.  Force DOS line-ends for decoding.
      
              (Fx_selection_exists_p): Handle CF_UNICODETEXT.
      
              (syms_of_w32select): Init and register new variables.
      
              * w32.h: Add prototypes for globals_of_w32select and
              term_w32select.  Make the neighboring K&R declarations into
              prototypes, too.
      
              * emacs.c: Include w32.h to get function prototypes.
              (main): Call globals_of_w32select.
      
              * w32.c (term_ntproc): Call term_w32select.
      
              * mule-cmds.el (set-locale-environment): Remove call to
              set-selection-coding-system on Windows.
      
              * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef.
      52c7f9ee
  35. 16 Apr, 2004 1 commit
  36. 08 Sep, 2003 1 commit
  37. 01 Sep, 2003 1 commit