• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisiónd4bc24e6a28144ebb16f143efb72ffdd98bbe0fc (tree)
Tiempo2006-11-02 02:12:57
Autorvimboss
Commitervimboss

Log Message

updated for version 7.0-156

Cambiar Resumen

Diferencia incremental

diff -r 82b2594be408 -r d4bc24e6a281 src/feature.h
--- a/src/feature.h Wed Nov 01 14:32:36 2006 +0000
+++ b/src/feature.h Wed Nov 01 17:12:57 2006 +0000
@@ -1133,7 +1133,7 @@
11331133 /*
11341134 * +ARP Amiga only. Use arp.library, DOS 2.0 is not required.
11351135 */
1136-#ifndef NO_ARP
1136+#if !defined(NO_ARP) && !defined(__amigaos4__)
11371137 # define FEAT_ARP
11381138 #endif
11391139
diff -r 82b2594be408 -r d4bc24e6a281 src/mbyte.c
--- a/src/mbyte.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/mbyte.c Wed Nov 01 17:12:57 2006 +0000
@@ -667,7 +667,7 @@
667667 * API */
668668 n = IsDBCSLeadByteEx(enc_dbcs, (BYTE)i) ? 2 : 1;
669669 #else
670-# ifdef MACOS
670+# if defined(MACOS) || defined(__amigaos4__)
671671 /*
672672 * if mblen() is not available, character which MSB is turned on
673673 * are treated as leading byte character. (note : This assumption
diff -r 82b2594be408 -r d4bc24e6a281 src/memfile.c
--- a/src/memfile.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/memfile.c Wed Nov 01 17:12:57 2006 +0000
@@ -655,7 +655,7 @@
655655 # endif
656656 #endif
657657 #ifdef AMIGA
658-# ifdef __AROS__
658+# if defined(__AROS__) || defined(__amigaos4__)
659659 if (fsync(mfp->mf_fd) != 0)
660660 status = FAIL;
661661 # else
diff -r 82b2594be408 -r d4bc24e6a281 src/memline.c
--- a/src/memline.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/memline.c Wed Nov 01 17:12:57 2006 +0000
@@ -55,10 +55,14 @@
5555 # include <time.h>
5656 #endif
5757
58-#ifdef SASC
58+#if defined(SASC) || defined(__amigaos4__)
5959 # include <proto/dos.h> /* for Open() and Close() */
6060 #endif
6161
62+#ifdef HAVE_ERRNO_H
63+# include <errno.h>
64+#endif
65+
6266 typedef struct block0 ZERO_BL; /* contents of the first block */
6367 typedef struct pointer_block PTR_BL; /* contents of a pointer block */
6468 typedef struct data_block DATA_BL; /* contents of a data block */
@@ -4481,7 +4485,7 @@
44814485 curchnk = buf->b_ml.ml_chunksize + curix;
44824486
44834487 if (updtype == ML_CHNK_DELLINE)
4484- len *= -1;
4488+ len = -len;
44854489 curchnk->mlcs_totalsize += len;
44864490 if (updtype == ML_CHNK_ADDLINE)
44874491 {
diff -r 82b2594be408 -r d4bc24e6a281 src/os_amiga.c
--- a/src/os_amiga.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/os_amiga.c Wed Nov 01 17:12:57 2006 +0000
@@ -30,20 +30,31 @@
3030 # include <exec/types.h>
3131 # include <exec/exec.h>
3232 # include <libraries/dos.h>
33-# include <libraries/dosextens.h>
3433 # include <intuition/intuition.h>
35-#else
36-# include <proto/dos.h>
37-# include <libraries/dosextens.h>
38-# include <proto/intuition.h>
39-# include <proto/exec.h>
4034 #endif
4135
36+/* XXX These are included from os_amiga.h
37+#include <proto/exec.h>
38+#include <proto/dos.h>
39+#include <proto/intuition.h>
40+*/
41+
4242 #include <exec/memory.h>
43+#include <libraries/dosextens.h>
4344
4445 #include <dos/dostags.h> /* for 2.0 functions */
4546 #include <dos/dosasl.h>
4647
48+/* From version 4 of AmigaOS, several system structures must be allocated
49+ * and freed using system functions. "struct AnchorPath" is one.
50+ */
51+#ifdef __amigaos4__
52+# include <dos/anchorpath.h>
53+# define free_fib(x) FreeDosObject(DOS_FIB, x)
54+#else
55+# define free_fib(x) vim_free(fib)
56+#endif
57+
4758 #if defined(LATTICE) && !defined(SASC) && defined(FEAT_ARP)
4859 # include <libraries/arp_pragmas.h>
4960 #endif
@@ -56,7 +67,9 @@
5667 #undef FALSE
5768 #define FALSE (0)
5869
59-#if !defined(AZTEC_C) && !defined(__AROS__)
70+#ifdef __amigaos4__
71+# define dos_packet(a, b, c) DoPkt(a, b, c, 0, 0, 0, 0)
72+#elif !defined(AZTEC_C) && !defined(__AROS__)
6073 static long dos_packet __ARGS((struct MsgPort *, long, long));
6174 #endif
6275 static int lock2name __ARGS((BPTR lock, char_u *buf, long len));
@@ -68,7 +81,9 @@
6881 static BPTR raw_out = (BPTR)NULL;
6982 static int close_win = FALSE; /* set if Vim opened the window */
7083
84+#ifndef __amigaos4__ /* Use autoopen for AmigaOS4 */
7185 struct IntuitionBase *IntuitionBase = NULL;
86+#endif
7287 #ifdef FEAT_ARP
7388 struct ArpBase *ArpBase = NULL;
7489 #endif
@@ -186,9 +201,17 @@
186201 mch_avail_mem(special)
187202 int special;
188203 {
204+#ifdef __amigaos4__
205+ return (long_u)AvailMem(MEMF_ANY);
206+#else
189207 return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY);
208+#endif
190209 }
191210
211+/*
212+ * Waits a specified amount of time, or until input arrives if
213+ * ignoreinput is FALSE.
214+ */
192215 void
193216 mch_delay(msec, ignoreinput)
194217 long msec;
@@ -252,6 +275,7 @@
252275 out_flush();
253276
254277 wb_window = NULL;
278+#ifndef __amigaos4__
255279 if ((IntuitionBase = (struct IntuitionBase *)
256280 OpenLibrary((UBYTE *)intlibname, 0L)) == NULL)
257281 {
@@ -260,6 +284,7 @@
260284 mch_errmsg("!?\n");
261285 mch_exit(3);
262286 }
287+#endif
263288 }
264289
265290 #include <workbench/startup.h>
@@ -284,7 +309,7 @@
284309 {
285310 int i;
286311 BPTR nilfh, fh;
287- char_u buf1[20];
312+ char_u buf1[24];
288313 char_u buf2[BUF2SIZE];
289314 static char_u *(constrings[3]) = {(char_u *)"con:0/0/662/210/",
290315 (char_u *)"con:0/0/640/200/",
@@ -295,35 +320,39 @@
295320 char *av;
296321 char_u *device = NULL;
297322 int exitval = 4;
323+#ifndef __amigaos4__
298324 struct Library *DosBase;
325+#endif
299326 int usewin = FALSE;
300327
301328 /*
302329 * check if we are running under DOS 2.0x or higher
303330 */
331+#ifndef __amigaos4__
304332 DosBase = OpenLibrary(DOS_LIBRARY, 37L);
305333 if (DosBase != NULL)
306334 /* if (((struct Library *)DOSBase)->lib_Version >= 37) */
307335 {
308336 CloseLibrary(DosBase);
309-#ifdef FEAT_ARP
337+# ifdef FEAT_ARP
310338 dos2 = TRUE;
311-#endif
339+# endif
312340 }
313341 else /* without arp functions we NEED 2.0 */
314342 {
315-#ifndef FEAT_ARP
343+# ifndef FEAT_ARP
316344 mch_errmsg(_("Need Amigados version 2.04 or later\n"));
317345 exit(3);
318-#else
346+# else
319347 /* need arp functions for dos 1.x */
320348 if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
321349 {
322350 fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
323351 exit(3);
324352 }
325-#endif
353+# endif
326354 }
355+#endif /* __amigaos4__ */
327356
328357 /*
329358 * scan argv[] for the "-f" and "-d" arguments
@@ -398,8 +427,15 @@
398427 /*
399428 * Make a unique name for the temp file (which we will not delete!).
400429 * Use a pointer on the stack (nobody else will be using it).
430+ * Under AmigaOS4, this assumption might change in the future, so
431+ * we use a pointer to the current task instead. This should be a
432+ * shared structure and thus globally unique.
401433 */
434+#ifdef __amigaos4__
435+ sprintf((char *)buf1, "t:nc%p", FindTask(0));
436+#else
402437 sprintf((char *)buf1, "t:nc%ld", (long)buf1);
438+#endif
403439 if ((fh = Open((UBYTE *)buf1, (long)MODE_NEWFILE)) == (BPTR)NULL)
404440 {
405441 mch_errmsg(_("Cannot create "));
@@ -513,7 +549,8 @@
513549
514550 /*
515551 * fname_case(): Set the case of the file name, if it already exists.
516- * This will cause the file name to remain exactly the same.
552+ * This will cause the file name to remain exactly the same
553+ * if the file system ignores, but preserves case.
517554 */
518555 /*ARGSUSED*/
519556 void
@@ -528,9 +565,14 @@
528565 if (fib != NULL)
529566 {
530567 flen = STRLEN(name);
568+ /* TODO: Check if this fix applies to AmigaOS < 4 too.*/
569+#ifdef __amigaos4__
570+ if (fib->fib_DirEntryType == ST_ROOT)
571+ strcat(fib->fib_FileName, ":");
572+#endif
531573 if (flen == strlen(fib->fib_FileName)) /* safety check */
532574 mch_memmove(name, fib->fib_FileName, flen);
533- vim_free(fib);
575+ free_fib(fib);
534576 }
535577 }
536578
@@ -548,13 +590,17 @@
548590
549591 if (fname == NULL) /* safety check */
550592 return NULL;
551- fib = (struct FileInfoBlock *)malloc(sizeof(struct FileInfoBlock));
593+#ifdef __amigaos4__
594+ fib = AllocDosObject(DOS_FIB,0);
595+#else
596+ fib = (struct FileInfoBlock *)alloc(sizeof(struct FileInfoBlock));
597+#endif
552598 if (fib != NULL)
553599 {
554600 flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
555601 if (flock == (BPTR)NULL || !Examine(flock, fib))
556602 {
557- vim_free(fib); /* in case of an error the memory is freed here */
603+ free_fib(fib); /* in case of an error the memory is freed here */
558604 fib = NULL;
559605 }
560606 if (flock)
@@ -613,6 +659,7 @@
613659 char_u *s;
614660 int len;
615661 {
662+ /* TODO: Implement this. */
616663 *s = NUL;
617664 return FAIL;
618665 }
@@ -625,7 +672,11 @@
625672 char_u *s;
626673 int len;
627674 {
675+#if defined(__amigaos4__) && defined(__CLIB2__)
676+ gethostname(s, len);
677+#else
628678 vim_strncpy(s, "Amiga", len - 1);
679+#endif
629680 }
630681
631682 /*
@@ -634,7 +685,14 @@
634685 long
635686 mch_get_pid()
636687 {
688+#ifdef __amigaos4__
689+ /* This is as close to a pid as we can come. We could use CLI numbers also,
690+ * but then we would have two different types of process identifiers.
691+ */
692+ return((long)FindTask(0));
693+#else
637694 return (long)0;
695+#endif
638696 }
639697
640698 /*
@@ -746,7 +804,7 @@
746804 if (fib != NULL)
747805 {
748806 retval = fib->fib_Protection;
749- vim_free(fib);
807+ free_fib(fib);
750808 }
751809 return retval;
752810 }
@@ -790,8 +848,12 @@
790848 fib = get_fib(name);
791849 if (fib != NULL)
792850 {
851+#ifdef __amigaos4__
852+ retval = (FIB_IS_DRAWER(fib)) ? TRUE : FALSE;
853+#else
793854 retval = ((fib->fib_DirEntryType >= 0) ? TRUE : FALSE);
794- vim_free(fib);
855+#endif
856+ free_fib(fib);
795857 }
796858 return retval;
797859 }
@@ -912,7 +974,7 @@
912974 mch_settmode(tmode)
913975 int tmode;
914976 {
915-#ifdef __AROS__
977+#if defined(__AROS__) || defined(__amigaos4__)
916978 if (!SetMode(raw_in, tmode == TMODE_RAW ? 1 : 0))
917979 #else
918980 if (dos_packet(MP(raw_in), (long)ACTION_SCREEN_MODE,
@@ -954,14 +1016,21 @@
9541016 mch_get_shellsize()
9551017 {
9561018 struct ConUnit *conUnit;
1019+#ifndef __amigaos4__
9571020 char id_a[sizeof(struct InfoData) + 3];
958- struct InfoData *id;
1021+#endif
1022+ struct InfoData *id=0;
9591023
9601024 if (!term_console) /* not an amiga window */
961- return FAIL;
1025+ goto out;
9621026
9631027 /* insure longword alignment */
1028+#ifdef __amigaos4__
1029+ if(!(id = AllocDosObject(DOS_INFODATA, 0)))
1030+ goto out;
1031+#else
9641032 id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
1033+#endif
9651034
9661035 /*
9671036 * Should make console aware of real window size, not the one we set.
@@ -983,7 +1052,7 @@
9831052 /* it's not an amiga window, maybe aux device */
9841053 /* terminal type should be set */
9851054 term_console = FALSE;
986- return FAIL;
1055+ goto out;
9871056 }
9881057 if (oldwindowtitle == NULL)
9891058 oldwindowtitle = (char_u *)wb_window->Title;
@@ -1006,6 +1075,12 @@
10061075 }
10071076
10081077 return OK;
1078+out:
1079+#ifdef __amigaos4__
1080+ FreeDosObject(DOS_INFODATA, id); /* Safe to pass NULL */
1081+#endif
1082+
1083+ return FAIL;
10091084 }
10101085
10111086 /*
@@ -1046,7 +1121,7 @@
10461121 OUT_STR_NF(tltoa((unsigned long)n));
10471122 }
10481123
1049-#if !defined(AZTEC_C) && !defined(__AROS__)
1124+#if !defined(AZTEC_C) && !defined(__AROS__) && !defined(__amigaos4__)
10501125 /*
10511126 * Sendpacket.c
10521127 *
@@ -1371,8 +1446,12 @@
13711446 * Use and abuse as you please.
13721447 */
13731448
1374-#define ANCHOR_BUF_SIZE (512)
1375-#define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
1449+#ifdef __amigaos4__
1450+# define ANCHOR_BUF_SIZE 1024
1451+#else
1452+# define ANCHOR_BUF_SIZE (512)
1453+# define ANCHOR_SIZE (sizeof(struct AnchorPath) + ANCHOR_BUF_SIZE)
1454+#endif
13761455
13771456 int
13781457 mch_expandpath(gap, pat, flags)
@@ -1385,19 +1464,32 @@
13851464 char_u *starbuf, *sp, *dp;
13861465 int start_len;
13871466 int matches;
1467+#ifdef __amigaos4__
1468+ struct TagItem AnchorTags[] = {
1469+ {ADO_Strlen, ANCHOR_BUF_SIZE},
1470+ {ADO_Flags, APF_DODOT|APF_DOWILD|APF_MultiAssigns},
1471+ {TAG_DONE, 0L}
1472+ };
1473+#endif
13881474
13891475 start_len = gap->ga_len;
13901476
13911477 /* Get our AnchorBase */
1478+#ifdef __amigaos4__
1479+ Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
1480+#else
13921481 Anchor = (struct AnchorPath *)alloc_clear((unsigned)ANCHOR_SIZE);
1482+#endif
13931483 if (Anchor == NULL)
13941484 return 0;
13951485
1486+#ifndef __amigaos4__
13961487 Anchor->ap_Strlen = ANCHOR_BUF_SIZE; /* ap_Length not supported anymore */
1397-#ifdef APF_DODOT
1488+# ifdef APF_DODOT
13981489 Anchor->ap_Flags = APF_DODOT | APF_DOWILD; /* allow '.' for current dir */
1399-#else
1490+# else
14001491 Anchor->ap_Flags = APF_DoDot | APF_DoWild; /* allow '.' for current dir */
1492+# endif
14011493 #endif
14021494
14031495 #ifdef FEAT_ARP
@@ -1432,7 +1524,11 @@
14321524 */
14331525 while (Result == 0)
14341526 {
1527+#ifdef __amigaos4__
1528+ addfile(gap, (char_u *)Anchor->ap_Buffer, flags);
1529+#else
14351530 addfile(gap, (char_u *)Anchor->ap_Buf, flags);
1531+#endif
14361532 #ifdef FEAT_ARP
14371533 if (dos2)
14381534 #endif
@@ -1469,7 +1565,11 @@
14691565 #endif
14701566
14711567 Return:
1568+#ifdef __amigaos4__
1569+ FreeDosObject(DOS_ANCHORPATH, Anchor);
1570+#else
14721571 vim_free(Anchor);
1572+#endif
14731573
14741574 return matches;
14751575 }
diff -r 82b2594be408 -r d4bc24e6a281 src/os_amiga.h
--- a/src/os_amiga.h Wed Nov 01 14:32:36 2006 +0000
+++ b/src/os_amiga.h Wed Nov 01 17:12:57 2006 +0000
@@ -17,9 +17,12 @@
1717 #define HAVE_AVAIL_MEM
1818
1919 #ifndef HAVE_CONFIG_H
20-# ifdef AZTEC_C
20+# if defined(AZTEC_C) || defined(__amigaos4__)
2121 # define HAVE_STAT_H
2222 # endif
23+# ifdef __amigaos4__
24+# define HAVE_STDARG_H
25+# endif
2326 # define HAVE_STDLIB_H
2427 # define HAVE_STRING_H
2528 # define HAVE_FCNTL_H
@@ -34,15 +37,24 @@
3437 # define HAVE_DATE_TIME
3538 # endif
3639
37-#define DFLT_ERRORFILE "AztecC.Err"
38-#define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
40+#endif /* HAVE_CONFIG_H */
3941
40-#define BASENAMELEN 26 /* Amiga */
42+#ifndef DFLT_ERRORFILE
43+# define DFLT_ERRORFILE "AztecC.Err" /* Should this change? */
44+#endif
4145
42-#define TEMPNAME "t:v?XXXXXX"
43-#define TEMPNAMELEN 12
46+#ifndef DFLT_RUNTIMEPATH
47+# define DFLT_RUNTIMEPATH "home:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,home:vimfiles/after"
48+#endif
4449
45-#endif /* HAVE_CONFIG_H */
50+#ifndef BASENAMELEN
51+# define BASENAMELEN 26 /* Amiga */
52+#endif
53+
54+#ifndef TEMPNAME
55+# define TEMPNAME "t:v?XXXXXX"
56+# define TEMPNAMELEN 12
57+#endif
4658
4759 #include <exec/types.h>
4860 #include <libraries/dos.h>
@@ -155,9 +167,9 @@
155167 #endif
156168
157169 #ifdef FEAT_VIMINFO
158-#ifndef VIMINFO_FILE
159-# define VIMINFO_FILE "s:.viminfo"
160-#endif
170+# ifndef VIMINFO_FILE
171+# define VIMINFO_FILE "s:.viminfo"
172+# endif
161173 #endif /* FEAT_VIMINFO */
162174
163175 #ifndef EXRC_FILE
diff -r 82b2594be408 -r d4bc24e6a281 src/pty.c
--- a/src/pty.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/pty.c Wed Nov 01 17:12:57 2006 +0000
@@ -51,7 +51,7 @@
5151 # include <sys/termios.h>
5252 #endif
5353
54-#if HAVE_SYS_IOCTL_H
54+#ifdef HAVE_SYS_IOCTL_H
5555 # include <sys/ioctl.h>
5656 #endif
5757
@@ -69,14 +69,14 @@
6969 # endif
7070 #endif
7171
72-#if HAVE_UNISTD_H
72+#ifdef HAVE_UNISTD_H
7373 # include <unistd.h>
7474 #endif
7575
7676 #if HAVE_TERMIO_H
7777 # include <termio.h>
7878 #else
79-# if HAVE_TERMIOS_H
79+# ifdef HAVE_TERMIOS_H
8080 # include <termios.h>
8181 # endif
8282 #endif
diff -r 82b2594be408 -r d4bc24e6a281 src/version.c
--- a/src/version.c Wed Nov 01 14:32:36 2006 +0000
+++ b/src/version.c Wed Nov 01 17:12:57 2006 +0000
@@ -667,6 +667,8 @@
667667 static int included_patches[] =
668668 { /* Add new patch number below this line */
669669 /**/
670+ 156,
671+/**/
670672 155,
671673 /**/
672674 154,
Show on old repository browser