Changeset 2619


Ignore:
Timestamp:
Mar 12, 2006, 6:02:46 PM (19 years ago)
Author:
bird
Message:

applied OS/2 patches (manually).

Location:
trunk/texinfo
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/texinfo/info/echo-area.c

    r2617 r2619  
    592592
    593593    counter = input_line_end - input_line_point;
    594    
     594
    595595    for (i = input_line_point - len; counter; i++, counter--)
    596596      input_line[i] = input_line[i + len];
     
    894894  return (line);
    895895}
    896  
     896
    897897/* Read a line in the echo area with completion over COMPLETIONS. */
    898898char *
     
    14881488pause_or_input (void)
    14891489{
    1490 #ifdef FD_SET
     1490#if defined(FD_SET) && !defined(__INNOTEK_LIBC__)
    14911491  struct timeval timer;
    14921492  fd_set readfds;
  • trunk/texinfo/info/filesys.h

    r2617 r2619  
    7979/* The default value of INFOPATH. */
    8080#if !defined (DEFAULT_INFOPATH)
    81 #  define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
     81#  ifndef __EMX__
     82#    define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
     83#  else
     84#    define DEFAULT_INFOPATH ".;/usr/local/info;/usr/info;/usr/local/lib/info;/usr/lib/info;/usr/local/gnu/info;/usr/local/gnu/lib/info;/usr/gnu/info;/usr/gnu/lib/info;/opt/gnu/info;/usr/share/info;/usr/share/lib/info;/usr/local/share/info;/usr/local/share/lib/info;/usr/gnu/lib/emacs/info;/usr/local/gnu/lib/emacs/info;/usr/local/lib/emacs/info;/usr/local/emacs/info;/emx/info;"
     85#  endif /* __EMX__ */
    8286#endif /* !DEFAULT_INFOPATH */
    8387
  • trunk/texinfo/info/man.c

    r2617 r2619  
    3333#include "tilde.h"
    3434#include "man.h"
     35
     36#ifdef __EMX__
     37# include <process.h>
     38# include <sys/wait.h>
     39# undef PIPE_USE_FORK
     40#endif
    3541
    3642#if !defined (_POSIX_VERSION)
     
    471477  int bindex = 0;
    472478  int select_result;
    473 #if defined (FD_SET)
     479#if defined (FD_SET) && !defined (__INNOTEK__LIBC__)
    474480  fd_set read_fds;
    475481
  • trunk/texinfo/info/session.c

    r2617 r2619  
    2424#include "search.h"
    2525#include <sys/ioctl.h>
     26
     27#ifdef __EMX__
     28#  include <stdlib.h>
     29#  include "pc.h"
     30#endif /* __EMX__ */
    2631
    2732#if defined (HAVE_SYS_TIME_H)
     
    19941999   prefer the one forward.  The return is in newly-allocated memory,
    19952000   since the caller frees it.
    1996    
     2001
    19972002   This is called from info_menu_or_ref_item with XREF_LIST being all
    19982003   the xrefs in the node, and POS being point.  The ui function that
     
    20092014  int nearest = -1;
    20102015  long best_delta = -1;
    2011  
     2016
    20122017  for (this_xref = 0; xref_list[this_xref]; this_xref++)
    20132018    {
     
    20192024          break;
    20202025        }
    2021      
     2026
    20222027      /* See how far POS is from this xref.  Take into account the
    20232028         `*Note' that begins the xref, since as far as the user is
     
    20252030      delta = MIN (labs (pos - (xref->start - strlen (INFO_XREF_LABEL))),
    20262031                   labs (pos - xref->end));
    2027      
     2032
    20282033      /* It's the <= instead of < that makes us choose the forward xref
    20292034         of POS if two are equidistant.  Of course, because of all the
     
    20362041        }
    20372042    }
    2038  
     2043
    20392044  /* Maybe there was no list to search through.  */
    20402045  if (nearest < 0)
    20412046    return NULL;
    2042  
     2047
    20432048  /* Ok, we have a nearest xref, make a list of it.  */
    20442049  {
     
    32993304
    33003305#if !defined (DEFAULT_INFO_PRINT_COMMAND)
     3306# ifndef __EMX__
    33013307#  define DEFAULT_INFO_PRINT_COMMAND "lpr"
     3308# else
     3309#  define DEFAULT_INFO_PRINT_COMMAND "expand --tabs=4 >>InfoLog.tmp"
     3310# endif /* __EMX__ */
    33023311#endif /* !DEFAULT_INFO_PRINT_COMMAND */
    33033312
     
    41144123            break;
    41154124          }
    4116      
     4125
    41174126
    41184127      if (search_result == 0)
     
    45754584          !info_input_pending_p ())
    45764585        {
    4577 #if defined (FD_SET)
     4586#if defined (FD_SET) && !defined (__EMX__)
    45784587          struct timeval timer;
    45794588          fd_set readfds;
     
    49244933  space_avail = info_input_buffer_space_available ();
    49254934
     4935#ifdef __EMX__
     4936  if ( is_xfree86 == XFREE86_NO )
     4937    {
     4938      while (chars_avail < space_avail && (tty = pc_getc(0)) != -1)
     4939        input[chars_avail++] = tty;
     4940    }
     4941  else
     4942    {
     4943#endif /* __EMX__ */
    49264944  /* If we can just find out how many characters there are to read, do so. */
    49274945#if defined (FIONREAD)
     
    49764994#  endif /* O_NDELAY */
    49774995#endif /* !FIONREAD */
     4996#ifdef __EMX__
     4997    }
     4998#endif /* __EMX__ */
    49784999
    49795000  while (i < chars_avail)
     
    50025023      unsigned char c;
    50035024      int tty = fileno (info_input_stream);
     5025
     5026#ifdef __EMX__
     5027      if (is_xfree86 == XFREE86_NO)
     5028        keystroke = pc_getc(1);
     5029      else
     5030      {
     5031#endif /* __EMX__ */
    50045032
    50055033      /* Using stream I/O causes FIONREAD etc to fail to work
     
    50465074            }
    50475075        }
     5076#ifdef __EMX__
     5077      }
     5078#endif /* __EMX__ */
    50485079    }
    50495080
  • trunk/texinfo/info/terminal.c

    r2617 r2619  
    2424#include "terminal.h"
    2525#include "termdep.h"
     26#ifdef __EMX__
     27#  include <stdlib.h>
     28#  include "pc.h"
     29#endif /* __EMX__ */
    2630
    2731#include <sys/types.h>
     
    135139  if (term_keypad_on)
    136140      send_to_terminal (term_keypad_on);
    137  
     141
    138142  if (!term_begin_use || !*term_begin_use)
    139143    return;
    140144
    141145#ifdef SIGWINCH
    142   sigsave = signal (SIGWINCH, SIG_IGN); 
     146  sigsave = signal (SIGWINCH, SIG_IGN);
    143147#endif
    144148
     
    166170  if (term_keypad_off)
    167171      send_to_terminal (term_keypad_off);
    168  
     172
    169173  if (!term_end_use || !*term_end_use)
    170174    return;
     
    460464      screenwidth = screenheight = 0;
    461465
     466#ifdef __EMX__
     467      {
     468        int s[2];
     469        _scrsize (s);
     470        screenwidth = s[0];
     471        screenheight = s[1];
     472        if (getenv ("WINDOWID"))
     473          {
     474             FILE *fd = popen ("scrsize","rt");
     475             if (fd)
     476               {
     477                 fscanf (fd, "%i %i", &screenwidth, &screenheight);
     478                 pclose (fd);
     479               }
     480          }
     481      }
     482#endif /* __EMX__ */
     483
    462484#if defined (TIOCGWINSZ)
    463485      {
     
    705727
    706728  tty = fileno (stdin);
     729
     730#ifdef __EMX__
     731  if (is_xfree86 == XFREE86_NO)
     732    pc_init ();
     733  else
     734  {
     735#endif /* __EMX__ */
    707736
    708737#if defined (HAVE_TERMIOS_H)
     
    827856  ioctl (tty, TIOCSETN, &ttybuff);
    828857#endif /* !HAVE_TERMIOS_H && !HAVE_TERMIO_H */
     858#ifdef __EMX__
     859  }
     860#endif /* __EMX__ */
    829861}
    830862
     
    843875
    844876  tty = fileno (stdin);
     877
     878#ifdef __EMX__
     879  if ( is_xfree86 == XFREE86_NO )
     880    pc_exit ();
     881  else
     882  {
     883#endif /* __EMX__ */
    845884
    846885#if defined (HAVE_TERMIOS_H)
     
    868907#  endif /* !HAVE_TERMIO_H */
    869908#endif /* !HAVE_TERMIOS_H */
     909#ifdef __EMX__
     910  }
     911#endif /* __EMX__ */
    870912  terminal_end_using_terminal ();
    871913}
  • trunk/texinfo/lib/Makefile.am

    r2617 r2619  
    1818                   gettext.h \
    1919                   strcase.h strdup.h substring.c system.h \
    20                    xalloc.h xexit.c xmalloc.c xstrdup.c
     20                   xalloc.h xexit.c xmalloc.c xstrdup.c \
     21                   pc.c pc.h
    2122libtxi_a_LIBADD = $(LIBOBJS) $(ALLOCA)
    2223libtxi_a_DEPENDENCIES = $(libtxi_a_LIBADD)
  • trunk/texinfo/lib/system.h

    r2617 r2619  
    2828#ifdef MIKTEX
    2929#include <gnu-miktex.h>
    30 #define S_ISDIR(x) ((x)&_S_IFDIR) 
     30#define S_ISDIR(x) ((x)&_S_IFDIR)
    3131#else
    3232/* MiKTeX defines substring() in a separate DLL, where it has its
    33    own __declspec declaration.  We don't want to try to duplicate 
     33   own __declspec declaration.  We don't want to try to duplicate
    3434   this Microsoft-ism here.  */
    3535extern char *substring (const char *, const char *);
     
    213213#  define DEFAULT_INFO_PRINT_COMMAND ">PRN"
    214214# else   /* O_BINARY && !__MSDOS__ */
    215 #  define setmode(f,m)  _setmode(f,m)
    216 #  define HAVE_LONG_FILENAMES(dir)   (1)
    217 #  define NULL_DEVICE   "NUL"
     215#  ifdef __EMX__
     216#   define NULL_DEVICE  "nul"
     217#   define HAVE_LONG_FILENAMES(dir)   (1)
     218#   define DEFAULT_INFO_PRINT_COMMAND "expand --tabs=4 >>InfoLog.tmp"
     219#  else
     220#   define setmode(f,m)  _setmode(f,m)
     221#   define HAVE_LONG_FILENAMES(dir)   (1)
     222#   define NULL_DEVICE  "NUL"
     223#  endif /* !__EMX__ */
    218224# endif  /* O_BINARY && !__MSDOS__ */
    219225# ifdef __CYGWIN__
     
    229235# define FOPEN_RBIN     "rb"
    230236# define FOPEN_WBIN     "wb"
     237# ifdef __EMX__                         /* bird - start */
     238#  define FOPEN_RTXT     "rt"
     239#  define FOPEN_WTXT     "wt"
     240# else
     241#  define FOPEN_RTXT     "r"
     242#  define FOPEN_WTXT     "w"
     243# endif                                 /* bird - end */
    231244# define HAVE_DRIVE(n)  ((n)[0] && (n)[1] == ':')
    232245# define IS_SLASH(c)    ((c) == '/' || (c) == '\\')
     
    240253# define FOPEN_RBIN     "r"
    241254# define FOPEN_WBIN     "w"
     255# define FOPEN_RTXT     "r"             /* bird */
     256# define FOPEN_WTXT     "w"             /* bird */
    242257# define IS_SLASH(c)    ((c) == '/')
    243258# define HAVE_DRIVE(n)  (0)
  • trunk/texinfo/makeinfo/files.c

    r2617 r2619  
    202202
    203203  fullpath
    204     = get_file_info_in_path (filename, use_path ? include_files_path : NULL, 
     204    = get_file_info_in_path (filename, use_path ? include_files_path : NULL,
    205205                             &fileinfo);
    206206
     
    369369}
    370370
     371#if defined (__EMX__)
     372/* Convert DOS slashes to UNIX slashes. */
     373static char *slashify (char *filename)
     374{
     375  if (filename)
     376    for (char *s = strchr (filename, '/'); s; s = strchr (s + 1, '/')
     377      *s = '/';
     378  return filename;
     379}
     380#endif
     381
    371382/* Return just the simple part of the filename; i.e. the
    372383   filename without the path information, or extensions.
     
    375386filename_part (char *filename)
    376387{
     388#if defined (__EMX__)
     389  char *basename = filename_non_directory (slashify (filename));
     390#else
    377391  char *basename = filename_non_directory (filename);
     392#endif
    378393
    379394#ifdef REMOVE_OUTPUT_EXTENSIONS
     
    394409  char *result = NULL;
    395410  int i;
     411#ifdef __EMX__
     412  slashify (filename);
     413#endif
    396414
    397415  filename = expand_filename (filename, "");
     
    414432  int initial_character;
    415433  char *result;
     434#ifdef __EMX__
     435  slashify (filename);
     436#endif
    416437
    417438  /* No filename given? */
    418439  if (!filename || !*filename)
    419440    return xstrdup ("");
    420  
     441
    421442  /* Already absolute? */
    422443  if (IS_ABSOLUTE (filename) ||
     
    443464      strcat (localdir, "/");
    444465      strcat (localdir, filename);
     466#ifdef __EMX__
     467      slashify (localdir);
     468#endif
    445469      result = xstrdup (localdir);
    446470      free (localdir);
     
    505529{
    506530  int i;
     531#ifdef __EMX__
     532  slashify (filename);
     533  slashify (input_name);
     534#endif
    507535
    508536  if (filename)
     
    542570      /* Make it so that relative names work. */
    543571      char *result;
    544      
     572
    545573      i = strlen (input_name) - 1;
    546574
     
    580608  char *lastdot, *p;
    581609
    582 #ifdef _PC_NAME_MAX
     610#if defined (_PC_NAME_MAX) && !defined(__EMX__) /* bird: _PC_NAME_MAX => 14 on OS/2. FIXME!!! */
    583611  maxlen = pathconf (fname, _PC_NAME_MAX);
    584612  if (maxlen < 1)
     
    657685      || FILENAME_CMP (current_output_filename, ALSO_NULL_DEVICE) == 0)
    658686    return;
    659    
     687
    660688  /* We need the HTML header in the output,
    661689     to get a proper output_position.  */
  • trunk/texinfo/makeinfo/makeinfo.c

    r2617 r2619  
    543543  int reading_from_stdin = 0;
    544544
     545#ifdef __EMX__
     546  _response (&argc, &argv);
     547  _wildcard (&argc, &argv);
     548  if (argc == 1 && isatty (STDIN_FILENO))
     549    usage (0);
     550#endif
     551
    545552#ifdef HAVE_SETLOCALE
    546553  /* Do not use LC_ALL, because LC_NUMERIC screws up the scanf parsing
     
    658665            {
    659666              macro_expansion_filename = optarg;
    660               macro_expansion_output_stream
    661                 = strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w");
     667#if defined(__EMX__)
     668              if (strcmp (optarg, "-") == 0)
     669                {
     670                  macro_expansion_output_stream = stdout;
     671                  freopen(NULL, FOPEN_WBIN, stdout);
     672                }
     673              else
     674                macro_expansion_output_stream = fopen (optarg, FOPEN_WBIN);
     675#else
     676              macro_expansion_output_stream =
     677                  strcmp (optarg, "-") == 0 ? stdout : fopen (optarg, "w");
     678#endif
    662679              if (!macro_expansion_output_stream)
    663680                error (_("%s: could not open macro expansion output `%s'"),
     
    9991016          sprintf (end_block, "\n%cend ", COMMAND_PREFIX);
    10001017          if (executing_string && strstr (string, end_block))
    1001             line_error (_("Multiline command %c%s used improperly"), 
     1018            line_error (_("Multiline command %c%s used improperly"),
    10021019                COMMAND_PREFIX, command);
    10031020          else
     
    16321649        real_output_filename = xstrdup (real_output_filename);
    16331650
    1634       output_stream = fopen (real_output_filename, "w");
     1651#if defined(__EMX__)
     1652     output_stream = fopen (real_output_filename, FOPEN_WBIN);
     1653#else
     1654     output_stream = fopen (real_output_filename, "w");
     1655#endif
    16351656    }
    16361657
     
    33413362          add_word_args ("\"%s\"", fullname);
    33423363          add_html_elt (" alt=");
    3343           add_word_args ("\"%s\">", 
     3364          add_word_args ("\"%s\">",
    33443365              escape_string (*alt_arg ? text_expansion (alt_arg) : fullname));
    33453366
     
    33783399          strcpy (txtname, name_arg);
    33793400          strcat (txtname, ".txt");
    3380           image_file = fopen (txtname, "r");
     3401          image_file = fopen (txtname, FOPEN_RTXT); /* bird: text */
    33813402          if (image_file == NULL)
    33823403            {
     
    33843405                                               include_files_path, &file_info);
    33853406              if (txtpath != NULL)
    3386                 image_file = fopen (txtpath, "r");
     3407                image_file = fopen (txtpath, FOPEN_RTXT); /* bird: text */
    33873408            }
    33883409
     
    34413462                  if (image_in_brackets)
    34423463                    add_char (']');
    3443                  
     3464
    34443465                  if (use_magic_cookie)
    34453466                    add_char ('"');
     
    36823703             expand to a context-sensitive macro (e.g. @xref) and produce
    36833704             spurious warnings */
    3684           input_text_offset++; 
     3705          input_text_offset++;
    36853706          execute_string ("%s", value);
    36863707          input_text_offset--;
  • trunk/texinfo/makeinfo/node.c

    r2617 r2619  
    504504    char *optr = otem;
    505505    int need_old = 0;
    506    
     506
    507507    for (; *optr; optr++)
    508508      {
     
    513513          }
    514514      }
    515    
     515
    516516    if (need_old)
    517517      {
     
    974974
    975975      if (!splitting && no_headers)
    976         { /* cross refs need a name="#anchor" even if not writing headers */ 
     976        { /* cross refs need a name="#anchor" even if not writing headers */
    977977          add_html_names (node);
    978978        }
     
    984984          add_word_args ("<p>%s\n", splitting ? "" : "<hr>");
    985985
    986           /* In the split HTML case, the filename is wrong for the 
     986          /* In the split HTML case, the filename is wrong for the
    987987             old-style converted names, but we'll add them anyway, for
    988988             consistency.  (And we need them in the normal (not
     
    995995              add_word ((char *) _("Next:"));
    996996              add_word ("&nbsp;");
    997              
     997
    998998              add_word ("<a rel=\"next\" accesskey=\"n\" href=\"");
    999999              add_anchor_name (tem, 1);
    10001000              tem = escape_string (tem);
    10011001              add_word_args ("\">%s</a>", tem);
    1002              
     1002       
    10031003              free (tem);
    10041004
     
    18801880                  char *split_basename = filename_part (split_filename);
    18811881
     1882#ifdef __EMX__
     1883                  fd = open (split_filename,
     1884                             O_WRONLY|O_TRUNC|O_CREAT|O_BINARY, 0666);
     1885#else
    18821886                  fd = open (split_filename, O_WRONLY|O_TRUNC|O_CREAT, 0666);
     1887#endif
    18831888                  if (fd < 0
    18841889                      || write (fd, the_header, header_size) != header_size
     
    19181923       original again.  We must use `output_stream', or
    19191924       write_tag_table_indirect () won't know where to place the output. */
     1925#ifdef __EMX__
     1926    output_stream = fopen (filename, FOPEN_WBIN);
     1927#else
    19201928    output_stream = fopen (filename, "w");
     1929#endif
    19211930    if (!output_stream)
    19221931      {
  • trunk/texinfo/util/texindex.c

    r2617 r2619  
    2121#include "system.h"
    2222#include <getopt.h>
     23
     24#ifdef __EMX__
     25#  include <stdlib.h>
     26#endif
    2327
    2428static char *program_name = "texindex";
     
    158162  tempcount = 0;
    159163  last_deleted_tempcount = 0;
     164
     165#ifdef __EMX__
     166  _response(&argc, &argv);
     167  _wildcard(&argc, &argv);
     168#endif
    160169
    161170#ifdef HAVE_SETLOCALE
Note: See TracChangeset for help on using the changeset viewer.