Wed Apr 6 11:30:05 2011

Asterisk developer's documentation


func_module.c File Reference

Simple module check function. More...

#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/pbx.h"

Go to the source code of this file.

Functions

static void __reg_module (void)
static void __unreg_module (void)
static int ifmodule_read (struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int load_module (void)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Checks if Asterisk module is loaded in memory" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "8586c2a7d357cb591cc3a6607a8f62d1" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, }
static struct ast_module_infoast_module_info = &__mod_info
static struct ast_custom_function ifmodule_function


Detailed Description

Simple module check function.

Author:
Olle E. Johansson, Edvina.net

Definition in file func_module.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 82 of file func_module.c.

static void __unreg_module ( void   )  [static]

Definition at line 82 of file func_module.c.

static int ifmodule_read ( struct ast_channel chan,
const char *  cmd,
char *  data,
char *  buf,
size_t  len 
) [static]

Definition at line 49 of file func_module.c.

References ast_copy_string(), and ast_module_check().

00051 {
00052    char *ret = "0";
00053 
00054    *buf = '\0';
00055 
00056    if (data)
00057       if (ast_module_check(data))
00058          ret = "1";
00059 
00060    ast_copy_string(buf, ret, len);
00061 
00062    return 0;
00063 }

static int load_module ( void   )  [static]

Definition at line 77 of file func_module.c.

References ast_custom_function_register, and ifmodule_function.

00078 {
00079    return ast_custom_function_register(&ifmodule_function);
00080 }

static int unload_module ( void   )  [static]

Definition at line 72 of file func_module.c.

References ast_custom_function_unregister(), and ifmodule_function.

00073 {
00074    return ast_custom_function_unregister(&ifmodule_function);
00075 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Checks if Asterisk module is loaded in memory" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "8586c2a7d357cb591cc3a6607a8f62d1" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } [static]

Definition at line 82 of file func_module.c.

struct ast_module_info* ast_module_info = &__mod_info [static]

Definition at line 82 of file func_module.c.

struct ast_custom_function ifmodule_function [static]

Initial value:

 {
   .name = "IFMODULE",
   .read = ifmodule_read,
   .read_max = 2,
}

Definition at line 65 of file func_module.c.

Referenced by load_module(), and unload_module().


Generated on Wed Apr 6 11:30:05 2011 for Asterisk - The Open Source Telephony Project by  doxygen 1.4.7