Loading...
Searching...
No Matches
Library initialization and termination

## Functions

apr_status_t | apr_initialize (void)
apr_status_t | apr_app_initialize (int *argc, char const *const **argv, char const *const **env)
void | apr_terminate (void)
void | apr_terminate2 (void)

## Detailed Description

## Function Documentation

## apr_app_initialize()

apr_status_t apr_app_initialize | ( | int * | argc,
|  | char const *const ** | argv,
|  | char const *const ** | env
| ) |  |

Set up an application with normalized argc, argv (and optionally env) in order to deal with platform-specific oddities, such as Win32 services, code pages and signals. This must be the first function called for any APR program.

Parameters

  argc | Pointer to the argc that may be corrected
  argv | Pointer to the argv that may be corrected
  env | Pointer to the env that may be corrected, may be NULL

Remarks
  See apr_initialize() if this is a library consumer of apr. Otherwise, this call is identical to apr_initialize(), and must be closed with a call to apr_terminate() at the end of program execution.

## apr_initialize()

apr_status_t apr_initialize | ( | void |  | ) |

Setup any APR internal data structures. This MUST be the first function called for any APR library. It is safe to call apr_initialize several times as long as apr_terminate() is called the same number of times.

Remarks
  See apr_app_initialize() if this is an application, rather than a library consumer of apr.

## apr_terminate()

void apr_terminate | ( | void |  | ) |

Tear down any APR internal data structures which aren't torn down automatically. apr_terminate must be called once for every call to apr_initialize() or apr_app_initialize().

Remarks
  An APR program must call this function at termination once it has stopped using APR services. The APR developers suggest using `atexit(apr_terminate)` to ensure this is called. When using APR from a language other than C that has problems with the calling convention, use apr_terminate2() instead.

See also
  apr_terminate2

## apr_terminate2()

void apr_terminate2 | ( | void |  | ) |

Tear down any APR internal data structures which aren't torn down automatically, same as apr_terminate()

Remarks
  An APR program must call either the apr_terminate() or apr_terminate2 function once it it has finished using APR services. The APR developers suggest using `atexit(apr_terminate)` to ensure this is done. apr_terminate2 exists to allow non-c language apps to tear down apr, while apr_terminate() is recommended from c language applications.