mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.2393: using old C style comments
Problem: Using old C style comments. Solution: Use // comments where appropriate.
This commit is contained in:
229
src/os_amiga.c
229
src/os_amiga.c
@@ -17,13 +17,13 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#ifdef Window
|
#ifdef Window
|
||||||
# undef Window /* Amiga has its own Window definition */
|
# undef Window // Amiga has its own Window definition
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef TRUE /* will be redefined by exec/types.h */
|
#undef TRUE // will be redefined by exec/types.h
|
||||||
#undef FALSE
|
#undef FALSE
|
||||||
|
|
||||||
/* cproto fails on missing include files, skip them */
|
// cproto fails on missing include files, skip them
|
||||||
#ifndef PROTO
|
#ifndef PROTO
|
||||||
|
|
||||||
#ifndef LATTICE
|
#ifndef LATTICE
|
||||||
@@ -33,21 +33,19 @@
|
|||||||
# include <intuition/intuition.h>
|
# include <intuition/intuition.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX These are included from os_amiga.h
|
// XXX These are included from os_amiga.h
|
||||||
#include <proto/exec.h>
|
// #include <proto/exec.h>
|
||||||
#include <proto/dos.h>
|
// #include <proto/dos.h>
|
||||||
#include <proto/intuition.h>
|
// #include <proto/intuition.h>
|
||||||
*/
|
|
||||||
|
|
||||||
#include <exec/memory.h>
|
#include <exec/memory.h>
|
||||||
#include <libraries/dosextens.h>
|
#include <libraries/dosextens.h>
|
||||||
|
|
||||||
#include <dos/dostags.h> /* for 2.0 functions */
|
#include <dos/dostags.h> // for 2.0 functions
|
||||||
#include <dos/dosasl.h>
|
#include <dos/dosasl.h>
|
||||||
|
|
||||||
/* From version 4 of AmigaOS, several system structures must be allocated
|
// From version 4 of AmigaOS, several system structures must be allocated
|
||||||
* and freed using system functions. "struct AnchorPath" is one.
|
// and freed using system functions. "struct AnchorPath" is one.
|
||||||
*/
|
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
# include <dos/anchorpath.h>
|
# include <dos/anchorpath.h>
|
||||||
# define free_fib(x) FreeDosObject(DOS_FIB, x)
|
# define free_fib(x) FreeDosObject(DOS_FIB, x)
|
||||||
@@ -59,7 +57,7 @@
|
|||||||
# include <libraries/arp_pragmas.h>
|
# include <libraries/arp_pragmas.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PROTO */
|
#endif // PROTO
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set stack size to 1 MiB on NG systems. This should be enough even for
|
* Set stack size to 1 MiB on NG systems. This should be enough even for
|
||||||
@@ -92,9 +90,9 @@ static int sortcmp(const void *a, const void *b);
|
|||||||
|
|
||||||
static BPTR raw_in = (BPTR)NULL;
|
static BPTR raw_in = (BPTR)NULL;
|
||||||
static BPTR raw_out = (BPTR)NULL;
|
static BPTR raw_out = (BPTR)NULL;
|
||||||
static int close_win = FALSE; /* set if Vim opened the window */
|
static int close_win = FALSE; // set if Vim opened the window
|
||||||
|
|
||||||
#ifndef __amigaos4__ /* Use autoopen for AmigaOS4 */
|
#ifndef __amigaos4__ // Use autoopen for AmigaOS4
|
||||||
struct IntuitionBase *IntuitionBase = NULL;
|
struct IntuitionBase *IntuitionBase = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
@@ -105,9 +103,9 @@ static struct Window *wb_window;
|
|||||||
static char_u *oldwindowtitle = NULL;
|
static char_u *oldwindowtitle = NULL;
|
||||||
|
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
int dos2 = FALSE; /* Amiga DOS 2.0x or higher */
|
int dos2 = FALSE; // Amiga DOS 2.0x or higher
|
||||||
#endif
|
#endif
|
||||||
int size_set = FALSE; /* set to TRUE if window size was set */
|
int size_set = FALSE; // set to TRUE if window size was set
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
static char version[] __attribute__((used)) =
|
static char version[] __attribute__((used)) =
|
||||||
@@ -151,7 +149,7 @@ mch_write(char_u *p, int len)
|
|||||||
mch_inchar(
|
mch_inchar(
|
||||||
char_u *buf,
|
char_u *buf,
|
||||||
int maxlen,
|
int maxlen,
|
||||||
long time, /* milli seconds */
|
long time, // milli seconds
|
||||||
int tb_change_cnt)
|
int tb_change_cnt)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
@@ -160,13 +158,13 @@ mch_inchar(
|
|||||||
if (time >= 0)
|
if (time >= 0)
|
||||||
{
|
{
|
||||||
if (time == 0)
|
if (time == 0)
|
||||||
utime = 100L; /* time = 0 causes problems in DOS 1.2 */
|
utime = 100L; // time = 0 causes problems in DOS 1.2
|
||||||
else
|
else
|
||||||
utime = time * 1000L; /* convert from milli to micro secs */
|
utime = time * 1000L; // convert from milli to micro secs
|
||||||
if (WaitForChar(raw_in, utime) == 0) /* no character available */
|
if (WaitForChar(raw_in, utime) == 0) // no character available
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else /* time == -1 */
|
else // time == -1
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If there is no character available within 2 seconds (default)
|
* If there is no character available within 2 seconds (default)
|
||||||
@@ -186,12 +184,12 @@ mch_inchar(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) /* repeat until we got a character */
|
for (;;) // repeat until we got a character
|
||||||
{
|
{
|
||||||
len = Read(raw_in, (char *)buf, (long)maxlen / input_conv.vc_factor);
|
len = Read(raw_in, (char *)buf, (long)maxlen / input_conv.vc_factor);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
{
|
{
|
||||||
/* Convert from 'termencoding' to 'encoding'. */
|
// Convert from 'termencoding' to 'encoding'.
|
||||||
if (input_conv.vc_type != CONV_NONE)
|
if (input_conv.vc_type != CONV_NONE)
|
||||||
len = convert_input(buf, len, maxlen);
|
len = convert_input(buf, len, maxlen);
|
||||||
return len;
|
return len;
|
||||||
@@ -228,14 +226,14 @@ mch_avail_mem(int special)
|
|||||||
void
|
void
|
||||||
mch_delay(long msec, int ignoreinput)
|
mch_delay(long msec, int ignoreinput)
|
||||||
{
|
{
|
||||||
#ifndef LATTICE /* SAS declares void Delay(ULONG) */
|
#ifndef LATTICE // SAS declares void Delay(ULONG)
|
||||||
void Delay(long);
|
void Delay(long);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (msec > 0)
|
if (msec > 0)
|
||||||
{
|
{
|
||||||
if (ignoreinput)
|
if (ignoreinput)
|
||||||
Delay(msec / 20L); /* Delay works with 20 msec intervals */
|
Delay(msec / 20L); // Delay works with 20 msec intervals
|
||||||
else
|
else
|
||||||
WaitForChar(raw_in, msec * 1000L);
|
WaitForChar(raw_in, msec * 1000L);
|
||||||
}
|
}
|
||||||
@@ -260,7 +258,7 @@ mch_init(void)
|
|||||||
static char intlibname[] = "intuition.library";
|
static char intlibname[] = "intuition.library";
|
||||||
|
|
||||||
#ifdef AZTEC_C
|
#ifdef AZTEC_C
|
||||||
Enable_Abort = 0; /* disallow vim to be aborted */
|
Enable_Abort = 0; // disallow vim to be aborted
|
||||||
#endif
|
#endif
|
||||||
Columns = 80;
|
Columns = 80;
|
||||||
Rows = 24;
|
Rows = 24;
|
||||||
@@ -313,7 +311,7 @@ mch_init(void)
|
|||||||
* For the -f option (foreground mode) we open our own window and disable :sh.
|
* For the -f option (foreground mode) we open our own window and disable :sh.
|
||||||
* Otherwise the calling program would never know when editing is finished.
|
* Otherwise the calling program would never know when editing is finished.
|
||||||
*/
|
*/
|
||||||
#define BUF2SIZE 320 /* length of buffer for argument with complete path */
|
#define BUF2SIZE 320 // length of buffer for argument with complete path
|
||||||
|
|
||||||
int
|
int
|
||||||
mch_check_win(int argc, char **argv)
|
mch_check_win(int argc, char **argv)
|
||||||
@@ -342,20 +340,20 @@ mch_check_win(int argc, char **argv)
|
|||||||
#ifndef __amigaos4__
|
#ifndef __amigaos4__
|
||||||
DosBase = OpenLibrary(DOS_LIBRARY, 37L);
|
DosBase = OpenLibrary(DOS_LIBRARY, 37L);
|
||||||
if (DosBase != NULL)
|
if (DosBase != NULL)
|
||||||
/* if (((struct Library *)DOSBase)->lib_Version >= 37) */
|
// if (((struct Library *)DOSBase)->lib_Version >= 37)
|
||||||
{
|
{
|
||||||
CloseLibrary(DosBase);
|
CloseLibrary(DosBase);
|
||||||
# ifdef FEAT_ARP
|
# ifdef FEAT_ARP
|
||||||
dos2 = TRUE;
|
dos2 = TRUE;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
else /* without arp functions we NEED 2.0 */
|
else // without arp functions we NEED 2.0
|
||||||
{
|
{
|
||||||
# ifndef FEAT_ARP
|
# ifndef FEAT_ARP
|
||||||
mch_errmsg(_("Need Amigados version 2.04 or later\n"));
|
mch_errmsg(_("Need Amigados version 2.04 or later\n"));
|
||||||
exit(3);
|
exit(3);
|
||||||
# else
|
# else
|
||||||
/* need arp functions for dos 1.x */
|
// need arp functions for dos 1.x
|
||||||
if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
|
if (!(ArpBase = (struct ArpBase *) OpenLibrary((UBYTE *)ArpName, ArpVersion)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
|
fprintf(stderr, _("Need %s version %ld\n"), ArpName, ArpVersion);
|
||||||
@@ -363,7 +361,7 @@ mch_check_win(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif /* __amigaos4__ */
|
#endif // __amigaos4__
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* scan argv[] for the "-f" and "-d" arguments
|
* scan argv[] for the "-f" and "-d" arguments
|
||||||
@@ -380,7 +378,7 @@ mch_check_win(int argc, char **argv)
|
|||||||
case 'd':
|
case 'd':
|
||||||
if (i < argc - 1
|
if (i < argc - 1
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
/* require using "-dev", "-d" means diff mode */
|
// require using "-dev", "-d" means diff mode
|
||||||
&& argv[i][2] == 'e' && argv[i][3] == 'v'
|
&& argv[i][2] == 'e' && argv[i][3] == 'v'
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@@ -419,7 +417,7 @@ mch_check_win(int argc, char **argv)
|
|||||||
(long)MODE_NEWFILE)) != (BPTR)NULL)
|
(long)MODE_NEWFILE)) != (BPTR)NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (raw_in == (BPTR)NULL) /* all three failed */
|
if (raw_in == (BPTR)NULL) // all three failed
|
||||||
{
|
{
|
||||||
mch_errmsg(_(winerr));
|
mch_errmsg(_(winerr));
|
||||||
goto exit;
|
goto exit;
|
||||||
@@ -458,7 +456,7 @@ mch_check_win(int argc, char **argv)
|
|||||||
* Write the command into the file, put quotes around the arguments that
|
* Write the command into the file, put quotes around the arguments that
|
||||||
* have a space in them.
|
* have a space in them.
|
||||||
*/
|
*/
|
||||||
if (argc == 0) /* run from workbench */
|
if (argc == 0) // run from workbench
|
||||||
ac = ((struct WBStartup *)argv)->sm_NumArgs;
|
ac = ((struct WBStartup *)argv)->sm_NumArgs;
|
||||||
else
|
else
|
||||||
ac = argc;
|
ac = argc;
|
||||||
@@ -471,11 +469,11 @@ mch_check_win(int argc, char **argv)
|
|||||||
if (argp->wa_Lock)
|
if (argp->wa_Lock)
|
||||||
(void)lock2name(argp->wa_Lock, buf2, (long)(BUF2SIZE - 1));
|
(void)lock2name(argp->wa_Lock, buf2, (long)(BUF2SIZE - 1));
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
if (dos2) /* use 2.0 function */
|
if (dos2) // use 2.0 function
|
||||||
#endif
|
#endif
|
||||||
AddPart((UBYTE *)buf2, (UBYTE *)argp->wa_Name, (long)(BUF2SIZE - 1));
|
AddPart((UBYTE *)buf2, (UBYTE *)argp->wa_Name, (long)(BUF2SIZE - 1));
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
else /* use arp function */
|
else // use arp function
|
||||||
TackOn((char *)buf2, argp->wa_Name);
|
TackOn((char *)buf2, argp->wa_Name);
|
||||||
#endif
|
#endif
|
||||||
av = (char *)buf2;
|
av = (char *)buf2;
|
||||||
@@ -483,7 +481,7 @@ mch_check_win(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
av = argv[i];
|
av = argv[i];
|
||||||
|
|
||||||
/* skip '-d' or "-dev" option */
|
// skip '-d' or "-dev" option
|
||||||
if (av[0] == '-' && av[1] == 'd'
|
if (av[0] == '-' && av[1] == 'd'
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
&& av[2] == 'e' && av[3] == 'v'
|
&& av[2] == 'e' && av[3] == 'v'
|
||||||
@@ -530,13 +528,13 @@ mch_check_win(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (i == 3) /* all three failed */
|
if (i == 3) // all three failed
|
||||||
{
|
{
|
||||||
DeleteFile((UBYTE *)buf1);
|
DeleteFile((UBYTE *)buf1);
|
||||||
mch_errmsg(_(winerr));
|
mch_errmsg(_(winerr));
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
exitval = 0; /* The Execute succeeded: exit this program */
|
exitval = 0; // The Execute succeeded: exit this program
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
@@ -544,7 +542,7 @@ exit:
|
|||||||
CloseLibrary((struct Library *) ArpBase);
|
CloseLibrary((struct Library *) ArpBase);
|
||||||
#endif
|
#endif
|
||||||
exit(exitval);
|
exit(exitval);
|
||||||
/* NOTREACHED */
|
// NOTREACHED
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -563,11 +561,11 @@ mch_input_isatty(void)
|
|||||||
* This will cause the file name to remain exactly the same
|
* This will cause the file name to remain exactly the same
|
||||||
* if the file system ignores, but preserves case.
|
* if the file system ignores, but preserves case.
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
//ARGSUSED
|
||||||
void
|
void
|
||||||
fname_case(
|
fname_case(
|
||||||
char_u *name,
|
char_u *name,
|
||||||
int len) /* buffer size, ignored here */
|
int len) // buffer size, ignored here
|
||||||
{
|
{
|
||||||
struct FileInfoBlock *fib;
|
struct FileInfoBlock *fib;
|
||||||
size_t flen;
|
size_t flen;
|
||||||
@@ -576,12 +574,12 @@ fname_case(
|
|||||||
if (fib != NULL)
|
if (fib != NULL)
|
||||||
{
|
{
|
||||||
flen = STRLEN(name);
|
flen = STRLEN(name);
|
||||||
/* TODO: Check if this fix applies to AmigaOS < 4 too.*/
|
// TODO: Check if this fix applies to AmigaOS < 4 too.
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
if (fib->fib_DirEntryType == ST_ROOT)
|
if (fib->fib_DirEntryType == ST_ROOT)
|
||||||
strcat(fib->fib_FileName, ":");
|
strcat(fib->fib_FileName, ":");
|
||||||
#endif
|
#endif
|
||||||
if (flen == strlen(fib->fib_FileName)) /* safety check */
|
if (flen == strlen(fib->fib_FileName)) // safety check
|
||||||
mch_memmove(name, fib->fib_FileName, flen);
|
mch_memmove(name, fib->fib_FileName, flen);
|
||||||
free_fib(fib);
|
free_fib(fib);
|
||||||
}
|
}
|
||||||
@@ -598,7 +596,7 @@ get_fib(char_u *fname)
|
|||||||
BPTR flock;
|
BPTR flock;
|
||||||
struct FileInfoBlock *fib;
|
struct FileInfoBlock *fib;
|
||||||
|
|
||||||
if (fname == NULL) /* safety check */
|
if (fname == NULL) // safety check
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
fib = AllocDosObject(DOS_FIB,0);
|
fib = AllocDosObject(DOS_FIB,0);
|
||||||
@@ -610,7 +608,7 @@ get_fib(char_u *fname)
|
|||||||
flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
|
flock = Lock((UBYTE *)fname, (long)ACCESS_READ);
|
||||||
if (flock == (BPTR)NULL || !Examine(flock, fib))
|
if (flock == (BPTR)NULL || !Examine(flock, fib))
|
||||||
{
|
{
|
||||||
free_fib(fib); /* in case of an error the memory is freed here */
|
free_fib(fib); // in case of an error the memory is freed here
|
||||||
fib = NULL;
|
fib = NULL;
|
||||||
}
|
}
|
||||||
if (flock)
|
if (flock)
|
||||||
@@ -703,9 +701,8 @@ mch_get_host_name(char_u *s, int len)
|
|||||||
mch_get_pid(void)
|
mch_get_pid(void)
|
||||||
{
|
{
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
/* This is as close to a pid as we can come. We could use CLI numbers also,
|
// This is as close to a pid as we can come. We could use CLI numbers also,
|
||||||
* but then we would have two different types of process identifiers.
|
// but then we would have two different types of process identifiers.
|
||||||
*/
|
|
||||||
return((long)FindTask(0));
|
return((long)FindTask(0));
|
||||||
#else
|
#else
|
||||||
return (long)0;
|
return (long)0;
|
||||||
@@ -738,13 +735,13 @@ mch_FullName(
|
|||||||
int retval = FAIL;
|
int retval = FAIL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Lock the file. If it exists, we can get the exact name. */
|
// Lock the file. If it exists, we can get the exact name.
|
||||||
if ((l = Lock((UBYTE *)fname, (long)ACCESS_READ)) != (BPTR)0)
|
if ((l = Lock((UBYTE *)fname, (long)ACCESS_READ)) != (BPTR)0)
|
||||||
{
|
{
|
||||||
retval = lock2name(l, buf, (long)len - 1);
|
retval = lock2name(l, buf, (long)len - 1);
|
||||||
UnLock(l);
|
UnLock(l);
|
||||||
}
|
}
|
||||||
else if (force || !mch_isFullName(fname)) /* not a full path yet */
|
else if (force || !mch_isFullName(fname)) // not a full path yet
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If the file cannot be locked (doesn't exist), try to lock the
|
* If the file cannot be locked (doesn't exist), try to lock the
|
||||||
@@ -757,8 +754,8 @@ mch_FullName(
|
|||||||
if (retval == OK)
|
if (retval == OK)
|
||||||
{
|
{
|
||||||
i = STRLEN(buf);
|
i = STRLEN(buf);
|
||||||
/* Concatenate the fname to the directory. Don't add a slash
|
// Concatenate the fname to the directory. Don't add a slash
|
||||||
* if fname is empty, but do change "" to "/". */
|
// if fname is empty, but do change "" to "/".
|
||||||
if (i == 0 || *fname != NUL)
|
if (i == 0 || *fname != NUL)
|
||||||
{
|
{
|
||||||
if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
|
if (i < len - 1 && (i == 0 || buf[i - 1] != ':'))
|
||||||
@@ -769,7 +766,7 @@ mch_FullName(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*buf == 0 || *buf == ':')
|
if (*buf == 0 || *buf == ':')
|
||||||
retval = FAIL; /* something failed; use the file name */
|
retval = FAIL; // something failed; use the file name
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -792,11 +789,11 @@ mch_isFullName(char_u *fname)
|
|||||||
lock2name(BPTR lock, char_u *buf, long len)
|
lock2name(BPTR lock, char_u *buf, long len)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
if (dos2) /* use 2.0 function */
|
if (dos2) // use 2.0 function
|
||||||
#endif
|
#endif
|
||||||
return ((int)NameFromLock(lock, (UBYTE *)buf, len) ? OK : FAIL);
|
return ((int)NameFromLock(lock, (UBYTE *)buf, len) ? OK : FAIL);
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
else /* use arp function */
|
else // use arp function
|
||||||
return ((int)PathName(lock, (char *)buf, (long)(len/32)) ? OK : FAIL);
|
return ((int)PathName(lock, (char *)buf, (long)(len/32)) ? OK : FAIL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -828,7 +825,7 @@ mch_getperm(char_u *name)
|
|||||||
int
|
int
|
||||||
mch_setperm(char_u *name, long perm)
|
mch_setperm(char_u *name, long perm)
|
||||||
{
|
{
|
||||||
perm &= ~FIBF_ARCHIVE; /* reset archived bit */
|
perm &= ~FIBF_ARCHIVE; // reset archived bit
|
||||||
return (SetProtection((UBYTE *)name, (long)perm) ? OK : FAIL);
|
return (SetProtection((UBYTE *)name, (long)perm) ? OK : FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -838,7 +835,7 @@ mch_setperm(char_u *name, long perm)
|
|||||||
void
|
void
|
||||||
mch_hide(char_u *name)
|
mch_hide(char_u *name)
|
||||||
{
|
{
|
||||||
/* can't hide a file */
|
// can't hide a file
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -890,7 +887,7 @@ mch_mkdir(char_u *name)
|
|||||||
int
|
int
|
||||||
mch_can_exe(char_u *name, char_u **path, int use_path)
|
mch_can_exe(char_u *name, char_u **path, int use_path)
|
||||||
{
|
{
|
||||||
/* TODO */
|
// TODO
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,7 +900,7 @@ mch_can_exe(char_u *name, char_u **path, int use_path)
|
|||||||
int
|
int
|
||||||
mch_nodetype(char_u *name)
|
mch_nodetype(char_u *name)
|
||||||
{
|
{
|
||||||
/* TODO */
|
// TODO
|
||||||
return NODE_NORMAL;
|
return NODE_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,7 +917,7 @@ mch_exit(int r)
|
|||||||
{
|
{
|
||||||
exiting = TRUE;
|
exiting = TRUE;
|
||||||
|
|
||||||
if (raw_in) /* put terminal in 'normal' mode */
|
if (raw_in) // put terminal in 'normal' mode
|
||||||
{
|
{
|
||||||
settmode(TMODE_COOK);
|
settmode(TMODE_COOK);
|
||||||
stoptermcap();
|
stoptermcap();
|
||||||
@@ -930,18 +927,18 @@ mch_exit(int r)
|
|||||||
{
|
{
|
||||||
if (term_console)
|
if (term_console)
|
||||||
{
|
{
|
||||||
win_resize_off(); /* window resize events de-activated */
|
win_resize_off(); // window resize events de-activated
|
||||||
if (size_set)
|
if (size_set)
|
||||||
OUT_STR("\233t\233u"); /* reset window size (CSI t CSI u) */
|
OUT_STR("\233t\233u"); // reset window size (CSI t CSI u)
|
||||||
}
|
}
|
||||||
out_flush();
|
out_flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_TITLE
|
#ifdef FEAT_TITLE
|
||||||
mch_restore_title(SAVE_RESTORE_BOTH); /* restore window title */
|
mch_restore_title(SAVE_RESTORE_BOTH); // restore window title
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ml_close_all(TRUE); /* remove all memfiles */
|
ml_close_all(TRUE); // remove all memfiles
|
||||||
|
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
if (ArpBase)
|
if (ArpBase)
|
||||||
@@ -950,7 +947,7 @@ mch_exit(int r)
|
|||||||
if (close_win)
|
if (close_win)
|
||||||
Close(raw_in);
|
Close(raw_in);
|
||||||
if (r)
|
if (r)
|
||||||
printf(_("Vim exiting with %d\n"), r); /* somehow this makes :cq work!? */
|
printf(_("Vim exiting with %d\n"), r); // somehow this makes :cq work!?
|
||||||
exit(r);
|
exit(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1027,10 +1024,10 @@ mch_get_shellsize(void)
|
|||||||
#endif
|
#endif
|
||||||
struct InfoData *id=0;
|
struct InfoData *id=0;
|
||||||
|
|
||||||
if (!term_console) /* not an amiga window */
|
if (!term_console) // not an amiga window
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* insure longword alignment */
|
// insure longword alignment
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
if (!(id = AllocDosObject(DOS_INFODATA, 0)))
|
if (!(id = AllocDosObject(DOS_INFODATA, 0)))
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1044,7 +1041,7 @@ mch_get_shellsize(void)
|
|||||||
* is rarely needed, so we skip it now, unless we changed the size.
|
* is rarely needed, so we skip it now, unless we changed the size.
|
||||||
*/
|
*/
|
||||||
if (size_set)
|
if (size_set)
|
||||||
OUT_STR("\233t\233u"); /* CSI t CSI u */
|
OUT_STR("\233t\233u"); // CSI t CSI u
|
||||||
out_flush();
|
out_flush();
|
||||||
|
|
||||||
#ifdef __AROS__
|
#ifdef __AROS__
|
||||||
@@ -1055,8 +1052,8 @@ mch_get_shellsize(void)
|
|||||||
|| (wb_window = (struct Window *)id->id_VolumeNode) == NULL)
|
|| (wb_window = (struct Window *)id->id_VolumeNode) == NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* it's not an amiga window, maybe aux device */
|
// it's not an amiga window, maybe aux device
|
||||||
/* terminal type should be set */
|
// terminal type should be set
|
||||||
term_console = FALSE;
|
term_console = FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -1069,10 +1066,10 @@ mch_get_shellsize(void)
|
|||||||
}
|
}
|
||||||
conUnit = (struct ConUnit *) ((struct IOStdReq *) id->id_InUse)->io_Unit;
|
conUnit = (struct ConUnit *) ((struct IOStdReq *) id->id_InUse)->io_Unit;
|
||||||
|
|
||||||
/* get window size */
|
// get window size
|
||||||
Rows = conUnit->cu_YMax + 1;
|
Rows = conUnit->cu_YMax + 1;
|
||||||
Columns = conUnit->cu_XMax + 1;
|
Columns = conUnit->cu_XMax + 1;
|
||||||
if (Rows < 0 || Rows > 200) /* cannot be an amiga window */
|
if (Rows < 0 || Rows > 200) // cannot be an amiga window
|
||||||
{
|
{
|
||||||
Columns = 80;
|
Columns = 80;
|
||||||
Rows = 24;
|
Rows = 24;
|
||||||
@@ -1083,7 +1080,7 @@ mch_get_shellsize(void)
|
|||||||
return OK;
|
return OK;
|
||||||
out:
|
out:
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
FreeDosObject(DOS_INFODATA, id); /* Safe to pass NULL */
|
FreeDosObject(DOS_INFODATA, id); // Safe to pass NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -1114,7 +1111,7 @@ mch_set_shellsize(void)
|
|||||||
void
|
void
|
||||||
mch_new_shellsize(void)
|
mch_new_shellsize(void)
|
||||||
{
|
{
|
||||||
/* Nothing to do. */
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1139,8 +1136,8 @@ out_num(long n)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PROTO
|
#ifndef PROTO
|
||||||
/* #include <proto/exec.h> */
|
// #include <proto/exec.h>
|
||||||
/* #include <proto/dos.h> */
|
// #include <proto/dos.h>
|
||||||
# include <exec/memory.h>
|
# include <exec/memory.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1152,9 +1149,9 @@ out_num(long n)
|
|||||||
|
|
||||||
static long
|
static long
|
||||||
dos_packet(
|
dos_packet(
|
||||||
struct MsgPort *pid, /* process identifier ... (handlers message port) */
|
struct MsgPort *pid, // process identifier ... (handlers message port)
|
||||||
long action, /* packet type ... (what you want handler to do) */
|
long action, // packet type ... (what you want handler to do)
|
||||||
long arg) /* single argument */
|
long arg) // single argument
|
||||||
{
|
{
|
||||||
# ifdef FEAT_ARP
|
# ifdef FEAT_ARP
|
||||||
struct MsgPort *replyport;
|
struct MsgPort *replyport;
|
||||||
@@ -1163,14 +1160,14 @@ dos_packet(
|
|||||||
|
|
||||||
if (dos2)
|
if (dos2)
|
||||||
# endif
|
# endif
|
||||||
return DoPkt(pid, action, arg, 0L, 0L, 0L, 0L); /* use 2.0 function */
|
return DoPkt(pid, action, arg, 0L, 0L, 0L, 0L); // use 2.0 function
|
||||||
# ifdef FEAT_ARP
|
# ifdef FEAT_ARP
|
||||||
|
|
||||||
replyport = (struct MsgPort *) CreatePort(NULL, 0); /* use arp function */
|
replyport = (struct MsgPort *) CreatePort(NULL, 0); // use arp function
|
||||||
if (!replyport)
|
if (!replyport)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
/* Allocate space for a packet, make it public and clear it */
|
// Allocate space for a packet, make it public and clear it
|
||||||
packet = (struct StandardPacket *)
|
packet = (struct StandardPacket *)
|
||||||
AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR);
|
AllocMem((long) sizeof(struct StandardPacket), MEMF_PUBLIC | MEMF_CLEAR);
|
||||||
if (!packet) {
|
if (!packet) {
|
||||||
@@ -1183,7 +1180,7 @@ dos_packet(
|
|||||||
packet->sp_Pkt.dp_Type = action;
|
packet->sp_Pkt.dp_Type = action;
|
||||||
packet->sp_Pkt.dp_Arg1 = arg;
|
packet->sp_Pkt.dp_Arg1 = arg;
|
||||||
|
|
||||||
PutMsg(pid, (struct Message *)packet); /* send packet */
|
PutMsg(pid, (struct Message *)packet); // send packet
|
||||||
|
|
||||||
WaitPort(replyport);
|
WaitPort(replyport);
|
||||||
GetMsg(replyport);
|
GetMsg(replyport);
|
||||||
@@ -1196,7 +1193,7 @@ dos_packet(
|
|||||||
return (res1);
|
return (res1);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
#endif /* !defined(AZTEC_C) && !defined(__AROS__) */
|
#endif // !defined(AZTEC_C) && !defined(__AROS__)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call shell.
|
* Call shell.
|
||||||
@@ -1205,7 +1202,7 @@ dos_packet(
|
|||||||
int
|
int
|
||||||
mch_call_shell(
|
mch_call_shell(
|
||||||
char_u *cmd,
|
char_u *cmd,
|
||||||
int options) /* SHELL_*, see vim.h */
|
int options) // SHELL_*, see vim.h
|
||||||
{
|
{
|
||||||
BPTR mydir;
|
BPTR mydir;
|
||||||
int x;
|
int x;
|
||||||
@@ -1219,20 +1216,20 @@ mch_call_shell(
|
|||||||
|
|
||||||
if (close_win)
|
if (close_win)
|
||||||
{
|
{
|
||||||
/* if Vim opened a window: Executing a shell may cause crashes */
|
// if Vim opened a window: Executing a shell may cause crashes
|
||||||
emsg(_("E360: Cannot execute shell with -f option"));
|
emsg(_("E360: Cannot execute shell with -f option"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (term_console)
|
if (term_console)
|
||||||
win_resize_off(); /* window resize events de-activated */
|
win_resize_off(); // window resize events de-activated
|
||||||
out_flush();
|
out_flush();
|
||||||
|
|
||||||
if (options & SHELL_COOKED)
|
if (options & SHELL_COOKED)
|
||||||
settmode(TMODE_COOK); /* set to normal mode */
|
settmode(TMODE_COOK); // set to normal mode
|
||||||
mydir = Lock((UBYTE *)"", (long)ACCESS_READ); /* remember current dir */
|
mydir = Lock((UBYTE *)"", (long)ACCESS_READ); // remember current dir
|
||||||
|
|
||||||
#if !defined(AZTEC_C) /* not tested very much */
|
#if !defined(AZTEC_C) // not tested very much
|
||||||
if (cmd == NULL)
|
if (cmd == NULL)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_ARP
|
# ifdef FEAT_ARP
|
||||||
@@ -1289,7 +1286,7 @@ mch_call_shell(
|
|||||||
retval = x;
|
retval = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else /* else part is for AZTEC_C */
|
#else // else part is for AZTEC_C
|
||||||
if (p_st >= 4 || (p_st >= 2 && !(options & SHELL_FILTER)))
|
if (p_st >= 4 || (p_st >= 2 && !(options & SHELL_FILTER)))
|
||||||
use_execute = 1;
|
use_execute = 1;
|
||||||
else
|
else
|
||||||
@@ -1300,11 +1297,11 @@ mch_call_shell(
|
|||||||
* separate shell name from argument
|
* separate shell name from argument
|
||||||
*/
|
*/
|
||||||
shellcmd = vim_strsave(p_sh);
|
shellcmd = vim_strsave(p_sh);
|
||||||
if (shellcmd == NULL) /* out of memory, use Execute */
|
if (shellcmd == NULL) // out of memory, use Execute
|
||||||
use_execute = 1;
|
use_execute = 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
shellarg = skiptowhite(shellcmd); /* find start of arguments */
|
shellarg = skiptowhite(shellcmd); // find start of arguments
|
||||||
if (*shellarg != NUL)
|
if (*shellarg != NUL)
|
||||||
{
|
{
|
||||||
*shellarg++ = NUL;
|
*shellarg++ = NUL;
|
||||||
@@ -1392,17 +1389,17 @@ mch_call_shell(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
vim_free(shellcmd);
|
vim_free(shellcmd);
|
||||||
#endif /* AZTEC_C */
|
#endif // AZTEC_C
|
||||||
|
|
||||||
if ((mydir = CurrentDir(mydir)) != 0) /* make sure we stay in the same directory */
|
if ((mydir = CurrentDir(mydir)) != 0) // make sure we stay in the same directory
|
||||||
UnLock(mydir);
|
UnLock(mydir);
|
||||||
if (tmode == TMODE_RAW)
|
if (tmode == TMODE_RAW)
|
||||||
settmode(TMODE_RAW); /* set to raw mode */
|
settmode(TMODE_RAW); // set to raw mode
|
||||||
#ifdef FEAT_TITLE
|
#ifdef FEAT_TITLE
|
||||||
resettitle();
|
resettitle();
|
||||||
#endif
|
#endif
|
||||||
if (term_console)
|
if (term_console)
|
||||||
win_resize_on(); /* window resize events activated */
|
win_resize_on(); // window resize events activated
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1418,9 +1415,9 @@ mch_breakcheck(int force)
|
|||||||
got_int = TRUE;
|
got_int = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this routine causes manx to use this Chk_Abort() rather than its own */
|
// this routine causes manx to use this Chk_Abort() rather than its own
|
||||||
/* otherwise it resets our ^C when doing any I/O (even when Enable_Abort */
|
// otherwise it resets our ^C when doing any I/O (even when Enable_Abort
|
||||||
/* is zero). Since we want to check for our own ^C's */
|
// is zero). Since we want to check for our own ^C's
|
||||||
|
|
||||||
#ifdef _DCC
|
#ifdef _DCC
|
||||||
#define Chk_Abort chkabort
|
#define Chk_Abort chkabort
|
||||||
@@ -1464,7 +1461,7 @@ Chk_Abort(void)
|
|||||||
mch_expandpath(
|
mch_expandpath(
|
||||||
garray_T *gap,
|
garray_T *gap,
|
||||||
char_u *pat,
|
char_u *pat,
|
||||||
int flags) /* EW_* flags */
|
int flags) // EW_* flags
|
||||||
{
|
{
|
||||||
struct AnchorPath *Anchor;
|
struct AnchorPath *Anchor;
|
||||||
LONG Result;
|
LONG Result;
|
||||||
@@ -1481,7 +1478,7 @@ mch_expandpath(
|
|||||||
|
|
||||||
start_len = gap->ga_len;
|
start_len = gap->ga_len;
|
||||||
|
|
||||||
/* Get our AnchorBase */
|
// Get our AnchorBase
|
||||||
#ifdef __amigaos4__
|
#ifdef __amigaos4__
|
||||||
Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
|
Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags);
|
||||||
#else
|
#else
|
||||||
@@ -1491,11 +1488,11 @@ mch_expandpath(
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifndef __amigaos4__
|
#ifndef __amigaos4__
|
||||||
Anchor->ap_Strlen = ANCHOR_BUF_SIZE; /* ap_Length not supported anymore */
|
Anchor->ap_Strlen = ANCHOR_BUF_SIZE; // ap_Length not supported anymore
|
||||||
# ifdef APF_DODOT
|
# ifdef APF_DODOT
|
||||||
Anchor->ap_Flags = APF_DODOT | APF_DOWILD; /* allow '.' for current dir */
|
Anchor->ap_Flags = APF_DODOT | APF_DOWILD; // allow '.' for current dir
|
||||||
# else
|
# else
|
||||||
Anchor->ap_Flags = APF_DoDot | APF_DoWild; /* allow '.' for current dir */
|
Anchor->ap_Flags = APF_DoDot | APF_DoWild; // allow '.' for current dir
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1503,7 +1500,7 @@ mch_expandpath(
|
|||||||
if (dos2)
|
if (dos2)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
/* hack to replace '*' by '#?' */
|
// hack to replace '*' by '#?'
|
||||||
starbuf = alloc(2 * STRLEN(pat) + 1);
|
starbuf = alloc(2 * STRLEN(pat) + 1);
|
||||||
if (starbuf == NULL)
|
if (starbuf == NULL)
|
||||||
goto Return;
|
goto Return;
|
||||||
@@ -1561,7 +1558,7 @@ mch_expandpath(
|
|||||||
qsort((void *)(((char_u **)gap->ga_data) + start_len),
|
qsort((void *)(((char_u **)gap->ga_data) + start_len),
|
||||||
(size_t)matches, sizeof(char_u *), sortcmp);
|
(size_t)matches, sizeof(char_u *), sortcmp);
|
||||||
|
|
||||||
/* Free the wildcard stuff */
|
// Free the wildcard stuff
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
if (dos2)
|
if (dos2)
|
||||||
#endif
|
#endif
|
||||||
@@ -1638,9 +1635,9 @@ mch_has_wildcard(char_u *p)
|
|||||||
mch_getenv(char_u *var)
|
mch_getenv(char_u *var)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
UBYTE *buf; /* buffer to expand in */
|
UBYTE *buf; // buffer to expand in
|
||||||
char_u *retval; /* return value */
|
char_u *retval; // return value
|
||||||
static char_u *alloced = NULL; /* allocated memory */
|
static char_u *alloced = NULL; // allocated memory
|
||||||
|
|
||||||
#ifdef FEAT_ARP
|
#ifdef FEAT_ARP
|
||||||
if (!dos2)
|
if (!dos2)
|
||||||
@@ -1665,7 +1662,7 @@ mch_getenv(char_u *var)
|
|||||||
vim_free(buf);
|
vim_free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if $VIM is not defined, use "vim:" instead */
|
// if $VIM is not defined, use "vim:" instead
|
||||||
if (retval == NULL && STRCMP(var, "VIM") == 0)
|
if (retval == NULL && STRCMP(var, "VIM") == 0)
|
||||||
retval = (char_u *)"vim:";
|
retval = (char_u *)"vim:";
|
||||||
|
|
||||||
@@ -1675,7 +1672,7 @@ mch_getenv(char_u *var)
|
|||||||
/*
|
/*
|
||||||
* Amiga version of setenv() with AmigaDOS 2.0 support.
|
* Amiga version of setenv() with AmigaDOS 2.0 support.
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
// ARGSUSED
|
||||||
int
|
int
|
||||||
mch_setenv(char *var, char *value, int x)
|
mch_setenv(char *var, char *value, int x)
|
||||||
{
|
{
|
||||||
@@ -1685,6 +1682,6 @@ mch_setenv(char *var, char *value, int x)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (SetVar((UBYTE *)var, (UBYTE *)value, (LONG)-1, (ULONG)GVF_LOCAL_ONLY))
|
if (SetVar((UBYTE *)var, (UBYTE *)value, (LONG)-1, (ULONG)GVF_LOCAL_ONLY))
|
||||||
return 0; /* success */
|
return 0; // success
|
||||||
return -1; /* failure */
|
return -1; // failure
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
|
#if USE_THREAD_FOR_INPUT_WITH_TIMEOUT
|
||||||
|
|
||||||
#ifdef PROTO /* making prototypes on Unix */
|
#ifdef PROTO // making prototypes on Unix
|
||||||
#define sem_id int
|
#define sem_id int
|
||||||
#define thread_id int
|
#define thread_id int
|
||||||
#endif
|
#endif
|
||||||
@@ -32,7 +32,7 @@ sem_id character_present;
|
|||||||
sem_id character_wanted;
|
sem_id character_wanted;
|
||||||
thread_id read_thread_id;
|
thread_id read_thread_id;
|
||||||
|
|
||||||
#define TRY_ABORT 0 /* This code does not work so turn it off. */
|
#define TRY_ABORT 0 // This code does not work so turn it off.
|
||||||
|
|
||||||
#if TRY_ABORT
|
#if TRY_ABORT
|
||||||
static void
|
static void
|
||||||
@@ -89,7 +89,7 @@ beos_select(int nbits,
|
|||||||
bigtime_t tmo;
|
bigtime_t tmo;
|
||||||
|
|
||||||
if (nbits == 0) {
|
if (nbits == 0) {
|
||||||
/* select is purely being used for delay */
|
// select is purely being used for delay
|
||||||
snooze(timeout->tv_sec * 1e6 + timeout->tv_usec);
|
snooze(timeout->tv_sec * 1e6 + timeout->tv_usec);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -140,10 +140,10 @@ beos_select(int nbits,
|
|||||||
resume_thread(read_thread_id);
|
resume_thread(read_thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* timeout == NULL means "indefinitely" */
|
// timeout == NULL means "indefinitely"
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
tmo = timeout->tv_sec * 1e6 + timeout->tv_usec;
|
tmo = timeout->tv_sec * 1e6 + timeout->tv_usec;
|
||||||
/* 0 means "don't wait, which is impossible to do exactly. */
|
// 0 means "don't wait, which is impossible to do exactly.
|
||||||
if (tmo == 0)
|
if (tmo == 0)
|
||||||
tmo = 1.0;
|
tmo = 1.0;
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#if defined(MACOS_CONVERT) || defined(PROTO)
|
#if defined(MACOS_CONVERT) || defined(PROTO)
|
||||||
|
|
||||||
# ifdef PROTO
|
# ifdef PROTO
|
||||||
/* A few dummy types to be able to generate function prototypes. */
|
// A few dummy types to be able to generate function prototypes.
|
||||||
typedef int UniChar;
|
typedef int UniChar;
|
||||||
typedef int *TECObjectRef;
|
typedef int *TECObjectRef;
|
||||||
typedef int CFStringRef;
|
typedef int CFStringRef;
|
||||||
@@ -34,9 +34,9 @@ typedef int CFStringRef;
|
|||||||
static char_u *mac_utf16_to_utf8(UniChar *from, size_t fromLen, size_t *actualLen);
|
static char_u *mac_utf16_to_utf8(UniChar *from, size_t fromLen, size_t *actualLen);
|
||||||
static UniChar *mac_utf8_to_utf16(char_u *from, size_t fromLen, size_t *actualLen);
|
static UniChar *mac_utf8_to_utf16(char_u *from, size_t fromLen, size_t *actualLen);
|
||||||
|
|
||||||
/* Converter for composing decomposed HFS+ file paths */
|
// Converter for composing decomposed HFS+ file paths
|
||||||
static TECObjectRef gPathConverter;
|
static TECObjectRef gPathConverter;
|
||||||
/* Converter used by mac_utf16_to_utf8 */
|
// Converter used by mac_utf16_to_utf8
|
||||||
static TECObjectRef gUTF16ToUTF8Converter;
|
static TECObjectRef gUTF16ToUTF8Converter;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -79,9 +79,9 @@ mac_string_convert(
|
|||||||
|
|
||||||
if (cfstr == NULL)
|
if (cfstr == NULL)
|
||||||
fprintf(stderr, "Encoding failed\n");
|
fprintf(stderr, "Encoding failed\n");
|
||||||
/* When conversion failed, try excluding bytes from the end, helps when
|
// When conversion failed, try excluding bytes from the end, helps when
|
||||||
* there is an incomplete byte sequence. Only do up to 6 bytes to avoid
|
// there is an incomplete byte sequence. Only do up to 6 bytes to avoid
|
||||||
* looping a long time when there really is something unconvertible. */
|
// looping a long time when there really is something unconvertible.
|
||||||
while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
|
while (cfstr == NULL && unconvlenp != NULL && len > 1 && *unconvlenp < 6)
|
||||||
{
|
{
|
||||||
--len;
|
--len;
|
||||||
@@ -104,7 +104,7 @@ mac_string_convert(
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
CFRange convertRange = CFRangeMake(0, CFStringGetLength(cfstr));
|
CFRange convertRange = CFRangeMake(0, CFStringGetLength(cfstr));
|
||||||
/* Determine output buffer size */
|
// Determine output buffer size
|
||||||
CFStringGetBytes(cfstr, convertRange, to, NULL, FALSE, NULL, 0, (CFIndex *)&buflen);
|
CFStringGetBytes(cfstr, convertRange, to, NULL, FALSE, NULL, 0, (CFIndex *)&buflen);
|
||||||
retval = (buflen > 0) ? alloc(buflen) : NULL;
|
retval = (buflen > 0) ? alloc(buflen) : NULL;
|
||||||
if (retval == NULL) {
|
if (retval == NULL) {
|
||||||
@@ -127,8 +127,8 @@ mac_string_convert(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Trying char-by-char conversion...\n");
|
fprintf(stderr, "Trying char-by-char conversion...\n");
|
||||||
/* conversion failed for the whole string, but maybe it will work
|
// conversion failed for the whole string, but maybe it will work
|
||||||
* for each character */
|
// for each character
|
||||||
for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
|
for (d = retval, in = 0, out = 0; in < len && out < buflen - 1;)
|
||||||
{
|
{
|
||||||
if (from == kCFStringEncodingUTF8)
|
if (from == kCFStringEncodingUTF8)
|
||||||
@@ -188,8 +188,8 @@ macroman2enc(
|
|||||||
CFRange r;
|
CFRange r;
|
||||||
CFIndex len = *sizep;
|
CFIndex len = *sizep;
|
||||||
|
|
||||||
/* MacRoman is an 8-bit encoding, no need to move bytes to
|
// MacRoman is an 8-bit encoding, no need to move bytes to
|
||||||
* conv_rest[]. */
|
// conv_rest[].
|
||||||
cfstr = CFStringCreateWithBytes(NULL, ptr, len,
|
cfstr = CFStringCreateWithBytes(NULL, ptr, len,
|
||||||
kCFStringEncodingMacRoman, 0);
|
kCFStringEncodingMacRoman, 0);
|
||||||
/*
|
/*
|
||||||
@@ -203,8 +203,8 @@ macroman2enc(
|
|||||||
r.length = CFStringGetLength(cfstr);
|
r.length = CFStringGetLength(cfstr);
|
||||||
if (r.length != CFStringGetBytes(cfstr, r,
|
if (r.length != CFStringGetBytes(cfstr, r,
|
||||||
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
(enc_utf8) ? kCFStringEncodingUTF8 : kCFStringEncodingISOLatin1,
|
||||||
0, /* no lossy conversion */
|
0, // no lossy conversion
|
||||||
0, /* not external representation */
|
0, // not external representation
|
||||||
ptr + *sizep, real_size - *sizep, &len))
|
ptr + *sizep, real_size - *sizep, &len))
|
||||||
{
|
{
|
||||||
CFRelease(cfstr);
|
CFRelease(cfstr);
|
||||||
@@ -256,9 +256,9 @@ enc2macroman(
|
|||||||
r.length = CFStringGetLength(cfstr);
|
r.length = CFStringGetLength(cfstr);
|
||||||
if (r.length != CFStringGetBytes(cfstr, r,
|
if (r.length != CFStringGetBytes(cfstr, r,
|
||||||
kCFStringEncodingMacRoman,
|
kCFStringEncodingMacRoman,
|
||||||
0, /* no lossy conversion */
|
0, // no lossy conversion
|
||||||
0, /* not external representation (since vim
|
0, // not external representation (since vim
|
||||||
* handles this internally */
|
// handles this internally
|
||||||
to, maxtolen, &l))
|
to, maxtolen, &l))
|
||||||
{
|
{
|
||||||
CFRelease(cfstr);
|
CFRelease(cfstr);
|
||||||
@@ -296,8 +296,8 @@ mac_conv_init(void)
|
|||||||
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
|
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
|
||||||
utf8_canon_encoding) != noErr)
|
utf8_canon_encoding) != noErr)
|
||||||
{
|
{
|
||||||
/* On pre-10.3, Unicode normalization is not available so
|
// On pre-10.3, Unicode normalization is not available so
|
||||||
* fall back to non-normalizing converter */
|
// fall back to non-normalizing converter
|
||||||
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
|
if (TECCreateConverter(&gUTF16ToUTF8Converter, utf16_encoding,
|
||||||
utf8_encoding) != noErr)
|
utf8_encoding) != noErr)
|
||||||
gUTF16ToUTF8Converter = NULL;
|
gUTF16ToUTF8Converter = NULL;
|
||||||
@@ -334,30 +334,30 @@ mac_utf16_to_enc(
|
|||||||
size_t fromLen,
|
size_t fromLen,
|
||||||
size_t *actualLen)
|
size_t *actualLen)
|
||||||
{
|
{
|
||||||
/* Following code borrows somewhat from os_mswin.c */
|
// Following code borrows somewhat from os_mswin.c
|
||||||
vimconv_T conv;
|
vimconv_T conv;
|
||||||
size_t utf8_len;
|
size_t utf8_len;
|
||||||
char_u *utf8_str;
|
char_u *utf8_str;
|
||||||
char_u *result = NULL;
|
char_u *result = NULL;
|
||||||
|
|
||||||
/* Convert to utf-8 first, works better with iconv */
|
// Convert to utf-8 first, works better with iconv
|
||||||
utf8_len = 0;
|
utf8_len = 0;
|
||||||
utf8_str = mac_utf16_to_utf8(from, fromLen, &utf8_len);
|
utf8_str = mac_utf16_to_utf8(from, fromLen, &utf8_len);
|
||||||
|
|
||||||
if (utf8_str)
|
if (utf8_str)
|
||||||
{
|
{
|
||||||
/* We might be called before we have p_enc set up. */
|
// We might be called before we have p_enc set up.
|
||||||
conv.vc_type = CONV_NONE;
|
conv.vc_type = CONV_NONE;
|
||||||
|
|
||||||
/* If encoding (p_enc) is any unicode, it is actually in utf-8 (vim
|
// If encoding (p_enc) is any unicode, it is actually in utf-8 (vim
|
||||||
* internal unicode is always utf-8) so don't convert in such cases */
|
// internal unicode is always utf-8) so don't convert in such cases
|
||||||
|
|
||||||
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0)
|
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0)
|
||||||
convert_setup(&conv, (char_u *)"utf-8",
|
convert_setup(&conv, (char_u *)"utf-8",
|
||||||
p_enc? p_enc: (char_u *)"macroman");
|
p_enc? p_enc: (char_u *)"macroman");
|
||||||
if (conv.vc_type == CONV_NONE)
|
if (conv.vc_type == CONV_NONE)
|
||||||
{
|
{
|
||||||
/* p_enc is utf-8, so we're done. */
|
// p_enc is utf-8, so we're done.
|
||||||
result = utf8_str;
|
result = utf8_str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -388,7 +388,7 @@ mac_enc_to_utf16(
|
|||||||
size_t fromLen,
|
size_t fromLen,
|
||||||
size_t *actualLen)
|
size_t *actualLen)
|
||||||
{
|
{
|
||||||
/* Following code borrows somewhat from os_mswin.c */
|
// Following code borrows somewhat from os_mswin.c
|
||||||
vimconv_T conv;
|
vimconv_T conv;
|
||||||
size_t utf8_len;
|
size_t utf8_len;
|
||||||
char_u *utf8_str;
|
char_u *utf8_str;
|
||||||
@@ -397,9 +397,9 @@ mac_enc_to_utf16(
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
/* Use MacRoman by default, we might be called before we have p_enc
|
// Use MacRoman by default, we might be called before we have p_enc
|
||||||
* set up. Convert to utf-8 first, works better with iconv(). Does
|
// set up. Convert to utf-8 first, works better with iconv(). Does
|
||||||
* nothing if 'encoding' is "utf-8". */
|
// nothing if 'encoding' is "utf-8".
|
||||||
conv.vc_type = CONV_NONE;
|
conv.vc_type = CONV_NONE;
|
||||||
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0 &&
|
if ((enc_canon_props(p_enc) & ENC_UNICODE) == 0 &&
|
||||||
convert_setup(&conv, p_enc ? p_enc : (char_u *)"macroman",
|
convert_setup(&conv, p_enc ? p_enc : (char_u *)"macroman",
|
||||||
@@ -583,4 +583,4 @@ mac_lang_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* MACOS_CONVERT */
|
#endif // MACOS_CONVERT
|
||||||
|
452
src/os_mswin.c
452
src/os_mswin.c
File diff suppressed because it is too large
Load Diff
18
src/os_qnx.c
18
src/os_qnx.c
@@ -36,17 +36,17 @@ void qnx_init(void)
|
|||||||
#define CLIP_TYPE_VIM "VIMTYPE"
|
#define CLIP_TYPE_VIM "VIMTYPE"
|
||||||
#define CLIP_TYPE_TEXT "TEXT"
|
#define CLIP_TYPE_TEXT "TEXT"
|
||||||
|
|
||||||
/* Turn on the clipboard for a console vim when photon is running */
|
// Turn on the clipboard for a console vim when photon is running
|
||||||
void qnx_clip_init(void)
|
void qnx_clip_init(void)
|
||||||
{
|
{
|
||||||
if (is_photon_available == TRUE && !gui.in_use)
|
if (is_photon_available == TRUE && !gui.in_use)
|
||||||
clip_init(TRUE);
|
clip_init(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/* Clipboard */
|
// Clipboard
|
||||||
|
|
||||||
/* No support for owning the clipboard */
|
// No support for owning the clipboard
|
||||||
int
|
int
|
||||||
clip_mch_own_selection(Clipboard_T *cbd)
|
clip_mch_own_selection(Clipboard_T *cbd)
|
||||||
{
|
{
|
||||||
@@ -69,13 +69,13 @@ clip_mch_request_selection(Clipboard_T *cbd)
|
|||||||
cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
|
cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
|
||||||
if (cbdata != NULL)
|
if (cbdata != NULL)
|
||||||
{
|
{
|
||||||
/* Look for the vim specific clip first */
|
// Look for the vim specific clip first
|
||||||
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
|
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
|
||||||
if (clip_header != NULL && clip_header->data != NULL)
|
if (clip_header != NULL && clip_header->data != NULL)
|
||||||
{
|
{
|
||||||
switch(*(char *) clip_header->data)
|
switch(*(char *) clip_header->data)
|
||||||
{
|
{
|
||||||
default: /* fallthrough to line type */
|
default: // fallthrough to line type
|
||||||
case 'L': type = MLINE; break;
|
case 'L': type = MLINE; break;
|
||||||
case 'C': type = MCHAR; break;
|
case 'C': type = MCHAR; break;
|
||||||
case 'B': type = MBLOCK; break;
|
case 'B': type = MBLOCK; break;
|
||||||
@@ -83,7 +83,7 @@ clip_mch_request_selection(Clipboard_T *cbd)
|
|||||||
is_type_set = TRUE;
|
is_type_set = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try for just normal text */
|
// Try for just normal text
|
||||||
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
|
clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
|
||||||
if (clip_header != NULL)
|
if (clip_header != NULL)
|
||||||
{
|
{
|
||||||
@@ -109,7 +109,7 @@ clip_mch_set_selection(Clipboard_T *cbd)
|
|||||||
char_u *text_clip, vim_clip[2], *str = NULL;
|
char_u *text_clip, vim_clip[2], *str = NULL;
|
||||||
PhClipHeader clip_header[2];
|
PhClipHeader clip_header[2];
|
||||||
|
|
||||||
/* Prevent recursion from clip_get_selection() */
|
// Prevent recursion from clip_get_selection()
|
||||||
if (cbd->owned == TRUE)
|
if (cbd->owned == TRUE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ clip_mch_set_selection(Clipboard_T *cbd)
|
|||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
default: /* fallthrough to MLINE */
|
default: // fallthrough to MLINE
|
||||||
case MLINE: *vim_clip = 'L'; break;
|
case MLINE: *vim_clip = 'L'; break;
|
||||||
case MCHAR: *vim_clip = 'C'; break;
|
case MCHAR: *vim_clip = 'C'; break;
|
||||||
case MBLOCK: *vim_clip = 'B'; break;
|
case MBLOCK: *vim_clip = 'B'; break;
|
||||||
|
1353
src/os_unix.c
1353
src/os_unix.c
File diff suppressed because it is too large
Load Diff
193
src/os_vms.c
193
src/os_vms.c
@@ -11,19 +11,19 @@
|
|||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
/* define _generic_64 for use in time functions */
|
// define _generic_64 for use in time functions
|
||||||
#if !defined(VAX) && !defined(PROTO)
|
#if !defined(VAX) && !defined(PROTO)
|
||||||
# include <gen64def.h>
|
# include <gen64def.h>
|
||||||
#else
|
#else
|
||||||
/* based on Alpha's gen64def.h; the file is absent on VAX */
|
// based on Alpha's gen64def.h; the file is absent on VAX
|
||||||
typedef struct _generic_64 {
|
typedef struct _generic_64 {
|
||||||
# pragma __nomember_alignment
|
# pragma __nomember_alignment
|
||||||
__union { /* You can treat me as... */
|
__union { // You can treat me as...
|
||||||
/* long long is not available on VAXen */
|
// long long is not available on VAXen
|
||||||
/* unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or */
|
// unsigned __int64 gen64$q_quadword; ...a single 64-bit value, or
|
||||||
|
|
||||||
unsigned int gen64$l_longword [2]; /* ...two 32-bit values, or */
|
unsigned int gen64$l_longword [2]; // ...two 32-bit values, or
|
||||||
unsigned short int gen64$w_word [4]; /* ...four 16-bit values */
|
unsigned short int gen64$w_word [4]; // ...four 16-bit values
|
||||||
} gen64$r_quad_overlay;
|
} gen64$r_quad_overlay;
|
||||||
} GENERIC_64;
|
} GENERIC_64;
|
||||||
#endif
|
#endif
|
||||||
@@ -67,13 +67,13 @@ typedef struct
|
|||||||
} ITMLST2;
|
} ITMLST2;
|
||||||
|
|
||||||
static TT_MODE orgmode;
|
static TT_MODE orgmode;
|
||||||
static short iochan; /* TTY I/O channel */
|
static short iochan; // TTY I/O channel
|
||||||
static short iosb[4]; /* IO status block */
|
static short iosb[4]; // IO status block
|
||||||
|
|
||||||
static int vms_match_num = 0;
|
static int vms_match_num = 0;
|
||||||
static int vms_match_free = 0;
|
static int vms_match_free = 0;
|
||||||
static char_u **vms_fmatch = NULL;
|
static char_u **vms_fmatch = NULL;
|
||||||
static char *Fspec_Rms; /* rms file spec, passed implicitly between routines */
|
static char *Fspec_Rms; // rms file spec, passed implicitly between routines
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ mch_settmode(int tmode)
|
|||||||
set_tty(int row, int col)
|
set_tty(int row, int col)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
TT_MODE newmode; /* New TTY mode bits */
|
TT_MODE newmode; // New TTY mode bits
|
||||||
static short first_time = TRUE;
|
static short first_time = TRUE;
|
||||||
|
|
||||||
if (first_time)
|
if (first_time)
|
||||||
@@ -165,7 +165,7 @@ set_tty(int row, int col)
|
|||||||
get_tty(void)
|
get_tty(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
static $DESCRIPTOR(odsc,"SYS$OUTPUT"); /* output descriptor */
|
static $DESCRIPTOR(odsc,"SYS$OUTPUT"); // output descriptor
|
||||||
|
|
||||||
int status;
|
int status;
|
||||||
TT_MODE tt_mode;
|
TT_MODE tt_mode;
|
||||||
@@ -195,7 +195,7 @@ mch_get_shellsize(void)
|
|||||||
{
|
{
|
||||||
TT_MODE tmode;
|
TT_MODE tmode;
|
||||||
|
|
||||||
tmode = get_tty(); /* get size from VMS */
|
tmode = get_tty(); // get size from VMS
|
||||||
Columns = tmode.width;
|
Columns = tmode.width;
|
||||||
Rows = tmode.x.y.length;
|
Rows = tmode.x.y.length;
|
||||||
return OK;
|
return OK;
|
||||||
@@ -262,7 +262,7 @@ mch_setenv(char *var, char *value, int x)
|
|||||||
{
|
{
|
||||||
int res, dum;
|
int res, dum;
|
||||||
long attrib = 0L;
|
long attrib = 0L;
|
||||||
char acmode = PSL$C_SUPER; /* needs SYSNAM privilege */
|
char acmode = PSL$C_SUPER; // needs SYSNAM privilege
|
||||||
DESC tabnam, lognam;
|
DESC tabnam, lognam;
|
||||||
ITMLST1 itmlst;
|
ITMLST1 itmlst;
|
||||||
|
|
||||||
@@ -288,9 +288,9 @@ vms_sys(char *cmd, char *out, char *inp)
|
|||||||
if (inp)
|
if (inp)
|
||||||
vul_desc(&idsc, inp);
|
vul_desc(&idsc, inp);
|
||||||
|
|
||||||
lib$spawn(cmd ? &cdsc : NULL, /* command string */
|
lib$spawn(cmd ? &cdsc : NULL, // command string
|
||||||
inp ? &idsc : NULL, /* input file */
|
inp ? &idsc : NULL, // input file
|
||||||
out ? &odsc : NULL, /* output file */
|
out ? &odsc : NULL, // output file
|
||||||
0, 0, 0, &status, 0, 0, 0, 0, 0, 0);
|
0, 0, 0, &status, 0, 0, 0, 0, 0, 0);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ vms_tolower( char *name )
|
|||||||
vms_sys_status(int status)
|
vms_sys_status(int status)
|
||||||
{
|
{
|
||||||
if (status != SS$_NORMAL && (status & STS$M_SUCCESS) == 0)
|
if (status != SS$_NORMAL && (status & STS$M_SUCCESS) == 0)
|
||||||
return status; /* Command failed. */
|
return status; // Command failed.
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -329,35 +329,35 @@ vms_read(char *inbuf, size_t nbytes)
|
|||||||
{
|
{
|
||||||
int status, function, len;
|
int status, function, len;
|
||||||
TT_MODE tt_mode;
|
TT_MODE tt_mode;
|
||||||
ITEM itmlst[2]; /* terminates on everything */
|
ITEM itmlst[2]; // terminates on everything
|
||||||
static long trm_mask[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
|
static long trm_mask[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
|
||||||
|
|
||||||
/* whatever happened earlier we need an iochan here */
|
// whatever happened earlier we need an iochan here
|
||||||
if (!iochan)
|
if (!iochan)
|
||||||
tt_mode = get_tty();
|
tt_mode = get_tty();
|
||||||
|
|
||||||
/* important: clean the inbuf */
|
// important: clean the inbuf
|
||||||
memset(inbuf, 0, nbytes);
|
memset(inbuf, 0, nbytes);
|
||||||
|
|
||||||
/* set up the itemlist for the first read */
|
// set up the itemlist for the first read
|
||||||
vul_item(&itmlst[0], 0, TRM$_MODIFIERS,
|
vul_item(&itmlst[0], 0, TRM$_MODIFIERS,
|
||||||
(char *)( TRM$M_TM_NOECHO | TRM$M_TM_NOEDIT |
|
(char *)( TRM$M_TM_NOECHO | TRM$M_TM_NOEDIT |
|
||||||
TRM$M_TM_NOFILTR | TRM$M_TM_TRMNOECHO |
|
TRM$M_TM_NOFILTR | TRM$M_TM_TRMNOECHO |
|
||||||
TRM$M_TM_NORECALL) , 0);
|
TRM$M_TM_NORECALL) , 0);
|
||||||
vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0);
|
vul_item(&itmlst[1], sizeof(trm_mask), TRM$_TERM, (char *)&trm_mask, 0);
|
||||||
|
|
||||||
/* wait forever for a char */
|
// wait forever for a char
|
||||||
function = (IO$_READLBLK | IO$M_EXTEND);
|
function = (IO$_READLBLK | IO$M_EXTEND);
|
||||||
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
|
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
|
||||||
inbuf, nbytes-1, 0, 0, &itmlst, sizeof(itmlst));
|
inbuf, nbytes-1, 0, 0, &itmlst, sizeof(itmlst));
|
||||||
len = strlen(inbuf); /* how many chars we got? */
|
len = strlen(inbuf); // how many chars we got?
|
||||||
|
|
||||||
/* read immediately the rest in the IO queue */
|
// read immediately the rest in the IO queue
|
||||||
function = (IO$_READLBLK | IO$M_TIMED | IO$M_ESCAPE | IO$M_NOECHO | IO$M_NOFILTR);
|
function = (IO$_READLBLK | IO$M_TIMED | IO$M_ESCAPE | IO$M_NOECHO | IO$M_NOFILTR);
|
||||||
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
|
status = sys$qiow(0, iochan, function, &iosb, 0, 0,
|
||||||
inbuf+len, nbytes-1-len, 0, 0, 0, 0);
|
inbuf+len, nbytes-1-len, 0, 0, 0, 0);
|
||||||
|
|
||||||
len = strlen(inbuf); /* return the total length */
|
len = strlen(inbuf); // return the total length
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@@ -375,12 +375,12 @@ vms_wproc(char *name, int val)
|
|||||||
int i;
|
int i;
|
||||||
static int vms_match_alloced = 0;
|
static int vms_match_alloced = 0;
|
||||||
|
|
||||||
if (val == DECC$K_FOREIGN ) /* foreign non VMS files are not counting */
|
if (val == DECC$K_FOREIGN ) // foreign non VMS files are not counting
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* accept all DECC$K_FILE and DECC$K_DIRECTORY */
|
// accept all DECC$K_FILE and DECC$K_DIRECTORY
|
||||||
if (vms_match_num == 0) {
|
if (vms_match_num == 0) {
|
||||||
/* first time through, setup some things */
|
// first time through, setup some things
|
||||||
if (NULL == vms_fmatch) {
|
if (NULL == vms_fmatch) {
|
||||||
vms_fmatch = ALLOC_MULT(char_u *, EXPL_ALLOC_INC);
|
vms_fmatch = ALLOC_MULT(char_u *, EXPL_ALLOC_INC);
|
||||||
if (!vms_fmatch)
|
if (!vms_fmatch)
|
||||||
@@ -389,16 +389,16 @@ vms_wproc(char *name, int val)
|
|||||||
vms_match_free = EXPL_ALLOC_INC;
|
vms_match_free = EXPL_ALLOC_INC;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* re-use existing space */
|
// re-use existing space
|
||||||
vms_match_free = vms_match_alloced;
|
vms_match_free = vms_match_alloced;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make matches look uniform */
|
// make matches look uniform
|
||||||
vms_remove_version(name);
|
vms_remove_version(name);
|
||||||
name=vms_tolower(name);
|
name=vms_tolower(name);
|
||||||
|
|
||||||
/* if name already exists, don't add it */
|
// if name already exists, don't add it
|
||||||
for (i = 0; i<vms_match_num; i++) {
|
for (i = 0; i<vms_match_num; i++) {
|
||||||
if (0 == STRCMP((char_u *)name,vms_fmatch[i]))
|
if (0 == STRCMP((char_u *)name,vms_fmatch[i]))
|
||||||
return 1;
|
return 1;
|
||||||
@@ -406,7 +406,7 @@ vms_wproc(char *name, int val)
|
|||||||
if (--vms_match_free == 0) {
|
if (--vms_match_free == 0) {
|
||||||
char_u **old_vms_fmatch = vms_fmatch;
|
char_u **old_vms_fmatch = vms_fmatch;
|
||||||
|
|
||||||
/* add more space to store matches */
|
// add more space to store matches
|
||||||
vms_match_alloced += EXPL_ALLOC_INC;
|
vms_match_alloced += EXPL_ALLOC_INC;
|
||||||
vms_fmatch = vim_realloc(old_vms_fmatch,
|
vms_fmatch = vim_realloc(old_vms_fmatch,
|
||||||
sizeof(char **) * vms_match_alloced);
|
sizeof(char **) * vms_match_alloced);
|
||||||
@@ -445,7 +445,7 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
|
|||||||
int dir;
|
int dir;
|
||||||
int files_alloced, files_free;
|
int files_alloced, files_free;
|
||||||
|
|
||||||
*num_file = 0; /* default: no files found */
|
*num_file = 0; // default: no files found
|
||||||
files_alloced = EXPL_ALLOC_INC;
|
files_alloced = EXPL_ALLOC_INC;
|
||||||
files_free = EXPL_ALLOC_INC;
|
files_free = EXPL_ALLOC_INC;
|
||||||
*file = ALLOC_MULT(char_u *, files_alloced);
|
*file = ALLOC_MULT(char_u *, files_alloced);
|
||||||
@@ -456,13 +456,13 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
|
|||||||
}
|
}
|
||||||
for (i = 0; i < num_pat; i++)
|
for (i = 0; i < num_pat; i++)
|
||||||
{
|
{
|
||||||
/* expand environment var or home dir */
|
// expand environment var or home dir
|
||||||
if (vim_strchr(pat[i],'$') || vim_strchr(pat[i],'~'))
|
if (vim_strchr(pat[i],'$') || vim_strchr(pat[i],'~'))
|
||||||
expand_env(pat[i],buf,MAXPATHL);
|
expand_env(pat[i],buf,MAXPATHL);
|
||||||
else
|
else
|
||||||
STRCPY(buf,pat[i]);
|
STRCPY(buf,pat[i]);
|
||||||
|
|
||||||
vms_match_num = 0; /* reset collection counter */
|
vms_match_num = 0; // reset collection counter
|
||||||
result = decc$translate_vms(vms_fixfilename(buf));
|
result = decc$translate_vms(vms_fixfilename(buf));
|
||||||
if ( (int) result == 0 || (int) result == -1 ) {
|
if ( (int) result == 0 || (int) result == -1 ) {
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
@@ -477,21 +477,21 @@ mch_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file, i
|
|||||||
|
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
/* files should exist if expanding interactively */
|
// files should exist if expanding interactively
|
||||||
if (!(flags & EW_NOTFOUND) && mch_getperm(vms_fmatch[i]) < 0)
|
if (!(flags & EW_NOTFOUND) && mch_getperm(vms_fmatch[i]) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* do not include directories */
|
// do not include directories
|
||||||
dir = (mch_isdir(vms_fmatch[i]));
|
dir = (mch_isdir(vms_fmatch[i]));
|
||||||
if (( dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
|
if (( dir && !(flags & EW_DIR)) || (!dir && !(flags & EW_FILE)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Skip files that are not executable if we check for that. */
|
// Skip files that are not executable if we check for that.
|
||||||
if (!dir && (flags & EW_EXEC)
|
if (!dir && (flags & EW_EXEC)
|
||||||
&& !mch_can_exe(vms_fmatch[i], NULL, !(flags & EW_SHELLCMD)))
|
&& !mch_can_exe(vms_fmatch[i], NULL, !(flags & EW_SHELLCMD)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* allocate memory for pointers */
|
// allocate memory for pointers
|
||||||
if (--files_free < 1)
|
if (--files_free < 1)
|
||||||
{
|
{
|
||||||
char_u **old_file = *file;
|
char_u **old_file = *file;
|
||||||
@@ -521,8 +521,8 @@ mch_expandpath(garray_T *gap, char_u *path, int flags)
|
|||||||
char *result;
|
char *result;
|
||||||
|
|
||||||
vms_match_num = 0;
|
vms_match_num = 0;
|
||||||
/* the result from the decc$translate_vms needs to be handled */
|
// the result from the decc$translate_vms needs to be handled
|
||||||
/* otherwise it might create ACCVIO error in decc$to_vms */
|
// otherwise it might create ACCVIO error in decc$to_vms
|
||||||
result = decc$translate_vms(vms_fixfilename(path));
|
result = decc$translate_vms(vms_fixfilename(path));
|
||||||
if ( (int) result == 0 || (int) result == -1 ) {
|
if ( (int) result == 0 || (int) result == -1 ) {
|
||||||
cnt = 0;
|
cnt = 0;
|
||||||
@@ -533,7 +533,7 @@ mch_expandpath(garray_T *gap, char_u *path, int flags)
|
|||||||
cnt = vms_match_num;
|
cnt = vms_match_num;
|
||||||
for (i = 0; i < cnt; i++)
|
for (i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
if (mch_getperm(vms_fmatch[i]) >= 0) /* add existing file */
|
if (mch_getperm(vms_fmatch[i]) >= 0) // add existing file
|
||||||
addfile(gap, vms_fmatch[i], flags);
|
addfile(gap, vms_fmatch[i], flags);
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
@@ -551,10 +551,9 @@ vms_unix_mixed_filespec(char *in, char *out)
|
|||||||
int len;
|
int len;
|
||||||
char *out_str=out;
|
char *out_str=out;
|
||||||
|
|
||||||
/* copy vms filename portion up to last colon
|
// copy vms filename portion up to last colon
|
||||||
* (node and/or disk)
|
// (node and/or disk)
|
||||||
*/
|
lastcolon = strrchr(in, ':'); // find last colon
|
||||||
lastcolon = strrchr(in, ':'); /* find last colon */
|
|
||||||
if (lastcolon != NULL) {
|
if (lastcolon != NULL) {
|
||||||
len = lastcolon - in + 1;
|
len = lastcolon - in + 1;
|
||||||
strncpy(out, in, len);
|
strncpy(out, in, len);
|
||||||
@@ -562,49 +561,49 @@ vms_unix_mixed_filespec(char *in, char *out)
|
|||||||
in += len;
|
in += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
end_of_dir = NULL; /* default: no directory */
|
end_of_dir = NULL; // default: no directory
|
||||||
|
|
||||||
/* start of directory portion */
|
// start of directory portion
|
||||||
ch = *in;
|
ch = *in;
|
||||||
if ((ch == '[') || (ch == '/') || (ch == '<')) { /* start of directory(s) ? */
|
if ((ch == '[') || (ch == '/') || (ch == '<')) { // start of directory(s) ?
|
||||||
ch = '[';
|
ch = '[';
|
||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
} else if (EQN(in, "../", 3)) { /* Unix parent directory? */
|
} else if (EQN(in, "../", 3)) { // Unix parent directory?
|
||||||
*out++ = '[';
|
*out++ = '[';
|
||||||
*out++ = '-';
|
*out++ = '-';
|
||||||
end_of_dir = out;
|
end_of_dir = out;
|
||||||
ch = '.';
|
ch = '.';
|
||||||
in += 2;
|
in += 2;
|
||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
} else { /* not a special character */
|
} else { // not a special character
|
||||||
while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
|
while (EQN(in, "./", 2)) { // Ignore Unix "current dir"
|
||||||
in += 2;
|
in += 2;
|
||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
}
|
}
|
||||||
if (strchr(in, '/') == NULL) { /* any more Unix directories ? */
|
if (strchr(in, '/') == NULL) { // any more Unix directories ?
|
||||||
strcpy(out, in); /* No - get rest of the spec */
|
strcpy(out, in); // No - get rest of the spec
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
*out++ = '['; /* Yes, denote a Vms subdirectory */
|
*out++ = '['; // Yes, denote a Vms subdirectory
|
||||||
ch = '.';
|
ch = '.';
|
||||||
--in;
|
--in;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we get here, there is a directory part of the filename */
|
// if we get here, there is a directory part of the filename
|
||||||
|
|
||||||
/* initialize output file spec */
|
// initialize output file spec
|
||||||
*out++ = ch;
|
*out++ = ch;
|
||||||
++in;
|
++in;
|
||||||
|
|
||||||
while (*in != '\0') {
|
while (*in != '\0') {
|
||||||
ch = *in;
|
ch = *in;
|
||||||
if ((ch == ']') || (ch == '/') || (ch == '>') ) { /* end of (sub)directory ? */
|
if ((ch == ']') || (ch == '/') || (ch == '>') ) { // end of (sub)directory ?
|
||||||
end_of_dir = out;
|
end_of_dir = out;
|
||||||
ch = '.';
|
ch = '.';
|
||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
}
|
}
|
||||||
else if (EQN(in, "../", 3)) { /* Unix parent directory? */
|
else if (EQN(in, "../", 3)) { // Unix parent directory?
|
||||||
*out++ = '-';
|
*out++ = '-';
|
||||||
end_of_dir = out;
|
end_of_dir = out;
|
||||||
ch = '.';
|
ch = '.';
|
||||||
@@ -612,7 +611,7 @@ vms_unix_mixed_filespec(char *in, char *out)
|
|||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while (EQN(in, "./", 2)) { /* Ignore Unix "current dir" */
|
while (EQN(in, "./", 2)) { // Ignore Unix "current dir"
|
||||||
end_of_dir = out;
|
end_of_dir = out;
|
||||||
in += 2;
|
in += 2;
|
||||||
SKIP_FOLLOWING_SLASHES(in);
|
SKIP_FOLLOWING_SLASHES(in);
|
||||||
@@ -620,14 +619,14 @@ vms_unix_mixed_filespec(char *in, char *out)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Place next character into output file spec */
|
// Place next character into output file spec
|
||||||
*out++ = ch;
|
*out++ = ch;
|
||||||
++in;
|
++in;
|
||||||
}
|
}
|
||||||
|
|
||||||
*out = '\0'; /* Terminate output file spec */
|
*out = '\0'; // Terminate output file spec
|
||||||
|
|
||||||
if (end_of_dir != NULL) /* Terminate directory portion */
|
if (end_of_dir != NULL) // Terminate directory portion
|
||||||
*end_of_dir = ']';
|
*end_of_dir = ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,7 +650,7 @@ vms_fixfilename(void *instring)
|
|||||||
static size_t buflen = 0;
|
static size_t buflen = 0;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* get a big-enough buffer */
|
// get a big-enough buffer
|
||||||
len = strlen(instring) + 1;
|
len = strlen(instring) + 1;
|
||||||
if (len > buflen)
|
if (len > buflen)
|
||||||
{
|
{
|
||||||
@@ -665,22 +664,22 @@ vms_fixfilename(void *instring)
|
|||||||
strcpy(tmpbuf, instring);
|
strcpy(tmpbuf, instring);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Fspec_Rms = buf; /* for decc$to_vms */
|
Fspec_Rms = buf; // for decc$to_vms
|
||||||
|
|
||||||
if (strchr(instring,'/') == NULL)
|
if (strchr(instring,'/') == NULL)
|
||||||
/* It is already a VMS file spec */
|
// It is already a VMS file spec
|
||||||
strcpy(buf, instring);
|
strcpy(buf, instring);
|
||||||
else if (strchr(instring,'"') == NULL) /* password in the path? */
|
else if (strchr(instring,'"') == NULL) // password in the path?
|
||||||
{
|
{
|
||||||
/* Seems it is a regular file, let guess that it is pure Unix fspec */
|
// Seems it is a regular file, let guess that it is pure Unix fspec
|
||||||
if (decc$to_vms(instring, vms_fspec_proc, 0, 0) <= 0)
|
if (decc$to_vms(instring, vms_fspec_proc, 0, 0) <= 0)
|
||||||
/* No... it must be mixed */
|
// No... it must be mixed
|
||||||
vms_unix_mixed_filespec(instring, buf);
|
vms_unix_mixed_filespec(instring, buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* we have a password in the path */
|
// we have a password in the path
|
||||||
/* decc$ functions can not handle */
|
// decc$ functions can not handle
|
||||||
/* this is our only hope to resolv */
|
// this is our only hope to resolv
|
||||||
vms_unix_mixed_filespec(instring, buf);
|
vms_unix_mixed_filespec(instring, buf);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
@@ -697,7 +696,7 @@ vms_remove_version(void * fname)
|
|||||||
char_u *cp;
|
char_u *cp;
|
||||||
char_u *fp;
|
char_u *fp;
|
||||||
|
|
||||||
if ((cp = vim_strchr( fname, ';')) != NULL) /* remove version */
|
if ((cp = vim_strchr( fname, ';')) != NULL) // remove version
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
else if ((cp = vim_strrchr( fname, '.')) != NULL )
|
else if ((cp = vim_strrchr( fname, '.')) != NULL )
|
||||||
{
|
{
|
||||||
@@ -726,7 +725,7 @@ struct typeahead_st {
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
RealWaitForChar(
|
RealWaitForChar(
|
||||||
int fd UNUSED, /* always read from iochan */
|
int fd UNUSED, // always read from iochan
|
||||||
long msec,
|
long msec,
|
||||||
int *check_for_gpm UNUSED,
|
int *check_for_gpm UNUSED,
|
||||||
int *interrupted)
|
int *interrupted)
|
||||||
@@ -738,71 +737,71 @@ RealWaitForChar(
|
|||||||
unsigned int convert_operation = LIB$K_DELTA_SECONDS_F;
|
unsigned int convert_operation = LIB$K_DELTA_SECONDS_F;
|
||||||
float sec =(float) msec/1000;
|
float sec =(float) msec/1000;
|
||||||
|
|
||||||
/* make sure the iochan is set */
|
// make sure the iochan is set
|
||||||
if (!iochan)
|
if (!iochan)
|
||||||
get_tty();
|
get_tty();
|
||||||
|
|
||||||
if (sec > 0) {
|
if (sec > 0) {
|
||||||
/* time-out specified; convert it to absolute time */
|
// time-out specified; convert it to absolute time
|
||||||
/* sec>0 requirement of lib$cvtf_to_internal_time()*/
|
// sec>0 requirement of lib$cvtf_to_internal_time()
|
||||||
|
|
||||||
/* get current time (number of 100ns ticks since the VMS Epoch) */
|
// get current time (number of 100ns ticks since the VMS Epoch)
|
||||||
status = sys$gettim(&time_curr);
|
status = sys$gettim(&time_curr);
|
||||||
if (status != SS$_NORMAL)
|
if (status != SS$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; // error
|
||||||
/* construct the delta time */
|
// construct the delta time
|
||||||
#if __G_FLOAT==0
|
#if __G_FLOAT==0
|
||||||
# ifndef VAX
|
# ifndef VAX
|
||||||
/* IEEE is default on IA64, but can be used on Alpha too - but not on VAX */
|
// IEEE is default on IA64, but can be used on Alpha too - but not on VAX
|
||||||
status = lib$cvts_to_internal_time(
|
status = lib$cvts_to_internal_time(
|
||||||
&convert_operation, &sec, &time_diff);
|
&convert_operation, &sec, &time_diff);
|
||||||
# endif
|
# endif
|
||||||
#else /* default on Alpha and VAX */
|
#else // default on Alpha and VAX
|
||||||
status = lib$cvtf_to_internal_time(
|
status = lib$cvtf_to_internal_time(
|
||||||
&convert_operation, &sec, &time_diff);
|
&convert_operation, &sec, &time_diff);
|
||||||
#endif
|
#endif
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; // error
|
||||||
/* add them up */
|
// add them up
|
||||||
status = lib$add_times(
|
status = lib$add_times(
|
||||||
&time_curr,
|
&time_curr,
|
||||||
&time_diff,
|
&time_diff,
|
||||||
&time_out);
|
&time_out);
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; // error
|
||||||
}
|
}
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
/* select() */
|
// select()
|
||||||
status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
|
status = sys$qiow(0, iochan, IO$_SENSEMODE | IO$M_TYPEAHDCNT, iosb,
|
||||||
0, 0, &typeahead, 8, 0, 0, 0, 0);
|
0, 0, &typeahead, 8, 0, 0, 0, 0);
|
||||||
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
|
if (status != SS$_NORMAL || (iosb[0] & 0xFFFF) != SS$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; // error
|
||||||
|
|
||||||
if (typeahead.numchars)
|
if (typeahead.numchars)
|
||||||
return 1; /* ready to read */
|
return 1; // ready to read
|
||||||
|
|
||||||
/* there's nothing to read; what now? */
|
// there's nothing to read; what now?
|
||||||
if (msec == 0) {
|
if (msec == 0) {
|
||||||
/* immediate time-out; return impatiently */
|
// immediate time-out; return impatiently
|
||||||
return 0;
|
return 0;
|
||||||
} else if (msec < 0) {
|
} else if (msec < 0) {
|
||||||
/* no time-out; wait on indefinitely */
|
// no time-out; wait on indefinitely
|
||||||
return 1; /* fakeout to force a wait in vms_read() */
|
return 1; // fakeout to force a wait in vms_read()
|
||||||
} else {
|
} else {
|
||||||
/* time-out needs to be checked */
|
// time-out needs to be checked
|
||||||
status = sys$gettim(&time_curr);
|
status = sys$gettim(&time_curr);
|
||||||
if (status != SS$_NORMAL)
|
if (status != SS$_NORMAL)
|
||||||
return 0; /* error */
|
return 0; // error
|
||||||
|
|
||||||
status = lib$sub_times(
|
status = lib$sub_times(
|
||||||
&time_out,
|
&time_out,
|
||||||
&time_curr,
|
&time_curr,
|
||||||
&time_diff);
|
&time_diff);
|
||||||
if (status != LIB$_NORMAL)
|
if (status != LIB$_NORMAL)
|
||||||
return 0; /* error, incl. time_diff < 0 (i.e. time-out) */
|
return 0; // error, incl. time_diff < 0 (i.e. time-out)
|
||||||
|
|
||||||
/* otherwise wait some more */
|
// otherwise wait some more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
761
src/os_win32.c
761
src/os_win32.c
File diff suppressed because it is too large
Load Diff
@@ -742,6 +742,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2393,
|
||||||
/**/
|
/**/
|
||||||
2392,
|
2392,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user