1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixes for OS2.

Fix bug in isamlog
Add argument types to function declarations.
This commit is contained in:
monty@hundin.mysql.fi
2001-08-22 01:45:07 +03:00
parent 063a1a6557
commit 733f865f54
137 changed files with 9927 additions and 852 deletions

View File

@@ -77,7 +77,7 @@ extern "C" {
#undef bcmp // Fix problem with new readline
#undef bzero
#ifdef __WIN__
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
#else
#include <readline/readline.h>
@@ -569,7 +569,7 @@ static int get_options(int argc, char **argv)
set_all_changeable_vars(changeable_vars);
while ((c=getopt_long(argc,argv,
"?ABCD:LfgGHinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
(char*) "?ABCD:LfgGHinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
long_options, &option_index)) != EOF)
{
switch(c) {
@@ -767,10 +767,20 @@ static int get_options(int argc, char **argv)
return(0);
}
#if defined(OS2)
static char* readline( char* prompt)
{
#if defined(OS2)
static char linebuffer[254];
#endif
puts( prompt);
return gets( linebuffer);
}
#endif
static int read_lines(bool execute_commands)
{
#ifdef __WIN__
#if defined( __WIN__) || defined(OS2)
char linebuffer[254];
#endif
char *line;
@@ -790,7 +800,7 @@ static int read_lines(bool execute_commands)
}
else
{
#ifdef __WIN__
#if defined( __WIN__) || defined(OS2)
if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE);
tee_fputs(glob_buffer.is_empty() ? "mysql> " :
@@ -1483,7 +1493,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
static void init_pager()
{
#ifndef __WIN__
#if !defined( __WIN__) && !defined( OS2)
if (!opt_nopager)
{
if (!(PAGER= popen(pager, "w")))
@@ -1499,7 +1509,7 @@ static void init_pager()
static void end_pager()
{
#ifndef __WIN__
#if !defined( __WIN__) && !defined( OS2)
if (!opt_nopager)
pclose(PAGER);
#endif
@@ -2337,6 +2347,9 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
va_start(args, fmt);
(void) vfprintf(file, fmt, args);
#ifdef OS2
fflush( file);
#endif
if (opt_outfile)
(void) vfprintf(OUTFILE, fmt, args);
va_end(args);
@@ -2346,6 +2359,9 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file)
{
fputs(s, file);
#ifdef OS2
fflush( file);
#endif
if (opt_outfile)
fputs(s, OUTFILE);
}
@@ -2355,6 +2371,9 @@ void tee_puts(const char *s, FILE *file)
{
fputs(s, file);
fputs("\n", file);
#ifdef OS2
fflush( file);
#endif
if (opt_outfile)
{
fputs(s, OUTFILE);
@@ -2365,11 +2384,14 @@ void tee_puts(const char *s, FILE *file)
void tee_putc(int c, FILE *file)
{
putc(c, file);
#ifdef OS2
fflush( file);
#endif
if (opt_outfile)
putc(c, OUTFILE);
}
#ifdef __WIN__
#if defined( __WIN__) || defined( OS2)
#include <time.h>
#else
#include <sys/times.h>
@@ -2379,7 +2401,7 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void)
{
#ifdef __WIN__
#if defined( __WIN__) || defined( OS2)
return clock();
#else
struct tms tms_tmp;