X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fs%2Fcygwin32.h;h=58190018211a51d2a93529f6640c71c6c78b03f4;hb=8ca450f99e6270c9f6023acb88da0c89c2374d4a;hp=937adab45670a4a4291ba51749c50d4404dfe795;hpb=2fd9701a4f902054649dde9143a3f77809afee8f;p=chise%2Fxemacs-chise.git diff --git a/src/s/cygwin32.h b/src/s/cygwin32.h index 937adab..5819001 100644 --- a/src/s/cygwin32.h +++ b/src/s/cygwin32.h @@ -20,13 +20,14 @@ Boston, MA 02111-1307, USA. */ /* Building under cygwin * - * The approach I have taken with this port is to use primarily the UNIX - * code base adding stuff that is MS-Windows specific. This works quite - * well, and is in keeping with my perception of the cygwin philosophy. - * Note that if you make changes to this file you do NOT want to define - * WINDOWSNT, I repeat - do not define this, it will break everything - * horribly. What does get defined is HAVE_MS_WINDOWS, but this is - * done by configure and only applies to the window system. + * The approach I have taken with this port is to use primarily the + * UNIX code base adding stuff that is MS-Windows specific. This works + * quite well, and is in keeping with my perception of the cygwin + * philosophy. Note that if you make changes to this file you do NOT + * want to define WIN32_NATIVE (formerly "WINDOWSNT"), I repeat - do + * not define this, it will break everything horribly. What does get + * defined is HAVE_MS_WINDOWS, but this is done by configure and only + * applies to the window system. * * When building make sure your HOME path is unix style - i.e. without * a drive letter. @@ -40,6 +41,9 @@ Boston, MA 02111-1307, USA. */ * Andy Piper 8/1/98 * http://www.xemacs.freeserve.co.uk/ */ +/* Identify ourselves */ +#define CYGWIN + /* cheesy way to determine cygwin version */ #ifndef NOT_C_CODE # include @@ -57,94 +61,61 @@ Boston, MA 02111-1307, USA. */ # endif # endif -extern void cygwin32_win32_to_posix_path_list(const char*, char*); -extern int cygwin32_win32_to_posix_path_list_buf_size(const char*); -extern void cygwin32_posix_to_win32_path_list(const char*, char*); -extern int cygwin32_posix_to_win32_path_list_buf_size(const char*); # if CYGWIN_VERSION_DLL_MAJOR < 20 + +void cygwin32_win32_to_posix_path_list (const char*, char*); +int cygwin32_win32_to_posix_path_list_buf_size (const char*); +void cygwin32_posix_to_win32_path_list (const char*, char*); +int cygwin32_posix_to_win32_path_list_buf_size (const char*); + +#define cygwin_win32_to_posix_path_list cygwin32_win32_to_posix_path_list +#define cygwin_win32_to_posix_path_list_buf_size \ + cygwin32_win32_to_posix_path_list_buf_size +#define cygwin_posix_to_win32_path_list cygwin32_posix_to_win32_path_list +#define cygwin_posix_to_win32_path_list_buf_size \ + cygwin32_posix_to_win32_path_list_buf_size + struct timeval; struct timezone; struct itimerval; struct stat; -extern int gettimeofday(struct timeval *tp, struct timezone *tzp); -extern int gethostname (char* name, int namelen); -extern char* mktemp(char *); -extern double logb(double); -extern void sync(); -extern int ioctl(int, int, ...); - /* sys/stat.h */ -extern int lstat(const char *path, struct stat *buf); - /* unistd.h */ -extern int readlink(const char *path, void *buf, unsigned int bufsiz); -extern int symlink(const char *name1, const char *name2); - /* sys/time.h */ -extern int setitimer(int which, const struct itimerval *value, - struct itimerval *ovalue); -extern int utimes(char *file, struct timeval *tvp); - -extern int srandom( unsigned seed); -extern long random(); - -# define SND_ASYNC 1 -# define SND_NODEFAULT 2 -# define SND_MEMORY 4 -# define SND_FILENAME 0x2000L -# define VK_APPS 0x5D -# define SIF_TRACKPOS 0x0010 -# define ICC_BAR_CLASSES 4 -# define FW_BLACK FW_HEAVY -# define FW_ULTRABOLD FW_EXTRABOLD -# define FW_DEMIBOLD FW_SEMIBOLD -# define FW_ULTRALIGHT FW_EXTRALIGHT -# define APPCMD_FILTERINITS 0x20L -# define CBF_FAIL_SELFCONNECTIONS 0x1000 -# define CBF_SKIP_ALLNOTIFICATIONS 0x3C0000 -# define CBF_FAIL_ADVISES 0x4000 -# define CBF_FAIL_POKES 0x10000 -# define CBF_FAIL_REQUESTS 0x20000 -# define SZDDESYS_TOPIC "System" -# define JOHAB_CHARSET 130 -# define MAC_CHARSET 77 -# endif -#endif +int gettimeofday (struct timeval *tp, struct timezone *tzp); +int gethostname (char* name, int namelen); +char* mktemp (char *); +double logb (double); +void sync (void); +int ioctl (int, int, ...); + /* sys/stat.h */ +int lstat (const char *path, struct stat *buf); + /* unistd.h */ +int readlink (const char *path, void *buf, unsigned int bufsiz); +int symlink (const char *name1, const char *name2); + /* sys/time.h */ +int setitimer (int which, const struct itimerval *value, + struct itimerval *ovalue); +int utimes (char *file, struct timeval *tvp); -#ifndef SPI_GETWHEELSCROLLLINES -#define SPI_GETWHEELSCROLLLINES 104 -#endif -#ifndef WHEEL_PAGESCROLL -#define WHEEL_PAGESCROLL (UINT_MAX) -#endif -#ifndef WHEEL_DELTA -#define WHEEL_DELTA 120 -#endif -#ifndef WM_MOUSEWHEEL -#define WM_MOUSEWHEEL 0x20A -#endif -#ifndef TCS_BOTTOM -#define TCS_BOTTOM 0x0002 -#endif -#ifndef TCS_VERTICAL -#define TCS_VERTICAL 0x0080 -#endif -#ifndef PHYSICALWIDTH -#define PHYSICALWIDTH 110 -#endif -#ifndef PHYSICALHEIGHT -#define PHYSICALHEIGHT 111 -#endif -#ifndef PHYSICALOFFSETX -#define PHYSICALOFFSETX 112 -#endif -#ifndef PHYSICALOFFSETY -#define PHYSICALOFFSETY 113 -#endif +int srandom (unsigned seed); +long random (void); + +# else /* not CYGWIN_VERSION_DLL_MAJOR < 20 */ +void cygwin_win32_to_posix_path_list (const char*, char*); +int cygwin_win32_to_posix_path_list_buf_size (const char*); +void cygwin_posix_to_win32_path_list (const char*, char*); +int cygwin_posix_to_win32_path_list_buf_size (const char*); -#define PBS_SMOOTH 0x01 +# endif /* CYGWIN_VERSION_DLL_MAJOR < 20 */ + +# if CYGWIN_VERSION_DLL_MAJOR <= 20 +char *getpass (const char *prompt); +double logb (double); +# endif /* CYGWIN_VERSION_DLL_MAJOR <= 20 */ + +/* Still left out of 1.1! */ +double logb (double); +int killpg (int pgrp, int sig); -#ifdef HAVE_MS_WINDOWS -#define HAVE_NTGUI -#define HAVE_FACES #endif #ifndef ORDINARY_LINK @@ -153,7 +124,7 @@ extern long random(); #define C_SWITCH_SYSTEM -Wno-sign-compare -fno-caller-saves #define LIBS_SYSTEM -lwinmm - +#define WIN32_LEAN_AND_MEAN #define TEXT_START -1 #define TEXT_END -1 @@ -177,23 +148,11 @@ extern long random(); #define HAVE_SOCKETS #endif #define OBJECTS_SYSTEM ntplay.o -#define HAVE_NATIVE_SOUND #undef MAIL_USE_SYSTEM_LOCK -#define MAIL_USE_POP - -/* Define NO_ARG_ARRAY if you cannot take the address of the first of a - * group of arguments and treat it as an array of the arguments. */ - -#define NO_ARG_ARRAY -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) +/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT + since there is no load average available. */ /* Define VIRT_ADDR_VARIES if the virtual addresses of pure and impure space as loaded can vary, and even their @@ -221,6 +180,12 @@ extern long random(); #define NO_MATHERR +/* + * Define HAVE_PTYS if the system supports pty devices. + */ + +#define HAVE_PTYS + /* define MAIL_USE_FLOCK if the mailer uses flock to interlock access to /usr/spool/mail/$USER. The alternative is that a lock file named @@ -254,44 +219,8 @@ extern long random(); #define SYSTEM_PURESIZE_EXTRA 15000 #define CYGWIN_CONV_PATH(src, dst) \ -dst = alloca (cygwin32_win32_to_posix_path_list_buf_size(src)); \ -cygwin32_win32_to_posix_path_list(src, dst) +dst = alloca (cygwin_win32_to_posix_path_list_buf_size(src)); \ +cygwin_win32_to_posix_path_list(src, dst) #define CYGWIN_WIN32_PATH(src, dst) \ -dst = alloca (cygwin32_posix_to_win32_path_list_buf_size(src)); \ -cygwin32_posix_to_win32_path_list(src, dst) - -/* - * stolen from usg. - */ -#define HAVE_PTYS -#define FIRST_PTY_LETTER 'z' - -/* Pseudo-terminal support under SVR4 only loops to deal with errors. */ - -#define PTY_ITERATION for (i = 0, c = 0; i < 1; i++) - -/* This sets the name of the master side of the PTY. */ - -#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx"); - -/* This sets the name of the slave side of the PTY. On SysVr4, - grantpt(3) forks a subprocess, so keep sigchld_handler() from - intercepting that death. If any child but grantpt's should die - within, it should be caught after EMACS_UNBLOCK_SIGNAL. */ - -#define PTY_OPEN \ - fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0) - -#define PTY_TTY_NAME_SPRINTF \ - { \ - extern char* ptsname(int); \ - char *ptyname; \ - \ - if (!(ptyname = ptsname (fd))) \ - { close (fd); return -1; } \ - strncpy (pty_name, ptyname, sizeof (pty_name)); \ - pty_name[sizeof (pty_name) - 1] = 0; \ - } - -/* ============================================================ */ - +dst = alloca (cygwin_posix_to_win32_path_list_buf_size(src)); \ +cygwin_posix_to_win32_path_list(src, dst)