Show
Ignore:
Timestamp:
01/23/05 17:06:29 (4 years ago)
Author:
miyoshi
Message:

* alloc.c: Sync up with Emacs CVS HEAD.

* blockinput.h: Ditto.

* buffer.c: Ditto.

* buffer.h: Ditto.

* callint.c: Ditto.

* callproc.c: Ditto.

* casefiddle.c: Ditto.

* charset.c: Ditto.

* coding.c: Ditto.

* data.c: Ditto.

* dispnew.c: Ditto.

* doc.c: Ditto.

* editfns.c: Ditto.

* emacs.c: Ditto.

* fileio.c: Ditto.

* floatfns.c: Ditto.

* fns.c: Ditto.

* fontset.c: Ditto.

* getloadavg.c: Ditto.

* gmalloc.c: Ditto.

* insdel.c: Ditto.

* keyboard.c: Ditto.

* keyboard.h: Ditto.

* lisp.h: Ditto.

* lread.c: Ditto.

* macros.c: Ditto.

* marker.c: Ditto.

* minibuf.c: Ditto.

* mktime.c: Ditto.

* mw32term.c: Ditto.

* process.c: Ditto.

* process.h: Ditto.

* scroll.c: Ditto.

* sound.c: Ditto.

* sysdep.c: Ditto.

* systty.h: Ditto.

* syswait.h: Ditto.

* term.c: Ditto.

* termcap.c: Ditto.

* termhooks.h: Ditto.

* tparam.c: Ditto.

* undo.c: Ditto.

* unexelf.c: Ditto.

* unexw32.c: Ditto.

* w32.h: Ditto.

* w32console.c: Ditto.

* w32heap.c: Ditto.

* w32inevt.c: Ditto.

* w32proc.c: Ditto.

* w32reg.c: Ditto.

* w32xfns.c: Ditto.

* xdisp.c: Ditto.

* xfaces.c: Ditto.

* xmenu.c: Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/src/sysdep.c

    r3598 r3600  
    11/* Interfaces to system-dependent kernel and library entries. 
    2    Copyright (C) 1985, 86,87,88,93,94,95, 1999, 2000, 2001 
     2   Copyright (C) 1985, 86,87,88,93,94,95,1999,2000,01,2003 
    33   Free Software Foundation, Inc. 
    44 
     
    2020Boston, MA 02111-1307, USA.  */ 
    2121 
    22  
    23 #include "config.h" 
     22#ifdef HAVE_CONFIG_H 
     23#include <config.h> 
     24#endif 
     25 
    2426#include <signal.h> 
     27#include <stdio.h> 
    2528#include <setjmp.h> 
    2629#ifdef HAVE_UNISTD_H 
     
    4750#undef NULL 
    4851 
    49 #ifdef macintosh 
     52#ifdef MAC_OS8 
    5053/* It is essential to include stdlib.h so that this file picks up 
    5154   the correct definitions of rand, srand, and RAND_MAX. 
     
    5760static int delete_exited_processes; 
    5861#endif 
    59 #endif  /* macintosh */ 
     62#endif  /* MAC_OS8 */ 
    6063 
    6164#ifdef WINDOWSNT 
     
    7578#endif 
    7679 
    77 #include <stdio.h> 
    7880#include <sys/types.h> 
    7981#include <sys/stat.h> 
    8082#include <errno.h> 
    81  
    82 /* Get _POSIX_VDISABLE, if it is available.  */ 
    83 #ifdef HAVE_UNISTD_H 
    84 #include <unistd.h> 
    85 #endif 
    86  
    87 #ifdef HAVE_STDLIB_H 
    88 #include <stdlib.h> 
    89 #endif 
    9083 
    9184#ifdef HAVE_SETPGID 
     
    146139#endif /* not VMS */ 
    147140 
    148 #ifndef BSD4_1 
    149 #ifdef BSD_SYSTEM /* avoid writing defined (BSD_SYSTEM) || defined (USG) 
    150               because the vms compiler doesn't grok `defined' */ 
     141#ifdef HAVE_FCNTL_H 
    151142#include <fcntl.h> 
    152143#endif 
    153 #ifdef USG 
    154 #ifndef USG5 
    155 #include <fcntl.h> 
    156 #endif 
    157 #endif 
    158 #endif /* not 4.1 bsd */ 
    159144 
    160145#ifndef MSDOS 
     
    250235#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T) 
    251236#else 
    252 #if defined (HAVE_TERMIOS_H) && defined (LINUX) 
     237#if defined (HAVE_TERMIOS_H) && defined (GNU_LINUX) 
    253238#include <termios.h> 
    254239#endif 
     
    330315 
    331316void 
     317#ifdef PROTOTYPES 
     318stuff_char (char c) 
     319#else 
    332320stuff_char (c) 
    333321     char c; 
     322#endif 
    334323{ 
    335324  if (read_socket_hook) 
     
    481470      wait (0); 
    482471#else /* neither BSD_SYSTEM nor UNIPLUS: random sysV */ 
    483 #ifdef POSIX_SIGNALS    /* would this work for LINUX as well? */ 
     472#ifdef POSIX_SIGNALS    /* would this work for GNU/Linux as well? */ 
    484473      sigblock (sigmask (SIGCHLD)); 
    485474      errno = 0; 
     
    766755/* Fork a subshell.  */ 
    767756 
    768 #ifndef macintosh 
     757#ifndef MAC_OS8 
    769758void 
    770759sys_subshell () 
     
    802791 
    803792  dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); 
    804   str = (unsigned char *) alloca (XSTRING (dir)->size + 2); 
    805   len = XSTRING (dir)->size
    806   bcopy (XSTRING (dir)->data, str, len); 
     793  str = (unsigned char *) alloca (SCHARS (dir) + 2); 
     794  len = SCHARS (dir)
     795  bcopy (SDATA (dir), str, len); 
    807796  if (str[len - 1] != '/') str[len++] = '/'; 
    808797  str[len] = 0; 
     
    845834#ifdef SET_EMACS_PRIORITY 
    846835      { 
    847         extern int emacs_priority; 
     836        extern EMACS_INT emacs_priority; 
    848837 
    849838        if (emacs_priority < 0) 
     
    887876#endif /* !VMS */ 
    888877} 
    889 #endif /* !macintosh */ 
     878#endif /* !MAC_OS8 */ 
    890879 
    891880static void 
     
    12991288  struct emacs_tty tty; 
    13001289 
    1301 #ifdef macintosh 
     1290#ifdef MAC_OS8 
    13021291/* cus-start.el complains if delete-exited-processes is not defined */ 
    13031292#ifndef subprocesses 
     
    13071296  delete_exited_processes = 0; 
    13081297#endif 
    1309 #endif /* not macintosh */ 
     1298#endif /* MAC_OS8 */ 
    13101299 
    13111300#ifdef VMS 
     
    20051994    { 
    20061995      struct input_event e; 
    2007       e.kind = ascii_keystroke; 
     1996      EVENT_INIT (e); 
     1997 
     1998      e.kind = ASCII_KEYSTROKE_EVENT; 
    20081999      XSETINT (e.code, c); 
    20092000      e.frame_or_window = selected_frame; 
     
    22312222 */ 
    22322223 
     2224#ifndef start_of_data 
    22332225char * 
    22342226start_of_data () 
     
    22532245#endif /* DATA_START */ 
    22542246} 
     2247#endif /* start_of_data */ 
    22552248#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */ 
    22562249 
     
    23832376          { 
    23842377            char *fqdn = (char *) hp->h_name; 
     2378#if 0 
    23852379            char *p; 
     2380#endif 
    23862381 
    23872382            if (!index (fqdn, '.')) 
     
    24572452  { 
    24582453    unsigned char *p; 
    2459     for (p = XSTRING (Vsystem_name)->data; *p; p++) 
     2454    for (p = SDATA (Vsystem_name); *p; p++) 
    24602455      if (*p == ' ' || *p == '\t') 
    24612456        *p = '-'; 
     
    26422637   waiting for at least one character.  */ 
    26432638 
    2644 /* Make all keyboard buffers much bigger when using a window system.  */ 
    2645 #ifdef HAVE_WINDOW_SYSTEM 
    2646 #define BUFFER_SIZE_FACTOR 16 
    2647 #else 
    2648 #define BUFFER_SIZE_FACTOR 1 
    2649 #endif 
    2650  
    26512639void 
    26522640read_input_waiting () 
    26532641{ 
    2654   struct input_event e; 
    26552642  int nread, i; 
    26562643  extern int quit_char; 
     
    26722659          /* Don't look at input that follows a C-g too closely. 
    26732660             This reduces lossage due to autorepeat on C-g.  */ 
    2674           if (buf[i].kind == ascii_keystroke 
     2661          if (buf[i].kind == ASCII_KEYSTROKE_EVENT 
    26752662              && buf[i].code == quit_char) 
    26762663            break; 
     
    26792666  else 
    26802667    { 
     2668      struct input_event e; 
    26812669      char buf[3]; 
    26822670      nread = read (fileno (stdin), buf, 1); 
     2671      EVENT_INIT (e); 
    26832672 
    26842673      /* Scan the chars for C-g and store them in kbd_buffer.  */ 
    2685       e.kind = ascii_keystroke
     2674      e.kind = ASCII_KEYSTROKE_EVENT
    26862675      e.frame_or_window = selected_frame; 
    26872676      e.modifiers = 0; 
     
    28662855#endif /* POSIX_SIGNALS */ 
    28672856  
    2868 #if !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED 
     2857#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST 
    28692858static char *my_sys_siglist[NSIG]; 
    28702859# ifdef sys_siglist 
     
    28822871#endif 
    28832872 
    2884 #if !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED 
     2873#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST 
    28852874  if (! initialized) 
    28862875    { 
     
    30423031# endif 
    30433032    } 
    3044 #endif /* !defined HAVE_STRSIGNAL && !defined SYS_SIGLIST_DECLARED */ 
     3033#endif /* !defined HAVE_STRSIGNAL && !defined HAVE_DECL_SYS_SIGLIST */ 
    30453034} 
    30463035  
     
    32543243int 
    32553244emacs_open (path, oflag, mode) 
    3256      char *path; 
     3245     const char *path; 
    32573246     int oflag, mode; 
    32583247{ 
     
    33053294emacs_write (fildes, buf, nbyte) 
    33063295     int fildes; 
    3307      char *buf; 
     3296     const char *buf; 
    33083297     unsigned int nbyte; 
    33093298{ 
     
    37663755    } 
    37673756 
    3768   if (synch_process_death != 0 || synch_process_retcode != 0) 
     3757  if (synch_process_death != 0 || synch_process_retcode != 0 
     3758      || synch_process_termsig != 0) 
    37693759    { 
    37703760      errno = EIO;              /* We don't know why, but */ 
     
    38123802    } 
    38133803 
    3814   if (synch_process_death != 0 || synch_process_retcode != 0) 
     3804  if (synch_process_death != 0 || synch_process_retcode != 0 
     3805      || synch_process_termsig != 0) 
    38153806    { 
    38163807      errno = EIO;              /* We don't know why, but */ 
     
    53235314#endif /* HAVE_STRSIGNAL */ 
    53245315 
     5316/* arch-tag: edb43589-4e09-4544-b325-978b5b121dcf 
     5317   (do not change this comment) */