#include <config.h>
#include <signal.h>
#include <setjmp.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#include "lisp.h"
#include "blockinput.h"
#define read sys_read
#define write sys_write
#include <windows.h>
-extern int errno;
+#ifndef NULL
+#define NULL 0
+#endif
#endif /* not WINDOWSNT */
/* Does anyone other than VMS need this? */
#include <unistd.h>
#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_SETPGID
+#if !defined (USG) || defined (BSD_PGRPS)
+#undef setpgrp
+#define setpgrp setpgid
+#endif
+#endif
+
/* Get SI_SRPC_DOMAIN, if it is available. */
#ifdef HAVE_SYS_SYSTEMINFO_H
#include <sys/systeminfo.h>
#endif
#endif
+#ifndef USE_CRT_DLL
#ifndef errno
extern int errno;
#endif
+#endif
#ifdef VMS
#include <rms.h>
extern int quit_char;
+#include "keyboard.h"
#include "frame.h"
#include "window.h"
#include "termhooks.h"
#endif
#endif
-#ifndef VFORK_RETURN_TYPE
-#define VFORK_RETURN_TYPE int
-#endif
-
/* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits. */
#ifndef LPASS8
#define LPASS8 0
};
#endif
+#ifdef HAVE_SPEED_T
+#include <termios.h>
+extern speed_t ospeed;
+#else
#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T)
extern short ospeed;
#else
extern short ospeed;
#endif
#endif
+#endif
/* The file descriptor for Emacs's input terminal.
Under Unix, this is normally zero except when using X;
void hft_reset ();
#endif
+/* Temporary used by `sigblock' when defined in terms of signprocmask. */
+
+SIGMASKTYPE sigprocmask_set;
+
\f
/* Specify a different file descriptor for further input operations. */
BLOCK_INPUT;
if (fstat (fd, &sbuf) < 0
|| (sbuf.st_mode & S_IFMT) != S_IFDIR
- || (dirp = (DIR *) malloc (sizeof (DIR))) == 0)
+ || (dirp = (DIR *) xmalloc (sizeof (DIR))) == 0)
{
emacs_close (fd);
UNBLOCK_INPUT;
else if (mkdir (unixDirName, 0700) != 0) /* create it if not */
return NULL;
- TempDirName = (char *) malloc (strlen (unixDirName) + 1);
+ TempDirName = (char *) xmalloc (strlen (unixDirName) + 1);
strcpy (TempDirName, unixDirName);
}
{
char *command, *t, tempmacpathname[MAXPATHLEN+1];
- /* The arguments for the command in argv[2] are separated by spaces. Count them and put
- the count in newargc. */
+ /* The arguments for the command in argv[2] are separated by
+ spaces. Count them and put the count in newargc. */
command = (char *) alloca (strlen (argv[2])+2);
strcpy (command, argv[2]);
if (command[strlen (command) - 1] != ' ')
/* After expanding all the arguments, we now know the length of the parameter block to be
sent to the subprocess as a message attached to the HLE. */
- param = (char *) malloc (paramlen + 1);
+ param = (char *) xmalloc (paramlen + 1);
if (!param)
return -1;
iErr = FSMakeFSSpec (0, 0, macappname, &spec);
if (iErr != noErr) {
- free (param);
+ xfree (param);
return -1;
}
lpbr.launchAppParameters = NULL;
iErr = LaunchApplication (&lpbr); /* call the subprocess */
- if (iErr != noErr) {
- free (param);
- return -1;
- }
+ if (iErr != noErr)
+ {
+ xfree (param);
+ return -1;
+ }
sendEvent.what = kHighLevelEvent;
sendEvent.message = kEmacsSubprocessSend; /* Event ID stored in "where" unused */
while (iErr == sessClosedErr && retries-- > 0);
if (iErr != noErr) {
- free (param);
+ xfree (param);
return -1;
}
iErr = AcceptHighLevelEvent (&targ, &refCon, NULL, &len);
if (iErr != noErr) {
DisposeHandle ((Handle) cursorRegionHdl);
- free (param);
+ xfree (param);
return -1;
}
DisposeHandle ((Handle) cursorRegionHdl);
- free (param);
+ xfree (param);
return refCon;
}
CInfoPBRec cipb;
int len;
- dirp = (DIR *) malloc (sizeof (DIR));
+ dirp = (DIR *) xmalloc (sizeof (DIR));
if (!dirp)
return 0;
int
closedir (DIR *dp)
{
- free (dp);
-
+ xfree (dp);
return 0;
}