diff options
Diffstat (limited to 'xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c')
-rw-r--r-- | xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c | 111 |
1 files changed, 6 insertions, 105 deletions
diff --git a/xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c b/xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c index 5dba3c698..685549a46 100644 --- a/xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c +++ b/xserver/hw/xfree86/utils/xorgconfig/xorgconfig.c @@ -1,4 +1,3 @@ - /* * This is a configuration program that will create a base XF86Config * file based on menu choices. Its main feature is that clueless users @@ -91,7 +90,6 @@ * - Add font path "/TrueType/" and "/freefont/". * Chisato Yamauchi(cyamauch@phyas.aichi-edu.ac.jp) */ -/* $XConsortium: xf86config.c /main/21 1996/10/28 05:43:57 kaleb $ */ #ifdef HAVE_CONFIG_H # include "xorg-server.h" @@ -107,13 +105,6 @@ #include <sys/types.h> #include <sys/stat.h> -/* hv: fix a few EMX problems, will disappear with real UnixOS/2 */ -#ifdef __UNIXOS2__ -#define sync() /*nothing*/ -static int getuid() { return 0; } -#endif - - #include <X11/Xlib.h> #include <X11/extensions/XKBstr.h> #include <X11/extensions/XKBrules.h> @@ -172,11 +163,7 @@ static int getuid() { return 0; } #endif #define MODULEPATH TREEROOT "/lib/modules" -#ifndef __UNIXOS2__ #define XSERVERNAME_FOR_PROBE "X" -#else -#define XSERVERNAME_FOR_PROBE PROJECTROOT"/bin/"__XSERVERNAME__ -#endif #ifndef XCONFIGFILE #define XCONFIGFILE "xorg.conf" @@ -385,10 +372,6 @@ getstring(char *s) /* * Mouse configuration. - * - * (hv) OS/2 (__UNIXOS2__) only has an OS supported mouse, so user has no options - * the server will enable a third button automatically if there is one - * We also do the same for QNX4, since we use the OS mouse drivers. */ int M_OSMOUSE, M_WSMOUSE, M_AUTO, @@ -405,7 +388,7 @@ struct { int *ident; char *desc; } mouse_info[] = { -#if defined(__UNIXOS2__) || defined(QNX4) +#if defined(QNX4) #define DEF_PROTO_STRING "OSMOUSE" {"OSMOUSE", &M_OSMOUSE, "OSMOUSE" @@ -505,7 +488,6 @@ struct { # define DEF_MOUSEDEV "/dev/mouse"; #endif -#ifndef __UNIXOS2__ static char *mouseintro_text = "First specify a mouse protocol type. Choose one from the following list:\n" "\n"; @@ -556,12 +538,10 @@ static char *mousemancomment_text = "You have selected a Logitech MouseMan type mouse. You might want to enable\n" "ChordMiddle which could cause the third button to work.\n"; -#endif /* !__UNIXOS2__ */ - static void mouse_configuration(void) { -#if !defined(__UNIXOS2__) && !defined(QNX4) +#if !defined(QNX4) int i, j; char s[80]; char *def_mousedev = DEF_MOUSEDEV; @@ -685,18 +665,14 @@ mouse_configuration(void) { } printf("\n"); -#else /* __UNIXOS2__ */ +#else /* set some reasonable defaults for OS/2 */ config_mousetype = M_OSMOUSE; config_chordmiddle = 0; config_cleardtrrts = 0; config_emulate3buttons = 0; -#if !defined(QNX4) - config_pointerdevice = "OS2MOUSE"; -#else config_pointerdevice = "QNXMOUSE"; #endif -#endif /* __UNIXOS2__ */ } @@ -1366,36 +1342,9 @@ static char *modestring[NU_MODESTRINGS] = { #endif }; -#ifdef __EMX__ -/* yet another instance of this code, sigh! */ -char * -__XOS2RedirRoot(char *path, char sep) -{ - static char pn[300]; - char *root; - int i,l; - if ((isalpha(path[0]) && path[1]==':') || path[0] != '/') - return path; - - root = getenv("X11ROOT"); - if (!root) root = ""; - sprintf(pn,"%s%s",root,path); - if (sep=='\\') { - l = strlen(pn); - for (i=0; i<l; i++) - if (pn[i]=='/') pn[i]='\\'; - } - return pn; -} -#endif - -/* (hv) to avoid the UNIXISM to try to open a dir to check for existance */ static int exists_dir(char *name) { struct stat sbuf; -#ifdef __EMX__ - name = __XOS2RedirRoot(name,'/'); -#endif /* is it there ? */ if (stat(name,&sbuf) == -1) return 0; @@ -1706,22 +1655,10 @@ skipramdacselection: sprintf(d3name, "%s%s", temp_dir, DUMBCONFIG3); printf("Running X -probeonly -pn -xf86config %s.\n", fname); write_XF86Config(fname); -#ifndef __EMX__ sync(); -#endif /* compose a line with the real path */ -#ifndef __EMX__ sprintf(syscmdline, "X -probeonly -pn -xf86config %s 2> %s", fname, d2name); -#else - /* OS/2 does not have symlinks, so "X" does not exist, - * call the real X server - */ - sprintf(syscmdline,"%s/"__XSERVERNAME__" -probeonly -pn -xf86config " - TEMPORARY_XF86CONFIG_FILENAME " 2>" DUMBCONFIG2, - __XOS2RedirRoot("/"__XSERVERNAME__"/bin",'\\'), - card[card_selected].server); -#endif if (system(syscmdline)) { printf("X -probeonly call failed.\n"); @@ -2081,17 +2018,7 @@ static char *XF86Config_fontpathchunk_text = "Section \"InputDevice\"\n" "\n" " Identifier \"Keyboard1\"\n" -#ifdef USE_DEPRECATED_KEYBOARD_DRIVER -" Driver \"Keyboard\"\n" -#else " Driver \"kbd\"\n" -#endif -"\n" -"# For most OSs the protocol can be omitted (it defaults to \"Standard\").\n" -"# When using XQUEUE (only for SVR3 and SVR4, but not Solaris),\n" -"# uncomment the following line.\n" -"\n" -"# Option \"Protocol\" \"Xqueue\"\n" "\n" " Option \"AutoRepeat\" \"500 30\"\n" "\n" @@ -2144,7 +2071,7 @@ static char *pointersection_text1 = "\n" "# Identifier and driver\n" "\n" -#if defined(__UNIXWARE__) || defined(XQUEUE) +#if defined(__UNIXWARE__) "# Identifier \"Mouse1\"\n" "# Driver \"mouse\"\n" #else @@ -2155,15 +2082,6 @@ static char *pointersection_text1 = static char *pointersection_text2 = "\n" -"# When using XQUEUE, comment out the above two lines, and uncomment\n" -"# the following line.\n" -"\n" -#if defined(__UNIXWARE__) || defined(XQUEUE) -" Option \"Protocol\" \"Xqueue\"\n" -#else -"# Option \"Protocol\" \"Xqueue\"\n" -#endif -"\n" "# Mouse-speed setting for PS/2 mouse.\n" "\n" "# Option \"Resolution\" \"256\"\n" @@ -2539,7 +2457,7 @@ write_fontpath_section(FILE *f) len = nextdir - thisdir; nextdir++; } - if (len > sizeof(cur)) + if (len >= sizeof(cur)) continue; strncpy(cur, thisdir, len); cur[len] = '\0'; @@ -2582,10 +2500,8 @@ write_XF86Config(char *filename) f = fopen(filename, "w"); if (f == NULL) { printf("Failed to open filename for writing.\n"); -#ifndef __EMX__ if (getuid() != 0) printf("Maybe you need to be root to write to the specified directory?\n"); -#endif return(1); } @@ -2640,7 +2556,7 @@ write_XF86Config(char *filename) fprintf(f, " Option \"Protocol\" \"%s\"\t# %s\n", mouse_info[config_mousetype].name, mouse_info[config_mousetype].desc); -#if !defined(__UNIXOS2__) && !defined(QNX4) +#if !defined(QNX4) fprintf(f, " Option \"Device\" \"%s\"\n", config_pointerdevice); #endif fprintf(f, "%s", pointersection_text2); @@ -2819,7 +2735,6 @@ ask_XF86Config_location(void) { "I am going to write the " CONFIGNAME " file now. Make sure you don't accidently\n" "overwrite a previously configured one.\n\n"); -#ifndef __EMX__ if (getuid() == 0) { #ifdef PREFER_XF86CONFIG_IN_ETC filename = Strdup("/etc/X11/" XCONFIGFILE); @@ -2853,16 +2768,6 @@ ask_XF86Config_location(void) { if (answerisyes(s)) return filename; #endif -#else /* __EMX__ */ - { - printf("Please answer the following question with either 'y' or 'n'.\n"); - printf("Shall I write it to the default location, drive:/"__XSERVERNAME__"/lib/X11/XConfig? "); - getstring(s); - printf("\n"); - if (answerisyes(s)) { - return __XOS2RedirRoot("/"__XSERVERNAME__"/lib/X11/XConfig",'/'); - } -#endif /* __EMX__ */ } if (filename) @@ -2901,7 +2806,6 @@ __XSERVERNAME__" distribution for your OS.\n" "libraries, configuration files and a server that you want to use.\n" "\n"; -#ifndef __UNIXOS2__ static char *oldxfree86_text = "The directory '/usr/X386/bin' exists. You probably have a very old version of\n" "XFree86 installed, but this program was built to configure "__XSERVERNAME__" "XVERSIONSTRING"\n" @@ -2921,7 +2825,6 @@ static char *pathnote_text = "link is '/usr/bin/X11'.\n" "\n" "Make sure the path is OK before continuing.\n"; -#endif static void path_check(void) { @@ -2938,7 +2841,6 @@ path_check(void) { printf("\n"); } -#ifndef __UNIXOS2__ ok = exists_dir("/usr/X386/bin"); if (!ok) return; @@ -2948,7 +2850,6 @@ path_check(void) { getenv("PATH")); printf("%s", pathnote_text); keypress(); -#endif } |