msdos.h 4.25 KB
Newer Older
Richard M. Stallman's avatar
Richard M. Stallman committed
1
/* MS-DOS specific C utilities, interface.
Paul Eggert's avatar
Paul Eggert committed
2
   Copyright (C) 1993, 2001-2019 Free Software Foundation, Inc.
Richard M. Stallman's avatar
Richard M. Stallman committed
3 4 5

This file is part of GNU Emacs.

6
GNU Emacs is free software: you can redistribute it and/or modify
Richard M. Stallman's avatar
Richard M. Stallman committed
7
it under the terms of the GNU General Public License as published by
8 9
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
Richard M. Stallman's avatar
Richard M. Stallman committed
10 11 12 13 14 15 16

GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
17
along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
Richard M. Stallman's avatar
Richard M. Stallman committed
18

19 20
#ifndef EMACS_MSDOS_H
#define EMACS_MSDOS_H
Morten Welinder's avatar
Morten Welinder committed
21

Richard M. Stallman's avatar
Richard M. Stallman committed
22 23
#include <dpmi.h>

Eli Zaretskii's avatar
Eli Zaretskii committed
24 25
#include "termhooks.h"		/* struct terminal */

26
int dos_ttraw (struct tty_display_info *);
27
int dos_ttcooked (void);
Kim F. Storm's avatar
Kim F. Storm committed
28 29
int dos_get_saved_screen (char **, int *, int *);
int dos_set_keyboard (int, int);
30
void dos_set_window_size (int *, int *);
Kim F. Storm's avatar
Kim F. Storm committed
31

Richard M. Stallman's avatar
Richard M. Stallman committed
32 33
int getdefdir (int, char*);
void unixtodos_filename (char *);
34
void dostounix_filename (char *);
35
char *rootrelativepath (char *);
36 37
void init_environment (int, char **, int);
void internal_terminal_init (void);
38
void initialize_msdos_display (struct terminal *);
Richard M. Stallman's avatar
Richard M. Stallman committed
39 40

extern int have_mouse;
41 42 43
void mouse_init (void);
void mouse_on (void);
void mouse_off (void);
Richard M. Stallman's avatar
Richard M. Stallman committed
44
void mouse_moveto (int, int);
45

Eli Zaretskii's avatar
Eli Zaretskii committed
46 47
void IT_set_frame_parameters (struct frame *, Lisp_Object);

Eli Zaretskii's avatar
Eli Zaretskii committed
48 49
#include <sys/types.h>
#include <sys/stat.h>
Eli Zaretskii's avatar
Eli Zaretskii committed
50 51
#include <pc.h>
#include <signal.h>
Eli Zaretskii's avatar
Eli Zaretskii committed
52

53 54 55
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
int readlink (const char *, char *, size_t);
#endif
Eli Zaretskii's avatar
Eli Zaretskii committed
56 57 58
ssize_t readlinkat (int, const char *, char *, size_t);
int fstatat (int, char const *, struct stat *, int);
int unsetenv (const char *);
Eli Zaretskii's avatar
Eli Zaretskii committed
59 60 61 62 63 64 65 66 67 68
int faccessat (int, const char *, int, int);
void msdos_fatal_signal (int);
void syms_of_msdos (void);
int pthread_sigmask (int, const sigset_t *, sigset_t *);
int dos_keysns (void);
int dos_keyread (void);
int run_msdos_command (char **, const char *, int, int, int, char **);

void syms_of_win16select (void);

Eli Zaretskii's avatar
Eli Zaretskii committed
69 70 71

/* Constants.  */
#define EINPROGRESS 112
Eli Zaretskii's avatar
Eli Zaretskii committed
72
#define ENOTSUP     ENOSYS
Eli Zaretskii's avatar
Eli Zaretskii committed
73 74 75 76 77 78 79
/* Gnulib sets O_CLOEXEC to O_NOINHERIT, which gets in the way when we
   need to redirect standard handles for subprocesses using temporary
   files created by mkostemp, see callproc.c.  */
#ifdef O_CLOEXEC
# undef O_CLOEXEC
#endif
#define O_CLOEXEC 0
80

Morten Welinder's avatar
Morten Welinder committed
81 82 83 84 85 86 87 88

#ifndef HAVE_X_WINDOWS
/* Dummy types.  */
typedef int XFontStruct;
typedef int GC;
typedef int Pixmap;
typedef int Display;
typedef int Window;
89
typedef int XRectangle;
90
#define PIX_TYPE unsigned long
Morten Welinder's avatar
Morten Welinder committed
91 92
#define XDISPLAY

93 94
typedef struct tty_display_info Display_Info;

95
extern struct tty_display_info the_only_display_info;
96
extern struct tty_output the_only_tty_output;
97

Morten Welinder's avatar
Morten Welinder committed
98
#define FRAME_X_DISPLAY(f) ((Display *) 0)
99
#define FRAME_FONT(f) ((f)->output_data.tty->font)
100
#define FRAME_DISPLAY_INFO(f) (&the_only_display_info)
101

102 103 104 105 106
/* Prototypes.  */

/* Forward declarations for prototypes.  */
struct frame;
struct window;
107 108

/* Defined in xfns.c; emulated on msdos.c */
109

Jan D's avatar
Jan D committed
110
extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
111

Morten Welinder's avatar
Morten Welinder committed
112 113 114
#define XFreeGC (void)
#define x_destroy_bitmap(p1,p2)
#define XGetGeometry(p1,p2,p3,p4,p5,p6,p7,p8,p9)
115 116
#define DisplayWidth(p1,p2) (SELECTED_FRAME()->text_cols)
#define DisplayHeight(p1,p2) (SELECTED_FRAME()->text_lines)
Morten Welinder's avatar
Morten Welinder committed
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
#define XMenuSetAEQ (void)
#define XMenuSetFreeze (void)
#define XMenuRecompute (void)
#define XM_FAILURE -1
#define XM_SUCCESS 1
#define XM_NO_SELECT 2
#define XM_IA_SELECT 3
#define ButtonReleaseMask 0

typedef struct x_menu_struct
{
  int count;
  char **text;
  struct x_menu_struct **submenu;
  int *panenumber; /* Also used as enable.  */
  int allocated;
  int panecount;
  int width;
135
  const char **help_text;
Morten Welinder's avatar
Morten Welinder committed
136 137
} XMenu;

138
XMenu *XMenuCreate (Display *, Window, char *);
139 140
int XMenuAddPane (Display *, XMenu *, char const *, int);
int XMenuAddSelection (Display *, XMenu *, int, int, char *, int, char const *);
141 142
void XMenuLocate (Display *, XMenu *, int, int, int, int,
		  int *, int *, int *, int *);
143
int XMenuActivate (Display *, XMenu *, int *, int *, int, int, unsigned,
144
		   char **, void (*callback)(char const *, int, int));
145 146
void XMenuDestroy (Display *, XMenu *);

Morten Welinder's avatar
Morten Welinder committed
147 148
#endif /* not HAVE_X_WINDOWS */

149
#endif /* not EMACS_MSDOS_H */