home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 52
/
Amiga_Dream_52.iso
/
OS2
/
gnuinfo.zip
/
patches.emx
< prev
next >
Wrap
Text File
|
1998-01-04
|
46KB
|
1,756 lines
Only in new: FILE_ID.DIZ
Only in new: README.EMX
Only in new: patches.emx
Only in new: config.h.emx
Only in new: Makefile.emx
Only in new/info: Makefile.emx
Only in new/makeinfo: Makefile.emx
Only in new/util: Makefile.emx
Only in new/intl: gnuintl.def
Only in new/intl: Makefile.emx
Only in new/lib: Makefile.emx
Only in new/lib: pc.c
Only in new/lib: pc.h
Only in new/lib: termcap.c
Only in new/lib: termcap.h
Only in new/lib: tparam.c
diff -cbr orig/info/dir.c new/info/dir.c
*** orig/info/dir.c Sun Jul 27 23:09:20 1997
--- new/info/dir.c Mon Jan 5 04:53:53 1998
***************
*** 40,70 ****
--- 40,90 ----
typedef struct
{
+ #ifdef __EMX__
+ char *path;
+ #else
unsigned long device;
unsigned long inode;
+ #endif
} dir_file_list_entry_type;
static int
new_dir_file_p (test)
+ #ifdef __EMX__
+ char *test;
+ #else
struct stat *test;
+ #endif
{
static unsigned dir_file_list_len = 0;
static dir_file_list_entry_type *dir_file_list = NULL;
unsigned i;
+ #ifdef __EMX__
+ char path[1024];
+ _fullpath(path, test, sizeof(path));
+ #endif
for (i = 0; i < dir_file_list_len; i++)
{
dir_file_list_entry_type entry;
entry = dir_file_list[i];
+ #ifdef __EMX__
+ if (stricmp(path, entry.path) == 0)
+ #else
if (entry.device == test->st_dev && entry.inode == test->st_ino)
+ #endif
return 0;
}
dir_file_list_len++;
dir_file_list = xrealloc (dir_file_list,
dir_file_list_len * sizeof (dir_file_list_entry_type));
+ #ifdef __EMX__
+ dir_file_list[dir_file_list_len - 1].path = strdup(path);
+ #else
dir_file_list[dir_file_list_len - 1].device = test->st_dev;
dir_file_list[dir_file_list_len - 1].inode = test->st_ino;
+ #endif
return 1;
}
***************
*** 88,94 ****
--- 108,118 ----
/* Initialize the list we use to avoid reading the same dir file twice
with the dir file just found. */
+ #ifdef __EMX__
+ new_dir_file_p (dir_buffer->fullpath);
+ #else
new_dir_file_p (&dir_buffer->finfo);
+ #endif
path_index = update_tags = 0;
***************
*** 132,138 ****
--- 156,166 ----
statable = (stat (fullpath, &finfo) == 0);
/* Only add this file if we have not seen it before. */
+ #ifdef __EMX__
+ if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (fullpath))
+ #else
if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
+ #endif
{
long filesize;
char *contents = filesys_read_info_file (fullpath, &filesize,
diff -cbr orig/info/dribble.c new/info/dribble.c
*** orig/info/dribble.c Tue Jul 15 20:32:22 1997
--- new/info/dribble.c Sat Nov 15 12:43:34 1997
***************
*** 37,43 ****
/* Perhaps close existing dribble file. */
close_dribble_file ();
! info_dribble_file = fopen (name, "w");
#if defined (HAVE_SETVBUF)
if (info_dribble_file)
--- 37,43 ----
/* Perhaps close existing dribble file. */
close_dribble_file ();
! info_dribble_file = fopen (name, "wb");
#if defined (HAVE_SETVBUF)
if (info_dribble_file)
diff -cbr orig/info/echo-area.c new/info/echo-area.c
*** orig/info/echo-area.c Thu Jul 24 23:13:44 1997
--- new/info/echo-area.c Sat Dec 27 22:15:54 1997
***************
*** 1464,1470 ****
static void
pause_or_input ()
{
! #if defined (FD_SET)
struct timeval timer;
fd_set readfds;
int ready;
--- 1464,1470 ----
static void
pause_or_input ()
{
! #if defined (FD_SET) && !defined(__EMX__)
struct timeval timer;
fd_set readfds;
int ready;
diff -cbr orig/info/filesys.c new/info/filesys.c
*** orig/info/filesys.c Thu Jul 24 23:23:08 1997
--- new/info/filesys.c Sat Nov 15 18:49:12 1997
***************
*** 24,31 ****
--- 24,41 ----
#include "tilde.h"
#include "filesys.h"
+ #ifdef __EMX__
+ #define COLONCHR ';'
+ #define COLONSTR ";"
+ #include <ctype.h>
+ #else
+ #define COLONCHR ':'
+ #define COLONSTR ":"
+ #endif
+
/* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename ();
+ static char *info_check_file ();
static void remember_info_filename (), maybe_initialize_infopath ();
typedef struct
***************
*** 38,51 ****
"",
".info",
"-info",
(char *)NULL
};
static COMPRESSION_ALIST compress_suffixes[] = {
! { ".Z", "uncompress" },
{ ".Y", "unyabba" },
! { ".z", "gunzip" },
! { ".gz", "gunzip" },
{ (char *)NULL, (char *)NULL }
};
--- 48,62 ----
"",
".info",
"-info",
+ ".inf",
(char *)NULL
};
static COMPRESSION_ALIST compress_suffixes[] = {
! { ".Z", "compress -d" },
{ ".Y", "unyabba" },
! { ".z", "gzip -d" },
! { ".gz", "gzip -d" },
{ (char *)NULL, (char *)NULL }
};
***************
*** 86,98 ****
various extensions to it. I guess we have to stat this file
after all. */
if (initial_character == '/')
! temp = info_file_in_path (partial + 1, "/");
else if (initial_character == '~')
{
expansion = tilde_expand_word (partial);
if (*expansion == '/')
{
! temp = info_file_in_path (expansion + 1, "/");
free (expansion);
}
else
--- 97,113 ----
various extensions to it. I guess we have to stat this file
after all. */
if (initial_character == '/')
! temp = info_check_file (partial);
! #ifdef __EMX__
! else if (isalpha(initial_character) && partial[1] == ':')
! temp = info_check_file (partial);
! #endif
else if (initial_character == '~')
{
expansion = tilde_expand_word (partial);
if (*expansion == '/')
{
! temp = info_check_file (expansion);
free (expansion);
}
else
***************
*** 116,122 ****
strcat (local_temp_filename, "/");
strcat (local_temp_filename, partial);
! return (local_temp_filename);
}
else
temp = info_file_in_path (partial, infopath);
--- 131,141 ----
strcat (local_temp_filename, "/");
strcat (local_temp_filename, partial);
!
! temp = info_check_file (local_temp_filename);
! free (local_temp_filename);
!
! return (temp);
}
else
temp = info_file_in_path (partial, infopath);
***************
*** 143,151 ****
info_file_in_path (filename, path)
char *filename, *path;
{
! struct stat finfo;
! char *temp_dirname;
! int statable, dirname_index;
dirname_index = 0;
--- 162,169 ----
info_file_in_path (filename, path)
char *filename, *path;
{
! char *temp_dirname, *final_name;
! int dirname_index;
dirname_index = 0;
***************
*** 170,179 ****
strcat (temp, "/");
strcat (temp, filename);
- pre_suffix_length = strlen (temp);
-
free (temp_dirname);
for (i = 0; info_suffixes[i]; i++)
{
strcpy (temp + pre_suffix_length, info_suffixes[i]);
--- 188,219 ----
strcat (temp, "/");
strcat (temp, filename);
free (temp_dirname);
+ final_name = info_check_file (temp);
+
+ free (temp);
+
+ if (final_name)
+ return (final_name);
+ }
+ return ((char *)NULL);
+ }
+
+ /* check if the file exists, possibly trying the compressed file suffixes */
+ static char *
+ info_check_file (filename)
+ char *filename;
+ {
+ register int i, statable, pre_suffix_length;
+ struct stat finfo;
+ char *temp;
+
+ temp = (char *)xmalloc (30 + strlen (filename));
+ strcpy (temp, filename);
+
+ pre_suffix_length = strlen (temp);
+
for (i = 0; info_suffixes[i]; i++)
{
strcpy (temp + pre_suffix_length, info_suffixes[i]);
***************
*** 223,231 ****
}
}
}
! free (temp);
! }
! return ((char *)NULL);
}
/* Given a string containing units of information separated by colons,
--- 263,269 ----
}
}
}
! return ((char *) NULL);
}
/* Given a string containing units of information separated by colons,
***************
*** 242,248 ****
if ((i >= strlen (string)) || !string)
return ((char *) NULL);
! while (string[i] && string[i] != ':')
i++;
if (i == start)
{
--- 280,286 ----
if ((i >= strlen (string)) || !string)
return ((char *) NULL);
! while (string[i] && string[i] != COLONCHR)
i++;
if (i == start)
{
***************
*** 353,366 ****
strcpy (infopath, path);
else if (where == INFOPATH_APPEND)
{
! strcat (infopath, ":");
strcat (infopath, path);
}
else if (where == INFOPATH_PREPEND)
{
char *temp = xstrdup (infopath);
strcpy (infopath, path);
! strcat (infopath, ":");
strcat (infopath, temp);
free (temp);
}
--- 391,404 ----
strcpy (infopath, path);
else if (where == INFOPATH_APPEND)
{
! strcat (infopath, COLONSTR);
strcat (infopath, path);
}
else if (where == INFOPATH_PREPEND)
{
char *temp = xstrdup (infopath);
strcpy (infopath, path);
! strcat (infopath, COLONSTR);
strcat (infopath, temp);
free (temp);
}
***************
*** 387,393 ****
long *filesize;
struct stat *finfo;
{
! long st_size;
*filesize = filesys_error_number = 0;
--- 425,431 ----
long *filesize;
struct stat *finfo;
{
! long st_size, result;
*filesize = filesys_error_number = 0;
***************
*** 410,416 ****
/* Try to read the contents of this file. */
st_size = (long) finfo->st_size;
contents = (char *)xmalloc (1 + st_size);
! if ((read (descriptor, contents, st_size)) != st_size)
{
filesys_error_number = errno;
close (descriptor);
--- 448,455 ----
/* Try to read the contents of this file. */
st_size = (long) finfo->st_size;
contents = (char *)xmalloc (1 + st_size);
! result = read (descriptor, contents, st_size);
! if (result == -1 || result > st_size)
{
filesys_error_number = errno;
close (descriptor);
diff -cbr orig/info/info.c new/info/info.c
*** orig/info/info.c Wed Jul 30 17:21:44 1997
--- new/info/info.c Sat Nov 22 12:03:14 1997
***************
*** 94,100 ****
};
/* String describing the shorthand versions of the long options found above. */
! static char *short_options = "d:n:f:o:s";
/* When non-zero, the Info window system has been initialized. */
int info_windows_initialized_p = 0;
--- 94,100 ----
};
/* String describing the shorthand versions of the long options found above. */
! static char *short_options = "d:n:f:o:sh?";
/* When non-zero, the Info window system has been initialized. */
int info_windows_initialized_p = 0;
***************
*** 118,123 ****
--- 118,124 ----
NODE *initial_node; /* First node loaded by Info. */
remember_info_program_name (argv[0]);
+ setvbuf(stdout, NULL, _IOFBF, BUFSIZ);
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
***************
*** 168,173 ****
--- 169,179 ----
user_filename = xstrdup (optarg);
break;
+ /* User is requesting help. */
+ case 'h':
+ print_help_p = 1;
+ break;
+
/* User is specifying the name of a file to output to. */
case 'o':
if (user_output_filename)
***************
*** 591,596 ****
--- 597,604 ----
static void
usage ()
{
+ fprintf (stderr,"\nGNU %s %s - info %s\n\n",
+ PACKAGE, VERSION, version_string ());
fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n",
_("Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]..."),
_(" [--directory dir-path] [--file info-file] [--node node-name]..."),
diff -cbr orig/info/info.h new/info/info.h
*** orig/info/info.h Tue Jul 15 20:34:24 1997
--- new/info/info.h Sat Nov 15 13:02:02 1997
***************
*** 54,60 ****
#endif /* !whitespace */
#if !defined (whitespace_or_newline)
! # define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
#endif /* !whitespace_or_newline */
/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
--- 54,60 ----
#endif /* !whitespace */
#if !defined (whitespace_or_newline)
! # define whitespace_or_newline(c) (whitespace (c) || (c == '\n') || (c == '\r'))
#endif /* !whitespace_or_newline */
/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
diff -cbr orig/info/man.c new/info/man.c
*** orig/info/man.c Fri Aug 1 01:49:58 1997
--- new/info/man.c Sat Dec 27 22:16:20 1997
***************
*** 28,33 ****
--- 28,37 ----
#if defined (HAVE_SYS_WAIT_H)
#include <sys/wait.h>
#endif
+ #ifdef __EMX__
+ #include <process.h>
+ #include <sys/wait.h>
+ #endif
#include "tilde.h"
#include "man.h"
***************
*** 153,159 ****
--- 157,173 ----
free (temp_dirname);
+ #ifdef __EMX__
+ strcat (temp, ".cmd");
+ statable = (stat (temp, &finfo) == 0);
+ if (!statable)
+ {
+ strcpy(temp + strlen (temp) - 4, ".exe");
statable = (stat (temp, &finfo) == 0);
+ }
+ #else
+ statable = (stat (temp, &finfo) == 0);
+ #endif
/* If we have found a regular executable file, then use it. */
if ((statable) && (S_ISREG (finfo.st_mode)) &&
***************
*** 247,252 ****
--- 261,298 ----
writer end is pipes[1]. */
pipe (pipes);
+ #ifdef __EMX__
+ {
+ int pid, old_stdout, old_stderr;
+
+ old_stdout = dup (fileno (stdout));
+ fcntl (old_stdout, F_SETFD, FD_CLOEXEC);
+ dup2 (pipes[1], fileno (stdout));
+
+ old_stderr = dup (fileno (stderr));
+ fcntl (old_stderr, F_SETFD, FD_CLOEXEC);
+ close (fileno (stderr));
+
+ close (pipes[1]);
+ fcntl (pipes[0], F_SETFD, FD_CLOEXEC);
+
+ pid = spawnv (P_NOWAIT, formatter_args[0], formatter_args);
+
+ close (fileno (stdout));
+ dup2 (old_stdout, fileno (stdout));
+ close (old_stdout);
+
+ dup2 (old_stderr, fileno (stderr));
+ close (old_stderr);
+
+ if (pid != -1)
+ formatted_page = read_from_fd (pipes[0]);
+
+ close (pipes[0]);
+
+ waitpid (pid, NULL, WNOHANG);
+ }
+ #else
signal (SIGCHLD, reap_children);
child = fork ();
***************
*** 278,283 ****
--- 324,330 ----
close (pipes[1]);
exit (0);
}
+ #endif
/* If we have the page, then clean it up. */
if (formatted_page)
***************
*** 363,369 ****
int bsize = 0;
int bindex = 0;
int select_result;
! #if defined (FD_SET)
fd_set read_fds;
timeout.tv_sec = 15;
--- 410,416 ----
int bsize = 0;
int bindex = 0;
int select_result;
! #if defined (FD_SET) && !defined(__EMX__)
fd_set read_fds;
timeout.tv_sec = 15;
diff -cbr orig/info/session.c new/info/session.c
*** orig/info/session.c Thu Jul 24 23:34:00 1997
--- new/info/session.c Sat Dec 27 22:14:08 1997
***************
*** 22,27 ****
--- 22,31 ----
#include "info.h"
#include <sys/ioctl.h>
+ #ifdef __EMX__
+ # include <pc.h>
+ #endif
+
#if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
# define HAVE_STRUCT_TIMEVAL
***************
*** 305,311 ****
{
FILE *stream;
! stream = fopen (filename, "r");
if (!stream)
return;
--- 309,315 ----
{
FILE *stream;
! stream = fopen (filename, "rb");
if (!stream)
return;
***************
*** 2476,2482 ****
if (strcmp (output_filename, "-") == 0)
output_stream = stdout;
else
! output_stream = fopen (output_filename, "w");
if (!output_stream)
{
--- 2480,2486 ----
if (strcmp (output_filename, "-") == 0)
output_stream = stdout;
else
! output_stream = fopen (output_filename, "wb");
if (!output_stream)
{
***************
*** 2601,2607 ****
if (strcmp (filename, "-") == 0)
output_stream = stdout;
else
! output_stream = fopen (filename, "w");
if (!output_stream)
{
--- 2605,2611 ----
if (strcmp (filename, "-") == 0)
output_stream = stdout;
else
! output_stream = fopen (filename, "wb");
if (!output_stream)
{
***************
*** 3823,3829 ****
if (!info_any_buffered_input_p () &&
!info_input_pending_p ())
{
! #if defined (FD_SET)
struct timeval timer;
fd_set readfds;
--- 3827,3833 ----
if (!info_any_buffered_input_p () &&
!info_input_pending_p ())
{
! #if defined (FD_SET) && !defined(__EMX__)
struct timeval timer;
fd_set readfds;
***************
*** 4147,4152 ****
--- 4151,4160 ----
space_avail = info_input_buffer_space_available ();
+ #ifdef __EMX__
+ while (chars_avail < space_avail && (tty = pc_getc(0)) != -1)
+ input[chars_avail++] = tty;
+ #else
/* If we can just find out how many characters there are to read, do so. */
#if defined (FIONREAD)
{
***************
*** 4174,4179 ****
--- 4182,4188 ----
}
# endif /* O_NDELAY */
#endif /* !FIONREAD */
+ #endif
while (i < chars_avail)
{
***************
*** 4201,4206 ****
--- 4210,4218 ----
unsigned char c;
int tty = fileno (info_input_stream);
+ #ifdef __EMX__
+ keystroke = pc_getc(1);
+ #else
/* Using stream I/O causes FIONREAD etc to fail to work
so unless someone can find a portable way of finding
out how many characters are currently buffered, we
***************
*** 4230,4235 ****
--- 4242,4248 ----
exit (0);
}
}
+ #endif
}
if (info_dribble_file)
diff -cbr orig/info/terminal.c new/info/terminal.c
*** orig/info/terminal.c Tue Jul 29 23:42:04 1997
--- new/info/terminal.c Mon Dec 29 08:30:34 1997
***************
*** 118,124 ****
--- 118,128 ----
output_character_function (c)
int c;
{
+ #ifdef __RSXNT__
+ pc_putc (c);
+ #else
putc (c, stdout);
+ #endif
return c;
}
***************
*** 133,139 ****
--- 137,145 ----
static void
terminal_begin_using_terminal ()
{
+ #ifdef SIGWINCH
RETSIGTYPE (*sigsave) ();
+ #endif
if (term_keypad_on)
send_to_terminal (term_keypad_on);
***************
*** 141,155 ****
--- 147,167 ----
if (!term_begin_use || !*term_begin_use)
return;
+ #ifdef SIGWINCH
sigsave = signal (SIGWINCH, SIG_IGN);
+ #endif
send_to_terminal (term_begin_use);
/* Without this fflush and sleep, running info in a shelltool or
cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
not restored properly.
From: strube@physik3.gwdg.de (Hans Werner Strube). */
fflush (stdout);
+ #ifndef __EMX__
sleep (1);
+ #endif
+ #ifdef SIGWINCH
signal (SIGWINCH, sigsave);
+ #endif
}
/* Tell the terminal that we will not be doing any more cursor
***************
*** 157,163 ****
--- 169,177 ----
static void
terminal_end_using_terminal ()
{
+ #ifdef SIGWINCH
RETSIGTYPE (*sigsave) ();
+ #endif
if (term_keypad_off)
send_to_terminal (term_keypad_off);
***************
*** 165,175 ****
--- 179,200 ----
if (!term_end_use || !*term_end_use)
return;
+ #ifdef SIGWINCH
sigsave = signal (SIGWINCH, SIG_IGN);
+ #endif
+ #ifdef __EMX__
+ terminal_goto_xy (0, screenheight - 2); /* cmd.exe writes extra newline */
+ #else
+ terminal_goto_xy (0, screenheight - 1);
+ #endif
send_to_terminal (term_end_use);
fflush (stdout);
+ #ifndef __EMX__
sleep (1);
+ #endif
+ #ifdef SIGWINCH
signal (SIGWINCH, sigsave);
+ #endif
}
/* **************************************************************** */
***************
*** 449,454 ****
--- 474,487 ----
{
screenwidth = screenheight = 0;
+ #ifdef __EMX__
+ {
+ int size[2];
+ _scrsize(size);
+ screenwidth = size[0];
+ screenheight = size[1];
+ }
+ #else
#if defined (TIOCGWINSZ)
{
struct winsize window_size;
***************
*** 460,465 ****
--- 493,499 ----
}
}
#endif /* TIOCGWINSZ */
+ #endif
/* Environment variable COLUMNS overrides setting of "co". */
if (screenwidth <= 0)
***************
*** 669,674 ****
--- 703,712 ----
tty = fileno (stdin);
+ #ifdef __EMX__
+ pc_init ();
+ #else
+
#if defined (HAVE_TERMIOS_H)
tcgetattr (tty, &original_termios);
tcgetattr (tty, &ttybuff);
***************
*** 779,784 ****
--- 817,823 ----
ttybuff.sg_flags |= CBREAK;
ioctl (tty, TIOCSETN, &ttybuff);
#endif /* !HAVE_TERMIOS_H && !HAVE_TERMIO_H */
+ #endif /* !__EMX__ */
}
/* Restore the tty settings back to what they were before we started using
***************
*** 796,801 ****
--- 835,844 ----
tty = fileno (stdin);
+ #ifdef __EMX__
+ pc_exit ();
+ #else
+
#if defined (HAVE_TERMIOS_H)
tcsetattr (tty, TCSANOW, &original_termios);
#else
***************
*** 820,825 ****
--- 863,869 ----
# endif /* !HAVE_TERMIO_H */
#endif /* !HAVE_TERMIOS_H */
+ #endif /* !__EMX__ */
terminal_end_using_terminal ();
}
diff -cbr orig/intl/bindtextdom.c new/intl/bindtextdom.c
*** orig/intl/bindtextdom.c Sat Jun 14 23:12:00 1997
--- new/intl/bindtextdom.c Sat Nov 15 12:41:50 1997
***************
*** 49,55 ****
/* @@ end of prolog @@ */
/* Contains the default location of the message catalogs. */
! extern const char _nl_default_dirname[];
/* List with bindings of specific domains. */
extern struct binding *_nl_domain_bindings;
--- 49,55 ----
/* @@ end of prolog @@ */
/* Contains the default location of the message catalogs. */
! extern const char *_nl_default_dirname;
/* List with bindings of specific domains. */
extern struct binding *_nl_domain_bindings;
***************
*** 73,78 ****
--- 73,81 ----
const char *dirname;
{
struct binding *binding;
+
+ if (_nl_default_dirname == NULL)
+ _nl_default_dirname = GNULOCALEDIR;
/* Some sanity checks. */
if (domainname == NULL || domainname[0] == '\0')
diff -cbr orig/intl/dcgettext.c new/intl/dcgettext.c
*** orig/intl/dcgettext.c Sat Jun 14 23:12:00 1997
--- new/intl/dcgettext.c Sat Nov 15 12:57:04 1997
***************
*** 151,157 ****
const char *_nl_current_default_domain = _nl_default_default_domain;
/* Contains the default location of the message catalogs. */
! const char _nl_default_dirname[] = GNULOCALEDIR;
/* List with bindings of specific domains created by bindtextdomain()
calls. */
--- 151,157 ----
const char *_nl_current_default_domain = _nl_default_default_domain;
/* Contains the default location of the message catalogs. */
! const char *_nl_default_dirname = NULL;
/* List with bindings of specific domains created by bindtextdomain()
calls. */
***************
*** 235,240 ****
--- 235,243 ----
if (msgid == NULL)
return NULL;
+ if (_nl_default_dirname == NULL)
+ _nl_default_dirname = GNULOCALEDIR;
+
/* If DOMAINNAME is NULL, we are interested in the default domain. If
CATEGORY is not LC_MESSAGES this might not make much sense but the
defintion left this undefined. */
***************
*** 258,264 ****
--- 261,274 ----
if (binding == NULL)
dirname = (char *) _nl_default_dirname;
+ #ifdef __EMX__
+ #define getcwd _getcwd2
+ /* we have to deal with drive letters here and with getcwd below */
+ else if (binding->dirname[0] == '/' ||
+ isalpha(binding->dirname[0]) && binding->dirname[1] == ':')
+ #else
else if (binding->dirname[0] == '/')
+ #endif
dirname = binding->dirname;
else
{
diff -cbr orig/intl/gettext.h new/intl/gettext.h
*** orig/intl/gettext.h Sat Jun 14 23:12:00 1997
--- new/intl/gettext.h Sat Nov 15 12:57:04 1997
***************
*** 25,30 ****
--- 25,36 ----
# include <limits.h>
#endif
+ #ifdef __EMX__
+ #define PATH_SEPARATOR ';'
+ #else
+ #define PATH_SEPARATOR ':'
+ #endif
+
/* @@ end of prolog @@ */
/* The magic number of the GNU message catalog format. */
diff -cbr orig/intl/libgettext.h new/intl/libgettext.h
*** orig/intl/libgettext.h Sat Jun 14 23:12:00 1997
--- new/intl/libgettext.h Fri Dec 26 19:28:24 1997
***************
*** 36,41 ****
--- 36,49 ----
# include <locale.h>
#endif
+ #ifdef __EMX__
+ #define CheckEnv(e, d) ({char *v = getenv(e); v ? v : (d);})
+ #define StrCat(s1, s2) ({int l = strlen(s1) + strlen(s2); \
+ char *r = malloc(l); strcpy(r, s1); strcat(r, s2); r;})
+ #define GNULOCALEDIR CheckEnv("GNULOCALEDIR","/lib/glocale")
+ #define LOCALE_ALIAS_PATH StrCat(GNULOCALEDIR, ";.")
+ #define LOCALEDIR CheckEnv("LOCALEDIR","/lib/locale")
+ #endif
#ifdef __cplusplus
extern "C" {
diff -cbr orig/intl/loadmsgcat.c new/intl/loadmsgcat.c
*** orig/intl/loadmsgcat.c Sat Jun 14 23:12:02 1997
--- new/intl/loadmsgcat.c Sat Nov 15 18:58:00 1997
***************
*** 38,43 ****
--- 38,47 ----
#include "gettext.h"
#include "gettextP.h"
+ #ifndef O_BINARY
+ #define O_BINARY 0
+ #endif
+
/* @@ end of prolog @@ */
#ifdef _LIBC
***************
*** 58,63 ****
--- 62,92 ----
int _nl_msg_cat_cntr;
+ #ifdef __EMX__
+
+ #include <string.h>
+
+ /* quick hack to at least translate german umlauts from Latin-1 to
+ Codepage 850/437 - needs to be extended to other NLS characters */
+
+ static char *cp850 = "\x84\x94\x81\x8E\x99\x9A\xE1\xAE\xAF";
+ static char *latin1 = "\xE4\xF6\xFC\xC4\xD6\xDC\xDF\xAB\xBB";
+
+ static void recode_msg (char *msg)
+ {
+ char *ptr = msg;
+ int len = strlen (msg), pos;
+
+ while ((pos = strcspn(ptr, latin1)) < len)
+ {
+ ptr[pos] = cp850[strchr(latin1, ptr[pos]) - latin1];
+ ptr += pos + 1;
+ len -= pos + 1;
+ }
+ }
+
+ #endif
+
/* Load the message catalogs specified by FILENAME. If it is no valid
message catalog do nothing. */
void
***************
*** 84,90 ****
return;
/* Try to open the addressed file. */
! fd = open (domain_file->filename, O_RDONLY);
if (fd == -1)
return;
--- 113,119 ----
return;
/* Try to open the addressed file. */
! fd = open (domain_file->filename, O_RDONLY | O_BINARY);
if (fd == -1)
return;
***************
*** 192,197 ****
--- 221,235 ----
domain_file->data = NULL;
return;
}
+
+ #ifdef __EMX__
+ {
+ int i;
+ for (i = 0; i < domain->nstrings; i++)
+ recode_msg ((char *) domain->data + W (domain->must_swap,
+ domain->trans_tab[i].offset));
+ }
+ #endif
/* Show that one domain is changed. This might make some cached
translations invalid. */
diff -cbr orig/intl/localealias.c new/intl/localealias.c
*** orig/intl/localealias.c Sat Jun 14 23:12:02 1997
--- new/intl/localealias.c Sat Nov 15 12:41:54 1997
***************
*** 67,72 ****
--- 67,77 ----
# endif
#endif
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+ # include "libgettext.h"
+ #endif
#include "gettext.h"
#include "gettextP.h"
***************
*** 139,148 ****
_nl_expand_alias (name)
const char *name;
{
! static const char *locale_alias_path = LOCALE_ALIAS_PATH;
struct alias_map *retval;
size_t added;
do
{
struct alias_map item;
--- 144,156 ----
_nl_expand_alias (name)
const char *name;
{
! static const char *locale_alias_path = NULL;
struct alias_map *retval;
size_t added;
+ if (locale_alias_path == NULL)
+ locale_alias_path = LOCALE_ALIAS_PATH;
+
do
{
struct alias_map item;
***************
*** 168,178 ****
{
const char *start;
! while (locale_alias_path[0] == ':')
++locale_alias_path;
start = locale_alias_path;
! while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
++locale_alias_path;
if (start < locale_alias_path)
--- 176,186 ----
{
const char *start;
! while (locale_alias_path[0] == PATH_SEPARATOR)
++locale_alias_path;
start = locale_alias_path;
! while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR)
++locale_alias_path;
if (start < locale_alias_path)
diff -cbr orig/lib/system.h new/lib/system.h
*** orig/lib/system.h Thu Jul 31 22:34:36 1997
--- new/lib/system.h Sat Nov 15 17:29:28 1997
***************
*** 37,43 ****
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
! #include <libintl.h>
/* Don't use bcopy! Use memmove if source and destination may overlap,
memcpy otherwise. */
--- 37,43 ----
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
! #include <libgettext.h>
/* Don't use bcopy! Use memmove if source and destination may overlap,
memcpy otherwise. */
diff -cbr orig/lib/xmalloc.c new/lib/xmalloc.c
*** orig/lib/xmalloc.c Mon Jun 19 22:06:30 1995
--- new/lib/xmalloc.c Sat Dec 27 00:41:40 1997
***************
*** 25,30 ****
--- 25,34 ----
Written by Brian Fox (bfox@ai.mit.edu). */
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+
#if !defined (ALREADY_HAVE_XMALLOC)
#include <stdio.h>
#include <sys/types.h>
diff -cbr orig/makeinfo/makeinfo.c new/makeinfo/makeinfo.c
*** orig/makeinfo/makeinfo.c Thu Jul 31 23:36:28 1997
--- new/makeinfo/makeinfo.c Sat Nov 15 12:55:16 1997
***************
*** 49,54 ****
--- 49,60 ----
# endif
#endif
+ #ifdef __EMX__
+ #include <stdlib.h>
+ #include <assert.h>
+ #include <io.h>
+ #endif
+
/* We'd like to take advantage of _doprnt if it's around, a la error.c,
but then we'd have no VA_SPRINTF. */
#if HAVE_VPRINTF
***************
*** 226,231 ****
--- 232,240 ----
specified marker. */
int number_footnotes = 1;
+ /* Non-zero indicates that a FAT compatible output name should be created. */
+ int fat_name = 0;
+
/* The current footnote number in this node. Each time a new node is
started this is reset to 1. */
int current_footnote_number = 1;
***************
*** 792,797 ****
--- 801,807 ----
{ "paragraph-indent", 1, 0, 'p' }, /* formerly -pi */
{ "reference-limit", 1, 0, 'r' }, /* formerly -rl */
{ "verbose", 0, &verbose_mode, 1 }, /* formerly -verbose */
+ { "fat-name", 0, &fat_name, 1 },
{ "help", 0, 0, 'h' },
{ "version", 0, 0, 'V' },
{NULL, 0, NULL, 0}
***************
*** 948,953 ****
--- 958,970 ----
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
+ #ifdef __EMX__
+ _response (&argc, &argv);
+ _wildcard (&argc, &argv);
+ if (argc == 1 && isatty (0))
+ usage (NO_ERROR);
+ #endif
+
/* Parse argument flags from the input line. */
while ((c = getopt_long (argc, argv, "D:e:E:f:I:o:p:P:r:s:U:V",
long_options, &ind)) != EOF)
***************
*** 970,976 ****
fprintf (stderr,
_("%s: %s arg must be numeric, not `%s'.\n"),
"--error-limit", progname, optarg);
! usage (stderr, FATAL);
}
break;
--- 987,993 ----
fprintf (stderr,
_("%s: %s arg must be numeric, not `%s'.\n"),
"--error-limit", progname, optarg);
! usage (FATAL);
}
break;
***************
*** 1157,1162 ****
--- 1174,1182 ----
if (exit_value != 0)
fprintf (stderr, _("Try `%s --help' for more information.\n"), progname);
else
+ {
+ printf ("\nGNU %s %s - makeinfo %d.%d\n\n",
+ PACKAGE, VERSION, major_version, minor_version);
printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n\
\n\
Translate Texinfo source documentation to a format suitable for reading\n\
***************
*** 1192,1197 ****
--- 1212,1218 ----
"),
progname, paragraph_start_indent,
fill_column, max_error_level, reference_warning_limit);
+ }
exit (exit_value);
}
***************
*** 1231,1237 ****
{
struct stat fileinfo;
long file_size;
! int file = -1, count = 0;
char *fullpath, *result, *get_file_info_in_path ();
result = fullpath = (char *)NULL;
--- 1252,1258 ----
{
struct stat fileinfo;
long file_size;
! int file = -1, count = 0, bytes_read;
char *fullpath, *result, *get_file_info_in_path ();
result = fullpath = (char *)NULL;
***************
*** 1244,1250 ****
filename = fullpath;
file_size = (long) fileinfo.st_size;
! file = open (filename, O_RDONLY);
if (file < 0)
goto error_exit;
--- 1265,1271 ----
filename = fullpath;
file_size = (long) fileinfo.st_size;
! file = open (filename, O_RDONLY|O_TEXT);
if (file < 0)
goto error_exit;
***************
*** 1264,1271 ****
count += n;
if (n == -1)
#else /* !VMS && !WIN32 */
! count = file_size;
! if (read (file, result, file_size) != file_size)
#endif /* !VMS && !WIN32 */
error_exit:
{
--- 1285,1296 ----
count += n;
if (n == -1)
#else /* !VMS && !WIN32 */
! count = read (file, result, file_size);
! #ifdef __EMX__
! if (count <= 0 || count > file_size)
! #else
! if (count != file_size)
! #endif
#endif /* !VMS && !WIN32 */
error_exit:
{
***************
*** 1575,1580 ****
--- 1600,1608 ----
}
else
{
+ #ifdef __EMX__
+ return (strdup (filename));
+ #else
struct passwd *user_entry;
int i, c;
char *username = (char *)xmalloc (257);
***************
*** 1598,1603 ****
--- 1626,1632 ----
+ strlen (&filename[i]));
strcpy (result, user_entry->pw_dir);
strcat (result, &filename[i]);
+ #endif
}
}
#endif /* not WIN32 */
***************
*** 1922,1927 ****
--- 1951,1958 ----
".texinfo",
".texi",
".txinfo",
+ ".txi",
+ ".tex",
"",
(char *)NULL
};
***************
*** 2134,2140 ****
else
real_output_filename = xstrdup (real_output_filename);
! output_stream = fopen (real_output_filename, "w");
}
if (output_stream != stdout)
--- 2165,2171 ----
else
real_output_filename = xstrdup (real_output_filename);
! output_stream = fopen (real_output_filename, "wb");
}
if (output_stream != stdout)
***************
*** 2279,2284 ****
--- 2310,2316 ----
void
reader_loop ()
{
+ extern int executing_string;
int character;
int done = 0;
int dash_count = 0;
***************
*** 3095,3100 ****
--- 3127,3133 ----
{
last_inserted_character = '\n';
last_char_was_newline = 1;
+ last_inserted_character = 0;
}
/* Align the end of the text in output_paragraph with fill_column. */
***************
*** 5388,5397 ****
(10 + strlen (root_pathname) + strlen (root_filename));
sprintf
(split_filename,
"%s%s-%d", root_pathname, root_filename, which_file);
! fd = open
! (split_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
if ((fd < 0) ||
(write (fd, the_header, header_size) != header_size) ||
--- 5421,5435 ----
(10 + strlen (root_pathname) + strlen (root_filename));
sprintf
(split_filename,
+ #ifdef __EMX__
+ fat_name ? "%s%s.i%.2d" : "%s%s-%d",
+ root_pathname, root_filename, which_file);
+ #else
"%s%s-%d", root_pathname, root_filename, which_file);
+ #endif
! fd = open (split_filename,
! O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666);
if ((fd < 0) ||
(write (fd, the_header, header_size) != header_size) ||
***************
*** 5412,5418 ****
--- 5450,5461 ----
indirect_info += strlen (indirect_info);
}
+ #ifdef __EMX__
+ sprintf (indirect_info,
+ fat_name ? "%s.i%.2d: %ld\n" : "%s-%d: %ld\n",
+ #else
sprintf (indirect_info, "%s-%d: %d\n",
+ #endif
root_filename, which_file, file_top);
free (split_filename);
***************
*** 5427,5433 ****
/* We have sucessfully created the subfiles. Now write out the
original again. We must use `output_stream', or
write_tag_table_indirect () won't know where to place the output. */
! output_stream = fopen (filename, "w");
if (!output_stream)
{
perror (filename);
--- 5470,5476 ----
/* We have sucessfully created the subfiles. Now write out the
original again. We must use `output_stream', or
write_tag_table_indirect () won't know where to place the output. */
! output_stream = fopen (filename, "wb");
if (!output_stream)
{
perror (filename);
diff -cbr orig/util/deref.c new/util/deref.c
*** orig/util/deref.c Thu Nov 19 03:15:06 1992
--- new/util/deref.c Sat Dec 27 00:39:08 1997
***************
*** 48,53 ****
--- 48,55 ----
* Use of fgets for input (to be fixed).
*/
+ #include <config.h>
+
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
diff -cbr orig/util/install-info.c new/util/install-info.c
*** orig/util/install-info.c Fri Jul 25 20:09:04 1997
--- new/util/install-info.c Sat Nov 15 12:47:58 1997
***************
*** 283,288 ****
--- 283,289 ----
void
print_help ()
{
+ printf ("\nGNU %s %s - install-info\n\nUsage: ", PACKAGE, VERSION);
printf (_("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
***************
*** 423,428 ****
--- 424,435 ----
int i;
progname = argv[0];
+
+ if (argc == 1)
+ {
+ print_help ();
+ exit (0);
+ }
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
diff -cbr orig/util/texindex.c new/util/texindex.c
*** orig/util/texindex.c Fri Jul 25 01:34:46 1997
--- new/util/texindex.c Fri Dec 26 19:51:30 1997
***************
*** 34,39 ****
--- 34,46 ----
#define memset(ptr, ignore, count) bzero (ptr, count)
#endif
+ /* OS/2 port (c) 1991 Kai Uwe Rommel,
+ rommel@leo.org
+
+ This port is also distributed under the terms of the
+ GNU General Public License as published by the
+ Free Software Foundation. */
+
char *mktemp ();
***************
*** 59,64 ****
--- 66,80 ----
# define TI_FATAL_ERROR 1
#endif /* !VMS */
+ #ifdef __EMX__
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <assert.h>
+ #include <io.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #endif
+
#if !defined (SEEK_SET)
# define SEEK_SET 0
# define SEEK_CUR 1
***************
*** 174,179 ****
--- 190,200 ----
{
int i;
+ #ifdef __EMX__
+ _response(&argc, &argv);
+ _wildcard(&argc, &argv);
+ #endif
+
tempcount = 0;
last_deleted_tempcount = 0;
***************
*** 213,219 ****
--- 234,244 ----
decode_command (argc, argv);
+ #ifdef __EMX__
+ tempbase = mktemp (concat ("tiXXXXXX", "", ""));
+ #else
tempbase = mktemp (concat ("txiXXXXXX", "", ""));
+ #endif
/* Process input files completely, one by one. */
***************
*** 223,229 ****
long ptr;
char *outfile;
! desc = open (infiles[i], O_RDONLY, 0);
if (desc < 0)
pfatal_with_name (infiles[i]);
lseek (desc, (off_t) 0, SEEK_END);
--- 248,254 ----
long ptr;
char *outfile;
! desc = open (infiles[i], O_RDONLY|O_TEXT, 0);
if (desc < 0)
pfatal_with_name (infiles[i]);
lseek (desc, (off_t) 0, SEEK_END);
***************
*** 279,284 ****
--- 304,310 ----
register int i;
FILE *f = result_value ? stderr : stdout;
+ fprintf (f, "\nGNU %s %s - texindex 2.1\n\n", PACKAGE, VERSION);
fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
/* Avoid trigraph nonsense. */
***************
*** 321,331 ****
--- 347,366 ----
if (tempdir == NULL)
tempdir = "sys$scratch:";
#else
+ #ifdef __EMX__
+ if (tempdir == NULL)
+ tempdir = getenv("TMP");
+ if ( !tempdir )
+ tempdir = "/";
+ else
+ tempdir = concat (tempdir, "/", "");
+ #else
if (tempdir == NULL)
tempdir = "/tmp/";
else
tempdir = concat (tempdir, "/", "");
#endif
+ #endif
keep_tempfiles = 0;
***************
*** 900,915 ****
/* Sort an input file too big to sort in core. */
void
! sort_offline (infile, nfiles, total, outfile)
char *infile;
- int nfiles;
long total;
char *outfile;
{
/* More than enough. */
int ntemps = 2 * (total + MAX_IN_CORE_SORT - 1) / MAX_IN_CORE_SORT;
char **tempfiles = (char **) xmalloc (ntemps * sizeof (char *));
! FILE *istream = fopen (infile, "r");
int i;
struct linebuffer lb;
long linelength;
--- 935,949 ----
/* Sort an input file too big to sort in core. */
void
! sort_offline (infile, total, outfile)
char *infile;
long total;
char *outfile;
{
/* More than enough. */
int ntemps = 2 * (total + MAX_IN_CORE_SORT - 1) / MAX_IN_CORE_SORT;
char **tempfiles = (char **) xmalloc (ntemps * sizeof (char *));
! FILE *istream = fopen (infile, "rt");
int i;
struct linebuffer lb;
long linelength;
***************
*** 981,987 ****
for (i = 0; i < ntemps; i++)
{
char *newtemp = maketempname (++tempcount);
! sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
unlink (tempfiles[i]);
tempfiles[i] = newtemp;
--- 1015,1021 ----
for (i = 0; i < ntemps; i++)
{
char *newtemp = maketempname (++tempcount);
! sort_in_core (tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
unlink (tempfiles[i]);
tempfiles[i] = newtemp;
***************
*** 1015,1021 ****
/* Read the contents of the file into the moby array `data'. */
! int desc = open (infile, O_RDONLY, 0);
if (desc < 0)
fatal (_("failure reopening %s"), infile);
--- 1049,1055 ----
/* Read the contents of the file into the moby array `data'. */
! int desc = open (infile, O_RDONLY|O_TEXT, 0);
if (desc < 0)
fatal (_("failure reopening %s"), infile);
***************
*** 1071,1077 ****
Make a `struct lineinfo' for each line, which records the keyfield
as well as the line, and sort them. */
! lineinfo = (struct lineinfo *) malloc ((nextline - linearray) * sizeof (struct lineinfo));
if (lineinfo)
{
--- 1105,1111 ----
Make a `struct lineinfo' for each line, which records the keyfield
as well as the line, and sort them. */
! lineinfo = (struct lineinfo *) xmalloc ((nextline - linearray) * sizeof (struct lineinfo));
if (lineinfo)
{
***************
*** 1542,1548 ****
thisline[i] = &lb1[i];
prevline[i] = &lb2[i];
file_lossage[i] = 0;
! streams[i] = fopen (infiles[i], "r");
if (!streams[i])
pfatal_with_name (infiles[i]);
--- 1576,1582 ----
thisline[i] = &lb1[i];
prevline[i] = &lb2[i];
file_lossage[i] = 0;
! streams[i] = fopen (infiles[i], "rt");
if (!streams[i])
pfatal_with_name (infiles[i]);
***************
*** 1733,1739 ****
_("Virtual memory exhausted in %s ()! Needed %d bytes."),
callers_name, bytes_wanted);
! error (printable_string);
abort ();
}
--- 1767,1773 ----
_("Virtual memory exhausted in %s ()! Needed %d bytes."),
callers_name, bytes_wanted);
! error (printable_string, "");
abort ();
}