More 'static' qualifiers on module global variables.

The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming 2009-06-15 17:34:30 +00:00
parent 4379249674
commit 82fb56886e
35 changed files with 73 additions and 73 deletions

View File

@ -46,7 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *name = "cdr_manager";
static int enablecdr = 0;
struct ast_str *customfields;
static struct ast_str *customfields;
static int manager_log(struct ast_cdr *cdr);

View File

@ -48,7 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define MSGSM_SAMPLES (2*GSM_SAMPLES) /* samples in an MSGSM block */
/* begin binary data: */
char msgsm_silence[] = /* 65 */
static char msgsm_silence[] = /* 65 */
{0x48,0x17,0xD6,0x84,0x02,0x80,0x24,0x49,0x92,0x24,0x89,0x02,0x80,0x24,0x49
,0x92,0x24,0x89,0x02,0x80,0x24,0x49,0x92,0x24,0x89,0x02,0x80,0x24,0x49,0x92
,0x24,0x09,0x82,0x74,0x61,0x4D,0x28,0x00,0x48,0x92,0x24,0x49,0x92,0x28,0x00

View File

@ -163,12 +163,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
</function>
***/
enum {
enum cdr_option_flags {
OPT_RECURSIVE = (1 << 0),
OPT_UNPARSED = (1 << 1),
OPT_LAST = (1 << 2),
OPT_SKIPLOCKED = (1 << 3),
} cdr_option_flags;
};
AST_APP_OPTIONS(cdr_func_options, {
AST_APP_OPTION('l', OPT_LAST),

View File

@ -227,7 +227,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
ast_channel_unlock(chan); \
} while (0)
char *transfercapability_table[0x20] = {
static const char * const transfercapability_table[0x20] = {
"SPEECH", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
"DIGITAL", "RESTRICTED_DIGITAL", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",
"3K1AUDIO", "DIGITAL_W_TONES", "UNK", "UNK", "UNK", "UNK", "UNK", "UNK",

View File

@ -569,7 +569,7 @@ static int acf_curl2_exec(struct ast_channel *chan, const char *cmd, char *info,
return acf_curl_helper(chan, cmd, info, NULL, buf, len);
}
struct ast_custom_function acf_curl = {
static struct ast_custom_function acf_curl = {
.name = "CURL",
.synopsis = "Retrieves the contents of a URL",
.syntax = "CURL(url[,post-data])",
@ -580,7 +580,7 @@ struct ast_custom_function acf_curl = {
.read2 = acf_curl2_exec,
};
struct ast_custom_function acf_curlopt = {
static struct ast_custom_function acf_curlopt = {
.name = "CURLOPT",
.synopsis = "Set options for use with the CURL() function",
.syntax = "CURLOPT(<option>)",

View File

@ -305,12 +305,12 @@ static int acf_cut_exec2(struct ast_channel *chan, const char *cmd, char *data,
return ret;
}
struct ast_custom_function acf_sort = {
static struct ast_custom_function acf_sort = {
.name = "SORT",
.read = acf_sort_exec,
};
struct ast_custom_function acf_cut = {
static struct ast_custom_function acf_cut = {
.name = "CUT",
.read = acf_cut_exec,
.read2 = acf_cut_exec2,

View File

@ -216,7 +216,7 @@ static int function_enum(struct ast_channel *chan, const char *cmd, char *data,
return 0;
}
unsigned int enum_datastore_id;
static unsigned int enum_datastore_id;
struct enum_result_datastore {
struct enum_context *context;
@ -243,7 +243,7 @@ static void erds_destroy_cb(void *data)
erds_destroy(erds);
}
const struct ast_datastore_info enum_result_datastore_info = {
static const struct ast_datastore_info enum_result_datastore_info = {
.type = "ENUMQUERY",
.destroy = erds_destroy_cb,
};

View File

@ -84,7 +84,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
AST_LIST_HEAD_STATIC(locklist, lock_frame);
static AST_LIST_HEAD_STATIC(locklist, lock_frame);
static void lock_free(void *data);
static int unloading = 0;

View File

@ -99,10 +99,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *config = "func_odbc.conf";
enum {
enum odbc_option_flags {
OPT_ESCAPECOMMAS = (1 << 0),
OPT_MULTIROW = (1 << 1),
} odbc_option_flags;
};
struct acf_odbc_query {
AST_RWLIST_ENTRY(acf_odbc_query) list;
@ -118,7 +118,7 @@ struct acf_odbc_query {
static void odbc_datastore_free(void *data);
struct ast_datastore_info odbc_info = {
static struct ast_datastore_info odbc_info = {
.type = "FUNC_ODBC",
.destroy = odbc_datastore_free,
};
@ -135,7 +135,7 @@ struct odbc_datastore {
char names[0];
};
AST_RWLIST_HEAD_STATIC(queries, acf_odbc_query);
static AST_RWLIST_HEAD_STATIC(queries, acf_odbc_query);
static int resultcount = 0;

View File

@ -410,29 +410,29 @@ static int function_realtime_readdestroy(struct ast_channel *chan, const char *c
return 0;
}
struct ast_custom_function realtime_function = {
static struct ast_custom_function realtime_function = {
.name = "REALTIME",
.read = function_realtime_read,
.write = function_realtime_write,
};
struct ast_custom_function realtimefield_function = {
static struct ast_custom_function realtimefield_function = {
.name = "REALTIME_FIELD",
.read = realtimefield_read,
.write = function_realtime_write,
};
struct ast_custom_function realtimehash_function = {
static struct ast_custom_function realtimehash_function = {
.name = "REALTIME_HASH",
.read = realtimefield_read,
};
struct ast_custom_function realtime_store_function = {
static struct ast_custom_function realtime_store_function = {
.name = "REALTIME_STORE",
.write = function_realtime_store,
};
struct ast_custom_function realtime_destroy_function = {
static struct ast_custom_function realtime_destroy_function = {
.name = "REALTIME_DESTROY",
.read = function_realtime_readdestroy,
};

View File

@ -94,7 +94,7 @@ static int acf_vmcount_exec(struct ast_channel *chan, const char *cmd, char *arg
return 0;
}
struct ast_custom_function acf_vmcount = {
static struct ast_custom_function acf_vmcount = {
.name = "VMCOUNT",
.read = acf_vmcount_exec,
.read_max = 12,

View File

@ -60,7 +60,7 @@
* to unregister that module's calendar type (usually done in module_unload())
*/
extern struct ast_config *calendar_config;
extern struct ast_config *ast_calendar_config;
struct ast_calendar;
struct ast_calendar_event;

View File

@ -74,7 +74,7 @@ static int cli_default_perm = 1;
* it is already running. */
AST_MUTEX_DEFINE_STATIC(permsconfiglock);
/*! \brief List of users and permissions. */
AST_RWLIST_HEAD_STATIC(cli_perms, usergroup_cli_perm);
static AST_RWLIST_HEAD_STATIC(cli_perms, usergroup_cli_perm);
/*!
* \brief map a debug or verbose value to a filename

View File

@ -594,7 +594,7 @@ void ast_db_freetree(struct ast_db_entry *dbe)
}
}
struct ast_cli_entry cli_database[] = {
static struct ast_cli_entry cli_database[] = {
AST_CLI_DEFINE(handle_cli_database_show, "Shows database contents"),
AST_CLI_DEFINE(handle_cli_database_showkey, "Shows database contents"),
AST_CLI_DEFINE(handle_cli_database_get, "Gets database value"),

View File

@ -190,7 +190,7 @@ struct devstate_change {
char device[1];
};
struct {
static struct {
pthread_t thread;
struct ast_event_sub *event_sub;
ast_cond_t cond;

View File

@ -39,7 +39,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/taskprocessor.h"
#include "asterisk/astobj2.h"
struct ast_taskprocessor *event_dispatcher;
static struct ast_taskprocessor *event_dispatcher;
/*!
* \brief An event information element

View File

@ -339,17 +339,17 @@ static void *dial_features_duplicate(void *data)
memcpy(df_copy, df, sizeof(*df));
return df_copy;
}
static void dial_features_destroy(void *data)
{
}
static void dial_features_destroy(void *data)
{
struct ast_dial_features *df = data;
if (df) {
ast_free(df);
}
}
const struct ast_datastore_info dial_features_info = {
}
static const struct ast_datastore_info dial_features_info = {
.type = "dial-features",
.destroy = dial_features_destroy,
.duplicate = dial_features_duplicate,

View File

@ -1365,7 +1365,7 @@ static char *handle_cli_core_show_file_formats(struct ast_cli_entry *e, int cmd,
#undef FORMAT2
}
struct ast_cli_entry cli_file[] = {
static struct ast_cli_entry cli_file[] = {
AST_CLI_DEFINE(handle_cli_core_show_file_formats, "Displays file formats")
};

View File

@ -116,7 +116,7 @@ struct http_uri_redirect {
static AST_RWLIST_HEAD_STATIC(uri_redirects, http_uri_redirect);
const struct ast_cfhttp_methods_text {
static const struct ast_cfhttp_methods_text {
enum ast_http_method method;
const char text[];
} ast_http_methods_text[] = {

View File

@ -197,7 +197,7 @@ static char *handle_core_show_image_formats(struct ast_cli_entry *e, int cmd, st
return CLI_SUCCESS;
}
struct ast_cli_entry cli_image[] = {
static struct ast_cli_entry cli_image[] = {
AST_CLI_DEFINE(handle_core_show_image_formats, "Displays image formats")
};

View File

@ -125,7 +125,7 @@ static AST_LIST_HEAD_STATIC(reload_queue, reload_queue_item);
need to know what filename the module was loaded from while it
is being registered
*/
struct ast_module *resource_being_loaded;
static struct ast_module *resource_being_loaded;
/* XXX: should we check for duplicate resource names here? */

View File

@ -97,7 +97,7 @@ static char exec_after_rotate[256] = "";
static int filesize_reload_needed;
static unsigned int global_logmask = 0xFFFF;
enum rotatestrategy {
static enum rotatestrategy {
SEQUENTIAL = 1 << 0, /* Original method - create a new file, in order */
ROTATE = 1 << 1, /* Rotate all files, such that the oldest file has the highest suffix */
TIMESTAMP = 1 << 2, /* Append the epoch timestamp onto the end of the archived file */

View File

@ -5006,7 +5006,7 @@ static int rawman_http_callback(struct ast_tcptls_session_instance *ser, const s
return generic_http_callback(ser, method, FORMAT_RAW, &ser->remote_address, uri, get_params, headers);
}
struct ast_http_uri rawmanuri = {
static struct ast_http_uri rawmanuri = {
.description = "Raw HTTP Manager Event Interface",
.uri = "rawman",
.callback = rawman_http_callback,
@ -5014,7 +5014,7 @@ struct ast_http_uri rawmanuri = {
.key = __FILE__,
};
struct ast_http_uri manageruri = {
static struct ast_http_uri manageruri = {
.description = "HTML Manager Event Interface",
.uri = "manager",
.callback = manager_http_callback,
@ -5022,7 +5022,7 @@ struct ast_http_uri manageruri = {
.key = __FILE__,
};
struct ast_http_uri managerxmluri = {
static struct ast_http_uri managerxmluri = {
.description = "XML Manager Event Interface",
.uri = "mxml",
.callback = mxml_http_callback,
@ -5047,7 +5047,7 @@ static int auth_rawman_http_callback(struct ast_tcptls_session_instance *ser, co
return auth_http_callback(ser, method, FORMAT_RAW, &ser->remote_address, uri, get_params, headers);
}
struct ast_http_uri arawmanuri = {
static struct ast_http_uri arawmanuri = {
.description = "Raw HTTP Manager Event Interface w/Digest authentication",
.uri = "arawman",
.has_subtree = 0,
@ -5056,7 +5056,7 @@ struct ast_http_uri arawmanuri = {
.key = __FILE__,
};
struct ast_http_uri amanageruri = {
static struct ast_http_uri amanageruri = {
.description = "HTML Manager Event Interface w/Digest authentication",
.uri = "amanager",
.has_subtree = 0,
@ -5065,7 +5065,7 @@ struct ast_http_uri amanageruri = {
.key = __FILE__,
};
struct ast_http_uri amanagerxmluri = {
static struct ast_http_uri amanagerxmluri = {
.description = "XML Manager Event Interface w/Digest authentication",
.uri = "amxml",
.has_subtree = 0,
@ -5086,7 +5086,7 @@ static void purge_old_stuff(void *data)
purge_events();
}
struct ast_tls_config ami_tls_cfg;
static struct ast_tls_config ami_tls_cfg;
static struct ast_tcptls_session_args ami_desc = {
.accept_fd = -1,
.master = AST_PTHREADT_NULL,

View File

@ -1050,7 +1050,7 @@ enum syntaxtype {
};
/*! \brief Mapping between type of node and type of syntax to generate. */
struct strsyntaxtype {
static struct strsyntaxtype {
const char *type;
enum syntaxtype stxtype;
} stxtype[] = {

View File

@ -3876,7 +3876,7 @@ AST_APP_OPTIONS(dundi_query_opts, BEGIN_OPTIONS
AST_APP_OPTION('b', OPT_BYPASS_CACHE),
END_OPTIONS );
unsigned int dundi_result_id;
static unsigned int dundi_result_id;
struct dundi_result_datastore {
struct dundi_result results[MAX_RESULTS];

View File

@ -93,8 +93,8 @@ static int matchmore(struct ast_channel *chan, const char *context, const char *
static int exec(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
AST_MUTEX_DEFINE_STATIC(config_file_lock);
char *config_file_data = NULL;
long config_file_size = 0;
static char *config_file_data = NULL;
static long config_file_size = 0;
static struct ast_context *local_contexts = NULL;
static struct ast_hashtab *local_table = NULL;

View File

@ -54,9 +54,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define EXT_DATA_SIZE 256
enum {
enum option_flags {
OPTION_PATTERNS_DISABLED = (1 << 0),
} option_flags;
};
AST_APP_OPTIONS(switch_opts, {
AST_APP_OPTION('p', OPTION_PATTERNS_DISABLED),

View File

@ -187,10 +187,10 @@ struct evententry {
AST_LIST_ENTRY(evententry) list;
};
AST_LIST_HEAD_STATIC(techs, ast_calendar_tech);
static AST_LIST_HEAD_STATIC(techs, ast_calendar_tech);
AST_LIST_HEAD_NOLOCK(eventlist, evententry); /* define the type */
struct ast_config *calendar_config = NULL;
struct ast_config *ast_calendar_config;
static struct ast_calendar *unref_calendar(struct ast_calendar *cal)
{
@ -390,22 +390,22 @@ static int load_tech_calendars(struct ast_calendar_tech *tech)
const char *cat = NULL;
const char *val;
if (!calendar_config) {
if (!ast_calendar_config) {
ast_log(LOG_WARNING, "Calendar support disabled, not loading %s calendar module\n", tech->type);
return -1;
}
while ((cat = ast_category_browse(calendar_config, cat))) {
while ((cat = ast_category_browse(ast_calendar_config, cat))) {
if (!strcasecmp(cat, "general")) {
continue;
}
if (!(val = ast_variable_retrieve(calendar_config, cat, "type")) || strcasecmp(val, tech->type)) {
if (!(val = ast_variable_retrieve(ast_calendar_config, cat, "type")) || strcasecmp(val, tech->type)) {
continue;
}
/* A serious error occurred loading calendars from this tech and it should be disabled */
if (!(cal = build_calendar(calendar_config, cat, tech))) {
if (!(cal = build_calendar(ast_calendar_config, cat, tech))) {
ast_calendar_unregister(tech);
return -1;
}
@ -862,11 +862,11 @@ static int load_config(void *data)
return 0;
}
if (calendar_config) {
ast_config_destroy(calendar_config);
if (ast_calendar_config) {
ast_config_destroy(ast_calendar_config);
}
calendar_config = tmpcfg;
ast_calendar_config = tmpcfg;
return 0;
}

View File

@ -540,7 +540,7 @@ static void *caldav_load_calendar(void *void_data)
struct ast_calendar *cal = void_data;
ast_mutex_t refreshlock;
if (!(cal && calendar_config)) {
if (!(cal && ast_calendar_config)) {
ast_log(LOG_ERROR, "You must enable calendar support for res_caldav to load\n");
return NULL;
}
@ -575,7 +575,7 @@ static void *caldav_load_calendar(void *void_data)
return NULL;
}
for (v = ast_variable_browse(calendar_config, cal->name); v; v = v->next) {
for (v = ast_variable_browse(ast_calendar_config, cal->name); v; v = v->next) {
if (!strcasecmp(v->name, "url")) {
ast_string_field_set(pvt, url, v->value);
} else if (!strcasecmp(v->name, "user")) {

View File

@ -623,7 +623,7 @@ static void *exchangecal_load_calendar(void *void_data)
struct ast_calendar *cal = void_data;
ast_mutex_t refreshlock;
if (!(cal && calendar_config)) {
if (!(cal && ast_calendar_config)) {
ast_log(LOG_ERROR, "You must enable calendar support for res_exchangecal to load\n");
return NULL;
}
@ -658,7 +658,7 @@ static void *exchangecal_load_calendar(void *void_data)
return NULL;
}
for (v = ast_variable_browse(calendar_config, cal->name); v; v = v->next) {
for (v = ast_variable_browse(ast_calendar_config, cal->name); v; v = v->next) {
if (!strcasecmp(v->name, "url")) {
ast_string_field_set(pvt, url, v->value);
} else if (!strcasecmp(v->name, "user")) {

View File

@ -328,7 +328,7 @@ static void *ical_load_calendar(void *void_data)
struct ast_calendar *cal = void_data;
ast_mutex_t refreshlock;
if (!(cal && calendar_config)) {
if (!(cal && ast_calendar_config)) {
ast_log(LOG_ERROR, "You must enable calendar support for res_icalendar to load\n");
return NULL;
}
@ -362,7 +362,7 @@ static void *ical_load_calendar(void *void_data)
return NULL;
}
for (v = ast_variable_browse(calendar_config, cal->name); v; v = v->next) {
for (v = ast_variable_browse(ast_calendar_config, cal->name); v; v = v->next) {
if (!strcasecmp(v->name, "url")) {
ast_string_field_set(pvt, url, v->value);
} else if (!strcasecmp(v->name, "user")) {

View File

@ -49,7 +49,7 @@ AST_THREADSTORAGE(escapebuf_buf);
#define RES_CONFIG_PGSQL_CONF "res_pgsql.conf"
PGconn *pgsqlConn = NULL;
static PGconn *pgsqlConn = NULL;
#define MAX_DB_OPTION_SIZE 64
@ -84,7 +84,7 @@ static int pgsql_reconnect(const char *database);
static char *handle_cli_realtime_pgsql_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *handle_cli_realtime_pgsql_cache(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
enum { RQ_WARN, RQ_CREATECLOSE, RQ_CREATECHAR } requirements;
static enum { RQ_WARN, RQ_CREATECLOSE, RQ_CREATECHAR } requirements;
static struct ast_cli_entry cli_realtime[] = {
AST_CLI_DEFINE(handle_cli_realtime_pgsql_status, "Shows connection information for the PostgreSQL RealTime driver"),

View File

@ -261,8 +261,8 @@ static char *app_ajisend = "JabberSend";
static char *app_ajistatus = "JabberStatus";
struct aji_client_container clients;
struct aji_capabilities *capabilities = NULL;
static struct aji_client_container clients;
static struct aji_capabilities *capabilities = NULL;
/*! \brief Global flags, initialized to default values */
static struct ast_flags globalflags = { AJI_AUTOREGISTER };

View File

@ -180,7 +180,7 @@ struct ast_smdi_interface {
};
/*! \brief SMDI interface container. */
struct ast_smdi_interface_container {
static struct ast_smdi_interface_container {
ASTOBJ_CONTAINER_COMPONENTS(struct ast_smdi_interface);
} smdi_ifaces;

View File

@ -34,7 +34,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
int res_snmp_agentx_subagent;
int res_snmp_dont_stop;
int res_snmp_enabled;
static int res_snmp_enabled;
static pthread_t thread = AST_PTHREADT_NULL;