OpenDNSSEC-enforcer  1.4.9
ksm_init_rundown.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008-2009 Nominet UK. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 /*+
28  * KsmInit_rundown.c - KSM Initialization and Rundown
29  *
30  * Description:
31  * Holds the miscellaneous administration functions.
32 -*/
33 
34 #include "ksm/ksm.h"
35 #include "ksm/kmedef.h"
36 #include "ksm/kmemsg.h"
37 #include "ksm/message.h"
38 
39 
40 /*+
41  * KsmInit - Initialization Function
42  *
43  * Description:
44  * Initialize KSM library. The tasks are:
45  *
46  * a) Register the KSM error messages.
47  * b) Initialize the database
48  *
49  * Arguments:
50  * None.
51  *
52  * Returns:
53  * int
54  * 0 for success or a KSM error code
55 -*/
56 
57 int KsmInit(void)
58 {
59  MsgInit();
60  MsgRegister(KME_MIN_VALUE, KME_MAX_VALUE, m_messages, NULL);
61  DbInit();
62 
63  return 0;
64 }
65 
66 
67 
68 /*+
69  * KsmRundown - Rundown Function
70  *
71  * Description:
72  * Runs down the KSM library and frees any resources.
73  *
74  * Arguments:
75  * None.
76  *
77  * Returns:
78  * int
79  * 0 for success or a KSM error code
80 -*/
81 
82 int KsmRundown(void)
83 {
84  DbRundown();
85  MsgRundown();
86 
87  return 0;
88 }
void DbInit(void)
int KsmRundown(void)
void MsgRegister(int min, int max, const char **message, MSG_OUTPUT_FUNCTION output)
Definition: message.c:141
void DbRundown(void)
#define KME_MAX_VALUE
Definition: kmemsg.h:7
void MsgRundown(void)
Definition: message.c:412
int KsmInit(void)
#define KME_MIN_VALUE
Definition: kmemsg.h:6
void MsgInit(void)
Definition: message.c:63