~ubuntu-branches/ubuntu/vivid/globus-gss-assist/vivid

« back to all changes in this revision

Viewing changes to globus_gss_assist_module.c

  • Committer: Bazaar Package Importer
  • Author(s): Mattias Ellert
  • Date: 2009-04-18 20:17:33 UTC
  • Revision ID: james.westby@ubuntu.com-20090418201733-xl4r26mgda1shx4q
Tags: upstream-4.0
ImportĀ upstreamĀ versionĀ 4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 1999-2006 University of Chicago
 
3
 * 
 
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
 
7
 * 
 
8
 * http://www.apache.org/licenses/LICENSE-2.0
 
9
 * 
 
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.
 
15
 */
 
16
 
 
17
#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
 
18
/**
 
19
 * @file globus_gsi_assist.c
 
20
 * @author Sam Lang, Sam Meder
 
21
 * 
 
22
 * $RCSfile: globus_gss_assist_module.c,v $
 
23
 * $Revision: 1.11 $
 
24
 * $Date: 2006/01/19 05:56:01 $
 
25
 */
 
26
#endif
 
27
 
 
28
#include "globus_i_gss_assist.h"
 
29
#include "globus_gsi_system_config.h"
 
30
#include "globus_callout.h"
 
31
#include "version.h"
 
32
#include <stdlib.h>
 
33
 
 
34
#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
 
35
 
 
36
static int globus_l_gsi_gss_assist_activate(void);
 
37
static int globus_l_gsi_gss_assist_deactivate(void);
 
38
 
 
39
int                               globus_i_gsi_gss_assist_debug_level = 0;
 
40
FILE *                            globus_i_gsi_gss_assist_debug_fstream = NULL;
 
41
 
 
42
globus_mutex_t                    globus_i_gsi_gss_assist_mutex;
 
43
 
 
44
/**
 
45
 * Module descriptor static initializer.
 
46
 */
 
47
globus_module_descriptor_t globus_i_gsi_gss_assist_module =
 
48
{
 
49
    "globus_gss_assist",
 
50
    globus_l_gsi_gss_assist_activate,
 
51
    globus_l_gsi_gss_assist_deactivate,
 
52
    GLOBUS_NULL,
 
53
    GLOBUS_NULL,
 
54
    &local_version
 
55
};
 
56
 
 
57
/**
 
58
 * Module activation
 
59
 */
 
60
static
 
61
int
 
62
globus_l_gsi_gss_assist_activate(void)
 
63
{
 
64
    int                                 result;
 
65
    char *                              tmp_string;
 
66
    static char *                       _function_name_ =
 
67
        "globus_l_gsi_gss_assist_activate";
 
68
 
 
69
    tmp_string = getenv("GLOBUS_GSI_GSS_ASSIST_DEBUG_LEVEL");
 
70
    if(tmp_string != GLOBUS_NULL)
 
71
    {
 
72
        globus_i_gsi_gss_assist_debug_level = atoi(tmp_string);
 
73
        if(globus_i_gsi_gss_assist_debug_level < 0)
 
74
        {
 
75
            globus_i_gsi_gss_assist_debug_level = 0;
 
76
        }
 
77
    }
 
78
 
 
79
    tmp_string = getenv("GLOBUS_GSI_GSS_ASSIST_DEBUG_FILE");
 
80
    if(tmp_string != GLOBUS_NULL)
 
81
    {
 
82
        globus_i_gsi_gss_assist_debug_fstream = fopen(tmp_string, "w");
 
83
        if(globus_i_gsi_gss_assist_debug_fstream == NULL)
 
84
        {
 
85
            result = GLOBUS_NULL;
 
86
            goto exit;
 
87
        }
 
88
    }
 
89
    else
 
90
    {
 
91
        globus_i_gsi_gss_assist_debug_fstream = stderr;
 
92
    }
 
93
 
 
94
    GLOBUS_I_GSI_GSS_ASSIST_DEBUG_ENTER;
 
95
 
 
96
    globus_module_activate(GLOBUS_COMMON_MODULE);
 
97
    globus_module_activate(GLOBUS_CALLOUT_MODULE);
 
98
    globus_module_activate(GLOBUS_GSI_SYSCONFIG_MODULE);
 
99
    globus_module_activate(GLOBUS_GSI_GSSAPI_MODULE);
 
100
 
 
101
    globus_mutex_init(&globus_i_gsi_gss_assist_mutex, NULL);
 
102
 
 
103
 exit:
 
104
    GLOBUS_I_GSI_GSS_ASSIST_DEBUG_EXIT;    
 
105
    return GLOBUS_SUCCESS;
 
106
}
 
107
 
 
108
/**
 
109
 * Module deactivation
 
110
 */
 
111
static
 
112
int
 
113
globus_l_gsi_gss_assist_deactivate(void)
 
114
{
 
115
    static char *                       _function_name_ =
 
116
        "globus_l_gsi_gssapi_deactivate";
 
117
    
 
118
    GLOBUS_I_GSI_GSS_ASSIST_DEBUG_ENTER;
 
119
    
 
120
    globus_mutex_destroy(&globus_i_gsi_gss_assist_mutex);
 
121
 
 
122
    globus_module_deactivate(GLOBUS_GSI_GSSAPI_MODULE);
 
123
    globus_module_deactivate(GLOBUS_GSI_SYSCONFIG_MODULE);
 
124
    globus_module_deactivate(GLOBUS_CALLOUT_MODULE);
 
125
    globus_module_deactivate(GLOBUS_COMMON_MODULE);
 
126
 
 
127
    GLOBUS_I_GSI_GSS_ASSIST_DEBUG_EXIT;
 
128
    return GLOBUS_SUCCESS;
 
129
}
 
130
/* globus_l_gsi_gss_assist_deactivate() */
 
131
 
 
132
#endif
 
133