summaryrefslogtreecommitdiff
path: root/ext/mysql/libmysql/my_init.c
diff options
context:
space:
mode:
authorMySQL Team <mysql@php.net>2000-08-22 09:02:46 +0000
committerMySQL Team <mysql@php.net>2000-08-22 09:02:46 +0000
commit4b1380e31c0f6e76c629611c7ba8c4e2e961a2fd (patch)
tree853d1881366287956bbfa7edf2f4edc0ae62637e /ext/mysql/libmysql/my_init.c
parentbac08af4cb97ea7e9db18a4267fb070264792f2f (diff)
downloadphp-git-4b1380e31c0f6e76c629611c7ba8c4e2e961a2fd.tar.gz
New files for MySQL 3.23.23 client library. New files are for qouting
using different character sets.
Diffstat (limited to 'ext/mysql/libmysql/my_init.c')
-rw-r--r--ext/mysql/libmysql/my_init.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/ext/mysql/libmysql/my_init.c b/ext/mysql/libmysql/my_init.c
index db45d991d3..912e80d9eb 100644
--- a/ext/mysql/libmysql/my_init.c
+++ b/ext/mysql/libmysql/my_init.c
@@ -1,10 +1,26 @@
-/* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
- This file is public domain and comes with NO WARRANTY of any kind */
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA */
#include "mysys_priv.h"
#include "my_static.h"
#include "mysys_err.h"
+#include "m_ctype.h"
#include <m_string.h>
+#include <m_ctype.h>
#ifdef THREAD
#include <my_pthread.h>
#endif
@@ -17,7 +33,7 @@
#include <my_static.c>
#include <m_ctype.h>
#endif
-#ifdef __WIN32__
+#ifdef __WIN__
#ifdef _MSC_VER
#include <locale.h>
#include <crtdbg.h>
@@ -44,7 +60,7 @@ void my_init(void)
pthread_init(); /* Must be called before DBUG_ENTER */
#endif
my_thread_global_init();
-#ifndef __WIN32__
+#ifndef __WIN__
sigfillset(&my_signals); /* signals blocked by mf_brkhant */
#endif
#endif
@@ -59,13 +75,15 @@ void my_init(void)
#ifndef VMS
if ((str=getenv("UMASK")) != 0)
my_umask=atoi(str) | 0600; /* Default creation of new files */
+ if ((str=getenv("UMASK_DIR")) != 0)
+ my_umask_dir=atoi(str) | 0700; /* Default creation of new dir's */
#endif
#ifdef VMS
init_ctype(); /* Stupid linker don't link _ctype.c */
#endif
DBUG_PRINT("exit",("home: '%s'",home_dir));
}
-#ifdef __WIN32__
+#ifdef __WIN__
win32_init_tcp_ip();
#endif
DBUG_VOID_RETURN;
@@ -94,7 +112,7 @@ void my_end(int infoflag)
#ifdef HAVE_GETRUSAGE
struct rusage rus;
if (!getrusage(RUSAGE_SELF, &rus))
- fprintf(info_file,"\nUser time %.2f, System time %.2f\nMaximum resident set size %d, Integral resident set size %d\nNon physical pagefaults %d, Physical pagefaults %d, Swaps %d\nBlocks in %d out %d, Messages in %d out %d, Signals %d\nVouluntary context switches %d, Invouluntary context switches %d\n",
+ fprintf(info_file,"\nUser time %.2f, System time %.2f\nMaximum resident set size %ld, Integral resident set size %ld\nNon physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\nBlocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\nVouluntary context switches %ld, Invouluntary context switches %ld\n",
(rus.ru_utime.tv_sec * SCALE_SEC +
rus.ru_utime.tv_usec / SCALE_USEC) / 100.0,
(rus.ru_stime.tv_sec * SCALE_SEC +
@@ -105,12 +123,13 @@ void my_end(int infoflag)
rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals,
rus.ru_nvcsw, rus.ru_nivcsw);
#endif
-#if defined(MSDOS) && !defined(__WIN32__)
+#if defined(MSDOS) && !defined(__WIN__)
fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC);
#endif
+ free_charsets();
#if defined(SAFEMALLOC)
TERMINATE(stderr); /* Give statistic on screen */
-#elif defined(__WIN32__) && defined(_MSC_VER)
+#elif defined(__WIN__) && defined(_MSC_VER)
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
@@ -129,13 +148,13 @@ void my_end(int infoflag)
my_thread_end();
my_thread_global_end();
#endif
-#ifdef __WIN32__
+#ifdef __WIN__
if (have_tcpip);
WSACleanup( );
-#endif /* __WIN32__ */
+#endif /* __WIN__ */
} /* my_end */
-#ifdef __WIN32__
+#ifdef __WIN__
/*
This code is specially for running MySQL, but it should work in