1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
18
#include "apr_general.h"
19
#include "apr_pools.h"
20
#include "apr_signal.h"
21
#include "apr_atomic.h"
23
#include "apr_arch_proc_mutex.h" /* for apr_proc_mutex_unix_setup_lock() */
24
#include "apr_arch_internal_time.h"
27
APR_DECLARE(apr_status_t) apr_app_initialize(int *argc,
28
const char * const * *argv,
29
const char * const * *env)
31
/* An absolute noop. At present, only Win32 requires this stub, but it's
32
* required in order to move command arguments passed through the service
33
* control manager into the process, and it's required to fix the char*
34
* data passed in from win32 unicode into utf-8, win32's apr internal fmt.
36
return apr_initialize();
39
static int initialized = 0;
41
APR_DECLARE(apr_status_t) apr_initialize(void)
50
#if !defined(BEOS) && !defined(OS2)
51
apr_proc_mutex_unix_setup_lock();
52
apr_unix_setup_time();
55
if ((status = apr_pool_initialize()) != APR_SUCCESS)
58
if (apr_pool_create(&pool, NULL) != APR_SUCCESS) {
62
apr_pool_tag(pool, "apr_initialize");
64
/* apr_atomic_init() used to be called from here aswell.
65
* Pools rely on mutexes though, which can be backed by
66
* atomics. Due to this circular dependency
67
* apr_pool_initialize() is taking care of calling
68
* apr_atomic_init() at the correct time.
71
apr_signal_init(pool);
76
APR_DECLARE_NONSTD(void) apr_terminate(void)
86
APR_DECLARE(void) apr_terminate2(void)