/[emacs]/emacs/src/mac.c
ViewVC logotype

Diff of /emacs/src/mac.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26 by mituharu, Thu Feb 3 11:55:47 2005 UTC revision 1.27 by mituharu, Fri Mar 4 11:08:05 2005 UTC
# Line 25  Boston, MA 02111-1307, USA.  */ Line 25  Boston, MA 02111-1307, USA.  */
25  #include <stdio.h>  #include <stdio.h>
26  #include <errno.h>  #include <errno.h>
27  #include <time.h>  #include <time.h>
 #include <utime.h>  
 #include <dirent.h>  
 #include <sys/types.h>  
 #include <sys/stat.h>  
 #include <string.h>  
 #include <pwd.h>  
 #include <grp.h>  
 #include <sys/param.h>  
 #include <stdlib.h>  
 #include <fcntl.h>  
 #if __MWERKS__  
 #include <unistd.h>  
 #endif  
28    
29    #ifdef HAVE_CARBON
30  #ifdef MAC_OSX  #ifdef MAC_OSX
31  #undef mktime  #undef mktime
32  #undef DEBUG  #undef DEBUG
# Line 57  Boston, MA 02111-1307, USA.  */ Line 45  Boston, MA 02111-1307, USA.  */
45  #define realloc unexec_realloc  #define realloc unexec_realloc
46  #undef init_process  #undef init_process
47  #define init_process emacs_init_process  #define init_process emacs_init_process
48  #else /* not MAC_OSX */  #else  /* not MAC_OSX */
49    #undef SIGHUP
50    #define OLDP2C 1
51    #include <Carbon.h>
52    #endif  /* not MAC_OSX */
53    #else   /* not HAVE_CARBON */
54  #include <Files.h>  #include <Files.h>
55  #include <MacTypes.h>  #include <MacTypes.h>
56  #include <TextUtils.h>  #include <TextUtils.h>
# Line 69  Boston, MA 02111-1307, USA.  */ Line 62  Boston, MA 02111-1307, USA.  */
62  #include <OSA.h>  #include <OSA.h>
63  #include <AppleScript.h>  #include <AppleScript.h>
64  #include <Scrap.h>  #include <Scrap.h>
65  #endif /* not MAC_OSX */  #include <Events.h>
66    #include <Processes.h>
67    #include <EPPC.h>
68    #endif  /* not HAVE_CARBON */
69    
70    #include <utime.h>
71    #include <dirent.h>
72    #include <sys/types.h>
73    #include <sys/stat.h>
74    #include <string.h>
75    #include <pwd.h>
76    #include <grp.h>
77    #include <sys/param.h>
78    #include <stdlib.h>
79    #include <fcntl.h>
80    #if __MWERKS__
81    #include <unistd.h>
82    #endif
83    
84  #include "lisp.h"  #include "lisp.h"
85  #include "process.h"  #include "process.h"
# Line 812  sys_fopen (const char *name, const char Line 822  sys_fopen (const char *name, const char
822  }  }
823    
824    
 #include <Events.h>  
   
825  long target_ticks = 0;  long target_ticks = 0;
826    
827  #ifdef __MRC__  #ifdef __MRC__
# Line 856  select (n,  rfds, wfds, efds, timeout) Line 864  select (n,  rfds, wfds, efds, timeout)
864    struct timeval *timeout;    struct timeval *timeout;
865  {  {
866  #if TARGET_API_MAC_CARBON  #if TARGET_API_MAC_CARBON
867    return 1;    OSErr err;
868      EventTimeout timeout_sec =
869        (timeout
870         ? (EMACS_SECS (*timeout) * kEventDurationSecond
871            + EMACS_USECS (*timeout) * kEventDurationMicrosecond)
872         : kEventDurationForever);
873    
874      if (FD_ISSET (0, rfds))
875        {
876          BLOCK_INPUT;
877          err = ReceiveNextEvent (0, NULL, timeout_sec, kEventLeaveInQueue, NULL);
878          UNBLOCK_INPUT;
879          if (err == noErr)
880            return 1;
881          else
882            FD_ZERO (rfds);
883        }
884      return 0;
885  #else /* not TARGET_API_MAC_CARBON */  #else /* not TARGET_API_MAC_CARBON */
886    EventRecord e;    EventRecord e;
887    UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +    UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +
# Line 1421  path_from_vol_dir_name (char *path, int Line 1446  path_from_vol_dir_name (char *path, int
1446    return 1;  /* success */    return 1;  /* success */
1447  }  }
1448    
1449    
1450    OSErr
1451    posix_pathname_to_fsspec (ufn, fs)
1452         const char *ufn;
1453         FSSpec *fs;
1454    {
1455      Str255 mac_pathname;
1456    
1457      if (posix_to_mac_pathname (ufn, mac_pathname, sizeof (mac_pathname)) == 0)
1458        return fnfErr;
1459      else
1460        {
1461          c2pstr (mac_pathname);
1462          return FSMakeFSSpec (0, 0, mac_pathname, fs);
1463        }
1464    }
1465    
1466    OSErr
1467    fsspec_to_posix_pathname (fs, ufn, ufnbuflen)
1468         const FSSpec *fs;
1469         char *ufn;
1470         int ufnbuflen;
1471    {
1472      char mac_pathname[MAXPATHLEN];
1473    
1474      if (path_from_vol_dir_name (mac_pathname, sizeof (mac_pathname) - 1,
1475                                  fs->vRefNum, fs->parID, fs->name)
1476          && mac_to_posix_pathname (mac_pathname, ufn, ufnbuflen))
1477        return noErr;
1478      else
1479        return fnfErr;
1480    }
1481    
1482  #ifndef MAC_OSX  #ifndef MAC_OSX
1483    
1484  int  int
# Line 1899  uname (struct utsname *name) Line 1957  uname (struct utsname *name)
1957  }  }
1958    
1959    
 #include <Processes.h>  
 #include <EPPC.h>  
   
1960  /* Event class of HLE sent to subprocess.  */  /* Event class of HLE sent to subprocess.  */
1961  const OSType kEmacsSubprocessSend = 'ESND';  const OSType kEmacsSubprocessSend = 'ESND';
1962    
# Line 2770  and t is the same as `SECONDARY'.  */) Line 2825  and t is the same as `SECONDARY'.  */)
2825    return Qnil;    return Qnil;
2826  }  }
2827    
 extern void mac_clear_font_name_table P_ ((void));  
2828    
2829  DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,  DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table, Smac_clear_font_name_table, 0, 0, 0,
2830         doc: /* Clear the font name table.  */)         doc: /* Clear the font name table.  */)

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26