ab0fac5
To: vim-dev@vim.org
ab0fac5
Subject: Patch 7.0.156
ab0fac5
Fcc: outbox
ab0fac5
From: Bram Moolenaar <Bram@moolenaar.net>
ab0fac5
Mime-Version: 1.0
ab0fac5
Content-Type: text/plain; charset=ISO-8859-1
ab0fac5
Content-Transfer-Encoding: 8bit
ab0fac5
------------
ab0fac5
ab0fac5
Patch 7.0.156 (extra)
ab0fac5
Problem:    Vim doesn't compile for Amiga OS 4.
ab0fac5
Solution:   Various changes for Amiga OS4. (Peter Bengtsson)
ab0fac5
Files:	    src/feature.h, src/mbyte.c, src/memfile.c, src/memline.c,
ab0fac5
	    src/os_amiga.c, src/os_amiga.h, src/pty.c
ab0fac5
ab0fac5
ab0fac5
*** ../vim-7.0.155/src/feature.h	Thu Apr 27 01:54:09 2006
ab0fac5
--- src/feature.h	Wed Nov  1 17:52:54 2006
ab0fac5
***************
ab0fac5
*** 1133,1139 ****
ab0fac5
  /*
ab0fac5
   * +ARP			Amiga only. Use arp.library, DOS 2.0 is not required.
ab0fac5
   */
ab0fac5
! #ifndef NO_ARP
ab0fac5
  # define FEAT_ARP
ab0fac5
  #endif
ab0fac5
  
ab0fac5
--- 1133,1139 ----
ab0fac5
  /*
ab0fac5
   * +ARP			Amiga only. Use arp.library, DOS 2.0 is not required.
ab0fac5
   */
ab0fac5
! #if !defined(NO_ARP) && !defined(__amigaos4__)
ab0fac5
  # define FEAT_ARP
ab0fac5
  #endif
ab0fac5
  
ab0fac5
*** ../vim-7.0.155/src/mbyte.c	Tue Aug 29 17:28:56 2006
ab0fac5
--- src/mbyte.c	Wed Nov  1 17:52:54 2006
ab0fac5
***************
ab0fac5
*** 667,673 ****
ab0fac5
  	     * API */
ab0fac5
  	    n = IsDBCSLeadByteEx(enc_dbcs, (BYTE)i) ? 2 : 1;
ab0fac5
  #else
ab0fac5
! # ifdef MACOS
ab0fac5
  	    /*
ab0fac5
  	     * if mblen() is not available, character which MSB is turned on
ab0fac5
  	     * are treated as leading byte character. (note : This assumption
ab0fac5
--- 667,673 ----
ab0fac5
  	     * API */
ab0fac5
  	    n = IsDBCSLeadByteEx(enc_dbcs, (BYTE)i) ? 2 : 1;
ab0fac5
  #else
ab0fac5
! # if defined(MACOS) || defined(__amigaos4__)
ab0fac5
  	    /*
ab0fac5
  	     * if mblen() is not available, character which MSB is turned on
ab0fac5
  	     * are treated as leading byte character. (note : This assumption
ab0fac5
*** ../vim-7.0.155/src/memfile.c	Tue Sep 26 13:49:41 2006
ab0fac5
--- src/memfile.c	Wed Nov  1 17:52:54 2006
ab0fac5
***************
ab0fac5
*** 655,661 ****
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
  #ifdef AMIGA
ab0fac5
! # ifdef __AROS__
ab0fac5
  	if (fsync(mfp->mf_fd) != 0)
ab0fac5
  	    status = FAIL;
ab0fac5
  # else
ab0fac5
--- 655,661 ----
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
  #ifdef AMIGA
ab0fac5
! # if defined(__AROS__) || defined(__amigaos4__)
ab0fac5
  	if (fsync(mfp->mf_fd) != 0)
ab0fac5
  	    status = FAIL;
ab0fac5
  # else
ab0fac5
*** ../vim-7.0.155/src/memline.c	Tue Oct 10 21:56:37 2006
ab0fac5
--- src/memline.c	Wed Nov  1 17:52:54 2006
ab0fac5
***************
ab0fac5
*** 55,64 ****
ab0fac5
  # include <time.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #ifdef SASC
ab0fac5
  # include <proto/dos.h>	    /* for Open() and Close() */
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  typedef struct block0		ZERO_BL;    /* contents of the first block */
ab0fac5
  typedef struct pointer_block	PTR_BL;	    /* contents of a pointer block */
ab0fac5
  typedef struct data_block	DATA_BL;    /* contents of a data block */
ab0fac5
--- 55,68 ----
ab0fac5
  # include <time.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #if defined(SASC) || defined(__amigaos4__)
ab0fac5
  # include <proto/dos.h>	    /* for Open() and Close() */
ab0fac5
  #endif
ab0fac5
  
ab0fac5
+ #ifdef HAVE_ERRNO_H
ab0fac5
+ # include <errno.h>
ab0fac5
+ #endif
ab0fac5
+ 
ab0fac5
  typedef struct block0		ZERO_BL;    /* contents of the first block */
ab0fac5
  typedef struct pointer_block	PTR_BL;	    /* contents of a pointer block */
ab0fac5
  typedef struct data_block	DATA_BL;    /* contents of a data block */
ab0fac5
***************
ab0fac5
*** 4481,4487 ****
ab0fac5
      curchnk = buf->b_ml.ml_chunksize + curix;
ab0fac5
  
ab0fac5
      if (updtype == ML_CHNK_DELLINE)
ab0fac5
! 	len *= -1;
ab0fac5
      curchnk->mlcs_totalsize += len;
ab0fac5
      if (updtype == ML_CHNK_ADDLINE)
ab0fac5
      {
ab0fac5
--- 4485,4491 ----
ab0fac5
      curchnk = buf->b_ml.ml_chunksize + curix;
ab0fac5
  
ab0fac5
      if (updtype == ML_CHNK_DELLINE)
ab0fac5
! 	len = -len;
ab0fac5
      curchnk->mlcs_totalsize += len;
ab0fac5
      if (updtype == ML_CHNK_ADDLINE)
ab0fac5
      {
ab0fac5
*** ../vim-7.0.155/src/os_amiga.c	Thu Sep 14 21:36:35 2006
ab0fac5
--- src/os_amiga.c	Wed Nov  1 18:09:46 2006
ab0fac5
***************
ab0fac5
*** 30,49 ****
ab0fac5
  # include <exec/types.h>
ab0fac5
  # include <exec/exec.h>
ab0fac5
  # include <libraries/dos.h>
ab0fac5
- # include <libraries/dosextens.h>
ab0fac5
  # include <intuition/intuition.h>
ab0fac5
- #else
ab0fac5
- # include <proto/dos.h>
ab0fac5
- # include <libraries/dosextens.h>
ab0fac5
- # include <proto/intuition.h>
ab0fac5
- # include <proto/exec.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #include <exec/memory.h>
ab0fac5
  
ab0fac5
  #include <dos/dostags.h>	    /* for 2.0 functions */
ab0fac5
  #include <dos/dosasl.h>
ab0fac5
  
ab0fac5
  #if defined(LATTICE) && !defined(SASC) && defined(FEAT_ARP)
ab0fac5
  # include <libraries/arp_pragmas.h>
ab0fac5
  #endif
ab0fac5
--- 30,60 ----
ab0fac5
  # include <exec/types.h>
ab0fac5
  # include <exec/exec.h>
ab0fac5
  # include <libraries/dos.h>
ab0fac5
  # include <intuition/intuition.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
+ /* XXX These are included from os_amiga.h
ab0fac5
+ #include <proto/exec.h>
ab0fac5
+ #include <proto/dos.h>
ab0fac5
+ #include <proto/intuition.h>
ab0fac5
+ */
ab0fac5
+ 
ab0fac5
  #include <exec/memory.h>
ab0fac5
+ #include <libraries/dosextens.h>
ab0fac5
  
ab0fac5
  #include <dos/dostags.h>	    /* for 2.0 functions */
ab0fac5
  #include <dos/dosasl.h>
ab0fac5
  
ab0fac5
+ /* From version 4 of AmigaOS, several system structures must be allocated
ab0fac5
+  * and freed using system functions. "struct AnchorPath" is one.
ab0fac5
+  */
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+ # include <dos/anchorpath.h>
ab0fac5
+ # define	free_fib(x) FreeDosObject(DOS_FIB, x)
ab0fac5
+ #else
ab0fac5
+ # define	free_fib(x) vim_free(fib)
ab0fac5
+ #endif
ab0fac5
+ 
ab0fac5
  #if defined(LATTICE) && !defined(SASC) && defined(FEAT_ARP)
ab0fac5
  # include <libraries/arp_pragmas.h>
ab0fac5
  #endif
ab0fac5
***************
ab0fac5
*** 56,62 ****
ab0fac5
  #undef	FALSE
ab0fac5
  #define FALSE (0)
ab0fac5
  
ab0fac5
! #if !defined(AZTEC_C) && !defined(__AROS__)
ab0fac5
  static long dos_packet __ARGS((struct MsgPort *, long, long));
ab0fac5
  #endif
ab0fac5
  static int lock2name __ARGS((BPTR lock, char_u *buf, long   len));
ab0fac5
--- 67,75 ----
ab0fac5
  #undef	FALSE
ab0fac5
  #define FALSE (0)
ab0fac5
  
ab0fac5
! #ifdef __amigaos4__
ab0fac5
! # define	dos_packet(a, b, c)   DoPkt(a, b, c, 0, 0, 0, 0)
ab0fac5
! #elif !defined(AZTEC_C) && !defined(__AROS__)
ab0fac5
  static long dos_packet __ARGS((struct MsgPort *, long, long));
ab0fac5
  #endif
ab0fac5
  static int lock2name __ARGS((BPTR lock, char_u *buf, long   len));
ab0fac5
***************
ab0fac5
*** 68,74 ****
ab0fac5
--- 81,89 ----
ab0fac5
  static BPTR		raw_out = (BPTR)NULL;
ab0fac5
  static int		close_win = FALSE;  /* set if Vim opened the window */
ab0fac5
  
ab0fac5
+ #ifndef __amigaos4__	/* Use autoopen for AmigaOS4 */
ab0fac5
  struct IntuitionBase	*IntuitionBase = NULL;
ab0fac5
+ #endif
ab0fac5
  #ifdef FEAT_ARP
ab0fac5
  struct ArpBase		*ArpBase = NULL;
ab0fac5
  #endif
ab0fac5
***************
ab0fac5
*** 186,194 ****
ab0fac5
--- 201,217 ----
ab0fac5
  mch_avail_mem(special)
ab0fac5
      int	    special;
ab0fac5
  {
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     return (long_u)AvailMem(MEMF_ANY);
ab0fac5
+ #else
ab0fac5
      return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY);
ab0fac5
+ #endif
ab0fac5
  }
ab0fac5
  
ab0fac5
+ /*
ab0fac5
+  * Waits a specified amount of time, or until input arrives if
ab0fac5
+  * ignoreinput is FALSE.
ab0fac5
+  */
ab0fac5
      void
ab0fac5
  mch_delay(msec, ignoreinput)
ab0fac5
      long    msec;
ab0fac5
***************
ab0fac5
*** 252,257 ****
ab0fac5
--- 275,281 ----
ab0fac5
      out_flush();
ab0fac5
  
ab0fac5
      wb_window = NULL;
ab0fac5
+ #ifndef __amigaos4__
ab0fac5
      if ((IntuitionBase = (struct IntuitionBase *)
ab0fac5
  				OpenLibrary((UBYTE *)intlibname, 0L)) == NULL)
ab0fac5
      {
ab0fac5
***************
ab0fac5
*** 260,265 ****
ab0fac5
--- 284,290 ----
ab0fac5
  	mch_errmsg("!?\n");
ab0fac5
  	mch_exit(3);
ab0fac5
      }
ab0fac5
+ #endif
ab0fac5
  }
ab0fac5
  
ab0fac5
  #include <workbench/startup.h>
ab0fac5
***************
ab0fac5
*** 284,290 ****
ab0fac5
  {
ab0fac5
      int		    i;
ab0fac5
      BPTR	    nilfh, fh;
ab0fac5
!     char_u	    buf1[20];
ab0fac5
      char_u	    buf2[BUF2SIZE];
ab0fac5
      static char_u   *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
ab0fac5
  					(char_u *)"con:0/0/640/200/",
ab0fac5
--- 309,315 ----
ab0fac5
  {
ab0fac5
      int		    i;
ab0fac5
      BPTR	    nilfh, fh;
ab0fac5
!     char_u	    buf1[24];
ab0fac5
      char_u	    buf2[BUF2SIZE];
ab0fac5
      static char_u   *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
ab0fac5
  					(char_u *)"con:0/0/640/200/",
ab0fac5
***************
ab0fac5
*** 295,329 ****
ab0fac5
      char	    *av;
ab0fac5
      char_u	    *device = NULL;
ab0fac5
      int		    exitval = 4;
ab0fac5
      struct Library  *DosBase;
ab0fac5
      int		    usewin = FALSE;
ab0fac5
  
ab0fac5
  /*
ab0fac5
   * check if we are running under DOS 2.0x or higher
ab0fac5
   */
ab0fac5
      DosBase = OpenLibrary(DOS_LIBRARY, 37L);
ab0fac5
      if (DosBase != NULL)
ab0fac5
      /* if (((struct Library *)DOSBase)->lib_Version >= 37) */
ab0fac5
      {
ab0fac5
  	CloseLibrary(DosBase);
ab0fac5
! #ifdef FEAT_ARP
ab0fac5
  	dos2 = TRUE;
ab0fac5
! #endif
ab0fac5
      }
ab0fac5
      else	    /* without arp functions we NEED 2.0 */
ab0fac5
      {
ab0fac5
! #ifndef FEAT_ARP
ab0fac5
  	mch_errmsg(_("Need Amigados version 2.04 or later\n"));
ab0fac5
  	exit(3);
ab0fac5
! #else
ab0fac5
  		    /* need arp functions for dos 1.x */
ab0fac5
  	if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
ab0fac5
  	{
ab0fac5
  	    fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
ab0fac5
  	    exit(3);
ab0fac5
  	}
ab0fac5
! #endif
ab0fac5
      }
ab0fac5
  
ab0fac5
      /*
ab0fac5
       * scan argv[] for the "-f" and "-d" arguments
ab0fac5
--- 320,358 ----
ab0fac5
      char	    *av;
ab0fac5
      char_u	    *device = NULL;
ab0fac5
      int		    exitval = 4;
ab0fac5
+ #ifndef __amigaos4__
ab0fac5
      struct Library  *DosBase;
ab0fac5
+ #endif
ab0fac5
      int		    usewin = FALSE;
ab0fac5
  
ab0fac5
  /*
ab0fac5
   * check if we are running under DOS 2.0x or higher
ab0fac5
   */
ab0fac5
+ #ifndef __amigaos4__
ab0fac5
      DosBase = OpenLibrary(DOS_LIBRARY, 37L);
ab0fac5
      if (DosBase != NULL)
ab0fac5
      /* if (((struct Library *)DOSBase)->lib_Version >= 37) */
ab0fac5
      {
ab0fac5
  	CloseLibrary(DosBase);
ab0fac5
! # ifdef FEAT_ARP
ab0fac5
  	dos2 = TRUE;
ab0fac5
! # endif
ab0fac5
      }
ab0fac5
      else	    /* without arp functions we NEED 2.0 */
ab0fac5
      {
ab0fac5
! # ifndef FEAT_ARP
ab0fac5
  	mch_errmsg(_("Need Amigados version 2.04 or later\n"));
ab0fac5
  	exit(3);
ab0fac5
! # else
ab0fac5
  		    /* need arp functions for dos 1.x */
ab0fac5
  	if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
ab0fac5
  	{
ab0fac5
  	    fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
ab0fac5
  	    exit(3);
ab0fac5
  	}
ab0fac5
! # endif
ab0fac5
      }
ab0fac5
+ #endif	/* __amigaos4__ */
ab0fac5
  
ab0fac5
      /*
ab0fac5
       * scan argv[] for the "-f" and "-d" arguments
ab0fac5
***************
ab0fac5
*** 398,405 ****
ab0fac5
--- 427,441 ----
ab0fac5
      /*
ab0fac5
       * Make a unique name for the temp file (which we will not delete!).
ab0fac5
       * Use a pointer on the stack (nobody else will be using it).
ab0fac5
+      * Under AmigaOS4, this assumption might change in the future, so
ab0fac5
+      * we use a pointer to the current task instead. This should be a
ab0fac5
+      * shared structure and thus globally unique.
ab0fac5
       */
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     sprintf((char *)buf1, "t:nc%p", FindTask(0));
ab0fac5
+ #else
ab0fac5
      sprintf((char *)buf1, "t:nc%ld", (long)buf1);
ab0fac5
+ #endif
ab0fac5
      if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
ab0fac5
      {
ab0fac5
  	mch_errmsg(_("Cannot create "));
ab0fac5
***************
ab0fac5
*** 513,519 ****
ab0fac5
  
ab0fac5
  /*
ab0fac5
   * fname_case(): Set the case of the file name, if it already exists.
ab0fac5
!  *		 This will cause the file name to remain exactly the same.
ab0fac5
   */
ab0fac5
  /*ARGSUSED*/
ab0fac5
      void
ab0fac5
--- 549,556 ----
ab0fac5
  
ab0fac5
  /*
ab0fac5
   * fname_case(): Set the case of the file name, if it already exists.
ab0fac5
!  *		 This will cause the file name to remain exactly the same
ab0fac5
!  *		 if the file system ignores, but preserves case.
ab0fac5
   */
ab0fac5
  /*ARGSUSED*/
ab0fac5
      void
ab0fac5
***************
ab0fac5
*** 528,536 ****
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	flen = STRLEN(name);
ab0fac5
  	if (flen == strlen(fib->fib_FileName))	/* safety check */
ab0fac5
  	    mch_memmove(name, fib->fib_FileName, flen);
ab0fac5
! 	vim_free(fib);
ab0fac5
      }
ab0fac5
  }
ab0fac5
  
ab0fac5
--- 565,578 ----
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	flen = STRLEN(name);
ab0fac5
+ 	/* TODO: Check if this fix applies to AmigaOS < 4 too.*/
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+ 	if (fib->fib_DirEntryType == ST_ROOT)
ab0fac5
+ 	    strcat(fib->fib_FileName, ":");
ab0fac5
+ #endif
ab0fac5
  	if (flen == strlen(fib->fib_FileName))	/* safety check */
ab0fac5
  	    mch_memmove(name, fib->fib_FileName, flen);
ab0fac5
! 	free_fib(fib);
ab0fac5
      }
ab0fac5
  }
ab0fac5
  
ab0fac5
***************
ab0fac5
*** 548,560 ****
ab0fac5
  
ab0fac5
      if (fname == NULL)	    /* safety check */
ab0fac5
  	return NULL;
ab0fac5
!     fib = (struct FileInfoBlock *)malloc(sizeof(struct FileInfoBlock));
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
ab0fac5
  	if (flock == (BPTR)NULL || !Examine(flock, fib))
ab0fac5
  	{
ab0fac5
! 	    vim_free(fib);  /* in case of an error the memory is freed here */
ab0fac5
  	    fib = NULL;
ab0fac5
  	}
ab0fac5
  	if (flock)
ab0fac5
--- 590,606 ----
ab0fac5
  
ab0fac5
      if (fname == NULL)	    /* safety check */
ab0fac5
  	return NULL;
ab0fac5
! #ifdef __amigaos4__
ab0fac5
!     fib = AllocDosObject(DOS_FIB,0);
ab0fac5
! #else
ab0fac5
!     fib = (struct FileInfoBlock *)alloc(sizeof(struct FileInfoBlock));
ab0fac5
! #endif
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
ab0fac5
  	if (flock == (BPTR)NULL || !Examine(flock, fib))
ab0fac5
  	{
ab0fac5
! 	    free_fib(fib);  /* in case of an error the memory is freed here */
ab0fac5
  	    fib = NULL;
ab0fac5
  	}
ab0fac5
  	if (flock)
ab0fac5
***************
ab0fac5
*** 613,618 ****
ab0fac5
--- 659,665 ----
ab0fac5
      char_u  *s;
ab0fac5
      int	    len;
ab0fac5
  {
ab0fac5
+     /* TODO: Implement this. */
ab0fac5
      *s = NUL;
ab0fac5
      return FAIL;
ab0fac5
  }
ab0fac5
***************
ab0fac5
*** 625,631 ****
ab0fac5
--- 672,682 ----
ab0fac5
      char_u  *s;
ab0fac5
      int	    len;
ab0fac5
  {
ab0fac5
+ #if defined(__amigaos4__) && defined(__CLIB2__)
ab0fac5
+     gethostname(s, len);
ab0fac5
+ #else
ab0fac5
      vim_strncpy(s, "Amiga", len - 1);
ab0fac5
+ #endif
ab0fac5
  }
ab0fac5
  
ab0fac5
  /*
ab0fac5
***************
ab0fac5
*** 634,640 ****
ab0fac5
--- 685,698 ----
ab0fac5
      long
ab0fac5
  mch_get_pid()
ab0fac5
  {
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     /* This is as close to a pid as we can come. We could use CLI numbers also,
ab0fac5
+      * but then we would have two different types of process identifiers.
ab0fac5
+      */
ab0fac5
+     return((long)FindTask(0));
ab0fac5
+ #else
ab0fac5
      return (long)0;
ab0fac5
+ #endif
ab0fac5
  }
ab0fac5
  
ab0fac5
  /*
ab0fac5
***************
ab0fac5
*** 746,752 ****
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	retval = fib->fib_Protection;
ab0fac5
! 	vim_free(fib);
ab0fac5
      }
ab0fac5
      return retval;
ab0fac5
  }
ab0fac5
--- 804,810 ----
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	retval = fib->fib_Protection;
ab0fac5
! 	free_fib(fib);
ab0fac5
      }
ab0fac5
      return retval;
ab0fac5
  }
ab0fac5
***************
ab0fac5
*** 790,797 ****
ab0fac5
      fib = get_fib(name);
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
  	retval = ((fib->fib_DirEntryType >= 0) ? TRUE : FALSE);
ab0fac5
! 	vim_free(fib);
ab0fac5
      }
ab0fac5
      return retval;
ab0fac5
  }
ab0fac5
--- 848,859 ----
ab0fac5
      fib = get_fib(name);
ab0fac5
      if (fib != NULL)
ab0fac5
      {
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+ 	retval = (FIB_IS_DRAWER(fib)) ? TRUE : FALSE;
ab0fac5
+ #else
ab0fac5
  	retval = ((fib->fib_DirEntryType >= 0) ? TRUE : FALSE);
ab0fac5
! #endif
ab0fac5
! 	free_fib(fib);
ab0fac5
      }
ab0fac5
      return retval;
ab0fac5
  }
ab0fac5
***************
ab0fac5
*** 912,918 ****
ab0fac5
  mch_settmode(tmode)
ab0fac5
      int		tmode;
ab0fac5
  {
ab0fac5
! #ifdef __AROS__
ab0fac5
      if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
ab0fac5
  #else
ab0fac5
      if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
ab0fac5
--- 974,980 ----
ab0fac5
  mch_settmode(tmode)
ab0fac5
      int		tmode;
ab0fac5
  {
ab0fac5
! #if defined(__AROS__) || defined(__amigaos4__)
ab0fac5
      if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
ab0fac5
  #else
ab0fac5
      if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
ab0fac5
***************
ab0fac5
*** 954,967 ****
ab0fac5
  mch_get_shellsize()
ab0fac5
  {
ab0fac5
      struct ConUnit  *conUnit;
ab0fac5
      char	    id_a[sizeof(struct InfoData) + 3];
ab0fac5
!     struct InfoData *id;
ab0fac5
  
ab0fac5
      if (!term_console)	/* not an amiga window */
ab0fac5
! 	return FAIL;
ab0fac5
  
ab0fac5
      /* insure longword alignment */
ab0fac5
      id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
ab0fac5
  
ab0fac5
      /*
ab0fac5
       * Should make console aware of real window size, not the one we set.
ab0fac5
--- 1016,1036 ----
ab0fac5
  mch_get_shellsize()
ab0fac5
  {
ab0fac5
      struct ConUnit  *conUnit;
ab0fac5
+ #ifndef __amigaos4__
ab0fac5
      char	    id_a[sizeof(struct InfoData) + 3];
ab0fac5
! #endif
ab0fac5
!     struct InfoData *id=0;
ab0fac5
  
ab0fac5
      if (!term_console)	/* not an amiga window */
ab0fac5
! 	goto out;
ab0fac5
  
ab0fac5
      /* insure longword alignment */
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     if(!(id = AllocDosObject(DOS_INFODATA, 0)))
ab0fac5
+ 	goto out;
ab0fac5
+ #else
ab0fac5
      id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
ab0fac5
+ #endif
ab0fac5
  
ab0fac5
      /*
ab0fac5
       * Should make console aware of real window size, not the one we set.
ab0fac5
***************
ab0fac5
*** 983,989 ****
ab0fac5
  	/* it's not an amiga window, maybe aux device */
ab0fac5
  	/* terminal type should be set */
ab0fac5
  	term_console = FALSE;
ab0fac5
! 	return FAIL;
ab0fac5
      }
ab0fac5
      if (oldwindowtitle == NULL)
ab0fac5
  	oldwindowtitle = (char_u *)wb_window->Title;
ab0fac5
--- 1052,1058 ----
ab0fac5
  	/* it's not an amiga window, maybe aux device */
ab0fac5
  	/* terminal type should be set */
ab0fac5
  	term_console = FALSE;
ab0fac5
! 	goto out;
ab0fac5
      }
ab0fac5
      if (oldwindowtitle == NULL)
ab0fac5
  	oldwindowtitle = (char_u *)wb_window->Title;
ab0fac5
***************
ab0fac5
*** 1006,1011 ****
ab0fac5
--- 1075,1086 ----
ab0fac5
      }
ab0fac5
  
ab0fac5
      return OK;
ab0fac5
+ out:
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     FreeDosObject(DOS_INFODATA, id); /* Safe to pass NULL */
ab0fac5
+ #endif
ab0fac5
+ 
ab0fac5
+     return FAIL;
ab0fac5
  }
ab0fac5
  
ab0fac5
  /*
ab0fac5
***************
ab0fac5
*** 1046,1052 ****
ab0fac5
      OUT_STR_NF(tltoa((unsigned long)n));
ab0fac5
  }
ab0fac5
  
ab0fac5
! #if !defined(AZTEC_C) && !defined(__AROS__)
ab0fac5
  /*
ab0fac5
   * Sendpacket.c
ab0fac5
   *
ab0fac5
--- 1121,1127 ----
ab0fac5
      OUT_STR_NF(tltoa((unsigned long)n));
ab0fac5
  }
ab0fac5
  
ab0fac5
! #if !defined(AZTEC_C) && !defined(__AROS__) && !defined(__amigaos4__)
ab0fac5
  /*
ab0fac5
   * Sendpacket.c
ab0fac5
   *
ab0fac5
***************
ab0fac5
*** 1371,1378 ****
ab0fac5
   *	Use and abuse as you please.
ab0fac5
   */
ab0fac5
  
ab0fac5
! #define ANCHOR_BUF_SIZE (512)
ab0fac5
! #define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
ab0fac5
  
ab0fac5
      int
ab0fac5
  mch_expandpath(gap, pat, flags)
ab0fac5
--- 1446,1457 ----
ab0fac5
   *	Use and abuse as you please.
ab0fac5
   */
ab0fac5
  
ab0fac5
! #ifdef __amigaos4__
ab0fac5
! # define	ANCHOR_BUF_SIZE	1024
ab0fac5
! #else
ab0fac5
! # define ANCHOR_BUF_SIZE (512)
ab0fac5
! # define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
ab0fac5
! #endif
ab0fac5
  
ab0fac5
      int
ab0fac5
  mch_expandpath(gap, pat, flags)
ab0fac5
***************
ab0fac5
*** 1385,1403 ****
ab0fac5
      char_u		*starbuf, *sp, *dp;
ab0fac5
      int			start_len;
ab0fac5
      int			matches;
ab0fac5
  
ab0fac5
      start_len = gap->ga_len;
ab0fac5
  
ab0fac5
      /* Get our AnchorBase */
ab0fac5
      Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
ab0fac5
      if (Anchor == NULL)
ab0fac5
  	return 0;
ab0fac5
  
ab0fac5
      Anchor->ap_Strlen = ANCHOR_BUF_SIZE;  /* ap_Length not supported anymore */
ab0fac5
! #ifdef APF_DODOT
ab0fac5
      Anchor->ap_Flags = APF_DODOT | APF_DOWILD;	/* allow '.' for current dir */
ab0fac5
! #else
ab0fac5
      Anchor->ap_Flags = APF_DoDot | APF_DoWild;	/* allow '.' for current dir */
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #ifdef FEAT_ARP
ab0fac5
--- 1464,1495 ----
ab0fac5
      char_u		*starbuf, *sp, *dp;
ab0fac5
      int			start_len;
ab0fac5
      int			matches;
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     struct TagItem	AnchorTags[] = {
ab0fac5
+ 	{ADO_Strlen, ANCHOR_BUF_SIZE},
ab0fac5
+ 	{ADO_Flags, APF_DODOT|APF_DOWILD|APF_MultiAssigns},
ab0fac5
+ 	{TAG_DONE, 0L}
ab0fac5
+     };
ab0fac5
+ #endif
ab0fac5
  
ab0fac5
      start_len = gap->ga_len;
ab0fac5
  
ab0fac5
      /* Get our AnchorBase */
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
ab0fac5
+ #else
ab0fac5
      Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
ab0fac5
+ #endif
ab0fac5
      if (Anchor == NULL)
ab0fac5
  	return 0;
ab0fac5
  
ab0fac5
+ #ifndef __amigaos4__
ab0fac5
      Anchor->ap_Strlen = ANCHOR_BUF_SIZE;  /* ap_Length not supported anymore */
ab0fac5
! # ifdef APF_DODOT
ab0fac5
      Anchor->ap_Flags = APF_DODOT | APF_DOWILD;	/* allow '.' for current dir */
ab0fac5
! # else
ab0fac5
      Anchor->ap_Flags = APF_DoDot | APF_DoWild;	/* allow '.' for current dir */
ab0fac5
+ # endif
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #ifdef FEAT_ARP
ab0fac5
***************
ab0fac5
*** 1432,1438 ****
ab0fac5
--- 1524,1534 ----
ab0fac5
       */
ab0fac5
      while (Result == 0)
ab0fac5
      {
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+ 	addfile(gap, (char_u *)Anchor->ap_Buffer, flags);
ab0fac5
+ #else
ab0fac5
  	addfile(gap, (char_u *)Anchor->ap_Buf, flags);
ab0fac5
+ #endif
ab0fac5
  #ifdef FEAT_ARP
ab0fac5
  	if (dos2)
ab0fac5
  #endif
ab0fac5
***************
ab0fac5
*** 1469,1475 ****
ab0fac5
--- 1565,1575 ----
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  Return:
ab0fac5
+ #ifdef __amigaos4__
ab0fac5
+     FreeDosObject(DOS_ANCHORPATH, Anchor);
ab0fac5
+ #else
ab0fac5
      vim_free(Anchor);
ab0fac5
+ #endif
ab0fac5
  
ab0fac5
      return matches;
ab0fac5
  }
ab0fac5
*** ../vim-7.0.155/src/os_amiga.h	Sun Jun 13 22:09:36 2004
ab0fac5
--- src/os_amiga.h	Wed Nov  1 18:03:32 2006
ab0fac5
***************
ab0fac5
*** 17,25 ****
ab0fac5
  #define HAVE_AVAIL_MEM
ab0fac5
  
ab0fac5
  #ifndef HAVE_CONFIG_H
ab0fac5
! # ifdef AZTEC_C
ab0fac5
  #  define HAVE_STAT_H
ab0fac5
  # endif
ab0fac5
  # define HAVE_STDLIB_H
ab0fac5
  # define HAVE_STRING_H
ab0fac5
  # define HAVE_FCNTL_H
ab0fac5
--- 17,28 ----
ab0fac5
  #define HAVE_AVAIL_MEM
ab0fac5
  
ab0fac5
  #ifndef HAVE_CONFIG_H
ab0fac5
! # if defined(AZTEC_C) || defined(__amigaos4__)
ab0fac5
  #  define HAVE_STAT_H
ab0fac5
  # endif
ab0fac5
+ # ifdef __amigaos4__
ab0fac5
+ #  define HAVE_STDARG_H
ab0fac5
+ # endif
ab0fac5
  # define HAVE_STDLIB_H
ab0fac5
  # define HAVE_STRING_H
ab0fac5
  # define HAVE_FCNTL_H
ab0fac5
***************
ab0fac5
*** 34,48 ****
ab0fac5
  #  define HAVE_DATE_TIME
ab0fac5
  # endif
ab0fac5
  
ab0fac5
! #define DFLT_ERRORFILE		"AztecC.Err"
ab0fac5
! #define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
ab0fac5
  
ab0fac5
! #define BASENAMELEN	26	/* Amiga */
ab0fac5
  
ab0fac5
! #define TEMPNAME	"t:v?XXXXXX"
ab0fac5
! #define TEMPNAMELEN	12
ab0fac5
  
ab0fac5
! #endif /* HAVE_CONFIG_H */
ab0fac5
  
ab0fac5
  #include <exec/types.h>
ab0fac5
  #include <libraries/dos.h>
ab0fac5
--- 37,60 ----
ab0fac5
  #  define HAVE_DATE_TIME
ab0fac5
  # endif
ab0fac5
  
ab0fac5
! #endif /* HAVE_CONFIG_H */
ab0fac5
  
ab0fac5
! #ifndef	DFLT_ERRORFILE
ab0fac5
! # define DFLT_ERRORFILE		"AztecC.Err"	/* Should this change? */
ab0fac5
! #endif
ab0fac5
  
ab0fac5
! #ifndef	DFLT_RUNTIMEPATH
ab0fac5
! # define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
ab0fac5
! #endif
ab0fac5
  
ab0fac5
! #ifndef	BASENAMELEN
ab0fac5
! # define BASENAMELEN	26	/* Amiga */
ab0fac5
! #endif
ab0fac5
! 
ab0fac5
! #ifndef	TEMPNAME
ab0fac5
! # define TEMPNAME	"t:v?XXXXXX"
ab0fac5
! # define TEMPNAMELEN	12
ab0fac5
! #endif
ab0fac5
  
ab0fac5
  #include <exec/types.h>
ab0fac5
  #include <libraries/dos.h>
ab0fac5
***************
ab0fac5
*** 155,163 ****
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #ifdef FEAT_VIMINFO
ab0fac5
! #ifndef VIMINFO_FILE
ab0fac5
! # define VIMINFO_FILE	"s:.viminfo"
ab0fac5
! #endif
ab0fac5
  #endif /* FEAT_VIMINFO */
ab0fac5
  
ab0fac5
  #ifndef EXRC_FILE
ab0fac5
--- 167,175 ----
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #ifdef FEAT_VIMINFO
ab0fac5
! # ifndef VIMINFO_FILE
ab0fac5
! #  define VIMINFO_FILE	"s:.viminfo"
ab0fac5
! # endif
ab0fac5
  #endif /* FEAT_VIMINFO */
ab0fac5
  
ab0fac5
  #ifndef EXRC_FILE
ab0fac5
*** ../vim-7.0.155/src/pty.c	Sun Jun 13 22:04:27 2004
ab0fac5
--- src/pty.c	Wed Nov  1 17:53:01 2006
ab0fac5
***************
ab0fac5
*** 51,57 ****
ab0fac5
  # include <sys/termios.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #if HAVE_SYS_IOCTL_H
ab0fac5
  # include <sys/ioctl.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
--- 51,57 ----
ab0fac5
  # include <sys/termios.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #ifdef HAVE_SYS_IOCTL_H
ab0fac5
  # include <sys/ioctl.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
***************
ab0fac5
*** 69,82 ****
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #if HAVE_UNISTD_H
ab0fac5
  # include <unistd.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #if HAVE_TERMIO_H
ab0fac5
  # include <termio.h>
ab0fac5
  #else
ab0fac5
! # if HAVE_TERMIOS_H
ab0fac5
  #  include <termios.h>
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
--- 69,82 ----
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
  
ab0fac5
! #ifdef HAVE_UNISTD_H
ab0fac5
  # include <unistd.h>
ab0fac5
  #endif
ab0fac5
  
ab0fac5
  #if HAVE_TERMIO_H
ab0fac5
  # include <termio.h>
ab0fac5
  #else
ab0fac5
! # ifdef HAVE_TERMIOS_H
ab0fac5
  #  include <termios.h>
ab0fac5
  # endif
ab0fac5
  #endif
ab0fac5
*** ../vim-7.0.155/src/version.c	Wed Nov  1 15:31:02 2006
ab0fac5
--- src/version.c	Wed Nov  1 18:04:17 2006
ab0fac5
***************
ab0fac5
*** 668,669 ****
ab0fac5
--- 668,671 ----
ab0fac5
  {   /* Add new patch number below this line */
ab0fac5
+ /**/
ab0fac5
+     156,
ab0fac5
  /**/
ab0fac5
ab0fac5
-- 
ab0fac5
hundred-and-one symptoms of being an internet addict:
ab0fac5
139. You down your lunch in five minutes, at your desk, so you can
ab0fac5
     spend the rest of the hour surfing the Net.
ab0fac5
ab0fac5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
ab0fac5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
ab0fac5
\\\        download, build and distribute -- http://www.A-A-P.org        ///
ab0fac5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///