[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/mac.c
From: |
YAMAMOTO Mitsuharu |
Subject: |
[Emacs-diffs] Changes to emacs/src/mac.c |
Date: |
Fri, 04 Mar 2005 06:08:05 -0500 |
Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.26 emacs/src/mac.c:1.27
*** emacs/src/mac.c:1.26 Thu Feb 3 11:55:47 2005
--- emacs/src/mac.c Fri Mar 4 11:08:05 2005
***************
*** 25,44 ****
#include <stdio.h>
#include <errno.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
#ifdef MAC_OSX
#undef mktime
#undef DEBUG
--- 25,32 ----
#include <stdio.h>
#include <errno.h>
#include <time.h>
+ #ifdef HAVE_CARBON
#ifdef MAC_OSX
#undef mktime
#undef DEBUG
***************
*** 57,63 ****
#define realloc unexec_realloc
#undef init_process
#define init_process emacs_init_process
! #else /* not MAC_OSX */
#include <Files.h>
#include <MacTypes.h>
#include <TextUtils.h>
--- 45,56 ----
#define realloc unexec_realloc
#undef init_process
#define init_process emacs_init_process
! #else /* not MAC_OSX */
! #undef SIGHUP
! #define OLDP2C 1
! #include <Carbon.h>
! #endif /* not MAC_OSX */
! #else /* not HAVE_CARBON */
#include <Files.h>
#include <MacTypes.h>
#include <TextUtils.h>
***************
*** 69,75 ****
#include <OSA.h>
#include <AppleScript.h>
#include <Scrap.h>
! #endif /* not MAC_OSX */
#include "lisp.h"
#include "process.h"
--- 62,85 ----
#include <OSA.h>
#include <AppleScript.h>
#include <Scrap.h>
! #include <Events.h>
! #include <Processes.h>
! #include <EPPC.h>
! #endif /* not HAVE_CARBON */
!
! #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
#include "lisp.h"
#include "process.h"
***************
*** 812,819 ****
}
- #include <Events.h>
-
long target_ticks = 0;
#ifdef __MRC__
--- 822,827 ----
***************
*** 856,862 ****
struct timeval *timeout;
{
#if TARGET_API_MAC_CARBON
! return 1;
#else /* not TARGET_API_MAC_CARBON */
EventRecord e;
UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +
--- 864,887 ----
struct timeval *timeout;
{
#if TARGET_API_MAC_CARBON
! OSErr err;
! EventTimeout timeout_sec =
! (timeout
! ? (EMACS_SECS (*timeout) * kEventDurationSecond
! + EMACS_USECS (*timeout) * kEventDurationMicrosecond)
! : kEventDurationForever);
!
! if (FD_ISSET (0, rfds))
! {
! BLOCK_INPUT;
! err = ReceiveNextEvent (0, NULL, timeout_sec, kEventLeaveInQueue, NULL);
! UNBLOCK_INPUT;
! if (err == noErr)
! return 1;
! else
! FD_ZERO (rfds);
! }
! return 0;
#else /* not TARGET_API_MAC_CARBON */
EventRecord e;
UInt32 sleep_time = EMACS_SECS (*timeout) * 60 +
***************
*** 1421,1426 ****
--- 1446,1484 ----
return 1; /* success */
}
+
+ OSErr
+ posix_pathname_to_fsspec (ufn, fs)
+ const char *ufn;
+ FSSpec *fs;
+ {
+ Str255 mac_pathname;
+
+ if (posix_to_mac_pathname (ufn, mac_pathname, sizeof (mac_pathname)) == 0)
+ return fnfErr;
+ else
+ {
+ c2pstr (mac_pathname);
+ return FSMakeFSSpec (0, 0, mac_pathname, fs);
+ }
+ }
+
+ OSErr
+ fsspec_to_posix_pathname (fs, ufn, ufnbuflen)
+ const FSSpec *fs;
+ char *ufn;
+ int ufnbuflen;
+ {
+ char mac_pathname[MAXPATHLEN];
+
+ if (path_from_vol_dir_name (mac_pathname, sizeof (mac_pathname) - 1,
+ fs->vRefNum, fs->parID, fs->name)
+ && mac_to_posix_pathname (mac_pathname, ufn, ufnbuflen))
+ return noErr;
+ else
+ return fnfErr;
+ }
+
#ifndef MAC_OSX
int
***************
*** 1899,1907 ****
}
- #include <Processes.h>
- #include <EPPC.h>
-
/* Event class of HLE sent to subprocess. */
const OSType kEmacsSubprocessSend = 'ESND';
--- 1957,1962 ----
***************
*** 2770,2776 ****
return Qnil;
}
- extern void mac_clear_font_name_table P_ ((void));
DEFUN ("mac-clear-font-name-table", Fmac_clear_font_name_table,
Smac_clear_font_name_table, 0, 0, 0,
doc: /* Clear the font name table. */)
--- 2825,2830 ----
- [Emacs-diffs] Changes to emacs/src/mac.c,
YAMAMOTO Mitsuharu <=